Motion Math scripts included with the Production Bundle (PB only)Several prewritten scripts, along with sample movies, are available from the After Effects CD. Each script creates keyframes for specified properties and channels in one of two layers, depending on the motion or effect you want. Most of the prewritten scripts create new keyframes automatically, but you can use some scripts to change the values of existing keyframes. By changing the scale factors or variable numerical values in the scripts, you can achieve the effect you want. As you experiment with the prewritten scripts, you will learn more about the Motion Math scripting language, and you will gain the confidence to create and save your own scripts. Scripts are named using a .mm extension. The After Effects CD provides the following prewritten scripts and movies: Apply from Effect Point (frmeffct.mm and frmeffct.mov) Copies the values of an effect point from one layer, multiplies them by a scale factor, and then creates position keyframes in a second layer using the new values. Apply to Effect Point (toeffect.mm and toeffect.mov) Copies the horizontal or vertical (or both) position values of one layer, multiplies them by a scale factor, and then creates specified effect keyframes in a second layer using the new values. Blink (blink.mm and blink.mov) Varies the opacity using the cosine function, cycling through a specified range of opacity percentages, and then creates keyframes for the specified layer's opacity. Comp Audio (cmpaud.mm and cmpaud.mov) Copies the values of the audio amplitude of the combined audio for all layers in a composition, multiplies them by a specified scale factor, and then creates keyframes for the specified property using the new values. Copy Relative Values (parallax.mm and parallax.mov) Multiplies relative values of a property in one layer by a scale factor and then copies them to a second layer. Copy Values (copyvalu.mm and copuvalu.mov) Copies specified property values from one layer, multiplies them by a scale factor, and then applies the new values to a second layer. This script appears by default when you first open the Motion Math window. Double Spring (dbspring.mm and dbspring.mov) Simulates the motion of two objects attached to the ends of a spring and creates position keyframes for both layers. If you have created position keyframes for either layer before the start of the work area, the velocity of each layer at the start of the work area is included with the motion of the layer. Gravity (gravity.mm and gravity.mov) Applies both a gravitational and a frictional force to a specified layer. Layer Audio (layeraud.mm and layeraud.mov) Copies the values of the audio amplitude of a single layer, multiplies them by a specified scale factor, and then creates keyframes for the specified property using the new values. Point At (pointat.mm and pointat.mov) Creates rotation keyframes for one layer, keeping the top of its y-axis pointing at the anchor point of the other layer. Both layers can be moving. Relative Corner to Absolute Corner (cornpin.mm and cornpin.mov) Bases the motion path of the layer on the position of the corner-pin keyframes instead of on the anchor point. In other words, this script makes the motion paths of the corner pins relative to the composition. Scale All Layers (scaleall.mm and scaleall.mov) Scales both the size and position of all selected layers. Use this script to resize all layers in a composition by the same amount. Scale Layers by Comp Size (scaleby.mm and scaleby.mov) Scales layers in a composition to new sizes and positions based on new composition dimensions. Use this script to resize layers proportionally after changing the dimensions of a composition. Span (span.mm and span.mov) Attaches each end of a third layer to the anchor point of the two moving layers, creating position, rotation, and scale keyframes for the third layer, as necessary. Spring (spring.mm and spring.mov) Simulates the motion of one object dragging another with a spring attached between them. This script creates position keyframes for only one of the two layers. |