ZBrushCentral

Open subtool folder before deleting the subtool

Hi,

I’ve just lost 1 hr of work because I’ve used my delete subtool hotkey and zBrush deleted the whole folder instead of only the selected subtool (because the folder was closed).

Would it be possible to create a delete macro, which checks if the active subtool is in a closed subtoolFolder and if so, opens that folder before executing the delete subtool command?

I’ve already tried to create it myself, but I have no idea how to open a folder or check if the active folder is open or closed.

Many Thanks
Chris

Hi Chris,

Try this:

[IButton,???,"Delete SubTool",
	[If,[IExists,Tool:SubTool:Delete],		
		[VarSet,folderID,[SubToolGetFolderIndex,[SubToolGetActiveIndex]]]
		[If,folderID>-1,//we have a folder		
			//is folder open?
			[VarSet,folderState,[SubToolGetStatus,folderID]]		
			[If,[Val,folderState]&0x400 == 0x400,//closed folder so open it											
				[SubToolSetStatus,folderID,folderState+0x400]											
			]		
		]
		[IKeyPress,'2',[IPress,Tool:SubTool:Delete]]
	]
,,0.5]

The code above is written as a macro, so save as a txt file to the ZStartup/Macros/Misc folder.

Are you using the “Delete” macro included with ZBrush? Clearly that needs revising to take account of this problem. I’ll see to it for the next update. Thanks for bringing this to my attention!

HTH,
Marcus

1 Like

Thank you Marcus, your script works perfectly!

I used the Delete button under Tools > Subtool > Delete, but mapped to a hotkey.

That’s great, Christian, thanks for letting me know.

Ah, another one that needs updating! Thanks!
-Marcus