Monday, October 6, 2008

Media Strobe Expression

Autodesk Smoke Tips & Tricks - Media Strobe Expression

Here i got 2 medias, i want to do the strobe effect inside the DVE.
The strobe expression is :
frametoslip(frame-ceil(frame%N))
Just put the above expression in your media's 'Slip' and 'Matte Slip' value, and replace the 'N' in the expression to whatever value you want the strobe to be.

Say '5' will give the result : frame 1,1,1,1,1,5,5,5,5,5,10,10,10,10,10,.....

But here, i not really sure what's the exact strobe i want, i want to keep my option flexible and maybe animate the strobe along the way.
First, i created a new axis, i rename it axisC.
Then in the media 'slip' and 'matte slip' for media1, i enter expression :
frametoslip(frame-ceil(frame%axisC.position.x))

In the media 'slip' and 'matte slip' for media2, i enter expression :
frametoslip(frame-ceil(frame%axisC.position.y))

Now in axisC, you can use the PositionX parameter to control media1's strobe value, and PositionY to control media2's strobe value. You can try different value right at the schematic without need to go changing the expression. And you can animate the strobe value. If you do animate it, remember to try a different curve (hermite, linear, constant) to see a different result.

5 comments:

Unknown said...

Hi,
How sure are you of the syntax in the expression?
My smoke tells me it is unknown.
Thanks, I really enjoy your blog, and want to give this tip a whirl.

Chee Keong said...

form ckeong,

It should be ok because i grab it from my screen, you see my one works. Anyway because i'm typing from computer, might be some mistake in typing, check the actually screen grab to compare the expression.

If you are using smoke2008, you need to upgrade in to SP1 or SP2. Because the earlier version has error in it's expression userfun file, you can't use the 'frametoslip' expression.

Chee Keong said...

from ckeong,

try this, just put this in expression :
frametoslip(10)
if it return unknown, that means you need to upgrade Service Pack, it's free i think.

at the meantime, you still can use the expression with some minor change.

for example, if you get this expression :

frametoslip(frame-ceil(frame%axisC.position.x))

change it to this(throw the frametoslip, and minus frame):

(frame-ceil(frame%axisC.position.x)) - frame

Anonymous said...

Very interesting but so deep one.. When u free u demo for me la ~~ ^_^ thankss

Anonymous said...

Hello

We do not agree with this year BRIT awards 2010 decision.

Please come to see our little survey

http://micropoll.com/t/KDqOnZBCWt

Lady Gaga can not be better than heavy metal

Poll supported by BRIT awards 2010 sponsor femmestyle
[url=http://www.femmestyle.ch/schoenheitschirurgie/fettabsaugung/index.html]fettabsaugung[/url]

PRINCE HARRY WISHES HAPPY BIRTHDAY TO THE BRIT AWARDS
With a special birthday message from Prince Harry for the 30th Anniversary of the BRIT Awards