Integrated limits for volume preservation in stretch-to constraints.

Currently the volume variation feature in stretch constraints is
unlimited. This has to be compensated by riggers by adding scale limit
constraints, but these are unaware of the stretch orientation and can
lead to flipping. Also the stretch calculation itself is not working
properly and can lead to collapsing volume.

The patch fixes this with several modifications:
- Interpret the volume variation factor as exponent, which works better
  with large values for artistic purposes.
- Add integrated limits to the volume "bulge" factor, so secondary
  constraints for compensation become unnecessary
- Add a smoothness factor to make limits less visible.

Eventually a generic volume preservation constraint would be nicer,
because multiple constraints currently implement volume variation of
their own. This feature could actually work very nicely independent from
other constraint features.

Differential Revision: https://developer.blender.org/D826
This commit is contained in:
Lukas Tönne
2014-10-13 19:51:46 +02:00
parent af346f9918
commit f9cbb908a3
4 changed files with 95 additions and 9 deletions

View File

@@ -502,6 +502,20 @@ class ConstraintButtonsPanel():
row.operator("constraint.stretchto_reset", text="Reset")
layout.prop(con, "bulge", text="Volume Variation")
split = layout.split()
col = split.column(align=True)
col.prop(con, "use_bulge_min", text="Volume Min")
sub = col.column()
sub.active = con.use_bulge_min
sub.prop(con, "bulge_min", text="")
col = split.column(align=True)
col.prop(con, "use_bulge_max", text="Volume Max")
sub = col.column()
sub.active = con.use_bulge_max
sub.prop(con, "bulge_max", text="")
col = layout.column()
col.active = con.use_bulge_min or con.use_bulge_max
col.prop(con, "bulge_smooth", text="Smooth")
row = layout.row()
row.label(text="Volume:")