Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

timeRemap play

Explorer ,
Nov 23, 2021 Nov 23, 2021

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.

TOPICS
Expressions
462
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Nov 24, 2021 Nov 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.

 

I

...
Translate
LEGEND ,
Nov 23, 2021 Nov 23, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 24, 2021 Nov 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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2021 Nov 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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2021 Nov 24, 2021

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2021 Nov 24, 2021

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 24, 2021 Nov 24, 2021
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines