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:
authorSybren A. Stüvel <sybren@blender.org>2022-03-07 19:27:06 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-03-10 13:34:51 +0300
commit7b62203fc794b5facda195bccea5981b54256044 (patch)
treeda3e0e6339ef4bba00b6353e3e3a46ca723fd922 /source/blender/makesrna/intern/rna_constraint.c
parent1f1dcf41d51a03150ee38f220c590f8715b11e88 (diff)
IK: make Ik chain length non-animatable
Mark the chain length of regular and spline IK constraints non-animatable. Changing the IK chain length requires a rebuild of depsgraph relations. This makes it unsuitable for animation. It's better to simply avoid having this property animatable than to allow animation but produce unstable results. Ref: T96203
Diffstat (limited to 'source/blender/makesrna/intern/rna_constraint.c')
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 114fe30acf7..63d8876ec8b 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -1209,6 +1209,9 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rootbone");
+ /* Changing the IK chain length requires a rebuild of depsgraph relations. This makes it
+ * unsuitable for animation. */
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(
prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones");
@@ -3020,6 +3023,9 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "chainlen");
+ /* Changing the IK chain length requires a rebuild of depsgraph relations. This makes it
+ * unsuitable for animation. */
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
/* TODO: this should really check the max length of the chain the constraint is attached to */
RNA_def_property_range(prop, 1, 255);
RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain");