Working with Behaviors

This section describes how to enable, rename, lock, duplicate, move, and reorganize behaviors in your project. These procedures apply to every type of behavior.

Behaviors Controls in the Layers List and Timeline

When you apply a behavior to an object, the behavior appears in three places—the Layers list, the Timeline, and the Behaviors Inspector.

Although the Behaviors Inspector contains all editable parameters for a behavior that’s been applied to an object, the Layers list and Timeline have several controls for each behavior:

  • Activation checkbox: Turns each behavior on or off. Behaviors that are turned off have no effect on the object to which they’re applied.
  • Name: Double-click this field to rename the behavior.
  • Lock: Click the lock icon to lock or unlock a behavior. You cannot modify the parameters of a locked behavior.
    Figure. Layers tab showing Behaviors applied to an object, with their own activation and lock controls as well as the enable/disable Behaviors icon.
  • Enable/disable behaviors: A behavior icon (a gear) appears to the right of the name of objects with applied behaviors. Clicking this icon turns all behaviors applied to the object on and off.
    Figue. Layers tab showing the Behaviors icon disabled state.

    Note: Control-clicking the behavior icon (the gear) opens a shortcut menu that displays behaviors applied to that object. Choose a behavior from this menu to display it in the Inspector.

  • Show/Hide Behaviors button: Located at the bottom of the Layers list and Timeline, this button lets you show or hide all behaviors. This button neither enables nor disables behaviors applied to objects in your project; it only controls their visibility.
    Figure. Show/Hide Behaviors button in the Layers tab.

Copying, Pasting, and Moving Behaviors

After you have added behaviors to an object, there are a number of ways you can copy and move them among the other items in the Timeline or Layers list.

Behaviors can be cut, copied, and pasted like any other item in Motion. When you cut or copy a behavior in the Timeline or Layers list, you also copy the current states of that behavior’s parameters.

To cut or copy a behavior
  1. Select a behavior.

  2. Do one of the following:

    • Choose Edit > Cut (or press Command-X) to remove the behavior and place it on the Clipboard.

    • Choose Edit > Copy (or press Command-C) to leave the behavior there and copy it to the Clipboard.

To paste a behavior
  1. Select an object.

  2. Choose Edit > Paste (or press Command-V).

    The cut or copied behavior is applied to the selected object, with all its parameter settings intact.

You can also move a behavior from one object to another in the Layers list or Timeline by dragging it to a new position.

To transfer a behavior from one object to another
  • In the Layers list or Timeline, drag a behavior from one object and drop it on top of another.

Note: If you move a Parameter behavior to another object, it is applied to the same parameter it affected in the previous object—as long as the corresponding parameter exists. If the parameter does not exist, the parameter assignment (Apply To field) is set to none.

Figure. Layers tab showing a behavior being dragged from one object to another.

You can also duplicate a behavior in place.

To duplicate a behavior
  1. Select the behavior to duplicate.

  2. Do one of the following:

    • Choose Edit > Duplicate (or press Command-D).

    • Control-click the behavior to duplicate, then choose Duplicate from the shortcut menu.

You can also duplicate a behavior and apply the duplicate to another object in the Layers list or Timeline.

To drag a duplicate of a behavior to another object
  • Option-drag the behavior to the object to apply the duplicated behavior to.

    The duplicated behavior is applied to the second object, and the original behavior is left in its original location.

When you duplicate an object, you also duplicate all behaviors applied to it. This way, if you’re creating a project with a number of objects that use the same behavior, you can apply that behavior to the first instance of that object, and then duplicate that object as many times as necessary.

Applying Multiple Behaviors to an Object

There is no limit to the number of behaviors you can add to an object. When multiple behaviors are applied to a single object, they all work together to create a final animated effect.

In general, each behavior applies a value to a specific parameter. The values generated by all behaviors that affect the same parameters are combined to create the end result. For example, if you apply the Throw, Spin, and Gravity behaviors to a single object, the Throw and Gravity behaviors combine to affect the position of the object. The Spin behavior affects the rotation of the object.

Behavior Order of Operations

