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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_world.c')
-rw-r--r--source/blender/makesrna/intern/rna_world.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index 04008665342..d1049eef2c7 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -22,6 +22,7 @@
# include "MEM_guardedalloc.h"
# include "BKE_context.h"
+# include "BKE_layer.h"
# include "BKE_main.h"
# include "BKE_texture.h"
@@ -84,6 +85,21 @@ static void rna_World_use_nodes_update(bContext *C, PointerRNA *ptr)
rna_World_draw_update(bmain, scene, ptr);
}
+void rna_World_lightgroup_get(PointerRNA *ptr, char *value)
+{
+ BKE_lightgroup_membership_get(((World *)ptr->owner_id)->lightgroup, value);
+}
+
+int rna_World_lightgroup_length(PointerRNA *ptr)
+{
+ return BKE_lightgroup_membership_length(((World *)ptr->owner_id)->lightgroup);
+}
+
+void rna_World_lightgroup_set(PointerRNA *ptr, const char *value)
+{
+ BKE_lightgroup_membership_set(&((World *)ptr->owner_id)->lightgroup, value);
+}
+
#else
static void rna_def_lighting(BlenderRNA *brna)
@@ -234,6 +250,13 @@ void RNA_def_world(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the world");
RNA_def_property_update(prop, 0, "rna_World_use_nodes_update");
+ /* Lightgroup Membership */
+ prop = RNA_def_property(srna, "lightgroup", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(
+ prop, "rna_World_lightgroup_get", "rna_World_lightgroup_length", "rna_World_lightgroup_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Lightgroup", "Lightgroup that the world belongs to");
+
rna_def_lighting(brna);
rna_def_world_mist(brna);
}