[Bf-blender-cvs] [ee813d29784] temp-render-depsgraph: Depsgraph: Expose query to get view layer to RNA

Dalai Felinto noreply at git.blender.org
Fri Feb 23 23:42:02 CET 2018


Commit: ee813d29784727cb42c70daa81fe5aa83c3d12bb
Author: Dalai Felinto
Date:   Fri Feb 23 09:22:35 2018 -0300
Branches: temp-render-depsgraph
https://developer.blender.org/rBee813d29784727cb42c70daa81fe5aa83c3d12bb

Depsgraph: Expose query to get view layer to RNA

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

M	source/blender/makesrna/intern/rna_depsgraph.c

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

diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c
index e6e1c714008..77ad4f43b72 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -35,6 +35,7 @@
 #include "rna_internal.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
 
 #include "DNA_object_types.h"
 
@@ -240,6 +241,13 @@ static ID *rna_Depsgraph_evaluated_id_get(Depsgraph *depsgraph, ID *id_orig)
 	return DEG_get_evaluated_id(depsgraph, id_orig);
 }
 
+static PointerRNA rna_Depsgraph_view_layer_get(PointerRNA *ptr)
+{
+	Depsgraph *depsgraph = (Depsgraph *)ptr->data;
+	ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph);
+	return rna_pointer_inherit_refine(ptr, &RNA_ViewLayer, view_layer);
+}
+
 #else
 
 static void rna_def_depsgraph_iter(BlenderRNA *brna)
@@ -358,6 +366,11 @@ static void rna_def_depsgraph(BlenderRNA *brna)
 	                                  "rna_Depsgraph_duplis_end",
 	                                  "rna_Depsgraph_duplis_get",
 	                                  NULL, NULL, NULL, NULL);
+
+	prop = RNA_def_property(srna, "view_layer", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "ViewLayer");
+	RNA_def_property_pointer_funcs(prop, "rna_Depsgraph_view_layer_get", NULL, NULL, NULL);
+	RNA_def_property_ui_text(prop, "Scene layer", "");
 }
 
 void RNA_def_depsgraph(BlenderRNA *brna)



More information about the Bf-blender-cvs mailing list