Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-07-10 17:47:12 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-07-10 17:47:12 +0300
commit205d750a634c2ed8d02ebc8ffbf8d653769d9a79 (patch)
tree089692d6b745b4cea7cbbb1687fbb615c3cd82f6 /source/blender
parent8692c3a83f586a3451803c820483b1a285657fcd (diff)
Depsgraph: Use explicit bmain pointer passed to layer utilities
it is not necessarily that depsgraph is built from G.bmain. This will solve issue reported in T51782.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc1
-rw-r--r--source/blender/depsgraph/intern/depsgraph.h5
-rw-r--r--source/blender/depsgraph/intern/depsgraph_query.cc5
3 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
index 43204d5fe98..4b8d5119cf6 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
@@ -75,6 +75,7 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
}
/* XXX store scene to access from DAG_get_scene */
+ m_graph->bmain = bmain;
m_graph->scene = scene;
/* scene objects */
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 9785d2f90d0..50c55bc0cf9 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -42,6 +42,7 @@
struct ID;
struct GHash;
+struct Main;
struct GSet;
struct PointerRNA;
struct PropertyRNA;
@@ -164,8 +165,8 @@ struct Depsgraph {
SpinLock lock;
// XXX: additional stuff like eval contexts, mempools for allocating nodes from, etc.
-
- Scene *scene; /* XXX: We really shouldn't do that, but it's required for shader preview */
+ Main *bmain; /* XXX: For until depsgraph has proper ownership. */
+ Scene *scene; /* XXX: We really shouldn't do that, but it's required for shader preview. */
};
} // namespace DEG
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index 0c876324210..b0ec4575fc5 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -91,8 +91,9 @@ Scene *DEG_get_scene(Depsgraph *graph)
SceneLayer *DEG_get_scene_layer(Depsgraph *graph)
{
Scene *scene = DEG_get_scene(graph);
- if (scene) {
- return BKE_scene_layer_context_active(scene);
+ if (scene != NULL) {
+ DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph);
+ return BKE_scene_layer_context_active_ex(deg_graph->bmain, scene);
}
return NULL;
}