Loading Action Sources for an Actor

 
 
 

When you select a model to use as an actor in CrowdFX, you must select and load the action sources that it will use in the crowd simulation. The action sources must be defined in the source model's Mixer > Sources > Animation node so that you can load them. These action sources can be locomotion moving in global space, locomotion "in place" (such as a walk cycle that is done in the model's local space), or stationary (such as waving, standing, or sitting).

To load action sources for an actor:

  1. Load a model to be an actor as described in Loading Actors for the Crowd Simulation.
  2. In the CrowdFX Actor Proxy Property Editor that appears, select the action sources that you want the actor to use from the Action Sources list and click the >> arrow to move them to the Selected Actions list.

    There is a maximum of three actions that are used in the crowd simulation by default, but you can add more later. If you use fewer than three actions, you'll need to adjust the pose states in the ICE tree - see Working with Action Sources for more information on these issues.

  3. Put the action sources in the Selected Actions list in top-down order, going from the slowest to fastest speed (for blending purposes).

    Use the Up and Down buttons to reorder them.

  4. Select or deselect the Use Center of Gravity option depending on the type of animation in the action sources you're loading - see Should You Use the COG or Not? below.
  5. Click the All Above button to load all sources in the Selected Actions list for the actor, or select specific ones and click the Selected button.

If the actor has a deformer rig that is identical to another actor in the crowd simulation, they can share their action sources - see Sharing Action Sources Among Actors.

For more information about action sources, see How Action Sources Are Used in the Crowd Simulation and Working with Action Sources.

The Actor's Center of Gravity (COG) Deformer

The actor's COG (center of gravity) is a deformer in the actor's rig whose horizontal speed (in the global Z direction) is used for calculating the actor's velocity for locomotion in the simulation.

When you import action sources for an actor, the COG in the actor's rig is automatically determined as the deformer whose Position X value is closest to zero and is closest to the center of the actor mesh's bounding box, such as the hip deformer. If this isn't the correct deformer for your rig, you can assign a different deformer as the COG as described in Modifying the Actor's Rig.

For the default pedestrian model shown below, the default COG is the hip deformer.

Should You Use the COG or Not?

In the CrowdFX Actor Proxy Property Editor, you can select or deselect the Use Center of Gravity option depending on the type of animation in the action sources you're loading.

  • Select the Use Center of Gravity option if the action sources contain locomotion animation that is done in global space in the Z direction, such as for a pedestrian simulation. The actor's velocity is computed based on the horizontal speed of its COG deformer.
  • Deselect the Use Center of Gravity option if:
    • The action sources are not locomotion types, such as sitting, standing, falling, or waving type animations. Deselecting this option prevents actors from moving in the Z direction when you want them to stay on the spot.
    • The action sources contain locomotion animation that was created in the source model's local space ("in place"). You then need to set the actor's horizontal speed as described in Working with "In Place" Locomotion Action Sources below.
    • You don't want to lose any details in your original animation if they're in global space. You then need to set the actor's horizontal speed value, as described below.

Loading Different Types of Actions Sources

If you're loading a mixture of animation types in several action sources, you need to load the animation in two passes. You can do this in two ways:

Method 1

  1. Load all the action sources into the Selected Actions list.

  2. Select only the action sources of one type, such as only the locomotion types that are moving in global space.

  3. Select or deselect the Use Center of Gravity option to match the type of animation you're loading.

  4. Click the Selected button below the list to load only the selected actions.

  5. After these are loaded, select the other types of action sources in the list, such as stationary and "in place" locomotion types.

  6. Toggle the Use Center of Gravity option and click the Selected button again to load these actions.

Method 2

  1. Load only one type of action source into the Selected Actions list.

  2. Select or deselect the Use Center of Gravity to match the type of animation you're loading.

  3. Click the All Above button to load all the action sources.

  4. Select those action sources and move them back to the Action Sources list (click the << button).

  5. Load the other type of action sources into the Selected Actions list, toggle the Use Center of Gravity option to match the type of animation, and click the All Above button.

If you import action sources using the incorrect Use Center of Gravity option, you can always re-import the action sources, and the existing animations in the ICE tree will update correctly.

Using "Animated In Place" Locomotion Action Sources

When you load action sources that are moving in the Z direction in global space, the velocity computation is handled for you by CrowdFX. However, it's common that action sources contain animation cycles that are animated in the actor's local space, and don't move in global space. You can still use these types of action sources, but there are a few steps you need to do to be able to use them in CrowdFX.

  1. Select the "in place" locomotion actions to load in the CrowdFX Actor Proxy Property Editor.

  2. Deselect the Use Center of Gravity option, then load the action sources.

  3. In the simulation point cloud's Emit ICE tree, plug the Set Horizontal Speed compound into the On Init port in the Initialize Locomotion Data compound.

  4. In the Set Horizontal Speed compound, set the Cycle value for the corresponding action source that you have loaded. The Cycle numbers match the order of the actions in the simulation point cloud's Get Animation Sources ICE tree (see How Action Sources Are Used in the Crowd Simulation ).

    The Cycle value is the number of Softimage units that the actor moves per second in the simulation, and needs to correspond to the cycle speed of the animation in the original action source. For example, if this value is too high, the actor's feet will slide in the simulation.

    To help figure out the appropriate cycle speed, you can use the Get Actor Pose compound as described in Testing the Animation in an Action Source.