[Closed] Node Event System — (how) does it work?
have anyone tried NodeEventCallback in 3dsmax 2008? neither example in reference doesn’t work, NodeEventCallback looks like undefined function. (i have 64bit max)
It was documented but pulled out of the release without notice to the doc them (me), so it was left in the Help without actually being exposed in Max 2008.
Sorry for the inconvenience!
Presuming 3ds Max 2009, and you added a node event callback successfully…
…how does one get rid of it again?
Well it wasnt documented (pulled out) as Bobo said – so im not sure. That was just my best guess – try it?
well, hence the “Presuming 3ds Max 2009, and you added a node event callback successfully…” The “Node Event System” is available just fine, and I can set up an event callback (broken as that may appear to be in some places)…
…but as far as I can tell – I’m not seeing any way to -remove- that callback.
There’s no “unRegisterNodeEventCallback” or “unRegisterNodeEventSystemCallback”
“callbacks.removeScripts callbackItem” just tells me that the callbackItem is not a callback
so…
Assign the callback to a variable, as it shows in the help doc. Then to remove it, declare that variable undefined and do a garbage collect. The gc() command is the key to removing it.
Crikey that’s batsh*t bonkers – but indeed does the trick, thanks!
( slips a note to the aforementioned docs department )
That explains why i couldn’t get it working then! So does it work in 2009? had the disk sitting on my desk since release but am mid project so havent installed it yet.
Yes-and-no(maybe).
From the example script in the help file, when executed, it happily tracks node selection changes, most parameter changes, etc. E.g.
-- (de)selecting an object
Event Detected: Event #callbackBegin, Nodes #()
Event Detected: Event #selectionChanged, Nodes #(2793)
Event Detected: Event #callbackEnd, Nodes #()
-- changing an object's name
Event Detected: Event #callbackBegin, Nodes #()
Event Detected: Event #nameChanged, Nodes #(2793)
Event Detected: Event #callbackEnd, Nodes #()
-- changing a property (a geosphere's radius)
Event Detected: Event #callbackBegin, Nodes #()
Event Detected: Event #geometryChanged, Nodes #(2793)
Event Detected: Event #topologyChanged, Nodes #(2793)
Event Detected: Event #mappingChanged, Nodes #(2793)
Event Detected: Event #extentionChannelChanged, Nodes #(2793)
Event Detected: Event #renderPropertiesChanged, Nodes #(2793)
Event Detected: Event #displayPropertiesChanged, Nodes #(2793)
Event Detected: Event #subobjectSelectionChanged, Nodes #(2793)
Event Detected: Event #callbackEnd, Nodes #()
But then it also claims “renderPropertiesChanged:
The supplied function will be called whenever the Render Properties of the node has been changed, including Renderable, Visible To Camera, Visible To Reflections and so on.”
-- changing primary / secondary visibility
...
-- nope, nothing
The rest that I’ve tested worked, though, so probably a simple oversight to be fixed in 2010?
Cheers Richard, Looks useful to me. Will have to get 2009 off the desk and installed now!