Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions time expression with 60fps – unexpected results

  • time expression with 60fps – unexpected results

    Posted by Patrick Grossien on August 10, 2015 at 6:28 pm

    I tried to use Dan Ebbert’s script below to hold a position of a layer for 12 seconds. Unfortunately I’m working with 60fps and the script doesn’t work as it should. It holds the position for more than 12 seconds.

    I haven’t fully grasped what the “time” function actually delivers. Especially with higher frame rates. Any help is much appreciated.

    holdTime = 12; //time to hold each position (seconds)
    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    random([thisComp.width, thisComp.height])

    Patrick Grossien replied 10 years, 8 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    August 10, 2015 at 6:34 pm

    time is in seconds and is independent of the frame rate. The expression works fine for me at 60 fps. Do you have time remapping in the mix somewhere?

    Dan

  • Patrick Grossien

    August 10, 2015 at 7:03 pm

    Thank you Dan for helping me out!

    There’s no time remapping in there.
    I’ve randomised an ellipse with turbulent displace and rotation.
    Scale has looping keyframes from 00:00:00 to 00:12:00 (also tried 00:11:59)
    and the repositioning always happens after 12sec and it’s multiples.

  • Patrick Grossien

    August 10, 2015 at 7:09 pm

    I tried it in a clean comp with a simple circle and it jumps at

    00:12:24

    00:24:24

    it always switches 24 frames after the given second.

    If I use 11 seconds as hold time it jumps at

    00:11:24
    00:22:24

    so it’s as if I’m missing something in the overall comp settings or preferences then?

    holdTime = 12; //time to hold each position (seconds)
    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    random([thisComp.width, thisComp.height])

  • Dan Ebberts

    August 10, 2015 at 7:13 pm

    Does the layer start at comp time = 0? If not, you might want to try it this way:

    holdTime = 12; //time to hold each position (seconds)
    seed = Math.floor((time-inPoint)/holdTime);
    seedRandom(seed,true);
    random([thisComp.width, thisComp.height])

    Dan

  • Patrick Grossien

    August 10, 2015 at 7:16 pm

    Oh man, I guess I’m just totally overworked. I can’t see the simplest things today….

    Yes that’s it and the script works like a charm like that.

    Thanks a million!

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