Scripting with ProBuilder - controlling UVs

Hi !
I’ve recently learned how to script extrusions and create PB objects from scratch.
Now I’d like to control the UVs, face by face, and I can’t figure out how to do this through code. Getting a bit lost between SetUV(), pb_UV, pbUVOps
For example, I want one specific face to be :

  • tiled
  • anchored at middle center
  • have an Y offset
  • flip U
  • and so on…

How would I translate this into script ?
Thanx for any help.

You’d do this by setting the auto uv parameters on the face. Ex:

var face = pb.faces[0];
face.uv.flipU = true;
face.uv.fill = Fill.Tile;
// Rebuild the UVs
pb.Refresh();
2 Likes

That was exactly what I was looking for. Thanx a lot @kaarrrllll ll !