2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2009-2023 Blender Authors
|
2023-06-15 13:09:04 +10:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2023-06-15 13:09:04 +10:00
|
|
|
|
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,
|
|
|
|
|
)
|
2022-08-12 12:07:52 +10:00
|
|
|
from bpy.app.translations import (
|
|
|
|
|
contexts as i18n_contexts,
|
|
|
|
|
pgettext_iface as iface_,
|
2022-08-22 15:33:39 +02:00
|
|
|
pgettext_tip as tip_,
|
2022-08-12 12:07:52 +10:00
|
|
|
)
|
2023-05-25 16:25:46 -06:00
|
|
|
from bl_ui.utils import PresetPanel
|
2013-02-10 09:09:26 +00:00
|
|
|
|
2011-06-24 03:30:50 +00:00
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Main Header
|
|
|
|
|
|
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-05-13 15:59:27 +10:00
|
|
|
@staticmethod
|
2019-05-28 16:22:21 +10:00
|
|
|
def draw_buttons(layout, context):
|
2019-05-14 10:00:00 +10:00
|
|
|
prefs = context.preferences
|
|
|
|
|
|
2019-05-19 19:02:21 +02:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2019-05-13 15:59:27 +10:00
|
|
|
|
2019-07-17 09:29:28 +10:00
|
|
|
if prefs.use_preferences_save and (not bpy.app.use_userpref_skip_save_on_exit):
|
|
|
|
|
pass
|
2019-06-12 12:21:21 +10:00
|
|
|
else:
|
2019-08-10 00:06:54 +10:00
|
|
|
# Show '*' to let users know the preferences have been modified.
|
2020-03-09 19:53:59 +01:00
|
|
|
layout.operator(
|
2019-08-10 00:06:54 +10:00
|
|
|
"wm.save_userpref",
|
2020-10-28 22:56:49 +11:00
|
|
|
text=iface_("Save Preferences") + (" *" if prefs.is_dirty else ""),
|
|
|
|
|
translate=False,
|
2019-08-10 00:06:54 +10:00
|
|
|
)
|
2019-05-13 15:59:27 +10: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
|
|
|
|
2020-03-09 19:53:59 +01:00
|
|
|
USERPREF_MT_editor_menus.draw_collapsible(context, layout)
|
|
|
|
|
|
2019-01-17 14:31:18 +01:00
|
|
|
layout.separator_spacer()
|
2020-03-09 19:53:59 +01:00
|
|
|
|
2019-05-13 15:59:27 +10:00
|
|
|
self.draw_buttons(layout, context)
|
2019-01-17 14:31:18 +01:00
|
|
|
|
2010-04-17 19:05:53 +00:00
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Main Navigation Bar
|
|
|
|
|
|
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
|
|
|
|
2020-03-09 19:53:59 +01:00
|
|
|
class USERPREF_MT_editor_menus(Menu):
|
|
|
|
|
bl_idname = "USERPREF_MT_editor_menus"
|
|
|
|
|
bl_label = ""
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.menu("USERPREF_MT_view")
|
|
|
|
|
layout.menu("USERPREF_MT_save_load", text="Preferences")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_MT_view(Menu):
|
|
|
|
|
bl_label = "View"
|
|
|
|
|
|
2021-03-06 18:21:17 +11:00
|
|
|
def draw(self, _context):
|
2020-03-09 19:53:59 +01:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.menu("INFO_MT_area")
|
|
|
|
|
|
|
|
|
|
|
2019-05-15 18:39:41 +10:00
|
|
|
class USERPREF_MT_save_load(Menu):
|
|
|
|
|
bl_label = "Save & Load"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
|
2019-08-11 17:51:09 +10:00
|
|
|
row = layout.row()
|
|
|
|
|
row.active = not bpy.app.use_userpref_skip_save_on_exit
|
|
|
|
|
row.prop(prefs, "use_preferences_save", text="Auto-Save Preferences")
|
2019-05-15 18:39:41 +10:00
|
|
|
|
|
|
|
|
layout.separator()
|
2019-05-19 19:02:21 +02:00
|
|
|
|
|
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2019-05-15 18:39:41 +10:00
|
|
|
if prefs.use_preferences_save:
|
2019-07-17 09:29:28 +10:00
|
|
|
layout.operator("wm.save_userpref", text="Save Preferences")
|
2019-05-15 18:39:41 +10:00
|
|
|
sub_revert = layout.column(align=True)
|
|
|
|
|
sub_revert.active = prefs.is_dirty
|
2019-07-17 09:29:28 +10:00
|
|
|
sub_revert.operator("wm.read_userpref", text="Revert to Saved Preferences")
|
2019-05-19 19:02:21 +02:00
|
|
|
|
|
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2022-10-05 17:08:28 +11:00
|
|
|
|
|
|
|
|
app_template = prefs.app_template
|
|
|
|
|
if app_template:
|
|
|
|
|
display_name = bpy.path.display_name(iface_(app_template))
|
|
|
|
|
layout.operator("wm.read_factory_userpref", text="Load Factory Blender Preferences")
|
2022-11-16 12:06:14 +01:00
|
|
|
props = layout.operator("wm.read_factory_userpref",
|
|
|
|
|
text=iface_("Load Factory %s Preferences") % display_name,
|
|
|
|
|
translate=False)
|
2022-10-05 17:08:28 +11:00
|
|
|
props.use_factory_startup_app_template_only = True
|
|
|
|
|
del display_name
|
|
|
|
|
else:
|
|
|
|
|
layout.operator("wm.read_factory_userpref", text="Load Factory Preferences")
|
2019-05-15 18:39:41 +10: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-05-13 15:59:27 +10:00
|
|
|
def draw(self, context):
|
2020-03-09 19:53:59 +01:00
|
|
|
layout = self.layout.row()
|
2019-01-04 21:40:16 +01:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
|
|
|
|
|
2020-03-09 19:53:59 +01:00
|
|
|
layout.menu("USERPREF_MT_save_load", text="", icon='COLLAPSEMENU')
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-05-28 16:22:21 +10:00
|
|
|
USERPREF_HT_header.draw_buttons(layout, context)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Min-In Helpers
|
|
|
|
|
|
2019-03-13 13:24:46 +11:00
|
|
|
# Panel mix-in.
|
2019-12-19 13:21:41 +11:00
|
|
|
class CenterAlignMixIn:
|
2019-01-04 21:40:16 +01:00
|
|
|
"""
|
|
|
|
|
Base class for panels to center align contents with some horizontal margin.
|
2019-12-19 13:21:41 +11:00
|
|
|
Deriving classes need to implement a ``draw_centered(context, layout)`` function.
|
2019-01-04 21:40:16 +01:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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-12-19 13:21:41 +11:00
|
|
|
# No horizontal margin if region is rather small.
|
|
|
|
|
is_wide = width > (350 * 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-12-19 13:21:41 +11:00
|
|
|
if is_wide:
|
2019-01-04 21:40:16 +01:00
|
|
|
row.label() # Needed so col below is centered.
|
|
|
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
|
col.ui_units_x = 50
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
# Implemented by sub-classes.
|
|
|
|
|
self.draw_centered(context, col)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
if is_wide:
|
2019-01-04 21:40:16 +01:00
|
|
|
row.label() # Needed so col above is centered.
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Interface Panels
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class InterfacePanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "interface"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_interface_display(InterfacePanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Display"
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
view = prefs.view
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(view, "ui_scale", text="Resolution Scale")
|
|
|
|
|
col.prop(view, "ui_line_width", text="Line Width")
|
|
|
|
|
col.prop(view, "show_splash", text="Splash Screen")
|
|
|
|
|
col.prop(view, "show_developer_ui")
|
2020-12-11 14:59:08 +11:00
|
|
|
|
2020-12-07 13:29:53 -08:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
col = layout.column(heading="Tooltips", align=True)
|
2020-12-16 18:02:40 +11:00
|
|
|
col.prop(view, "show_tooltips", text="User Tooltips")
|
2020-12-07 13:29:53 -08:00
|
|
|
sub = col.column()
|
|
|
|
|
sub.active = view.show_tooltips
|
|
|
|
|
sub.prop(view, "show_tooltips_python")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2023-09-25 10:56:12 +02:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
col = layout.column(heading="Search", align=True)
|
|
|
|
|
col.prop(prefs, "use_recent_searches", text="Sort by Most Recent")
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_interface_text(InterfacePanel, CenterAlignMixIn, Panel):
|
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-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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)
|
|
|
|
|
|
2020-05-29 13:57:40 -04:00
|
|
|
flow.prop(view, "use_text_antialiasing", text="Anti-Aliasing")
|
2019-01-06 21:51:07 +01:00
|
|
|
sub = flow.column()
|
2019-01-04 21:40:16 +01:00
|
|
|
sub.active = view.use_text_antialiasing
|
2023-09-29 19:02:25 +02:00
|
|
|
sub.prop(view, "use_text_render_subpixelaa", text="Subpixel Anti-Aliasing")
|
2019-01-04 21:40:16 +01:00
|
|
|
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-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_interface_translation(InterfacePanel, CenterAlignMixIn, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Translation"
|
2019-05-09 10:09:14 +02:00
|
|
|
bl_translation_context = i18n_contexts.id_windowmanager
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
@classmethod
|
2021-03-06 18:21:17 +11:00
|
|
|
def poll(cls, _context):
|
2019-12-19 13:21:41 +11:00
|
|
|
return bpy.app.build_options.international
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
view = prefs.view
|
2013-01-15 23:15:32 +00:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
layout.prop(view, "language")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Affect")
|
2023-10-04 10:30:28 +11:00
|
|
|
col.active = (bpy.app.translations.locale != "en_US")
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(view, "use_translate_tooltips", text="Tooltips")
|
|
|
|
|
col.prop(view, "use_translate_interface", text="Interface")
|
|
|
|
|
col.prop(view, "use_translate_new_dataname", text="New Data")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_interface_editors(InterfacePanel, CenterAlignMixIn, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Editors"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(system, "use_region_overlap")
|
|
|
|
|
col.prop(view, "show_navigate_ui")
|
|
|
|
|
col.prop(view, "color_picker_type")
|
|
|
|
|
col.row().prop(view, "header_align")
|
|
|
|
|
col.prop(view, "factor_display_type")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_interface_temporary_windows(InterfacePanel, CenterAlignMixIn, Panel):
|
2020-10-28 10:09:31 -07:00
|
|
|
bl_label = "Temporary Editors"
|
2019-09-18 14:32:21 +02:00
|
|
|
bl_parent_id = "USERPREF_PT_interface_editors"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-09-18 14:32:21 +02:00
|
|
|
prefs = context.preferences
|
|
|
|
|
view = prefs.view
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2020-10-24 11:42:17 -07:00
|
|
|
col.prop(view, "render_display_type", text="Render In")
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(view, "filebrowser_display_type", text="File Browser")
|
2019-09-18 14:32:21 +02:00
|
|
|
|
|
|
|
|
|
2020-07-18 07:49:25 -07:00
|
|
|
class USERPREF_PT_interface_statusbar(InterfacePanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Status Bar"
|
|
|
|
|
bl_parent_id = "USERPREF_PT_interface_editors"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
view = prefs.view
|
|
|
|
|
|
|
|
|
|
col = layout.column(heading="Show")
|
|
|
|
|
col.prop(view, "show_statusbar_stats", text="Scene Statistics")
|
2023-03-23 10:18:38 +01:00
|
|
|
col.prop(view, "show_statusbar_scene_duration", text="Scene Duration")
|
2020-07-18 07:49:25 -07:00
|
|
|
col.prop(view, "show_statusbar_memory", text="System Memory")
|
|
|
|
|
col.prop(view, "show_statusbar_vram", text="Video Memory")
|
|
|
|
|
col.prop(view, "show_statusbar_version", text="Blender Version")
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_interface_menus(InterfacePanel, Panel):
|
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-18 11:31:26 +01:00
|
|
|
def draw(self, context):
|
|
|
|
|
pass
|
2018-06-25 12:58:24 +02:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_interface_menus_mouse_over(InterfacePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
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-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_interface_menus_pie(InterfacePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Pie Menus"
|
|
|
|
|
bl_parent_id = "USERPREF_PT_interface_menus"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Editing Panels
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class EditingPanel:
|
2019-01-18 11:31:26 +01:00
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
2019-12-19 13:21:41 +11:00
|
|
|
bl_context = "editing"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
|
|
|
|
|
class USERPREF_PT_edit_objects(EditingPanel, Panel):
|
|
|
|
|
bl_label = "Objects"
|
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-03-20 10:44:13 +11:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_edit_objects_new(EditingPanel, CenterAlignMixIn, Panel):
|
2019-01-18 11:31:26 +01:00
|
|
|
bl_label = "New Objects"
|
|
|
|
|
bl_parent_id = "USERPREF_PT_edit_objects"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(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
|
|
|
|
2020-10-24 11:42:17 -07:00
|
|
|
flow.prop(edit, "material_link", text="Link Materials To")
|
|
|
|
|
flow.prop(edit, "object_align", text="Align To")
|
2019-01-18 11:31:26 +01:00
|
|
|
flow.prop(edit, "use_enter_edit_mode", text="Enter Edit Mode")
|
2020-05-12 10:59:41 +02:00
|
|
|
flow.prop(edit, "collection_instance_empty_size", text="Instance Empty Size")
|
2009-12-08 19:08:35 +00:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_edit_objects_duplicate_data(EditingPanel, CenterAlignMixIn, Panel):
|
2023-09-22 01:07:56 +02:00
|
|
|
bl_label = "Copy on Duplicate"
|
2019-01-06 12:56:18 +01:00
|
|
|
bl_parent_id = "USERPREF_PT_edit_objects"
|
2023-09-22 01:07:56 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
layout.use_property_split = False
|
|
|
|
|
|
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
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
datablock_types = (
|
|
|
|
|
("use_duplicate_action", "Action", 'ACTION', ''),
|
|
|
|
|
("use_duplicate_armature", "Armature", 'OUTLINER_DATA_ARMATURE', ''),
|
|
|
|
|
("use_duplicate_camera", "Camera", 'OUTLINER_DATA_CAMERA', ''),
|
|
|
|
|
("use_duplicate_curve", "Curve", 'OUTLINER_DATA_CURVE', ''),
|
|
|
|
|
("use_duplicate_curves", "Curves", 'OUTLINER_DATA_CURVES', ''),
|
|
|
|
|
("use_duplicate_grease_pencil", "Grease Pencil", 'OUTLINER_OB_GREASEPENCIL', ''),
|
|
|
|
|
("use_duplicate_lattice", "Lattice", 'OUTLINER_DATA_LATTICE', ''),
|
|
|
|
|
(None, None, None, None),
|
|
|
|
|
("use_duplicate_light", "Light", 'OUTLINER_DATA_LIGHT', ''),
|
|
|
|
|
("use_duplicate_lightprobe", "Light Probe", 'OUTLINER_DATA_LIGHTPROBE', ''),
|
|
|
|
|
("use_duplicate_material", "Material", 'MATERIAL_DATA', ''),
|
|
|
|
|
("use_duplicate_mesh", "Mesh", 'OUTLINER_DATA_MESH', ''),
|
|
|
|
|
("use_duplicate_metaball", "Metaball", 'OUTLINER_DATA_META', ''),
|
|
|
|
|
("use_duplicate_node_tree", "Node Tree", 'NODETREE', ''),
|
|
|
|
|
("use_duplicate_particle", "Particle", 'PARTICLES', ''),
|
|
|
|
|
(None, None, None, None),
|
|
|
|
|
("use_duplicate_pointcloud", "Point Cloud", 'OUTLINER_DATA_POINTCLOUD', ''),
|
|
|
|
|
("use_duplicate_speaker", "Speaker", 'OUTLINER_DATA_SPEAKER', ''),
|
|
|
|
|
("use_duplicate_surface", "Surface", 'OUTLINER_DATA_SURFACE', ''),
|
|
|
|
|
("use_duplicate_text", "Text", 'OUTLINER_DATA_FONT', ''),
|
|
|
|
|
("use_duplicate_volume", "Volume", 'OUTLINER_DATA_VOLUME', 'i18n_contexts.id_id'),
|
|
|
|
|
)
|
2021-10-22 12:33:03 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
col = flow.column()
|
2021-10-22 12:33:03 +02:00
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
for prop, type_name, type_icon, type_ctx in datablock_types:
|
|
|
|
|
if prop is None:
|
|
|
|
|
col = flow.column()
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
row = col.row()
|
|
|
|
|
|
|
|
|
|
row_checkbox = row.row()
|
2023-09-22 10:16:13 +10:00
|
|
|
row_checkbox.prop(edit, prop, text="", text_ctxt=type_ctx)
|
2023-09-22 01:07:56 +02:00
|
|
|
|
|
|
|
|
row_label = row.row()
|
|
|
|
|
row_label.label(text=type_name, icon=type_icon)
|
|
|
|
|
|
|
|
|
|
row_label.active = getattr(edit, prop)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_edit_cursor(EditingPanel, CenterAlignMixIn, Panel):
|
2019-01-18 11:31:26 +01:00
|
|
|
bl_label = "3D Cursor"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-18 11:31:26 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
col = layout.column(heading="Cursor")
|
|
|
|
|
col.prop(edit, "use_mouse_depth_cursor", text="Surface Project")
|
|
|
|
|
col.prop(edit, "use_cursor_lock_adjust", text="Lock Adjust")
|
2019-01-18 11:31:26 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_edit_gpencil(EditingPanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Grease Pencil"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Distance")
|
|
|
|
|
col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan")
|
|
|
|
|
col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_edit_annotations(EditingPanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Annotations"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
2009-10-31 19:31:45 +00:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(edit, "grease_pencil_default_color", text="Default Color")
|
|
|
|
|
col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-03-20 10:44:13 +11:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_edit_weight_paint(EditingPanel, CenterAlignMixIn, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Weight Paint"
|
2019-01-18 11:31:26 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-16 18:49:31 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
view = prefs.view
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
layout.use_property_split = False
|
|
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
layout.prop(view, "use_weight_color_range", text="Custom Gradient")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.active = view.use_weight_color_range
|
|
|
|
|
col.template_color_ramp(view, "weight_color_range", expand=True)
|
|
|
|
|
|
2022-03-23 11:59:56 +11:00
|
|
|
|
2021-11-13 13:49:09 +11:00
|
|
|
class USERPREF_PT_edit_text_editor(EditingPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Text Editor"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
|
|
|
|
layout.prop(edit, "use_text_edit_auto_close")
|
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2023-08-18 15:54:47 +02:00
|
|
|
class USERPREF_PT_edit_node_editor(EditingPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Node Editor"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
col = layout.column(heading="Auto-Offset")
|
|
|
|
|
row = col.row()
|
|
|
|
|
row.prop(edit, "node_use_insert_offset", text="")
|
|
|
|
|
subrow = row.row()
|
|
|
|
|
subrow.prop(edit, "node_margin", text="")
|
|
|
|
|
subrow.active = edit.node_use_insert_offset
|
|
|
|
|
|
|
|
|
|
layout.prop(edit, "node_preview_resolution", text="Preview Resolution")
|
2023-08-18 15:54:47 +02:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_edit_misc(EditingPanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Miscellaneous"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2014-09-30 18:29:32 +02:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color")
|
2019-01-06 12:56:18 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Animation Panels
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class AnimationPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "animation"
|
2019-01-06 12:56:18 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_animation_timeline(AnimationPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Timeline"
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
2019-01-16 18:49:31 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
view = prefs.view
|
2019-01-17 12:41:38 +01:00
|
|
|
edit = prefs.edit
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(edit, "use_negative_frames")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(view, "view2d_grid_spacing_min", text="Minimum Grid Spacing")
|
|
|
|
|
col.prop(view, "timecode_style")
|
|
|
|
|
col.prop(view, "view_frame_type")
|
2019-01-16 18:49:31 +01:00
|
|
|
if view.view_frame_type == 'SECONDS':
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(view, "view_frame_seconds")
|
2019-01-16 18:49:31 +01:00
|
|
|
elif view.view_frame_type == 'KEYFRAMES':
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(view, "view_frame_keyframes")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_animation_keyframes(AnimationPanel, CenterAlignMixIn, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Keyframes"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-06 12:56:18 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(edit, "use_visual_keying")
|
|
|
|
|
col.prop(edit, "use_keyframe_insert_needed", text="Only Insert Needed")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Auto-Keyframing")
|
|
|
|
|
col.prop(edit, "use_auto_keying_warning", text="Show Warning")
|
|
|
|
|
col.prop(edit, "use_keyframe_insert_available", text="Only Insert Available")
|
|
|
|
|
col.prop(edit, "use_auto_keying", text="Enable in New Scenes")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_animation_fcurves(AnimationPanel, CenterAlignMixIn, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "F-Curves"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-16 18:49:31 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
2021-01-12 19:14:57 -06:00
|
|
|
flow.prop(edit, "fcurve_unselected_alpha", text="Unselected Opacity")
|
2019-10-01 21:38:44 +03:00
|
|
|
flow.prop(edit, "fcurve_new_auto_smoothing", text="Default Smoothing Mode")
|
2019-01-16 18:49:31 +01:00
|
|
|
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")
|
2020-10-30 10:57:46 +01:00
|
|
|
flow.prop(edit, "use_anim_channel_group_colors")
|
2023-03-09 14:15:23 +01:00
|
|
|
flow.prop(edit, "show_only_selected_curve_keyframes")
|
|
|
|
|
flow.prop(edit, "use_fcurve_high_quality_drawing")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# System Panels
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class SystemPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "system"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_system_sound(SystemPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Sound"
|
2020-04-17 17:56:54 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2019-12-19 13:21:41 +11:00
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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)
|
2021-04-22 10:23:02 +02:00
|
|
|
sub.active = system.audio_device not in {'NONE', 'None'}
|
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-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_system_cycles_devices(SystemPanel, CenterAlignMixIn, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Cycles Render Devices"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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
|
|
|
|
2013-12-31 18:09:20 -06:00
|
|
|
|
2021-06-14 10:15:37 -07:00
|
|
|
class USERPREF_PT_system_os_settings(SystemPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Operating System Settings"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, _context):
|
|
|
|
|
# Only for Windows so far
|
|
|
|
|
import sys
|
|
|
|
|
return sys.platform[:3] == "win"
|
|
|
|
|
|
2021-06-15 10:44:08 +10:00
|
|
|
def draw_centered(self, _context, layout):
|
2023-05-24 21:19:56 +02:00
|
|
|
if _context.preferences.system.is_microsoft_store_install:
|
2023-07-10 14:17:06 +02:00
|
|
|
layout.label(text="Microsoft Store installation")
|
|
|
|
|
layout.label(text="Use Windows 'Default Apps' to associate with blend files")
|
2023-05-24 21:19:56 +02:00
|
|
|
else:
|
|
|
|
|
layout.label(text="Open blend files with this Blender version")
|
|
|
|
|
split = layout.split(factor=0.5)
|
|
|
|
|
split.alignment = 'LEFT'
|
|
|
|
|
split.operator("preferences.associate_blend", text="Register")
|
|
|
|
|
split.operator("preferences.unassociate_blend", text="Unregister")
|
|
|
|
|
layout.prop(bpy.context.preferences.system, "register_all_users", text="For All Users")
|
2021-06-14 10:15:37 -07:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_system_memory(SystemPanel, CenterAlignMixIn, Panel):
|
2019-12-19 13:20:37 +11:00
|
|
|
bl_label = "Memory & Limits"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-12-19 13:20:37 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
|
system = prefs.system
|
|
|
|
|
edit = prefs.edit
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(edit, "undo_steps", text="Undo Steps")
|
|
|
|
|
col.prop(edit, "undo_memory_limit", text="Undo Memory Limit")
|
|
|
|
|
col.prop(edit, "use_global_undo")
|
2019-12-19 13:20:37 +11:00
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(system, "scrollback", text="Console Scrollback Lines")
|
2019-12-19 13:20:37 +11:00
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(system, "texture_time_out", text="Texture Time Out")
|
|
|
|
|
col.prop(system, "texture_collection_rate", text="Garbage Collection Rate")
|
2019-12-19 13:20:37 +11:00
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2022-08-17 22:23:48 +02:00
|
|
|
col.prop(system, "vbo_time_out", text="VBO Time Out")
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(system, "vbo_collection_rate", text="Garbage Collection Rate")
|
2019-12-19 13:20:37 +11:00
|
|
|
|
|
|
|
|
|
2020-04-17 17:56:54 +02:00
|
|
|
class USERPREF_PT_system_video_sequencer(SystemPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Video Sequencer"
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
system = prefs.system
|
2021-03-06 18:16:39 +11:00
|
|
|
# edit = prefs.edit
|
2020-04-17 17:56:54 +02:00
|
|
|
|
|
|
|
|
layout.prop(system, "memory_cache_limit")
|
2019-12-19 13:20:37 +11:00
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
2022-08-17 22:14:28 +02:00
|
|
|
layout.prop(system, "use_sequencer_disk_cache", text="Disk Cache")
|
2020-04-17 17:56:54 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.active = system.use_sequencer_disk_cache
|
|
|
|
|
col.prop(system, "sequencer_disk_cache_dir", text="Directory")
|
|
|
|
|
col.prop(system, "sequencer_disk_cache_size_limit", text="Cache Limit")
|
|
|
|
|
col.prop(system, "sequencer_disk_cache_compression", text="Compression")
|
2019-12-19 13:20:37 +11:00
|
|
|
|
2021-03-16 18:47:23 +01:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
layout.prop(system, "sequencer_proxy_setup")
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Viewport Panels
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class ViewportPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "viewport"
|
2014-07-23 15:24:07 +02:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_viewport_display(ViewportPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Display"
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
2019-01-16 18:49:31 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
view = prefs.view
|
|
|
|
|
|
2022-03-21 18:07:39 +01:00
|
|
|
col = layout.column(heading="Text Info Overlay")
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(view, "show_object_info", text="Object Info")
|
|
|
|
|
col.prop(view, "show_view_name", text="View Name")
|
2023-09-22 01:07:56 +02:00
|
|
|
|
|
|
|
|
col = layout.column(heading="Playback Frame Rate (FPS)")
|
2023-08-25 19:22:05 +10:00
|
|
|
row = col.row()
|
2023-09-22 01:07:56 +02:00
|
|
|
row.prop(view, "show_playback_fps", text="")
|
|
|
|
|
subrow = row.row()
|
|
|
|
|
subrow.active = view.show_playback_fps
|
|
|
|
|
subrow.prop(view, "playback_fps_samples", text="Samples")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2019-05-04 14:03:51 +02:00
|
|
|
col.prop(view, "gizmo_size")
|
2019-05-09 21:35:52 +10:00
|
|
|
col.prop(view, "lookdev_sphere_size")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.separator()
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2023-03-16 00:12:29 +01:00
|
|
|
col.prop(view, "mini_axis_type", text="3D Viewport Axes")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
if view.mini_axis_type == 'MINIMAL':
|
2019-06-25 21:34:21 +10:00
|
|
|
col.prop(view, "mini_axis_size", text="Size")
|
|
|
|
|
col.prop(view, "mini_axis_brightness", text="Brightness")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2021-01-23 13:10:07 -08:00
|
|
|
if view.mini_axis_type == 'GIZMO':
|
|
|
|
|
col.prop(view, "gizmo_size_navigate_v3d", text="Size")
|
|
|
|
|
|
2023-08-28 15:29:25 +02:00
|
|
|
layout.separator()
|
|
|
|
|
col = layout.column(heading="Fresnel")
|
|
|
|
|
col.prop(view, "use_fresnel_edit")
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_viewport_quality(ViewportPanel, CenterAlignMixIn, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Quality"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
system = prefs.system
|
2013-12-31 18:09:20 -06:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(system, "viewport_aa")
|
2019-01-06 21:51:07 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Smooth Wires")
|
|
|
|
|
col.prop(system, "use_overlay_smooth_wire", text="Overlay")
|
|
|
|
|
col.prop(system, "use_edit_mode_smooth_wire", text="Edit Mode")
|
2013-12-31 18:09:20 -06:00
|
|
|
|
2018-06-18 08:51:29 +02:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_viewport_textures(ViewportPanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Textures"
|
2013-12-31 18:09:20 -06:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
system = prefs.system
|
2009-12-15 14:22:34 +00:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(system, "gl_texture_limit", text="Limit Size")
|
|
|
|
|
col.prop(system, "anisotropic_filter")
|
|
|
|
|
col.prop(system, "gl_clip_alpha", slider=True)
|
|
|
|
|
col.prop(system, "image_draw_method", text="Image Display Method")
|
2019-01-06 21:51:07 +01:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_viewport_selection(ViewportPanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Selection"
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
system = prefs.system
|
2009-12-17 01:21:55 +00:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
layout.prop(system, "use_select_pick_depth")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
|
|
|
|
|
OpenSubDiv: add support for an OpenGL evaluator
This evaluator is used in order to evaluate subdivision at render time, allowing for
faster renders of meshes with a subdivision surface modifier placed at the last
position in the modifier list.
When evaluating the subsurf modifier, we detect whether we can delegate evaluation
to the draw code. If so, the subdivision is first evaluated on the GPU using our own
custom evaluator (only the coarse data needs to be initially sent to the GPU), then,
buffers for the final `MeshBufferCache` are filled on the GPU using a set of
compute shaders. However, some buffers are still filled on the CPU side, if doing so
on the GPU is impractical (e.g. the line adjacency buffer used for x-ray, whose
logic is hardly GPU compatible).
This is done at the mesh buffer extraction level so that the result can be readily used
in the various OpenGL engines, without having to write custom geometry or tesselation
shaders.
We use our own subdivision evaluation shaders, instead of OpenSubDiv's vanilla one, in
order to control the data layout, and interpolation. For example, we store vertex colors
as compressed 16-bit integers, while OpenSubDiv's default evaluator only work for float
types.
In order to still access the modified geometry on the CPU side, for use in modifiers
or transform operators, a dedicated wrapper type is added `MESH_WRAPPER_TYPE_SUBD`.
Subdivision will be lazily evaluated via `BKE_object_get_evaluated_mesh` which will
create such a wrapper if possible. If the final subdivision surface is not needed on
the CPU side, `BKE_object_get_evaluated_mesh_no_subsurf` should be used.
Enabling or disabling GPU subdivision can be done through the user preferences (under
Viewport -> Subdivision).
See patch description for benchmarks.
Reviewed By: campbellbarton, jbakker, fclem, brecht, #eevee_viewport
Differential Revision: https://developer.blender.org/D12406
2021-12-27 16:34:47 +01:00
|
|
|
class USERPREF_PT_viewport_subdivision(ViewportPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Subdivision"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
system = prefs.system
|
|
|
|
|
|
|
|
|
|
layout.prop(system, "use_gpu_subdivision")
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Theme Panels
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class ThemePanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "themes"
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2019-04-19 07:51:14 +02:00
|
|
|
@staticmethod
|
2018-10-10 18:11:11 +02:00
|
|
|
def reset_cb(context):
|
2019-03-02 00:52:00 +11:00
|
|
|
bpy.ops.preferences.reset_default_theme()
|
2018-10-08 19:19:05 +02:00
|
|
|
|
2012-01-10 15:08:12 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_theme(ThemePanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Themes"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-11-02 17:18:17 +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-03-02 00:21:05 +11:00
|
|
|
row.operator("preferences.theme_install", text="Install...", icon='IMPORT')
|
2019-03-02 00:52:00 +11:00
|
|
|
row.operator("preferences.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-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_theme_user_interface(ThemePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "User Interface"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
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.
|
2019-12-19 13:21:41 +11:00
|
|
|
# This is not registered.
|
2019-03-13 13:24:46 +11:00
|
|
|
class PreferenceThemeWidgetColorPanel:
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
2013-06-06 20:36:28 +00:00
|
|
|
|
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-09-12 16:03:49 +02:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=2, even_columns=True, even_rows=False, align=False)
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-09-12 16:03:49 +02:00
|
|
|
col = flow.column(align=True)
|
|
|
|
|
col.prop(widget_style, "text")
|
|
|
|
|
col.prop(widget_style, "text_sel", text="Selected")
|
2019-01-04 21:40:16 +01:00
|
|
|
col.prop(widget_style, "item", slider=True)
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-09-12 16:03:49 +02:00
|
|
|
col = flow.column(align=True)
|
|
|
|
|
col.prop(widget_style, "inner", slider=True)
|
|
|
|
|
col.prop(widget_style, "inner_sel", text="Selected", slider=True)
|
|
|
|
|
col.prop(widget_style, "outline")
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2019-09-12 16:03:49 +02:00
|
|
|
col.separator()
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-09-12 16:03:49 +02:00
|
|
|
col.prop(widget_style, "roundness")
|
2013-06-06 20:36:28 +00:00
|
|
|
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
# Base class for dynamically defined widget color panels.
|
|
|
|
|
# This is not registered.
|
2019-09-12 16:03:49 +02:00
|
|
|
class PreferenceThemeWidgetShadePanel:
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
|
ui = theme.user_interface
|
|
|
|
|
widget_style = getattr(ui, self.wcol)
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
col.active = widget_style.show_shaded
|
|
|
|
|
col.prop(widget_style, "shadetop", text="Shade Top")
|
|
|
|
|
col.prop(widget_style, "shadedown", text="Down")
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
|
ui = theme.user_interface
|
|
|
|
|
widget_style = getattr(ui, self.wcol)
|
|
|
|
|
|
|
|
|
|
self.layout.prop(widget_style, "show_shaded", text="")
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_theme_interface_state(ThemePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "State"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(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")
|
2023-08-31 14:55:55 +02:00
|
|
|
col.prop(ui_state, "inner_anim_sel", text="Selected")
|
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")
|
2023-08-31 14:55:55 +02:00
|
|
|
col.prop(ui_state, "inner_driven_sel", text="Selected")
|
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")
|
2023-08-31 14:55:55 +02:00
|
|
|
col.prop(ui_state, "inner_key_sel", text="Selected")
|
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")
|
2023-08-31 14:55:55 +02:00
|
|
|
col.prop(ui_state, "inner_overridden_sel", text="Selected")
|
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")
|
2023-08-31 14:55:55 +02:00
|
|
|
col.prop(ui_state, "inner_changed_sel", text="Selected")
|
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")
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_theme_interface_styles(ThemePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Styles"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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
|
|
|
|
2023-08-31 14:55:55 +02:00
|
|
|
col = flow.column(align=True)
|
|
|
|
|
col.prop(ui, "menu_shadow_fac")
|
|
|
|
|
col.prop(ui, "menu_shadow_width", text="Shadow Width")
|
|
|
|
|
|
|
|
|
|
col = flow.column(align=True)
|
|
|
|
|
col.prop(ui, "icon_alpha")
|
|
|
|
|
col.prop(ui, "icon_saturation", text="Saturation")
|
|
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
|
col.prop(ui, "widget_text_cursor")
|
|
|
|
|
col.prop(ui, "editor_outline")
|
|
|
|
|
col.prop(ui, "widget_emboss")
|
|
|
|
|
col.prop(ui, "panel_roundness")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2020-03-23 16:00:42 +01:00
|
|
|
class USERPREF_PT_theme_interface_transparent_checker(ThemePanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Transparent Checkerboard"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
|
ui = theme.user_interface
|
|
|
|
|
|
|
|
|
|
flow = layout.grid_flow(
|
|
|
|
|
row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
|
2023-08-31 14:55:55 +02:00
|
|
|
col = flow.column(align=True)
|
|
|
|
|
col.prop(ui, "transparent_checker_primary")
|
|
|
|
|
col.prop(ui, "transparent_checker_secondary")
|
|
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
|
col.prop(ui, "transparent_checker_size")
|
2020-03-23 16:00:42 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_theme_interface_gizmos(ThemePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Axis & Gizmo Colors"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_parent_id = "USERPREF_PT_theme_user_interface"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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")
|
2023-08-31 14:55:55 +02:00
|
|
|
col.prop(ui, "gizmo_secondary", text="Secondary")
|
|
|
|
|
col.prop(ui, "gizmo_view_align", text="View Align")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
|
col.prop(ui, "gizmo_a")
|
2023-08-31 14:55:55 +02:00
|
|
|
col.prop(ui, "gizmo_b", text="B")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_theme_interface_icons(ThemePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
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-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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-05-09 17:07:06 +02:00
|
|
|
flow.prop(ui, "icon_scene")
|
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")
|
2019-09-10 08:07:39 -07:00
|
|
|
flow.prop(ui, "icon_folder")
|
2019-05-09 15:53:44 +02:00
|
|
|
flow.prop(ui, "icon_border_intensity")
|
2018-04-26 21:17:33 +02:00
|
|
|
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_theme_text_style(ThemePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Text Style"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
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
|
2023-08-31 14:55:55 +02: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
|
|
|
col = flow.column()
|
|
|
|
|
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
|
|
|
|
2023-08-31 14:55:55 +02:00
|
|
|
col = flow.column(align=True)
|
2019-01-04 21:40:16 +01:00
|
|
|
col.prop(font_style, "shadow")
|
2023-08-31 14:55:55 +02:00
|
|
|
col.prop(font_style, "shadow_alpha", text="Alpha")
|
|
|
|
|
col.prop(font_style, "shadow_value", text="Brightness")
|
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-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_theme_bone_color_sets(ThemePanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
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-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-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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):
|
2020-07-16 23:50:33 +10:00
|
|
|
layout.label(text=iface_("Color Set %d") % i, translate=False)
|
2010-06-26 17:06:55 +00:00
|
|
|
|
2023-08-31 14:55:55 +02:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
2011-11-19 20:57:53 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
flow.prop(ui, "normal")
|
2023-08-31 14:55:55 +02:00
|
|
|
flow.prop(ui, "select", text="Selected")
|
2019-01-04 21:40:16 +01:00
|
|
|
flow.prop(ui, "active")
|
|
|
|
|
flow.prop(ui, "show_colored_constraints")
|
2012-12-20 16:50:39 +00:00
|
|
|
|
2020-10-02 10:10:01 +10:00
|
|
|
|
2020-09-15 12:13:03 -06:00
|
|
|
class USERPREF_PT_theme_collection_colors(ThemePanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Collection Colors"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw_header(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.label(icon='OUTLINER_COLLECTION')
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
2023-08-31 14:55:55 +02:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=2, even_columns=True, even_rows=False, align=False)
|
2020-09-15 12:13:03 -06:00
|
|
|
for i, ui in enumerate(theme.collection_color, 1):
|
2020-10-16 14:06:47 +11:00
|
|
|
flow.prop(ui, "color", text=iface_("Color %d") % i, translate=False)
|
2020-09-15 12:13:03 -06:00
|
|
|
|
2012-12-20 16:50:39 +00:00
|
|
|
|
2021-09-29 14:29:32 +02:00
|
|
|
class USERPREF_PT_theme_strip_colors(ThemePanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Strip Colors"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw_header(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.label(icon='SEQ_STRIP_DUPLICATE')
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
theme = context.preferences.themes[0]
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
2023-08-31 14:55:55 +02:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=2, even_columns=True, even_rows=False, align=False)
|
2021-09-29 14:29:32 +02:00
|
|
|
for i, ui in enumerate(theme.strip_color, 1):
|
|
|
|
|
flow.prop(ui, "color", text=iface_("Color %d") % i, translate=False)
|
|
|
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
# Base class for dynamically defined theme-space panels.
|
2019-12-19 13:21:41 +11:00
|
|
|
# This is not registered.
|
2019-03-13 13:24:46 +11:00
|
|
|
class PreferenceThemeSpacePanel:
|
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",
|
2019-12-17 16:11:31 +03:00
|
|
|
"bone_locked_weight",
|
2019-01-04 21:40:16 +01:00
|
|
|
"paint_curve_pivot",
|
|
|
|
|
},
|
|
|
|
|
'GRAPH_EDITOR': {
|
|
|
|
|
"handle_vertex_select",
|
|
|
|
|
},
|
|
|
|
|
'IMAGE_EDITOR': {
|
|
|
|
|
"paint_curve_pivot",
|
|
|
|
|
},
|
|
|
|
|
'NODE_EDITOR': {
|
|
|
|
|
"layout_node",
|
|
|
|
|
},
|
|
|
|
|
'CLIP_EDITOR': {
|
|
|
|
|
"handle_vertex_select",
|
2022-12-15 17:24:23 +11:00
|
|
|
},
|
2019-01-04 21:40:16 +01:00
|
|
|
}
|
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-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
|
|
|
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
|
|
|
|
|
|
|
|
|
2020-05-21 16:17:44 +10:00
|
|
|
class ThemeGenericClassGenerator:
|
2018-10-02 19:04:38 +02:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
@staticmethod
|
|
|
|
|
def generate_panel_classes_for_wcols():
|
|
|
|
|
wcols = [
|
|
|
|
|
("Box", "wcol_box"),
|
2023-08-31 13:01:56 +02:00
|
|
|
("List Item", "wcol_list_item"),
|
2019-01-04 21:40:16 +01:00
|
|
|
("Menu", "wcol_menu"),
|
2023-08-31 13:01:56 +02:00
|
|
|
("Menu Background", "wcol_menu_back"),
|
|
|
|
|
("Menu Item", "wcol_menu_item"),
|
|
|
|
|
("Number Field", "wcol_num"),
|
|
|
|
|
("Option", "wcol_option"),
|
2019-01-04 21:40:16 +01:00
|
|
|
("Pie Menu", "wcol_pie_menu"),
|
2023-08-31 13:01:56 +02:00
|
|
|
("Progress Bar", "wcol_progress"),
|
2019-01-04 21:40:16 +01:00
|
|
|
("Pulldown", "wcol_pulldown"),
|
2023-08-31 13:01:56 +02:00
|
|
|
("Radio Buttons", "wcol_radio"),
|
|
|
|
|
("Regular", "wcol_regular"),
|
2019-01-04 21:40:16 +01:00
|
|
|
("Scroll Bar", "wcol_scroll"),
|
2023-08-31 13:01:56 +02:00
|
|
|
("Tab", "wcol_tab"),
|
|
|
|
|
("Text", "wcol_text"),
|
|
|
|
|
("Toggle", "wcol_toggle"),
|
|
|
|
|
("Tool", "wcol_tool"),
|
|
|
|
|
("Toolbar Item", "wcol_toolbar_item"),
|
|
|
|
|
("Tooltip", "wcol_tooltip"),
|
|
|
|
|
("Value Slider", "wcol_numslider"),
|
2019-01-04 21:40:16 +01:00
|
|
|
]
|
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
|
2019-12-19 13:21:41 +11:00
|
|
|
yield type(panel_id, (PreferenceThemeWidgetColorPanel, ThemePanel, Panel), {
|
2019-01-04 21:40:16 +01:00
|
|
|
"bl_label": name,
|
|
|
|
|
"bl_options": {'DEFAULT_CLOSED'},
|
|
|
|
|
"draw": PreferenceThemeWidgetColorPanel.draw,
|
|
|
|
|
"wcol": wcol,
|
|
|
|
|
})
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2019-09-12 16:03:49 +02:00
|
|
|
panel_shade_id = "USERPREF_PT_theme_interface_shade_" + wcol
|
2019-12-19 13:21:41 +11:00
|
|
|
yield type(panel_shade_id, (PreferenceThemeWidgetShadePanel, ThemePanel, Panel), {
|
2019-09-12 16:03:49 +02:00
|
|
|
"bl_label": "Shaded",
|
|
|
|
|
"bl_options": {'DEFAULT_CLOSED'},
|
|
|
|
|
"bl_parent_id": panel_id,
|
|
|
|
|
"draw": PreferenceThemeWidgetShadePanel.draw,
|
|
|
|
|
"wcol": wcol,
|
|
|
|
|
})
|
|
|
|
|
|
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
|
2019-12-19 13:21:41 +11:00
|
|
|
yield type(panel_id, (PreferenceThemeSpacePanel, ThemePanel, Panel), {
|
2019-01-04 21:40:16 +01:00
|
|
|
"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,
|
|
|
|
|
})
|
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
yield from generate_child_panel_classes_recurse(
|
|
|
|
|
panel_id,
|
|
|
|
|
prop.fixed_type,
|
|
|
|
|
theme_area,
|
|
|
|
|
new_datapath,
|
|
|
|
|
)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-03-13 13:03:54 +11:00
|
|
|
yield from 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
|
|
|
|
2023-01-06 13:52:57 +11:00
|
|
|
for theme_area in Theme.bl_rna.properties["theme_area"].enum_items_static:
|
2019-01-04 21:40:16 +01:00
|
|
|
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
|
2019-12-19 13:21:41 +11:00
|
|
|
yield type(panel_id, (PreferenceThemeSpacePanel, ThemePanel, Panel), {
|
2019-01-04 21:40:16 +01:00
|
|
|
"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(),
|
|
|
|
|
})
|
|
|
|
|
|
2019-03-13 13:03:54 +11:00
|
|
|
yield from ThemeGenericClassGenerator.generate_theme_area_child_panel_classes(
|
2019-01-04 21:40:16 +01:00
|
|
|
panel_id, Theme.bl_rna.properties[theme_area.identifier.lower()].fixed_type,
|
|
|
|
|
theme_area, theme_area.identifier.lower())
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# File Paths Panels
|
|
|
|
|
|
2019-03-13 13:24:46 +11:00
|
|
|
# Panel mix-in.
|
|
|
|
|
class FilePathsPanel:
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
2019-12-19 13:21:41 +11:00
|
|
|
bl_context = "file_paths"
|
2013-01-23 16:01:35 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
|
|
|
|
|
class USERPREF_PT_file_paths_data(FilePathsPanel, Panel):
|
|
|
|
|
bl_label = "Data"
|
2013-01-23 16:01:35 +00:00
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
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
|
|
|
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, "sound_directory", text="Sounds")
|
|
|
|
|
col.prop(paths, "temporary_directory", text="Temporary Files")
|
|
|
|
|
|
|
|
|
|
|
2023-04-11 15:20:52 +02:00
|
|
|
class USERPREF_PT_file_paths_script_directories(FilePathsPanel, Panel):
|
|
|
|
|
bl_label = "Script Directories"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
paths = context.preferences.filepaths
|
|
|
|
|
|
|
|
|
|
if len(paths.script_directories) == 0:
|
|
|
|
|
layout.operator("preferences.script_directory_add", text="Add", icon='ADD')
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = False
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
box = layout.box()
|
|
|
|
|
split = box.split(factor=0.35)
|
|
|
|
|
name_col = split.column()
|
|
|
|
|
path_col = split.column()
|
|
|
|
|
|
|
|
|
|
row = name_col.row(align=True) # Padding
|
|
|
|
|
row.separator()
|
|
|
|
|
row.label(text="Name")
|
|
|
|
|
|
|
|
|
|
row = path_col.row(align=True) # Padding
|
|
|
|
|
row.separator()
|
I18n: disambiguate a few messages
- "Front"/"Back": 'put something at the front/back' or 'the front/back
face of something'. (e. g. the Empty Image options, Depth and Side
option, both use the same strings as enum, which should be avoided
in some languages).
- "Flip": invert, as in normals, or mirror, as in an image.
- "Path": a path to a resource, in general a file but sometimes a
datablock, as opposed to a trajectory in space.
- "Join": disambiguate for the Grease Pencil operator, which may use a
different word as that for meshes.
- "Wave": an ondulating motion, as opposed to a fluid dynamics motion.
- "Step": can mean the distance between two things, or a number of
times to do something. In this case it is better to use the plural.
- "Edge": generally the edges of a mesh, but can also mean edge
detection. Additionally, it was used for the option to enable
Freestyle. This was changed to "Use Freestyle".
- "Boundary": the limit of a grease pencil drawing for filling
purposes, as opposed to the external limit of a (non-manifold) mesh.
- "Rotations": can be translated to something like "Turns", in the
context of a spiral.
Pull Request: https://projects.blender.org/blender/blender/pulls/108213
2023-05-16 19:16:02 +02:00
|
|
|
row.label(text="Path", text_ctxt=i18n_contexts.editor_filebrowser)
|
2023-04-11 15:20:52 +02:00
|
|
|
|
|
|
|
|
row.operator("preferences.script_directory_add", text="", icon='ADD', emboss=False)
|
|
|
|
|
|
|
|
|
|
for i, script_directory in enumerate(paths.script_directories):
|
|
|
|
|
row = name_col.row()
|
|
|
|
|
row.alert = not script_directory.name
|
|
|
|
|
row.prop(script_directory, "name", text="")
|
|
|
|
|
|
|
|
|
|
row = path_col.row()
|
|
|
|
|
subrow = row.row()
|
|
|
|
|
subrow.alert = not script_directory.directory
|
|
|
|
|
subrow.prop(script_directory, "directory", text="")
|
|
|
|
|
row.operator("preferences.script_directory_remove", text="", icon='X', emboss=False).index = i
|
|
|
|
|
|
|
|
|
|
|
2019-03-13 13:24:46 +11:00
|
|
|
class USERPREF_PT_file_paths_render(FilePathsPanel, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Render"
|
2023-09-22 01:07:56 +02:00
|
|
|
bl_parent_id = "USERPREF_PT_file_paths_data"
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
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")
|
|
|
|
|
|
|
|
|
|
|
2023-05-25 16:25:46 -06:00
|
|
|
class USERPREF_PT_text_editor_presets(PresetPanel, Panel):
|
|
|
|
|
bl_label = "Text Editor Presets"
|
|
|
|
|
preset_subdir = "text_editor"
|
|
|
|
|
preset_operator = "script.execute_preset"
|
|
|
|
|
preset_add_operator = "text_editor.preset_add"
|
|
|
|
|
|
|
|
|
|
|
2019-03-13 13:24:46 +11:00
|
|
|
class USERPREF_PT_file_paths_applications(FilePathsPanel, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Applications"
|
2023-09-22 01:07:56 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2019-01-06 21:51:07 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2023-05-25 16:25:46 -06:00
|
|
|
class USERPREF_PT_text_editor(FilePathsPanel, Panel):
|
|
|
|
|
bl_label = "Text Editor"
|
|
|
|
|
bl_parent_id = "USERPREF_PT_file_paths_applications"
|
|
|
|
|
|
|
|
|
|
def draw_header_preset(self, _context):
|
|
|
|
|
USERPREF_PT_text_editor_presets.draw_panel_header(self.layout)
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
paths = context.preferences.filepaths
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(paths, "text_editor", text="Program")
|
|
|
|
|
col.prop(paths, "text_editor_args", text="Arguments")
|
|
|
|
|
|
|
|
|
|
|
2019-03-13 13:24:46 +11:00
|
|
|
class USERPREF_PT_file_paths_development(FilePathsPanel, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "Development"
|
2023-09-22 01:07:56 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
prefs = context.preferences
|
2019-12-19 13:21:41 +11:00
|
|
|
return prefs.view.show_developer_ui
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
paths = context.preferences.filepaths
|
|
|
|
|
layout.prop(paths, "i18n_branches_directory", text="I18n Branches")
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_saveload_autorun(FilePathsPanel, Panel):
|
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()
|
2021-02-24 13:15:48 -06:00
|
|
|
row.label(text="Excluded Paths")
|
2020-06-04 16:23:07 +10:00
|
|
|
row.operator("preferences.autoexec_path_add", text="", icon='ADD', emboss=False)
|
2019-01-04 21:40:16 +01:00
|
|
|
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')
|
2020-06-04 16:23:07 +10:00
|
|
|
row.operator("preferences.autoexec_path_remove", text="", icon='X', emboss=False).index = i
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2020-12-14 13:39:41 +01:00
|
|
|
class USERPREF_PT_file_paths_asset_libraries(FilePathsPanel, Panel):
|
|
|
|
|
bl_label = "Asset Libraries"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = False
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
paths = context.preferences.filepaths
|
2023-02-15 13:00:17 +01:00
|
|
|
active_library_index = paths.active_asset_library
|
2020-12-14 13:39:41 +01:00
|
|
|
|
2023-02-15 13:00:17 +01:00
|
|
|
row = layout.row()
|
2021-10-23 18:07:48 +02:00
|
|
|
|
2023-02-15 13:00:17 +01:00
|
|
|
row.template_list(
|
|
|
|
|
"USERPREF_UL_asset_libraries", "user_asset_libraries",
|
|
|
|
|
paths, "asset_libraries",
|
|
|
|
|
paths, "active_asset_library"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
|
col.operator("preferences.asset_library_add", text="", icon='ADD')
|
|
|
|
|
props = col.operator("preferences.asset_library_remove", text="", icon='REMOVE')
|
|
|
|
|
props.index = active_library_index
|
|
|
|
|
|
2023-06-28 20:17:29 +10:00
|
|
|
try:
|
|
|
|
|
active_library = None if active_library_index < 0 else paths.asset_libraries[active_library_index]
|
|
|
|
|
except IndexError:
|
|
|
|
|
active_library = None
|
|
|
|
|
|
|
|
|
|
if active_library is None:
|
2023-02-15 13:00:17 +01:00
|
|
|
return
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
layout.prop(active_library, "path")
|
|
|
|
|
layout.prop(active_library, "import_method", text="Import Method")
|
2023-04-25 20:54:58 +02:00
|
|
|
layout.prop(active_library, "use_relative_path")
|
2023-02-15 13:00:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_UL_asset_libraries(bpy.types.UIList):
|
|
|
|
|
def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index):
|
|
|
|
|
asset_library = item
|
|
|
|
|
|
|
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
|
|
|
|
layout.prop(asset_library, "name", text="", emboss=False)
|
|
|
|
|
elif self.layout_type == 'GRID':
|
|
|
|
|
layout.alignment = 'CENTER'
|
|
|
|
|
layout.prop(asset_library, "name", text="", emboss=False)
|
2020-12-14 13:39:41 +01:00
|
|
|
|
|
|
|
|
|
2023-08-09 20:15:34 +10:00
|
|
|
class USERPREF_PT_file_paths_extension_repos(FilePathsPanel, Panel):
|
|
|
|
|
bl_label = "Extension Repositories"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
return context.preferences.experimental.use_extension_repos
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = False
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
paths = context.preferences.filepaths
|
|
|
|
|
active_library_index = paths.active_extension_repo
|
|
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
|
|
row.template_list(
|
|
|
|
|
"USERPREF_UL_extension_repos", "user_extension_repos",
|
|
|
|
|
paths, "extension_repos",
|
|
|
|
|
paths, "active_extension_repo"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
|
col.operator("preferences.extension_repo_add", text="", icon='ADD')
|
|
|
|
|
props = col.operator("preferences.extension_repo_remove", text="", icon='REMOVE')
|
|
|
|
|
props.index = active_library_index
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
active_repo = None if active_library_index < 0 else paths.extension_repos[active_library_index]
|
|
|
|
|
except IndexError:
|
|
|
|
|
active_repo = None
|
|
|
|
|
|
|
|
|
|
if active_repo is None:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
layout.prop(active_repo, "directory")
|
|
|
|
|
layout.prop(active_repo, "remote_path")
|
|
|
|
|
row = layout.row()
|
|
|
|
|
row.prop(active_repo, "use_cache")
|
|
|
|
|
row.prop(active_repo, "module")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_UL_extension_repos(bpy.types.UIList):
|
|
|
|
|
def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index):
|
|
|
|
|
repo = item
|
|
|
|
|
|
|
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
|
|
|
|
layout.prop(repo, "name", text="", emboss=False)
|
|
|
|
|
elif self.layout_type == 'GRID':
|
|
|
|
|
layout.alignment = 'CENTER'
|
|
|
|
|
layout.prop(repo, "name", text="", emboss=False)
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Save/Load Panels
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class SaveLoadPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "save_load"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_saveload_blend(SaveLoadPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Blend Files"
|
|
|
|
|
|
|
|
|
|
def draw_centered(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
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Save")
|
|
|
|
|
col.prop(view, "use_save_prompt")
|
2019-01-06 21:51:07 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(paths, "save_version")
|
|
|
|
|
col.prop(paths, "recent_files")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
layout.separator()
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
col = layout.column(heading="Auto-Save")
|
|
|
|
|
row = col.row()
|
|
|
|
|
row.prop(paths, "use_auto_save_temporary_files", text="")
|
|
|
|
|
subrow = row.row()
|
|
|
|
|
subrow.active = paths.use_auto_save_temporary_files
|
|
|
|
|
subrow.prop(paths, "auto_save_time", text="Timer (Minutes)")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
layout.separator()
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
layout.prop(paths, "file_preview_type")
|
2019-01-06 21:51:07 +01:00
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
layout.separator()
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
col = layout.column(heading="Default To")
|
|
|
|
|
col.prop(paths, "use_relative_paths")
|
|
|
|
|
col.prop(paths, "use_file_compression")
|
|
|
|
|
col.prop(paths, "use_load_ui")
|
|
|
|
|
|
|
|
|
|
col = layout.column(heading="Text Files")
|
|
|
|
|
col.prop(paths, "use_tabs_as_spaces")
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2012-01-09 16:58:01 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_saveload_file_browser(SaveLoadPanel, CenterAlignMixIn, Panel):
|
2019-01-16 18:49:31 +01:00
|
|
|
bl_label = "File Browser"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-16 18:49:31 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
paths = prefs.filepaths
|
|
|
|
|
|
2022-07-14 19:07:13 +02:00
|
|
|
col = layout.column(heading="Show Locations")
|
|
|
|
|
col.prop(paths, "show_recent_locations", text="Recent")
|
|
|
|
|
col.prop(paths, "show_system_bookmarks", text="System")
|
|
|
|
|
|
2021-09-09 09:49:45 -07:00
|
|
|
col = layout.column(heading="Defaults")
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(paths, "use_filter_files")
|
2021-09-09 09:49:45 -07:00
|
|
|
col.prop(paths, "show_hidden_files_datablocks")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Input Panels
|
2011-08-05 14:53:13 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class InputPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "input"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2013-07-08 07:25:33 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_input_keyboard(InputPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Keyboard"
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_input_mouse(InputPanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Mouse"
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-10-03 00:20:58 +10:00
|
|
|
import sys
|
2019-01-04 21:40:16 +01:00
|
|
|
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)
|
|
|
|
|
|
2023-09-22 01:07:56 +02:00
|
|
|
if sys.platform[:3] == "win":
|
|
|
|
|
flow.prop(inputs, "use_mouse_emulate_3_button")
|
|
|
|
|
else:
|
|
|
|
|
col = flow.column(heading="Emulate 3 Button Mouse")
|
|
|
|
|
row = col.row()
|
|
|
|
|
row.prop(inputs, "use_mouse_emulate_3_button", text="")
|
|
|
|
|
subrow = row.row()
|
|
|
|
|
subrow.prop(inputs, "mouse_emulate_3_button_modifier", text="")
|
|
|
|
|
subrow.active = inputs.use_mouse_emulate_3_button
|
|
|
|
|
|
2019-01-06 21:51:07 +01:00
|
|
|
flow.prop(inputs, "use_mouse_continuous")
|
|
|
|
|
flow.prop(inputs, "use_drag_immediately")
|
2019-05-30 14:47:24 +10:00
|
|
|
flow.prop(inputs, "mouse_double_click_time", text="Double Click Speed")
|
|
|
|
|
flow.prop(inputs, "drag_threshold_mouse")
|
|
|
|
|
flow.prop(inputs, "drag_threshold_tablet")
|
2019-01-16 18:49:31 +01:00
|
|
|
flow.prop(inputs, "drag_threshold")
|
2019-03-20 22:14:13 +11:00
|
|
|
flow.prop(inputs, "move_threshold")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2022-09-26 22:56:14 +02:00
|
|
|
class USERPREF_PT_input_touchpad(InputPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Touchpad"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
import sys
|
2022-09-27 16:36:27 +10:00
|
|
|
return sys.platform[:3] == "win" or sys.platform == "darwin"
|
2022-09-26 22:56:14 +02:00
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
inputs = prefs.inputs
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(inputs, "use_multitouch_gestures")
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_input_tablet(InputPanel, CenterAlignMixIn, Panel):
|
2019-12-19 13:20:37 +11:00
|
|
|
bl_label = "Tablet"
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-12-19 13:20:37 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
|
inputs = prefs.inputs
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
if sys.platform[:3] == "win":
|
|
|
|
|
layout.prop(inputs, "tablet_api")
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(inputs, "pressure_threshold_max")
|
|
|
|
|
col.prop(inputs, "pressure_softness")
|
2019-12-19 13:20:37 +11:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_input_ndof(InputPanel, CenterAlignMixIn, Panel):
|
2019-12-19 13:20:37 +11:00
|
|
|
bl_label = "NDOF"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
inputs = prefs.inputs
|
2019-12-19 13:21:41 +11:00
|
|
|
return inputs.use_ndof
|
2019-12-19 13:20:37 +11:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-12-19 13:20:37 +11:00
|
|
|
prefs = context.preferences
|
|
|
|
|
inputs = prefs.inputs
|
|
|
|
|
|
2020-05-21 11:42:23 -04:00
|
|
|
USERPREF_PT_ndof_settings.draw_settings(layout, inputs)
|
2019-12-19 13:20:37 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Navigation Panels
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class NavigationPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "navigation"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_navigation_orbit(NavigationPanel, CenterAlignMixIn, Panel):
|
|
|
|
|
bl_label = "Orbit & Pan"
|
|
|
|
|
|
|
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2019-01-06 21:51:07 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.row().prop(inputs, "view_rotate_method", expand=True)
|
2019-08-04 01:22:38 +10:00
|
|
|
if inputs.view_rotate_method == 'TURNTABLE':
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(inputs, "view_rotate_sensitivity_turntable")
|
2019-08-04 01:22:38 +10:00
|
|
|
else:
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.prop(inputs, "view_rotate_sensitivity_trackball")
|
|
|
|
|
col.prop(inputs, "use_rotate_around_active")
|
|
|
|
|
|
|
|
|
|
col.separator()
|
2019-08-04 01:22:38 +10:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Auto")
|
|
|
|
|
col.prop(inputs, "use_auto_perspective", text="Perspective")
|
|
|
|
|
col.prop(inputs, "use_mouse_depth_navigate", text="Depth")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(view, "smooth_view")
|
|
|
|
|
col.prop(view, "rotation_angle")
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_navigation_zoom(NavigationPanel, CenterAlignMixIn, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Zoom"
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
inputs = prefs.inputs
|
2014-01-27 18:38:53 +11:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2019-01-06 21:51:07 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.row().prop(inputs, "view_zoom_method", text="Zoom Method")
|
2011-04-22 14:47:35 +00:00
|
|
|
if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}:
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col.row().prop(inputs, "view_zoom_axis")
|
|
|
|
|
col.prop(inputs, "use_zoom_to_mouse")
|
|
|
|
|
col = layout.column(heading="Invert Zoom Direction", align=True)
|
|
|
|
|
col.prop(inputs, "invert_mouse_zoom", text="Mouse")
|
|
|
|
|
col.prop(inputs, "invert_zoom_wheel", text="Wheel")
|
|
|
|
|
else:
|
|
|
|
|
col.prop(inputs, "use_zoom_to_mouse")
|
|
|
|
|
col.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_navigation_fly_walk(NavigationPanel, CenterAlignMixIn, Panel):
|
2019-01-06 12:56:18 +01:00
|
|
|
bl_label = "Fly & Walk"
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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-04 21:40:16 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_navigation_fly_walk_navigation(NavigationPanel, CenterAlignMixIn, Panel):
|
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-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
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
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(walk, "use_mouse_reverse")
|
|
|
|
|
col.prop(walk, "mouse_speed")
|
|
|
|
|
col.prop(walk, "teleport_time")
|
2017-04-10 17:44:03 -04:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(align=True)
|
|
|
|
|
col.prop(walk, "walk_speed")
|
|
|
|
|
col.prop(walk, "walk_speed_factor")
|
2017-04-10 17:44:03 -04:00
|
|
|
|
2013-12-03 03:14:09 -02:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_navigation_fly_walk_gravity(NavigationPanel, CenterAlignMixIn, Panel):
|
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-12-19 13:21:41 +11:00
|
|
|
def draw_centered(self, context, layout):
|
2019-01-04 21:40:16 +01:00
|
|
|
prefs = context.preferences
|
|
|
|
|
inputs = prefs.inputs
|
|
|
|
|
walk = inputs.walk_navigation
|
|
|
|
|
|
|
|
|
|
layout.active = walk.use_gravity
|
2019-01-06 21:51:07 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(walk, "view_height")
|
|
|
|
|
col.prop(walk, "jump_height")
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# Special case, this is only exposed as a popover.
|
|
|
|
|
class USERPREF_PT_ndof_settings(Panel):
|
|
|
|
|
bl_label = "3D Mouse Settings"
|
|
|
|
|
bl_space_type = 'TOPBAR' # dummy.
|
|
|
|
|
bl_region_type = 'HEADER'
|
2020-05-21 11:42:23 -04:00
|
|
|
bl_ui_units_x = 12
|
2019-01-16 18:49:31 +01:00
|
|
|
|
2020-05-21 11:42:23 -04:00
|
|
|
@staticmethod
|
|
|
|
|
def draw_settings(layout, props, show_3dview_settings=True):
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(props, "ndof_sensitivity", text="Pan Sensitivity")
|
|
|
|
|
col.prop(props, "ndof_orbit_sensitivity")
|
|
|
|
|
col.prop(props, "ndof_deadzone")
|
2019-01-14 17:46:49 +01:00
|
|
|
|
2020-05-21 11:42:23 -04:00
|
|
|
layout.separator()
|
2019-01-06 21:51:07 +01:00
|
|
|
|
2020-05-21 11:42:23 -04:00
|
|
|
if show_3dview_settings:
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.row().prop(props, "ndof_view_navigate_method", expand=True, text="Navigation")
|
|
|
|
|
col.row().prop(props, "ndof_view_rotate_method", expand=True, text="Rotation")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
layout.separator()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2020-05-21 11:42:23 -04:00
|
|
|
col = layout.column()
|
|
|
|
|
if show_3dview_settings:
|
|
|
|
|
col.prop(props, "ndof_show_guide")
|
|
|
|
|
col.prop(props, "ndof_zoom_invert")
|
2022-02-23 21:25:46 +11:00
|
|
|
col.prop(props, "ndof_lock_camera_pan_zoom")
|
2020-05-21 11:42:23 -04:00
|
|
|
row = col.row(heading="Pan")
|
|
|
|
|
row.prop(props, "ndof_pan_yz_swap_axis", text="Swap Y and Z Axes")
|
2009-12-16 10:13:26 +00:00
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2020-05-21 11:42:23 -04:00
|
|
|
row = layout.row(heading=("Invert Axis Pan" if show_3dview_settings else "Invert Pan Axis"))
|
2019-12-19 13:20:37 +11:00
|
|
|
for text, attr in (
|
|
|
|
|
("X", "ndof_panx_invert_axis"),
|
|
|
|
|
("Y", "ndof_pany_invert_axis"),
|
|
|
|
|
("Z", "ndof_panz_invert_axis"),
|
|
|
|
|
):
|
2020-05-21 11:42:23 -04:00
|
|
|
row.prop(props, attr, text=text, toggle=True)
|
2009-12-16 10:13:26 +00:00
|
|
|
|
2020-05-21 11:42:23 -04:00
|
|
|
if show_3dview_settings:
|
|
|
|
|
row = layout.row(heading="Orbit")
|
|
|
|
|
for text, attr in (
|
|
|
|
|
("X", "ndof_rotx_invert_axis"),
|
|
|
|
|
("Y", "ndof_roty_invert_axis"),
|
|
|
|
|
("Z", "ndof_rotz_invert_axis"),
|
|
|
|
|
):
|
|
|
|
|
row.prop(props, attr, text=text, toggle=True)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
layout.separator()
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2020-05-21 11:42:23 -04:00
|
|
|
col = layout.column(heading="Fly/Walk")
|
|
|
|
|
col.prop(props, "ndof_lock_horizon")
|
|
|
|
|
col.prop(props, "ndof_fly_helicopter")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False # No animation.
|
|
|
|
|
|
|
|
|
|
input_prefs = context.preferences.inputs
|
|
|
|
|
is_view3d = context.space_data.type == 'VIEW_3D'
|
|
|
|
|
self.draw_settings(layout, input_prefs, is_view3d)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Key-Map Editor Panels
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2020-10-02 10:10:01 +10:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class KeymapPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "keymap"
|
|
|
|
|
|
|
|
|
|
|
2019-01-04 21:40:16 +01:00
|
|
|
class USERPREF_MT_keyconfigs(Menu):
|
|
|
|
|
bl_label = "KeyPresets"
|
|
|
|
|
preset_subdir = "keyconfig"
|
2019-03-02 00:21:05 +11:00
|
|
|
preset_operator = "preferences.keyconfig_activate"
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
Menu.draw_preset(self, context)
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_keymap(KeymapPanel, Panel):
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_label = "Keymap"
|
|
|
|
|
bl_options = {'HIDE_HEADER'}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2023-09-20 15:11:18 +10:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Extension Panels
|
|
|
|
|
|
|
|
|
|
class ExtensionsPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "extensions"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_extensions(ExtensionsPanel, Panel):
|
|
|
|
|
bl_label = "Extensions"
|
|
|
|
|
bl_options = {'HIDE_HEADER'}
|
|
|
|
|
|
|
|
|
|
# NOTE: currently disabled by an add-on when used.
|
|
|
|
|
unused = True
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, _context):
|
|
|
|
|
return cls.unused
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
row.label(text="The add-on to use extensions is disabled! See:")
|
|
|
|
|
row.operator(
|
|
|
|
|
"wm.url_open", text="Extension Add-on Repo", icon='URL',
|
|
|
|
|
).url = "https://projects.blender.org/ideasman42/bl_ext"
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Add-On Panels
|
|
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class AddOnPanel:
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2010-02-14 23:33:18 +00:00
|
|
|
bl_region_type = 'WINDOW'
|
2019-12-19 13:21:41 +11:00
|
|
|
bl_context = "addons"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_addons(AddOnPanel, Panel):
|
|
|
|
|
bl_label = "Add-ons"
|
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 = {
|
2021-11-23 15:22:06 +01:00
|
|
|
'OFFICIAL': 'BLENDER',
|
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
|
|
|
|
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(),
|
2023-04-11 15:20:52 +02:00
|
|
|
*bpy.utils.script_paths_pref(),
|
2018-02-01 14:58:05 +11:00
|
|
|
):
|
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
|
|
|
|
|
|
2020-10-16 14:00:15 +11:00
|
|
|
wm = context.window_manager
|
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 (
|
2023-04-12 13:04:54 +02:00
|
|
|
*[os.path.join(pref_p, "addons") for pref_p in bpy.utils.script_paths_pref()],
|
PyAPI: use keyword only arguments
Use keyword only arguments for the following functions.
- addon_utils.module_bl_info 2nd arg `info_basis`.
- addon_utils.modules 1st `module_cache`, 2nd arg `refresh`.
- addon_utils.modules_refresh 1st arg `module_cache`.
- bl_app_template_utils.activate 1nd arg `template_id`.
- bl_app_template_utils.import_from_id 2nd arg `ignore_not_found`.
- bl_app_template_utils.import_from_path 2nd arg `ignore_not_found`.
- bl_keymap_utils.keymap_from_toolbar.generate 2nd & 3rd args `use_fallback_keys` & `use_reset`.
- bl_keymap_utils.platform_helpers.keyconfig_data_oskey_from_ctrl 2nd arg `filter_fn`.
- bl_ui_utils.bug_report_url.url_prefill_from_blender 1st arg `addon_info`.
- bmesh.types.BMFace.copy 1st & 2nd args `verts`, `edges`.
- bmesh.types.BMesh.calc_volume 1st arg `signed`.
- bmesh.types.BMesh.from_mesh 2nd..4th args `face_normals`, `use_shape_key`, `shape_key_index`.
- bmesh.types.BMesh.from_object 3rd & 4th args `cage`, `face_normals`.
- bmesh.types.BMesh.transform 2nd arg `filter`.
- bmesh.types.BMesh.update_edit_mesh 2nd & 3rd args `loop_triangles`, `destructive`.
- bmesh.types.{BMVertSeq,BMEdgeSeq,BMFaceSeq}.sort 1st & 2nd arg `key`, `reverse`.
- bmesh.utils.face_split 4th..6th args `coords`, `use_exist`, `example`.
- bpy.data.libraries.load 2nd..4th args `link`, `relative`, `assets_only`.
- bpy.data.user_map 1st..3rd args `subset`, `key_types, `value_types`.
- bpy.msgbus.subscribe_rna 5th arg `options`.
- bpy.path.abspath 2nd & 3rd args `start` & `library`.
- bpy.path.clean_name 2nd arg `replace`.
- bpy.path.ensure_ext 3rd arg `case_sensitive`.
- bpy.path.module_names 2nd arg `recursive`.
- bpy.path.relpath 2nd arg `start`.
- bpy.types.EditBone.transform 2nd & 3rd arg `scale`, `roll`.
- bpy.types.Operator.as_keywords 1st arg `ignore`.
- bpy.types.Struct.{keyframe_insert,keyframe_delete} 2nd..5th args `index`, `frame`, `group`, `options`.
- bpy.types.WindowManager.popup_menu 2nd & 3rd arg `title`, `icon`.
- bpy.types.WindowManager.popup_menu_pie 3rd & 4th arg `title`, `icon`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.blend_paths 1st..3rd args `absolute`, `packed`, `local`.
- bpy.utils.execfile 2nd arg `mod`.
- bpy.utils.keyconfig_set 2nd arg `report`.
- bpy.utils.load_scripts 1st & 2nd `reload_scripts` & `refresh_scripts`.
- bpy.utils.preset_find 3rd & 4th args `display_name`, `ext`.
- bpy.utils.resource_path 2nd & 3rd arg `major`, `minor`.
- bpy.utils.script_paths 1st..4th args `subdir`, `user_pref`, `check_all`, `use_user`.
- bpy.utils.smpte_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.smpte_from_seconds 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.system_resource 2nd arg `subdir`.
- bpy.utils.time_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.time_to_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.units.to_string 4th..6th `precision`, `split_unit`, `compatible_unit`.
- bpy.utils.units.to_value 4th arg `str_ref_unit`.
- bpy.utils.user_resource 2nd & 3rd args `subdir`, `create`
- bpy_extras.view3d_utils.location_3d_to_region_2d 4th arg `default`.
- bpy_extras.view3d_utils.region_2d_to_origin_3d 4th arg `clamp`.
- gpu.offscreen.unbind 1st arg `restore`.
- gpu_extras.batch.batch_for_shader 4th arg `indices`.
- gpu_extras.batch.presets.draw_circle_2d 4th arg `segments`.
- gpu_extras.presets.draw_circle_2d 4th arg `segments`.
- imbuf.types.ImBuf.resize 2nd arg `resize`.
- imbuf.write 2nd arg `filepath`.
- mathutils.kdtree.KDTree.find 2nd arg `filter`.
- nodeitems_utils.NodeCategory 3rd & 4th arg `descriptions`, `items`.
- nodeitems_utils.NodeItem 2nd..4th args `label`, `settings`, `poll`.
- nodeitems_utils.NodeItemCustom 1st & 2nd arg `poll`, `draw`.
- rna_prop_ui.draw 5th arg `use_edit`.
- rna_prop_ui.rna_idprop_ui_get 2nd arg `create`.
- rna_prop_ui.rna_idprop_ui_prop_clear 3rd arg `remove`.
- rna_prop_ui.rna_idprop_ui_prop_get 3rd arg `create`.
- rna_xml.xml2rna 2nd arg `root_rna`.
- rna_xml.xml_file_write 4th arg `skip_typemap`.
2021-06-08 18:03:14 +10:00
|
|
|
bpy.utils.user_resource('SCRIPTS', path="addons"),
|
2018-11-08 09:54:13 +11:00
|
|
|
)
|
|
|
|
|
if p
|
|
|
|
|
)
|
2013-01-15 23:15:32 +00:00
|
|
|
|
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()
|
2020-10-16 14:00:15 +11:00
|
|
|
row.prop(wm, "addon_support", expand=True)
|
2019-01-16 18:42:26 +01:00
|
|
|
|
|
|
|
|
row = split.row(align=True)
|
2019-03-02 00:21:05 +11:00
|
|
|
row.operator("preferences.addon_install", icon='IMPORT', text="Install...")
|
|
|
|
|
row.operator("preferences.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()
|
2020-10-16 14:00:15 +11:00
|
|
|
row.prop(prefs.view, "show_addons_enabled_only")
|
|
|
|
|
row.prop(wm, "addon_filter", text="")
|
|
|
|
|
row.prop(wm, "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
|
|
|
|
2020-10-16 14:00:15 +11:00
|
|
|
show_enabled_only = prefs.view.show_addons_enabled_only
|
|
|
|
|
filter = wm.addon_filter
|
|
|
|
|
search = wm.addon_search.lower()
|
|
|
|
|
support = wm.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
|
2019-08-15 10:21:04 +02:00
|
|
|
is_visible = (
|
|
|
|
|
(filter == "All") or
|
|
|
|
|
(filter == info["category"]) or
|
|
|
|
|
(filter == "User" and (mod.__file__.startswith(addon_user_dirs)))
|
|
|
|
|
)
|
|
|
|
|
if show_enabled_only:
|
|
|
|
|
is_visible = is_visible and is_enabled
|
|
|
|
|
|
|
|
|
|
if is_visible:
|
2020-12-16 16:28:44 +11:00
|
|
|
if search and not (
|
2022-08-29 14:02:24 +02:00
|
|
|
(search in info["name"].lower() or
|
|
|
|
|
search in iface_(info["name"]).lower()) or
|
2020-12-16 16:28:44 +11:00
|
|
|
(info["author"] and (search in info["author"].lower())) or
|
2022-08-29 14:02:24 +02:00
|
|
|
((filter == "All") and (search in info["category"].lower() or
|
|
|
|
|
search in iface_(info["category"]).lower()))
|
2022-08-30 16:15:45 +10:00
|
|
|
):
|
2020-12-16 16:28:44 +11:00
|
|
|
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(
|
2019-03-02 00:21:05 +11:00
|
|
|
"preferences.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(
|
2019-03-02 00:21:05 +11:00
|
|
|
"preferences.addon_disable" if is_enabled else "preferences.addon_enable",
|
2018-02-01 14:58:05 +11:00
|
|
|
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
|
2022-08-29 14:02:24 +02:00
|
|
|
sub.label(text=iface_("%s: %s") % (iface_(info["category"]), iface_(info["name"])))
|
2018-07-03 07:58:10 +02:00
|
|
|
|
2021-12-01 11:24:55 +01:00
|
|
|
if 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:")
|
2022-08-29 14:02:24 +02:00
|
|
|
split.label(text=tip_(info["description"]))
|
2010-06-17 02:38:49 +00:00
|
|
|
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:")
|
2022-08-29 14:02:24 +02:00
|
|
|
split.label(text=tip_(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)
|
2023-06-01 18:11:45 +10:00
|
|
|
if info["doc_url"] or info.get("tracker_url"):
|
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()
|
2020-03-05 11:40:05 +11:00
|
|
|
if info["doc_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',
|
2020-03-05 11:40:05 +11:00
|
|
|
).url = info["doc_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).
|
2019-08-20 22:00:01 +10:00
|
|
|
if info.get("tracker_url"):
|
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',
|
2019-08-20 22:00:01 +10:00
|
|
|
).url = info["tracker_url"]
|
|
|
|
|
elif not user_addon:
|
2020-06-26 12:30:03 +10:00
|
|
|
addon_info = (
|
|
|
|
|
"Name: %s %s\n"
|
|
|
|
|
"Author: %s\n"
|
|
|
|
|
) % (info["name"], str(info["version"]), info["author"])
|
2019-08-20 22:00:01 +10:00
|
|
|
props = sub.operator(
|
|
|
|
|
"wm.url_open_preset", text="Report a Bug", icon='URL',
|
2018-03-09 21:17:43 +01:00
|
|
|
)
|
2019-08-20 22:00:01 +10:00
|
|
|
props.type = 'BUG_ADDON'
|
|
|
|
|
props.id = addon_info
|
2023-06-01 18:11:45 +10:00
|
|
|
|
|
|
|
|
if user_addon:
|
|
|
|
|
split = colsub.row().split(factor=0.15)
|
|
|
|
|
split.label(text="User:")
|
|
|
|
|
split.operator(
|
|
|
|
|
"preferences.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)
|
2023-07-30 16:14:11 +10:00
|
|
|
except BaseException:
|
2012-12-29 10:24:42 +00:00
|
|
|
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(
|
2019-03-02 00:21:05 +11:00
|
|
|
"preferences.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False,
|
2018-02-01 14:58:05 +11:00
|
|
|
).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)
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Studio Light Panels
|
|
|
|
|
|
2023-09-20 15:11:18 +10:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class StudioLightPanel:
|
2018-12-21 12:47:44 +11:00
|
|
|
bl_space_type = 'PREFERENCES'
|
2018-06-07 16:01:57 +02:00
|
|
|
bl_region_type = 'WINDOW'
|
2019-12-19 13:21:41 +11:00
|
|
|
bl_context = "lights"
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
|
|
|
|
|
class StudioLightPanelMixin:
|
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:
|
2022-08-22 15:33:39 +02:00
|
|
|
layout.label(text=self.get_error_message())
|
|
|
|
|
|
|
|
|
|
def get_error_message(self):
|
|
|
|
|
return tip_("No custom %s configured") % 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()
|
2023-04-13 13:14:01 +10:00
|
|
|
props = col.operator("preferences.studiolight_uninstall", text="", icon='REMOVE')
|
|
|
|
|
props.index = studio_light.index
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2018-11-30 15:40:46 +01:00
|
|
|
if studio_light.type == 'STUDIO':
|
2023-04-13 13:14:01 +10:00
|
|
|
props = col.operator("preferences.studiolight_copy_settings", text="", icon='IMPORT')
|
|
|
|
|
props.index = studio_light.index
|
2018-11-30 15:40:46 +01:00
|
|
|
|
2018-06-19 14:00:34 +02:00
|
|
|
box.label(text=studio_light.name)
|
|
|
|
|
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_studiolight_matcaps(StudioLightPanel, StudioLightPanelMixin, Panel):
|
2018-06-08 14:30:11 +02:00
|
|
|
bl_label = "MatCaps"
|
2018-11-28 22:16:56 +01:00
|
|
|
sl_type = 'MATCAP'
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw_header_preset(self, _context):
|
2019-01-16 19:12:51 +01:00
|
|
|
layout = self.layout
|
2019-03-02 00:21:05 +11:00
|
|
|
layout.operator("preferences.studiolight_install", icon='IMPORT', text="Install...").type = 'MATCAP'
|
2019-01-16 19:12:51 +01:00
|
|
|
layout.separator()
|
|
|
|
|
|
2022-08-22 15:33:39 +02:00
|
|
|
def get_error_message(self):
|
|
|
|
|
return tip_("No custom MatCaps configured")
|
|
|
|
|
|
2018-06-08 14:30:11 +02:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_studiolight_world(StudioLightPanel, StudioLightPanelMixin, Panel):
|
2019-12-27 14:38:45 -06:00
|
|
|
bl_label = "HDRIs"
|
2018-11-28 22:16:56 +01:00
|
|
|
sl_type = 'WORLD'
|
2018-06-08 14:30:11 +02:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw_header_preset(self, _context):
|
2019-01-16 19:12:51 +01:00
|
|
|
layout = self.layout
|
2019-03-02 00:21:05 +11:00
|
|
|
layout.operator("preferences.studiolight_install", icon='IMPORT', text="Install...").type = 'WORLD'
|
2019-01-16 19:12:51 +01:00
|
|
|
layout.separator()
|
|
|
|
|
|
2022-08-22 15:33:39 +02:00
|
|
|
def get_error_message(self):
|
|
|
|
|
return tip_("No custom HDRIs configured")
|
|
|
|
|
|
2018-06-07 16:01:57 +02:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_studiolight_lights(StudioLightPanel, StudioLightPanelMixin, Panel):
|
2018-11-28 15:57:40 +01:00
|
|
|
bl_label = "Studio Lights"
|
2018-11-28 22:16:56 +01:00
|
|
|
sl_type = 'STUDIO'
|
2018-07-17 13:58:08 +02:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw_header_preset(self, _context):
|
2019-01-16 19:12:51 +01:00
|
|
|
layout = self.layout
|
2023-04-13 13:14:01 +10:00
|
|
|
props = layout.operator("preferences.studiolight_install", icon='IMPORT', text="Install...")
|
|
|
|
|
props.type = 'STUDIO'
|
|
|
|
|
props.filter_glob = ".sl"
|
2019-01-16 19:12:51 +01:00
|
|
|
layout.separator()
|
|
|
|
|
|
2022-08-22 15:33:39 +02:00
|
|
|
def get_error_message(self):
|
|
|
|
|
return tip_("No custom Studio Lights configured")
|
|
|
|
|
|
2018-11-29 21:52:24 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
class USERPREF_PT_studiolight_light_editor(StudioLightPanel, 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"
|
2019-01-04 21:40:16 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-29 21:52:24 +01:00
|
|
|
|
2019-12-19 13:21:41 +11:00
|
|
|
@staticmethod
|
|
|
|
|
def opengl_light_buttons(layout, light):
|
2018-11-29 21:52:24 +01:00
|
|
|
|
|
|
|
|
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)
|
2019-03-02 00:21:05 +11:00
|
|
|
row.operator("preferences.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-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Experimental Panels
|
|
|
|
|
|
2019-11-07 12:31:33 -03:00
|
|
|
class ExperimentalPanel:
|
|
|
|
|
bl_space_type = 'PREFERENCES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
2019-12-19 13:21:41 +11:00
|
|
|
bl_context = "experimental"
|
2019-11-07 12:31:33 -03:00
|
|
|
|
2023-02-07 19:40:15 +01:00
|
|
|
url_prefix = "https://projects.blender.org/"
|
2019-12-07 08:46:02 +11:00
|
|
|
|
2020-08-17 19:50:35 +02:00
|
|
|
@classmethod
|
2021-03-06 18:21:17 +11:00
|
|
|
def poll(cls, _context):
|
2023-10-04 10:30:28 +11:00
|
|
|
return bpy.app.version_cycle == "alpha"
|
2020-08-17 19:50:35 +02:00
|
|
|
|
2020-03-24 11:34:18 +11:00
|
|
|
def _draw_items(self, context, items):
|
|
|
|
|
prefs = context.preferences
|
|
|
|
|
experimental = prefs.experimental
|
|
|
|
|
|
|
|
|
|
layout = self.layout
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
layout.use_property_split = False
|
2020-03-24 11:34:18 +11:00
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2021-01-13 00:52:10 +01:00
|
|
|
for prop_keywords, reference in items:
|
2020-03-24 11:34:18 +11:00
|
|
|
split = layout.split(factor=0.66)
|
|
|
|
|
col = split.split()
|
|
|
|
|
col.prop(experimental, **prop_keywords)
|
2020-06-11 20:32:39 +02:00
|
|
|
|
2021-01-13 00:52:10 +01:00
|
|
|
if reference:
|
|
|
|
|
if type(reference) is tuple:
|
|
|
|
|
url_ext = reference[0]
|
|
|
|
|
text = reference[1]
|
|
|
|
|
else:
|
|
|
|
|
url_ext = reference
|
|
|
|
|
text = reference
|
|
|
|
|
|
2020-06-11 20:32:39 +02:00
|
|
|
col = split.split()
|
2021-01-13 00:52:10 +01:00
|
|
|
col.operator("wm.url_open", text=text, icon='URL').url = self.url_prefix + url_ext
|
2020-03-24 11:34:18 +11:00
|
|
|
|
2020-10-02 10:10:01 +10:00
|
|
|
|
2019-11-07 12:31:33 -03:00
|
|
|
"""
|
2019-11-08 16:42:49 +11:00
|
|
|
# Example panel, leave it here so we always have a template to follow even
|
|
|
|
|
# after the features are gone from the experimental panel.
|
2019-11-07 12:31:33 -03:00
|
|
|
|
|
|
|
|
class USERPREF_PT_experimental_virtual_reality(ExperimentalPanel, Panel):
|
|
|
|
|
bl_label = "Virtual Reality"
|
|
|
|
|
|
2020-01-03 14:04:11 +11:00
|
|
|
def draw(self, context):
|
2020-03-24 11:34:18 +11:00
|
|
|
self._draw_items(
|
|
|
|
|
context, (
|
2023-02-07 19:40:15 +01:00
|
|
|
({"property": "use_virtual_reality_scene_inspection"}, ("blender/blender/issues/71347", "#71347")),
|
|
|
|
|
({"property": "use_virtual_reality_immersive_drawing"}, ("blender/blender/issues/71348", "#71348")),
|
2022-12-15 17:24:23 +11:00
|
|
|
),
|
2020-03-24 11:34:18 +11:00
|
|
|
)
|
|
|
|
|
"""
|
2019-11-08 16:42:49 +11:00
|
|
|
|
2019-11-07 12:31:33 -03:00
|
|
|
|
2020-06-25 15:46:16 +02:00
|
|
|
class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel):
|
|
|
|
|
bl_label = "New Features"
|
2020-03-17 12:29:36 +01:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
2023-02-14 12:11:32 +11:00
|
|
|
self._draw_items(
|
|
|
|
|
context, (
|
|
|
|
|
({"property": "use_sculpt_tools_tilt"}, ("blender/blender/issues/82877", "#82877")),
|
|
|
|
|
({"property": "use_extended_asset_browser"},
|
|
|
|
|
("blender/blender/projects/10", "Pipeline, Assets & IO Project Page")),
|
|
|
|
|
({"property": "use_override_templates"}, ("blender/blender/issues/73318", "Milestone 4")),
|
|
|
|
|
({"property": "use_new_volume_nodes"}, ("blender/blender/issues/103248", "#103248")),
|
2023-08-08 17:36:06 +02:00
|
|
|
({"property": "use_shader_node_previews"}, ("blender/blender/issues/110353", "#110353")),
|
2023-02-14 12:11:32 +11:00
|
|
|
),
|
|
|
|
|
)
|
2020-06-25 15:46:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class USERPREF_PT_experimental_prototypes(ExperimentalPanel, Panel):
|
|
|
|
|
bl_label = "Prototypes"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
self._draw_items(
|
|
|
|
|
context, (
|
2023-02-07 19:40:15 +01:00
|
|
|
({"property": "use_new_curves_tools"}, ("blender/blender/issues/68981", "#68981")),
|
|
|
|
|
({"property": "use_new_point_cloud_type"}, ("blender/blender/issues/75717", "#75717")),
|
|
|
|
|
({"property": "use_sculpt_texture_paint"}, ("blender/blender/issues/96225", "#96225")),
|
2023-06-05 12:08:30 +02:00
|
|
|
({"property": "use_experimental_compositors"}, ("blender/blender/issues/88150", "#88150")),
|
2023-06-19 11:40:40 +02:00
|
|
|
({"property": "use_grease_pencil_version3"}, ("blender/blender/projects/6", "Grease Pencil 3.0")),
|
2023-05-23 15:00:38 +02:00
|
|
|
({"property": "enable_overlay_next"}, ("blender/blender/issues/102179", "#102179")),
|
2023-08-09 20:15:34 +10:00
|
|
|
({"property": "use_extension_repos"}, ("/blender/blender/issues/106254", "#106254")),
|
2020-03-24 11:34:18 +11:00
|
|
|
),
|
|
|
|
|
)
|
2020-03-17 12:29:36 +01:00
|
|
|
|
2022-04-19 15:05:55 +10:00
|
|
|
|
2022-04-14 17:15:07 +10:00
|
|
|
# Keep this as tweaks can be useful to restore.
|
|
|
|
|
"""
|
2022-04-04 17:25:19 +10:00
|
|
|
class USERPREF_PT_experimental_tweaks(ExperimentalPanel, Panel):
|
|
|
|
|
bl_label = "Tweaks"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
self._draw_items(
|
|
|
|
|
context, (
|
2023-02-07 19:40:15 +01:00
|
|
|
({"property": "use_select_nearest_on_first_click"}, ("blender/blender/issues/96752", "#96752")),
|
2022-04-04 17:25:19 +10:00
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
|
2022-04-14 17:15:07 +10:00
|
|
|
"""
|
2022-04-04 17:25:19 +10:00
|
|
|
|
2022-04-19 15:05:55 +10:00
|
|
|
|
2020-06-25 15:46:16 +02:00
|
|
|
class USERPREF_PT_experimental_debugging(ExperimentalPanel, Panel):
|
|
|
|
|
bl_label = "Debugging"
|
|
|
|
|
|
2020-08-17 19:50:35 +02:00
|
|
|
@classmethod
|
2021-03-06 18:21:17 +11:00
|
|
|
def poll(cls, _context):
|
2020-08-17 19:50:35 +02:00
|
|
|
# Unlike the other experimental panels, the debugging one is always visible
|
|
|
|
|
# even in beta or release.
|
|
|
|
|
return True
|
|
|
|
|
|
2020-06-25 15:46:16 +02:00
|
|
|
def draw(self, context):
|
|
|
|
|
self._draw_items(
|
|
|
|
|
context, (
|
2023-02-07 19:40:15 +01:00
|
|
|
({"property": "use_undo_legacy"}, ("blender/blender/issues/60695", "#60695")),
|
|
|
|
|
({"property": "override_auto_resync"}, ("blender/blender/issues/83811", "#83811")),
|
2020-06-11 20:32:39 +02:00
|
|
|
({"property": "use_cycles_debug"}, None),
|
2021-11-16 16:49:27 +01:00
|
|
|
({"property": "show_asset_debug_info"}, None),
|
2022-01-19 20:02:23 +01:00
|
|
|
({"property": "use_asset_indexing"}, None),
|
2022-09-02 18:30:48 +02:00
|
|
|
({"property": "use_viewport_debug"}, None),
|
2023-08-03 15:32:06 +02:00
|
|
|
({"property": "use_eevee_debug"}, None),
|
2020-06-25 15:46:16 +02:00
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 13:20:37 +11:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Class Registration
|
|
|
|
|
|
2019-03-13 13:03:54 +11:00
|
|
|
# Order of registration defines order in UI,
|
|
|
|
|
# so dynamically generated classes are 'injected' in the intended order.
|
|
|
|
|
classes = (
|
|
|
|
|
USERPREF_PT_theme_user_interface,
|
|
|
|
|
*ThemeGenericClassGenerator.generate_panel_classes_for_wcols(),
|
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,
|
2020-03-09 19:53:59 +01:00
|
|
|
USERPREF_MT_editor_menus,
|
|
|
|
|
USERPREF_MT_view,
|
2019-05-15 18:39:41 +10:00
|
|
|
USERPREF_MT_save_load,
|
2019-01-04 21:40:16 +01:00
|
|
|
|
|
|
|
|
USERPREF_PT_interface_display,
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_interface_editors,
|
2019-09-18 14:32:21 +02:00
|
|
|
USERPREF_PT_interface_temporary_windows,
|
2020-07-18 07:49:25 -07:00
|
|
|
USERPREF_PT_interface_statusbar,
|
2019-01-16 18:49:31 +01:00
|
|
|
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,
|
OpenSubDiv: add support for an OpenGL evaluator
This evaluator is used in order to evaluate subdivision at render time, allowing for
faster renders of meshes with a subdivision surface modifier placed at the last
position in the modifier list.
When evaluating the subsurf modifier, we detect whether we can delegate evaluation
to the draw code. If so, the subdivision is first evaluated on the GPU using our own
custom evaluator (only the coarse data needs to be initially sent to the GPU), then,
buffers for the final `MeshBufferCache` are filled on the GPU using a set of
compute shaders. However, some buffers are still filled on the CPU side, if doing so
on the GPU is impractical (e.g. the line adjacency buffer used for x-ray, whose
logic is hardly GPU compatible).
This is done at the mesh buffer extraction level so that the result can be readily used
in the various OpenGL engines, without having to write custom geometry or tesselation
shaders.
We use our own subdivision evaluation shaders, instead of OpenSubDiv's vanilla one, in
order to control the data layout, and interpolation. For example, we store vertex colors
as compressed 16-bit integers, while OpenSubDiv's default evaluator only work for float
types.
In order to still access the modified geometry on the CPU side, for use in modifiers
or transform operators, a dedicated wrapper type is added `MESH_WRAPPER_TYPE_SUBD`.
Subdivision will be lazily evaluated via `BKE_object_get_evaluated_mesh` which will
create such a wrapper if possible. If the final subdivision surface is not needed on
the CPU side, `BKE_object_get_evaluated_mesh_no_subsurf` should be used.
Enabling or disabling GPU subdivision can be done through the user preferences (under
Viewport -> Subdivision).
See patch description for benchmarks.
Reviewed By: campbellbarton, jbakker, fclem, brecht, #eevee_viewport
Differential Revision: https://developer.blender.org/D12406
2021-12-27 16:34:47 +01:00
|
|
|
USERPREF_PT_viewport_subdivision,
|
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,
|
2021-11-13 13:49:09 +11:00
|
|
|
USERPREF_PT_edit_text_editor,
|
2023-08-18 15:54:47 +02:00
|
|
|
USERPREF_PT_edit_node_editor,
|
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_fcurves,
|
|
|
|
|
|
|
|
|
|
USERPREF_PT_system_cycles_devices,
|
2021-06-14 10:15:37 -07:00
|
|
|
USERPREF_PT_system_os_settings,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_system_memory,
|
2020-04-17 17:56:54 +02:00
|
|
|
USERPREF_PT_system_video_sequencer,
|
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,
|
2023-08-31 14:55:55 +02:00
|
|
|
USERPREF_PT_theme_interface_gizmos,
|
|
|
|
|
USERPREF_PT_theme_interface_icons,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_theme_interface_state,
|
|
|
|
|
USERPREF_PT_theme_interface_styles,
|
2020-03-23 16:00:42 +01:00
|
|
|
USERPREF_PT_theme_interface_transparent_checker,
|
2019-01-04 21:40:16 +01:00
|
|
|
USERPREF_PT_theme_text_style,
|
|
|
|
|
USERPREF_PT_theme_bone_color_sets,
|
2020-09-15 12:13:03 -06:00
|
|
|
USERPREF_PT_theme_collection_colors,
|
2021-09-29 14:29:32 +02:00
|
|
|
USERPREF_PT_theme_strip_colors,
|
2019-01-04 21:40:16 +01:00
|
|
|
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_file_paths_data,
|
|
|
|
|
USERPREF_PT_file_paths_render,
|
2023-09-22 01:07:56 +02:00
|
|
|
USERPREF_PT_file_paths_asset_libraries,
|
|
|
|
|
USERPREF_PT_file_paths_script_directories,
|
|
|
|
|
USERPREF_PT_file_paths_extension_repos,
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_file_paths_applications,
|
2023-05-25 16:25:46 -06:00
|
|
|
USERPREF_PT_text_editor,
|
|
|
|
|
USERPREF_PT_text_editor_presets,
|
2019-01-16 18:49:31 +01:00
|
|
|
USERPREF_PT_file_paths_development,
|
|
|
|
|
|
|
|
|
|
USERPREF_PT_saveload_blend,
|
|
|
|
|
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_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,
|
2022-09-26 22:56:14 +02:00
|
|
|
USERPREF_PT_input_touchpad,
|
2019-01-16 18:49:31 +01:00
|
|
|
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,
|
2023-09-20 15:11:18 +10:00
|
|
|
|
|
|
|
|
USERPREF_PT_extensions,
|
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-11-29 19:12:50 +11:00
|
|
|
# Popovers.
|
|
|
|
|
USERPREF_PT_ndof_settings,
|
|
|
|
|
|
2020-06-25 15:46:16 +02:00
|
|
|
USERPREF_PT_experimental_new_features,
|
|
|
|
|
USERPREF_PT_experimental_prototypes,
|
2022-04-14 17:15:07 +10:00
|
|
|
# USERPREF_PT_experimental_tweaks,
|
2020-06-25 15:46:16 +02:00
|
|
|
USERPREF_PT_experimental_debugging,
|
2020-03-17 12:29:36 +01:00
|
|
|
|
2023-02-15 13:00:17 +01:00
|
|
|
# UI lists
|
|
|
|
|
USERPREF_UL_asset_libraries,
|
2023-08-09 20:15:34 +10:00
|
|
|
USERPREF_UL_extension_repos,
|
2023-02-15 13:00:17 +01:00
|
|
|
|
2019-03-13 13:03:54 +11:00
|
|
|
# Add dynamically generated editor theme panels last,
|
|
|
|
|
# so they show up last in the theme section.
|
|
|
|
|
*ThemeGenericClassGenerator.generate_panel_classes_from_theme_areas(),
|
|
|
|
|
)
|
2019-01-04 21:40:16 +01:00
|
|
|
|
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)
|