View Full Version : Deleting interdependent script controllers
01-02-2009, 07:16 PM
Hey guys, this is Max 9. I'm updating a game export script that bakes the transforms of each exportable bone into a copy, then deletes everything but the bones & copies, then aligns each bone back to the copy.
I use a lot of script controllers in the rig. When I delete the rigging, I often (but not always) have to click through an error for each script controller when its dependencies go poof. The errors do not affect the export, with all the animation saved into the copies beforehand, but the errors are annoying and I'd love to not have to click through them.
Is there maybe a way to disable script controller execution en masse so that I can delete their dependencies without being yelled at? Any sagely ideas?
01-02-2009, 08:23 PM
hmm.. I thought there was (one of the maxscript options in the customize menu), but I guess not.
dialogMonitorOPS.UnRegisterNotification id:#test -- remove any earlier test monitor
dialogMonitorOps.enabled = false -- disable the monitor in case it was still enabled
fn test = (
hwnd = DialogMonitorOPS.GetWindowHandle() -- check the dialog that popped up
hwnd_title = UIAccessor.GetWindowText hwnd -- get its title
if (hwnd != 0) then (
-- the script controller dialog that pops up
if (findString hwnd_title "Script Controller : " != undefined) then (
-- the error message that pops up (only if quiet mode is false)
else if (hwnd_title == "MAXScript Script Controller Exception") then (
else ( format "Unexpected dialog. Title: [%]\n" hwnd_title )
dialogMonitorOPS.RegisterNotification test id:#test -- register the monitor
dialogMonitorOps.enabled = true -- enable the monitor
setQuietMode true -- disables the annoying beeping and gets rid of error dialog
-- disable debugger breaks
debugStates = #(MXSDebugger.breakOnError,MXSDebugger.breakOnException)
MXSDebugger.breakOnError = false
MXSDebugger.breakOnException = false
-- do your controllers thing here
MXSDebugger.breakOnException = debugStates
MXSDebugger.breakOnError = debugStates
dialogMonitorOps.enabled = false -- disable the monitor
dialogMonitorOPS.UnRegisterNotification id:#test -- remove the monitor
You will still get the error messages in the maxscript listener. Should there be some other dialog that pops up, its title will be printed out and you can add handling for it to the test() function.
01-02-2009, 08:23 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.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.