Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects › Value triggers animation expression

  • Value triggers animation expression

    Posted by Arnis Vitols on November 16, 2015 at 1:24 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?

    Walter Soyka replied 10 years, 10 months ago 3 Members · 4 Replies
  • 4 Replies
  • Walter Soyka

    November 16, 2015 at 5:51 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   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Kalleheikki Kannisto

    November 16, 2015 at 8: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?

  • Arnis Vitols

    November 17, 2015 at 8:19 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 .

  • Walter Soyka

    November 17, 2015 at 1:43 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   |   RenderBreak [blog]   |   Profile [LinkedIn]

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy