Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating a switch between expressions in one layer

  • Animating a switch between expressions in one layer

    Posted by Ran Ben avraham on April 24, 2017 at 9:47 am

    Hi everyone ☺

    Here’s what I’m trying to accomplish:

    I got one layer in one comp.
    i would like this layer to take it’s position from another layer that is in another comp.

    Up to this point I’m good. here is where it gets tricky –

    In the middle of the animation i would like my layer to switch it’s position source (the one mentioned above) to another source (a different layer that is in a different comp). and i would like to accomplish this without splitting or duplicating my layer. i would rather use a checkbox control / layer control / slider control or any other solution you might think of. as long it’s animatable.

    I’ll try to simplify it:

    White Circle is in comp 1
    Red Circle is in comp 2
    Green Circle is in comp 3

    1-5 seconds – White Circle takes it’s position from Red circle.
    no problem!

    5-10 seconds – white circle stops tacking it’s position from red circle and switches to green circle.
    ???

    Rules for the switch:

    1. the switch needs to happen in a manner that i can animate.
    (checkbox control / layer control / slider control or any other solution you might think of).
    2. the expression takes place in one layer that isn’t splited or duplicated – a switch between expressions in one layer.

    Thank you all very much 🙂

    Ran Ben avraham replied 9 years ago 2 Members · 2 Replies
  • 2 Replies
  • Steve Sierra

    April 24, 2017 at 12:43 pm

    Hi,

    If you create a slider on your white circle layer, you can put this expression for the position property (you can still keyframe your position if you need to) :

    var a = comp(“Comp 3”).layer(“Shape Layer 1”).transform.position;
    var b = comp(“Comp 2”).layer(“Shape Layer 1”).transform.position;
    var c = effect(“Slider Control 1”)(“Slider”);

    transform.position + ((a*c/100) + (b*(100-c)/100))/2

    Hope this helps,
    Cheers !

  • Ran Ben avraham

    April 26, 2017 at 7:55 am

    Works like a charm!
    Thank you 🙂

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