Friday, October 10, 2008

Media Repeat Frame Expression

Autodesk Smoke Tips & Tricks - Media Repeat Frame Expression

This is almost same with the previous tip Media Strobe Expression, but this time we will do repeat every frame in the clip N times. Is like you use 'Video' - 'Repeat' - 'Frames in Clip' , but we will do it in DVE with expression. Say, here i got 2 animation clips. The animation characters move every frame, however, here i want it to move only every 3 frames. The expression is: frametoslip(floor(frame/N))+1, just replace the N to whatever value you like it to repeat, put this expression into the media slip & matte slip.

To repeat every frame in the clip 3 times, expression is:
frametoslip(floor(frame/3))+1.
This will give result : frame 1,1,1,2,2,2,3,3,3,4,4,4....

Here i want to keep my option flexible, or maybe i want to change the repeat frame amount during animation. So, i made a new axis and name it axisC.

In media1 'Slip' & 'Matte Slip' put this expression:

frametoslip(floor(frame/axisC.position.x))+1

In media2 'Slip' & 'Matte Slip' put this expression:

frametoslip(floor(frame/axisC.position.y))+1

Now i can use the axisC positionX to control the repeat amount for media1, and axisC positionY to control media2 repeat amount. I can animate it if i want to. Try change the interperlation (linear, hermite, constant, natural) and see the different when you animate the freeze amount.

No comments: