------------------------------------------------------------------------------- -- Space Warp Control Panel -- By Jeff Brown (jeff@firemist.com) -- v 1.50 -- Modified On : 2017/04/25 -- tested using Max 2016, 2018 -- -- Thanks to all the good Max-folks that have helped me over the years. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Description: -- Speeds up workflow by turning off space warp bindings on objects via toggle system. -- can also delete space warp bindings from objects ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- comment ( uncomment ) the following line to disable ( enable ) as a Macro Script : macroScript WarpToggle category:"Fire Mist Media" ( --------------- variables ----------------------------------------------------- local wcRollout -- interface rollout local button_remove, button_wtON, button_wtOFF --interface buttons local radioBtn_range local setWarpState, removeWarpBindings --functions local obj, noBoundObj, j local radioBtnState, warpOnOff --------------- functions ----------------------------------------------------- function setWarpState radioBtnState warpOnOff = ( if radioBtnState == 1 then ( noBoundObj = true for eachobj in objects do ( for j in eachobj.modifiers where superClassOf j == SpaceWarpModifier do ( j.enabled = warpOnOff noBoundObj = false ) ) ) else ( noBoundObj = true for obj in selection do ( for j in obj.modifiers where superClassOf j == SpaceWarpModifier do ( j.enabled = warpOnOff noBoundObj = false ) ) ) if noBoundObj do ( messageBox "No SW-Bound objects found" ) ) function removeWarpBindings radioBtnState = ( if radioBtnState == 1 then ( noBoundObj = true for obj in objects do ( for j = obj.modifiers.count to 1 by -1 where superClassOf obj.modifiers[j] == SpaceWarpModifier do ( deleteModifier obj j noBoundObj = false ) ) ) else ( noBoundObj = true for obj in selection do ( for j = obj.modifiers.count to 1 by -1 where superClassOf obj.modifiers[j] == SpaceWarpModifier do ( deleteModifier obj j noBoundObj = false ) ) ) if noBoundObj do ( messageBox "No SW-Bound objects found" ) ) --------------- user interface ----------------------------------------------------- try(destroyDialog wcRollout) catch() --kill any existing instances of rollout to start fresh rollout wcRollout "Warp Control" width:228 height:54 ( button button_remove "REMOVE!" pos:[4,20] width:70 height:20 enabled:true toolTip:"removes SW bindings" radiobuttons radioBtn_range " operate on:" pos:[86,1] width:65 height:40 labels:#("ALL", "Selected") default:2 columns:1 button button_wtON "warps -ON-" pos:[160,10] width:64 height:16 enabled:true toolTip:"activate space warp bindings" button button_wtOFF "warps -OFF-" pos:[160,32] width:64 height:16 enabled:true toolTip:"de-activate space warp bindings" on button_wtON pressed do ( setWarpState radioBtn_range.state ON ) on button_wtOFF pressed do ( setWarpState radioBtn_range.state OFF ) on button_remove pressed do ( with undo label:"remove SW bindings" ON removeWarpBindings radioBtn_range.state ) ) createDialog wcRollout width:230 height:56 pos:[360, 220] style:#(#style_titlebar, #style_border, #style_sysmenu, #style_minimizebox) )