------------------------------------------------------------------------------- -- mbHideUnhide.mcr -- (c) 2006 Martin Breidt (martin@breidt.net) -- v 0.1 -- Created On: 10/05/06 -- tested using Max 8 SP3 ------------------------------------------------------------------------------- -- -- This code is released under "Quote ware" license: -- If you use this tool in a production environment with a group of more than two people, -- or have used it in the past under such conditions, then you are obliged to tell -- me (martin@breidt.net) about it and allow me to list that project title and your -- company name as a reference on my website http://scripts.breidt.net -- ------------------------------------------------------------------------------- -- Description: -- Two macroscripts (to be found in the "MB Tools" category) that replace the -- standard hide/unhide functions. -- The first one will hide all selected objects but also store the information -- which objects werde just hidden in the scene file. -- The second macroscript can then be called to undo the previous hide action. ------------------------------------------------------------------------------- macroscript mbHide category:"MB Tools" -- macroscript that will hide all selected nodes and store -- the information which nodes were hidden in the scene ( persistent global mbHide_lastHidden on isEnabled do (selection.count>0) on execute do ( if selection.count>0 then mbHide_lastHidden = #() for o in selection do ( append mbHide_lastHidden o o.isHidden = true ) clearSelection() ) ) macroscript mbUnhideLast category:"MB Tools" -- macroscript that will undo the last mbHide action and make -- all nodes visible again that were hidden before ( persistent global mbHide_lastHidden on isEnabled do ((classof mbHide_lastHidden)==Array) on execute do ( if (classof mbHide_lastHidden)==Array then ( for o in mbHide_lastHidden do ( if isValidNode o then o.isHidden = false ) mbHide_lastHidden = undefined ) ) )