Thread: Fireworks
View Single Post
# 4 18-11-2003 , 08:55 AM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198

Originally posted by Dann
Hey kBrown,

Thanks for the assist, but a wierd thing is happening. When I created a script with that text called myworks02.mel, I get an error message
// Error: Cannot find procedure "myworks02". //

Lemme guess. You didn't source your script? Just say "source myworks02.mel" in the command line. Or restart Maya. Otherwise Maya doesn't know a thing about your script.

One way would have been to copy-paste the script in to the script editor and execute it. This way the global procedure would have persisted in the memory until you quit Maya...

Originally posted by Dann
If I remove that text and go back to the simple command I had before that did nothing, it finds the script but of course doesn't work. I'm guessing it's a bogus error message meaning something else is wrong.

Not sure what you mean here...

Originally posted by Dann
As I try to dissect and understand your MEL, might there be an error in the "for" condition? Doesn't it set $i to 0 every time? should it for $i ==0?

Also, $i is defined as an integer, but with no value. Does that automatically make it's value 0?

Thanks again,
-dann

No, the script is a working one. I tested it after posting it user added image

The $i is defined as an integer and because I didn't assign it a value maya initializes it to 0.

The for loop is alright too. Please excuse my bad explanation but it's like:
Code:
// for( <iterator and initial value>, <test condition>, <what to do on every round )
   for(          $i = 0             , $i < $numColors ,  $i++                      )
Basically $i is first set to 0 and on every round it is incremented by 1 ($i++). The loop is repeated as long as the test condition is true ($i < $numColors).


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!