Notifications
Clear all

[Closed] degradation override with script?

Hey peeps, anyone know how to turn off the degradation override with script? I found the “max override” in the MAX commands section of the help and it says:

Toggles Degradation Override. Executing this command works on the active window only, so if executed from Listener does nothing.

So I dropped it in a script to try to get it to work, but can’t get it to do anything there. Tried script with and without a UI in case that makes a difference. But I can’t seem to get it to do anything.

Cheers,
Cg.

6 Replies

why not do it with macroScript?you can set a hotkey for this.

Sorry, I’m not following you. It already has a hotkey set to “o” to toggle it. I need to know how to do it with maxscript.

Cg.

(
	WM_CHAR 	= 0x0102
	VK_RETURN 	= 0x000D

	hwnd = windows.getchildhwnd #max "StatusPanelBottomContainer"
	hwnd = uiaccessor.GetFirstChildWindow hwnd[1]
	for k=1 to 3 do hwnd = uiaccessor.GetNextWindow hwnd

	windows.sendMessage hwnd WM_CHAR VK_RETURN 0 -- press ENTER key
)



Denis, you’re a champion.

Cg.

i believe there is a better solution

You can also try:

(
	-- Anything that sets the focus on the viewport or max
	toolmode.commandmode = toolmode.commandmode
	max override
)

Or if you do it from a Rollout:

(
	rollout RO_TEST "" width:184 height:48
	(
		button btn1 "Toggle Adaptive Degradation" pos:[8,8] width:168 height:32
		
		on btn1 pressed do
		(
			toolmode.commandmode = toolmode.commandmode
			max override
			setfocus btn1
		)
	)
	createdialog RO_TEST
)