Skip to content
Luna edited this page May 30, 2021 · 3 revisions

Nodes

Nodes are the backbone of an Inochi2D puppet, they make up all the parts of the puppet that move as well as contain data for deformation, etc.
NOTE: Inochi2D is still under active development and the Nodes are subject to change over time.

Nodes are built out of a class hierarchy, every node being a subclass of the main Node class.
Some nodes have their own special subclass (eg. Drawables), which needs to be instantiated at load time through some factory mechanism.
Every node has a typeId which can be used for this, type ids are of a string type.

Every subclassed node of a Node type contain and should encode the values of their parent class.

Official TypeIds

Here's a nonexhaustive list of current typeIds in Inochi2D

Type Id Mapped To Notes
Node Node
Drawable Drawables Non-instantiatable, throw error
PathDeform PathDeform
Part Part Subclass of Drawable
Mask Mask Subclass of Drawable

UUIDs

Every node has an UUID which is used in the encoded file format to allow for decoding. The UUIDs are simple unsigned integers that are randomly generated via whatever Random algorithm your language supports, (std.random.uniform in the reference implemtation's case).
When generating a UUID there's a small piece of logic that makes sure no IDs overlap.

Names

Every node can optionally have a user specified human readable name, which can be used for indexing instead of UUIDs. They serve no other purpose than readability. Nodes that haven't been named will automatically be given the name Unnamed Node

Enabled Status

Every node can be enabled or disabled, this prevents the node from being drawn if it can be drawn, as well as disables its own local updating to save on resources.

ZSort

Nodes are sorted by their ZSort value, while Inochi2D is in a semi-3D space sorting is done on the CPU to allow for more control for the rigger to for example allow head turning to make hair appear in front of the head, and such.

Transform

See the Transforms page (NOTE: TODO)

Children

Every node can have child nodes which inherit their parent node's transform information.