On this page |
Overview
Clips are bits of animation that an agent replays when in a certain state. Houdini will look for an animation clip with the same name as the state and apply it to any agents in that state.
Even while agents are running pre-made animation, the simulation can add procedural changes on top, for terrain adaptation, "look at", and so on. You can also transition from animation to ragdoll simulation.
Houdini requires that you "bake out" the animation to files on disk for performance. Each time you add or change a clip, you should go to this node and re-save the animations to disk.
How it works
The Agent render node "renders" a piece of character animation out to files on disk containing the animated geometry and character skeleton data. The render node associates the files with the combination of the name of the agent and the name of the clip. The Crowd Source nodes in the agent geometry network associates agent primitives with a set of clips through the agent name. An agent in a certain state will loop an animation clip with the same name as the state.
The render node writes the files to, and the crowd nodes read the files from, a cache directory. The default cache directory is ${HIP}/agents/
, which stores the clips in an agents
subdirectory next to the scene file. If you change the cache directory, you need to also change it in any Crowd Source nodes in the agent geometry network that load the clips. (If you do this, you might want to use channel references between the nodes to make sure they stay synchronized.)
Adding an animation clip
The crowd system assumes characters are contained in an asset or subnetwork.
-
Load and select the character node (asset or subnet) containing the animation you want to bake out.
-
In the Crowds shelf, click Bake Agent. This creates a
agent_bake
render subnet at the object level if it doesn’t already exist, creates a new Agent render node inside for this clip, and selects it. -
In the parameter editor, set the Agent name to the name of the character this animation is for (for example,
knight
). Set the Clip name to a name of the clip (for example,charge
).
Re-baking animation after changes
-
Select the character baking render subnetwork. In the parameter editor, click Render to render all the character baking nodes inside. (If this is very slow, you can go into the render subnetwork and individually render the node only for the characters that have changed.)
-
After you bake out any new clips, select the any Crowd Source nodes that use the character in the crowd geometry network. In the parameter editor, click then Source tab, then click Reload.
Tips and notes
-
The Crowd Solver in the simulation network has controls for how the solver re-times animation to better match agent movement.
See also |