ZBrushCentral

Number of columns and rows in polymesh?

If I initialize an object with a 16x32 HDivide and VDivide and then convert it to a polymesh, how would I later find out the number of columns and rows via script?

I’m guessing the answer may be in Mesh3DGet, but exactly which property I should query I’ve not got a blooming clue.

I wonder if Marcus knows…

:smiley:

splodge,

You’re right, although you can’t find the number of columns/rows, only the number of faces or points. Columns/rows only have relevance while initializing the parametric object.

for faces:


[VarDef,facesCount,0]//variable to store number of faces
[Mesh3DGet,1,,,facesCount]

and for points:


[VarDef,pointsCount,0]//variable to store number of points
[Mesh3DGet,0,,,pointsCount]

Okay, thanks Marcus!

After further thought I’m hoping that the UV Map on a 16x32 object will contain 16x32 points, I’ll look into it. Still, it’s gonna be a lot of work trying to count those points!.

The plan is to automatically set the texture width and height to dimensions that are more suitable to an object. So a 16x128 object will receive a 64x1024 texture and a 16x8 object will get a 1024x512 texture.

Turns out the UV map contains twice the number of points as the mesh.

I worked out the number of columns and rows by counting the UV coords that have a value of 0,n and n,0.

This was done using an external .dll and not the zscript functions. Yes, I cheated… :stuck_out_tongue:

i think that will only work in certain circumstances, when the object has ‘columns’ and ‘rows’ and the UV mapping is appropriate. You also need to allow for the fact that UV mapping rarely uses all the available space.

yep, I only plan to get the number columns and rows of meshes derived from ZBrush tools. All of which use a suitable UV map.

If I have any problems I’ll be back. So please don’t go far!