Workbench: studiolight
authorJeroen Bakker <j.bakker@atmind.nl>
Thu, 3 May 2018 13:31:03 +0000 (15:31 +0200)
committerJeroen Bakker <j.bakker@atmind.nl>
Thu, 3 May 2018 13:31:03 +0000 (15:31 +0200)
12 files changed:
release/scripts/startup/bl_ui/space_view3d.py
source/blender/draw/CMakeLists.txt
source/blender/draw/DRW_engine.h
source/blender/draw/engines/workbench/workbench_engine.c
source/blender/draw/engines/workbench/workbench_materials.c
source/blender/draw/engines/workbench/workbench_private.h
source/blender/draw/engines/workbench/workbench_studiolight.c [new file with mode: 0644]
source/blender/editors/include/UI_icons.h
source/blender/editors/interface/CMakeLists.txt
source/blender/editors/interface/interface_icons.c
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/intern/rna_space.c

index 077af19da8cf16b408b2be0833756e57ed964143..5b06f512abeae2092c2ab4e25931182483d105a1 100644 (file)
@@ -3545,38 +3545,17 @@ class VIEW3D_PT_shading(Panel):
         col.prop(shading, "type", expand=True)
 
         if shading.type == 'SOLID':
         col.prop(shading, "type", expand=True)
 
         if shading.type == 'SOLID':
+            col.separator()
+            col.row().prop(shading, "single_color_mode", expand=True)
+
             col.separator()
             col.row().prop(shading, "light", expand=True)
             col.separator()
             col.row().prop(shading, "light", expand=True)
+            if shading.light == 'STUDIO':
+                col.row().template_icon_view(shading, "studiolight")
 
             col.separator()
 
             col.separator()
-            col.row().prop(shading, "single_color_mode", expand=True)
             col.prop(shading, "show_object_overlap")
 
             col.prop(shading, "show_object_overlap")
 
-            if shading.light == 'STUDIO':
-                # TODO: don't store these settings in the scene
-                scene = context.scene
-                props = scene.layer_properties['BLENDER_WORKBENCH']
-
-                col.separator()
-
-                sub = col.column()
-                sub.label(text="Left/Right:")
-                row = sub.row(align=True)
-                row.prop(props, "diffuse_light_x_neg", text="")
-                row.prop(props, "diffuse_light_x_pos", text="")
-
-                sub = col.column()
-                sub.label(text="Up/Down:")
-                row = sub.row(align=True)
-                row.prop(props, "diffuse_light_y_neg", text="")
-                row.prop(props, "diffuse_light_y_pos", text="")
-
-                sub = col.column()
-                sub.label(text="Front/Back:")
-                row = sub.row(align=True)
-                row.prop(props, "diffuse_light_z_neg", text="")
-                row.prop(props, "diffuse_light_z_pos", text="")
-
 
 class VIEW3D_PT_overlay(Panel):
     bl_space_type = 'VIEW_3D'
 
 class VIEW3D_PT_overlay(Panel):
     bl_space_type = 'VIEW_3D'
