diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-05-07 19:52:10 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-05-07 19:54:36 +0300 |
commit | 37eb1090148057e9c1ecaae6a94bf97c8e51dd61 (patch) | |
tree | cd03c47901faebd17035eccecf33e53eee4bd990 /source/blender/makesrna | |
parent | b1a77117189259cd75f99b91f88a64b810c9973a (diff) |
Spline IK: support using both original scaling and volume preservation.
Add a new option that makes the Spline IK solver apply volume
preservation on top of the original scaling, considering the
pre-IK scale of the bone as the goal volume to be preserved.
This basically works similar to the Stretch To constraint, and
allows easily rigging a stretchy chain that uniformly follows
its parent's scaling.
Since the Stretch To behavior is more familiar, the new option
is on by default for newly created Spline IK constraints.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 49c1fa779ab..ef3ea19fa57 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -2604,6 +2604,13 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) "on top of the shape and scaling of the curve itself"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + /* take original scaling of the bone into account in volume preservation */ + prop = RNA_def_property(srna, "use_original_scale", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE); + RNA_def_property_ui_text( + prop, "Use Original Scale", "Apply volume preservation over the original scaling"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + /* volume presevation for "volumetric" scale mode */ prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.f); |