[Bf-blender-cvs] [7baddbf8180] master: UI: add tool panel for node editor, use tabs
Campbell Barton
noreply at git.blender.org
Fri May 17 04:51:18 CEST 2019
Commit: 7baddbf81807bc145efe61001da9f574df121965
Author: Campbell Barton
Date: Fri May 17 10:58:43 2019 +1000
Branches: master
https://developer.blender.org/rB7baddbf81807bc145efe61001da9f574df121965
UI: add tool panel for node editor, use tabs
This follows the 3D view, adding an "Options" tab.
===================================================================
M release/scripts/startup/bl_ui/space_node.py
M source/blender/editors/space_node/space_node.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 52a3a714cdc..45ff4ce6c5f 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -27,6 +27,9 @@ from .properties_grease_pencil_common import (
AnnotationDataPanel,
GreasePencilToolsPanel,
)
+from .space_toolsystem_common import (
+ ToolActivePanelHelper,
+)
from .properties_material import (
EEVEE_MATERIAL_PT_settings,
MATERIAL_PT_viewport
@@ -321,6 +324,12 @@ class NODE_MT_node(Menu):
layout.operator("node.read_viewlayers")
+class NODE_PT_active_tool(ToolActivePanelHelper, Panel):
+ bl_space_type = 'NODE_EDITOR'
+ bl_region_type = 'UI'
+ bl_category = "Tool"
+
+
class NODE_PT_material_slots(Panel):
bl_space_type = "NODE_EDITOR"
bl_region_type = 'HEADER'
@@ -430,7 +439,7 @@ class NODE_MT_context_menu(Menu):
class NODE_PT_active_node_generic(Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_category = "Node"
+ bl_category = "Item"
bl_label = "Node"
@classmethod
@@ -448,7 +457,7 @@ class NODE_PT_active_node_generic(Panel):
class NODE_PT_active_node_color(Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_category = "Node"
+ bl_category = "Item"
bl_label = "Color"
bl_options = {'DEFAULT_CLOSED'}
bl_parent_id = 'NODE_PT_active_node_generic'
@@ -478,7 +487,7 @@ class NODE_PT_active_node_color(Panel):
class NODE_PT_active_node_properties(Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_category = "Node"
+ bl_category = "Item"
bl_label = "Properties"
bl_options = {'DEFAULT_CLOSED'}
bl_parent_id = 'NODE_PT_active_node_generic'
@@ -512,7 +521,7 @@ class NODE_PT_active_node_properties(Panel):
class NODE_PT_texture_mapping(Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_category = "Node"
+ bl_category = "Item"
bl_label = "Texture Mapping"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@@ -550,7 +559,7 @@ class NODE_PT_texture_mapping(Panel):
class NODE_PT_backdrop(Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_category = "Node"
+ bl_category = "View"
bl_label = "Backdrop"
@classmethod
@@ -585,7 +594,7 @@ class NODE_PT_backdrop(Panel):
class NODE_PT_quality(bpy.types.Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_category = "Node"
+ bl_category = "Options"
bl_label = "Performance"
@classmethod
@@ -639,7 +648,7 @@ class NODE_UL_interface_sockets(bpy.types.UIList):
class NODE_PT_grease_pencil(AnnotationDataPanel, Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_category = "Node"
+ bl_category = "View"
bl_options = {'DEFAULT_CLOSED'}
# NOTE: this is just a wrapper around the generic GP Panel
@@ -653,7 +662,7 @@ class NODE_PT_grease_pencil(AnnotationDataPanel, Panel):
class NODE_PT_grease_pencil_tools(GreasePencilToolsPanel, Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_category = "Node"
+ bl_category = "View"
bl_options = {'DEFAULT_CLOSED'}
# NOTE: this is just a wrapper around the generic GP tools panel
@@ -672,7 +681,7 @@ def node_panel(cls):
node_cls.bl_space_type = 'NODE_EDITOR'
node_cls.bl_region_type = 'UI'
- node_cls.bl_category = "Node"
+ node_cls.bl_category = "Options"
if hasattr(node_cls, 'bl_parent_id'):
node_cls.bl_parent_id = 'NODE_' + node_cls.bl_parent_id
@@ -694,6 +703,7 @@ classes = (
NODE_PT_active_node_color,
NODE_PT_active_node_properties,
NODE_PT_texture_mapping,
+ NODE_PT_active_tool,
NODE_PT_backdrop,
NODE_PT_quality,
NODE_PT_grease_pencil,
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 2351d437294..7183512a5bc 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -1001,6 +1001,7 @@ void ED_spacetype_node(void)
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH;
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
art->listener = node_region_listener;
+ art->message_subscribe = ED_area_do_mgs_subscribe_for_tool_ui;
art->init = node_buttons_region_init;
art->draw = node_buttons_region_draw;
BLI_addhead(&st->regiontypes, art);
More information about the Bf-blender-cvs
mailing list