Jump to content
afx

Expression every 3 frames??

Recommended Posts

How would I get an expression to evaluate every 3 frames??

Probably an easy answer, but i must overlooking something in exhelp.

Share this post


Link to post
Share on other sites

depends. which context, POPs, SOPs, ..? if your expression is frame-dependent (meaning that it uses the $F variable), it's pretty easy using the modulo operator. Just use ($F - $F%3) instead of $F. this will make $F increment in steps of 3 frames instead of every frame (0 0 3 3 3 6 6 6 9 9 9 etc.). If you need it to increment by 1 every 3 frames, use (($F - $F%3) / 3) instead of $F - the resulting sequence will be (0 0 1 1 1 2 2 2 3 3 3 etc.).

cheers,

Abdelkareem

Share this post


Link to post
Share on other sites

Dude awesome thanks, that worked perfectly.

I was going about it all the wrong way.

I created a attribute create with a module in the first variable and then inputed that into an if() and was going by it that way.

Now what is the difference between $FF and $F? That might of been my issue also.

Edited by Angelo
  • Like 1

Share this post


Link to post
Share on other sites

$F is the current frame number as an integer (1 2 3 etc.), whereas $FF is the current frame as a float. $FF is important for certain effects (think particles or DOPs), and for correct motion blur and time shifting/stretching for example.

cheers,

Abdelkareem

Share this post


Link to post
Share on other sites

$F%3 == 0

or use : if($F%3==0, stateA,stateB)

have fun:)

Edited by ykcosmo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×