View Full Version : Mel problem... On a simple variable!
Nicool 08-11-2002, 05:30 PM Hye,
// Mel start
curve -p 0 0 0 ;
int $i;
for ($i = 0; $i = 4; $i++) {
curve -r $i 0 0 curve1;
curve -r 0 0 $i curve1;
curve -r -$i 0 0 curve1; // It doesn't work with "-" on this value :surprised
}
How can I use $i as a negative value in this code???
Thanks, Nicool
|
|
svenip
08-11-2002, 08:12 PM
curve -p 0 0 0 ;
int $i;
for ($i = 0; $i = 4; $i++)
{
curve -r $i 0 0 curve1;
curve -r 0 0 $i curve1;
$cmd = "curve -r -"+$i*(-1)" 0 0 curve1;";
eval $cmd
}
NightshadeVFX
08-11-2002, 11:09 PM
Your also setting i = 4; on the check part of the for loop; Set it to <= 4 or
bigfatMELon
08-12-2002, 12:11 AM
I don't think sven's code is going to do much. There are a number of syntax issues and it's quite the work around for this simplified version:
curve -p 0 0 0 ;
int $i;
for ($i = 0; $i = 4; $i++) {
curve -r $i 0 0 curve1;
curve -r 0 0 $i curve1;
curve -r ($i * -1) 0 0 curve1;
}
While having the correct syntax and avoiding the eval command, this also does nothing because the -r (Replace) is expecting the name (string) of the curve to be replaced instead of a spatial coordinate.
What is it that you are expecting from this code? Using the -a and -p flags creates something somewhat recognizable in the form of a funky, lobsided spiral. As in:
curve -p 0 0 0 ;
int $i;
for ($i=0; $i<5; $i++) {
curve -a -p $i 0 0 curve1;
curve -a -p 0 0 $i curve1;
curve -a -p($i * -1) 0 0 curve1;
}
-jl
Nicool
08-12-2002, 08:28 AM
:bounce: Thank you to much!!!
Nicool
Nicool
08-12-2002, 01:53 PM
Finaly:scream: I'll use the curveOnSurface function:wavey:
Thanks you:airguitar
CGTalk Moderation
01-13-2006, 01: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.