Fix #35633, Cannot Add Group Node In Blender 2.67a. The menu entry for the "make group" operator was missing in the new categories system. Added an alternative NodeItemCustom to the standard NodeItem to

allow custom draw functions such as this operator. Used in the group items callback to generate the basic group_make operator call.
This commit is contained in:
Lukas Toenne
2013-06-05 09:21:17 +00:00
parent aa96f0290a
commit 32f35056af
2 changed files with 30 additions and 9 deletions

View File

@@ -19,7 +19,7 @@
# <pep8 compliant>
import bpy
import nodeitems_utils
from nodeitems_utils import NodeCategory, NodeItem
from nodeitems_utils import NodeCategory, NodeItem, NodeItemCustom
# Subclasses for standard node types
@@ -47,6 +47,11 @@ 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):
layout.operator("node.group_make")
layout.separator()
# maps node tree type to group node type
node_tree_group_type = {
'CompositorNodeTree' : 'CompositorNodeGroup',
@@ -62,6 +67,8 @@ def node_group_items(context):
if not ntree:
return
yield NodeItemCustom(draw=group_make_draw)
def contains_group(nodetree, group):
if nodetree == group:
return True