Use toolbar tabs for node categories instead of just a long list of

panels.

Patch by @Severin (with minor modifications by me). As discussed in
{D535} the node editor does not have real modal operator tools like the
3D view or image editors for instance, so it makes sense to utilise it
this way. Tabs really help in this area due to the large amount of node
types and categories. Further tweaks could be made later if the need
arises.
This commit is contained in:
Lukas Tönne 2014-06-23 16:34:02 +02:00
parent b82e84f179
commit 647870bc6a
2 changed files with 5 additions and 4 deletions

View File

@ -108,7 +108,7 @@ def register_node_categories(identifier, cat_list):
"bl_space_type": 'NODE_EDITOR',
"bl_region_type": 'TOOLS',
"bl_label": cat.name,
"bl_options": {'DEFAULT_CLOSED'},
"bl_category": cat.name,
"category": cat,
"poll": cat.poll,
"draw": draw_node_item,

View File

@ -50,9 +50,10 @@ class TextureNodeCategory(NodeCategory):
return context.space_data.tree_type == 'TextureNodeTree'
# menu entry for making a new group from selected nodes
def group_make_draw(self, layout, context):
# menu entry for node group tools
def group_tools_draw(self, layout, context):
layout.operator("node.group_make")
layout.operator("node.group_ungroup")
layout.separator()
# maps node tree type to group node type
@ -72,7 +73,7 @@ def node_group_items(context):
if not ntree:
return
yield NodeItemCustom(draw=group_make_draw)
yield NodeItemCustom(draw=group_tools_draw)
def contains_group(nodetree, group):
if nodetree == group: