On this page |
Agent layers
Layers let you choose between several different available display geometries for each individual agent. This lets you create crowd diversity within a single agent class.
Creating layers
When you create an agent from a character, Houdini generates a default layer from the original character’s visible geometry. The Agent Layer geometry node lets you add additional layers.
For example, to create a layer with a different overall character skin:
-
In the crowd source geometry network, add an Agent Layer node.
-
Click the Add button next to Layer bindings to add a binding.
-
Set the SOP path to the geometry node representing the new character skin.
-
Enter a Shape name for the skin.
-
In the Transform name menu, choose the top-level transform of the rig.
-
Setting the current layer
Each individual agent primitive has a current display layer. (It also has a collision layer, which is the geometry used in dynamics for collisions.)
-
The high-level Crowd Source geometry node has options to randomly assign the current display layer across the crowd.
-
You can use the Agent Edit geometry node in the source network to change the current layer for selected agents.
-
If you want to set the current layer in a wrangler or VOP network (for example, to change an agent’s layer when it’s in a certain state), you can use the setagentcurrentlayer VEX function or the Agent Layer Name, Agent Layers, and Set Agent Layer VOPs.
Tip
You can use a layer to display low-res proxy geometry. For example, you could create a low-poly character skin and set it up as a layer on the agent, then branch the crowd source network to an Agent Edit that sets the low-poly layer as the current layer for all agents. Then give that branch the display flag and the "real" branch the render flag.
Attaching parts using layers
Each layer is not really a different geometry, they are different sets of bindings between transforms on the rig and bits of geometry (shapes). This means you can create a layer that is based on a base layer, but adds a binding to attach, for example, a hammer or sword to the character’s hand.
-
In the crowd source geometry network, add an Agent Layer node.
-
In the Agent Layer’s parameters, turn on Source Layer to base the layer on an existing layer (the
default
layer). -
Click the Add button next to Layer bindings to add a binding.
-
Set the SOP path to the geometry node representing the part you want to attach.
-
Enter a Shape name for the part.
-
In the Transform name menu, choose the transform you want to attach the shape to.
-
Tip
A powerful way to create variation is to use a loop block to create multiple layers that attach different parts (for example, different hats).
Crowd source randomize
The crowd source node has a Randomize tab that lets you automate some variation in a single crowd source node. For example, instead of naming every agent in the group guy
, you can randomly assign each agent to be one of guy1
, guy2
, or guy3
using the Randomize controls (note that each of these names is a different character class that needs its own baked out set of animation clips).
Attributes
-
If the input points have agent related attributes on them, the attributes will be copied onto the new agent primitives. This is a very effective way for expert users to manually or randomly specifying different starting conditions, looks, and so on across agents.
-
You can use controls on the Crowd Source geometry node node’s Randomize tab to vary the scale of agents (setting
pscale
). The solver will take the scale into account and vary the agent’s gate speed appropriately. To slow down agents, try randomizing max speed. Set Allowed variance on the Crowd Solver DOP to 100% so agents can vary their speed (otherwise the solver limits how much agent speed can vary from the original gate speed, leading to foot slippage).
Material stylesheets
Material stylesheets let you modify material settings on agents at render time. This lets you, for example, randomize texture setting on agents to give them different looks.