Mar 08, 2025 9:15 PM
Jul 08, 2025 4:21 AM

Houdini Crowds Sink

· Houdini MOC · #note/sink

Gait and agent speed

Source

The gait speed controls how the clip is retimed based on the particle speed, but if Limit Particle Speed to Gait Speed Range is enabled it is also used to set speed limits on the agent's particle.

The 'steerforce' and 'steerweight' attributes accumulate a weighted average of different forces, which the POP Steer Solver (inside the crowd solver) uses to set the 'force' attribute

Agents from KineFX

CG Wiki Crowds

Agents are assumed to be skeleton based, the rest rides on top of that. So the workflow is

You might assume that once you've got a final kinefx bone deformed thing or packed character you'd just pipe that into an agent, but no, you essentially recreate it again but in an agent context.

Solaris import

SOP Crowd Import

Always pay attention to the agent definitions in case your crowd import is broken. There should be no duplicated agents (if it's not what you're actually after). Agent definitions can be disrupted very easily (by changes to the rig/shapes data), this will create unneeded agent definition duplicates and will invalidate the crowd import as a result.

Houdini doesn't seem to recook the source SOP crowd simulation automatically, at least not always. It's very important to have any crowd simulation recooked from scratch (within the SOP Crowd Import LOP cache time span) after any changes, because any fragment of the previously cached data will be interpreted as different agent definitions, which will create multiple agent definitions and will fail to import the crowd properly.

If the crowd simulation's time span starts later (or ends earlier) than the LOP crowd import time span (meaning no data is passed to the LOPs for some frames) it will also be interpreted wrong and will result in invalid crowd import.

If all above doesn't solve the agent definitions duplicates, you might try to replace agent definitions using python.

Replacing agent definitions

Source

Loop through each agentname, and re-apply the same agent definition in python using my agent source.

houdini_agent_definition_replace.png|450

VEX code to get definitions:
(my take, not sure of it)

//printf("prim=%g", @primnum);
string pan = prim(1, "agentname", 0);
//printf("def=%g\n", s@agentname);
//printf("agt=%g\n", pan);
if (s@agentname != pan) { 
    removeprim(0, @primnum, 1);
    //printf("%g deleted\n", @primnum);
} else {
    //printf("%g matched\n", @primnum); 
};

Python code to replace definitions:

node = hou.pwd()
input1 = node.inputs()[1]
ref_agent_geo = input1.geometry()
current_geo = node.geometry()

ref_agent_def = ref_agent_geo.prims()[0].definition()
ref_agent_def = ref_agent_def.freeze()
#print(ref_agent_def)

for agent in current_geo.prims():
    agent_def = agent.definition()
    new_def = agent.setDefinition(ref_agent_def)

CG Wiki on Crowds

Agent Primitives: Geometry
00:01 - Intro to shapes, deformers, and layers
06:56 - Demo of Agent Layer 2.0 and Crowd Assign Layers
23:02 - Deformers and rigid shape bindings
27:25 - Bounding boxes
30:59 - Vellum workflow

Crowds Quick Intro

Rapid Crowd Generation in Houdini 20 (+Agents in USD)
Attaching Props using layers and Solaris solution, Time Dependency Optimization, Motion paths (simulation-free) with triggers and avoids

A few notes on Houdini Crowd Simulations

KineFX Crowds
0:00:43 Intro
0:01:42 Motionclip basics
0:13:49 Blending Clips
0:22:29 Agent Promotion