diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-21 16:27:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-30 17:10:03 +0300 |
commit | 9f78f471d7aeacd357349f0eb4b8f8bbc01db756 (patch) | |
tree | e6dd30928d9566ad86cf19658f691e3c78fe887c /release/scripts | |
parent | df8a7ec3a81394fef4a21a6f1c1e4a43d5d44fba (diff) |
Workspaces: switch object mode when switching workspaces.
In the workspace properties a mode can now be configured that is
automatically enabled when switching to the workspace.
This is a test to validate how well it works. The weak point is
that if you don't have an appropriate object already select it will
not switch modes.
See T56475.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_workspace.py (renamed from release/scripts/startup/bl_ui/properties_data_workspace.py) | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index d88cee4424b..093739c5b08 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -92,7 +92,7 @@ _modules = [ "space_view3d_toolbar", # XXX, keep last so panels show after all other tool options. - "properties_data_workspace", + "properties_workspace", ] import bpy diff --git a/release/scripts/startup/bl_ui/properties_data_workspace.py b/release/scripts/startup/bl_ui/properties_workspace.py index b01ed640b2c..d07e2dbbaf6 100644 --- a/release/scripts/startup/bl_ui/properties_data_workspace.py +++ b/release/scripts/startup/bl_ui/properties_workspace.py @@ -36,11 +36,15 @@ class WORKSPACE_PT_main(WorkSpaceButtonsPanel, Panel): bl_options = {'DEFAULT_CLOSED'} def draw(self, context): - pass + workspace = context.workspace + + layout = self.layout + layout.use_property_split = True + layout.prop(workspace, "object_mode", text="Mode") -class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel): - bl_label = "Workspace Add-ons" +class WORKSPACE_PT_addons(WorkSpaceButtonsPanel, Panel): + bl_label = "Filter Add-ons" bl_parent_id = "WORKSPACE_PT_main" def draw_header(self, context): @@ -102,7 +106,7 @@ class WORKSPACE_PT_custom_props(WorkSpaceButtonsPanel, PropertyPanel, Panel): classes = ( WORKSPACE_PT_main, - WORKSPACE_PT_owner_ids, + WORKSPACE_PT_addons, WORKSPACE_PT_custom_props, ) |