Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/userpref.py
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| wm.fileselect_add(self) | wm.fileselect_add(self) | ||||
| return {'RUNNING_MODAL'} | return {'RUNNING_MODAL'} | ||||
| # ----------------------------------------------------------------------------- | # ----------------------------------------------------------------------------- | ||||
| # Studio Light Operations | # Studio Light Operations | ||||
| class PREFERENCES_OT_studiolight_install(Operator): | class PREFERENCES_OT_studiolight_install(Operator): | ||||
| """Install a user defined studio light""" | """Install a user defined light""" | ||||
| bl_idname = "preferences.studiolight_install" | bl_idname = "preferences.studiolight_install" | ||||
| bl_label = "Install Custom Studio Light" | bl_label = "Install Light" | ||||
| files: CollectionProperty( | files: CollectionProperty( | ||||
| name="File Path", | name="File Path", | ||||
| type=OperatorFileListElement, | type=OperatorFileListElement, | ||||
| ) | ) | ||||
| directory: StringProperty( | directory: StringProperty( | ||||
| subtype='DIR_PATH', | subtype='DIR_PATH', | ||||
| ) | ) | ||||
| filter_folder: BoolProperty( | filter_folder: BoolProperty( | ||||
| name="Filter folders", | name="Filter Folders", | ||||
| default=True, | default=True, | ||||
| options={'HIDDEN'}, | options={'HIDDEN'}, | ||||
| ) | ) | ||||
| filter_glob: StringProperty( | filter_glob: StringProperty( | ||||
| default="*.png;*.jpg;*.hdr;*.exr", | default="*.png;*.jpg;*.hdr;*.exr", | ||||
| options={'HIDDEN'}, | options={'HIDDEN'}, | ||||
| ) | ) | ||||
| type: EnumProperty( | type: EnumProperty( | ||||
| name="Type", | name="Type", | ||||
| items=( | items=( | ||||
| ('MATCAP', "MatCap", ""), | ('MATCAP', "MatCap", "Install custom MatCaps"), | ||||
| ('WORLD', "World", ""), | ('WORLD', "World", "Install custom HDRIs"), | ||||
| ('STUDIO', "Studio", ""), | ('STUDIO', "Studio", "Install custom Studio Lights"), | ||||
| ) | ) | ||||
| ) | ) | ||||
| def execute(self, context): | def execute(self, context): | ||||
| import os | import os | ||||
| import shutil | import shutil | ||||
| prefs = context.preferences | prefs = context.preferences | ||||
| ▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines | |||||