Error: No object matches name

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 06 June 2005   #1
Error: No object matches name

This is my first attempt at MEl and I'm getting the feeling that I did something totally wrong with my script since I get the: //Error: No object matches name: // error. Could you please take a look at it and help me out?

global proc CreateCurve(int $numVerts, float $curveLenght)
 {
 		int $numVerts;
 		string $curve;
 		float $calculate;
 		float $curveLenght;
 		string $array[];
 			float $calculate = $curveLenght / $numVerts;
 			if ($numVerts < 1 || $numVerts = 1)
 			{
 				int $arraynumber;
 				int $arraynumber = 1;
 				float $newfloat;
 				do	{
 				$array[$arraynumber] = "-p 0 0" + $calculate + " ";
 				$newfloat = $newfloat + $calculate;
 				$arraynumber = $arraynumber + 1;
 				}while ($newfloat < $curveLenght);
 				curve $array;
 			}else{
 			print("The number of vertices must be larger than the number one.\n");
 		}
 }


any help will be appreciated. Thanks
 
Old 06 June 2005   #2
A few tips:

1. Procedure parameters shouldn't be redeclared inside the procedure (i.e. $numVerts, and $curveLenght), otherwise their values will be reset.
2. if ( $numVerts < 1 || $numVerts = 1) checks if $numVerts is less than 1 and then sets it to 1. You probably want 'if ( $numVerts >= 1 )'
3. $newfloat should be initialized to 0 (float $newfloat = 0; ), otherwise it will start with a random value
4. It might be easier to use a string instead of a string array to build the parameters:
string $params;
$params += ("-p 0 0 " + $calculate + " ");
5. When executing the curve command, use an eval statement:
eval("curve " + $params);

This may not get you all the way there, but it's a start.

Last edited by bruegger : 06 June 2005 at 02:40 PM.
 
Old 06 June 2005   #3
Thanks, I fixed it this morning and its working like a charm
 
Old 06 June 2005   #4
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:57 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.