[Bf-blender-cvs] [52fdf5d] render-layers: layer.objects

Dalai Felinto noreply at git.blender.org
Sat Dec 3 02:44:21 CET 2016


Commit: 52fdf5d06c06ca14d893c77be3845e03cb3a0c93
Author: Dalai Felinto
Date:   Sat Dec 3 00:54:13 2016 +0100
Branches: render-layers
https://developer.blender.org/rB52fdf5d06c06ca14d893c77be3845e03cb3a0c93

layer.objects

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

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

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

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index cd69076..3124924 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2277,6 +2277,15 @@ static void rna_SceneLayer_name_set(PointerRNA *ptr, const char *value)
 	}
 }
 
+static PointerRNA rna_SceneLayer_objects_get(CollectionPropertyIterator *iter)
+{
+	ListBaseIterator *internal = &iter->internal.listbase;
+
+	/* we are actually iterating a ObjectBase list, so override get */
+	ObjectBase *base = (ObjectBase *)internal->link;
+	return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object);
+}
+
 static SceneLayer *rna_SceneLayer_new(ID *id, Scene *UNUSED(sce), const char *name)
 {
 	Scene *scene = (Scene *)id;
@@ -5256,8 +5265,14 @@ static void rna_def_scene_layer(BlenderRNA *brna)
 	RNA_def_property_struct_type(prop, "LayerCollection");
 	RNA_def_property_ui_text(prop, "Layer Collections", "");
 
+	prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
+	RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL);
+	RNA_def_property_struct_type(prop, "Object");
+	RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SceneLayer_objects_get", NULL, NULL, NULL, NULL);
+	RNA_def_property_ui_text(prop, "Objects", "All the objects in this layer");
+
 #if 0
-	/* engine, objects, active_object, active collection, ... */
+	/* engine, active_object, active collection, ... */
 #endif
 }




More information about the Bf-blender-cvs mailing list