diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-06-09 13:42:34 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-06-09 13:42:34 +0400 |
commit | 6e55460a8d208f7d8dd9992416d0c359c0298488 (patch) | |
tree | 7af23c6b349702d93852fec3c50a0c21d25d1dc2 /release | |
parent | 90cbf5d5918f770a6a348d84a8601f93c33ace22 (diff) |
Removed deprecated XXX comment from custom_nodes.py, importing node base types works now (this comment was causing some confusion in the past).
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/templates_py/custom_nodes.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/release/scripts/templates_py/custom_nodes.py b/release/scripts/templates_py/custom_nodes.py index 30c91840590..48dbfd4749a 100644 --- a/release/scripts/templates_py/custom_nodes.py +++ b/release/scripts/templates_py/custom_nodes.py @@ -1,6 +1,5 @@ import bpy -# XXX these don't work yet ... -#from bpy_types import NodeTree, Node, NodeSocket +from bpy_types import NodeTree, Node, NodeSocket # Implementation of custom nodes from Python @@ -10,7 +9,7 @@ def add_nodetype(layout, type): layout.operator("node.add_node", text=type.bl_label).type = type.bl_rna.identifier # Derived from the NodeTree base type, similar to Menu, Operator, Panel, etc. -class MyCustomTree(bpy.types.NodeTree): +class MyCustomTree(NodeTree): # Description string '''A custom node tree type that will show up in the node editor header''' # Optional identifier string. If not explicitly defined, the python class name is used. @@ -30,7 +29,7 @@ class MyCustomTree(bpy.types.NodeTree): # Custom socket type -class MyCustomSocket(bpy.types.NodeSocket): +class MyCustomSocket(NodeSocket): # Description string '''Custom node socket type''' # Optional identifier string. If not explicitly defined, the python class name is used. @@ -59,7 +58,7 @@ class MyCustomSocket(bpy.types.NodeSocket): def draw_color(self, context, node): return (1.0, 0.4, 0.216, 0.5) -# Base class for all custom nodes in this tree type. +# Mix-in class for all custom nodes in this tree type. # Defines a poll function to enable instantiation. class MyCustomTreeNode : @classmethod @@ -67,7 +66,7 @@ class MyCustomTreeNode : return ntree.bl_idname == 'CustomTreeType' # Derived from the Node base type. -class MyCustomNode(bpy.types.Node, MyCustomTreeNode): +class MyCustomNode(Node, MyCustomTreeNode): # === Basics === # Description string '''A custom node''' |