ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to move forwards one frame triggered by thisComp.marker object

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James Baron
Expression to move forwards one frame triggered by thisComp.marker object
on Jan 23, 2019 at 1:41:40 am

Hi there,

Im trying to figure out how to apply an expression to a time remap which will advance one frame every time there is a marker in the main comp

Thanks in advance!


Return to posts index

Brian Holzknecht
Re: Expression to move forwards one frame triggered by thisComp.marker object
on Jan 23, 2019 at 2:32:45 am

Here is something I modified from a previous post I found and it seems to do the trick. Not sure if it's correct, but it appeared to work for me.

Brian

skip = framesToTime(1); // frame skip
m = thisComp.marker;
begin = 0;

if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (time &lt; m.key(n).time) n--;
begin = n*skip;
}
value + begin


Return to posts index

James Baron
Re: Expression to move forwards one frame triggered by thisComp.marker object
on Jan 23, 2019 at 2:50:07 am

Thanks for your reply Brian! Im getting an expression error running it on time remap though?


Return to posts index


Brian Holzknecht
Re: Expression to move forwards one frame triggered by thisComp.marker object
on Jan 23, 2019 at 3:06:22 am

Hmm... that’s weird. What version of after effects are you using? I’m using 2018 and In my test I made a 2nd comp that I’m using as a source with the time remap on.

I’m not really an expression guy, but i figured I’d try to help while I’m waiting for some assistance on my question. Lol.

I’m not at my computer or I’d try to troubleshoot it right now. Sorry.

Brian


Return to posts index

Dan Ebberts
Re: Expression to move forwards one frame triggered by thisComp.marker object
on Jan 23, 2019 at 4:13:30 am

Something like this should work:


m = comp("Main Comp").marker;
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
}
framesToTime(n);



Dan



Return to posts index

Brian Holzknecht
Re: Expression to move forwards one frame triggered by thisComp.marker object
on Jan 23, 2019 at 4:34:01 am

Your expression skills are so impressive, the help I tried to provide came from one of your posts to someone else... Clearly I need to learn a ton more on expressions.

Brian


Return to posts index


James Baron
Re: Expression to move forwards one frame triggered by thisComp.marker object
on Jan 23, 2019 at 10:49:52 pm

Perfect Dan!! Thanks a lot for your help Dan and Brian


Return to posts index

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