2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-08-18 12:58:51 +00:00
|
|
|
import bpy
|
2018-02-01 14:58:05 +11:00
|
|
|
from bpy.types import (
|
|
|
|
Header,
|
|
|
|
Menu,
|
|
|
|
Panel,
|
|
|
|
)
|
2013-02-10 10:29:38 +00:00
|
|
|
from bpy.app.translations import pgettext_iface as iface_
|
2013-02-10 09:09:26 +00:00
|
|
|
|
2011-06-24 03:30:50 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class USERPREF_HT_header(Header):
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-11 10:49:50 +11:00
|
|
|
def draw(self, _context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2012-07-29 12:07:06 +00:00
|
|
|
|
2018-11-27 14:19:00 +01:00
|
|
|
layout.template_header()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-17 14:31:18 +01:00
|
|
|
layout.separator_spacer()
|
|
|
|
|
|
|
|
layout.operator("wm.save_userpref")
|
|
|
|
|
2010-04-17 19:05:53 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_navigation_bar(Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Preferences Navigation"
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2018-11-25 16:21:35 +01:00
|
|
|
bl_region_type = 'NAVIGATION_BAR'
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-11-25 16:21:35 +01:00
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.scale_x = 1.3
|
|
|
|
col.scale_y = 1.3
|
2018-12-21 12:47:44 +11:00
|
|
|
col.prop(prefs, "active_section", expand=True)
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_save_preferences(Panel):
|
|
|
|
bl_label = "Save Preferences"
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_region_type = 'EXECUTE'
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-17 14:31:18 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
# Hide when header is visible
|
|
|
|
for region in context.area.regions:
|
|
|
|
if region.type == 'HEADER' and region.height <= 1:
|
|
|
|
return True
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
2019-01-11 10:49:50 +11:00
|
|
|
def draw(self, _context):
|
2019-01-04 21:40:16 +01:00
|
|
|
layout = self.layout
|
|
|
|
layout.operator_context = 'EXEC_AREA'
|
|
|
|
|
|
|
|
layout.scale_x = 1.3
|
|
|
|
layout.scale_y = 1.3
|
|
|
|
|
|
|
|
layout.operator("wm.save_userpref")
|
|
|
|
|
|
|
|
|
|
|
|
class PreferencePanel(Panel):
|
|
|
|
"""
|
|
|
|
Base class for panels to center align contents with some horizontal margin.
|
|
|
|
Deriving classes need to implement a ``draw_props(context, layout)`` function.
|
|
|
|
"""
|
|
|
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
width = context.region.width
|
2019-01-17 02:01:58 +01:00
|
|
|
ui_scale = context.preferences.system.ui_scale
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False # No animation.
|
|
|
|
|
|
|
|
row = layout.row()
|
2019-01-17 02:01:58 +01:00
|
|
|
if width > (350 * ui_scale): # No horizontal margin if region is rather small.
|
2019-01-04 21:40:16 +01:00
|
|
|
row.label() # Needed so col below is centered.
|
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
col.ui_units_x = 50
|
|
|
|
|
|
|
|
# draw_props implemented by deriving classes.
|
|
|
|
self.draw_props(context, col)
|
|
|
|
|
2019-01-17 02:01:58 +01:00
|
|
|
if width > (350 * ui_scale): # No horizontal margin if region is rather small.
|
2019-01-04 21:40:16 +01:00
|
|
|
row.label() # Needed so col above is centered.
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_interface_display(PreferencePanel):
|
|
|
|
bl_label = "Display"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'INTERFACE')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(view, "ui_scale", text="Resolution Scale")
|
|
|
|
flow.prop(view, "ui_line_width", text="Line Width")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
layout.separator()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.prop(view, "show_splash", text="Splash Screen")
|
2019-01-04 21:40:16 +01:00
|
|
|
flow.prop(view, "show_tooltips")
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.prop(view, "show_tooltips_python")
|
|
|
|
flow.prop(view, "show_developer_ui")
|
2019-01-04 21:40:16 +01:00
|
|
|
flow.prop(view, "show_large_cursors")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_interface_text(PreferencePanel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Text Rendering"
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-08-14 19:27:59 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'INTERFACE')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(view, "use_text_antialiasing", text="Anti-aliasing")
|
|
|
|
sub = flow.column()
|
2019-01-04 21:40:16 +01:00
|
|
|
sub.active = view.use_text_antialiasing
|
|
|
|
sub.prop(view, "text_hinting", text="Hinting")
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(view, "font_path_ui")
|
|
|
|
flow.prop(view, "font_path_ui_mono")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_interface_translation(PreferencePanel):
|
|
|
|
bl_label = "Translation"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'INTERFACE') and bpy.app.build_options.international
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
|
|
|
|
|
|
|
self.layout.prop(view, "use_international_fonts", text="")
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.active = view.use_international_fonts
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
layout.prop(view, "language")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.prop(view, "use_translate_tooltips", text="Tooltips")
|
|
|
|
flow.prop(view, "use_translate_interface", text="Interface")
|
|
|
|
flow.prop(view, "use_translate_new_dataname", text="New Data")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_interface_editors(PreferencePanel):
|
|
|
|
bl_label = "Editors"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'INTERFACE')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
2019-01-16 18:49:31 +01:00
|
|
|
system = prefs.system
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.prop(system, "use_region_overlap")
|
|
|
|
flow.prop(view, "show_layout_ui", text="Corner Splitting")
|
|
|
|
flow.prop(view, "color_picker_type")
|
2019-02-06 21:39:06 +11:00
|
|
|
flow.row().prop(view, "header_align")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-18 11:31:26 +01:00
|
|
|
class USERPREF_PT_interface_menus(Panel):
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
bl_region_type = 'WINDOW'
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Menus"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2013-12-02 15:23:06 +01:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'INTERFACE')
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2019-01-18 11:31:26 +01:00
|
|
|
def draw(self, context):
|
|
|
|
pass
|
2018-06-25 12:58:24 +02:00
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_interface_menus_mouse_over(PreferencePanel):
|
|
|
|
bl_label = "Open on Mouse Over"
|
|
|
|
bl_parent_id = "USERPREF_PT_interface_menus"
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_header(self, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
2018-01-11 16:08:55 +11:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
self.layout.prop(view, "use_mouse_over_open", text="")
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
|
|
|
|
|
|
|
layout.active = view.use_mouse_over_open
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(view, "open_toplevel_delay", text="Top Level")
|
|
|
|
flow.prop(view, "open_sublevel_delay", text="Sub Level")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_interface_menus_pie(PreferencePanel):
|
|
|
|
bl_label = "Pie Menus"
|
|
|
|
bl_parent_id = "USERPREF_PT_interface_menus"
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(view, "pie_animation_timeout")
|
2019-01-10 15:46:44 +01:00
|
|
|
flow.prop(view, "pie_tap_timeout")
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(view, "pie_initial_timeout")
|
|
|
|
flow.prop(view, "pie_menu_radius")
|
|
|
|
flow.prop(view, "pie_menu_threshold")
|
|
|
|
flow.prop(view, "pie_menu_confirm")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
2019-01-18 11:31:26 +01:00
|
|
|
class USERPREF_PT_edit_objects(Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Objects"
|
2019-01-18 11:31:26 +01:00
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
bl_region_type = 'WINDOW'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'EDITING')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-18 11:31:26 +01:00
|
|
|
def draw(self, context):
|
|
|
|
pass
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-18 11:31:26 +01:00
|
|
|
class USERPREF_PT_edit_objects_new(PreferencePanel):
|
|
|
|
bl_label = "New Objects"
|
|
|
|
bl_parent_id = "USERPREF_PT_edit_objects"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2018-08-14 19:27:59 +02:00
|
|
|
|
2019-01-18 11:31:26 +01:00
|
|
|
flow.prop(edit, "material_link", text="Link Materials to")
|
|
|
|
flow.prop(edit, "object_align", text="Align to")
|
|
|
|
flow.prop(edit, "use_enter_edit_mode", text="Enter Edit Mode")
|
2009-12-08 19:08:35 +00:00
|
|
|
|
|
|
|
|
2019-01-18 11:31:26 +01:00
|
|
|
class USERPREF_PT_edit_objects_duplicate_data(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Duplicate Data"
|
2019-01-06 12:56:18 +01:00
|
|
|
bl_parent_id = "USERPREF_PT_edit_objects"
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(edit, "use_duplicate_action", text="Action")
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(edit, "use_duplicate_armature", text="Armature")
|
2019-01-04 21:40:16 +01:00
|
|
|
col.prop(edit, "use_duplicate_curve", text="Curve")
|
|
|
|
# col.prop(edit, "use_duplicate_fcurve", text="F-Curve")
|
2018-06-27 14:41:53 +02:00
|
|
|
col.prop(edit, "use_duplicate_light", text="Light")
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(edit, "use_duplicate_material", text="Material")
|
2019-01-04 21:40:16 +01:00
|
|
|
col.prop(edit, "use_duplicate_mesh", text="Mesh")
|
|
|
|
col.prop(edit, "use_duplicate_metaball", text="Metaball")
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(edit, "use_duplicate_particle", text="Particle")
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(edit, "use_duplicate_surface", text="Surface")
|
|
|
|
col.prop(edit, "use_duplicate_text", text="Text")
|
|
|
|
col.prop(edit, "use_duplicate_texture", text="Texture")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2019-01-18 11:31:26 +01:00
|
|
|
class USERPREF_PT_edit_cursor(PreferencePanel):
|
|
|
|
bl_label = "3D Cursor"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'EDITING')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(edit, "use_mouse_depth_cursor")
|
|
|
|
flow.prop(edit, "use_cursor_lock_adjust")
|
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_edit_gpencil(PreferencePanel):
|
|
|
|
bl_label = "Grease Pencil"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
2019-01-04 21:40:16 +01:00
|
|
|
return (prefs.active_section == 'EDITING')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
|
|
|
|
flow.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_edit_annotations(PreferencePanel):
|
|
|
|
bl_label = "Annotations"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
2019-01-04 21:40:16 +01:00
|
|
|
return (prefs.active_section == 'EDITING')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(edit, "grease_pencil_default_color", text="Default Color")
|
|
|
|
flow.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
|
|
|
|
flow.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_edit_weight_paint(PreferencePanel):
|
|
|
|
bl_label = "Weight Paint"
|
2019-01-18 11:31:26 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'EDITING')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
|
|
|
|
|
|
|
layout.prop(view, "use_weight_color_range", text="Use Custom Colors")
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.active = view.use_weight_color_range
|
|
|
|
col.template_color_ramp(view, "weight_color_range", expand=True)
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_edit_misc(PreferencePanel):
|
|
|
|
bl_label = "Miscellaneous"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2014-09-30 18:29:32 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'EDITING')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color")
|
|
|
|
flow.prop(edit, "node_margin", text="Node Auto-offset Margin")
|
2019-01-06 12:56:18 +01:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_animation_timeline(PreferencePanel):
|
|
|
|
bl_label = "Timeline"
|
2019-01-06 12:56:18 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'ANIMATION')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
2019-01-17 12:41:38 +01:00
|
|
|
edit = prefs.edit
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
flow.prop(edit, "use_negative_frames")
|
|
|
|
|
|
|
|
layout.separator()
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(view, "view2d_grid_spacing_min", text="Minimum Grid Spacing")
|
|
|
|
flow.prop(view, "timecode_style")
|
|
|
|
flow.prop(view, "view_frame_type")
|
|
|
|
if view.view_frame_type == 'SECONDS':
|
|
|
|
flow.prop(view, "view_frame_seconds")
|
|
|
|
elif view.view_frame_type == 'KEYFRAMES':
|
|
|
|
flow.prop(view, "view_frame_keyframes")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_animation_keyframes(PreferencePanel):
|
|
|
|
bl_label = "Keyframes"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'ANIMATION')
|
2019-01-06 12:56:18 +01:00
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.prop(edit, "use_visual_keying")
|
|
|
|
flow.prop(edit, "use_keyframe_insert_needed", text="Only Insert Needed")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_animation_autokey(PreferencePanel):
|
|
|
|
bl_label = "Auto-Keyframing"
|
|
|
|
bl_parent_id = "USERPREF_PT_animation_keyframes"
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(edit, "use_auto_keying_warning", text="Show Warning")
|
|
|
|
flow.prop(edit, "use_keyframe_insert_available", text="Only Insert Available")
|
2019-01-17 12:00:18 +01:00
|
|
|
flow.prop(edit, "use_auto_keying", text="Enable in New Scenes")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_animation_fcurves(PreferencePanel):
|
|
|
|
bl_label = "F-Curves"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'ANIMATION')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(edit, "fcurve_unselected_alpha", text="F-Curve Visibility")
|
|
|
|
flow.prop(edit, "keyframe_new_interpolation_type", text="Default Interpolation")
|
|
|
|
flow.prop(edit, "keyframe_new_handle_type", text="Default Handles")
|
|
|
|
flow.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_system_sound(PreferencePanel):
|
|
|
|
bl_label = "Sound"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'SYSTEM')
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
system = prefs.system
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
layout.prop(system, "audio_device", expand=False)
|
2019-01-06 21:51:07 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
sub = layout.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=False)
|
2017-09-02 15:42:29 +10:00
|
|
|
sub.active = system.audio_device not in {'NONE', 'Null'}
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(system, "audio_channels", text="Channels")
|
|
|
|
sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer")
|
|
|
|
sub.prop(system, "audio_sample_rate", text="Sample Rate")
|
|
|
|
sub.prop(system, "audio_sample_format", text="Sample Format")
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_system_cycles_devices(PreferencePanel):
|
|
|
|
bl_label = "Cycles Render Devices"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'SYSTEM')
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
|
|
|
|
col = layout.column()
|
2019-01-16 18:49:31 +01:00
|
|
|
col.use_property_split = False
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2016-11-24 11:14:45 +11:00
|
|
|
if bpy.app.build_options.cycles:
|
2018-12-21 12:47:44 +11:00
|
|
|
addon = prefs.addons.get("cycles")
|
2016-11-24 11:14:45 +11:00
|
|
|
if addon is not None:
|
|
|
|
addon.preferences.draw_impl(col, context)
|
|
|
|
del addon
|
2016-11-19 01:15:08 +01:00
|
|
|
|
2018-11-26 14:21:24 +01:00
|
|
|
# NOTE: Disabled for until GPU side of OpenSubdiv is brought back.
|
2019-01-11 10:49:50 +11:00
|
|
|
# system = prefs.system
|
2018-11-26 14:21:24 +01:00
|
|
|
# if hasattr(system, "opensubdiv_compute_type"):
|
|
|
|
# col.label(text="OpenSubdiv compute:")
|
|
|
|
# col.row().prop(system, "opensubdiv_compute_type", text="")
|
2015-07-20 16:08:06 +02:00
|
|
|
|
2013-12-31 18:09:20 -06:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_viewport_display(PreferencePanel):
|
|
|
|
bl_label = "Display"
|
2014-07-23 15:24:07 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'VIEWPORT')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
view = prefs.view
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(view, "show_object_info", text="Object Info")
|
|
|
|
flow.prop(view, "show_view_name", text="View Name")
|
|
|
|
flow.prop(view, "show_playback_fps", text="Playback FPS")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(view, "gizmo_size", text="Gizmo Size")
|
|
|
|
col.prop(view, "object_origin_size")
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
flow.separator()
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(view, "mini_axis_type", text="3D Viewport Axis")
|
|
|
|
|
|
|
|
if view.mini_axis_type == 'MINIMAL':
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = view.mini_axis_type == 'MINIMAL'
|
|
|
|
sub.prop(view, "mini_axis_size", text="Size")
|
|
|
|
sub.prop(view, "mini_axis_brightness", text="Brightness")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_viewport_quality(PreferencePanel):
|
|
|
|
bl_label = "Quality"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'VIEWPORT')
|
2013-12-31 18:09:20 -06:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
import sys
|
|
|
|
prefs = context.preferences
|
|
|
|
system = prefs.system
|
2013-12-31 18:09:20 -06:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(system, "gpu_viewport_quality")
|
|
|
|
flow.prop(system, "multi_sample", text="Multisampling")
|
|
|
|
flow.prop(system, "gpencil_multi_sample", text="Grease Pencil Multisampling")
|
2013-12-31 18:09:20 -06:00
|
|
|
|
2018-06-18 08:51:29 +02:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_viewport_textures(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Textures"
|
2013-12-31 18:09:20 -06:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'VIEWPORT')
|
2014-01-27 18:38:53 +11:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
system = prefs.system
|
2009-12-15 14:22:34 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2009-12-15 14:22:34 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(system, "gl_texture_limit", text="Limit Size")
|
|
|
|
flow.prop(system, "anisotropic_filter")
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.prop(system, "gl_clip_alpha", slider=True)
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(system, "image_draw_method", text="Image Display Method")
|
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_viewport_selection(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Selection"
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'VIEWPORT')
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
system = prefs.system
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(system, "use_select_pick_depth")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_system_memory(PreferencePanel):
|
2019-01-18 11:31:26 +01:00
|
|
|
bl_label = "Memory & Limits"
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'SYSTEM')
|
2009-12-15 14:22:34 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
system = prefs.system
|
|
|
|
edit = prefs.edit
|
2014-06-14 02:23:32 +10:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(edit, "undo_steps", text="Undo Steps")
|
|
|
|
flow.prop(edit, "undo_memory_limit", text="Undo Memory Limit")
|
|
|
|
flow.prop(edit, "use_global_undo")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(system, "memory_cache_limit", text="Sequencer Cache Limit")
|
|
|
|
flow.prop(system, "scrollback", text="Console Scrollback Lines")
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(system, "texture_time_out", text="Texture Time Out")
|
|
|
|
flow.prop(system, "texture_collection_rate", text="Garbage Collection Rate")
|
|
|
|
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2012-01-10 15:08:12 +00:00
|
|
|
class USERPREF_MT_interface_theme_presets(Menu):
|
|
|
|
bl_label = "Presets"
|
|
|
|
preset_subdir = "interface_theme"
|
|
|
|
preset_operator = "script.execute_preset"
|
|
|
|
preset_type = 'XML'
|
2013-06-07 00:27:21 +00:00
|
|
|
preset_xml_map = (
|
2018-12-21 12:47:44 +11:00
|
|
|
("preferences.themes[0]", "Theme"),
|
|
|
|
("preferences.ui_styles[0]", "ThemeStyle"),
|
2018-02-01 14:58:05 +11:00
|
|
|
)
|
2012-01-10 15:08:12 +00:00
|
|
|
draw = Menu.draw_preset
|
|
|
|
|
2018-10-10 18:11:11 +02:00
|
|
|
def reset_cb(context):
|
2018-10-08 19:19:05 +02:00
|
|
|
bpy.ops.ui.reset_default_theme()
|
|
|
|
|
2012-01-10 15:08:12 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class USERPREF_PT_theme(Panel):
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Themes"
|
2009-11-02 17:18:17 +00:00
|
|
|
bl_region_type = 'WINDOW'
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-11-02 17:18:17 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'THEMES')
|
2012-01-14 03:24:41 +00:00
|
|
|
|
2019-01-11 10:49:50 +11:00
|
|
|
def draw(self, _context):
|
2019-01-04 21:40:16 +01:00
|
|
|
layout = self.layout
|
2010-06-26 17:24:01 +00:00
|
|
|
|
2019-01-16 18:42:26 +01:00
|
|
|
split = layout.split(factor=0.6)
|
|
|
|
|
|
|
|
row = split.row(align=True)
|
|
|
|
row.menu("USERPREF_MT_interface_theme_presets", text=USERPREF_MT_interface_theme_presets.bl_label)
|
|
|
|
row.operator("wm.interface_theme_preset_add", text="", icon='ADD')
|
|
|
|
row.operator("wm.interface_theme_preset_add", text="", icon='REMOVE').remove_active = True
|
2010-06-26 22:23:54 +00:00
|
|
|
|
2019-01-16 18:42:26 +01:00
|
|
|
row = split.row(align=True)
|
2019-01-04 21:40:16 +01:00
|
|
|
row.operator("wm.theme_install", text="Install...", icon='IMPORT')
|
|
|
|
row.operator("ui.reset_default_theme", text="Reset", icon='LOOP_BACK')
|
2010-06-26 17:24:01 +00:00
|
|
|
|
2010-06-26 22:23:54 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_theme_user_interface(PreferencePanel):
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_label = "User Interface"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2010-06-26 17:24:01 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'THEMES')
|
2010-06-26 17:24:01 +00:00
|
|
|
|
2019-01-11 10:49:50 +11:00
|
|
|
def draw_header(self, _context):
|
2019-01-04 21:40:16 +01:00
|
|
|
layout = self.layout
|
2010-06-26 17:24:01 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.label(icon='WORKSPACE')
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw(self, context):
|
|
|
|
pass
|
2013-06-06 20:36:28 +00:00
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# Base class for dynamically defined widget color panels.
|
|
|
|
class PreferenceThemeWidgetColorPanel(Panel):
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
2013-06-06 20:36:28 +00:00
|
|
|
|
|
|
|
@staticmethod
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw(self, context):
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
ui = theme.user_interface
|
|
|
|
widget_style = getattr(ui, self.wcol)
|
|
|
|
layout = self.layout
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.use_property_split = True
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(widget_style, "outline")
|
|
|
|
col.prop(widget_style, "item", slider=True)
|
|
|
|
col.prop(widget_style, "inner", slider=True)
|
|
|
|
col.prop(widget_style, "inner_sel", slider=True)
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(widget_style, "text")
|
|
|
|
col.prop(widget_style, "text_sel")
|
|
|
|
col.prop(widget_style, "roundness")
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(widget_style, "show_shaded")
|
|
|
|
|
|
|
|
colsub = col.column()
|
|
|
|
colsub.active = widget_style.show_shaded
|
|
|
|
colsub.prop(widget_style, "shadetop")
|
|
|
|
colsub.prop(widget_style, "shadedown")
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'THEMES')
|
2009-11-02 17:18:17 +00:00
|
|
|
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_theme_interface_state(PreferencePanel):
|
|
|
|
bl_label = "State"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
2018-12-21 12:47:44 +11:00
|
|
|
theme = context.preferences.themes[0]
|
2019-01-04 21:40:16 +01:00
|
|
|
ui_state = theme.user_interface.wcol_state
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2012-01-10 16:30:16 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(ui_state, "inner_anim")
|
|
|
|
col.prop(ui_state, "inner_anim_sel")
|
2012-01-10 16:30:16 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(ui_state, "inner_driven")
|
|
|
|
col.prop(ui_state, "inner_driven_sel")
|
2012-01-10 16:30:16 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(ui_state, "inner_key")
|
|
|
|
col.prop(ui_state, "inner_key_sel")
|
2012-01-10 16:30:16 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(ui_state, "inner_overridden")
|
|
|
|
col.prop(ui_state, "inner_overridden_sel")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(ui_state, "inner_changed")
|
|
|
|
col.prop(ui_state, "inner_changed_sel")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(ui_state, "blend")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_theme_interface_styles(PreferencePanel):
|
|
|
|
bl_label = "Styles"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
ui = theme.user_interface
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
flow.prop(ui, "menu_shadow_fac")
|
|
|
|
flow.prop(ui, "icon_alpha")
|
|
|
|
flow.prop(ui, "icon_saturation")
|
|
|
|
flow.prop(ui, "editor_outline")
|
|
|
|
flow.prop(ui, "menu_shadow_width")
|
|
|
|
flow.prop(ui, "widget_emboss")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_theme_interface_gizmos(PreferencePanel):
|
|
|
|
bl_label = "Axis & Gizmo Colors"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
ui = theme.user_interface
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=True, align=False)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(ui, "axis_x", text="Axis X")
|
|
|
|
col.prop(ui, "axis_y", text="Y")
|
|
|
|
col.prop(ui, "axis_z", text="Z")
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(ui, "gizmo_primary")
|
|
|
|
col.prop(ui, "gizmo_secondary")
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(ui, "gizmo_a")
|
|
|
|
col.prop(ui, "gizmo_b")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_theme_interface_icons(PreferencePanel):
|
|
|
|
bl_label = "Icon Colors"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
ui = theme.user_interface
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
flow.prop(ui, "icon_collection")
|
|
|
|
flow.prop(ui, "icon_object")
|
|
|
|
flow.prop(ui, "icon_object_data")
|
|
|
|
flow.prop(ui, "icon_modifier")
|
|
|
|
flow.prop(ui, "icon_shading")
|
2018-04-26 21:17:33 +02:00
|
|
|
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_theme_text_style(PreferencePanel):
|
|
|
|
bl_label = "Text Style"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'THEMES')
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@staticmethod
|
|
|
|
def _ui_font_style(layout, font_style):
|
|
|
|
layout.use_property_split = True
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column()
|
|
|
|
col.row().prop(font_style, "font_kerning_style", expand=True)
|
|
|
|
col.prop(font_style, "points")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(font_style, "shadow_offset_x", text="Shadow Offset X")
|
|
|
|
col.prop(font_style, "shadow_offset_y", text="Y")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(font_style, "shadow")
|
|
|
|
col.prop(font_style, "shadow_alpha")
|
|
|
|
col.prop(font_style, "shadow_value")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-11 10:49:50 +11:00
|
|
|
def draw_header(self, _context):
|
2019-01-04 21:40:16 +01:00
|
|
|
layout = self.layout
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.label(icon='FONTPREVIEW')
|
Pie Menus C code backend.
This commit merges the code in the pie-menu branch.
As per decisions taken the last few days, there are no pie menus
included and there will be an official add-on including overrides of
some keys with pie menus. However, people will now be able to use the
new code in python.
Full Documentation is in http://wiki.blender.org/index.php/Dev:Ref/
Thanks:
Campbell Barton, Dalai Felinto and Ton Roosendaal for the code review
and design comments
Jonathan Williamson, Pawel Lyczkowski, Pablo Vazquez among others for
suggestions during the development.
Special Thanks to Sean Olson, for his support, suggestions, testing and
merciless bugging so that I would finish the pie menu code. Without him
we wouldn't be here. Also to the rest of the developers of the original
python add-on, Patrick Moore and Dan Eicher and finally to Matt Ebb, who
did the research and first implementation and whose code I used to get
started.
2014-08-11 10:39:59 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
style = context.preferences.ui_styles[0]
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.label(text="Panel Title")
|
|
|
|
self._ui_font_style(layout, style.panel_title)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.separator()
|
2012-03-19 22:29:16 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.label(text="Widget")
|
|
|
|
self._ui_font_style(layout, style.widget)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.separator()
|
2010-06-09 19:12:03 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.label(text="Widget Label")
|
|
|
|
self._ui_font_style(layout, style.widget_label)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_PT_theme_bone_color_sets(PreferencePanel):
|
|
|
|
bl_label = "Bone Color Sets"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 17:14:03 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'THEMES')
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2019-01-11 10:49:50 +11:00
|
|
|
def draw_header(self, _context):
|
2019-01-04 21:40:16 +01:00
|
|
|
layout = self.layout
|
2010-06-26 17:06:55 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.label(icon='COLOR')
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
theme = context.preferences.themes[0]
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.use_property_split = True
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
for i, ui in enumerate(theme.bone_color_sets, 1):
|
|
|
|
layout.label(text=iface_(f"Color Set {i:d}"), translate=False)
|
2010-06-26 17:06:55 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2011-11-19 20:57:53 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
flow.prop(ui, "normal")
|
|
|
|
flow.prop(ui, "select")
|
|
|
|
flow.prop(ui, "active")
|
|
|
|
flow.prop(ui, "show_colored_constraints")
|
2012-12-20 16:50:39 +00:00
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# Base class for dynamically defined theme-space panels.
|
|
|
|
class PreferenceThemeSpacePanel(Panel):
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
bl_region_type = 'WINDOW'
|
2012-12-20 16:50:39 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# not essential, hard-coded UI delimiters for the theme layout
|
|
|
|
ui_delimiters = {
|
|
|
|
'VIEW_3D': {
|
|
|
|
"text_grease_pencil",
|
|
|
|
"text_keyframe",
|
|
|
|
"speaker",
|
|
|
|
"freestyle_face_mark",
|
|
|
|
"split_normal",
|
|
|
|
"bone_solid",
|
|
|
|
"paint_curve_pivot",
|
|
|
|
},
|
|
|
|
'GRAPH_EDITOR': {
|
|
|
|
"handle_vertex_select",
|
|
|
|
},
|
|
|
|
'IMAGE_EDITOR': {
|
|
|
|
"paint_curve_pivot",
|
|
|
|
},
|
|
|
|
'NODE_EDITOR': {
|
|
|
|
"layout_node",
|
|
|
|
},
|
|
|
|
'CLIP_EDITOR': {
|
|
|
|
"handle_vertex_select",
|
|
|
|
}
|
|
|
|
}
|
2011-11-19 20:57:53 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# TODO theme_area should be deprecated
|
|
|
|
@staticmethod
|
|
|
|
def _theme_generic(layout, themedata, theme_area):
|
2011-11-19 20:57:53 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.use_property_split = True
|
2011-11-19 20:57:53 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
props_type = {}
|
Axis Colours are now Themeable
This commit allows you to set the RGB <-> XYZ axis colours used for things like
the mini axis indicator, grid axis indicators, manipulators, transform
constraint indicators, F-Curves (when using XYZ to RGB colouring option), and
perhaps something else I've missed. Previously, these places all used hardcoded
defines (220 * i/j/k), but the readability of these colours was often quite
poor, especially when used with certain themes.
The settings for these colours can be found under the "User Interface" section
of the themes (i.e. same set of colours is used across editors). I could have
made these per editor, but since it's unlikely that these will need to be too
different across editors in practice (+ being easier to version patch), they are
stored under the UI section.
2012-11-09 06:36:11 +00:00
|
|
|
|
2019-01-11 10:49:50 +11:00
|
|
|
for prop in themedata.rna_type.properties:
|
2019-01-04 21:40:16 +01:00
|
|
|
if prop.identifier == "rna_type":
|
|
|
|
continue
|
Axis Colours are now Themeable
This commit allows you to set the RGB <-> XYZ axis colours used for things like
the mini axis indicator, grid axis indicators, manipulators, transform
constraint indicators, F-Curves (when using XYZ to RGB colouring option), and
perhaps something else I've missed. Previously, these places all used hardcoded
defines (220 * i/j/k), but the readability of these colours was often quite
poor, especially when used with certain themes.
The settings for these colours can be found under the "User Interface" section
of the themes (i.e. same set of colours is used across editors). I could have
made these per editor, but since it's unlikely that these will need to be too
different across editors in practice (+ being easier to version patch), they are
stored under the UI section.
2012-11-09 06:36:11 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
props_type.setdefault((prop.type, prop.subtype), []).append(prop)
|
Axis Colours are now Themeable
This commit allows you to set the RGB <-> XYZ axis colours used for things like
the mini axis indicator, grid axis indicators, manipulators, transform
constraint indicators, F-Curves (when using XYZ to RGB colouring option), and
perhaps something else I've missed. Previously, these places all used hardcoded
defines (220 * i/j/k), but the readability of these colours was often quite
poor, especially when used with certain themes.
The settings for these colours can be found under the "User Interface" section
of the themes (i.e. same set of colours is used across editors). I could have
made these per editor, but since it's unlikely that these will need to be too
different across editors in practice (+ being easier to version patch), they are
stored under the UI section.
2012-11-09 06:36:11 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
th_delimiters = PreferenceThemeSpacePanel.ui_delimiters.get(theme_area)
|
|
|
|
for props_type, props_ls in sorted(props_type.items()):
|
|
|
|
if props_type[0] == 'POINTER':
|
|
|
|
continue
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
if th_delimiters is None:
|
|
|
|
# simple, no delimiters
|
2019-01-11 10:49:50 +11:00
|
|
|
for prop in props_ls:
|
2019-01-04 21:40:16 +01:00
|
|
|
flow.prop(themedata, prop.identifier)
|
|
|
|
else:
|
Axis Colours are now Themeable
This commit allows you to set the RGB <-> XYZ axis colours used for things like
the mini axis indicator, grid axis indicators, manipulators, transform
constraint indicators, F-Curves (when using XYZ to RGB colouring option), and
perhaps something else I've missed. Previously, these places all used hardcoded
defines (220 * i/j/k), but the readability of these colours was often quite
poor, especially when used with certain themes.
The settings for these colours can be found under the "User Interface" section
of the themes (i.e. same set of colours is used across editors). I could have
made these per editor, but since it's unlikely that these will need to be too
different across editors in practice (+ being easier to version patch), they are
stored under the UI section.
2012-11-09 06:36:11 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
for prop in props_ls:
|
|
|
|
flow.prop(themedata, prop.identifier)
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@staticmethod
|
2019-01-11 10:49:50 +11:00
|
|
|
def draw_header(self, _context):
|
2019-01-04 21:40:16 +01:00
|
|
|
if hasattr(self, "icon") and self.icon != 'NONE':
|
|
|
|
layout = self.layout
|
|
|
|
layout.label(icon=self.icon)
|
2018-10-02 19:04:38 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@staticmethod
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
theme = context.preferences.themes[0]
|
2018-10-02 19:04:38 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
datapath_list = self.datapath.split(".")
|
|
|
|
data = theme
|
|
|
|
for datapath_item in datapath_list:
|
|
|
|
data = getattr(data, datapath_item)
|
|
|
|
PreferenceThemeSpacePanel._theme_generic(layout, data, self.theme_area)
|
2018-10-02 19:04:38 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'THEMES')
|
2018-10-02 19:04:38 +02:00
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class ThemeGenericClassGenerator():
|
|
|
|
generated_classes = []
|
2018-10-02 19:04:38 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@staticmethod
|
|
|
|
def generate_panel_classes_for_wcols():
|
|
|
|
wcols = [
|
|
|
|
("Regular", "wcol_regular"),
|
|
|
|
("Tool", "wcol_tool"),
|
|
|
|
("Toolbar Item", "wcol_toolbar_item"),
|
|
|
|
("Radio Buttons", "wcol_radio"),
|
|
|
|
("Text", "wcol_text"),
|
|
|
|
("Option", "wcol_option"),
|
|
|
|
("Toggle", "wcol_toggle"),
|
|
|
|
("Number Field", "wcol_num"),
|
|
|
|
("Value Slider", "wcol_numslider"),
|
|
|
|
("Box", "wcol_box"),
|
|
|
|
("Menu", "wcol_menu"),
|
|
|
|
("Pie Menu", "wcol_pie_menu"),
|
|
|
|
("Pulldown", "wcol_pulldown"),
|
|
|
|
("Menu Back", "wcol_menu_back"),
|
|
|
|
("Tooltip", "wcol_tooltip"),
|
|
|
|
("Menu Item", "wcol_menu_item"),
|
|
|
|
("Scroll Bar", "wcol_scroll"),
|
|
|
|
("Progress Bar", "wcol_progress"),
|
|
|
|
("List Item", "wcol_list_item"),
|
|
|
|
("Tab", "wcol_tab"),
|
|
|
|
]
|
2018-10-02 19:04:38 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
for (name, wcol) in wcols:
|
|
|
|
panel_id = "USERPREF_PT_theme_interface_" + wcol
|
|
|
|
paneltype = type(panel_id, (PreferenceThemeWidgetColorPanel,), {
|
|
|
|
"bl_label": name,
|
|
|
|
"bl_options": {'DEFAULT_CLOSED'},
|
|
|
|
"draw": PreferenceThemeWidgetColorPanel.draw,
|
|
|
|
"wcol": wcol,
|
|
|
|
})
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
ThemeGenericClassGenerator.generated_classes.append(paneltype)
|
2011-02-16 02:25:03 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@staticmethod
|
|
|
|
def generate_theme_area_child_panel_classes(parent_id, rna_type, theme_area, datapath):
|
|
|
|
def generate_child_panel_classes_recurse(parent_id, rna_type, theme_area, datapath):
|
|
|
|
props_type = {}
|
2011-02-16 02:25:03 +00:00
|
|
|
|
2019-01-11 10:49:50 +11:00
|
|
|
for prop in rna_type.properties:
|
2019-01-04 21:40:16 +01:00
|
|
|
if prop.identifier == "rna_type":
|
|
|
|
continue
|
2011-02-14 03:43:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
props_type.setdefault((prop.type, prop.subtype), []).append(prop)
|
2011-02-16 02:25:03 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
for props_type, props_ls in sorted(props_type.items()):
|
|
|
|
if props_type[0] == 'POINTER':
|
2019-01-11 10:49:50 +11:00
|
|
|
for prop in props_ls:
|
2019-01-04 21:40:16 +01:00
|
|
|
new_datapath = datapath + "." + prop.identifier if datapath else prop.identifier
|
|
|
|
panel_id = parent_id + "_" + prop.identifier
|
|
|
|
paneltype = type(panel_id, (PreferenceThemeSpacePanel,), {
|
|
|
|
"bl_label": rna_type.properties[prop.identifier].name,
|
|
|
|
"bl_parent_id": parent_id,
|
|
|
|
"bl_options": {'DEFAULT_CLOSED'},
|
|
|
|
"draw": PreferenceThemeSpacePanel.draw,
|
|
|
|
"theme_area": theme_area.identifier,
|
|
|
|
"datapath": new_datapath,
|
|
|
|
})
|
|
|
|
|
|
|
|
ThemeGenericClassGenerator.generated_classes.append(paneltype)
|
|
|
|
generate_child_panel_classes_recurse(panel_id, prop.fixed_type, theme_area, new_datapath)
|
|
|
|
|
|
|
|
generate_child_panel_classes_recurse(parent_id, rna_type, theme_area, datapath)
|
2011-02-14 03:43:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@staticmethod
|
|
|
|
def generate_panel_classes_from_theme_areas():
|
|
|
|
from bpy.types import Theme
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
for theme_area in Theme.bl_rna.properties['theme_area'].enum_items_static:
|
|
|
|
if theme_area.identifier in {'USER_INTERFACE', 'STYLE', 'BONE_COLOR_SETS'}:
|
|
|
|
continue
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
panel_id = "USERPREF_PT_theme_" + theme_area.identifier.lower()
|
|
|
|
# Generate panel-class from theme_area
|
|
|
|
paneltype = type(panel_id, (PreferenceThemeSpacePanel,), {
|
|
|
|
"bl_label": theme_area.name,
|
|
|
|
"bl_options": {'DEFAULT_CLOSED'},
|
|
|
|
"draw_header": PreferenceThemeSpacePanel.draw_header,
|
|
|
|
"draw": PreferenceThemeSpacePanel.draw,
|
|
|
|
"theme_area": theme_area.identifier,
|
|
|
|
"icon": theme_area.icon,
|
|
|
|
"datapath": theme_area.identifier.lower(),
|
|
|
|
})
|
|
|
|
|
|
|
|
ThemeGenericClassGenerator.generated_classes.append(paneltype)
|
|
|
|
ThemeGenericClassGenerator.generate_theme_area_child_panel_classes(
|
|
|
|
panel_id, Theme.bl_rna.properties[theme_area.identifier.lower()].fixed_type,
|
|
|
|
theme_area, theme_area.identifier.lower())
|
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class FilePathsPanel(Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
bl_region_type = 'WINDOW'
|
2013-01-23 16:01:35 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'FILE_PATHS')
|
2013-01-23 16:01:35 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.use_property_split = True
|
2019-01-16 18:49:31 +01:00
|
|
|
layout.use_property_decorate = False
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
self.draw_props(context, layout)
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_file_paths_data(FilePathsPanel):
|
|
|
|
bl_label = "Data"
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
paths = context.preferences.filepaths
|
|
|
|
|
|
|
|
col = self.layout.column()
|
|
|
|
col.prop(paths, "font_directory", text="Fonts")
|
|
|
|
col.prop(paths, "texture_directory", text="Textures")
|
|
|
|
col.prop(paths, "script_directory", text="Scripts")
|
|
|
|
col.prop(paths, "sound_directory", text="Sounds")
|
|
|
|
col.prop(paths, "temporary_directory", text="Temporary Files")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_file_paths_render(FilePathsPanel):
|
|
|
|
bl_label = "Render"
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
paths = context.preferences.filepaths
|
|
|
|
|
|
|
|
col = self.layout.column()
|
|
|
|
col.prop(paths, "render_output_directory", text="Render Output")
|
|
|
|
col.prop(paths, "render_cache_directory", text="Render Cache")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_file_paths_applications(FilePathsPanel):
|
|
|
|
bl_label = "Applications"
|
2019-01-06 21:51:07 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
paths = context.preferences.filepaths
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
col = layout.column()
|
|
|
|
col.prop(paths, "image_editor", text="Image Editor")
|
|
|
|
col.prop(paths, "animation_player_preset", text="Animation Player")
|
2019-01-06 12:56:18 +01:00
|
|
|
if paths.animation_player_preset == 'CUSTOM':
|
2019-01-16 18:49:31 +01:00
|
|
|
col.prop(paths, "animation_player", text="Player")
|
2009-11-02 17:18:17 +00:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_file_paths_development(FilePathsPanel):
|
|
|
|
bl_label = "Development"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'FILE_PATHS') and prefs.view.show_developer_ui
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
paths = context.preferences.filepaths
|
|
|
|
layout.prop(paths, "i18n_branches_directory", text="I18n Branches")
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_saveload_autorun(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Auto Run Python Scripts"
|
2019-01-18 11:31:26 +01:00
|
|
|
bl_parent_id = "USERPREF_PT_saveload_blend"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_header(self, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
paths = prefs.filepaths
|
|
|
|
|
|
|
|
self.layout.prop(paths, "use_scripts_auto_execute", text="")
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
paths = prefs.filepaths
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False # No animation.
|
|
|
|
|
|
|
|
layout.active = paths.use_scripts_auto_execute
|
|
|
|
|
|
|
|
box = layout.box()
|
|
|
|
row = box.row()
|
|
|
|
row.label(text="Excluded Paths:")
|
|
|
|
row.operator("wm.userpref_autoexec_path_add", text="", icon='ADD', emboss=False)
|
|
|
|
for i, path_cmp in enumerate(prefs.autoexec_paths):
|
|
|
|
row = box.row()
|
|
|
|
row.prop(path_cmp, "path", text="")
|
|
|
|
row.prop(path_cmp, "use_glob", text="", icon='FILTER')
|
|
|
|
row.operator("wm.userpref_autoexec_path_remove", text="", icon='X', emboss=False).index = i
|
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_saveload_blend(PreferencePanel):
|
|
|
|
bl_label = "Blend Files"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'SAVE_LOAD')
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
paths = prefs.filepaths
|
2019-01-18 11:31:26 +01:00
|
|
|
view = prefs.view
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
flow.prop(paths, "use_relative_paths")
|
|
|
|
flow.prop(paths, "use_file_compression")
|
|
|
|
flow.prop(paths, "use_load_ui")
|
|
|
|
flow.prop(paths, "use_save_preview_images")
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(paths, "use_tabs_as_spaces")
|
2019-02-28 13:20:21 +11:00
|
|
|
flow.prop(view, "use_save_prompt")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(paths, "save_version")
|
|
|
|
flow.prop(paths, "recent_files")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_saveload_blend_autosave(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Auto Save"
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_parent_id = "USERPREF_PT_saveload_blend"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
paths = prefs.filepaths
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(paths, "use_auto_save_temporary_files")
|
|
|
|
sub = flow.column()
|
2010-08-17 13:14:41 +00:00
|
|
|
sub.active = paths.use_auto_save_temporary_files
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(paths, "auto_save_time", text="Timer (mins)")
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2012-01-09 16:58:01 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_saveload_file_browser(PreferencePanel):
|
|
|
|
bl_label = "File Browser"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'SAVE_LOAD')
|
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
paths = prefs.filepaths
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(paths, "use_filter_files")
|
|
|
|
flow.prop(paths, "show_hidden_files_datablocks")
|
|
|
|
flow.prop(paths, "hide_recent_locations")
|
|
|
|
flow.prop(paths, "hide_system_bookmarks")
|
|
|
|
flow.prop(paths, "show_thumbnails")
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class USERPREF_MT_ndof_settings(Menu):
|
2012-02-08 04:37:37 +00:00
|
|
|
# accessed from the window key-bindings in C (only)
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "3D Mouse Settings"
|
2011-08-05 14:53:13 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2012-07-29 12:07:06 +00:00
|
|
|
|
2018-12-21 12:47:44 +11:00
|
|
|
input_prefs = context.preferences.inputs
|
2011-08-05 14:53:13 +00:00
|
|
|
|
2014-02-18 11:39:26 +11:00
|
|
|
is_view3d = context.space_data.type == 'VIEW_3D'
|
|
|
|
|
2014-02-20 10:00:16 +11:00
|
|
|
layout.prop(input_prefs, "ndof_sensitivity")
|
2014-03-11 23:40:11 +11:00
|
|
|
layout.prop(input_prefs, "ndof_orbit_sensitivity")
|
2015-07-01 13:45:19 +10:00
|
|
|
layout.prop(input_prefs, "ndof_deadzone")
|
2014-02-20 10:00:16 +11:00
|
|
|
|
2014-02-18 11:39:26 +11:00
|
|
|
if is_view3d:
|
2011-08-05 14:53:13 +00:00
|
|
|
layout.separator()
|
|
|
|
layout.prop(input_prefs, "ndof_show_guide")
|
|
|
|
|
|
|
|
layout.separator()
|
2017-09-02 15:42:29 +10:00
|
|
|
layout.label(text="Orbit Style")
|
2014-02-20 10:00:16 +11:00
|
|
|
layout.row().prop(input_prefs, "ndof_view_navigate_method", text="")
|
2012-09-28 12:37:14 +00:00
|
|
|
layout.row().prop(input_prefs, "ndof_view_rotate_method", text="")
|
2014-02-20 10:00:16 +11:00
|
|
|
layout.separator()
|
2017-09-02 15:42:29 +10:00
|
|
|
layout.label(text="Orbit Options")
|
2014-02-18 23:51:11 +11:00
|
|
|
layout.prop(input_prefs, "ndof_rotx_invert_axis")
|
|
|
|
layout.prop(input_prefs, "ndof_roty_invert_axis")
|
|
|
|
layout.prop(input_prefs, "ndof_rotz_invert_axis")
|
2011-09-07 10:33:46 +00:00
|
|
|
|
2014-02-18 11:39:26 +11:00
|
|
|
# view2d use pan/zoom
|
|
|
|
layout.separator()
|
2017-09-02 15:42:29 +10:00
|
|
|
layout.label(text="Pan Options")
|
2014-02-18 11:39:26 +11:00
|
|
|
layout.prop(input_prefs, "ndof_panx_invert_axis")
|
|
|
|
layout.prop(input_prefs, "ndof_pany_invert_axis")
|
|
|
|
layout.prop(input_prefs, "ndof_panz_invert_axis")
|
|
|
|
layout.prop(input_prefs, "ndof_pan_yz_swap_axis")
|
|
|
|
|
2017-09-02 15:42:29 +10:00
|
|
|
layout.label(text="Zoom Options")
|
2014-02-18 11:39:26 +11:00
|
|
|
layout.prop(input_prefs, "ndof_zoom_invert")
|
2011-11-14 14:02:19 +00:00
|
|
|
|
2014-02-18 11:39:26 +11:00
|
|
|
if is_view3d:
|
2011-08-05 14:53:13 +00:00
|
|
|
layout.separator()
|
2017-09-02 15:42:29 +10:00
|
|
|
layout.label(text="Fly/Walk Options")
|
2011-08-05 14:53:13 +00:00
|
|
|
layout.prop(input_prefs, "ndof_fly_helicopter", icon='NDOF_FLY')
|
|
|
|
layout.prop(input_prefs, "ndof_lock_horizon", icon='NDOF_DOM')
|
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_input_keyboard(PreferencePanel):
|
|
|
|
bl_label = "Keyboard"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'INPUT')
|
2013-07-08 07:25:33 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
layout.prop(inputs, "use_emulate_numpad")
|
|
|
|
layout.prop(inputs, "use_numeric_input_advanced")
|
2019-01-06 21:51:07 +01:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_input_mouse(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Mouse"
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'INPUT')
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(inputs, "use_mouse_emulate_3_button")
|
|
|
|
flow.prop(inputs, "use_mouse_continuous")
|
|
|
|
flow.prop(inputs, "use_drag_immediately")
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.prop(inputs, "drag_threshold")
|
|
|
|
flow.prop(inputs, "mouse_double_click_time", text="Double Click Speed")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_navigation_orbit(PreferencePanel):
|
|
|
|
bl_label = "Orbit & Pan"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
2019-01-16 18:49:31 +01:00
|
|
|
return (prefs.active_section == 'NAVIGATION')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
import sys
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
2019-01-16 18:49:31 +01:00
|
|
|
view = prefs.view
|
2015-04-07 14:08:30 +02:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.row().prop(inputs, "view_rotate_method", expand=True)
|
|
|
|
flow.prop(inputs, "use_rotate_around_active")
|
|
|
|
flow.prop(inputs, "use_auto_perspective")
|
|
|
|
flow.prop(inputs, "use_mouse_depth_navigate")
|
2019-01-18 11:31:26 +01:00
|
|
|
if sys.platform == "darwin":
|
|
|
|
flow.prop(inputs, "use_trackpad_natural", text="Natural Trackpad Direction")
|
2009-11-22 16:33:47 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.separator()
|
|
|
|
|
|
|
|
flow.prop(view, "smooth_view")
|
|
|
|
flow.prop(view, "rotation_angle")
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_navigation_zoom(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Zoom"
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'NAVIGATION')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
2014-01-27 18:38:53 +11:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.row().prop(inputs, "view_zoom_method", text="Zoom Method", expand=True)
|
2011-04-22 14:47:35 +00:00
|
|
|
if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}:
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.row().prop(inputs, "view_zoom_axis", expand=True)
|
|
|
|
flow.prop(inputs, "invert_mouse_zoom", text="Invert Mouse Zoom Direction")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
|
2019-01-04 21:40:16 +01:00
|
|
|
# sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(inputs, "use_zoom_to_mouse")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_navigation_fly_walk(PreferencePanel):
|
2019-01-06 12:56:18 +01:00
|
|
|
bl_label = "Fly & Walk"
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'NAVIGATION')
|
2013-02-08 12:12:57 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
layout.row().prop(inputs, "navigation_mode", expand=True)
|
2019-01-06 21:51:07 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(inputs, "use_camera_lock_parent")
|
2013-12-03 03:14:09 -02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_navigation_fly_walk_navigation(PreferencePanel):
|
2019-01-06 12:56:18 +01:00
|
|
|
bl_label = "Walk"
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_parent_id = "USERPREF_PT_navigation_fly_walk"
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
2019-01-06 12:56:18 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return prefs.inputs.navigation_mode == 'WALK'
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
2017-04-10 17:44:03 -04:00
|
|
|
walk = inputs.walk_navigation
|
2013-12-03 03:14:09 -02:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(walk, "use_mouse_reverse")
|
|
|
|
flow.prop(walk, "mouse_speed")
|
|
|
|
flow.prop(walk, "teleport_time")
|
2017-04-10 17:44:03 -04:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
sub = flow.column(align=True)
|
2017-04-10 17:44:03 -04:00
|
|
|
sub.prop(walk, "walk_speed")
|
|
|
|
sub.prop(walk, "walk_speed_factor")
|
|
|
|
|
2013-12-03 03:14:09 -02:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_navigation_fly_walk_gravity(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Gravity"
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_parent_id = "USERPREF_PT_navigation_fly_walk"
|
2019-01-06 12:56:18 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return prefs.inputs.navigation_mode == 'WALK'
|
2018-11-20 15:35:59 +03:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_header(self, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
|
|
|
walk = inputs.walk_navigation
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
self.layout.prop(walk, "use_gravity", text="")
|
2013-07-08 07:25:33 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
|
|
|
walk = inputs.walk_navigation
|
|
|
|
|
|
|
|
layout.active = walk.use_gravity
|
2019-01-06 21:51:07 +01:00
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(walk, "view_height")
|
|
|
|
flow.prop(walk, "jump_height")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_input_tablet(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Tablet"
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
|
|
|
return prefs.active_section == 'INPUT'
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
|
|
|
inputs = prefs.inputs
|
|
|
|
|
2019-01-14 17:46:49 +01:00
|
|
|
import sys
|
|
|
|
if sys.platform[:3] == "win":
|
|
|
|
layout.prop(inputs, "tablet_api")
|
|
|
|
layout.separator()
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(inputs, "pressure_threshold_max")
|
|
|
|
flow.prop(inputs, "pressure_softness")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
class USERPREF_PT_input_ndof(PreferencePanel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "NDOF"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-12-16 10:13:26 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
2019-01-04 21:40:16 +01:00
|
|
|
inputs = prefs.inputs
|
2019-01-16 18:49:31 +01:00
|
|
|
return prefs.active_section == 'INPUT' and inputs.use_ndof
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw_props(self, context, layout):
|
|
|
|
prefs = context.preferences
|
2018-12-21 12:47:44 +11:00
|
|
|
inputs = prefs.inputs
|
2009-12-16 10:13:26 +00:00
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
|
|
flow.prop(inputs, "ndof_sensitivity", text="Pan Sensitivity")
|
|
|
|
flow.prop(inputs, "ndof_orbit_sensitivity", text="Orbit Sensitivity")
|
|
|
|
flow.prop(inputs, "ndof_deadzone", text="Deadzone")
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.separator()
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.row().prop(inputs, "ndof_view_navigate_method", expand=True)
|
|
|
|
flow.row().prop(inputs, "ndof_view_rotate_method", expand=True)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_MT_keyconfigs(Menu):
|
|
|
|
bl_label = "KeyPresets"
|
|
|
|
preset_subdir = "keyconfig"
|
|
|
|
preset_operator = "wm.keyconfig_activate"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
Menu.draw_preset(self, context)
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_keymap(Panel):
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
bl_label = "Keymap"
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_options = {'HIDE_HEADER'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'KEYMAP')
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
from rna_keymap_ui import draw_keymaps
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
# import time
|
2018-11-18 11:16:25 +11:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# start = time.time()
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
# Keymap Settings
|
2019-01-16 18:42:26 +01:00
|
|
|
draw_keymaps(context, layout)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# print("runtime", time.time() - start)
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class USERPREF_PT_addons(Panel):
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2014-11-14 12:17:25 +01:00
|
|
|
bl_label = "Add-ons"
|
2010-02-14 23:33:18 +00:00
|
|
|
bl_region_type = 'WINDOW'
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2011-11-17 20:11:20 +00:00
|
|
|
_support_icon_mapping = {
|
|
|
|
'OFFICIAL': 'FILE_BLEND',
|
2018-11-22 16:17:09 +11:00
|
|
|
'COMMUNITY': 'COMMUNITY',
|
2018-11-22 15:31:19 +11:00
|
|
|
'TESTING': 'EXPERIMENTAL',
|
2018-06-05 16:32:11 +02:00
|
|
|
}
|
2011-11-17 20:11:20 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'ADDONS')
|
2010-02-14 23:33:18 +00:00
|
|
|
|
2011-06-29 15:56:22 +00:00
|
|
|
@staticmethod
|
|
|
|
def is_user_addon(mod, user_addon_paths):
|
2013-02-08 11:23:22 +00:00
|
|
|
import os
|
|
|
|
|
2011-06-29 15:56:22 +00:00
|
|
|
if not user_addon_paths:
|
2018-02-01 14:58:05 +11:00
|
|
|
for path in (
|
|
|
|
bpy.utils.script_path_user(),
|
|
|
|
bpy.utils.script_path_pref(),
|
|
|
|
):
|
2012-07-29 01:02:25 +00:00
|
|
|
if path is not None:
|
|
|
|
user_addon_paths.append(os.path.join(path, "addons"))
|
2011-07-01 12:33:34 +00:00
|
|
|
|
2011-06-29 15:56:22 +00:00
|
|
|
for path in user_addon_paths:
|
|
|
|
if bpy.path.is_subdir(mod.__file__, path):
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
2011-07-18 05:41:46 +00:00
|
|
|
@staticmethod
|
|
|
|
def draw_error(layout, message):
|
|
|
|
lines = message.split("\n")
|
|
|
|
box = layout.box()
|
2013-04-13 22:52:28 +00:00
|
|
|
sub = box.row()
|
2018-08-28 12:34:51 +10:00
|
|
|
sub.label(text=lines[0])
|
2013-04-13 22:52:28 +00:00
|
|
|
sub.label(icon='ERROR')
|
2011-07-18 05:41:46 +00:00
|
|
|
for l in lines[1:]:
|
2018-08-28 12:34:51 +10:00
|
|
|
box.label(text=l)
|
2011-07-18 05:41:46 +00:00
|
|
|
|
2010-02-14 23:33:18 +00:00
|
|
|
def draw(self, context):
|
2013-02-08 11:23:22 +00:00
|
|
|
import os
|
2012-10-01 02:04:06 +00:00
|
|
|
import addon_utils
|
|
|
|
|
2010-02-14 23:33:18 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
used_ext = {ext.module for ext in prefs.addons}
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2018-11-08 09:54:13 +11:00
|
|
|
addon_user_dirs = tuple(
|
|
|
|
p for p in (
|
2018-12-21 12:47:44 +11:00
|
|
|
os.path.join(prefs.filepaths.script_directory, "addons"),
|
2018-11-08 09:54:13 +11:00
|
|
|
bpy.utils.user_resource('SCRIPTS', "addons"),
|
|
|
|
)
|
|
|
|
if p
|
|
|
|
)
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2018-11-08 10:10:08 +11:00
|
|
|
# Development option for 2.8x, don't show users bundled addons
|
|
|
|
# unless they have been updated for 2.8x.
|
|
|
|
# Developers can turn them on with '--debug'
|
|
|
|
show_official_27x_addons = bpy.app.debug
|
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
# collect the categories that can be filtered on
|
2018-02-01 14:58:05 +11:00
|
|
|
addons = [
|
|
|
|
(mod, addon_utils.module_bl_info(mod))
|
|
|
|
for mod in addon_utils.modules(refresh=False)
|
|
|
|
]
|
2010-03-14 20:07:15 +00:00
|
|
|
|
2019-01-16 18:42:26 +01:00
|
|
|
split = layout.split(factor=0.6)
|
|
|
|
|
|
|
|
row = split.row()
|
|
|
|
row.prop(context.window_manager, "addon_support", expand=True)
|
|
|
|
|
|
|
|
row = split.row(align=True)
|
2019-01-04 21:40:16 +01:00
|
|
|
row.operator("wm.addon_install", icon='IMPORT', text="Install...")
|
|
|
|
row.operator("wm.addon_refresh", icon='FILE_REFRESH', text="Refresh")
|
2010-06-27 19:04:44 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(context.window_manager, "addon_filter", text="")
|
|
|
|
row.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
|
2011-11-17 20:11:20 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = layout.column()
|
2010-02-14 23:33:18 +00:00
|
|
|
|
2013-08-28 06:36:54 +00:00
|
|
|
# set in addon_utils.modules_refresh()
|
2011-07-18 05:41:46 +00:00
|
|
|
if addon_utils.error_duplicates:
|
2017-02-27 03:54:12 +11:00
|
|
|
box = col.box()
|
|
|
|
row = box.row()
|
2018-08-28 12:34:51 +10:00
|
|
|
row.label(text="Multiple add-ons with the same name found!")
|
2017-02-27 03:54:12 +11:00
|
|
|
row.label(icon='ERROR')
|
2018-09-04 18:44:05 +10:00
|
|
|
box.label(text="Delete one of each pair to resolve:")
|
2017-02-27 03:54:12 +11:00
|
|
|
for (addon_name, addon_file, addon_path) in addon_utils.error_duplicates:
|
|
|
|
box.separator()
|
|
|
|
sub_col = box.column(align=True)
|
2018-08-28 12:34:51 +10:00
|
|
|
sub_col.label(text=addon_name + ":")
|
|
|
|
sub_col.label(text=" " + addon_file)
|
|
|
|
sub_col.label(text=" " + addon_path)
|
2017-02-27 03:54:12 +11:00
|
|
|
|
2011-08-07 04:55:58 +00:00
|
|
|
if addon_utils.error_encoding:
|
2018-02-01 14:58:05 +11:00
|
|
|
self.draw_error(
|
|
|
|
col,
|
|
|
|
"One or more addons do not have UTF-8 encoding\n"
|
|
|
|
"(see console for details)",
|
|
|
|
)
|
2011-08-07 04:55:58 +00:00
|
|
|
|
2010-09-09 14:22:03 +00:00
|
|
|
filter = context.window_manager.addon_filter
|
|
|
|
search = context.window_manager.addon_search.lower()
|
2011-01-14 16:49:43 +00:00
|
|
|
support = context.window_manager.addon_support
|
2010-03-14 20:07:15 +00:00
|
|
|
|
2011-06-29 15:56:22 +00:00
|
|
|
# initialized on demand
|
|
|
|
user_addon_paths = []
|
|
|
|
|
2010-03-14 23:19:44 +00:00
|
|
|
for mod, info in addons:
|
2010-03-14 20:07:15 +00:00
|
|
|
module_name = mod.__name__
|
2010-03-14 23:19:44 +00:00
|
|
|
|
2010-04-21 16:50:51 +00:00
|
|
|
is_enabled = module_name in used_ext
|
|
|
|
|
2011-01-14 16:49:43 +00:00
|
|
|
if info["support"] not in support:
|
|
|
|
continue
|
|
|
|
|
2011-10-23 17:52:20 +00:00
|
|
|
# check if addon should be visible with current filters
|
2018-06-20 18:21:01 +02:00
|
|
|
if (
|
|
|
|
(filter == "All") or
|
|
|
|
(filter == info["category"]) or
|
|
|
|
(filter == "Enabled" and is_enabled) or
|
2018-06-05 16:32:11 +02:00
|
|
|
(filter == "Disabled" and not is_enabled) or
|
2018-11-08 09:54:13 +11:00
|
|
|
(filter == "User" and (mod.__file__.startswith(addon_user_dirs)))
|
2018-06-20 18:21:01 +02:00
|
|
|
):
|
2010-04-21 16:50:51 +00:00
|
|
|
if search and search not in info["name"].lower():
|
|
|
|
if info["author"]:
|
|
|
|
if search not in info["author"].lower():
|
|
|
|
continue
|
|
|
|
else:
|
2010-03-13 00:14:36 +00:00
|
|
|
continue
|
2010-04-21 16:50:51 +00:00
|
|
|
|
2018-11-08 10:10:08 +11:00
|
|
|
# Skip 2.7x add-ons included with Blender, unless in debug mode.
|
|
|
|
is_addon_27x = info.get("blender", (0,)) < (2, 80)
|
|
|
|
if (
|
|
|
|
is_addon_27x and
|
|
|
|
(not show_official_27x_addons) and
|
|
|
|
(not mod.__file__.startswith(addon_user_dirs))
|
|
|
|
):
|
|
|
|
continue
|
|
|
|
|
2010-04-21 16:50:51 +00:00
|
|
|
# Addon UI Code
|
2012-12-29 10:24:42 +00:00
|
|
|
col_box = col.column()
|
|
|
|
box = col_box.box()
|
2010-06-27 19:04:44 +00:00
|
|
|
colsub = box.column()
|
2016-01-11 20:22:14 +11:00
|
|
|
row = colsub.row(align=True)
|
2010-04-21 16:50:51 +00:00
|
|
|
|
2016-01-11 20:22:14 +11:00
|
|
|
row.operator(
|
2018-02-01 14:58:05 +11:00
|
|
|
"wm.addon_expand",
|
2018-11-22 15:31:19 +11:00
|
|
|
icon='DISCLOSURE_TRI_DOWN' if info["show_expanded"] else 'DISCLOSURE_TRI_RIGHT',
|
2018-02-01 14:58:05 +11:00
|
|
|
emboss=False,
|
|
|
|
).module = module_name
|
2016-01-11 20:22:14 +11:00
|
|
|
|
|
|
|
row.operator(
|
2018-02-01 14:58:05 +11:00
|
|
|
"wm.addon_disable" if is_enabled else "wm.addon_enable",
|
|
|
|
icon='CHECKBOX_HLT' if is_enabled else 'CHECKBOX_DEHLT', text="",
|
|
|
|
emboss=False,
|
|
|
|
).module = module_name
|
2010-06-17 02:38:49 +00:00
|
|
|
|
2013-04-13 22:52:28 +00:00
|
|
|
sub = row.row()
|
|
|
|
sub.active = is_enabled
|
2017-09-02 15:42:29 +10:00
|
|
|
sub.label(text="%s: %s" % (info["category"], info["name"]))
|
2018-07-03 07:58:10 +02:00
|
|
|
|
|
|
|
# WARNING: 2.8x exception, may be removed
|
|
|
|
# use disabled state for old add-ons, chances are they are broken.
|
2018-11-08 10:10:08 +11:00
|
|
|
if is_addon_27x:
|
2019-01-04 21:40:16 +01:00
|
|
|
sub.label(text="upgrade to 2.8x required")
|
2018-07-03 07:58:10 +02:00
|
|
|
sub.label(icon='ERROR')
|
|
|
|
# Remove code above after 2.8x migration is complete.
|
|
|
|
elif info["warning"]:
|
2013-04-13 22:52:28 +00:00
|
|
|
sub.label(icon='ERROR')
|
2010-06-17 02:38:49 +00:00
|
|
|
|
2011-01-14 16:49:43 +00:00
|
|
|
# icon showing support level.
|
2013-04-13 22:52:28 +00:00
|
|
|
sub.label(icon=self._support_icon_mapping.get(info["support"], 'QUESTION'))
|
2011-01-14 16:49:43 +00:00
|
|
|
|
2012-02-08 04:37:37 +00:00
|
|
|
# Expanded UI (only if additional info is available)
|
2010-08-17 17:03:52 +00:00
|
|
|
if info["show_expanded"]:
|
2010-06-17 02:38:49 +00:00
|
|
|
if info["description"]:
|
2018-08-28 12:38:54 +10:00
|
|
|
split = colsub.row().split(factor=0.15)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Description:")
|
2010-06-17 02:38:49 +00:00
|
|
|
split.label(text=info["description"])
|
|
|
|
if info["location"]:
|
2018-08-28 12:38:54 +10:00
|
|
|
split = colsub.row().split(factor=0.15)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Location:")
|
2010-06-17 02:38:49 +00:00
|
|
|
split.label(text=info["location"])
|
2012-04-11 11:22:19 +00:00
|
|
|
if mod:
|
2018-08-28 12:38:54 +10:00
|
|
|
split = colsub.row().split(factor=0.15)
|
2012-04-11 11:22:19 +00:00
|
|
|
split.label(text="File:")
|
2013-02-08 16:41:02 +00:00
|
|
|
split.label(text=mod.__file__, translate=False)
|
2010-04-21 16:50:51 +00:00
|
|
|
if info["author"]:
|
2018-08-28 12:38:54 +10:00
|
|
|
split = colsub.row().split(factor=0.15)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Author:")
|
2013-02-08 16:41:02 +00:00
|
|
|
split.label(text=info["author"], translate=False)
|
2010-04-21 16:50:51 +00:00
|
|
|
if info["version"]:
|
2018-08-28 12:38:54 +10:00
|
|
|
split = colsub.row().split(factor=0.15)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Version:")
|
2017-09-02 15:42:29 +10:00
|
|
|
split.label(text=".".join(str(x) for x in info["version"]), translate=False)
|
2010-06-17 02:38:49 +00:00
|
|
|
if info["warning"]:
|
2018-08-28 12:38:54 +10:00
|
|
|
split = colsub.row().split(factor=0.15)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Warning:")
|
2017-09-02 15:42:29 +10:00
|
|
|
split.label(text=" " + info["warning"], icon='ERROR')
|
2011-06-29 15:56:22 +00:00
|
|
|
|
2011-07-11 05:50:49 +00:00
|
|
|
user_addon = USERPREF_PT_addons.is_user_addon(mod, user_addon_paths)
|
2013-11-16 03:08:51 +01:00
|
|
|
tot_row = bool(info["wiki_url"]) + bool(user_addon)
|
2011-06-29 15:56:22 +00:00
|
|
|
|
|
|
|
if tot_row:
|
2018-08-28 12:38:54 +10:00
|
|
|
split = colsub.row().split(factor=0.15)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Internet:")
|
2019-01-16 19:32:10 +01:00
|
|
|
sub = split.row()
|
2010-05-30 20:48:09 +00:00
|
|
|
if info["wiki_url"]:
|
2019-01-16 19:32:10 +01:00
|
|
|
sub.operator(
|
2018-02-01 14:58:05 +11:00
|
|
|
"wm.url_open", text="Documentation", icon='HELP',
|
|
|
|
).url = info["wiki_url"]
|
2018-03-09 21:17:43 +01:00
|
|
|
# Only add "Report a Bug" button if tracker_url is set
|
|
|
|
# or the add-on is bundled (use official tracker then).
|
|
|
|
if info.get("tracker_url") or not user_addon:
|
2019-01-16 19:32:10 +01:00
|
|
|
sub.operator(
|
2018-03-09 21:17:43 +01:00
|
|
|
"wm.url_open", text="Report a Bug", icon='URL',
|
|
|
|
).url = info.get(
|
|
|
|
"tracker_url",
|
|
|
|
"https://developer.blender.org/maniphest/task/edit/form/2",
|
|
|
|
)
|
2011-06-29 15:56:22 +00:00
|
|
|
if user_addon:
|
2019-01-16 19:32:10 +01:00
|
|
|
sub.operator(
|
2018-02-01 14:58:05 +11:00
|
|
|
"wm.addon_remove", text="Remove", icon='CANCEL',
|
|
|
|
).module = mod.__name__
|
2010-06-09 19:12:03 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# Show addon user preferences
|
2012-12-29 10:24:42 +00:00
|
|
|
if is_enabled:
|
2018-12-21 12:47:44 +11:00
|
|
|
addon_preferences = prefs.addons[module_name].preferences
|
2012-12-29 10:24:42 +00:00
|
|
|
if addon_preferences is not None:
|
|
|
|
draw = getattr(addon_preferences, "draw", None)
|
|
|
|
if draw is not None:
|
|
|
|
addon_preferences_class = type(addon_preferences)
|
|
|
|
box_prefs = col_box.box()
|
2018-08-28 12:34:51 +10:00
|
|
|
box_prefs.label(text="Preferences:")
|
2012-12-29 10:24:42 +00:00
|
|
|
addon_preferences_class.layout = box_prefs
|
|
|
|
try:
|
|
|
|
draw(context)
|
|
|
|
except:
|
|
|
|
import traceback
|
|
|
|
traceback.print_exc()
|
|
|
|
box_prefs.label(text="Error (see console)", icon='ERROR')
|
|
|
|
del addon_preferences_class.layout
|
|
|
|
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
# Append missing scripts
|
|
|
|
# First collect scripts that are used but have no script file.
|
|
|
|
module_names = {mod.__name__ for mod, info in addons}
|
|
|
|
missing_modules = {ext for ext in used_ext if ext not in module_names}
|
|
|
|
|
2011-03-07 13:23:45 +00:00
|
|
|
if missing_modules and filter in {"All", "Enabled"}:
|
2010-06-27 19:04:44 +00:00
|
|
|
col.column().separator()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.column().label(text="Missing script files")
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
|
|
|
module_names = {mod.__name__ for mod, info in addons}
|
2010-09-25 06:36:01 +00:00
|
|
|
for module_name in sorted(missing_modules):
|
|
|
|
is_enabled = module_name in used_ext
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
# Addon UI Code
|
2010-06-27 19:04:44 +00:00
|
|
|
box = col.column().box()
|
|
|
|
colsub = box.column()
|
2016-03-03 18:50:15 +11:00
|
|
|
row = colsub.row(align=True)
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
2016-03-03 18:50:15 +11:00
|
|
|
row.label(text="", icon='ERROR')
|
2010-09-25 06:36:01 +00:00
|
|
|
|
|
|
|
if is_enabled:
|
2018-02-01 14:58:05 +11:00
|
|
|
row.operator(
|
|
|
|
"wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False,
|
|
|
|
).module = module_name
|
2010-09-25 06:36:01 +00:00
|
|
|
|
2016-03-03 18:50:15 +11:00
|
|
|
row.label(text=module_name, translate=False)
|
|
|
|
|
|
|
|
|
2018-06-08 14:30:11 +02:00
|
|
|
class StudioLightPanelMixin():
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2018-06-07 16:01:57 +02:00
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
return (prefs.active_section == 'LIGHTS')
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2018-12-21 12:47:44 +11:00
|
|
|
def _get_lights(self, prefs):
|
|
|
|
return [light for light in prefs.studio_lights if light.is_user_defined and light.type == self.sl_type]
|
2018-06-08 15:34:13 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
lights = self._get_lights(prefs)
|
2018-11-29 19:54:23 +01:00
|
|
|
|
|
|
|
self.draw_light_list(layout, lights)
|
|
|
|
|
|
|
|
def draw_light_list(self, layout, lights):
|
2018-06-08 15:34:13 +02:00
|
|
|
if lights:
|
2019-01-16 19:12:51 +01:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=4, even_columns=True, even_rows=True, align=False)
|
2018-06-08 15:34:13 +02:00
|
|
|
for studio_light in lights:
|
|
|
|
self.draw_studio_light(flow, studio_light)
|
|
|
|
else:
|
2018-08-28 12:34:51 +10:00
|
|
|
layout.label(text="No custom {} configured".format(self.bl_label))
|
2018-06-08 15:34:13 +02:00
|
|
|
|
2018-06-07 16:01:57 +02:00
|
|
|
def draw_studio_light(self, layout, studio_light):
|
|
|
|
box = layout.box()
|
|
|
|
row = box.row()
|
|
|
|
|
2019-01-16 19:12:51 +01:00
|
|
|
row.template_icon(layout.icon(studio_light), scale=3.0)
|
2018-11-30 15:40:46 +01:00
|
|
|
col = row.column()
|
2018-12-18 15:01:03 +11:00
|
|
|
op = col.operator("wm.studiolight_uninstall", text="", icon='REMOVE')
|
2018-06-07 16:01:57 +02:00
|
|
|
op.index = studio_light.index
|
|
|
|
|
2018-11-30 15:40:46 +01:00
|
|
|
if studio_light.type == 'STUDIO':
|
2018-12-18 15:01:03 +11:00
|
|
|
op = col.operator("wm.studiolight_copy_settings", text="", icon='IMPORT')
|
2018-11-30 15:40:46 +01:00
|
|
|
op.index = studio_light.index
|
|
|
|
|
2018-06-19 14:00:34 +02:00
|
|
|
box.label(text=studio_light.name)
|
|
|
|
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2018-06-08 14:30:11 +02:00
|
|
|
class USERPREF_PT_studiolight_matcaps(Panel, StudioLightPanelMixin):
|
|
|
|
bl_label = "MatCaps"
|
2018-11-28 22:16:56 +01:00
|
|
|
sl_type = 'MATCAP'
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2019-01-16 19:12:51 +01:00
|
|
|
def draw_header_preset(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.operator("wm.studiolight_install", icon='IMPORT', text="Install...").type = 'MATCAP'
|
|
|
|
layout.separator()
|
|
|
|
|
2018-06-08 14:30:11 +02:00
|
|
|
|
|
|
|
class USERPREF_PT_studiolight_world(Panel, StudioLightPanelMixin):
|
2018-11-28 22:16:56 +01:00
|
|
|
bl_label = "LookDev HDRIs"
|
|
|
|
sl_type = 'WORLD'
|
2018-06-08 14:30:11 +02:00
|
|
|
|
2019-01-16 19:12:51 +01:00
|
|
|
def draw_header_preset(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.operator("wm.studiolight_install", icon='IMPORT', text="Install...").type = 'WORLD'
|
|
|
|
layout.separator()
|
|
|
|
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2018-11-28 15:57:40 +01:00
|
|
|
class USERPREF_PT_studiolight_lights(Panel, StudioLightPanelMixin):
|
|
|
|
bl_label = "Studio Lights"
|
2018-11-28 22:16:56 +01:00
|
|
|
sl_type = 'STUDIO'
|
2018-07-17 13:58:08 +02:00
|
|
|
|
2019-01-16 19:12:51 +01:00
|
|
|
def draw_header_preset(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
op = layout.operator("wm.studiolight_install", icon='IMPORT', text="Install...")
|
|
|
|
op.type = 'STUDIO'
|
|
|
|
op.filter_glob = ".sl"
|
|
|
|
layout.separator()
|
|
|
|
|
2018-11-29 21:52:24 +01:00
|
|
|
|
2018-11-30 14:10:20 +01:00
|
|
|
class USERPREF_PT_studiolight_light_editor(Panel):
|
2019-01-16 19:12:51 +01:00
|
|
|
bl_label = "Editor"
|
2018-11-29 21:52:24 +01:00
|
|
|
bl_parent_id = "USERPREF_PT_studiolight_lights"
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2018-11-29 21:52:24 +01:00
|
|
|
bl_region_type = 'WINDOW'
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-29 21:52:24 +01:00
|
|
|
|
|
|
|
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
|
2018-07-17 13:58:08 +02:00
|
|
|
|
2018-12-21 12:47:44 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
system = prefs.system
|
2018-07-17 13:58:08 +02:00
|
|
|
|
2018-11-29 21:52:24 +01:00
|
|
|
row = layout.row()
|
2019-02-11 17:49:35 +11:00
|
|
|
row.prop(system, "use_studio_light_edit", toggle=True)
|
2018-12-20 13:01:40 +11:00
|
|
|
row.operator("wm.studiolight_new", text="Save as Studio light", icon='FILE_TICK')
|
2018-11-29 21:52:24 +01:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
column = layout.split()
|
2019-02-11 17:49:35 +11:00
|
|
|
column.active = system.use_studio_light_edit
|
2018-11-29 21:52:24 +01:00
|
|
|
|
2018-07-17 13:58:08 +02:00
|
|
|
light = system.solid_lights[0]
|
2018-08-28 12:38:54 +10:00
|
|
|
colsplit = column.split(factor=0.85)
|
2018-07-17 13:58:08 +02:00
|
|
|
self.opengl_light_buttons(colsplit, light)
|
|
|
|
|
|
|
|
light = system.solid_lights[1]
|
2018-08-28 12:38:54 +10:00
|
|
|
colsplit = column.split(factor=0.85)
|
2018-07-17 13:58:08 +02:00
|
|
|
self.opengl_light_buttons(colsplit, light)
|
|
|
|
|
|
|
|
light = system.solid_lights[2]
|
2018-11-30 13:58:27 +01:00
|
|
|
colsplit = column.split(factor=0.85)
|
|
|
|
self.opengl_light_buttons(colsplit, light)
|
|
|
|
|
|
|
|
light = system.solid_lights[3]
|
2018-07-17 13:58:08 +02:00
|
|
|
self.opengl_light_buttons(column, light)
|
|
|
|
|
2018-11-28 16:24:55 +01:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.prop(system, "light_ambient")
|
|
|
|
|
2018-11-29 19:54:23 +01:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
ThemeGenericClassGenerator.generate_panel_classes_for_wcols()
|
|
|
|
|
|
|
|
# Order of registration defines order in UI, so dynamically generated classes are 'injected' in the intended order.
|
|
|
|
classes = (USERPREF_PT_theme_user_interface,) + tuple(ThemeGenericClassGenerator.generated_classes)
|
|
|
|
|
|
|
|
classes += (
|
2017-03-18 20:03:24 +11:00
|
|
|
USERPREF_HT_header,
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_navigation_bar,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_save_preferences,
|
|
|
|
|
|
|
|
USERPREF_PT_interface_display,
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_interface_editors,
|
|
|
|
USERPREF_PT_interface_translation,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_interface_text,
|
|
|
|
USERPREF_PT_interface_menus,
|
|
|
|
USERPREF_PT_interface_menus_mouse_over,
|
|
|
|
USERPREF_PT_interface_menus_pie,
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
USERPREF_PT_viewport_display,
|
|
|
|
USERPREF_PT_viewport_quality,
|
|
|
|
USERPREF_PT_viewport_textures,
|
|
|
|
USERPREF_PT_viewport_selection,
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
USERPREF_PT_edit_objects,
|
2019-01-18 11:31:26 +01:00
|
|
|
USERPREF_PT_edit_objects_new,
|
|
|
|
USERPREF_PT_edit_objects_duplicate_data,
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_edit_cursor,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_edit_annotations,
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_edit_weight_paint,
|
|
|
|
USERPREF_PT_edit_gpencil,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_edit_misc,
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_animation_timeline,
|
|
|
|
USERPREF_PT_animation_keyframes,
|
|
|
|
USERPREF_PT_animation_autokey,
|
|
|
|
USERPREF_PT_animation_fcurves,
|
|
|
|
|
|
|
|
USERPREF_PT_system_cycles_devices,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_system_memory,
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_system_sound,
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2017-03-20 02:34:32 +11:00
|
|
|
USERPREF_MT_interface_theme_presets,
|
2017-03-18 20:03:24 +11:00
|
|
|
USERPREF_PT_theme,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_theme_interface_state,
|
|
|
|
USERPREF_PT_theme_interface_styles,
|
|
|
|
USERPREF_PT_theme_interface_gizmos,
|
|
|
|
USERPREF_PT_theme_interface_icons,
|
|
|
|
USERPREF_PT_theme_text_style,
|
|
|
|
USERPREF_PT_theme_bone_color_sets,
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_file_paths_data,
|
|
|
|
USERPREF_PT_file_paths_render,
|
|
|
|
USERPREF_PT_file_paths_applications,
|
|
|
|
USERPREF_PT_file_paths_development,
|
|
|
|
|
|
|
|
USERPREF_PT_saveload_blend,
|
|
|
|
USERPREF_PT_saveload_blend_autosave,
|
|
|
|
USERPREF_PT_saveload_autorun,
|
|
|
|
USERPREF_PT_saveload_file_browser,
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2017-03-20 02:34:32 +11:00
|
|
|
USERPREF_MT_ndof_settings,
|
|
|
|
USERPREF_MT_keyconfigs,
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_input_keyboard,
|
|
|
|
USERPREF_PT_input_mouse,
|
|
|
|
USERPREF_PT_input_tablet,
|
|
|
|
USERPREF_PT_input_ndof,
|
|
|
|
USERPREF_PT_navigation_orbit,
|
|
|
|
USERPREF_PT_navigation_zoom,
|
|
|
|
USERPREF_PT_navigation_fly_walk,
|
|
|
|
USERPREF_PT_navigation_fly_walk_navigation,
|
|
|
|
USERPREF_PT_navigation_fly_walk_gravity,
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
USERPREF_PT_keymap,
|
2017-03-20 02:34:32 +11:00
|
|
|
USERPREF_PT_addons,
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2018-11-28 16:24:55 +01:00
|
|
|
USERPREF_PT_studiolight_lights,
|
2018-11-30 14:10:20 +01:00
|
|
|
USERPREF_PT_studiolight_light_editor,
|
2018-06-08 14:30:11 +02:00
|
|
|
USERPREF_PT_studiolight_matcaps,
|
|
|
|
USERPREF_PT_studiolight_world,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# Add dynamically generated editor theme panels last, so they show up last in the theme section.
|
|
|
|
ThemeGenericClassGenerator.generated_classes.clear()
|
|
|
|
ThemeGenericClassGenerator.generate_panel_classes_from_theme_areas()
|
|
|
|
classes += tuple(ThemeGenericClassGenerator.generated_classes)
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|