ZBrushCentral

Dynamically hiding or removing UI buttons for custom Zscripts

I noticed that it is possible to dynamically rename UI buttons through commands in the ZFileUtils. However I have found myself in need of Adding or Subtracting UI buttons and I’m not sure if this can be done…

Basically my script needs to crawl a specified directory and create a UI button for each OBJ found within that directory (it would also rename the UI button to the title of that same OBJ).

Preferably I would create and destroy buttons accordingly but if this is not possible I could always hard code say 100 buttons and then rename them after crawling the directory, this would leave me with a large number of unused buttons which need to be hidden so that the UI only shows Buttons tied to an existing OBJ.

Any Input on this would be greatly appreciated!

The way to do this is like the font list for the Text 3D plugin or the ZCameras in the Draw palette. You can add/remove easily from the list. The ZFileUtils documentation for “Dropdown menu” shows you how to do it. There’s also a function for getting the files in a folder.