[Bf-blender-cvs] [df07303] master: Depsgraph: Avoid unneeded relations update when canceling transform

Sergey Sharybin noreply at git.blender.org
Mon May 9 16:04:16 CEST 2016


Commit: df07303fbbe891a52beff1e2a816404dbf48d49e
Author: Sergey Sharybin
Date:   Mon May 9 16:03:07 2016 +0200
Branches: master
https://developer.blender.org/rBdf07303fbbe891a52beff1e2a816404dbf48d49e

Depsgraph: Avoid unneeded relations update when canceling transform

This was originally done for T46320 in order to re-store depsgraph state
after all the constraint modifications.

However, it relations were updated if there's any IK chain the the pose,
which is a bit too annoying.

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

M	source/blender/editors/transform/transform_conversions.c

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

diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 17f23e9..fa5e868 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -820,6 +820,7 @@ static void pose_grab_with_ik_clear(Object *ob)
 	bKinematicConstraint *data;
 	bPoseChannel *pchan;
 	bConstraint *con, *next;
+	bool need_dependency_update = false;
 
 	for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
 		/* clear all temporary lock flags */
@@ -834,6 +835,7 @@ static void pose_grab_with_ik_clear(Object *ob)
 				data = con->data;
 				if (data->flag & CONSTRAINT_IK_TEMP) {
 					/* iTaSC needs clear for removed constraints */
+					need_dependency_update = true;
 					BIK_clear_data(ob->pose);
 
 					BLI_remlink(&pchan->constraints, con);
@@ -849,10 +851,10 @@ static void pose_grab_with_ik_clear(Object *ob)
 	}
 
 #ifdef WITH_LEGACY_DEPSGRAPH
-	if (!DEG_depsgraph_use_legacy())
+	if (!DEG_depsgraph_use_legacy() && need_dependency_update)
 #endif
 	{
-		/* TODO(sergey): Consuder doing partial update only. */
+		/* TODO(sergey): Consider doing partial update only. */
 		DAG_relations_tag_update(G.main);
 	}
 }




More information about the Bf-blender-cvs mailing list