[Closed] Retrieve scripted modifier 'parent'
Hi guys,
This is probably a really stupid question, but how can I retrieve the name of a modifier’s ‘parent’.
I can get the modifier itself using ‘this’. but are there any properties that retrieve the node it’s applied to?
I’m using MAX 9.0 and I’ve looked through the MAXscript help, but i couldn’t find anything that worked.
Greetz,
Tom
Hi Tom, I think this may help you.
–grab the modifier from an object
xMod = $.modifiers[1]–Will show you an array with all nodes that the modifier depends on
xArray = refs.dependents xMod–Now, lets find the object that holds the modifier
xObj = for o in xArray where superclassOf o == GeometryClass collect o–and now you got the object´s name
xObj[1].name
I don´t understand the “this” part you said you´re using to find the modifier, I looked into maxScript help and didnt find anything with “this” and modifiers!
Fabiomussarela, thanx for your help,
the code didn't work the way you wrote it (but that's my fault,:blush: cause I forgot to mention I needed the object while my plugin modifier was loading, and I can't select objects until it's finished)
but with some tweaking I got it to work.:cool:
(btw, the "this" value, returns a modifiers own name and class, basically the same as $.modifiers[i], but then from within the modifier itself).
Here's the code as I have it now
on Load do -- Load Plugin Modifier
(
xArray = refs.dependents this
xObj = for o in xArray where superclassof o == shape collect o
if (getAppData xObj[1] 1)== undefined then
(
messagebox ("Error Loading Data From " + xObj[1].name)
xObj=#()
)else
(
-- Load a lot of data and stuff
)
)
Thanks Again!
Grtz
Tom