Synchronized Motion

A Synchronized Motion Behavior (beSyncMotion) is exactly like a Motion Behavior, except that it will always plays the animation at a fixed position. This feature allows to synchronize an animation precisely with the environment. You can find one of the several use-cases described in the following tutorial.

The position/orientation of the animation at runtime is configured by moving/rotating the behavior node according to a pre-visualization of the animation.

Creation

  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBeSyncMotion Node
  • MEL command: glmCrowdBeSyncMotionCmd;

 
A Sync Motion Behavior allows to play an animation precisely synchronized with the environment (left: configuration previz, right: runtime)

Configuration

A Synchronized Motion Behavior defines the following specific attributes. For attributes that are shared with the Motion Behavior, see the a Motion Behavior documentation.

Configuration Attributes

Sync Objects

Transforms or curves of the scene with which the motion should be synchronized. For each mapped transform, the SyncMotion Behavior will display a preview of how will the animation be played (see the Display Configuration Attributes).

When curves are used, the behavior will use the nearest position between the curve and the entity to play the animation when it's triggered.

If several sync objects are set, the behavior will select the nearest to the entity to play the animation when it's triggered.

It is possible to synchronize on a Motion Behavior. See the dedicated part about that.

Dynamic objects

Allow SyncMotion to work with moving objects (consumes more CPU)

Even when the Dynamic checkbox is not checked, the position of the transforms or curves are evaluated when the behavior starts, so it is possible to put keyframes on them before the start time.

Sync Object Select

Selection mode for the sync object. Two modes are available:

  • Distance selection (default) : the behavior will choose the nearest object among the list of Sync Objects when the behavior starts
  • Per-Particle Attribute: Use the "Sync Object Select PP" attribute to get the name of the float per-particle field of the relative particle system, containing the index of the object to use in the Sync Objects list (index starts from 0)
Sync Object Select PP

Name of the float per-particle field of the relative particle system, containing the Sync Object index value which will be used (for more explanation about how to use ppAttributes, see ppAttributes Handling)
Object selection is set back to distance selection if the ppAttribute name is empty or invalid
Available only when the Sync Object Select Mode is set to "Per-Particle Attribute"

The value of the PP attributes are read when the behavior starts, so it is possible to change these values during the simulation.

Display Configuration Attributes

To be able to perfectly synchronize the animation with the environment, the SyncMotion Behavior displays a preview of how the animation will be played during the simulation. This preview can be correctly placed in the environment by moving/turning the SyncMotion Behavior node.

Enable Display Check this box to display the  preview of the animation on all the configured Sync Objects of the behavior.
Display Animation index When several animation clips are configured, this allow to choose the one to preview
Entity Type Select the entity type for which providing the display (the display will use the skeleton and color of the given entity type)
Display Scale Scale to apply on the EntityType for the display
Bone Radius

Bone radius of the displayed skeleton animation.

Display Type

Set the type of display for the animation.

One Frame shows only one given frame of the animation (see the Display Frame attribute).

All Frames shows all the frames of the animation.

Display Frame

Frame to display when the Display Type is set to One Frame

Decimate Frames Interval of frames to display when the Display Type is set to All Frames
Count on Curves Number of times to display the animation on curves (as every point on the curve is a potential position for the animation)

Advanced Attributes

Heading/Bank on curves Rotate the animation replay on the normal of the curve
Distance from pelvis If checked, the nearest SyncObject (transform or curve) will be computed from the pelvis. If unchecked, it will be computed from the particle's position
Synchronize 2d position If checked, the behavior will force the 2d position of the entity
Synchronize height If checked, the behavior will force the height of the entity (it might be useful to disable either this or the ground adaptation to get better results)
Synchronize orientation If checked, the behavior will force the orientation of the entity
Remove Animation Offset Check this option if the animation should be synchronized on the first animation frame's transform rather than the origin of the scene where the animation was created
Sync Duration Duration to reach the sync target transform. This parameter should not be confused with the Starting Duration.
The starting duration will define the duration to blend the sync motion with any other motion already running (ie. blend the posture), while the Sync Duration will define the duration to reach the synchronized root position/orientation.
Sync Duration Mode Evenly Spread on Time: will blend from the current transform to the target transform by the same corrective amount each frame
Evenly Spread on Translation: will try to smooth the blending to the sync transform by computing a different corrective amount of transformation each frame. Fast moving frames will handle more correction while slow moving frames will handle less correciton.

Other Attributes

For all other attributes, please refers to the documentation of the Motion Behavior.

Synchronizing on a Motion Behavior

When a Sync Motion is synchronized on a Motion from another entity, the entity running the Motion behavior will be considered the master and the one running the Sync Motion behavior will be considered the slave.

  • the time of the slave animation will be the same than the time of the master animation (which means that value set in the start percent won't have effect on the slave behavior). Beware that this might lead to odd animation if the master animation does not run when the slave animation does.
  • the transform of the slave animation will be computed relatively to the transform of the master animation (keeping the original offset between both animation but for the current transform of the master entity)

To configure a Sync Motion Behavior to sync on a Motion Behavior, just map the Motion Behavior to synchronize on in the Sync Object list, and it will automatically be recognized by Golaem.

Synchronizing on a Motion Behavior may be particularly useful when trying to synchronize entities with lots of interactions in their animation, like a rider and his horse, or two sword fighters.