View Full Version : Blink eye random animation
05 May 2003, 12:57 AM
I've a great idea. I've two blend shapes one with the eyes opened, another one with the eyes closed.
With an expression, I want randomly make the eye closed during 5 frames... And then reopen the eyes (sure)!
How to make randomly set the closed eyes blend shape to 1 during some frames (here is my pb)!
05 May 2003, 01:27 AM
sorry.. unless this is for background characters, having random blinks on your guys is definitely the wrong way to go. Blinking adds SO much to a character.. I can't imagine not wanting to animate this by hand.
BUT.. if you're desparate.. you can make the expression a sin wave or something like that..
$currentState = lefteye.blink;
global int $startFrame;
if ($currentState == 0)
// the eye is open.. do a random value check and see if we should start closing it.
$rand = rand(0,1);
if ($rand >= .9)
// time to start closing the eye.. set the startframe
$startFrame = frame;
lefteye.blink = .1;
// we're in a blink now
$currentFrame = frame;
// this is super sloppy.. you can make it much better..
$frameDif = $currentFrame - $startFrame;
if ($frameDif == 1)
lefteye.blink = .4;
if ($frameDif == 2)
lefteyeBlink = 1;
if ($frameDif == 3)
lefteyeBlink = .9;
if ($frameDif == 4)
lefteyeBlink = .5;
if ($frameDif == 5)
lefteyeBlink = .1;
if ($frameDif == 6)
lefteyeBlink = 0;
haven't actually checked to see if it'd work, but give it a shot.. ya never know. :)
05 May 2003, 02:06 AM
Oh thanks :beer: I will study it!
Sorry for my english. The word "blink" means for me "refresh eyes". Sure, I don't want use script to animate a one eye blink :)
01 January 2006, 02:00 AM
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.