Changing the Timing of Behaviors

You can change a behavior’s timing to control when it starts, how long it lasts, and when it stops. There are several ways to do this. You can use the Stop Parameter behavior to suspend one or more behavior’s effects on a single parameter. You can also trim each behavior in the Timeline. Finally, for some behaviors, you can change the Start Offset parameter to delay their beginning, and you can change the End Offset to stop the behaviors prior to the end of their object duration in the Timeline. These behaviors include Fade In/Fade Out, Grow/Shrink, and Snap Alignment to Motion.

Using the Stop Behavior

The easiest way to control behavior timing is to use the Stop behavior (in the Parameter category). The Stop behavior halts the animation occurring in any one parameter, whether the animation is based on keyframes in the Keyframe Editor or behaviors that have been applied to that object.

As explained in Applying Parameter Behaviors, all Parameter behaviors can be applied directly to a parameter of an object (such as opacity or position) or directly to an object (such as text or an image). If the behavior is applied directly to an object, a parameter must be explicitly assigned to the behavior (in the Behaviors tab of the Inspector).

To stop a parameter from animating
  1. Move the playhead to the frame where you want animation to stop.

  2. Select the affected object, then open the Properties tab in the Inspector.

  3. Control-click the parameter you want to stop, then choose Stop from the shortcut menu.

    The parameter is animated until the frame at which the Stop behavior begins.

    Note: When applied in this manner, the Stop behavior takes effect at the current frame (regardless of the Create Layers At Preference setting).

  4. To assign the Stop behavior to a different parameter, choose a new parameter from the Apply To (Go) pop-up menu.

The Stop behavior halts the animation of all behaviors that affect the selected parameter of that object. For example, if the Gravity, Edge Collision, and Rotate behaviors are applied to a shape and you apply the Stop parameter to the shape layer’s Position parameter, the shape stops moving but continues rotating.

To control when animation affecting that parameter is stopped, trim the Stop behavior in the Timeline. For more information on trimming behaviors, see the next section on Trimming Behaviors.

For more information about applying Parameter behaviors, see Applying Parameter Behaviors.

Trimming Behaviors

When you apply a behavior to an object, the duration of the behavior in the Timeline defaults to the duration of the object to which it’s applied.

Figure. Timeline tab showing a behavior bar at its default duration: matching that of the object to which it is applied.

A behavior can be modified to limit the duration of its effect. For example, if you apply the Spin behavior to a replicator layer, by default that replicator spins around for its entire duration. If you trim the Out point of the Spin behavior, the spinning stops at the new position of the Out point.

Figure. Behavior being trimmed in the Timeline.
To change the duration of a behavior in the Timeline
  1. Move the pointer to the In or Out point of any behavior in the Timeline.

  2. When the pointer changes to the trim pointer, do one of the following:

    • Drag the In point to delay the beginning of the behavior’s effect.

    • Drag the Out point to end the behavior’s effect prior to the end of the object.

      Note: When you drag the In or Out point of a behavior, a tooltip appears and displays the new location and duration of the In or Out point.

Trimming the Out point of a behavior often sets the object to its original state beyond the Out point behavior. For many behaviors, using the Stop behavior to pause the object’s animation is a more efficient method than trimming its Out point. Another way to stop a behavior’s effect and leave the affected object in the transformed state is to adjust a behavior’s Start and End Offset parameters. See Changing the Offset of Parameter Behaviors for more information.

Note: The Simulation behaviors do not leave the object at the transformed state after the last frame of the trimmed behavior. For more information, see Controlling Simulation Behaviors.

Controlling Simulation Behaviors

Keep in mind that the ideal use for behaviors (with the exception of the Motion Tracking behaviors) is creating fluid motion graphics that do not require specific timing. This is especially true with the Simulation behavior group, which allows you to create some very sophisticated interactions among multiple objects in your project with minimal editing.

Unlike Basic Motion behaviors, you cannot stop or change the motion of a Simulation behavior in the Timeline. However, you can affect the rate of a Simulation behavior by modifying its duration in the Timeline. You can also change the starting frame of the behavior.

But because the Simulation behaviors simulate natural effects, such as Gravity, the laws of inertia apply—an external force set the object in motion, and that object stays in motion even once the active force is no longer present. Changing the duration of a Timeline bar for a Simulation behavior does stop the “active” force on the object, but does not stop the motion of the object. You can, of course, control Simulation behaviors by modifying their parameters.

In the following image, the Orbit Around (Simulation) behavior is applied to the large circle. The center text is assigned as the object that the circle moves around. The red animation path represents the motion the circle travels over its duration. The Orbit Around behavior is the same duration (300 frames) as the large circle to which it is applied.

Figure. Canvas and Timeline showing how behavior duration affects length of behavior bar.

In the next image, the Orbit Around behavior is trimmed in the Timeline to a shorter duration (190 frames) than the object to which it is applied. Notice the change in the shape of the animation path: At frame 190, where the Orbit Around behavior ends, the object (the circle shape) stops moving around its target and continues moving off the Canvas. The Orbit Around behavior—the active force—is no longer present, but the motion of the circle does not stop.

Figure. Canvas and Timeline showing how behavior duration affects length of behavior bar.

Moving Behaviors in Time

