PDA

View Full Version : animating without setting keyframe


DEVILSAN
08-22-2008, 06:36 AM
Hi I am animating the eye lid movement open and close like this

float $time =`currentTime -q`;
//print $time;

float $newTime = $time + $blinkDelay;
float $halfTime = $newTime/2;
//print $halfTime;
// set keyframe at start end of the blink - on 2 atributes
setKeyframe -at "ssw" -at "esw" -t $time -t $newTime makeNurbSphere1;

// close the eye top and bottom
setAttr "makeNurbSphere1.startSweep" 0;
setAttr "makeNurbSphere1.endSweep" 360;

// set 1 keyframe in the middle at the closed state
setKeyframe -at "esw" -at "ssw" -t $halfTime makeNurbSphere1;


but now i want to rotate the eyeball but without keyframing it,
Do i add expression to eyeball.RotateY = $blinkDelay or something..


how do i do ? i think logic based on even driven concept like if something happens i can start for loop to rotate eyeball till some limit.. but i dont understand here how to do..

Gravedigger
08-22-2008, 08:23 PM
hello devilsan

i don't really get the problem.

well looking over your script i can see that you set keyframes for a nurbssphere for the attributes startsweep and endsweep. but what does the halftime thing is doing? you take half of the sum of the current time plus the delay which gives you, depending on the current time, a result way before your keyframe animation.

if the current time is 50 and your delay is 10:
$time = 50;
$newtime = 50+10 = 60;
$halftime = 30;

i'm not sure but i think you'd like to get something like:
$halftime = $time + ($delay/2);

next thing:
why do you want to rotate the eyeball and why don't you want to use keyframes? using expressions for eye animation isn't really a very nice way but it depends on what you're trying to achieve. could you please explain a bit more about the effect you're trying?

grs Gravedigger

DEVILSAN
08-22-2008, 09:02 PM
if the current time is 50 and your delay is 10:
$time = 50;
$newtime = 50+10 = 60;
$halftime = 30;

i'm not sure but i think you'd like to get something like:
$halftime = $time + ($delay/2);



I am trying to rotate the eyeball based on the value i have in end sweep or start sweep,

but as u say if we have 10 as delay the brackets will execute first and result will be 55

dont u think so,

btw i troubleshoot this thing since yeterday so i came up with setting the rotate expression value equals to value of sweep .

CGTalk Moderation
08-22-2008, 09:02 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.