View Full Version : Maxscript: self-referencing when instancing an object?
amz23 10-13-2008, 08:14 PM changing changing changing
|
|
amz23
10-13-2008, 08:16 PM
Hi!
I'm fairly new to Maxscript so maybe the answer is very simple, I'll describe briefly.
Basically I have an object but I want to "imprint" it with a text (I'm using a proboolean), and I want that text to be easily changed by the user, so I opted for User Defined properties via a getUserProp.
I created a script in one of the object's scale axis. Defined these variables:
myself
Assigned to Target: $'obj_name'[#text_obj].'Text(Object)' (obj_name is the name of the object, and text_obj is the name of the extruded-text sub-object of the proboolean)
parent
Assigned to Node: $'obj_name' (I think here lies the problem, this node remains the same even when cloning the xref object, it doesn't change to match the clone's name... but I couldn't do the reference in any other way but a Node because it tells me I create a "circular dependency")
Then the script just says:
myself.text=getUserProp parent "var"
1
This works for the first xrefed object, but when doing clones of it, the behavior is undesirable.... if doing a Copy-Clone of it, the original object's text gets the User Defined Props from the NEW object... and if I delete the new object, the original stops working. If I do an Instance-Clone of the object, the clone gets the UsrDefProps from the original, not from itself...
I then played around and changed into:
myself.text=getUserProp $ "var"
Because "$" points to the object itself... but it has the same problems PLUS when reopening the scene which has the xrefs, it prompts with errors in the script...
Is there a way to make each clone point to its own UserDefProps, not the original's? Any ideas or suggestions?
Thanks again :D!
amz23
10-13-2008, 08:25 PM
Ok this problem in an even simpler situation... just a box with it's height defined in the Custom User Props. Xrefed the first box, fine... instance-cloning it and the first box's height is defined by the clone's User Properties!!
Argh!
CGTalk Moderation
10-13-2008, 08:25 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.