PDA

View Full Version : got stuck with mel, (basic level quesiton)


stronman
04-06-2009, 07:55 AM
i have just started to learn maya scripting, and picked up the book" Mel companion"
while carefully reading this book , i got my first bump

the code is right blow:
_____________________________________________________
//code part 1
global proc generateGrass ( )
{
for ( $i = 0; $i < 10; $i++ )
generateBlade ;
}

//at this moment i want maya to create 10 blades using for loop

//code part 2:

global proc generateGrass ( )
{
// Creation of Poly Cone
string $blades[] = `polyCone
-radius 0,04
-height 1
-subdivisionsX 3
-subdivisionsY 10
-subdivisionsZ 0
-axis 0 1 0
-constructionHistory off
`
;
}
_________________________________________________________

i just left out rest of the unimportant codes that i understood
once i excuted the code, the maya sais"cant find object name

Chadrik
04-06-2009, 03:52 PM
the two procedures are named the same. should the second one be "generateBlade"?

stronman
04-08-2009, 02:16 PM
yes, it should be generateBlades

i have solved the problem several days ago,

i have checked the code little by little, and finally the mistake was caused by

the error of printing in "mel companion", there's no connection with the syntax mistake,

sorry to point out that the publishers are so carelessness, found a lot of tiny errors.

CGTalk Moderation
04-08-2009, 02:16 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.