[Bf-blender-cvs] [03e8202] master: Fix T46320: New Depsgraph: Auto-IK doesn't work

Sergey Sharybin noreply at git.blender.org
Thu Nov 12 16:20:47 CET 2015


Commit: 03e8202b7b1963bc856ca31b205364ddc569535a
Author: Sergey Sharybin
Date:   Thu Nov 12 20:19:30 2015 +0500
Branches: master
https://developer.blender.org/rB03e8202b7b1963bc856ca31b205364ddc569535a

Fix T46320: New Depsgraph: Auto-IK doesn't work

The issue is caused by transform tool temporary affecting on the pose
constraints, which actually changes the way how pose is to be evaluated.

This isn't ideal patch from the performance point of view, but only
limited to the new depsgraph, so we've got some time to work on partial
graph updates.

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

M	source/blender/editors/transform/CMakeLists.txt
M	source/blender/editors/transform/SConscript
M	source/blender/editors/transform/transform_conversions.c

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

diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt
index 42aa6a0..f3047c0 100644
--- a/source/blender/editors/transform/CMakeLists.txt
+++ b/source/blender/editors/transform/CMakeLists.txt
@@ -30,6 +30,7 @@ set(INC
 	../../makesdna
 	../../makesrna
 	../../windowmanager
+	../../depsgraph
 	../../../../intern/guardedalloc
 	../../../../intern/glew-mx
 )
diff --git a/source/blender/editors/transform/SConscript b/source/blender/editors/transform/SConscript
index 0f34ce5..d35c2fc 100644
--- a/source/blender/editors/transform/SConscript
+++ b/source/blender/editors/transform/SConscript
@@ -44,6 +44,7 @@ incs = [
     '../../makesdna',
     '../../makesrna',
     '../../windowmanager',
+    '../../depsgraph',
     ]
 
 defs = []
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 5898ad6..5ba11c9 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -117,6 +117,8 @@
 
 #include "RNA_access.h"
 
+#include "DEG_depsgraph.h"
+
 #include "transform.h"
 #include "bmesh.h"
 
@@ -845,6 +847,14 @@ static void pose_grab_with_ik_clear(Object *ob)
 			}
 		}
 	}
+
+#ifdef WITH_LEGACY_DEPSGRAPH
+	if (!DEG_depsgraph_use_legacy())
+#endif
+	{
+		/* TODO(sergey): Consuder doing partial update only. */
+		DAG_relations_tag_update(G.main);
+	}
 }
 
 /* adds the IK to pchan - returns if added */
@@ -995,8 +1005,16 @@ static short pose_grab_with_ik(Object *ob)
 	}
 
 	/* iTaSC needs clear for new IK constraints */
-	if (tot_ik)
+	if (tot_ik) {
 		BIK_clear_data(ob->pose);
+#ifdef WITH_LEGACY_DEPSGRAPH
+		if (!DEG_depsgraph_use_legacy())
+#endif
+		{
+			/* TODO(sergey): Consuder doing partial update only. */
+			DAG_relations_tag_update(G.main);
+		}
+	}
 
 	return (tot_ik) ? 1 : 0;
 }




More information about the Bf-blender-cvs mailing list