[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57302] trunk/blender/release/scripts/ templates_py/custom_nodes.py: Removed deprecated XXX comment from custom_nodes.py, importing node base types works now ( this comment was causing some confusion in the past).

Lukas Toenne lukas.toenne at googlemail.com
Sun Jun 9 11:42:35 CEST 2013


Revision: 57302
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57302
Author:   lukastoenne
Date:     2013-06-09 09:42:34 +0000 (Sun, 09 Jun 2013)
Log Message:
-----------
Removed deprecated XXX comment from custom_nodes.py, importing node base types works now (this comment was causing some confusion in the past).

Modified Paths:
--------------
    trunk/blender/release/scripts/templates_py/custom_nodes.py

Modified: trunk/blender/release/scripts/templates_py/custom_nodes.py
===================================================================
--- trunk/blender/release/scripts/templates_py/custom_nodes.py	2013-06-09 08:46:48 UTC (rev 57301)
+++ trunk/blender/release/scripts/templates_py/custom_nodes.py	2013-06-09 09:42:34 UTC (rev 57302)
@@ -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 @@
     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 @@
 
 
 # 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 @@
     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 @@
         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'''




More information about the Bf-blender-cvs mailing list