index 0db397433e5fb592e5d7d492f21ad8d74c3ef27d..9dadabad4b0abdcbac2342a4f772e203975696a7 100644 (file)
@@ -107,6 +107,7 @@ set(SRC
        engines/eevee/eevee_volumes.c
        engines/workbench/workbench_engine.c
        engines/workbench/workbench_materials.c
        engines/eevee/eevee_volumes.c
        engines/workbench/workbench_engine.c
        engines/workbench/workbench_materials.c
+       engines/workbench/workbench_studiolight.c
        engines/workbench/solid_mode.c
        engines/external/external_engine.c
 
        engines/workbench/solid_mode.c
        engines/external/external_engine.c
 
index e300bcad8bf8723db0718e53a556d97c78295e29..22dc116d4a67c3ac60cc3accb73b1a1d94004e0e 100644 (file)
@@ -142,4 +142,5 @@ void DRW_opengl_context_disable(void);
 
 void DRW_deferred_shader_remove(struct GPUMaterial *mat);
 
 
 void DRW_deferred_shader_remove(struct GPUMaterial *mat);
 
+unsigned int *WORKBENCH_generate_studiolight_preview(int studiolight_id, int icon_size);
 #endif /* __DRW_ENGINE_H__ */
 #endif /* __DRW_ENGINE_H__ */
index d4d14125116aff657817fa4ba221662bbc49eb42..f758918d577081345d7f61ba70a11e8756f06dac 100644 (file)
@@ -58,20 +58,7 @@ static void workbench_view_layer_settings_create(RenderEngine *UNUSED(engine), I
        BLI_assert(props &&
                   props->type == IDP_GROUP &&
                   props->subtype == IDP_GROUP_SUB_ENGINE_RENDER);
        BLI_assert(props &&
                   props->type == IDP_GROUP &&
                   props->subtype == IDP_GROUP_SUB_ENGINE_RENDER);
-
-       const float diffuse_x_pos[3] = {1.0,  0.8,   0.6};
-       const float diffuse_x_neg[3] = {1.0,  0.6,   0.6};
-       const float diffuse_y_pos[3] = {0.9,  0.9,   1.0};
-       const float diffuse_y_neg[3] = {0.05, 0.025, 0.025};
-       const float diffuse_z_pos[3] = {0.8,  0.8,   0.75};
-       const float diffuse_z_neg[3] = {1.0,  0.95,  0.8};
-
-       BKE_collection_engine_property_add_float_array(props, "diffuse_light_x_pos", diffuse_x_pos, 3);
-       BKE_collection_engine_property_add_float_array(props, "diffuse_light_x_neg", diffuse_x_neg, 3);
-       BKE_collection_engine_property_add_float_array(props, "diffuse_light_y_pos", diffuse_y_pos, 3);
-       BKE_collection_engine_property_add_float_array(props, "diffuse_light_y_neg", diffuse_y_neg, 3);
-       BKE_collection_engine_property_add_float_array(props, "diffuse_light_z_pos", diffuse_z_pos, 3);
-       BKE_collection_engine_property_add_float_array(props, "diffuse_light_z_neg", diffuse_z_neg, 3);
+       UNUSED_VARS_NDEBUG(props);
 }
 
 /* Note: currently unused, we may want to register so we can see this when debugging the view. */
 }
 
 /* Note: currently unused, we may want to register so we can see this when debugging the view. */
index b095890f8733457925c409f711eae35bec961fa8..69d983b96c7f8c80a630647e349e35e083d1d8c9 100644 (file)
@@ -257,10 +257,6 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata)
        WORKBENCH_PrivateData *wpd = stl->g_data;
        DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
        DRWShadingGroup *grp;
        WORKBENCH_PrivateData *wpd = stl->g_data;
        DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
        DRWShadingGroup *grp;
-       const DRWContextState *draw_ctx = DRW_context_state_get();
-       ViewLayer *view_layer = draw_ctx->view_layer;
-       IDProperty *props = BKE_view_layer_engine_evaluated_get(view_layer, COLLECTION_MODE_NONE, RE_engine_id_BLENDER_WORKBENCH);
-
        const DRWContextState *DCS = DRW_context_state_get();
 
        wpd->material_hash = BLI_ghash_ptr_new(__func__);
        const DRWContextState *DCS = DRW_context_state_get();
 
        wpd->material_hash = BLI_ghash_ptr_new(__func__);
@@ -269,10 +265,12 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata)
        if (v3d) {
                wpd->drawtype_lighting = v3d->drawtype_lighting;
                wpd->drawtype_options = v3d->drawtype_options;
        if (v3d) {
                wpd->drawtype_lighting = v3d->drawtype_lighting;
                wpd->drawtype_options = v3d->drawtype_options;
+               wpd->drawtype_studiolight = v3d->drawtype_studiolight;
        }
        else {
                wpd->drawtype_lighting = V3D_LIGHTING_STUDIO;
                wpd->drawtype_options = 0;
        }
        else {
                wpd->drawtype_lighting = V3D_LIGHTING_STUDIO;
                wpd->drawtype_options = 0;
+               wpd->drawtype_studiolight = 0;
        }
 
        select_deferred_shaders(wpd);
        }
 
        select_deferred_shaders(wpd);
