CGTalk > Software > 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's Avatar
Uzik Al-Faddim
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

Why isn't it using the string as the
object name when I use
---See you later space cowboy!
Old 11-21-2003, 10:53 AM   #2
Maxscript Generator
magicm's Avatar
CGSociety Member
Martijn van Herk
VFX Technical Director
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())

Old 11-21-2003, 12:37 PM   #3
uzik's Avatar
Uzik Al-Faddim
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
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
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
Society of Digital Artists

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

All times are GMT. The time now is 09:42 PM.

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