modify UVs with vex?

   3947   1   0
User Avatar
Member
1184 posts
Joined: April 2017
Offline
Hey!

I have a simple grid and I did a flatten and a layout. Somehow, I can't get the top-right corner of the grid (in UVs)to end precisely at 1, 1. I thought I'd give it a go in Vex.

Doing this sort of thing is easy in 3D. I'd use getbbox_max function, etc. I don't get how to do it on UVs instead of in 3D.

Any help is appreciated!

-Olivier
User Avatar
Member
1184 posts
Joined: April 2017
Offline
Ok!

So, I moved my grid in positive values (in the 3D viewport) with this point wrangle:

vector min = getbbox_min(0);

@P -= min;

…And transferred the point positions to the vertex UVs by using a vertex wrangle:

v@vertP = point(0, "P", @ptnum);

@uv = set(@vertP.x, @vertP.y, 0);

…Now, the UVs are perfectly from 0 to 1 just like in the 3D viewport!

-Olivier

Attachments:
use_position_as_uvs.JPG (46.8 KB)

  • Quick Links