@@ -281,12 +279,7 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata)
                WORKBENCH_UBO_World *wd = &wpd->world_data;
                UI_GetThemeColor3fv(UI_GetThemeValue(TH_SHOW_BACK_GRAD) ? TH_LOW_GRAD:TH_HIGH_GRAD, wd->background_color_low);
                UI_GetThemeColor3fv(TH_HIGH_GRAD, wd->background_color_high);
                WORKBENCH_UBO_World *wd = &wpd->world_data;
                UI_GetThemeColor3fv(UI_GetThemeValue(TH_SHOW_BACK_GRAD) ? TH_LOW_GRAD:TH_HIGH_GRAD, wd->background_color_low);
                UI_GetThemeColor3fv(TH_HIGH_GRAD, wd->background_color_high);
-               copy_v3_v3(wd->diffuse_light_x_pos, BKE_collection_engine_property_value_get_float_array(props, "diffuse_light_x_pos"));
-               copy_v3_v3(wd->diffuse_light_x_neg, BKE_collection_engine_property_value_get_float_array(props, "diffuse_light_x_neg"));
-               copy_v3_v3(wd->diffuse_light_y_pos, BKE_collection_engine_property_value_get_float_array(props, "diffuse_light_y_pos"));
-               copy_v3_v3(wd->diffuse_light_y_neg, BKE_collection_engine_property_value_get_float_array(props, "diffuse_light_y_neg"));
-               copy_v3_v3(wd->diffuse_light_z_pos, BKE_collection_engine_property_value_get_float_array(props, "diffuse_light_z_pos"));
-               copy_v3_v3(wd->diffuse_light_z_neg, BKE_collection_engine_property_value_get_float_array(props, "diffuse_light_z_neg"));
+               studiolight_update_world(wpd->drawtype_studiolight, wd);
 
                psl->composite_pass = DRW_pass_create("Composite", DRW_STATE_WRITE_COLOR);
                grp = DRW_shgroup_create(wpd->composite_sh, psl->composite_pass);
 
                psl->composite_pass = DRW_pass_create("Composite", DRW_STATE_WRITE_COLOR);
                grp = DRW_shgroup_create(wpd->composite_sh, psl->composite_pass);
index d94cce6e88043519ab20f52c9daf181b92098037..1f66fb31095547e7417cb62656c51ad3d6257501 100644 (file)
@@ -73,6 +73,7 @@ typedef struct WORKBENCH_PrivateData {
        struct GPUShader *composite_sh;
        short drawtype_lighting;
        short drawtype_options;
        struct GPUShader *composite_sh;
        short drawtype_lighting;
        short drawtype_options;
+       short drawtype_studiolight;
        struct GPUUniformBuffer *world_ubo;
        WORKBENCH_UBO_World world_data;
 } WORKBENCH_PrivateData; /* Transient data */
        struct GPUUniformBuffer *world_ubo;
        WORKBENCH_UBO_World world_data;
 } WORKBENCH_PrivateData; /* Transient data */
@@ -113,4 +114,7 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata);
 void workbench_materials_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob);
 void workbench_materials_cache_finish(WORKBENCH_Data *vedata);
 
 void workbench_materials_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob);
 void workbench_materials_cache_finish(WORKBENCH_Data *vedata);
 
+/* workbench_studiolight.c */
+void studiolight_update_world(int studio_light, WORKBENCH_UBO_World* wd);
+
 #endif
 #endif
