What is an expression? What can I create with expressions? In this After Effects tutorial we'll cover a few fantastic After Effects expressions that you may have never used before. Follow Report. Community guidelines. Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more. Jump to latest reply. Byron Cortez. In Response To Byron Cortez.
Thanks, Byron. That's a nice collection! Bookmark it, read it, read it again. Thanks, Martin. I only looked at the videos Roland Kahlenberg. In Response To Roland Kahlenberg. Hi Roland, Thanks for your feedback! Best, Rameez. Mathias Moehl. In Response To ZRo. After Effects Expressions Quicktips. In Response To Mathias Moehl. Thanks for sharing the link to your YouTube playlist. It's great! Thanks for sharing. I will take a look and include these in the main post.
Hi Angie, Absolutely! Thanks for adding the links. Appreciate it! I applaud you RameezKhan for you confidence in know-it-all. Please continue with your exubrence. PeterLund dir. With all the time I spend with After Effects, I am thankfull that so many people are helping us to understand expressions and scripting.
And maybe someone can post the old adobe university live tutorial for expressions and scripting. I miss this on the list. Peter www. Handle ohne zu tun; ohne Anstrengung arbeiten.
Stell dir das Kleine gross vor und das Wenige als Viel. Act without doing; work without effort. Think of the small as large and the few as many. Confront the difficult while it is still easy; accomplish the great task by a series of small acts. In Response To PeterLund dir. Thanks for sharing, Peter. The content team is actually working on revamping documentation for expressions.
Load more replies. Post Reply. Preview Exit Preview. You must be signed in to add attachments. Troubleshooting FAQs. Fix common After Effects crashes.
By default, the first value is used, unless you specify otherwise. For example, if you drag the pick whip from the Rotation property of Layer A to Scale property of Layer B, the following expression appears:. By default, this expression uses the first value of the Scale property, which is width. If you prefer to use the height value instead, drag the pick whip directly to the second value instead of the property name, or change the expression as follows:.
Conversely, if you drag the pick whip from the Scale property of Layer B to the Rotation property of Layer A, After Effects automatically creates a variable, assigns the one-dimensional Rotation property value to it, and then uses that variable for both dimensions of the Scale property:. In After Effects, many properties and methods take or return vectors.
After Effects refers to an array as a vector if it represents either a point or direction in space. For example, After Effects describes position as returning a vector. However, though a function like audioLevels does return a two-dimensional value the left and right channel levels , it is not called a vector because it does not represent a point or direction.
Some functions in After Effects accept vector arguments, but they are generally only useful when the values passed represent a direction. For example, cross vec1, vec2 computes a third vector that is at right angles to the input vectors.
The cross product is useful when vec1 and vec2 are two vectors representing directions in space, but not if they just represent two arbitrary collections of numbers. For example, the first layer in the Timeline panel is layer 1.
Generally, it is best to use the name of a layer, effect, or a mask instead of a number to avoid confusion and errors if the layer, effect, or mask is moved, or if the arguments are changed during product updates and upgrades. When you use a name, always enclose it in straight quotes. For example, the first of these expressions are easier to understand than the second expression, and the first expression continues to work even if you change the order of effects:.
Time within an expression is always in composition time not layer time and is measured in seconds - This is not the case with the sourceRectAtTime expression. The default time for any expression is the current composition time at which the expression is being evaluated.
The following expressions both use the default composition time and return the same values:. To use a relative time, add an incremental time value to the time argument. For example, to get the Position value 5 seconds before the current time, use the following expression:. Default time references to properties in nested compositions use the original default composition time, not remapped time. However, if you use the source function to retrieve a property, the remapped time is used.
For example, if the source of a layer in the containing composition is a nested composition, and in the containing composition you have remapped time, when you get the position values of a layer in the nested composition with the following expression, the position values use the default time of the composition:.
However, if you access layer 1 using the source function, the position values use the remapped time:. Because expressions operate on time in units of seconds not frames , you sometimes need to use time conversion methods to convert time values to perform operations on frames.
See Time conversion methods expression reference. Follow along with this example to learn how to use the After Effects expression language reference to write expressions. The expression created in this example links the Position property of Solid 2 to the Position property of Solid 1, with the movement of Solid 2 offset by 2 seconds from the movement of Solid 1.
Animate the Position property values for Solid 1 using keyframes. See About animation, keyframes, and expressions. The following expression appears by default:. The element thisComp is a global attribute whose value is a Comp object representing the current composition. To determine what can follow thisComp in your expression, look up the return value for thisComp under Global objects, attributes, and methods expression reference.
Note that thisComp returns a Comp object. Next, look at Comp attributes and methods expression reference to see which attributes and methods you can use with a Comp object. One option is layer index. The index, or number, inside the parentheses specify the layer that you want to use.
For this example, let's assume that Solid 1 is the first layer in your composition. To retrieve values from the first layer in the active composition, type. Again, look at the expression elements reference to see that layer index returns a Layer object. Look at Layer General attributes and methods expression reference , and find the element you want to use. The bounce happens in whatever direction the object is traveling.
Add keyframes to the Position property of the layer you want to animate. You can use the pick whip to link rotation values between layers to animate objects.
The way a clock works, consider these three circles as three hands of the clock - the hour hand moves from hour to hour, the minute hand rotates the full circumference of the clock face. The expression allows you to loop an animation without having to continuously add keyframes.
For example, multiple shapes spinning until the end of comp. Here you can set an initial keyframe for the start rotation and another for the end rotation. Then when you add the loopOut expression to the rotation parameter, the spinning will continue.
The variables on the expression below are for the type of loop, and how many keyframes to include in the loop. Cycle, Continue, Offset and Ping PongThis type of loop ends at the last keyframe, then starts again that the first keyframe in the selected range. The second variable is the number of keyframes to include. The loopOut is based on the last keyframe moving backward. By default, 0 accounts for all keyframes in the set from beginning to end.
Setting the variable to 1 includes 1 keyframe before the last one, 2 goes 2 keyframes back, and so on. When a layer is parented, the value shown in its Position property is not its "true" location in the Composition but are instead relative to its parent layer's location.
To find the parented layer's true location, an expression must be used to convert the parent layer's coordinate space to the Composition's coordinate space. Apply the following expression to the Position of an unparented layer to link it to the location of parented layer:. Delay and offset are a great way to make animation more dynamic and natural. You can create and control these types of offsets by parenting many layers to one parent layer and then applying an expression to the Position of each child to delay the motion inherited from the parent.
You can also drive the delay amount based on the index of the child layer relative to the parent layer. This allow you to easily reorder the animation of the child layers by reordering them in the Timeline below the parent or above if you want their animation to happen before the parent :.
This example expression instructs a layer to be at the same position as the next higher layer in the Timeline panel, but delayed by a specified amount of time in this case, 0. You can set similar expressions for the other geometric properties. Now that you have understood some of the concepts behind expressions, come to the community for some real-life examples, and to share your work.
You can also check out Dan Ebberts' excellent collection of example expressions and tutorials on his MotionScript website. Dan Ebberts provides example expressions and tutorials for learning how to work with expressions on his MotionScript website. For example, Dan provides an excellent page about collision detection. Rick Gerard provides an example on his website that demonstrates rolling a square object along a floor so that the sides stay in contact with the floor plane.
0コメント