CGTalk > Software Specific Forums > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 11-21-2003, 01:37 AM   #1
uzik
Frequenter
 
uzik's Avatar
portfolio
Uzik Al-Faddim
USA
 
Join Date: May 2003
Posts: 289
I'm missing something simple, but I can't figure out what

I'm doing my first max script.
All the complicated stuff works, but
what should be simple doesn't!

I'm trying to select an object I've just
cloned and put a mesh select modifier
on it. It keeps erroring out saying
it's got an undefined class.

Here's the code:

-- add a mesh selection modifier
addModifier ($(js_LifeObjectName)) (Mesh_Select())

I get this:

-- Error occurred in s loop
-- Frame:
-- s: 1
-- js_LifeObjectName: "Life001001"
-- called in r loop
-- Frame:
-- r: 1
-- called in js_LifeCreate()
-- Frame:
-- n: 12
-- obj: $Editable_Mesh:Box01 @ [-4.743082,-4.347826,0.000000]
-- called in js_LifeCreatePickButton()
-- Frame:
-- obj: $Editable_Mesh:Box01 @ [-4.743082,-4.347826,0.000000]
>> MAXScript Rollout Handler Exception: -- Type error: Call needs function or class, got: undefined <<


js_LifeObjectName names the object.
I can see the object exists. The debug
output shows the variable is set.
I tried putting in $js_LifeObjectName
and $(js_LifeObjectName) and
($(js_LifeObjectName))

Why isn't it using the string as the
object name when I use
$(js_LifeObjectName)?
__________________
---See you later space cowboy!
 
Old 11-21-2003, 10:53 AM   #2
magicm
Maxscript Generator
 
magicm's Avatar
CGSociety Member
portfolio
Martijn van Herk
VFX Technical Director
Freelance
Rotterdam, Netherlands
 
Join Date: Jun 2002
Posts: 1,139
I suspect js_LifeObjectName is a string value containing the name of the object?

If this is the case, you can get the actual object with:
getNodeByName js_LifeObjectName

so, to add the mesh select modifier try the following:
addModifier (getNodeByName js_LifeObjectName) (Mesh_Select())


Martijn
 
Old 11-21-2003, 12:37 PM   #3
uzik
Frequenter
 
uzik's Avatar
portfolio
Uzik Al-Faddim
USA
 
Join Date: May 2003
Posts: 289
Thanks very much! That was exactly
what I was looking for. Somewhere
I thought I read that it would
recursively evaluate an expression
and that $( string_naming_your_object )
would evaluate to $Object_name and
thus reference the object.

Thanks again!
__________________
---See you later space cowboy!
 
Old 01-16-2006, 06:00 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:27 PM.


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