diff --git a/source/blender/draw/engines/workbench/workbench_studiolight.c b/source/blender/draw/engines/workbench/workbench_studiolight.c
new file mode 100644 (file)
index 0000000..f93a734
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2016, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Blender Institute
+ *
+ */
+
+/** \file workbench_studiolight.h
+ *  \ingroup draw_engine
+ */
+ #include "DRW_engine.h"
+#include "workbench_private.h"
+
+#include "BLI_math.h"
+
+
+#define STUDIOLIGHT_X_POS 0
+#define STUDIOLIGHT_X_NEG 1
+#define STUDIOLIGHT_Y_POS 2
+#define STUDIOLIGHT_Y_NEG 3
+#define STUDIOLIGHT_Z_POS 4
+#define STUDIOLIGHT_Z_NEG 5
+
+const float studiolights[][6][3] = {
+       {
+               {1.0,  0.8,   0.6}, 
+               {1.0,  0.6,   0.6},
+               {0.9,  0.9,   1.0},
+               {0.05, 0.025, 0.025},
+               {0.8,  0.8,   0.75},
+               {1.0,  0.95,  0.8},
+       },
+       {
+               {0.0, 0.0, 0.0}, 
+               {0.0, 0.0, 0.0}, 
+               {0.0, 0.0, 0.0}, 
+               {0.0, 0.0, 0.0}, 
+               {0.8, 0.8, 1.0}, 
+               {0.0, 0.0, 0.0}, 
+       },
+       {
+               {0.4, 0.3, 0.8}, 
+               {0.4, 0.3, 0.8}, 
+               {0.8, 0.8, 0.2}, 
+               {0.0, 0.0, 0.0}, 
+               {0.4, 0.4, 0.8}, 
+               {0.0, 0.0, 0.0}, 
+       },
+       {
+               {0.2, 0.2, 0.0}, 
+               {0.8, 0.2, 0.0}, 
+               {0.8, 0.2, 0.0}, 
+               {0.2, 0.2, 0.0}, 
+               {0.8, 0.6, 0.4}, 
+               {0.0, 0.0, 0.0}, 
+       },
+       {
+               {0.8, 0.2, 0.0}, 
+               {0.8, 0.2, 0.0}, 
+               {0.8, 0.6, 0.0}, 
+               {0.2, 0.2, 0.0}, 
+               {1.0, 0.5, 0.0}, 
+               {0.0, 0.0, 0.0}, 
+       },
+};
+
+void studiolight_update_world(int studio_light, WORKBENCH_UBO_World* wd) {
+       copy_v3_v3(wd->diffuse_light_x_pos, studiolights[studio_light][STUDIOLIGHT_X_POS]);
+       copy_v3_v3(wd->diffuse_light_x_neg, studiolights[studio_light][STUDIOLIGHT_X_NEG]);
+       copy_v3_v3(wd->diffuse_light_y_pos, studiolights[studio_light][STUDIOLIGHT_Y_POS]);
+       copy_v3_v3(wd->diffuse_light_y_neg, studiolights[studio_light][STUDIOLIGHT_Y_NEG]);
+       copy_v3_v3(wd->diffuse_light_z_pos, studiolights[studio_light][STUDIOLIGHT_Z_POS]);
+       copy_v3_v3(wd->diffuse_light_z_neg, studiolights[studio_light][STUDIOLIGHT_Z_NEG]);
+}
+
+unsigned int *WORKBENCH_generate_studiolight_preview(int studiolight_id, int icon_size) {
+       unsigned int* rect = MEM_mallocN(icon_size * icon_size * sizeof(unsigned int), __func__);
+       int icon_center = icon_size / 2;
+       float sphere_radius = icon_center * 0.9;
+       
+       int offset = 0;
+       for (int y = 0 ; y < icon_size ; y ++) {
+               float dy = y - icon_center;
+               for (int x = 0 ; x < icon_size ; x ++) {
+                       float dx = x - icon_center;
+                       /* calculate aliasing */
+                       float alias = 0;
+                       const float alias_step = 0.2;
+                       for (float ay = dy - 0.5; ay < dy + 0.5 ; ay += alias_step) {
+                               for (float ax = dx - 0.5; ax < dx + 0.5 ; ax += alias_step) {
+                                       if (sqrt(ay*ay + ax*ax) < sphere_radius) {
+                                               alias += alias_step*alias_step;
+                                       }
+                               }
+                       }
+                       unsigned int pixelresult = 0x0;
+                       unsigned int alias_i = clamp_i(alias * 256, 0, 255);
+                       if (alias_i != 0) {
+                               /* calculate normal */
+                               unsigned int alias_mask = alias_i << 24;
+                               float normal[3];
+                               normal[0] = dx / sphere_radius;
+                               normal[1] = dy / sphere_radius;
+                               normal[2] = sqrt(-(normal[0]*normal[0])-(normal[1]*normal[1]) + 1);
+                               normalize_v3(normal);
+
+                               float color[3];
+                               mul_v3_v3fl(color, studiolights[studiolight_id][STUDIOLIGHT_X_POS], clamp_f(normal[0], 0.0, 1.0));
+                               interp_v3_v3v3(color, color, studiolights[studiolight_id][STUDIOLIGHT_X_NEG], clamp_f(-normal[0], 0.0, 1.0));
+                               interp_v3_v3v3(color, color, studiolights[studiolight_id][STUDIOLIGHT_Y_POS], clamp_f(normal[1], 0.0, 1.0));
+                               interp_v3_v3v3(color, color, studiolights[studiolight_id][STUDIOLIGHT_Y_NEG], clamp_f(-normal[1], 0.0, 1.0));
+                               interp_v3_v3v3(color, color, studiolights[studiolight_id][STUDIOLIGHT_Z_POS], clamp_f(normal[2], 0.0, 1.0));
+
+                               pixelresult = rgb_to_cpack(
+                                       linearrgb_to_srgb(color[0]),
+                                       linearrgb_to_srgb(color[1]),
+                                       linearrgb_to_srgb(color[2])
+                               ) | alias_mask;
+                       }
+                       rect[offset++] = pixelresult;
+               }
+       }
+       return rect;
+}
\ No newline at end of file
index 923038a749056c875154d24608ec8d4d2a91688a..a87f23c42a85f825dba79dfdf4e5dc858791cdaf 100644 (file)
@@ -1032,3 +1032,9 @@ DEF_VICO(COLORSET_18_VEC)
 DEF_VICO(COLORSET_19_VEC)
 DEF_VICO(COLORSET_20_VEC)
 
 DEF_VICO(COLORSET_19_VEC)
 DEF_VICO(COLORSET_20_VEC)
 
