[Bf-blender-cvs] [fd5102d] depsgraph_refactor: Depsgraph ID Users: Order was inversed for the relationships added so far

Joshua Leung noreply at git.blender.org
Fri Jan 2 05:15:22 CET 2015


Commit: fd5102d7977068fe662764eae5d23b922e331c0d
Author: Joshua Leung
Date:   Fri Jan 2 16:40:12 2015 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rBfd5102d7977068fe662764eae5d23b922e331c0d

Depsgraph ID Users: Order was inversed for the relationships added so far

It's important to remember here that relationships here mean "B is USED by A",
so doing the intuitive "A -> B" doesn't work out correctly

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

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

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build_idusers.cpp b/source/blender/depsgraph/intern/depsgraph_build_idusers.cpp
index 6f93979..14c35dd 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_idusers.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_idusers.cpp
@@ -97,7 +97,15 @@ extern "C" {
 #include "depsgraph_intern.h"
 
 /* ******************************************** */
-/* ID User Builder */
+/* ID User Builder
+ *
+ * This builder creates links between ID datablocks to
+ * say that datablock B "uses" datablock A.
+ *
+ * NOTE: This ordering is the *opposite* of the way
+ *       we typically think of hierarchical relationships.
+ *       For example, "ob.data" becomes "obdata -> object"
+ */
 
 void DepsgraphIDUsersBuilder::build_scene(Scene *scene)
 {
@@ -129,8 +137,8 @@ void DepsgraphIDUsersBuilder::build_object(Scene *scene, Object *ob)
 {
 	ID *ob_id = &ob->id;
 	
-	/* scene -> object */
-	add_relation(&scene->id, ob_id, DEPSREL_TYPE_DATABLOCK, "Scene Object"); 
+	/* object -> scene */
+	add_relation(ob_id, &scene->id, DEPSREL_TYPE_DATABLOCK, "Scene Object");
 	
 	/* object animation */
 	//build_animdata(&ob->id);
@@ -139,8 +147,8 @@ void DepsgraphIDUsersBuilder::build_object(Scene *scene, Object *ob)
 	if (ob->data) {
 		ID *obdata_id = (ID *)ob->data;
 		
-		/* object -> obdata */
-		add_relation(ob_id, obdata_id, DEPSREL_TYPE_DATABLOCK, "Object Data");
+		/* obdata -> object */
+		add_relation(obdata_id, ob_id, DEPSREL_TYPE_DATABLOCK, "Object Data");
 		
 		/* ob data animation */
 		//build_animdata(obdata_id);




More information about the Bf-blender-cvs mailing list