Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-11-06 17:11:32 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-11-07 19:03:03 +0300
commitaadc90d0fc6734ac335f5ae488767ddb4dac307c (patch)
tree29e990b2b9f9e92170c3a21a7b6f23db16181656 /source/blender/makesrna/intern/rna_constraint.c
parent4e5768b2a7863fb2fc85eb774c281ec535e515b8 (diff)
Stretch To: implement a mode similar to Damped Track for rotation.
Most of the time Stretch To is used in actual rigs, like BlenRig or Rigify, in combination with Damped Track to handle rotation before the stretch, because it produces rotations more appropriate for organic deformation, and doesn't flip because of internal gimbal lock. The prevalence of this pattern suggests that Stretch To should support that kind of rotation directly as an option. Differential Revision: https://developer.blender.org/D6134
Diffstat (limited to 'source/blender/makesrna/intern/rna_constraint.c')
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index c0211799192..6a10074810d 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -1811,8 +1811,13 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
};
static const EnumPropertyItem plane_items[] = {
- {PLANE_X, "PLANE_X", 0, "X", "Keep X Axis"},
- {PLANE_Z, "PLANE_Z", 0, "Z", "Keep Z Axis"},
+ {PLANE_X, "PLANE_X", 0, "XZ", "Rotate around local X, then Z"},
+ {PLANE_Z, "PLANE_Z", 0, "ZX", "Rotate around local Z, then X"},
+ {SWING_Y,
+ "SWING_Y",
+ 0,
+ "Swing",
+ "Use the smallest single axis rotation, similar to Damped Track"},
{0, NULL, 0, NULL, NULL},
};
@@ -1836,7 +1841,7 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
prop = RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "plane");
RNA_def_property_enum_items(prop, plane_items);
- RNA_def_property_ui_text(prop, "Keep Axis", "Axis to maintain during stretch");
+ RNA_def_property_ui_text(prop, "Keep Axis", "The rotation type and axis order to use");
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_DISTANCE);