ZBrushCentral

Question: displacement script

I’m completely new to scripting in ZB, but not to scripting in general and was looking for a script examples that deal with reading a texture as an input, modifying poly paint colors, and displacing meshes. I’ve created a substance that adds a wood grain projection to a UV mapped mesh (video) and similar shaders for Unity and Unreal that work in local space. In the end I’d like to create a script for Zbrush that does the same, without a dependence on UV coordinates.

Thanks for the help.

So, Do you want to create the texture using polypaint and then make a displacement based on the texture intensity?

For the second part, if you already have the polypaint, why not make a “Mask by intensity” and then a little bit of inflate deformation?

The inflate / deflate by polypaint sounds like a good idea. Basically what I’m trying to do is project a wood grain texture to a mesh based on a formula.

I would need to:
-iterate through each vertex in the mesh and get its world position
-math based on vert position and a wood grain input texture
-apply that value to the mesh as polypaint.
-Inflate / deflate the mesh as you stated

My current workflow requires uv mapping the mesh and projecting the texture in Substance Designer. While this is fine for most meshes it can introduce artifacts due to uv texture size limitations and seams. It’s also fairly difficult to uv unwrap meshes generated in CAD programs. The end goal is to remove the uv mapping problem from the workflow entirely.