Houdini 17.5 Crowd simulations

Attaching cloth to agents

You can add and constrain vellum cloth as part of agent shape geometry, and then simulate the cloth based on agent movements.

On this page

Overview

Vellum is Houdini’s fast cloth (and other PBD) solver. You can associate cloth with agent shapes and then simulate the cloth as part of the overall dynamics simulation along with the crowd and any other dynamics such as rigid bodies.

Because you can set up Vellum cloth in geometry using SOPs, it’s ideal for inclusion in an agent shape.

See the SimpleCrowdCloth node example for a fully worked example attaching capes to agents and simulating them.

Set up the cloth

In the SOP network where you set up your agent definition(s), you will add vellum cloth on top of the imported agent geometry, and then use that as the agent shape geometry.

  1. Alongside the agent definition SOPs, create a new SOP chain that creates the cloth geometry.

    You can import the cloth geometry or define it here. In the cape example, the cloth is a simple grid.

  2. Append a Vellum Constraints node to the cloth geometry. Set the Constraint type to "Cloth". This sets up attributes on the geometry for the Vellum solver to treat it as cloth.

  3. Connect the agent shape’s rest geometry to the Vellum Constraints node’s third input.

  4. Append another Vellum Constraints node and set the Constraint type to "Attach to Geometry".

    Instead of attaching specific points, you can simply specify a group on the cloth geometry and turn on Constrain to closest point.

  5. Append a Vellum Pack node to pack up the cloth geometry.

  6. Append a Null at the end of the chain, and give it a recongnizable name (for example, CAPE1_OUTPUT). We will use this node when we import the cape into an agent shape.

    (It’s usually a good idea to put a Null node at the end of SOP chains you will be importing from, so you can insert nodes above it and not have to change any references to the final node in the chain.)

Tip

You can add a Vellum Solver SOP at the end of the vellum setup chain to do a quick sim of the cloth, for example to check how it hangs on the character. This is faster than running the full crowd + cloth simulation.

Add the cloth to an agent

  1. In the SOP chain where you define the agent, above the AGENT_DEFINITION Null, add an Agent Layer node.

    A layer creates a way of varying a character.

  2. Set the Layer name to a name describing this skin variant, for example skin_with_short_cape.

  3. Add a __Layer binding___.

  4. In the new layer instance:

    • Set the Transform name to the named transform the new shape should be relative to (this is usually the character skin).

    • Tturn on Add shape.

    • In the SOP path field, enter the path to the cloth geometry for this variant.

    • In the Shape name field, enter a descriptive name for this shape (the cloth), such as short_cape.

  5. Repeat for each cloth shape layer you want to add to the agent definition.

Tip

When you populate the crowd, remember to seed the crowd with the variants you've created.

Simulate the cloth

  1. In a SOP network, grab the output of the Crowd Solver DOP.

    For example, you can use a DOP Import SOP, point it to the Crowd Object inside the DOP network, and set Import style to "Fetch Geometry from DOP Network".

  2. Append an Agent Vellum Unpack node to extract the vellum geometry.

  3. Append a Vellum Solver SOP to simulate the vellum geometry.

Tip

The output of the Vellum Solver SOP is only the simulated cloth geometry. You need to take that geometry and merge it with the crowd output somehow (for example, merge the geometry, or render them seperately and composite them together).

(You can extract just the character skin layer from the simulation output using an Agent Edit SOP. Turn on Set current layer and set it to the default skin layer.)

Crowd simulations

Getting started

  • Basics

    An overview of Houdini crowd simulation concepts.

  • Setup

    How to set up and edit a crowd simulation.

The moving parts

  • Agents

    About agents, the moving "actors" that make up a crowd simulation.

  • States

    About agent states, the virtual "mood" of each agent which controls the agent’s animation and which behaviors it runs.

  • Triggers

    How to specify conditions that cause agents to change from one state to another.

  • Caches

    Tips for efficiently caching and loading crowd sims.

Behavior

Appearance

  • Diversity

    How to create a more realistic crowd by making agents look and act differently.

  • Attaching cloth

    You can add and constrain vellum cloth as part of agent shape geometry, and then simulate the cloth based on agent movements.

Terrain

  • Foot planting

    How to set up agents to adapt their animation to terrain and prevent skating.

  • Terrain

    How to specify terrain geometry for agents to walk across.

  • Obstacles

    How to set up obstacles for agents to avoid.