ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Need to trigger animation any time there is a marker.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kavon Zamanian
Need to trigger animation any time there is a marker.
on Jan 9, 2019 at 9:12:42 pm

I'm building a template with the goal of the user being able to trigger an animation with one marker. This way all they need to do is add a marker where on the timeline they want the animation to trigger. I don't want sets of in/out markers - I just want the animation to trigger anytime there's a marker at all so users have unlimited executions of this animation.

I have it working for specific markers - just missing a reference that I can't seem to hunt down. This is what I have so far for one property.

This works fine for the first marker, or any other specific one, but I want to extend it to all markers so that it triggers once for every one.

Additionally, I'd love a way to apply this to actual keyframes, perhaps by time-remapping a composition. This way I wouldn't be limited to the ease expression for my repeating animations. That's a bit over my head though.

Thanks in advance.

m = thisComp.marker.key(1).time;
ease(time, m, m + 1,[-200],[0]);


Return to posts index

Dan Ebberts
Re: Need to trigger animation any time there is a marker.
on Jan 9, 2019 at 10:41:05 pm

Probably something like this, but I'm not sure what the "nomal" (non-animating state) should be (set by the last line):


m = thisComp.marker;
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
}
if (n > 0){
t = m.key(n).time;
ease (time,t,t+1,-200,0);
}else
0



Dan



Return to posts index

Kavon Zamanian
Re: Need to trigger animation any time there is a marker.
on Jan 10, 2019 at 5:46:15 pm

This is perfect. Thank you so much!


Return to posts index


Kavon Zamanian
Re: Need to trigger animation any time there is a marker.
on Jan 10, 2019 at 7:38:24 pm

Hey Dan,

I realized I'm still missing something and was wondering if you could help further. One of my animations would have 3 keyframes which I don't think I can apply to a kind of 3-stage ease expression (perhaps I'm wrong). Regardless, I think the better approach would be to apply it to a time-remapped composition in hopes of every marker re-triggering that composition playback.

https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=3830...

I found this thread where you helped someone do something similar, but I'm having trouble tweaking the code accordingly. Thoughts?

Thanks again


Return to posts index

Dan Ebberts
Re: Need to trigger animation any time there is a marker.
on Jan 10, 2019 at 7:55:10 pm

Like this maybe:


m = thisComp.marker;
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
}
if (n > 0){
t = m.key(n).time;
time - t;
}else
0



Dan



Return to posts index

Kavon Zamanian
Re: Need to trigger animation any time there is a marker.
on Jan 10, 2019 at 7:58:55 pm

Again, perfect. This project wouldn't be possible without you.

Cheers.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]