ZBrushCentral

Question: Tapping Ctrl+click on mesh to mask entire polygroup?

Apologies if this is beyond Zscripts, but similar to how Ctrl+Shift+tap hides polygroups, I was curious if it’s possible to customize Mask brushes so Ctrl+tap masks polygroups.

Conventionally, switching to Gizmo then Ctrl+tap is an issue for me since it destroys the gizmo orientation (i.e. screenshot below). I had to resort to Ctrl+shift+tap, Ctrl+tap off mesh, ctrl+shift+tap off mesh, Ctrl+tap off mesh again.

Usually I manage to record and edit personal macros but I’m a bit lost on this one:

[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,2020]
[CanvasStroke,(ZObjStrokeV03n2%p1EFD8B8p2A67038PnDF2Dn-4768n6718s22B6E98s22B6E98s22B6E98z7180=YH2B3V2E3K3XH2B3V2E3)]
[CanvasStroke,(ZObjStrokeV03n2%p1EFD8B8p2A67038PnDF2Dn-4768n6718s22B6E98s22B6E98s22B6E98z7180=YH32CV280K2XH32CV280)]
[CanvasStroke,(ZObjStrokeV03n2%p1EFD8B8p2A67038PnDF2Dn-4768n6718s22B6E98s22B6E98s22B6E98z7180=YH316V28EK3XH316V28E)]
[CanvasStroke,(ZObjStrokeV03n2%p1EFD8B8p2A67038PnDF2Dn-4768n6718s22B6E98s22B6E98s22B6E98z7180=YH316V28EK2XH316V28E)]
]

It’s not possible to customize brush behaviour like that. The best you can do with zscripting is to create a button that works with a hotkey. Here’s the code for a macro:

[IButton,???,"Mask polygroup under cursor",
	[IFreeze,
		[If,[IExists,Tool:Masking:MaskAll],	
			[IKeyPress,256+512,[IClick,1004,[MouseHPos],[MouseVPos]]]
			[IPress,Tool:Masking:MaskAll]
			[IPress,Tool:Visibility:ShowPt]
		]
	]
]

Copy the code to a text file and save to the ZStartup\Macros\Misc folder. Then start ZBrush and assign a hotkey to the button, which will have the name of the file name you chose and will be in the Macro palette. Place the cursor over a polygroup and press the hotkey.

HTH,
Marcus

1 Like

Marcus to the rescue once again! Thanks, will try that out. :smile:

1 Like