ZBrushCentral

Hotkey button secondary actions?

I know how to create hotkeys for basic buttons and alike, for example, shift-F for the polyframe action. But polyframe also has the line and fill toggles so you can see polygroup colors without lines or colored lines without fill. Is there any way to hotkey, macro or script these secondary toggles on a button? It’s not just this button. There are heaps more such as Floor (X,Y,Z), Perspective (Dynamic) etc.

Hi @tobor8man

I’m unaware of a way to hotkey or otherwise relocate the individual button sub-toggles. They don’t appear to exist independently of the main function, though they will work if you toggle them then activate the main button via hotkey.

As far as scripting or a macro, you should check over in the Scripting Help forum to see if @marcus_civis or one of the other scripting experts have an idea about this.


[Edit] In the specific case of the Polyframe toggles, you can hotkey the Fill and Line opacity sliders in Preferences> Draw. This will let you bring up the sliders with a hotkey, and adjust or switch off those aspects of the polyframe.

You can record a macro of the action you want and then edit the text file in Notepad to create a toggle. You can then assign a hotkey to the macro button. Here’s the PolyFrame button as an example:

//ZBrush macro - save to ZBrush 2019.1\ZStartup\Macros\Misc\ folder

[IButton,???,"Cycle Polyframe modes",
	[IShowActions,0]
	[IConfig,2019]
	[IPress,Transform: Pf]
	[Loop,1,
		[If,([IModGet,Transform: Pf]==0),//nothing
			[IModSet,Transform: Pf,1]
			[LoopExit]
		]
		[If,([IModGet,Transform: Pf]==1),//just Line
			[IModSet,Transform: Pf,2]
			[LoopExit]
		]
		[If,([IModGet,Transform: Pf]==2),//just Fill
			[IModSet,Transform: Pf,3]
			[LoopExit]
		]
		[If,([IModGet,Transform: Pf]==3),//Line & Fill
			[IModSet,Transform: Pf,0]
			[LoopExit]
		]
	]    		
,,0.5]//half palette width button

That’s more complex than most because of the two options. Here’s the simpler Draw Size Dynamic mode:

[IButton,???,"Toggle Draw Size Dynamic mode",
[IShowActions,0]
[IConfig,2019]
	[If,([IModGet,Draw:Draw Size]==1),
		[IModSet,Draw:Draw Size,0]
	,
		[IModSet,Draw:Draw Size,1]
	]
,,0.5]//half palette width button

HTH,
Marcus

1 Like

@marcus_cvis
Fantastic! That macro works perfectly. I hotkeyed it to Ctrl-Alt-Shift-A and hooked that up to my programmable keypad. Now I can quickly cycle through the polyframe options faster than I can find the UI button and the smaller mode toggles. I have more scripting questions but I’ll post them in the correct forum.

@Spyndel
Thanks for the intro to marcus and for bringing my attention to the Draw preference.