[Bf-blender-cvs] [de95469] depsgraph_refactor: Subgraph: Workaround for dependency from self in the constraint stack

Sergey Sharybin noreply at git.blender.org
Wed Nov 12 16:35:40 CET 2014


Commit: de9546904c137cf47cf6487e94e0af3b84464bbd
Author: Sergey Sharybin
Date:   Wed Nov 12 16:35:22 2014 +0100
Branches: depsgraph_refactor
https://developer.blender.org/rBde9546904c137cf47cf6487e94e0af3b84464bbd

Subgraph: Workaround for dependency from self in the constraint stack

Once the granularity in the bones is reached we can get rid of this.

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

M	source/blender/depsgraph/intern/depsgraph_build_relations.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index f6d455e..363311a 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -406,8 +406,11 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode
 					add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
 #else
 					/* TODO(sergey): Bones evaluation currently happens in the uber data update node.. */
-					ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_GEOMETRY);
-					add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
+					/* TODO(sergey): Once granularity is reached it sohuld be possible to get rid of this check. */
+					if (&ct->tar->id != id) {
+						ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_GEOMETRY);
+						add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
+					}
 #endif
 				}
 				else if (ELEM(ct->tar->type, OB_MESH, OB_LATTICE) && (ct->subtarget[0])) {
@@ -429,8 +432,11 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode
 				else {
 					/* standard object relation */
 					// TODO: loc vs rot vs scale?
-					ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM);
-					add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
+					/* TODO(sergey): What to do if target is self? */
+					if (&ct->tar->id != id) {
+						ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM);
+						add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
+					}
 				}
 			}




More information about the Bf-blender-cvs mailing list