Copy link to clipboard
Copied
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.
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.
I
...Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Ahaa, yea that works (with marker), now I just have to figure out how to convert my values (triggers) to work like this...
Copy link to clipboard
Copied
I could do it with scripting. Read expression values from sampleImage, then add these to markers!
Copy link to clipboard
Copied
Just I noticed it's not playing till the end. Let's say I would have markers on same layer (I did that with script), how would I write expression linking with markers?
Copy link to clipboard
Copied
The time of the first marker would be marker.key(1).time.
You might have to use the layer object to access the marker: thisLayer.marker.key(1).time.
I'm not sure about this, just try.
How do you access the next marker? If you use marker.nearestKey(time), and the markers are to close, you point to the next marker before the animation has finished. You have to take care of this scenario.
Otherwise, let me know what "not playing till end" means in detail.
*Martin