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:
authorJoshua Leung <aligorith@gmail.com>2011-11-11 04:44:48 +0400
committerJoshua Leung <aligorith@gmail.com>2011-11-11 04:44:48 +0400
commit4e5c03f06ea0834bc6575b653924a1749891bf5f (patch)
tree1739065f9366f14187cb8229b86c1b561cc2de65 /source/blender
parentcea9c518d57ff7587469ac2cc0fb3450e2ba5833 (diff)
Bugfix [#29210] ChildOf constraint Set Inverse
For Objects, Set Inverse was unreliable as the constraint didn't get reset properly before being calculated
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/object/object_constraint.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index b36416151a9..991ed0ebd51 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -700,6 +700,9 @@ static int childof_set_inverse_exec (bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
+ /* nullify inverse matrix first */
+ unit_m4(data->invmat);
+
/* try to find a pose channel */
// TODO: get from context instead?
if (ob && ob->pose)
@@ -733,18 +736,15 @@ static int childof_set_inverse_exec (bContext *C, wmOperator *op)
where_is_pose(scene, ob);
}
else if (ob) {
- Object workob;
- /* use what_does_parent to find inverse - just like for normal parenting.
- * NOTE: what_does_parent uses a static workob defined in object.c
- */
+ Object workob = {0};
+
+ /* use what_does_parent to find inverse - just like for normal parenting */
what_does_parent(scene, ob, &workob);
invert_m4_m4(data->invmat, workob.obmat);
}
- else
- unit_m4(data->invmat);
-
+
WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob);
-
+
return OPERATOR_FINISHED;
}