When combining different behavior types (such as Parameter and Simulation behaviors), or combining behaviors and keyframes, it is important to understand the behaviors’ order of operations. Motion evaluates behaviors and keyframes in the following order:

Keyframes > Simulation behaviors > All other behaviors

Parameter behaviors are applied in the order in which they are added, from the bottom of the Layers list up (like the order of filters and compositing order). For more information, see Reordering Behaviors.

Important: The order of operation is always in effect—regardless of the order in which the behaviors are applied or the keyframes are added to a layer or group.

Use the following guidelines for animating layers with multiple behaviors and/or keyframes:

  • When you animate a layer with keyframes and then apply a behavior, the effect of the keyframes is evaluated first.

    For example, if you animate the Rotation parameter of a layer using keyframes and then apply a Rotational Drag (Simulation) behavior to the layer, the Rotational Drag behavior slows the rotation of the layer. Motion is evaluating the keyframed rotation, and then applying the drag (from the Simulation behavior) to the keyframed animation.

  • When you animate a layer with any behavior, and then add keyframes, the effect of the keyframes is evaluated first.

    For example, if you animate a layer so it rotates in a clockwise direction using the Spin behavior and then keyframe the Rotation parameter so the layer rotates in a counterclockwise direction, the layer rotates in the counterclockwise direction. Although the keyframes are added to the project after the Spin behavior, Motion evaluates the keyframes first.

  • When you animate a layer with a Simulation behavior and then apply another behavior, the effect of the Simulation behavior is evaluated first.

    For example, if you animate a layer using the Gravity (Simulation) behavior and then apply a Throw (Basic Motion) behavior, the layer moves downward as specified by the Gravity behavior and in the direction specified in the Throw behavior. Motion is applying the value of the Throw behavior to the value of the Gravity behavior, creating the end result.

  • When you animate a layer with a behavior and then apply a Simulation behavior, the Simulation behavior is evaluated before the first behavior (and might have no effect).

    For example, if you animate the Rotation parameter of a layer using the Oscillate (Parameter) behavior and then apply a Rotational Drag (Simulation) behavior to the layer, the layer oscillates, but is not slowed by the Rotational Drag behavior. Motion is evaluating the Simulation behavior (Rotational Drag) before the Parameter behavior (Oscillate), applying the drag to a 0 value. There is no data for the Simulation behavior to affect.

    Note: Although the Spin behavior appears in the Basic Motion category, Spin is treated as a Simulation behavior in Motion’s order of operations.

For information on combining keyframes with behaviors, see Combining Behaviors with Keyframes.

Reordering Behaviors

When you apply multiple behaviors to a single object, the behaviors appear nested beneath that object in the Timeline and Layers list. All behaviors combine according to a predetermined order of operations regardless of their order in the Layers list, so reordering them has no effect on the resulting animations that are created, with a few exceptions:

  • The Stop behavior suspends the activity of all behaviors beneath it that affect the same parameter. The Stop behavior has no effect on behaviors above it in the Layers list.

  • Parameter behaviors are applied in the order that they are added, from the bottom to the top in the Layers list, so you need to think about how you are building the operation. For example, imagine a circle shape with an X Position of 50 in the Canvas. If you apply a Rate Parameter behavior with a positive Rate value to the X Position of the circle, the circle will move to the right from its starting X Position of 50. If you then apply a Negate Parameter behavior to the circle’s X Position, the circle will start at –50 in the Canvas and move to the left. The effect you see in the Canvas is the result of each behavior acting upon the previously applied behavior: an X Position value of 50 is modified by the Rate behavior (in a positive direction), which is in turn modified by the Negate behavior, changing the X Position and rate to negative values.

    If you swap the order of Rate and Negate in the Layers list, Negate is processed first. The circle’s X Position value of 50 is turned into –50. This is then passed as the input to Rate, which moves the circle in a positive direction. Now the circle begins at the –50 X Position in the Canvas, and moves to the right.

To reorder a behavior
  1. Drag the behavior up or down in the list of nested behaviors applied to the same object.

    A position indicator shows where the behavior appears when you release the mouse button.

    Figure. Layers tab showing behaviors being reordered.
  2. When the position indicator is in the correct position, release the mouse button.

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