+       /* Studio lighting presets */
+DEF_ICON(STUDIOLIGHT_01)
+DEF_ICON(STUDIOLIGHT_02)
+DEF_ICON(STUDIOLIGHT_03)
+DEF_ICON(STUDIOLIGHT_04)
+DEF_ICON(STUDIOLIGHT_05)
index cc5c580ad386f8f3463ee2e9f669278eeef2acda..49fe6bfb2dc2d75d701d07e0cba626a256f9755b 100644 (file)
@@ -25,6 +25,7 @@ set(INC
        ../../blenlib
        ../../blentranslation
        ../../depsgraph
        ../../blenlib
        ../../blentranslation
        ../../depsgraph
+       ../../draw
        ../../gpu
        ../../imbuf
        ../../makesdna
        ../../gpu
        ../../imbuf
        ../../makesdna
index 9815d58764c1b4a7acd64bab1e36d6e679801f5e..12b549e8f8b34b960825e0f1651dee3c61347870 100644 (file)
@@ -67,6 +67,8 @@
 
 #include "DEG_depsgraph.h"
 
 
 #include "DEG_depsgraph.h"
 
+#include "DRW_engine.h"
+
 #include "ED_datafiles.h"
 #include "ED_keyframes_draw.h"
 #include "ED_render.h"
 #include "ED_datafiles.h"
 #include "ED_keyframes_draw.h"
 #include "ED_render.h"
@@ -491,6 +493,23 @@ static void init_matcap_icons(void)
 
 }
 
 
 }
 
