Speed Up Performance in Animation Nodes
Animation nodes addon for blender is pretty powerful when it comes to creating interactive elements.
Sometimes it gets messy and it hits your performance very badly, in that situation we could use a few tricks
and caching feature to optimize the scene and gain a massive performance boost.
Turn off “Alway” on checkbox
This feature is on by default. If we’re working on something simple it makes sense but it becomes a massive
drag once your node tree starts to grow and becoming complicated.
Open you T panel, go to “Animation Nodes” settings and turn off this feature
and turn on “Tree Changed”, “Frame Changed” and Property Changed” options.
Tree Changed will update the node tree whenever you add or delete any node in the node tree.
Frame Changed will update the node tree whenever you scrub the play header in the timeline.
Property Changed will update the node tree whenever you changed any property in any node.
Use “Duplicate” command to duplicate the object to detach it from animation nodes node tree
We don’t always need that much control for every single element that we’re generating from animation nodes
if the element is just going to be a static mesh and if we don’t have any plan for modifying it in the future
why we’ll need that much overhead? remember every loop iteration counts.
Turn off the active button on “Object Output Nodes”
Sometimes we’re not sure whether the object is going to be a static mesh or will need modification or will animate.
In that situation, you probably need to preserve the node tree so instead of duplicating the object to detach it from
animation nodes, keep the object as it is but turn off active button on object output nodes. if it’s a spline object turn off
radio button right in front of “Spline” output. and if it’s a mesh object output turn off the radio button in front of “Mesh Data”.
We can also use caching feature on supported nodes to further enhance performance.
Caching option is not available on all nodes but only on three nodes “Loop”, “Group” and “Script” because these nodes become very
complicated very quickly.
Turn on this feature by going into the N panel under “Advance Node Setting”. Remember it will only show this feature
on invoke subprogram nodes and with at least one input except loop nodes.
By default, it’s set to “Disable” which is self-explanatory.
if you set this to “Once per input” it means that the subprogram will be executed once per input configuration. This is useful when the
subprogram only depends on its inputs and when it is only invoked with a few different input combinations.
There are also some limits which input and output types are allowed. You probably should not use it when you have a subprogram with many inputs.
if you set this to “One Time” it means it will store all the input and output values one time in a static form which means no animation.
if you set this to “Once per frame” it means it will store all the animated inputs and outputs. after setting this make sure you cache the values by playing your timeline once.
Before modifying any value make sure cache options is set to disable and click “Clear Cache” button once.
Watch the video if you want to see this process with examples.
Example scenes used in this tutorial is part of “Hud Nodes Pack” which is currently under development.
Tweets by ThinkPeng1