I'm missing something simple, but I can't figure out what

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  11 November 2003
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!
  11 November 2003
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())

  11 November 2003
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!
  01 January 2006
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 02:35 PM.

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