[Bf-blender-cvs] [0e14ee0] depsgraph_refactor: Depsgraph: Workaround-ish hook of on_visible_update to the new depsgraph

Sergey Sharybin noreply at git.blender.org
Fri Nov 21 12:33:56 CET 2014


Commit: 0e14ee0e5b4471124b8c92d475edb1b5fb701b5f
Author: Sergey Sharybin
Date:   Fri Nov 21 12:30:02 2014 +0100
Branches: depsgraph_refactor
https://developer.blender.org/rB0e14ee0e5b4471124b8c92d475edb1b5fb701b5f

Depsgraph: Workaround-ish hook of on_visible_update to the new depsgraph

It should be totally re-implemented actually, but current change is good
enough for testing purposes. So this way opening the file with new DEG
enabled from the command line wouldn't end up in some unknown state.

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

M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/depsgraph/intern/depsnode_component.cpp

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

diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 9de7341..a938c2e 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2321,7 +2321,7 @@ static void dag_current_scene_layers(Main *bmain, ListBase *lb)
 	}
 }
 
-static void dag_group_on_visible_update(Group *group)
+static void dag_group_on_visible_update(Scene *scene, Group *group)
 {
 	GroupObject *go;
 
@@ -2334,6 +2334,7 @@ static void dag_group_on_visible_update(Group *group)
 		if (ELEM(go->ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
 			go->ob->recalc |= OB_RECALC_DATA;
 			go->ob->id.flag |= LIB_DOIT;
+			DEG_id_tag_update(scene->depsgraph, &go->ob->id);
 			lib_id_recalc_tag(G.main, &go->ob->id);
 		}
 		if (go->ob->proxy_from) {
@@ -2343,7 +2344,7 @@ static void dag_group_on_visible_update(Group *group)
 		}
 
 		if (go->ob->dup_group)
-			dag_group_on_visible_update(go->ob->dup_group);
+			dag_group_on_visible_update(scene, go->ob->dup_group);
 	}
 }
 
@@ -2378,16 +2379,19 @@ void DAG_on_visible_update(Main *bmain, const bool do_time)
 			oblay = (node) ? node->lay : ob->lay;
 
 			if ((oblay & lay) & ~scene->lay_updated) {
-				if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
+				/* TODO(sergey): Why do we need armature here now but didn't need before? */
+				if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE, OB_ARMATURE)) {
 					ob->recalc |= OB_RECALC_DATA;
+					DEG_id_tag_update(scene->depsgraph, &ob->id);
 					lib_id_recalc_tag(bmain, &ob->id);
 				}
 				if (ob->proxy && (ob->proxy_group == NULL)) {
 					ob->proxy->recalc |= OB_RECALC_DATA;
+					DEG_id_tag_update(scene->depsgraph, &ob->proxy->id);
 					lib_id_recalc_tag(bmain, &ob->id);
 				}
 				if (ob->dup_group)
-					dag_group_on_visible_update(ob->dup_group);
+					dag_group_on_visible_update(scene, ob->dup_group);
 			}
 		}
 
diff --git a/source/blender/depsgraph/intern/depsnode_component.cpp b/source/blender/depsgraph/intern/depsnode_component.cpp
index 47488b1..30be003 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cpp
+++ b/source/blender/depsgraph/intern/depsnode_component.cpp
@@ -183,7 +183,10 @@ void BoneComponentDepsNode::init(const ID *id, const string &subdata)
 	ComponentDepsNode::init(id, subdata);
 	
 	/* name of component comes is bone name */
-	this->name = subdata;
+	/* TODO(sergey): This sets name to an empty string because subdata is
+	 * empty. Is it a bug?
+	 */
+	//this->name = subdata;
 	
 	/* bone-specific node data */
 	Object *ob = (Object *)id;




More information about the Bf-blender-cvs mailing list