ironflow.node_tools package

Subpackages

Submodules

Module contents

The necessary classes for creating new nodes.

Example

>>> from ironflow import GUI
>>> from ironflow.node_tools import Node, NodeInputBP, NodeOutputBP, dtypes, input_widgets
>>> gui = GUI(script_title='foo')
>>>
>>> class MyNode(Node):
>>>     title = "MyUserNode"
>>>     init_inputs = [
>>>         NodeInputBP(dtype=dtypes.Integer(default=1), label="foo")
>>>     ]
>>>     init_outputs = [
>>>        NodeOutputBP(label="bar")
>>>    ]
>>>    color = 'cyan'
>>>
>>>     def update_event(self, inp=-1):
>>>         self.set_output_val(0, self.input(0) + 42)
>>>
>>> gui.register_node(MyNode)