Reference a scripted plugin's transform/name from within it's own body of code

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
  08 August 2003
Reference a scripted plugin's transform/name from within it's own body of code

LIke say you make a simpleobject scripted plugin and would like to know from code within the plugin the name and transformation of itself. Anyone know how to go about doing this?

using 'this' only seems to refernce the custom properties of the object, but not the object itself.

Like saying or a=this.transform doesn't give you the tranform or name of the scripted object, it just gives and error that the 'name' and 'transform' are properties for an udefined thing.

And or .transform doesn't work because it's not an instance of a pre-existing object like box, sphere, or whatever.
Just enough to bring chaos to order
  08 August 2003

I think you can use refs.dependents to find the actual object.. Excerpt from online reference:

An important internal mechanism in 3ds max defines the dependency relationship between 3ds max objects. For example, a material depends on its various maps, a path controller depends on its percent controller, a scene node depends on its base object, etc. The following method returns the MAXWrapper objects that depend on a specified MAXWrapper object.

refs.dependents <MAXWrapper_object>

I'm not sure if this works for simpleobject plugins, but you could try:
refs.dependents this.

good luck
  08 August 2003

Do you remember in the movie "Goonies" when Sloth is finally able to reach the tray of vegetables and food from where he is chained up in the basement and he goes ape scat? That's exactly how I felt when (refs.dependents this)[1].transform succesfully returned the transform matrix of the object!

Thanks. It also works for finding it's name, amongst a bunch of other things too.
Just enough to bring chaos to order
  08 August 2003
well last time i saw the goonies is a very loooong time ago

glad it worked for you tho

  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 11:11 PM.

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