Style cleanup: C & pep8
This commit is contained in:
@@ -49,13 +49,15 @@ class MyCustomSocket(NodeSocket):
|
||||
def draw_color(self, context, node):
|
||||
return (1.0, 0.4, 0.216, 0.5)
|
||||
|
||||
|
||||
# Mix-in class for all custom nodes in this tree type.
|
||||
# Defines a poll function to enable instantiation.
|
||||
class MyCustomTreeNode :
|
||||
class MyCustomTreeNode:
|
||||
@classmethod
|
||||
def poll(cls, ntree):
|
||||
return ntree.bl_idname == 'CustomTreeType'
|
||||
|
||||
|
||||
# Derived from the Node base type.
|
||||
class MyCustomNode(Node, MyCustomTreeNode):
|
||||
# === Basics ===
|
||||
@@ -123,6 +125,7 @@ class MyCustomNode(Node, MyCustomTreeNode):
|
||||
import nodeitems_utils
|
||||
from nodeitems_utils import NodeCategory, NodeItem
|
||||
|
||||
|
||||
# our own base class with an appropriate poll function,
|
||||
# so the categories only show up in our own tree type
|
||||
class MyNodeCategory(NodeCategory):
|
||||
@@ -143,12 +146,12 @@ node_categories = [
|
||||
# NB: settings values are stored as string expressions,
|
||||
# for this reason they should be converted to strings using repr()
|
||||
NodeItem("CustomNodeType", label="Node A", settings={
|
||||
"myStringProperty" : repr("Lorem ipsum dolor sit amet"),
|
||||
"myFloatProperty" : repr(1.0),
|
||||
"myStringProperty": repr("Lorem ipsum dolor sit amet"),
|
||||
"myFloatProperty": repr(1.0),
|
||||
}),
|
||||
NodeItem("CustomNodeType", label="Node B", settings={
|
||||
"myStringProperty" : repr("consectetur adipisicing elit"),
|
||||
"myFloatProperty" : repr(2.0),
|
||||
"myStringProperty": repr("consectetur adipisicing elit"),
|
||||
"myFloatProperty": repr(2.0),
|
||||
}),
|
||||
]),
|
||||
]
|
||||
|
Reference in New Issue
Block a user