diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-29 21:54:23 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-29 23:52:36 +0300 |
commit | 844788a36cb0e1efdf3a2010ee67abcb7c46474c (patch) | |
tree | 202fbd26d4b397dbcf0eaae063e555591233542d /release/scripts/startup/bl_ui/space_userpref.py | |
parent | 8f4ab480bfe81f40b59b20780cb452736fe3af1d (diff) |
Workbench: Add back studio lighting presets
This changes a bit how the userprefs solid lights works. They are not
visible until enabling the "Edit Solid Light" checkbox. Once enabled the
current studiolight used for solid mode will be overwritten.
Once the lighting settings are tweaked, the user can click the
"Save as Studio light" button to save the current settings.
This makes it easy to create new lighting without messing the other
presets.
The studio lights are stored as ASCII files on the disk using a dead
simple custom format.
The UI/UX is not perfect and will be improved in other commits.
Also includes:
* Separate LookDev HDRI selection from Solid Lights
* Hide LookDev HDRIs from the Solid Lights selection list
Diffstat (limited to 'release/scripts/startup/bl_ui/space_userpref.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 72b07d55f70..261eccc7c55 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -47,7 +47,9 @@ class USERPREF_HT_header(Header): elif userpref.active_section == 'LIGHTS': layout.operator('wm.studiolight_install', text="Add MatCap").type = 'MATCAP' layout.operator('wm.studiolight_install', text="Add LookDev HDRI").type = 'WORLD' - layout.operator('wm.studiolight_install', text="Add Studio Light").type = 'STUDIO' + op = layout.operator('wm.studiolight_install', text="Add Studio Light") + op.type = 'STUDIO' + op.filter_glob = ".sl" elif userpref.active_section == 'THEMES': layout.operator("wm.theme_install", icon='FILEBROWSER') layout.operator("ui.reset_default_theme", icon='LOOP_BACK') @@ -1498,6 +1500,10 @@ class StudioLightPanelMixin(): layout = self.layout userpref = context.user_preferences lights = self._get_lights(userpref) + + self.draw_light_list(layout, lights) + + def draw_light_list(self, layout, lights): if lights: flow = layout.column_flow(columns=4) for studio_light in lights: @@ -1569,8 +1575,16 @@ 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, USERPREF_PT_navigation, |