From cf8642d9fac4cec7d3ee434a5403c2bbc8c5c21c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 22 Oct 2020 18:42:08 +1100 Subject: Fix T81949: Child Of Constraint can't assign inverse matrix Caused by ad70d4b0956f5, assigning the matrix now clears the flag that would reset it. --- source/blender/makesrna/intern/rna_constraint.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_constraint.c') 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); } -- cgit v1.2.3