[Bf-blender-cvs] [6cfed6d7756] blender2.8: UI: Minor changes to studiolight user preferences
Clément Foucault
noreply at git.blender.org
Thu Nov 29 21:52:57 CET 2018
Commit: 6cfed6d7756801ed2e10a82615da2b6a20f38d3b
Author: Clément Foucault
Date: Thu Nov 29 21:52:24 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB6cfed6d7756801ed2e10a82615da2b6a20f38d3b
UI: Minor changes to studiolight user preferences
===================================================================
M release/scripts/startup/bl_operators/wm.py
M release/scripts/startup/bl_ui/space_userpref.py
===================================================================
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 65ac0cb745b..f78b7491bdd 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2480,11 +2480,12 @@ class WM_OT_studiolight_install(Operator):
class WM_OT_studiolight_new(Operator):
+ """Create custom studio light from the studio light editor settings"""
bl_idname = 'wm.studiolight_new'
- bl_label = "Create Studio Light from default light setup"
+ bl_label = "Create custom Studio light"
filename: StringProperty(
- name="Filename",
+ name="Name",
default="StudioLight",
)
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,
)
More information about the Bf-blender-cvs
mailing list