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:
authorDalai Felinto <dfelinto@gmail.com>2018-06-26 17:07:39 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-06-26 17:07:39 +0300
commitfbaf6e6fb3d2eb2f0c737b7d4713a5ea171738e6 (patch)
tree35bfa54eef6240693a13d594bb49ed7c8d33b32e /release/scripts/startup/bl_operators/wm.py
parentbba0ad903cfa407368c78b0b8480b1a729474305 (diff)
parentc07f2bc89196ea449a2875634eb85efa45733fb5 (diff)
Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overridestemp-dynamic-overrides
Diffstat (limited to 'release/scripts/startup/bl_operators/wm.py')
-rw-r--r--release/scripts/startup/bl_operators/wm.py32
1 files changed, 10 insertions, 22 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index b0a5e19d269..b6f77505410 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2456,7 +2456,7 @@ class WM_OT_studiolight_install(Operator):
for filepath in filepaths:
shutil.copy(str(filepath), str(path_studiolights))
- userpref.studio_lights_refresh()
+ userpref.studio_lights.new(str(path_studiolights.joinpath(filepath.name)), self.orientation)
# print message
msg = (
@@ -2478,34 +2478,23 @@ class WM_OT_studiolight_uninstall(Operator):
bl_label = "Uninstall Studio Light"
index = bpy.props.IntProperty()
+ def _remove_path(self, path):
+ if path.exists():
+ path.unlink()
+
def execute(self, context):
import pathlib
userpref = context.user_preferences
for studio_light in userpref.studio_lights:
if studio_light.index == self.index:
- path = pathlib.Path(studio_light.path)
- if path.exists():
- path.unlink()
- userpref.studio_lights_refresh()
- return {'FINISHED'}
+ self._remove_path(pathlib.Path(studio_light.path))
+ self._remove_path(pathlib.Path(studio_light.path_irr_cache))
+ self._remove_path(pathlib.Path(studio_light.path_sh_cache))
+ userpref.studio_lights.remove(studio_light)
+ return {'FINISHED'}
return {'CANCELLED'}
-class WM_OT_studiolight_expand(Operator):
- bl_idname = "wm.studiolight_expand"
- bl_label = "Expand Studio Light"
- index = bpy.props.IntProperty()
-
- def execute(self, context):
- userpref = context.user_preferences
- for studio_light in userpref.studio_lights:
- if studio_light.index == self.index:
- studio_light.show_expanded = not studio_light.show_expanded
- break
-
- return {'FINISHED'}
-
-
class WM_OT_studiolight_userpref_show(Operator):
"""Show light user preferences"""
bl_idname = "wm.studiolight_userpref_show"
@@ -2572,7 +2561,6 @@ classes = (
WM_OT_owner_disable,
WM_OT_owner_enable,
WM_OT_url_open,
- WM_OT_studiolight_expand,
WM_OT_studiolight_install,
WM_OT_studiolight_uninstall,
WM_OT_studiolight_userpref_show,