how to rename 3D layers


aaaaa chrome crashed,second time I’m writing this post hope it is not going to appear double hahha

Soo, i’m new in scripting but i’m already in love with it
i’m about to finish a plugin but i got stuck renaming 3d layers
i would like to create a zscript that create always the same 5 layers with the same 5 names
nothing variable and no custom keys i would like just always the same 5 layers

I found this super useful post from marcus_civis
if you are going to read it,thank you for adding also the txt file on it
but hard to say i’m definitively to noob in scripting to extract what i need from it :laughing:small_orange_diamond:cry:small_orange_diamond:laughing:

thank you

The attached zscript will show you how to do it. It uses the ZFileUtils that you have the link to.

The CheckSystem routine is important because it checks for the DLL file and assigns the correct path to the dllPath variable. If you change the name of the MyPluginData folder (which has the DLL files) make sure you edit the CheckSystem routine correctly.

There’s an odd thing that ZBrush does with the names you are using, where the first two layers change the names v1 to V1 and v2 to V2. rec gets changed to Rec as well. I don’t think there’s a way around this.

As you’re new to zscripting try and understand what the code is doing. Simply cutting-and-pasting invariably leads to errors sooner or later.

wow, so fast!!

thank you very much marcus_civis i will try it as soon as i will arrive at home!!
but looking at the script i was pretty far from the solution :laughing:small_orange_diamond:laughing:

will do!!
before study it, and change the path(if i will need it)
at the moment i just have to copy the files
.dll and .lib on
C:\Program Files\Pixologic\ZBrush 4R8\ZStartup\ZPlugs64\MyPluginData
and run the script right?

thank you again


You don’t need to install the example - it’s not a plugin:

  1. Unzip the file to your Desktop. The unzipping may create a folder, that’s OK. Inside should be the CreateLayers.txt file and the MyPluginData folder (with two files inside). Leave everything as it is.
  2. Start ZBrush.
  3. Press the Load button in the Zscript palette.
  4. From the Open dialog, navigate to your Desktop and select the CreateLayers.txt file. ZBrush will load the script.
  5. The button will be at the bottom of the interface in the ZScript Window. Press ‘H’ on the keyboard to show it.
  6. With a 3D model selected in the Tool palette, press the button.

ook thanks, perfect!!
it works like a charm!!

thank you again