Expression Time After Effects
I'll start with my expression for the delay. I went with a 'daisy-chain' expression in which the layer references other layers in respect to itself (index). The leader object contains the motion and no expression controls. All layers below use this expression: thisComp.layer(index-1).transform.position.valueAtTime(time-delay).
- Expression Time After Effects Program
- After Effects Timer
- Expression Time After Effects Book
- Expression Time After Effects Download
- Countdown Script For After Effects
- Expression Time After Effects Model
The After Effects time expression is a great way to add movement without setting keyframes. Here’s how it’s done.
- The LottieFiles plugin converts your After Effects animation into a Lottie format file for use on the web and mobile. The plugin provides a smooth workflow for rapidly iterating on animations and testing feature support across different platforms.
- 50 After Effects Tips and Expressions. A free PDF containing 50 of our most helpful tips, keyboard shortcuts and expressions for Adobe After Effects. A must have for motion graphics designers! Animating in After Effects is incredibly straightforward, but to make things even easier you’ll want to keep these tips and shortcuts handy!
If you’re new to expressions in After Effects, one of the most helpful and easy to use expressions available is the time expression. Essentially, the time expression returns a number value related to your current position in the timeline. For example, if you were at three seconds, the time expression would return a value of three.
How to Use the Time Expression
The time expression can be thought of as a variable in itself. Like we said before, it will return a value related to position of your playhead in seconds. For most motion graphic circumstances, you will likely want to multiply the time expression so that it returns a larger value. In that case, we will have to tell After Effects to do some basic math.
In order to use the After Effects time expression, select the property in which you want the time value to affect and option click on the corresponding stopwatch. For example, if you wanted to set the expression to affect the position, simply click the stopwatch to the left of the position text.
Next, you will need to add in the time expression into your expression. You can simply replace the default text in your expression with the word time or you can have it interact with the time expression by using basic math icons like (+,-,/, & *).
Position
To link your position to the current time, simply option click on the stopwatch next to corresponding position property. In the example above, we separated the x and y position so we could apply the time expression to just the X position. Once you hit the stopwatch, you can simply type in time* any value.
Rotation
To link time and rotation together, simply click on the stopwatch next to rotation and replace the current expression with time*any value. In the example above, we have a five second loop. So, using some simple math, we figured out that we would need to multiply the time by 72 to create a perfect loop.
Exponential Values
You can also multiply time by itself so that it will increase exponentially. Simply option click on the stopwatch next the the property you want to effect and type in time*time. In the example above we multiplied time to the power of four.
Text Values
You can also link the value of text to be that of the current time. Simply option click on the stopwatch and add in the time expression. By default, the numbers will include numbers beyond the decimal point, so it is recommended that you use the Math.round() function to round up to the nearest whole number.
Want to learn more about working with expressions in After Effects? Check out a few of the following articles:
Have any other tips for using the time expression in After Effects? Share in the comments below.
Sign In
Register
- Access to orders in your account history
- Ability to add projects to a Favorites list
- Fast checkout with saved credit cards
- Personalized order invoices
Create Account
Text layers have gained a massive upgrade in After Effects 17.0. You can now use expressions to control text styling as well as the text itself. This feature enables you to keep font, size, and styling in sync across multiple text layers in After Effects and Motion Graphics templates.
Bear in mind that this is a new feature and will only work in After Effects 17.0 or above. MoGRTS containing text-style expressions will only be compatible with Premiere Pro 14.0 and higher.
Expression Time After Effects Program
In this blog post, we’ll cover three ways to use text forwarding expressions:
- Forward Source Text only
- Forward style only
- Forward Source Text and style
JavaScript Engine
To start, double-check that the JavaScript Expressions Engine is enabled. Go to File -> Project Settings… and click on the Expressions tab. Change the Expressions Engine from Legacy ExtendScript to JavaScript.
Forward Source Text only
This method has been available in After Effects for a long time, and many enterprising creators use it in their MoGRTS.
Create two text layers. For our example, we’ll name our layers “Parent” and “Child.” Pickwhip the Source Text of the second layer and drag it to the Source Text of the first layer. Voila! The second text layer now copies the Source Text of the first text layer.
You can copy and paste the expression from here:
thisComp.layer(“Parent”).text.sourceText
Forward text style only
We’ll continue where we left off in the previous example. In the Expressions Editor, simply add “.style” to the end of the expression. The second text layer now copies the text properties (style) of the first text layer. However, the Source Text remains separate.
You can copy and paste the expression from here:
thisComp.layer(“Parent”).text.sourceText.style
Forward Source Text & style
This one’s going to be more challenging, and we’ll have to combine our previous examples to accomplish it.
In the Expressions Editor, we’ll create two variables with custom names. Coding best practice is to give meaningful, self-explanatory names when creating custom variables. So we’ll create one variable named “parentText” to get the Source Text, and one variable named “parentStyle” to get the style of the Source Text.
var parentText = thisComp.layer(“Parent”).text.sourceText;
var parentStyle = thisComp.layer(“Parent”).text.sourceText.style;
Now we’re going to copy the text style properties from the “Parent” text layer via expressions. Hit Enter in the Expressions Editor to add a third line, and type in:
parentStyle.setText( parentText )
Once set up, the second text layer will copy all text style properties and the Source Text from the first text layer. Here is another way to write the expression and achieve the same result:
style = thisComp.layer(“Parent”).text.sourceText.getStyleAt(0); style.setText(thisComp.layer(“Parent”).text.sourceText);
After Effects Timer
By using “.getStyleAt()”, you are getting the style of a particular character index at a particular time. In this case, “.getStyleAt(0)” is getting the style of the character “P” because its character index in the word “Parent” is 0. Using “.style” is the same as using “.getStyleAt(0).” These techniques just scratch the surface of what is possible with text expressions.
More information on expressions for text properties can be found at the HelpX page.
Dropdown Menu Expression Controls
MoGRT creators have long used Sliders for toggling between multiple designs. When designing several options in a MoGRT, After Effects 17.0 has a new feature to familiarize yourself with.
Checkboxes are appropriate for On/Off states, such as flipping on or off the stroke of a text layer.
Sliders are appropriate for ranges of minimum and maximum values, such as the padding of a text box.
The new Dropdown Menu Control is appropriate for selection from a limited number of options.
How to set up a Dropdown Menu
In this example, we’ll learn how to reposition a layer to four different positions on the screen, like in the GIF above.
Create a New Composition with dimensions 1920x1080px. Create a new Null Object and apply the Dropdown Menu Control effect to it (Effect -> Expression Controls -> Dropdown Menu Control).
Expression Time After Effects Book
In the Effect Controls panel, select the Dropdown Menu Control and click on Edit… Click the “+” button in the top-right of the dialog box to add Item 4. Click on Item 1 and rename it to “Bottom-Left.” Rename all other items to reflect their position. Always rename the Dropdown Menu Control items to something that reflects the contents best.
Create a new text layer. Hit “p” on your keyboard for Position, and alt-click the stop-watch to the right of the word “position” to add an expression. To move the layer’s Position based on our Dropdown Menu, we’re going to write a switch statement:
In the Expression Editor, copy the following expression snippet:
menu = thisComp.layer(“Null 1”).effect(“Dropdown Menu Control”)(“Menu”).value;
switch (menu)
{
case 1: [192,972];
break;
case 2: [1344,972];
break;
case 3: [192,162];
break;
default: [1344,162]
};
The item names of the Dropdown Menu are not read by the expression. Instead, it is reading the index, meaning the hierarchal position of the menu item in the list (1, 2, 3, etc.). If no case (number) is matched, then the default code is executed. For our example, case 1 is “Bottom-Left,” case 2 is “Bottom-Right,” case 3 is “Top-Left,” and default is “Top-Right.” The values inside the square brackets are the positions that the layer will move to.
Expression Time After Effects Download
In the Effect Controls panel select the Dropdown Menu Control. Right-click the Menu property (A) and select Add Property to Essential Graphics.
Countdown Script For After Effects
In the Essential Graphics panel, hit Export Motion Graphics Template > OK. Fire up Premiere 2020, import your newly created MoGRT, and see the Dropdown Menu in action!
Expression Time After Effects Model
For more information on drop-downs,see the HelpX page.