shift+toolbar button click question

hello
i have toolbar button which toggle Vertex Ticks on selected objects. how could i add shift+button click action to OFF vertex ticks on all selected objects instead toggle it

--------------------------------

macroScript vertTicksToggle category:"_harumscarum" buttonText:"vtToggle" tooltip:"Vertex TicksToggle"
(
fn filt obj = isKindOf obj GeometryClass or isKindOf obj shape
if selection.count != 0 do
(
for o in selection where filt o do o.vertexticks = not o.vertexticks
)
)

Comments

Comment viewing options

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

.

You can't do it with Shift button, but you can do it with Alt button. Check maxscript help file for:

on altExecute

But your script should works as toggle - run it once to show verts ticks, run it again to turn vertex ticks off. I have the script that I use to turn on/off vertex ticks.

(
	on isEnabled return selection.count != 0
	on execute do 
	(
		try
		(
			for o in selection do o.vertexTicks = not o.vertexTicks
		)catch()
	)
)

No need for altExecute or any other action.

hummus's picture

Does altExecute work with ToolBar buttons?

I checked the altExecute documentation and it mentions working on Quadmenus but doesn't specify toolbar buttons, and when I tried it on a toolbar button I got no affect.
Is it possible to use Alt+Click on toolbar buttons, and if so - can you show an example of that working?

Thanks.

Comment viewing options

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