Skip to content

allkhor/animation-nodes

 
 

Repository files navigation

http://animation-nodes-documentation.readthedocs.org/en/latest/

##How to make my own nodes

Overview

To create your own node you have to follow 2 simple steps:

  1. Copy the file of an existing node and change to you needs.
  2. Register the node in the nodes/mn_node_list.py file.

All node files are in the subdirectories of the Folder named nodes.

the class

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

init

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

execute

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.

Registration

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.

summary

The best way to implement new nodes is to look at the existing ones :D

About

A node based system to create animations.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%