View Full Version : need help
Fares-Kr 03-04-2008, 08:39 AM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
|
Fares-Kr
03-06-2008, 09:16 AM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hi ,
I m not a mel expert , but with "for" you need to have the {} ...
for($i = 0; $i < $35; $i++)
{
$champagne = rand(2, 5);
$bubbles = rand(10, 20);
}
Here my 2 cents....
hope it helps...
Jerome
Fares-Kr
03-08-2008, 08:56 AM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
natsheh
03-08-2008, 11:19 PM
You may check Maya help, look under:
> "MEL and expressions" > "Controlling the flow of a script" > "for"
> "MEL and expressions" > "Values and Variables"
They have some good tutorials to follow too.
Best,
Fares-Kr
03-10-2008, 10:30 AM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
strarup
03-12-2008, 04:02 PM
Hi,
there shouldn't be anything wrong with that code... did you have the snapshot1Group selected when you executed the script?
the $tname is used for creating a variable... e.g. if you look into your snapshot1Group after creating the Animated Sweep...
that they e.g. are named transform1_1 upto transform1_35
(or whatever snapshot group you might have it in)
what does the code more do...
the "setKeyframe -at "nodeState" -v 2 -t 0 $tname;"
makes the curve which have the $tname based on the $i value "inactive" from frame 0...
until the "setKeyframe -at "nodeState" -v 0 -t $i $tname;"
makes the curve which have the $tname based on the $i value "active" at the frame value of $i...
e.g. let's take the curve named transform1_14...
"setKeyframe -at "nodeState" -v 2 -t 0 transform1_14;"
will make transform1_14 "inactive" from frame 0 until we get to frame 14... where...
"setKeyframe -at "nodeState" -v 0 -t 14 transform1_14;"
will make transform1_14 "active" again at frame 14...
when you run the code you should just select your snapshot group in which you have the curves...
I have made a little change to the script... just change the snapshotgrp name "select -r snapshot1Group;"
if you have the curves in another snapshotgrp... :)
hope that helps a bit... :)
kind regards
Strarup
proc makeDaSweepGrow()
{
select -cl;
select -r snapshot1Group;
for($i=1;$i<35;$i++)
{
$tname = "transform1_"+$i;
print($tname + "\n");
setKeyframe -at "nodeState" -v 2 -t 0 $tname;
setKeyframe -at "nodeState" -v 0 -t $i $tname;
}
}
makeDaSweepGrow;
zoo-prod
03-14-2008, 12:12 AM
be carrefull $tname is not declared, you need to declare this variable (if you don't do that it will not work) :
string $tname = "transform1_" + $i ;
Fares-Kr
03-16-2008, 11:08 AM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CGTalk Moderation
03-16-2008, 11:08 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.