/* UndoSubObjectLevel (2011.09.13) by Anubis (http://project3d.narod.ru) Compatibility: tested on 3ds Max 2009 (but s'd works below to 3ds Max 5) Reference to the request in the forum: http://www.scriptspot.com/forums/3ds-max/general-scripting/how-to-store-last-subobjectlevel */ macroscript UndoSubObjectLevel category:"Anubis" internalcategory:"Anubis" tooltip:"Undo SubObject Level" buttonText:"Undo SOL" ( if not isKindOf ::LastSubObjectLevel Number do ::LastSubObjectLevel = 0 fn filtActive = ( selection.count == 1 and IsSubSelEnabled() and \ getCommandPanelTaskMode() == #modify and \ numSubObjectLevels >= LastSubObjectLevel ) on isEnabled return filtActive() on isVisible return filtActive() on execute do (swap LastSubObjectLevel subObjectLevel) )