[Bf-blender-cvs] [b21e0cc] master: Fix T43872: Adding a constraint to a bone of a proxy armature resets all bones' transformations.

Bastien Montagne noreply at git.blender.org
Mon Mar 9 13:02:50 CET 2015


Commit: b21e0cccfa29ab87c0f78a4c5ff05827a3efee7f
Author: Bastien Montagne
Date:   Mon Mar 9 12:40:24 2015 +0100
Branches: master
https://developer.blender.org/rBb21e0cccfa29ab87c0f78a4c5ff05827a3efee7f

Fix T43872: Adding a constraint to a bone of a proxy armature resets all bones' transformations.

Temp hack for until new depsgraph is here. Thanks the Joshua and Sergey for their help.

===================================================================

M	source/blender/editors/object/object_constraint.c

===================================================================

diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 97d9267..231d23b 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1165,7 +1165,17 @@ void ED_object_constraint_dependency_update(Main *bmain, Object *ob)
 {
 	ED_object_constraint_update(ob);
 
-	if (ob->pose) ob->pose->flag |= POSE_RECALC;    // checks & sorts pose channels
+	if (ob->pose) {
+		ob->pose->flag |= POSE_RECALC;    /* Checks & sort pose channels. */
+		if (ob->proxy && ob->adt) {
+			/* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded
+			 * after calling `BKE_pose_rebuild()`, which causes T43872.
+			 * Note that this is a bit wide here, since we cannot be sure whether there are some locked proxy bones
+			 * or not...
+			 * XXX Temp hack until new depsgraph hopefully solves this. */
+			ob->adt->recalc |= ADT_RECALC_ANIM;
+		}
+	}
 	DAG_relations_tag_update(bmain);
 }
 
@@ -1725,6 +1735,12 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
 	
 	if ((ob->type == OB_ARMATURE) && (pchan)) {
 		ob->pose->flag |= POSE_RECALC;  /* sort pose channels */
+		if (BKE_constraints_proxylocked_owner(ob, pchan) && ob->adt) {
+			/* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded
+			 * after calling `BKE_pose_rebuild()`, which causes T43872.
+			 * XXX Temp hack until new depsgraph hopefully solves this. */
+			ob->adt->recalc |= ADT_RECALC_ANIM;
+		}
 		DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
 	}
 	else




More information about the Bf-blender-cvs mailing list