diff options
Diffstat (limited to 'release/scripts/templates_py/custom_nodes.py')
-rw-r--r-- | release/scripts/templates_py/custom_nodes.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/release/scripts/templates_py/custom_nodes.py b/release/scripts/templates_py/custom_nodes.py index 23d8ee55e72..a2701360c9b 100644 --- a/release/scripts/templates_py/custom_nodes.py +++ b/release/scripts/templates_py/custom_nodes.py @@ -30,10 +30,15 @@ class MyCustomSocket(NodeSocket): ('DOWN', "Down", "Where your feet are"), ('UP', "Up", "Where your head should be"), ('LEFT', "Left", "Not right"), - ('RIGHT', "Right", "Not left") + ('RIGHT', "Right", "Not left"), ) - my_enum_prop = bpy.props.EnumProperty(name="Direction", description="Just an example", items=my_items, default='UP') + my_enum_prop: bpy.props.EnumProperty( + name="Direction", + description="Just an example", + items=my_items, + default='UP', + ) # Optional function for drawing the socket input value def draw(self, context, layout, node, text): @@ -71,8 +76,8 @@ class MyCustomNode(Node, MyCustomTreeNode): # These work just like custom properties in ID data blocks # Extensive information can be found under # http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Properties - my_string_prop = bpy.props.StringProperty() - my_float_prop = bpy.props.FloatProperty(default=3.1415926) + my_string_prop: bpy.props.StringProperty() + my_float_prop: bpy.props.FloatProperty(default=3.1415926) # === Optional Functions === # Initialization function, called when a new node is created. @@ -98,7 +103,7 @@ class MyCustomNode(Node, MyCustomTreeNode): # Additional buttons displayed on the node. def draw_buttons(self, context, layout): - layout.label("Node settings") + layout.label(text="Node settings") layout.prop(self, "my_float_prop") # Detail buttons in the sidebar. |