View Full Version : Expression coding - Dimentionnal Pb
Nicool 12-11-2002, 03:58 PM Hye Everybody,
I'm working on an expression...
At TimeA I set a blendShape to 1. I want at TimeA+1 script set the blend shape to 0.75, at TimeA+2 to 0.5, to TimeA+3 0.25....
How to take the TimeA value? And how to manage this type of action?
Thanks
|
|
alexx
12-11-2002, 08:02 PM
do you want to set a keyframe on the blendshape at a certain time to be 1 and have it fade of in the next 4 frames?
you can get the current frame with that command:
int $myTime = `currentTime -q`;
:beer:
alexx
artifish
12-11-2002, 11:07 PM
or, as you're working with expressions, you can use the predefined variables "time" or "frame" - this is faster than using mel.
eg:
float $blend;
int $initFrame =10;
int $numFadeOutFrames= 4;
if ((frame >= $initFrame)&&(frame<($initFrame+$numFadeOutFrames)))
{
$blend = 1.0 - (frame-$initFrame)/ $numFadeOutFrames;
}
alexx
12-12-2002, 07:28 AM
this is the point where i think that i should read ALL the lines in the manuals...
in expressions frame and time are predefined?
oh oh..
i really never read that line in the manuals.. damn.
that would have sped up some of my particle scripts a lot :(
Nicool
12-12-2002, 05:53 PM
Thank you artifish and alexx,
I think I'll use mel, cause I need few "$initFrame" choose by random on the timeline.
In my script I want add randombly a blendshape movment...
I'll work on...
Regards
CGTalk Moderation
01-13-2006, 11:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.