ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Value triggers animation expression

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Arnis Vitols
Value triggers animation expression
on Nov 16, 2015 at 1:24:11 pm

Hello everyone!

I'm trying to write an expression where a value triggers an animation and I'm having trouble getting it to work.

At the moment I have:

x = transform.position[0];
if( x < 340) {ease(time,0,100)} else 0

And I can't seem to find any info on how to continue...

I'm trying to animate the opacity value - with this expression it just jumps to 100 as soon it reaches 340. The animation should have easings on both sides and it can be triggered on any frame of the comp. And last but not least the animations length should be 12 frames.

Can anyone help me with the expression?


Return to posts index

Walter Soyka
Re: Value triggers animation expression
on Nov 16, 2015 at 5:51:06 pm

Expressions have no state. When an expression is evaluated, it has no implicit idea what happened on the frame before; they are evaluated from scratch on every single frame.

If you want to trigger a time-remapping animation with an event like this, you'd have to write your expression in a way that considers time as an input. You'd have to look 12 frames back, figure out if the animation should have started already, and where you are in that animation.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Kalle Kannisto
Re: Value triggers animation expression
on Nov 16, 2015 at 8:00:00 pm

To clarify, are you trying to just fade an object it once it reaches a specific x location?

Or are you also trying to start an animation that is kept "frozen" to frame 1 until you reach a specific x location?


Return to posts index


Arnis Vitols
Re: Value triggers animation expression
on Nov 17, 2015 at 8:19:12 am

Yes, the first version.

It should only begin the fading as it reaches the specific X location. This should be done without any sort of pre-comp time remapping .


Return to posts index

Walter Soyka
Re: Value triggers animation expression
on Nov 17, 2015 at 1:43:51 pm

You can modify my code here:
https://forums.creativecow.net/thread/2/1051293#1051428

This was intended for time-remapping, but it could be easily altered to return an opacity value instead.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]