##How to make my own nodes
To create your own node you have to follow 2 simple steps:
- Copy the file of an existing node and change to you needs.
- Register the node in the nodes/mn_node_list.py file.
All node files are in the subdirectories of the Folder named nodes.
The Code itself is very self-explanatory. You have to change:
- the class Name too something that fits the purpose of your node
- the bl_idname variable: you Need this later to Register the node
- the bl_label variable: the user will see this in the add menu
The init function is for defining the sockets. In other nodes you see exactly how this has to look like. There are a few different types of sockets (the list will probably get longer over time):
- StringSocket -> Text
- ObjectSocket -> Object names
- IntegerSocket -> Whole Numbers
- FloatSocket -> All Numbers
- VectorSocket -> Vector with an x, y and z component
- GenericSocket -> allows all types
Here you add the code that executes when the node is used. It gets a variable named input as Parameter. This is a dictionary which contains your input socket names as keys. This function always returns a dictionary that should be called output. The keys of this dictionary are equivalent to the output socket names you defined in the init function.
Open the mn_node_list.py file and write your bl_idname in the corresponding category or define you own category. This shouldn't be more than a one-line-change.
The best way to implement new nodes is to look at the existing ones :D