Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Activating animation with slider control

  • Activating animation with slider control

    Posted by Ramiro Dall’agnese on April 30, 2018 at 4:11 pm

    Hi! Very new to expressions.

    I’m trying to make a US map template, where the states animate from their original place on the map to another part of the screen depending on a slider control that goes from 1-50.

    I’m able to get the states appear in their new value according to the slider, but they pop up rather than animate (position and scale).

    Thanks in advanced for any help!

    Ramiro Dall’agnese replied 8 years, 4 months ago 3 Members · 7 Replies
  • 7 Replies
  • Kalleheikki Kannisto

    May 1, 2018 at 3:52 pm

    Need some more information before I can suggest a good approach. Time-based animation with expressions usually require looping through frames or markers.

    The key question is: Does the time between the different states animating in vary, i.e. are you keyframing the slider with different speeds (or time stretches) between the points where the subsequent states show up?

    If so, it might be better to use markers instead of a slider. It is faster to find the time stamp of marker number X than to check every frame backwards for slider values at previous frames.

    If, however, the slider moves at a constant rate, it could be used to control the timing of the animations as well.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Ramiro Dall’agnese

    May 1, 2018 at 10:58 pm

    Hi, thanks for answering. I’ve scratched that part of the template for now. I figured out how to animate it, but there were a ton of other issues that I wouldn’t be able to solve for now.

    I have a separate question, however:

    I’m want a layer’s opacity to animate from 0-100 depending on whether another layer is enabled or not. If it’s enabled I want it to animate, if it’s not then I just want it to stay at 0. Is this possible?

  • Kalleheikki Kannisto

    May 2, 2018 at 6:04 am

    Not directly: You can’t read the enabled state of a layer with an expression (to my knowledge). But if you “enable” and “disable” layers with a checkbox expression control that sets them to 0 opacity based on checkbox state, you can read that checkbox value (or opacity value) from another layer.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Dan Ebberts

    May 2, 2018 at 6:33 am

    An expression does have access to the other layer’s enabled state and you could control opacity based on that:

    if (thisComp.layer(“Other Layer”).enabled) 100 else 0

    But you wouldn’t be able to animate anything because the expression has no way of knowing when the layer was enabled (it’s just something that happens in AE’s UI, it’s not keyframable).

    Dan

  • Kalleheikki Kannisto

    May 2, 2018 at 9:58 am

    Good point and thanks for correcting my wrong assumption. Perhaps the layer in and out points would be more useful a reference point?

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Ramiro Dall’agnese

    May 2, 2018 at 2:29 pm

    Thank you both for getting back. I appreciate it. I’ll see how I can work it out.

    In essence – what I want to do – is have the capitals of each corresponding State only appear if that State is enabled. I can’t simply place the capital in the State comp because the Capital names overlap other States and may end up behind another State’s outline, that’s why I want to have them in separate comps. Maybe there’s another solution?

    Thanks!

  • Ramiro Dall’agnese

    May 2, 2018 at 2:59 pm

    This worked in terms of animating the layer if the other layer is enabled. Granted, it’s tied to the position of the layer’s starting point, but it works for what I’m trying to achieve. Now I can just hide the capitals comps and have the working space a little tidier.

    Thanks a lot!

    fadeInTime = .5;

    if(thisComp.layer("5 CONNECTICUT").enabled)Math.min(linear(time,inPoint,inPoint + fadeInTime,0,90));;
    else 0;

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