Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 06-11-2006, 08:26 AM   #1
laiamulet
Registered User
 
Join Date: Oct 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Question 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, 21 views)
laiamulet is offline   Reply With Quote
Old 06-11-2006, 08:28 AM   #2
laiamulet
Registered User
 
Join Date: Oct 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

and,.. this is the shoppingMall ()
Attached Files
File Type: mel shoppingmall.mel (1.6 KB, 18 views)
laiamulet is offline   Reply With Quote
Old 06-11-2006, 01:51 PM   #3
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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")`;
}



A
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.