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-11-03 19:27:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-11-06 11:24:23 +0300
commit5af1c892695df48104337b9466cf7ded4b66e09a (patch)
tree56fed21cfa59a84297eddb8ccc6cedb5bb02a754 /source/blender/makesrna
parentdd79cd189b9b299137e45a0fff81c4f07d64ef81 (diff)
Depsgraph: Make graph to be per-scene-layer for RNA
New access is C.scene.render_layers.active.depsgraph. This will give depsgraph for a given layer. In the future there will need to be some extra context to be passed.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_layer.c15
-rw-r--r--source/blender/makesrna/intern/rna_scene.c7
2 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index d71f42fe851..1c7ce4fecf1 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -846,6 +846,14 @@ static int rna_SceneLayer_objects_selected_skip(CollectionPropertyIterator *iter
return 1;
};
+static PointerRNA rna_SceneLayer_depsgraph_get(PointerRNA *ptr)
+{
+ Scene *scene = (Scene *)ptr->id.data;
+ SceneLayer *scene_layer = (SceneLayer *)ptr->data;
+ Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, scene_layer);
+ return rna_pointer_inherit_refine(ptr, &RNA_Depsgraph, depsgraph);
+}
+
static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
SceneLayer *sl = (SceneLayer *)ptr->data;
@@ -954,6 +962,7 @@ static int rna_ViewRenderSettings_use_game_engine_get(PointerRNA *ptr)
return 0;
}
+
#else
static void rna_def_scene_collections(BlenderRNA *brna, PropertyRNA *cprop)
@@ -2162,6 +2171,12 @@ void RNA_def_scene_layer(BlenderRNA *brna)
RNA_def_function_ui_description(func,
"Update data tagged to be updated from previous access to data or operators");
+ /* Dependency Graph */
+ prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Depsgraph");
+ RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data");
+ RNA_def_property_pointer_funcs(prop, "rna_SceneLayer_depsgraph_get", NULL, NULL, NULL);
+
/* Nested Data */
/* *** Non-Animated *** */
RNA_define_animate_sdna(false);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 21159bbc240..a5645f362b9 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2175,6 +2175,7 @@ static void rna_SceneLayer_remove(
RNA_POINTER_INVALIDATE(sl_ptr);
}
}
+
#else
/* Grease Pencil Interpolation tool settings */
@@ -7324,12 +7325,6 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ColorManagedSequencerColorspaceSettings");
RNA_def_property_ui_text(prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
- /* Dependency Graph */
- prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "depsgraph_legacy");
- RNA_def_property_struct_type(prop, "Depsgraph");
- RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data");
-
/* Layer and Collections */
prop = RNA_def_property(srna, "render_layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "render_layers", NULL);