View Full Version : expression update problem
bendingiscool 11-20-2008, 04:41 PM Hey, I'm havng a problem with an expression, I'm trying to get Maya to do something when it reaches a current time, here's what I have so far...
int $time = `currentTime -query`;
if ($time = 100)
{
print whatever;// will be replaced by command later on
}
at the moment it prints the word every frame, where as I want it to only print when it gets to 100.
Any ideas what I'm doing wrong?
Cheers,
Chris
|
|
change it to this..
if ($time == 100)
'$time = 100' means you are setting the value of $time to be 100
'$time == 100' means you are checking to see if $time is 100
make sense?
Wick3dParticle
11-20-2008, 07:13 PM
change it to this..
if ($time == 100)
'$time = 100' means you are setting the value of $time to be 100
'$time == 100' means you are checking to see if $time is 100
make sense?
Yup...
Also Im pretty sure there is no need to declare time as a variable...maya knows what "time" and "frame" are.
So you can just type this:
if (time > 100){
print "Hello";
}
Also...did you mean "frame" rather than "time" because they are two very different things.
if you want the command to run after frame 100, then try this:
if (frame > 100){
print "Hello";
}
bendingiscool
11-21-2008, 12:18 PM
Thanks guys, completly forgot the syntax on that one ;)
Chris
CGTalk Moderation
11-21-2008, 12:18 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.