Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression for working purposes only? Jump to specific marker?

  • Expression for working purposes only? Jump to specific marker?

    Posted by Jason Hearne on January 31, 2012 at 10:33 pm

    My first question is Can I use Expressions for Working purposes only?

    My comp has a “timeline effect”. I’m animating between 2020 and 1970. I’ve reduced that animation to a simple Image Sequence such that 2020 starts on Frame 1 and goes to 1970 on Frame 702. Each change of the year happens every 14 frames.

    I’m making this project as a Template for many shots to be done by several artists. I’m trying to simplify it for the artist who will be needing to turn them around quickly. The Artist will need to locate the starting year (could be 2012) and the year they need to go to (could be 1985)

    Here’s what I have so far. I grabbed this from Dan Ebberts (the minus 1 I added):

    sp=thisComp.layer("Timeline Controls").effect("Timeline Mover Frames 1-702")("Slider")-1;
    framesToTime((Math.round(sp)))

    With this I am able to start at the frame I need and go to where I need to go at the speed I need.

    Now I need to make it so that the artist can find the right frame for the starting and ending keyframe.

    I have markers set at every change of the year (numberic only).

    I was hoping to use a Slider Control to type in the year wanted to make the time slider jump to the corresponding marker. This will show the year, a keyframe can be noted, and the artist can go back to the Slider Control and set the keyframe for that frame of the clip.

    Another way I was attempting this was setting up nulls with the year, using a Layer Control to trigger the jump.

    If none of this is possible, I located a script called rd_marker navigator that allows me a work around, but requires the artist to know they need to run the script. Short of making a guide text layer that tells them this, this is undesirable.

    Any thoughts would be greatly appreciated.

    Jason Hearne
    EdenFX
    Visual Effects and Animation

    Jason Hearne replied 14 years, 3 months ago 2 Members · 4 Replies
  • 4 Replies
  • Darby Edelen

    February 1, 2012 at 12:22 am

    Since the years are linear and sequential, just like a Slider, you should be able to do the actual animation from the Slider by adapting the range 1970-2020 (the years) to the range 701-0 (corresponding frames) using a linear() function. This way the animator would simply make the keyframe value of the slider the year they want shown at that point in the timeline.

    Applied to Time Remap:

    s = thisComp.layer("Timeline Controls").effect("Timeline Mover Frames 1-702")("Slider");
    f = Math.floor(linear(s, 1970, 2020, 701, 0));
    framesToTime(f);

    You may need to apply an offset to the frame values to make this accurate depending on how the timing in your timeline pre-comp/pre-render works. Either that or adjust the range of the frames (it might be 700, 0 instead of 701, 0 for example).

    Darby Edelen

  • Jason Hearne

    February 1, 2012 at 12:41 am

    Thanks for the Quick Reply Darby,

    I considered the Linear() option but was unsure how to exactly apply it.

    I replaced my original Expression with the one you supplied and now the slider does nothing.

    Jason Hearne
    EdenFX
    Visual Effects and Animation

  • Darby Edelen

    February 1, 2012 at 7:13 am

    [Jason Hearne] “I replaced my original Expression with the one you supplied and now the slider does nothing.”

    Make sure you didn’t change the name or location of the slider (the layer it is applied to). Also that expression will only have a noticeable effect when the slider values are animated between 1970 and 2020.

    Darby Edelen

  • Jason Hearne

    February 1, 2012 at 6:32 pm

    Doh!

    That worked. I thought I had slid up into that range, but it must have been after when I started messing with the order of the linear translate.

    Thanks! You just helped me eliminate 3 big steps from my set up! An extra 7 minutes saved!!!

    Jason Hearne
    EdenFX
    Visual Effects and Animation

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