Notifications
Clear all

[Closed] 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

5 Replies

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

That looks like what I need!

Cheers
Shane

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

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…

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

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.