disable (Off) all modifiers on selected objects

need simple hotkey script to disable (make it Off) all modifiers on selected objects
appreciate any help

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
j3dj3d's picture

Can't get this to work in 2016 sp2

Hi,

Tried this and no command panel comes up in 3ds max 2016.

Thanks for any help.

barigazy's picture

...

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)
		)
	)	
)

barigazy

j3dj3d's picture

Thanks you. Working in 2016 sp2 as well.

Very handy. Now on my toolbar. Thanks again.

barigazy's picture

...

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)
)

barigazy

harumscarum's picture

thank you very much.

thank you very much. could it be even simplier - hotkey toggle?

harumscarum's picture

thanks!

but it work only in one way - to ON all modifiers

barigazy's picture

...

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

barigazy's picture

...

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 

barigazy

harumscarum's picture

thank you very much!

thanks! work like a charm. is it possible to make it as toggle on/off?

barigazy's picture

...

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

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.