Scripted modifier's parent node

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 06 June 2008   #1
Scripted modifier's parent node

I'm doing some work with a scripted modifier and need to access the node that it is currently assigned to.

Now my quick rummage through docs hasn't identified any kind of "parent" variable and I was wondering if one existed??

Currently I'm using "$" and I'm kind of nervous about using it.

Shane
__________________
If it's worth doing, it's worth scripting
Don't wish for this to be eaiser, wish for you to better
 
Old 06 June 2008   #2
You can get the objects that depend on the modifer by using this:
Code:
deps = refs.dependents this objs = for obj in deps where isValidNode obj collect obj

Or, in case you're using max 2008 or later (or have the AVG extension installed):
Code:
objs = refs.dependentNodes this

More info about these methods can be found in the "MAXWrapper Common Properties, Operators, and Methods" topic in the online reference.

Cheers,
Martijn
 
Old 06 June 2008   #3
That looks like what I need!

Cheers
Shane
__________________
If it's worth doing, it's worth scripting
Don't wish for this to be eaiser, wish for you to better
 
Old 06 June 2008   #4
Quote:
Originally Posted by RustyKnight
That looks like what I need!

Cheers
Shane


But keep in mind a modifier can be instanced across multiple nodes, so there might be more than one node you want to take into account...
__________________
Bobo
 
Old 06 June 2008   #5
Yep, that was the SECOND question our lead asked..."can we apply it to all the objects", so yeah, this is really great (for what we want to do)...

Thanks for the heads up though!

Shane
__________________
If it's worth doing, it's worth scripting
Don't wish for this to be eaiser, wish for you to better
 
Old 06 June 2008   #6
I would have to test this but I think when using refs.dependentNodes the first node in the array is the node that the instance you are querying is on.
__________________
Paul Neale
http://paulneale.com
 
Old 06 June 2008   #7
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.
 
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 08:51 PM.


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