Removed the 'custom node group' example from the pynodes template script. This does not work properly due to the fact that node groups don't have a single registerable base class any more. The reason for

that is that RNA does not support multiple inheritance so the actual node group subtypes (ShaderNodeGroup, CompositorNodeGroup, TextureNodeGroup) can not be derived from both the
ShaderNode/CompositorNode/TextureNode base types as well as a common NodeGroup type ... It is possible however to define node group types entirely in python which avoids the limitations of the RNA system
and is much more flexible, example for this will follow later.
This commit is contained in:
Lukas Toenne 2013-06-09 08:46:47 +00:00
parent 820acf1b9e
commit fd2e3999bb

@ -120,44 +120,21 @@ class MyCustomNode(bpy.types.Node, MyCustomTreeNode):
layout.prop(self, "myStringProperty")
# A customized group-like node.
class MyCustomGroup(bpy.types.NodeGroup, MyCustomTreeNode):
# === Basics ===
# Description string
'''A custom group node'''
# Label for nice name display
bl_label = 'Custom Group Node'
bl_group_tree_idname = 'CustomTreeType'
orks = bpy.props.IntProperty(default=3)
dwarfs = bpy.props.IntProperty(default=12)
wizards = bpy.props.IntProperty(default=1)
# Additional buttons displayed on the node.
def draw_buttons(self, context, layout):
col = layout.column(align=True)
col.prop(self, "orks")
col.prop(self, "dwarfs")
col.prop(self, "wizards")
layout.label("The Node Tree:")
layout.prop(self, "node_tree", text="")
def register():
bpy.utils.register_class(MyCustomTree)
bpy.utils.register_class(MyCustomSocket)
bpy.utils.register_class(MyCustomNode)
bpy.utils.register_class(MyCustomGroup)
def unregister():
bpy.utils.unregister_class(MyCustomTree)
bpy.utils.unregister_class(MyCustomSocket)
bpy.utils.unregister_class(MyCustomNode)
bpy.utils.unregister_class(MyCustomGroup)
if __name__ == "__main__":
register()