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 15:14:03 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
|
|
|
|
|
|
|
# <pep8 compliant>
|
|
|
|
import bpy
|
|
|
|
from bpy.types import Header, Menu, Panel
|
|
|
|
|
|
|
|
class TOPBAR_HT_upper_bar(Header):
|
|
|
|
bl_space_type = 'TOPBAR'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
region = context.region
|
|
|
|
|
|
|
|
if region.alignment == 'RIGHT':
|
|
|
|
self.draw_right(context)
|
|
|
|
else:
|
|
|
|
self.draw_left(context)
|
|
|
|
|
|
|
|
def draw_left(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
window = context.window
|
|
|
|
screen = context.screen
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
TOPBAR_MT_editor_menus.draw_collapsible(context, layout)
|
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 15:14:03 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
if not screen.show_fullscreen:
|
2018-04-22 07:09:28 +00:00
|
|
|
layout.template_ID_tabs(
|
|
|
|
window, "workspace",
|
2018-08-28 13:12:14 +00:00
|
|
|
new="workspace.add",
|
2018-08-23 17:58:54 +00:00
|
|
|
menu="TOPBAR_MT_workspace_menu",
|
2018-04-22 07:09:28 +00:00
|
|
|
)
|
2018-04-21 08:06:12 +00:00
|
|
|
else:
|
2018-04-22 07:09:28 +00:00
|
|
|
layout.operator(
|
|
|
|
"screen.back_to_previous",
|
|
|
|
icon='SCREEN_BACK',
|
|
|
|
text="Back to Previous",
|
|
|
|
)
|
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 15:14:03 +00:00
|
|
|
|
|
|
|
def draw_right(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
window = context.window
|
2018-11-01 18:39:40 +00:00
|
|
|
screen = context.screen
|
2018-04-21 08:06:12 +00:00
|
|
|
scene = window.scene
|
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 15:14:03 +00:00
|
|
|
|
2018-11-01 18:39:40 +00:00
|
|
|
# If statusbar is hidden, still show messages at the top
|
|
|
|
if not screen.show_statusbar:
|
|
|
|
layout.template_reports_banner()
|
|
|
|
layout.template_running_jobs()
|
|
|
|
|
2018-04-21 08:06:12 +00:00
|
|
|
# Active workspace view-layer is retrieved through window, not through workspace.
|
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 15:14:03 +00:00
|
|
|
layout.template_ID(window, "scene", new="scene.new", unlink="scene.delete")
|
2018-04-24 13:20:17 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_search(
|
|
|
|
window, "view_layer",
|
|
|
|
scene, "view_layers",
|
|
|
|
new="scene.view_layer_add",
|
|
|
|
unlink="scene.view_layer_remove")
|
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 15:14:03 +00:00
|
|
|
|
|
|
|
|
2019-12-12 16:56:20 +00:00
|
|
|
class TOPBAR_PT_tool_settings_extra(Panel):
|
|
|
|
"""
|
|
|
|
Popover panel for adding extra options that don't fit in the tool settings header
|
|
|
|
"""
|
|
|
|
bl_idname = "TOPBAR_PT_tool_settings_extra"
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
bl_space_type = 'TOPBAR'
|
|
|
|
bl_label = "Extra Options"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
# Get the active tool
|
|
|
|
space_type, mode = ToolSelectPanelHelper._tool_key_from_context(context)
|
|
|
|
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
|
|
|
item, tool, _ = cls._tool_get_active(context, space_type, mode, with_icon=True)
|
|
|
|
if item is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
# Draw the extra settings
|
|
|
|
item.draw_settings(context, layout, tool, extra=True)
|
|
|
|
|
|
|
|
|
2019-12-06 16:45:50 +00:00
|
|
|
class TOPBAR_PT_tool_fallback(Panel):
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
bl_label = "Layers"
|
|
|
|
bl_ui_units_x = 8
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
ToolSelectPanelHelper.draw_fallback_tool_items(layout, context)
|
|
|
|
if tool_settings.workspace_tool_type == 'FALLBACK':
|
|
|
|
tool = context.tool
|
|
|
|
ToolSelectPanelHelper.draw_active_tool_fallback(context, layout, tool)
|
|
|
|
|
|
|
|
|
2018-09-20 15:54:11 +00:00
|
|
|
class TOPBAR_PT_gpencil_layers(Panel):
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
bl_label = "Layers"
|
2018-09-24 10:57:11 +00:00
|
|
|
bl_ui_units_x = 14
|
2018-09-20 15:54:11 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if context.gpencil_data is None:
|
|
|
|
return False
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
if ob is not None and ob.type == 'GPENCIL':
|
|
|
|
return True
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
gpd = context.gpencil_data
|
|
|
|
|
|
|
|
# Grease Pencil data...
|
|
|
|
if (gpd is None) or (not gpd.layers):
|
|
|
|
layout.operator("gpencil.layer_add", text="New Layer")
|
|
|
|
else:
|
|
|
|
self.draw_layers(context, layout, gpd)
|
|
|
|
|
|
|
|
def draw_layers(self, context, layout, gpd):
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
col = row.column()
|
2018-09-27 20:03:50 +00:00
|
|
|
layer_rows = 10
|
2018-10-11 16:27:09 +00:00
|
|
|
col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index",
|
2019-01-09 14:48:09 +00:00
|
|
|
rows=layer_rows, sort_reverse=True, sort_lock=True)
|
2018-09-20 15:54:11 +00:00
|
|
|
|
2018-11-26 17:12:39 +00:00
|
|
|
gpl = context.active_gpencil_layer
|
|
|
|
if gpl:
|
|
|
|
srow = col.row(align=True)
|
|
|
|
srow.prop(gpl, "blend_mode", text="Blend")
|
|
|
|
|
|
|
|
srow = col.row(align=True)
|
|
|
|
srow.prop(gpl, "opacity", text="Opacity", slider=True)
|
2019-06-28 12:24:23 +00:00
|
|
|
srow.prop(gpl, "mask_layer", text="",
|
|
|
|
icon='MOD_MASK' if gpl.mask_layer else 'LAYER_ACTIVE')
|
2018-11-26 17:12:39 +00:00
|
|
|
|
2019-01-11 18:15:23 +00:00
|
|
|
srow = col.row(align=True)
|
|
|
|
srow.prop(gpl, "use_solo_mode", text="Show Only On Keyframed")
|
|
|
|
|
2018-09-20 15:54:11 +00:00
|
|
|
col = row.column()
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
2018-10-01 08:45:50 +00:00
|
|
|
sub.operator("gpencil.layer_add", icon='ADD', text="")
|
|
|
|
sub.operator("gpencil.layer_remove", icon='REMOVE', text="")
|
2018-09-20 15:54:11 +00:00
|
|
|
|
|
|
|
gpl = context.active_gpencil_layer
|
|
|
|
if gpl:
|
2019-03-11 23:59:57 +00:00
|
|
|
sub.menu("GPENCIL_MT_layer_context_menu", icon='DOWNARROW_HLT', text="")
|
2018-09-20 15:54:11 +00:00
|
|
|
|
|
|
|
if len(gpd.layers) > 1:
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
2018-10-11 22:54:26 +00:00
|
|
|
sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP'
|
|
|
|
sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN'
|
2018-09-20 15:54:11 +00:00
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.operator("gpencil.layer_isolate", icon='HIDE_OFF', text="").affect_visibility = True
|
2019-12-04 13:13:21 +00:00
|
|
|
sub.operator("gpencil.layer_isolate", icon='LOCKED', text="").affect_visibility = False
|
2018-09-20 15:54:11 +00:00
|
|
|
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_editor_menus(Menu):
|
|
|
|
bl_idname = "TOPBAR_MT_editor_menus"
|
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 15:14:03 +00:00
|
|
|
bl_label = ""
|
|
|
|
|
2019-08-05 02:47:55 +00:00
|
|
|
def draw(self, context):
|
2018-12-20 01:02:21 +00:00
|
|
|
layout = self.layout
|
2019-05-17 14:34:11 +00:00
|
|
|
|
2019-08-05 02:47:55 +00:00
|
|
|
if context.area.show_menus:
|
2019-07-31 18:37:06 +00:00
|
|
|
layout.menu("TOPBAR_MT_app", text="", icon='BLENDER')
|
|
|
|
else:
|
|
|
|
layout.menu("TOPBAR_MT_app", text="Blender")
|
2019-05-17 14:34:11 +00:00
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
layout.menu("TOPBAR_MT_file")
|
|
|
|
layout.menu("TOPBAR_MT_edit")
|
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 15:14:03 +00:00
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
layout.menu("TOPBAR_MT_render")
|
2018-05-24 15:50:49 +00:00
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
layout.menu("TOPBAR_MT_window")
|
|
|
|
layout.menu("TOPBAR_MT_help")
|
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 15:14:03 +00:00
|
|
|
|
|
|
|
|
2019-05-15 11:05:51 +00:00
|
|
|
class TOPBAR_MT_app(Menu):
|
2019-05-17 11:53:20 +00:00
|
|
|
bl_label = "Blender"
|
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 15:14:03 +00:00
|
|
|
|
2019-05-28 06:22:21 +00:00
|
|
|
def draw(self, _context):
|
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 15:14:03 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2019-05-20 14:52:17 +00:00
|
|
|
layout.operator("wm.splash")
|
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 15:14:03 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-05-20 14:52:17 +00:00
|
|
|
layout.menu("TOPBAR_MT_app_support")
|
2019-05-16 14:54:48 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.menu("TOPBAR_MT_app_about")
|
2019-05-15 11:05:51 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-05-20 14:52:17 +00:00
|
|
|
layout.operator("preferences.app_template_install", text="Install Application Template...")
|
2019-05-15 11:05:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TOPBAR_MT_file(Menu):
|
|
|
|
bl_label = "File"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
|
|
|
layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
|
|
|
|
layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
|
|
|
|
layout.menu("TOPBAR_MT_file_open_recent")
|
|
|
|
layout.operator("wm.revert_mainfile")
|
2019-05-16 14:55:56 +00:00
|
|
|
layout.menu("TOPBAR_MT_file_recover")
|
2019-05-15 11:05:51 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
|
|
|
|
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
|
|
|
|
|
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
|
|
|
layout.operator("wm.save_as_mainfile", text="Save As...")
|
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
|
|
|
layout.operator("wm.save_as_mainfile", text="Save Copy...").copy = True
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-03-01 10:13:32 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
|
|
|
layout.operator("wm.link", text="Link...", icon='LINK_BLEND')
|
|
|
|
layout.operator("wm.append", text="Append...", icon='APPEND_BLEND')
|
|
|
|
layout.menu("TOPBAR_MT_file_previews")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.menu("TOPBAR_MT_file_import", icon='IMPORT')
|
|
|
|
layout.menu("TOPBAR_MT_file_export", icon='EXPORT')
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.menu("TOPBAR_MT_file_external_data")
|
|
|
|
|
2019-05-20 14:52:17 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.menu("TOPBAR_MT_file_defaults")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
|
|
|
|
|
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 15:14:03 +00:00
|
|
|
|
2018-08-28 13:12:14 +00:00
|
|
|
class TOPBAR_MT_file_new(Menu):
|
|
|
|
bl_label = "New File"
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def app_template_paths():
|
|
|
|
import os
|
|
|
|
|
|
|
|
template_paths = bpy.utils.app_template_paths()
|
|
|
|
|
|
|
|
# expand template paths
|
|
|
|
app_templates = []
|
|
|
|
for path in template_paths:
|
|
|
|
for d in os.listdir(path):
|
|
|
|
if d.startswith(("__", ".")):
|
|
|
|
continue
|
|
|
|
template = os.path.join(path, d)
|
|
|
|
if os.path.isdir(template):
|
|
|
|
# template_paths_expand.append(template)
|
|
|
|
app_templates.append(d)
|
|
|
|
|
|
|
|
return sorted(app_templates)
|
|
|
|
|
2019-04-19 05:51:14 +00:00
|
|
|
@staticmethod
|
2019-04-19 05:32:24 +00:00
|
|
|
def draw_ex(layout, _context, *, use_splash=False, use_more=False):
|
2019-04-24 15:45:34 +00:00
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
2018-08-28 13:12:14 +00:00
|
|
|
|
2018-09-18 15:44:14 +00:00
|
|
|
# Limit number of templates in splash screen, spill over into more menu.
|
|
|
|
paths = TOPBAR_MT_file_new.app_template_paths()
|
|
|
|
splash_limit = 5
|
|
|
|
|
|
|
|
if use_splash:
|
2018-10-01 08:45:50 +00:00
|
|
|
icon = 'FILE_NEW'
|
2018-09-18 15:44:14 +00:00
|
|
|
show_more = len(paths) > (splash_limit - 1)
|
|
|
|
if show_more:
|
|
|
|
paths = paths[:splash_limit - 2]
|
|
|
|
elif use_more:
|
2018-11-09 10:20:45 +00:00
|
|
|
icon = 'FILE_NEW'
|
2018-09-18 15:44:14 +00:00
|
|
|
paths = paths[splash_limit - 2:]
|
|
|
|
show_more = False
|
|
|
|
else:
|
|
|
|
icon = 'NONE'
|
|
|
|
show_more = False
|
|
|
|
|
|
|
|
# Draw application templates.
|
|
|
|
if not use_more:
|
|
|
|
props = layout.operator("wm.read_homefile", text="General", icon=icon)
|
2018-08-28 13:12:14 +00:00
|
|
|
props.app_template = ""
|
|
|
|
|
2018-09-18 15:44:14 +00:00
|
|
|
for d in paths:
|
2018-08-28 13:12:14 +00:00
|
|
|
props = layout.operator(
|
|
|
|
"wm.read_homefile",
|
|
|
|
text=bpy.path.display_name(d),
|
2018-09-18 15:44:14 +00:00
|
|
|
icon=icon,
|
2018-08-28 13:12:14 +00:00
|
|
|
)
|
|
|
|
props.app_template = d
|
|
|
|
|
2019-04-25 09:03:09 +00:00
|
|
|
layout.operator_context = 'EXEC_DEFAULT'
|
|
|
|
|
2018-09-18 15:44:14 +00:00
|
|
|
if show_more:
|
|
|
|
layout.menu("TOPBAR_MT_templates_more", text="...")
|
|
|
|
|
2018-08-28 13:12:14 +00:00
|
|
|
def draw(self, context):
|
2018-09-18 15:44:14 +00:00
|
|
|
TOPBAR_MT_file_new.draw_ex(self.layout, context)
|
|
|
|
|
|
|
|
|
2019-05-16 14:55:56 +00:00
|
|
|
class TOPBAR_MT_file_recover(Menu):
|
|
|
|
bl_label = "Recover"
|
|
|
|
|
2019-05-28 06:22:21 +00:00
|
|
|
def draw(self, _context):
|
2019-05-16 14:55:56 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator("wm.recover_last_session", text="Last Session")
|
|
|
|
layout.operator("wm.recover_auto_save", text="Auto Save...")
|
|
|
|
|
|
|
|
|
2019-05-20 14:52:17 +00:00
|
|
|
class TOPBAR_MT_file_defaults(Menu):
|
|
|
|
bl_label = "Defaults"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
prefs = context.preferences
|
|
|
|
|
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
|
|
|
|
|
|
|
if any(bpy.utils.app_template_paths()):
|
|
|
|
app_template = prefs.app_template
|
|
|
|
else:
|
|
|
|
app_template = None
|
|
|
|
|
|
|
|
if app_template:
|
|
|
|
layout.label(text=bpy.path.display_name(app_template, has_ext=False))
|
|
|
|
|
|
|
|
layout.operator("wm.save_homefile")
|
|
|
|
props = layout.operator("wm.read_factory_settings")
|
|
|
|
if app_template:
|
|
|
|
props.app_template = app_template
|
|
|
|
|
|
|
|
|
2019-05-16 14:54:48 +00:00
|
|
|
class TOPBAR_MT_app_about(Menu):
|
|
|
|
bl_label = "About"
|
|
|
|
|
2019-05-28 06:22:21 +00:00
|
|
|
def draw(self, _context):
|
2019-05-16 14:54:48 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2019-08-20 12:00:01 +00:00
|
|
|
layout.operator("wm.url_open_preset", text="Release Notes", icon='URL').type = 'RELEASE_NOTES'
|
2019-05-16 14:54:48 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-08-20 12:00:01 +00:00
|
|
|
layout.operator("wm.url_open_preset", text="Blender Website", icon='URL').type = 'BLENDER'
|
2019-09-03 10:34:34 +00:00
|
|
|
layout.operator("wm.url_open_preset", text="Credits", icon='URL').type = 'CREDITS'
|
2019-05-16 14:54:48 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator(
|
|
|
|
"wm.url_open", text="License", icon='URL',
|
|
|
|
).url = "https://www.blender.org/about/license/"
|
|
|
|
|
|
|
|
|
|
|
|
class TOPBAR_MT_app_support(Menu):
|
|
|
|
bl_label = "Support Blender"
|
|
|
|
|
2019-05-28 06:22:21 +00:00
|
|
|
def draw(self, _context):
|
2019-05-16 14:54:48 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2019-08-20 12:00:01 +00:00
|
|
|
layout.operator("wm.url_open_preset", text="Development Fund", icon='FUND').type = 'FUND'
|
2019-05-16 14:54:48 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator(
|
|
|
|
"wm.url_open", text="Blender Store", icon='URL',
|
|
|
|
).url = "https://store.blender.org"
|
|
|
|
|
|
|
|
|
2018-09-18 15:44:14 +00:00
|
|
|
class TOPBAR_MT_templates_more(Menu):
|
|
|
|
bl_label = "Templates"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
bpy.types.TOPBAR_MT_file_new.draw_ex(self.layout, context, use_more=True)
|
2018-08-28 13:12:14 +00:00
|
|
|
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_file_import(Menu):
|
|
|
|
bl_idname = "TOPBAR_MT_file_import"
|
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 15:14:03 +00:00
|
|
|
bl_label = "Import"
|
|
|
|
|
2019-04-19 05:32:24 +00:00
|
|
|
def draw(self, _context):
|
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 15:14:03 +00:00
|
|
|
if bpy.app.build_options.collada:
|
|
|
|
self.layout.operator("wm.collada_import", text="Collada (Default) (.dae)")
|
|
|
|
if bpy.app.build_options.alembic:
|
|
|
|
self.layout.operator("wm.alembic_import", text="Alembic (.abc)")
|
|
|
|
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_file_export(Menu):
|
|
|
|
bl_idname = "TOPBAR_MT_file_export"
|
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 15:14:03 +00:00
|
|
|
bl_label = "Export"
|
|
|
|
|
2019-04-19 05:32:24 +00:00
|
|
|
def draw(self, _context):
|
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 15:14:03 +00:00
|
|
|
if bpy.app.build_options.collada:
|
|
|
|
self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)")
|
|
|
|
if bpy.app.build_options.alembic:
|
|
|
|
self.layout.operator("wm.alembic_export", text="Alembic (.abc)")
|
|
|
|
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_file_external_data(Menu):
|
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 15:14:03 +00:00
|
|
|
bl_label = "External Data"
|
|
|
|
|
2019-04-19 05:32:24 +00:00
|
|
|
def draw(self, _context):
|
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 15:14:03 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
icon = 'CHECKBOX_HLT' if bpy.data.use_autopack else 'CHECKBOX_DEHLT'
|
|
|
|
layout.operator("file.autopack_toggle", icon=icon)
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
pack_all = layout.row()
|
|
|
|
pack_all.operator("file.pack_all")
|
|
|
|
pack_all.active = not bpy.data.use_autopack
|
|
|
|
|
|
|
|
unpack_all = layout.row()
|
|
|
|
unpack_all.operator("file.unpack_all")
|
|
|
|
unpack_all.active = not bpy.data.use_autopack
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("file.make_paths_relative")
|
|
|
|
layout.operator("file.make_paths_absolute")
|
|
|
|
layout.operator("file.report_missing_files")
|
|
|
|
layout.operator("file.find_missing_files")
|
|
|
|
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_file_previews(Menu):
|
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 15:14:03 +00:00
|
|
|
bl_label = "Data Previews"
|
|
|
|
|
2019-04-19 05:32:24 +00:00
|
|
|
def draw(self, _context):
|
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 15:14:03 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator("wm.previews_ensure")
|
|
|
|
layout.operator("wm.previews_batch_generate")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("wm.previews_clear")
|
|
|
|
layout.operator("wm.previews_batch_clear")
|
|
|
|
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_render(Menu):
|
2018-05-24 15:50:49 +00:00
|
|
|
bl_label = "Render"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2018-05-24 16:09:45 +00:00
|
|
|
rd = context.scene.render
|
|
|
|
|
2018-05-24 15:50:49 +00:00
|
|
|
layout.operator("render.render", text="Render Image", icon='RENDER_STILL').use_viewport = True
|
|
|
|
props = layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION')
|
|
|
|
props.animation = True
|
|
|
|
props.use_viewport = True
|
2018-05-24 16:09:45 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-08-01 22:52:08 +00:00
|
|
|
layout.operator("sound.mixdown", text="Render Audio...")
|
2018-05-24 15:50:49 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-08-01 22:52:08 +00:00
|
|
|
layout.operator("render.view_show", text="View Render")
|
|
|
|
layout.operator("render.play_rendered_anim", text="View Animation")
|
2018-05-24 15:50:49 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-08-01 22:52:08 +00:00
|
|
|
layout.prop(rd, "use_lock_interface", text="Lock Interface")
|
2018-05-24 15:50:49 +00:00
|
|
|
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_edit(Menu):
|
2018-05-24 14:46:01 +00:00
|
|
|
bl_label = "Edit"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator("ed.undo")
|
|
|
|
layout.operator("ed.redo")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-06-10 15:15:24 +00:00
|
|
|
layout.operator("ed.undo_history", text="Undo History...")
|
2018-05-24 14:46:01 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-06-02 21:13:03 +00:00
|
|
|
layout.operator("screen.repeat_last")
|
2018-06-10 15:15:24 +00:00
|
|
|
layout.operator("screen.repeat_history", text="Repeat History...")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("screen.redo_last", text="Adjust Last Operation...")
|
2018-06-02 21:13:03 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-03-20 14:04:28 +00:00
|
|
|
layout.operator("wm.search_menu", text="Operator Search...", icon='VIEWZOOM')
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-03-20 12:21:17 +00:00
|
|
|
# Mainly to expose shortcut since this depends on the context.
|
2019-05-06 11:42:06 +00:00
|
|
|
props = layout.operator("wm.call_panel", text="Rename Active Item...")
|
2019-03-20 12:21:17 +00:00
|
|
|
props.name = "TOPBAR_PT_name"
|
|
|
|
props.keep_open = False
|
|
|
|
|
2019-08-31 17:16:58 +00:00
|
|
|
layout.operator("wm.batch_rename")
|
|
|
|
|
2018-06-30 08:04:08 +00:00
|
|
|
layout.separator()
|
|
|
|
|
2018-06-19 07:11:03 +00:00
|
|
|
# Should move elsewhere (impacts outliner & 3D view).
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
layout.prop(tool_settings, "lock_object_mode")
|
|
|
|
|
2019-05-20 14:52:17 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("screen.userpref_show", text="Preferences...", icon='PREFERENCES')
|
|
|
|
|
2018-05-24 14:46:01 +00:00
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_window(Menu):
|
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 15:14:03 +00:00
|
|
|
bl_label = "Window"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
import sys
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator("wm.window_new")
|
2018-07-03 13:34:26 +00:00
|
|
|
layout.operator("wm.window_new_main")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
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 15:14:03 +00:00
|
|
|
layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER')
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-07-02 12:26:31 +00:00
|
|
|
layout.operator("screen.workspace_cycle", text="Next Workspace").direction = 'NEXT'
|
|
|
|
layout.operator("screen.workspace_cycle", text="Previous Workspace").direction = 'PREV'
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-08-17 15:32:36 +00:00
|
|
|
layout.prop(context.screen, "show_statusbar")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
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 15:14:03 +00:00
|
|
|
layout.operator("screen.screenshot")
|
|
|
|
|
|
|
|
if sys.platform[:3] == "win":
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("wm.console_toggle", icon='CONSOLE')
|
|
|
|
|
|
|
|
if context.scene.render.use_multiview:
|
|
|
|
layout.separator()
|
2018-06-27 10:22:26 +00:00
|
|
|
layout.operator("wm.set_stereo_3d")
|
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 15:14:03 +00:00
|
|
|
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
class TOPBAR_MT_help(Menu):
|
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 15:14:03 +00:00
|
|
|
bl_label = "Help"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2018-12-21 01:47:44 +00:00
|
|
|
show_developer = context.preferences.view.show_developer_ui
|
2018-07-27 00:02:11 +00:00
|
|
|
|
2019-09-07 11:08:20 +00:00
|
|
|
layout.operator("wm.url_open_preset", text="Manual", icon='HELP').type = 'MANUAL'
|
2019-07-01 14:34:10 +00:00
|
|
|
|
2018-07-27 00:02:11 +00:00
|
|
|
layout.operator(
|
2019-05-16 14:54:48 +00:00
|
|
|
"wm.url_open", text="Tutorials", icon='URL',
|
|
|
|
).url = "https://www.blender.org/tutorials"
|
|
|
|
layout.operator(
|
|
|
|
"wm.url_open", text="Support", icon='URL',
|
|
|
|
).url = "https://www.blender.org/support"
|
2018-07-27 00:02:11 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
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 15:14:03 +00:00
|
|
|
layout.operator(
|
2018-07-27 00:02:11 +00:00
|
|
|
"wm.url_open", text="User Communities", icon='URL',
|
|
|
|
).url = "https://www.blender.org/community/"
|
|
|
|
layout.operator(
|
|
|
|
"wm.url_open", text="Developer Community", icon='URL',
|
2019-05-16 14:54:48 +00:00
|
|
|
).url = "https://devtalk.blender.org"
|
2018-09-18 15:44:14 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
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 15:14:03 +00:00
|
|
|
layout.operator(
|
2019-05-16 14:54:48 +00:00
|
|
|
"wm.url_open", text="Python API Reference", icon='URL',
|
|
|
|
).url = bpy.types.WM_OT_doc_view._prefix
|
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 15:14:03 +00:00
|
|
|
|
2018-07-27 00:02:11 +00:00
|
|
|
if show_developer:
|
|
|
|
layout.operator(
|
2019-05-16 14:54:48 +00:00
|
|
|
"wm.url_open", text="Developer Documentation", icon='URL',
|
|
|
|
).url = "https://wiki.blender.org/wiki/Main_Page"
|
2018-07-27 00:02:11 +00:00
|
|
|
|
|
|
|
layout.operator("wm.operator_cheat_sheet", icon='TEXT')
|
|
|
|
|
2019-05-16 14:54:48 +00:00
|
|
|
layout.separator()
|
|
|
|
|
2019-08-20 12:00:01 +00:00
|
|
|
layout.operator("wm.url_open_preset", text="Report a Bug", icon='URL').type = 'BUG'
|
2019-05-16 14:54:48 +00:00
|
|
|
|
|
|
|
layout.separator()
|
2019-05-15 14:40:45 +00:00
|
|
|
|
2018-07-27 00:02:11 +00:00
|
|
|
layout.operator("wm.sysinfo")
|
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 15:14:03 +00:00
|
|
|
|
|
|
|
|
2019-03-11 23:59:57 +00:00
|
|
|
class TOPBAR_MT_file_context_menu(Menu):
|
2018-07-01 15:51:31 +00:00
|
|
|
bl_label = "File Context Menu"
|
|
|
|
|
2019-04-19 05:32:24 +00:00
|
|
|
def draw(self, _context):
|
2018-07-01 15:51:31 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2019-04-24 15:45:34 +00:00
|
|
|
layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
|
2018-07-25 09:56:37 +00:00
|
|
|
layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("wm.link", text="Link...", icon='LINK_BLEND')
|
|
|
|
layout.operator("wm.append", text="Append...", icon='APPEND_BLEND')
|
2018-07-01 15:51:31 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-08-29 13:02:21 +00:00
|
|
|
layout.menu("TOPBAR_MT_file_import", icon='IMPORT')
|
|
|
|
layout.menu("TOPBAR_MT_file_export", icon='EXPORT')
|
2018-07-01 15:51:31 +00:00
|
|
|
|
2018-11-06 21:05:05 +00:00
|
|
|
layout.separator()
|
|
|
|
|
2018-11-28 11:21:49 +00:00
|
|
|
layout.operator("screen.userpref_show", text="Preferences...", icon='PREFERENCES')
|
2018-07-01 15:51:31 +00:00
|
|
|
|
|
|
|
|
2018-08-23 17:58:54 +00:00
|
|
|
class TOPBAR_MT_workspace_menu(Menu):
|
|
|
|
bl_label = "Workspace"
|
|
|
|
|
2019-04-19 05:32:24 +00:00
|
|
|
def draw(self, _context):
|
2018-08-23 17:58:54 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2018-11-06 21:05:05 +00:00
|
|
|
layout.operator("workspace.duplicate", text="Duplicate", icon='DUPLICATE')
|
2018-08-23 17:58:54 +00:00
|
|
|
if len(bpy.data.workspaces) > 1:
|
2018-11-06 21:05:05 +00:00
|
|
|
layout.operator("workspace.delete", text="Delete", icon='REMOVE')
|
2018-08-23 17:58:54 +00:00
|
|
|
|
2018-08-23 14:13:52 +00:00
|
|
|
layout.separator()
|
|
|
|
|
2018-11-06 21:05:05 +00:00
|
|
|
layout.operator("workspace.reorder_to_front", text="Reorder to Front", icon='TRIA_LEFT_BAR')
|
|
|
|
layout.operator("workspace.reorder_to_back", text="Reorder to Back", icon='TRIA_RIGHT_BAR')
|
2018-08-23 14:13:52 +00:00
|
|
|
|
2018-12-13 20:55:12 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
# For key binding discoverability.
|
|
|
|
props = layout.operator("screen.workspace_cycle", text="Previous Workspace")
|
|
|
|
props.direction = 'PREV'
|
|
|
|
props = layout.operator("screen.workspace_cycle", text="Next Workspace")
|
|
|
|
props.direction = 'NEXT'
|
|
|
|
|
2018-08-23 17:58:54 +00:00
|
|
|
|
2018-12-15 16:21:47 +00:00
|
|
|
# Grease Pencil Object - Primitive curve
|
|
|
|
class TOPBAR_PT_gpencil_primitive(Panel):
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
bl_label = "Primitives"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
settings = context.tool_settings.gpencil_sculpt
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
# Curve
|
|
|
|
layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True)
|
|
|
|
|
2019-03-19 23:44:13 +00:00
|
|
|
|
2019-03-17 18:47:31 +00:00
|
|
|
# Grease Pencil Fill
|
|
|
|
class TOPBAR_PT_gpencil_fill(Panel):
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
bl_label = "Advanced"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
paint = context.tool_settings.gpencil_paint
|
|
|
|
brush = paint.brush
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
# Fill
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "fill_factor", text="Resolution")
|
|
|
|
if gp_settings.fill_draw_mode != 'STROKE':
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes")
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "fill_threshold", text="Threshold")
|
|
|
|
|
2018-12-15 16:21:47 +00:00
|
|
|
|
2019-03-20 12:21:17 +00:00
|
|
|
# Only a popover
|
|
|
|
class TOPBAR_PT_name(Panel):
|
|
|
|
bl_space_type = 'TOPBAR' # dummy
|
2019-04-18 19:13:22 +00:00
|
|
|
bl_region_type = 'HEADER'
|
2019-03-20 12:21:17 +00:00
|
|
|
bl_label = "Rename Active Item"
|
|
|
|
bl_ui_units_x = 14
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
# Edit first editable button in popup
|
|
|
|
def row_with_icon(layout, icon):
|
|
|
|
row = layout.row()
|
|
|
|
row.activate_init = True
|
|
|
|
row.label(icon=icon)
|
|
|
|
return row
|
|
|
|
|
|
|
|
mode = context.mode
|
|
|
|
scene = context.scene
|
|
|
|
space = context.space_data
|
|
|
|
space_type = None if (space is None) else space.type
|
|
|
|
found = False
|
|
|
|
if space_type == 'SEQUENCE_EDITOR':
|
|
|
|
layout.label(text="Sequence Strip Name")
|
|
|
|
item = getattr(scene.sequence_editor, "active_strip")
|
|
|
|
if item:
|
|
|
|
row = row_with_icon(layout, 'SEQUENCE')
|
|
|
|
row.prop(item, "name", text="")
|
|
|
|
found = True
|
|
|
|
elif space_type == 'NODE_EDITOR':
|
2019-04-12 11:50:33 +00:00
|
|
|
layout.label(text="Node Label")
|
2019-03-20 12:21:17 +00:00
|
|
|
item = context.active_node
|
|
|
|
if item:
|
|
|
|
row = row_with_icon(layout, 'NODE')
|
2019-04-12 11:50:33 +00:00
|
|
|
row.prop(item, "label", text="")
|
2019-03-20 12:21:17 +00:00
|
|
|
found = True
|
|
|
|
else:
|
|
|
|
if mode == 'POSE' or (mode == 'WEIGHT_PAINT' and context.pose_object):
|
|
|
|
layout.label(text="Bone Name")
|
2019-03-20 13:33:49 +00:00
|
|
|
item = context.active_pose_bone
|
2019-03-20 12:21:17 +00:00
|
|
|
if item:
|
|
|
|
row = row_with_icon(layout, 'BONE_DATA')
|
2019-03-20 13:33:49 +00:00
|
|
|
row.prop(item, "name", text="")
|
2019-03-20 12:21:17 +00:00
|
|
|
found = True
|
|
|
|
elif mode == 'EDIT_ARMATURE':
|
|
|
|
layout.label(text="Bone Name")
|
|
|
|
item = context.active_bone
|
|
|
|
if item:
|
|
|
|
row = row_with_icon(layout, 'BONE_DATA')
|
|
|
|
row.prop(item, "name", text="")
|
|
|
|
found = True
|
|
|
|
else:
|
|
|
|
layout.label(text="Object Name")
|
|
|
|
item = context.object
|
|
|
|
if item:
|
|
|
|
row = row_with_icon(layout, 'OBJECT_DATA')
|
|
|
|
row.prop(item, "name", text="")
|
|
|
|
found = True
|
|
|
|
|
|
|
|
if not found:
|
|
|
|
row = row_with_icon(layout, 'ERROR')
|
|
|
|
row.label(text="No active item")
|
|
|
|
|
|
|
|
|
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 15:14:03 +00:00
|
|
|
classes = (
|
|
|
|
TOPBAR_HT_upper_bar,
|
2019-03-11 23:59:57 +00:00
|
|
|
TOPBAR_MT_file_context_menu,
|
2018-08-23 17:58:54 +00:00
|
|
|
TOPBAR_MT_workspace_menu,
|
2018-08-29 13:02:21 +00:00
|
|
|
TOPBAR_MT_editor_menus,
|
2019-05-15 11:05:51 +00:00
|
|
|
TOPBAR_MT_app,
|
2019-05-16 14:54:48 +00:00
|
|
|
TOPBAR_MT_app_about,
|
|
|
|
TOPBAR_MT_app_support,
|
2018-08-29 13:02:21 +00:00
|
|
|
TOPBAR_MT_file,
|
2018-08-28 13:12:14 +00:00
|
|
|
TOPBAR_MT_file_new,
|
2019-05-16 14:55:56 +00:00
|
|
|
TOPBAR_MT_file_recover,
|
2019-05-20 14:52:17 +00:00
|
|
|
TOPBAR_MT_file_defaults,
|
2018-09-18 15:44:14 +00:00
|
|
|
TOPBAR_MT_templates_more,
|
2018-08-29 13:02:21 +00:00
|
|
|
TOPBAR_MT_file_import,
|
|
|
|
TOPBAR_MT_file_export,
|
|
|
|
TOPBAR_MT_file_external_data,
|
|
|
|
TOPBAR_MT_file_previews,
|
|
|
|
TOPBAR_MT_edit,
|
|
|
|
TOPBAR_MT_render,
|
|
|
|
TOPBAR_MT_window,
|
|
|
|
TOPBAR_MT_help,
|
2019-12-06 16:45:50 +00:00
|
|
|
TOPBAR_PT_tool_fallback,
|
2019-12-12 16:56:20 +00:00
|
|
|
TOPBAR_PT_tool_settings_extra,
|
2018-09-20 15:54:11 +00:00
|
|
|
TOPBAR_PT_gpencil_layers,
|
2018-12-15 16:21:47 +00:00
|
|
|
TOPBAR_PT_gpencil_primitive,
|
2019-03-17 18:47:31 +00:00
|
|
|
TOPBAR_PT_gpencil_fill,
|
2019-04-20 11:28:16 +00:00
|
|
|
TOPBAR_PT_name,
|
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 15:14:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|