Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 06-11-2006 , 08:26 AM
Registered User
Join Date: Oct 2006
Posts: 10

error: it is an undeclared variable, but...I've declared!

I have the main procedure called shoppingMall ().

In this procedure I've defined the position of the boxes in world coordinates and after I call another procedure called getDistanceToClosestUV($xBase, $yBase, $zBase) that takes into account the coordenates of my boxes.

In getDistanceToClosestUV() procedure I've translated the coordenates of a nurbs surface in world coordinates as well and after I calculate the minimum distance from the coordinates of the nurbs surface to the coordinates of the boxes.

I have that $ac = getDistanceToClosestUV() and this procedure is returning me a variable that is the minimum distance
return $deltaY;

I have to use the $ac to play with some rules, and the program is telling me that $ac is an undeclared variable, when I'm calling other procedures that are depending on this variable.

I don't understand why!!

I'll send you the 2 main procedures: shoppingMall() and getDistanceToClosestUV() and I hope someone can help me,...

Thank you!

Attached Files
File Type: mel getdistancetoclosestuv.mel (2.0 KB, 506 views)
# 2 06-11-2006 , 08:28 AM
Registered User
Join Date: Oct 2006
Posts: 10
and,.. this is the shoppingMall ()

Attached Files
File Type: mel shoppingmall.mel (1.6 KB, 509 views)
# 3 06-11-2006 , 01:51 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
well I'm not 100% sure because I can't run the scripts because there are some other procs missing (is there any reason why you have them as two separate scripts? couldn't it just be one script with the two procs in it?)

I've noticed that if $deltaY may not get set at all because if this:

if ($dist < $minDistance)

check fails then you will return an undefined $deltaY. You need initialise it to some value, even if it's 0.

It may have something to do with that.


On line 26 of that script aswell you call the name "accessibilty". If you plan on using this script again with other object etc then you should be passing that in as a paramter rather than hard coding it.

e.g.

global proc string myProc()
{
return `getAttr "myObject.tx"`;
}


this is better because you can use it on any object
global proc string myProc(string $myObject)
{
return `getAttr ($myObject + ".tx")`;
}


user added image
A


Technical Director - Framestore

Currently working on: Your Highness

IMDB
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