[Bf-blender-cvs] [647870b] master: Use toolbar tabs for node categories instead of just a long list of panels.

Lukas Tönne noreply at git.blender.org
Mon Jun 23 16:44:53 CEST 2014


Commit: 647870bc6af4fae4ec0408ede2da9f5b4dabe7f2
Author: Lukas Tönne
Date:   Mon Jun 23 16:34:02 2014 +0200
https://developer.blender.org/rB647870bc6af4fae4ec0408ede2da9f5b4dabe7f2

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.

===================================================================

M	release/scripts/modules/nodeitems_utils.py
M	release/scripts/startup/nodeitems_builtins.py

===================================================================

diff --git a/release/scripts/modules/nodeitems_utils.py b/release/scripts/modules/nodeitems_utils.py
index f017c76..1fef6c3 100644
--- a/release/scripts/modules/nodeitems_utils.py
+++ b/release/scripts/modules/nodeitems_utils.py
@@ -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,
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index 55f42ad..0a90b9f 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -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:




More information about the Bf-blender-cvs mailing list