ZBrushCentral

3D layer scripting reference?

Is there any reference to the available commands dealing with 3d Layers? I checked the wiki and the “advanced scripters” section too. The only info I could find was from this thread: http://www.zbrushcentral.com/showthread.php?t=46024

and it wasn’t very helpful for what I am trying to do.

There are no specific 3D Layers zscript commands. Scripting for layers can be a bit tricky but if you say what you are trying to do I will help if I can.

Yea they sure are tricky.

Right now I am just trying to get information about the current live layer and I can’t seem to figure that out.

Ultimately what I want is: If the layer has polypaint, turn off record mode, mask by intensity, invert the mask. The mask and invert part is easy… I just cant seem to figure out how to manipulate the current layer.

Here’s a way to get the information you want:


[VarSet,layerName,[IGetTitle,"Tool:Layers:Layer Intensity"]]			
[VarSet,layerPath,[StrMerge,"Tool:Layers:",#layerName]]				
[VarSet,layerInfo,[IGetInfo,layerPath]]
//turn off recording
[ISet,Tool:Layers:Layer Intensity,0]
[ISet,Tool:Layers:Layer Intensity,1]				
[If,([StrFind, "PolyPaint (Empty)",layerInfo]== -1),//we've got some polypaint				
   [IPress,Tool:Masking:Mask By Intensity]
   [IPress,Tool:Masking:Inverse]			
]

However note that there’s a drawback - this will only work if the layers have different names. If the layers have the same names then the ‘layerPath’ will be the first layer and so the ‘layerInfo’ will be for that, not the selected layer.

This is amazing!

See the information like “Layer Intensity” were the types of things I was looking for in the original post. There is no Layer information anywhere on the wiki that I could find.

On a separate note I am not seeing the drawback you described (which is cool!) If I have multiple layers with or without the same name it still masks all viable PolyPaint. Unless I am confused on what the issue is?

Well if it works for you good! But I suspect you will come across the issue sooner or later.