ZBrushCentral

Scripting help: Toggle for Move & Gizmo 3D

Would anyone know how to go about making a script to toggle the Move, using the Transpose Line, and Gizmo 3D tool? AFAIK we need to first access any of the M/R/S tools and only then we’re able to toggle the Gizmo 3D by pressing Y (or the respective UI button). I’m trying to simplify this multiple-keys process into one key.

If anyone has any pointers on where I could read for writing this or any similar scripts I could Frankenstein, would be highly appreciated.

I think I found the commands needed for this. Now I just need to figure out how to put this properly in an If statement, and how to check if the move Tool is active or not:

If the move Tool is not currently active … [IPress,Transform:Move]
If it is active … toggle through [IPress,Transform:Gizmo 3D] & [IUnPress,Transform:Gizmo 3D]

[If,/*check if Move Tools is inactive...*/,

[IPress,Transform:Move]

,//else

/*toggle through [IPress,Transform:Gizmo 3D] & [IUnPress,Transform:Gizmo 3D]*/

]//end of if command

1 Like

Here’s what I think you are after:

[IButton,???,"Toggle Gizmo",
	
	[If,[IGet,Transform:Move]==0,
		[IPress,Transform:Move]
		,//else
		/*toggle through [IPress,Transform:Gizmo 3D] & [IUnPress,Transform:Gizmo 3D]*/
		[If,[IGet,Transform:Gizmo 3D],
			[IUnPress,Transform:Gizmo 3D]
			,
			[IPress,Transform:Gizmo 3D]
		]
	]//end of if command

]//end of macro

If you save this as a text file to the ZBrush 2021\ZStartup\Macros\Misc folder it will load as a macro.

For switches like Move mode, using [IGet will return ‘1’ if it is ON and ‘0’ if it is off. We can treat 1 as true which is why I haven’t specified a value in the line [If,[IGet,Transform:Gizmo 3D],
I’ve put a value in the line [If,[IGet,Transform:Move]==0,because we want to know that Move is off and so the statement has to equal true.

HTH,
Marcus

1 Like

That was exactly what I was looking for Marcus, thank you! Based on your script, I also created similar ones for the Rotate and Scale tool, though with a slight tweak to adjust to my preferences. Thank you again!

1 Like