From fd2e3999bbbac2569e477eeb4eae1e261d1f4e36 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Sun, 9 Jun 2013 08:46:47 +0000 Subject: [PATCH] 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. --- release/scripts/templates_py/custom_nodes.py | 23 -------------------- 1 file changed, 23 deletions(-) diff --git a/release/scripts/templates_py/custom_nodes.py b/release/scripts/templates_py/custom_nodes.py index a07d5173825..6d5f85a556c 100644 --- a/release/scripts/templates_py/custom_nodes.py +++ b/release/scripts/templates_py/custom_nodes.py @@ -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() -