Skip to main content
Known Participant
November 23, 2021
Answered

timeRemap play

  • November 23, 2021
  • 2 replies
  • 765 views

Hi, I’m having a comp with timeRemap (light animation, bulb turns on). What I’m trying to achieve is to trigger timeRemap on if statement, if value, timeRemap plays. Now the problem is timeRemap is triggered, but only one (first) frame, not the whole animation it should play. On each trigger, the final effect is either 1 or 0 (timeRemap), but it should play animation how it is, smoothly, when it’s triggered. I hope I was clear. Any help would be much appricated.

This topic has been closed for replies.
Correct answer Mrtn Ritter

If your triggers are keyframes, markers, in / out points of layers or any other object with a time property, you can use a simple code on time remap like:

 

trigger = ... // use pigwhip to link to property with keys, or link to markers, etc.
if (time >= trigger.time)
{
   time - trigger.time;
}

 

When the playhead hits the trigger, the result will be 0. time does increase with each frame, but trigger.time is static. So the result will increase framewise and time remap will playback your animation.

 

Instead of hardcoding a trigger, you can use nearestKey(time) to jump to the next keyframe or marker or you cycle through the layers using for(){}, if your triggers are in/out points.

 

Give us more details and we can think of a more specific solution.

 

*Martin

 

2 replies

Mrtn Ritter
Mrtn RitterCorrect answer
Participating Frequently
November 24, 2021

If your triggers are keyframes, markers, in / out points of layers or any other object with a time property, you can use a simple code on time remap like:

 

trigger = ... // use pigwhip to link to property with keys, or link to markers, etc.
if (time >= trigger.time)
{
   time - trigger.time;
}

 

When the playhead hits the trigger, the result will be 0. time does increase with each frame, but trigger.time is static. So the result will increase framewise and time remap will playback your animation.

 

Instead of hardcoding a trigger, you can use nearestKey(time) to jump to the next keyframe or marker or you cycle through the layers using for(){}, if your triggers are in/out points.

 

Give us more details and we can think of a more specific solution.

 

*Martin

 

Known Participant
November 24, 2021

Ahaa, yea that works (with marker), now I just have to figure out how to convert my values (triggers) to work like this...

Known Participant
November 24, 2021

I could do it with scripting. Read expression values from sampleImage, then add these to markers!

Mylenium
Legend
November 24, 2021

Without seeing your existing code and a screenshot of your timeline nobody can tell you much. on a hunch, though, it seems like you haven't any linear() or such function in there to actualyl retain the animation. Simply turning things on and off will of course only work as you described. Time-remapping has no inherent auto-animation powers or whatever.

 

Mylenium