[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41747] trunk/blender/source/blender/ editors/object/object_constraint.c: Bugfix [#29210] ChildOf constraint Set Inverse
Joshua Leung
aligorith at gmail.com
Fri Nov 11 01:44:49 CET 2011
Revision: 41747
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41747
Author: aligorith
Date: 2011-11-11 00:44:48 +0000 (Fri, 11 Nov 2011)
Log Message:
-----------
Bugfix [#29210] ChildOf constraint Set Inverse
For Objects, Set Inverse was unreliable as the constraint didn't get reset
properly before being calculated
Modified Paths:
--------------
trunk/blender/source/blender/editors/object/object_constraint.c
Modified: trunk/blender/source/blender/editors/object/object_constraint.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_constraint.c 2011-11-10 20:31:50 UTC (rev 41746)
+++ trunk/blender/source/blender/editors/object/object_constraint.c 2011-11-11 00:44:48 UTC (rev 41747)
@@ -700,6 +700,9 @@
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 @@
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;
}
More information about the Bf-blender-cvs
mailing list