Introduction to Maya - Modeling Fundamentals Vol 1
This course will look at the fundamentals of modeling in Maya with an emphasis on creating good topology. We'll look at what makes a good model in Maya and why objects are modeled in the way they are.
# 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.
# 2 05-03-2006 , 12:30 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Misplaced bracket - - BTW, I dislike the way most MEL coders position their brackets . . . . This is how I do it . .

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 ;

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


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
# 3 05-03-2006 , 12:35 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
I have seen some pretty sorry examples of what people call MEL tutorials . . . . some of the clowns that write these obviously never even bother to test their code. Kind of like when you were in school and you find out that the answer in the math book is wrong . . . very frustrating, and certainly not helpful.

There is really not a lot of variation of MEL from one version of Maya to the next. If there is, it is usually only added functionality, and added functionality should not cause problems, unless you run code meant for Maya 7 in Maya 5, then you might run in to some issues.


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
# 4 05-03-2006 , 09:36 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
of course, last code was not part of the statement anymore. but i fear this error was done by me, cause the tutorial adds code gradually and I oversaw the curly bracket.

anyways, thx a lot really!

and for the bracket placing. it´s funny you mention this, cause I moved them around in every place to find a good position for the eye. I´ll use your method from now on.

kind regards!


everything starts and ends in the right place at the right time.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads