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:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_userpref.py')
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py135
1 files changed, 102 insertions, 33 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index b7d425bbc6f..4749eb7690c 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -22,6 +22,7 @@ from bpy.types import (
Header,
Menu,
Panel,
+ Operator,
)
from bpy.app.translations import pgettext_iface as iface_
from bpy.app.translations import contexts as i18n_contexts
@@ -52,7 +53,8 @@ class USERPREF_HT_header(Header):
def draw(self, context):
layout = self.layout
- layout.template_header()
+ # No need to show type selector.
+ # layout.template_header()
userpref = context.user_preferences
@@ -61,13 +63,19 @@ class USERPREF_HT_header(Header):
layout.operator_context = 'INVOKE_DEFAULT'
- if userpref.active_section == 'INPUT':
+ if userpref.active_section == 'INTERFACE':
+ layout.operator("wm.save_workspace_file")
+ elif userpref.active_section == 'INPUT':
layout.operator("wm.keyconfig_import")
layout.operator("wm.keyconfig_export")
elif userpref.active_section == 'ADDONS':
layout.operator("wm.addon_install", icon='FILESEL')
layout.operator("wm.addon_refresh", icon='FILE_REFRESH')
layout.menu("USERPREF_MT_addons_online_resources")
+ elif userpref.active_section == 'LIGHTS':
+ layout.operator('wm.studiolight_install', text="Install MatCap").orientation = 'MATCAP'
+ layout.operator('wm.studiolight_install', text="Install World HDRI").orientation = 'WORLD'
+ layout.operator('wm.studiolight_install', text="Install Camera HDRI").orientation = 'CAMERA'
elif userpref.active_section == 'THEMES':
layout.operator("ui.reset_default_theme")
layout.operator("wm.theme_install")
@@ -228,7 +236,6 @@ class USERPREF_PT_interface(Panel):
col.prop(view, "show_large_cursors")
col.prop(view, "show_view_name", text="View Name")
col.prop(view, "show_playback_fps", text="Playback FPS")
- col.prop(view, "use_global_scene")
col.prop(view, "object_origin_size")
col.separator()
@@ -256,7 +263,6 @@ class USERPREF_PT_interface(Panel):
col.prop(view, "use_mouse_depth_navigate")
col.prop(view, "use_zoom_to_mouse")
col.prop(view, "use_rotate_around_active")
- col.prop(view, "use_global_pivot")
col.prop(view, "use_camera_lock_parent")
col.separator()
@@ -288,11 +294,13 @@ class USERPREF_PT_interface(Panel):
#col.prop(view, "open_left_mouse_delay", text="Hold LMB")
#col.prop(view, "open_right_mouse_delay", text="Hold RMB")
col.prop(view, "show_manipulator")
+ # Currently not working
+ # col.prop(view, "show_manipulator_shaded")
sub = col.column()
sub.active = view.show_manipulator
sub.prop(view, "manipulator_size", text="Size")
- sub.prop(view, "manipulator_handle_size", text="Handle Size")
- sub.prop(view, "manipulator_hotspot", text="Hotspot")
+
+ col.prop(view, "show_manipulator_navigate")
col.separator()
col.separator()
@@ -477,7 +485,6 @@ class USERPREF_PT_system(Panel):
col = colsplit.column()
col.label(text="General:")
- col.prop(system, "frame_server_port")
col.prop(system, "scrollback", text="Console Scrollback")
col.separator()
@@ -517,7 +524,6 @@ class USERPREF_PT_system(Panel):
col = colsplit.column()
col.label(text="OpenGL:")
col.prop(system, "gl_clip_alpha", slider=True)
- col.prop(system, "use_mipmaps")
col.prop(system, "use_gpu_mipmap")
col.prop(system, "use_16bit_textures")
@@ -533,8 +539,6 @@ class USERPREF_PT_system(Panel):
col.separator()
- col.label(text="Window Draw Method:")
- col.prop(system, "window_draw_method", text="")
col.prop(system, "multi_sample", text="")
if sys.platform == "linux" and system.multi_sample != 'NONE':
col.label(text="Might fail for Mesh editing selection!")
@@ -542,6 +546,10 @@ class USERPREF_PT_system(Panel):
col.prop(system, "use_region_overlap")
col.separator()
+ col.label(text="Max Viewport Anti-aliasing Method")
+ col.prop(system, "max_anti_alias_method", text="")
+
+ col.separator()
col.label(text="Text Draw Options:")
col.prop(system, "use_text_antialiasing")
@@ -724,6 +732,7 @@ class USERPREF_PT_theme(Panel):
colsub.row().prop(widget_style, "item", slider=True)
colsub.row().prop(widget_style, "inner", slider=True)
colsub.row().prop(widget_style, "inner_sel", slider=True)
+ colsub.row().prop(widget_style, "roundness")
subsplit = row.split(percentage=0.85)
@@ -803,6 +812,9 @@ class USERPREF_PT_theme(Panel):
col.label(text="Tool:")
self._theme_widget_style(col, ui.wcol_tool)
+ col.label(text="Toolbar Item:")
+ self._theme_widget_style(col, ui.wcol_toolbar_item)
+
col.label(text="Radio Buttons:")
self._theme_widget_style(col, ui.wcol_radio)
@@ -851,6 +863,9 @@ class USERPREF_PT_theme(Panel):
col.label(text="List Item:")
self._theme_widget_style(col, ui.wcol_list_item)
+ col.label(text="Tab:")
+ self._theme_widget_style(col, ui.wcol_tab)
+
ui_state = theme.user_interface.wcol_state
col.label(text="State:")
@@ -865,6 +880,7 @@ class USERPREF_PT_theme(Panel):
colsub.row().prop(ui_state, "inner_anim_sel")
colsub.row().prop(ui_state, "inner_driven")
colsub.row().prop(ui_state, "inner_driven_sel")
+ colsub.row().prop(ui_state, "blend")
subsplit = row.split(percentage=0.85)
@@ -873,7 +889,8 @@ class USERPREF_PT_theme(Panel):
colsub = padding.column()
colsub.row().prop(ui_state, "inner_key")
colsub.row().prop(ui_state, "inner_key_sel")
- colsub.row().prop(ui_state, "blend")
+ colsub.row().prop(ui_state, "inner_overridden")
+ colsub.row().prop(ui_state, "inner_overridden_sel")
col.separator()
col.separator()
@@ -888,34 +905,22 @@ class USERPREF_PT_theme(Panel):
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "menu_shadow_fac")
-
- subsplit = row.split(percentage=0.85)
-
- padding = subsplit.split(percentage=0.15)
- colsub = padding.column()
- colsub = padding.column()
- colsub.row().prop(ui, "menu_shadow_width")
-
- row = col.row()
-
- subsplit = row.split(percentage=0.95)
-
- padding = subsplit.split(percentage=0.15)
- colsub = padding.column()
- colsub = padding.column()
colsub.row().prop(ui, "icon_alpha")
+ colsub.row().prop(ui, "icon_saturation")
+ colsub.row().prop(ui, "editor_outline")
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
+ colsub.row().prop(ui, "menu_shadow_width")
colsub.row().prop(ui, "widget_emboss")
col.separator()
col.separator()
- col.label("Axis Colors:")
+ col.label("Axis & Manipulator Colors:")
row = col.row()
@@ -933,9 +938,13 @@ class USERPREF_PT_theme(Panel):
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
+ colsub.row().prop(ui, "manipulator_primary")
+ colsub.row().prop(ui, "manipulator_secondary")
+ colsub.row().prop(ui, "manipulator_a")
+ colsub.row().prop(ui, "manipulator_b")
- layout.separator()
- layout.separator()
+ col.separator()
+ col.separator()
elif theme.theme_area == 'BONE_COLOR_SETS':
col = split.column()
@@ -1432,12 +1441,13 @@ class USERPREF_PT_addons(Panel):
continue
# check if addon should be visible with current filters
- if ((filter == "All") or
- (filter == info["category"]) or
- (filter == "Enabled" and is_enabled) or
+ if (
+ (filter == "All") or
+ (filter == info["category"]) or
+ (filter == "Enabled" and is_enabled) or
(filter == "Disabled" and not is_enabled) or
(filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder))))
- ):
+ ):
if search and search not in info["name"].lower():
if info["author"]:
if search not in info["author"].lower():
@@ -1571,6 +1581,62 @@ class USERPREF_PT_addons(Panel):
row.label(text=module_name, translate=False)
+class StudioLightPanelMixin():
+ bl_space_type = 'USER_PREFERENCES'
+ bl_region_type = 'WINDOW'
+
+ @classmethod
+ def poll(cls, context):
+ userpref = context.user_preferences
+ return (userpref.active_section == 'LIGHTS')
+
+ def _get_lights(self, userpref):
+ return [light for light in userpref.studio_lights if light.is_user_defined and light.orientation == self.sl_orientation]
+
+ def draw_header(self, context):
+ layout = self.layout
+ row = layout.row()
+ userpref = context.user_preferences
+ lights = self._get_lights(userpref)
+ row.label("({})".format(len(lights)))
+
+ def draw(self, context):
+ layout = self.layout
+ userpref = context.user_preferences
+ lights = self._get_lights(userpref)
+ if lights:
+ flow = layout.column_flow(4)
+ for studio_light in lights:
+ self.draw_studio_light(flow, studio_light)
+ else:
+ layout.label("No custom {} configured".format(self.bl_label))
+
+ def draw_studio_light(self, layout, studio_light):
+ box = layout.box()
+ row = box.row()
+
+ row.template_icon(layout.icon(studio_light), scale=6.0)
+ op = row.operator('wm.studiolight_uninstall', text="", icon='ZOOMOUT')
+ op.index = studio_light.index
+
+ box.label(text=studio_light.name)
+
+
+class USERPREF_PT_studiolight_matcaps(Panel, StudioLightPanelMixin):
+ bl_label = "MatCaps"
+ sl_orientation = 'MATCAP'
+
+
+class USERPREF_PT_studiolight_world(Panel, StudioLightPanelMixin):
+ bl_label = "World HDRI"
+ sl_orientation = 'WORLD'
+
+
+class USERPREF_PT_studiolight_camera(Panel, StudioLightPanelMixin):
+ bl_label = "Camera HDRI"
+ sl_orientation = 'CAMERA'
+
+
classes = (
USERPREF_HT_header,
USERPREF_PT_tabs,
@@ -1591,6 +1657,9 @@ classes = (
USERPREF_PT_input,
USERPREF_MT_addons_online_resources,
USERPREF_PT_addons,
+ USERPREF_PT_studiolight_matcaps,
+ USERPREF_PT_studiolight_world,
+ USERPREF_PT_studiolight_camera,
)
if __name__ == "__main__": # only for live edit.