+static void init_studio_light_icons(void)
+{
+       /* dynamic allocation now, tucking datatoc pointers in DrawInfo */
+#define INIT_STUDIOLIGHT_ICON(icon_id, studiolight_id)                                         \
+       {                                                                                          \
+               DrawInfo *di;                                                                          \
+               di = def_internal_icon(NULL, icon_id, 0, 0, 96, ICON_TYPE_BUFFER);                     \
+               di->data.buffer.image->rect = WORKBENCH_generate_studiolight_preview(studiolight_id, 96); \
+       } (void)0
+
+       INIT_STUDIOLIGHT_ICON(ICON_STUDIOLIGHT_01, 0);
+       INIT_STUDIOLIGHT_ICON(ICON_STUDIOLIGHT_02, 1);
+       INIT_STUDIOLIGHT_ICON(ICON_STUDIOLIGHT_03, 2);
+       INIT_STUDIOLIGHT_ICON(ICON_STUDIOLIGHT_04, 3);
+       INIT_STUDIOLIGHT_ICON(ICON_STUDIOLIGHT_05, 4);
+
+}
 static void init_internal_icons(void)
 {
 //     bTheme *btheme = UI_GetTheme();
 static void init_internal_icons(void)
 {
 //     bTheme *btheme = UI_GetTheme();
@@ -837,6 +856,7 @@ void UI_icons_init(int first_dyn_id)
        init_internal_icons();
        init_brush_icons();
        init_matcap_icons();
        init_internal_icons();
        init_brush_icons();
        init_matcap_icons();
+       init_studio_light_icons();
 #endif
 }
 
 #endif
 }
 
index 545acf667b6edff954714712c72045da93b98eb0..dd2933b04ee498a9e533bd737dbf5eb106809078 100644 (file)
@@ -258,7 +258,7 @@ typedef struct View3D {
        /* drawtype options (lighting, random) used for drawtype == OB_SOLID */
        short drawtype_lighting;
        short drawtype_options;
        /* drawtype options (lighting, random) used for drawtype == OB_SOLID */
        short drawtype_lighting;
        short drawtype_options;
-       short pad5;
+       short drawtype_studiolight;
 
        int overlays;
        int pad6;
 
        int overlays;
        int pad6;
index 8cef700e93419c2f01350a1b049f07f7f3f6eab8..6feec3558089d0c2cafd85e944c208163db2eba5 100644 (file)
@@ -2201,6 +2201,14 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna)
                {V3D_DRAWOPTION_RANDOMIZE,      "RANDOM",   0, "Random",   "Show random object color"},
                {0, NULL, 0, NULL, NULL}
        };
                {V3D_DRAWOPTION_RANDOMIZE,      "RANDOM",   0, "Random",   "Show random object color"},
                {0, NULL, 0, NULL, NULL}
        };
+       static const EnumPropertyItem studio_lighting_items[] = {
+               {0, "01", ICON_STUDIOLIGHT_01, "", ""},
+               {1, "02", ICON_STUDIOLIGHT_02, "", ""},
+               {2, "03", ICON_STUDIOLIGHT_03, "", ""},
+               {3, "04", ICON_STUDIOLIGHT_04, "", ""},
+               {4, "05", ICON_STUDIOLIGHT_05, "", ""},
+               {0, NULL, 0, NULL, NULL}
+       };
 
        srna = RNA_def_struct(brna, "View3DShading", NULL);
        RNA_def_struct_sdna(srna, "View3D");
 
        srna = RNA_def_struct(brna, "View3DShading", NULL);
        RNA_def_struct_sdna(srna, "View3D");
@@ -2228,6 +2236,12 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Object Overlap", "Show Object Overlap");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update");
 
        RNA_def_property_ui_text(prop, "Object Overlap", "Show Object Overlap");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update");
 
+       prop = RNA_def_property(srna, "studiolight", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "drawtype_studiolight");
+       RNA_def_property_enum_items(prop, studio_lighting_items);
+       RNA_def_property_ui_text(prop, "Studiolight", "Studio lighting setup");
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update");
+
        prop = RNA_def_property(srna, "single_color_mode", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, single_color_mode_items);
        RNA_def_property_enum_funcs(prop, "rna_View3DShading_single_color_mode_get",
        prop = RNA_def_property(srna, "single_color_mode", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, single_color_mode_items);
        RNA_def_property_enum_funcs(prop, "rna_View3DShading_single_color_mode_get",