diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-29 23:52:24 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-29 23:52:36 +0300 |
commit | 6cfed6d7756801ed2e10a82615da2b6a20f38d3b (patch) | |
tree | 7669fd5e22430b2873c3f70baf4569d5b8fffd90 /release/scripts/startup/bl_ui/space_userpref.py | |
parent | 030f9d084d453c7ea09d38fea3b5231088ff2eb9 (diff) |
UI: Minor changes to studiolight user preferences
Diffstat (limited to 'release/scripts/startup/bl_ui/space_userpref.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 261eccc7c55..041ac14602a 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1552,16 +1552,47 @@ class USERPREF_PT_studiolight_lights(Panel, StudioLightPanelMixin): col.prop(light, "smooth") col.prop(light, "direction") - def draw(self, context): + userpref = context.user_preferences + lights = self._get_lights(userpref) layout = self.layout - layout.use_property_split = True - column = layout.split() + self.draw_light_list(layout, lights) + + +class USERPREF_PT_studiolight_lights_editor(Panel): + bl_label = "Studio Lights Editor" + bl_parent_id = "USERPREF_PT_studiolight_lights" + bl_space_type = 'USER_PREFERENCES' + bl_region_type = 'WINDOW' + + def opengl_light_buttons(self, layout, light): + + col = layout.column() + col.active = light.use + + col.prop(light, "use", text="Use Light") + col.prop(light, "diffuse_color", text="Diffuse") + col.prop(light, "specular_color", text="Specular") + col.prop(light, "smooth") + col.prop(light, "direction") + + def draw(self, context): + layout = self.layout userpref = context.user_preferences system = userpref.system + row = layout.row() + row.prop(system, "edit_solid_light", toggle=True) + row.operator('wm.studiolight_new', text="Save as Studio light", icon="FILE_TICK") + + layout.separator() + + layout.use_property_split = True + column = layout.split() + column.active = system.edit_solid_light + light = system.solid_lights[0] colsplit = column.split(factor=0.85) self.opengl_light_buttons(colsplit, light) @@ -1575,15 +1606,8 @@ class USERPREF_PT_studiolight_lights(Panel, StudioLightPanelMixin): layout.separator() - layout.prop(system, "edit_solid_light") layout.prop(system, "light_ambient") - layout.operator('wm.studiolight_new', text="Save as Studio light") - - lights = self._get_lights(userpref) - - self.draw_light_list(layout, lights) - classes = ( USERPREF_HT_header, @@ -1600,6 +1624,7 @@ classes = ( USERPREF_MT_addons_online_resources, USERPREF_PT_addons, USERPREF_PT_studiolight_lights, + USERPREF_PT_studiolight_lights_editor, USERPREF_PT_studiolight_matcaps, USERPREF_PT_studiolight_world, ) |