Adding More Action Sources and Pose States

 
 
 

For pedestrian simulations, only three pose states are created by default, regardless of the number of action sources you have loaded; for stadium simulations, only one pose state created. However, you can load more action sources than are used by default and then create a corresponding pose state for each one.

When you add more than the default action sources, you need to rework the logic that is used in the Skeleton Simulation ICE tree for how the pose states are switched from one to another, which depends on your particular scene. In this example, more action states are being added to a stadium simulation so that the actors can have different poses based on the condition of them being inside a null or not:

The following is a basic outline of how to add more action sources and pose states:

  1. Load additional action sources as described in Loading Action Sources for an Actor.

  2. This adds another Get Data node for each action source in the Get Animation Sources ICE tree. The new action source is added to the actions that are loaded and set for the actor's cycles.

    In this example of a stadium simulation, three new action sources were added with IDs of 1, 2, and 3.

  3. Set the Pose State ID to include the new ID values you added in the previous step, based on whatever logic you create for using those action sources. The Pose State ID (CrowdFX_PoseState_ID) is an attribute set for the actors so that they know which animation (pose state) to use.

    You set the Pose State ID in the Set Locomotion or Set Stadium Animation compounds in the Skeleton Simulation ICE tree on the simulation point cloud, usually with the Set Pose State ID or Set Pose State ID From Speed compound (this one is only for locomotion simulations).

    When you reference the Pose State ID values, you need to decide on the logic and set up the conditions in which the new action sources are used.

    In this example, the IDs of 0, 1, 2, and 3 are all set with the Set Pose State ID node. The pose state that's used depends on whether or not the actors are within a null box that passes across the stadium. If they are, there's a 75% probability that their pose state will change to Pose State 3 and 25% that it will be Pose State 2. If they're not in the box, there's a 7% probability that their pose state will change to Pose State 1 and a 93% chance that it will be Pose State 0.

  4. Create a new Pose State compound for each new action source using the corresponding ID value.

    You also need to set the Transition Duration value for each pose state. This transition data is stored in an array in the Initialize Locomotion Data compound, so you need to get this data, which is done by default for the three pose states used for locomotion simulations.

    You can also set the Transition Duration value directly for each Pose State compound, as you need to do for stadium simulations.

    In a locomotion simulation, you also need to set the speed used for the pose state, if you're setting the pose state ID based on speed.

    In this example of a stadium simulation, a Pose State compound is used for each of the action sources that were loaded, with corresponding ID values as shown in the tree above. Each pose state's Transition Duration is set to a random value within a different range.