Behavior

A CrowdBehavior can define a realistic human navigation, an avoidance strategy, an animation task, i.e. a set of animations to play, etc …. It also defines some parameters to specify how and when (i.e. thanks to a Trigger) those behaviors should be played.
 
The attributes of a Behavior are not keyable. Once a Behavior has been initialized, if attribute values are changed they will not be taken into account until the next reinitialization of the node (start frame of the manager).
 

Creation

By default, creating a Behavior will automatically create two linked Triggers.
 
A behavior with two automatically created triggers
 

Configuration

Behaviors may share different types of attributes.
 

Behavior Attributes

Behavior attributes of a behavior node
 
Behavior Resources

Behaviors can use resources which act like semaphores used for mutual exclusion. Thus, when a behavior is started it acquires resources. As long as this behavior does not stop, the resources are not released and no other behavior using at least one of the same resources can be started. It can be used to lock some specified body part (e.g. a left arm grasping motion acquires the left arm resource to avoid that any other motion requiring the arm is started). While the needed resource is not available, the behavior runs in a waiting mode until the resource is released. Thus if the behavior is looping, once started, resources are never released

Notice that, by default, no resources are set.

Trigger Attributes

Once the parameters of a behavior have been defined, it can be useful to specify when this behavior should be started and stopped. This can be done thanks to a mechanism of triggers. Two Triggers can be linked as Start/Stop trigger.
 
Trigger attributes of a behavior
 
Use  To select the relative trigger in Maya.
 
Triggers can be chosen amongst all triggers already present in the scene thanks to a combo box. It is also possible to use the default trigger (true for start trigger / false for stop trigger).
 
Thus a Behavior will not start until the starting trigger is true. When a Behavior is started, its stopping trigger is evaluated at each frame. If this latter value becomes true, the behavior stops.
 

Callback Attributes

This part describes the available Callback Attributes
 
Callback attributes of a behavior
 
On Start Callback MEL/Python script command called when the behavior is started
On Stop Callback

MEL/Python script command called when the behavior is stopped.

 
These attributes can contain a string representing the MEL/Python command to run on start or stop. Those callbacks may contain two special tags (#pid# and #ps#) to interact with particles (see the Technical Documentation).
 

Sequence Attributes

Notice that those following attributes are automatically set by the Behavior Editor when behaviors are added, deleted or modified.
 
Sequence attributes of a behavior
 
Parent Behavior The Behavior can be added to a Behavior Container, a Parallel Operator and a No Order Operator. This attribute allows selecting the parent of the current Behavior
Next Behavior

The current Behavior can be followed by one of the parent behavior's children. This attribute allows selecting the behavior following the current one.