Disable Adaptive Degredation in the Viewport


#1

Some things in 3ds Max seems impossible to do with maxscript. Recently I’ve been working with pretty dense models, and when Adaptive Degredation is turned on, it will draw boundingboxes around my mesh objects for the navitation to go smoother. The problem is that I just don’t think it gets any smoother, so I would like to turn it off.

After doing some googling I found this snipped:
– Toggle active degradation
hwnd = windows.GetChildHwnd #max "StatusPanelBottomContainer"
hwnd = UIAccessor.GetFirstChildWindow hwnd[1]
for k=1 to 3 do hwnd = UIAccessor.GetNextWindow hwnd
windows.sendMessage hwnd 0x0102 0x000D 0

So what the snippet actually does is to toggle the button I want, but I can’t specify if it should enable or disable, it just picks the oppositve of what it currently is. Is there some way to always disable this button when the snippet is ran?


#2

You can cast the hWnd to ICustButton and use SetChecked directly.


#3

Ah you’re propably talking about a plugin of some sort? I’m trying to do this with maxscript, almost there, but it toggles instead of enabling/disabling it.


#4


fn SetAdaptiveDegradationState state = 
(
	try 
	(
		local hwnd = UIAccessor.GetFirstChildWindow (windows.GetChildHwnd #max "StatusPanelBottomContainer")[1]	
		for k=1 to 3 do hwnd = UIAccessor.GetNextWindow hwnd
	
		local btn = (dotNetClass "Autodesk.Max.GlobalInterface").Instance.GetICustButton (dotNetObject "System.IntPtr" hwnd)
	
		btn.SetCheck state
		
	) catch( )
	
)

for i=1 to 3 do
(
	SetAdaptiveDegradationState on
	windows.processPostedMessages()
	sleep 0.2
	
	SetAdaptiveDegradationState off
	windows.processPostedMessages()
	sleep 0.2
)

#5

In my viewport configuration i have set “Maintain Frames per second” to 0.01 . This should ensure that adaptive degradation never kicks in. I think this is a global setting store in the 3dsmax.ini and is’nt scene dependant
Another option would be the following call to disable degradation for geometry

(nitrousgraphicsmanager.getactiveviewportsetting()).AdaptiveDegradeNeverDegradeGeometry=true

This again is per viewport. I never tested this but if it doeswhat the name implies, your geometry display should never change to boxes in the viewport after applying the above command


#6

Thanks guys :slight_smile: Couldn’t notice any difference with AdaptiveDegradeNeverDegradeGeometry, but Serejah’s suggestion did the trick. By they way, working with UIAccessors/Windows etc seems totally cryptic to me, is there some good documentation on this? Anyway, thanks again :slight_smile:

By the way, is there any other cool viewport stuff you could do with maxscript? I know that you can enable NitrousGraphicsManager.GetActiveViewportSetting()ViewportClippingEnabled = true, but there doesn’t seem to be a way to actually adjust it, is this even possible? I would love to set the lower bar to the bottom,