In addition to changing a behavior’s duration, you can also move its position in the Timeline relative to the object under which it’s nested. This lets you set the frame at which that behavior begins to take effect.

To move a behavior in the Timeline
  1. Click anywhere within the middle of a behavior’s bar in the Timeline.

  2. Drag the behavior to the left or right to move it to another position in the Timeline.

    As you move the bar, a tooltip appears and displays the new In and Out points for the behavior. The tooltip also displays the delta value, which shows the number of frames you have moved the bar.

    Figure. Timeline showing a behavior moved to a new time.

Changing the Offset of Parameter Behaviors

Certain Parameter behaviors have two additional parameters, Start Offset and End Offset, which are used to change the frame where a parameter behavior’s effect begins and ends.

The Start Offset parameter has a slider that lets you delay the beginning of the behavior’s effect, relative to the first frame of its position in the Timeline. You can adjust this parameter to make the Parameter behavior start later.

The End Offset parameter lets you offset the end of the behavior’s effect relative to the last frame of its position in the Timeline. Using this slider to stop the effect, instead of trimming the end of the behavior in the Timeline, lets you freeze the behavior’s effect on the object for its remaining duration.

The following example illustrates how to use the Start Offset and End Offset parameters with the Ramp behavior.

To use the Start Offset and End Offset parameters
  1. Select an object, such as a shape.

  2. In the Properties tab of the Inspector, Control-click the Scale parameter, then choose Ramp from the shortcut menu.

    The Ramp behavior is applied to the Scale parameter of the object, and the Behaviors tab is displayed. The Ramp behavior lets you create a gradual transition in any animateable parameter.

  3. Set the Start Value to 0 and the End Value to 200, then play the project.

    The object scales from its original scale to twice its original size over the duration of the object.

  4. Set the Start Offset to 90 and the End Offset to 90.

    The object does not begin scaling until frame 90, and stops scaling 90 frames from its last frame in the Timeline.

Combining Behaviors with Keyframes

Any object can have both behaviors and keyframes applied to it simultaneously. When this happens, the values generated by the behavior and the keyframed values that are applied to the parameter itself are combined to yield the final value for that parameter. This lets you combine the automatic convenience of behaviors with the direct control of keyframing to achieve your final result.

Note: Motion has a specific order of operations for keyframes and behaviors. For more information, see Behavior Order of Operations.

For example, if you apply the Random Motion behavior to a shape, that shape might weave around onscreen with a completely random animation path similar to the following:

Figure. Canvas window showing an animation path generated by a behavior.

If you turn the Random Motion behavior off temporarily and create an animation path using keyframes, you can create a completely predictable and smooth movement.

Figure. Canvas window showing an animation path generated by keyframes.

You can combine the two by turning the Random Motion behavior back on, with the end result being an animation path that follows the general direction you want, but that has enough random variation in it to make it interesting.

Figure. Canvas window showing an animation path generated by the combination of keyframes and a behavior.

While this example shows how you can combine behaviors and keyframes to create animation paths, you can combine behaviors and keyframes for any parameter.

Combining Behaviors and Keyframes in the Keyframe Editor

When you display a parameter that’s affected by a behavior in the Keyframe Editor, two curves appear for that parameter. An uneditable curve in the background displays the parameter as it is affected by the behavior. There are no keyframes over this first curve. Superimposed over the curve displaying the behavior’s effect is the parameter’s editable curve.

Figure. Keyframe Editor showing an editable curve and a behavior effect curve.

You can keyframe a parameter either before or after applying a behavior to the object that affects it. When you keyframe a parameter that is already affected by a behavior, the value of the keyframed curve is combined with the value generated by the behavior at each frame, which either raises or lowers the resulting value displayed by the background curve. The background curve doesn’t just display the behavior’s animated values, it displays the sum of all values affecting that parameter.

Figure. Keyframe Editor showing a behavior curve affected by keyframes applied to the same parameter.

Raising or lowering a keyframe in the Keyframe Editor also raises or lowers the background curve, because the keyframe is modifying the values generated by the behavior.

Important: The value displayed in the Inspector for the affected parameter reflects the final combined result of both keyframes and behaviors that are applied to that parameter. Editing a parameter’s values directly in the Inspector only results in changes made to the underlying parameter value, whether keyframed or not. This parameter value is then combined with the behavior’s effect, yielding a final value that may differ from the value you entered.

Figure. Keyframe editor showing how keyframing can affect a behavior effect curve.

For more information on how to use keyframes in the Keyframe Editor, see Keyframes and Curves.

Important: When you combine keyframes with multiple behaviors, the results can appear to be unpredictable, depending on the combination of behaviors that are applied.

You can convert the behaviors that are applied to all parameters of an object into keyframes. Converting behaviors that have already been combined with keyframes turns the sum of all behaviors and keyframes affecting that parameter into a thinned series of keyframes (a curve with fewer keyframes). This results in a final animation curve that closely replicates the shape of the background curve that appeared in the Keyframe Editor. These keyframes can then be edited directly in the Keyframe Editor.

Figure. Keyframe Editor showing a parameter with combined keyframes and behavior being converted to keyframes.

For more information on converting behaviors into keyframes, see Converting Behaviors to Keyframes.