PDA

View Full Version : Scripted modifier's parent node


RustyKnight
06-25-2008, 12:50 AM
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

magicm
06-25-2008, 02:01 AM
You can get the objects that depend on the modifer by using this:
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):
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

RustyKnight
06-25-2008, 02:30 AM
That looks like what I need!

Cheers
Shane

Bobo
06-25-2008, 02:46 AM
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...

RustyKnight
06-25-2008, 02:50 AM
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

PEN
06-25-2008, 01:54 PM
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.

CGTalk Moderation
06-25-2008, 01:54 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.