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:
authorCampbell Barton <ideasman42@gmail.com>2020-10-22 10:42:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-10-22 10:46:31 +0300
commitcf8642d9fac4cec7d3ee434a5403c2bbc8c5c21c (patch)
tree4f61799d2b20037173ee3c7065c2dce22d269425 /source/blender/makesrna/intern/rna_constraint.c
parent9ea345d1cf82f0770d7bb90ccac4bc6df00f9a94 (diff)
Fix T81949: Child Of Constraint can't assign inverse matrix
Caused by ad70d4b0956f5, assigning the matrix now clears the flag that would reset it.
Diffstat (limited to 'source/blender/makesrna/intern/rna_constraint.c')
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 653056e4dc1..76b419926a1 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -512,6 +512,17 @@ static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRN
rna_Constraint_update(bmain, scene, ptr);
}
+/* Update only needed so this isn't overwritten on first evaluation. */
+static void rna_Constraint_childof_inverse_matrix_update(Main *bmain,
+ Scene *scene,
+ PointerRNA *ptr)
+{
+ bConstraint *con = ptr->data;
+ bChildOfConstraint *data = con->data;
+ data->flag &= ~CHILDOF_SET_INVERSE;
+ rna_Constraint_update(bmain, scene, ptr);
+}
+
static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value)
{
bConstraint *con = ptr->data;
@@ -999,7 +1010,8 @@ static void rna_def_constraint_childof(BlenderRNA *brna)
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before");
- RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_update(
+ prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_childof_inverse_matrix_update");
RNA_define_lib_overridable(false);
}