3dsMax 2022 script compatibility


There is very handy script to toggle between sub-objects and object selection
It is working like a charm in 3dsMax 2020, but this error occurs in 2022 when run on EditableMesh or EditablePoly with no modifiers assigned


Will appreciate fix

rapid_edit_04.ms (3.9 KB)


There should be an error message in maxscript listener with the source code line number and position where this error happens.


I know, but there is nothing in the Listener even if it is enabled



The error is on line 46. This line in the code below modPanel.setCurrentObject obj.modifiers[obj.modifiers.count]

local obj = selection[1]
		if getCommandPanelTaskMode() == #modify and subObjectLevel != 0 then
			subObjectLevel = 0
			modPanel.setCurrentObject obj.modifiers[obj.modifiers.count]
			setCommandPanelTaskMode #create
			setCommandPanelTaskMode #modify

I don’t know if this will help, but when the line 46 is replaced with this:

if obj.modifiers.count != 0 then
				modPanel.setCurrentObject obj.modifiers[obj.modifiers.count]
				modPanel.setCurrentObject obj

the error not appear.