need simple hotkey script to disable (make it Off) all modifiers on selected objects
appreciate any help
Forum topic · Scripts Wanted
disable (Off) all modifiers on selected objects
By harumscarum · 2014-12-26
Description
Comments (10)
Can't get this to work in 2016 sp2
j3dj3d · 2016-06-10
Hi,
Tried this and no command panel comes up in 3ds max 2016.
Thanks for any help.
barigazy · 2016-06-11
Works fine in max2017
Try this version. Run this macro and in the category "bgaTools" drag n drop this on your toolbar. When you hold SHIFT and press this button all modifiers of selected object will turn on else on single click will turn off
macroScript ModsOnOff category:"bgaTools" toolTip:"ModsOnOff"
(
if selection.count == 0 then messagebox "Select some object first!" title:"Warning" beep:off else
(
local modpanel = GetCommandPanelTaskMode()
with undo off with redraw off
(
for o in selection where o.modifiers.count > 0 do o.modifiers.enabled = keyboard.shiftPressed
if modpanel == #create then (setCommandPanelTaskMode #modify ; setCommandPanelTaskMode #create)
else (setCommandPanelTaskMode #create ; setCommandPanelTaskMode #modify)
)
)
)
Thanks you. Working in 2016 sp2 as well.
j3dj3d · 2016-06-12
Very handy. Now on my toolbar. Thanks again.
barigazy · 2014-12-26
Yup. Create two macros from this code
-- TURN ON MODIFIERS
if selection.count == 0 then messagebox "Select some object first!" title:"Warning" beep:off else
(
name = GetCommandPanelTaskMode()
for o in selection where o.modifiers.count > 0 do o.modifiers.enabled = on
if name == #create then (setCommandPanelTaskMode #modify ; setCommandPanelTaskMode #create)
else (setCommandPanelTaskMode #create ; setCommandPanelTaskMode #modify)
)
and this code
-- TURN OFF MODIFIERS
if selection.count == 0 then messagebox "Select some object first!" title:"Warning" beep:off else
(
name = GetCommandPanelTaskMode()
for o in selection where o.modifiers.count > 0 do o.modifiers.enabled = off
if name == #create then (setCommandPanelTaskMode #modify ; setCommandPanelTaskMode #create)
else (setCommandPanelTaskMode #create ; setCommandPanelTaskMode #modify)
)
harumscarum · 2014-12-26
thank you very much. could it be even simplier - hotkey toggle?
thanks!
harumscarum · 2014-12-26
but it work only in one way - to ON all modifiers
barigazy · 2014-12-26
No. Works in both ways. You need to use each FN separately.
Anyway here is the tool
try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "on | off"
(
fn toggleMods objs mode:on =
(
if objs.count == 0 then messagebox "Select some object first!" title:"Warning" beep:off else
(
name = GetCommandPanelTaskMode()
for o in objs where o.modifiers.count > 0 do o.modifiers.enabled = mode
if name == #create then (setCommandPanelTaskMode #modify ; setCommandPanelTaskMode #create)
else (setCommandPanelTaskMode #create ; setCommandPanelTaskMode #modify)
)
)
button btn_on "TurnOn" pos:[5,5] width:45 height:18
button btn_off "TurnOff" pos:[55,5] width:45 height:18
on btn_on pressed do toggleMods selection
on btn_off pressed do toggleMods selection mode:off
)
createDialog bgaRoll 105 28 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
barigazy · 2014-12-26
fn toggleMods objs mode:on =
(
if objs.count == 0 then messagebox "Select some object first!" title:"Warning" beep:off else
(
name = GetCommandPanelTaskMode()
for o in objs where o.modifiers.count > 0 do
(
for m = 1 to o.modifiers.count do o.modifiers[m].enabled = mode
)
if name == #create then (setCommandPanelTaskMode #modify ; setCommandPanelTaskMode #create)
else (setCommandPanelTaskMode #create ; setCommandPanelTaskMode #modify)
)
)
-- turn off all modifiers
toggleMods selection mode:off
-- turn on all modifiers
toggleMods selection
thank you very much!
harumscarum · 2014-12-26
thanks! work like a charm. is it possible to make it as toggle on/off?
barigazy · 2014-12-26
for o in selection where o.modifiers.count > 0 do
for m = 1 to o.modifiers.count do o.modifiers[m].enabled = off
max create mode