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 CLOSED
 
Thread Tools Search this Thread Display Modes
Old 08 August 2003   #1
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 a=this.name 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 delegate.name 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
 
Old 08 August 2003   #2
googlo,

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

---------------------------------------------------------------
Dependencies
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
Martijn
 
Old 08 August 2003   #3
Magicm,

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
 
Old 08 August 2003   #4
well last time i saw the goonies is a very loooong time ago

glad it worked for you tho


Martijn
 
Old 01 January 2006   #5
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
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 09:32 PM.


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