View Single Post
# 1 04-03-2006 , 11:52 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095

undeclared variable

I´m currently reading The MEL Companion. very good lecture! but -

is it possible, since the book was published in 2003 that some of the scripting language has changed? cause not even one of the examples.mel work correctly with maya 7.


global proc generateGrass()

{
//Creation of Poly Cone
string $blades[] = `polyCone -r .04 -h 1 -sx 3 -sy 10 -sz 0 -ax 0 1 0 -tx 1 -ch 0`;

//bring the bottom of the cone to groundlevel
setAttr ($blades[0] + ".translateY") 0.5 ;

}

// till here it´s working ------------

// harden the edges of cone
polySoftEdge
-angle 30
-constructionHistory off
( $blades[0] + ".e[0:59]" )
;


line 22.19: "$blades" is an undeclared variable. //



why is $blades[] in the second place a undeclared variable? and if there is a reasonable say syntax error or something, why is this provided by the book in exactly such way?

would be happy if someone could help me out.


everything starts and ends in the right place at the right time.