have you tried running a Notify on NOTIFY_MODPANEL_SEL_CHANGED ?
i thought about this… but what can it give us?
if I listen to all notifications, then in theory I will know what happens on the stack … but this is far from a fact, and it is not clear when I need to “start listening”
All this time I lived without knowing what is on the stack and it was OK. But recently I realized that I can’t say for sure that a certain modifier is at a certain moment on the stack. And It got me hooked
Interface::GetModContexts and Interface::GetCurEditObject ?
tried and learned them all…
i use it in a lot of my methods…
STOP! that sounds like an answer… let me check…
i can get all nodes in stack… all modcontexts… in theory i can find a modifier by node and context
i can’t get a list of current modifiers in stack, but at least i can know now the node (or nodes) which context is currently in the list. It’s a BIG progress!
the good thing is that the nodes might be UNSELECTED (the ‘pinned’ stack case)
now i know what is to enumerate… if we have multiple nodes with some logic i can find ‘shared’ modifiers… it sounds promising
I still don’t see how to get this stak:
( delete objects max modify mode md1 = noisemodifier() md2 = edit_poly() md3 = bend() md4 = smooth() md5 = uvwmap() obj1 = box pos:[0,0,0] obj2 = box pos:[50,0,0] addmodifier obj1 md1 addmodifier obj1 md2 addmodifier obj1 md3 addmodifier obj2 md2 addmodifier obj2 md4 addmodifier obj2 md5 select obj1 modpanel.setcurrentobject md2 modpanel.setpinstack on deselect obj1 )
This seems to work for my previous example, but it is very ugly.
( currentMod = modpanel.getcurrentobject() nodes = refs.dependentNodes currentMod nodesModifiers = for j in nodes collect #(j, j.modifiers.count) dummyMod = emptymodifier() select nodes modpanel.addmodtoselection dummyMod mainNode = undefined for j = 1 to nodesModifiers.count do ( if nodesModifiers[j] != nodesModifiers[j].modifiers.count do ( mainNode = nodesModifiers[j] deletemodifier mainNode dummyMod ) ) select mainNode modpanel.setcurrentobject currentMod modpanel.setpinstack on max select none print mainNode.modifiers )