[Bf-blender-cvs] [db04cc0f007] blender2.8: Depsgraph: Remove direct relations rebuild from set_background

Sergey Sharybin noreply at git.blender.org
Wed Oct 25 13:45:11 CEST 2017


Commit: db04cc0f00718b61e6973b8091a36b0294eb0d51
Author: Sergey Sharybin
Date:   Wed Oct 25 12:38:41 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBdb04cc0f00718b61e6973b8091a36b0294eb0d51

Depsgraph: Remove direct relations rebuild from set_background

We wouldn't really know which context we want there.

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

M	source/blender/blenkernel/intern/scene.c
M	source/blender/depsgraph/intern/depsgraph_build.cc

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

diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 7370bd8a47e..f0c727b33ac 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1106,7 +1106,6 @@ BaseLegacy *BKE_scene_base_find(Scene *scene, Object *ob)
  */
 void BKE_scene_set_background(Main *bmain, Scene *scene)
 {
-	Scene *sce;
 	BaseLegacy *base;
 	Object *ob;
 	Group *group;
@@ -1132,10 +1131,6 @@ void BKE_scene_set_background(Main *bmain, Scene *scene)
 		}
 	}
 
-	/* sort baselist for scene and sets */
-	for (sce = scene; sce; sce = sce->set)
-		DEG_scene_relations_rebuild(bmain, sce);
-
 	/* copy layers and flags from bases to objects */
 	for (base = scene->base.first; base; base = base->next) {
 		ob = base->object;
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index 9822cd154b1..05b5b73a735 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -291,6 +291,11 @@ void DEG_scene_relations_update(Main *bmain, Scene *scene)
 		/* Rebuild graph from scratch and exit. */
 		scene->depsgraph_legacy = DEG_graph_new();
 		DEG_graph_build_from_scene(scene->depsgraph_legacy, bmain, scene);
+		/* TODO(sergey): When we first create dependency graph we consider
+		 * it is first time became visible. This is true for viewports, but
+		 * will fail when render engines will start having their own graphs.
+		 */
+		DEG_graph_on_visible_update(bmain, scene->depsgraph_legacy);
 		return;
 	}
 	DEG_graph_relations_update(scene->depsgraph_legacy, bmain, scene);



More information about the Bf-blender-cvs mailing list