Notifications
Clear all

[Closed] Deleting interdependent script controllers

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?

Thanks!
–John.

1 Reply

hmm… I thought there was (one of the maxscript options in the customize menu), but I guess not.

Try this…


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 (
			UIAccessor.closeDialog hwnd
		)
		-- the error message that pops up (only if quiet mode is false)
		else if (hwnd_title == "MAXScript Script Controller Exception") then (
			UIAccessor.closeDialog hwnd
		)
		else ( format "Unexpected dialog.  Title: [%]
" hwnd_title )
	)
	true
)
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
[color=Green]-- disable debugger breaks
debugStates = #(MXSDebugger.breakOnError,MXSDebugger.breakOnException)
MXSDebugger.breakOnError = false
MXSDebugger.breakOnException = false
[/color]-- do your controllers thing here
MXSDebugger.breakOnException = debugStates[2]
MXSDebugger.breakOnError = debugStates[1]
setQuietMode false
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.