decorative banner

Specifying layers and properties (PB only)


    To specify a layer in a script, type its name as it appears in the Timeline window. If the name contains a space, you must enclose the name in quotes. For example, the layer name Red Boat must be specified as "Red Boat" in the script.

    For functions that require a property, you can specify, by name, any of the following default properties: mask feather, anchor point, position, scale, rotation, and opacity. When specifying properties with two words, such as anchor point, enclose them in quotes, as shown in the following example:

    value (circle, "anchor point") = value (square, "anchor point") * 1.5;

    To specify effect properties, use either the pop_property function or the effect_value function. The pop_property function obtains the value of the property currently selected in the specified Property menu. After you select a layer and load a script into Motion Math, both Property menus list all properties for all effects in the selected layer. For more information on using the pop_property function, see Using the Layer, Property, and Channel menus (PB only).

    The effect_value function obtains a value for an effect property or creates a keyframe for an effect property, depending on which side of an assignment it is used. The effect_value function uses the following format:

    effect_value (layer, effect index, property index)

    The effect index and the property index are numbers that specify a property in the Effect Controls window. The effect_index starts numbering at 0, and the property index starts numbering at 1. To specify a property in the Effect Controls window, use the effect index and the property index together to identify the order of the property in the window. In the following example, the Effect Controls window shows three effects for the layer Solid1.

    To specify the Blurriness property for the Fast Blur effect, for example, specify the following values in the effect_value function:

    effect_value (Solid1, 1, 0)

    Starting at the top of the Effect Controls window, the Fast Blur effect is the second effect listed, and Blurriness is the first (and only) property. Note that because effect_index starts numbering at 0, the second effect is identified by 1.

    When the effect_value function is used on the right side of an assignment, it obtains the value from the specified property. You can obtain values only from properties with numerical values.

    When the effect_value function is used on the left side of an assignment, it creates a keyframe for the specified property. You can assign values only to numerical properties, such as point controls, angles, and properties controlled by slider bars in the Effect Controls window.

    When you specify a property by indexing, all properties are counted, regardless of their value types or controls.