Notifications
Clear all

[Closed] Get UV Area Ratio XY and Scale

Hey,

Is it somehow possible to calculate and compare the uv area ratio to the geometry area ratio.
Im trying to find a way of how I can scale the islands in the unwrap so they end up with the correct XY ratio to avoid any stretched 1:1 textures.
In some cases it could also be interesting to get the area and scale them to 2:1 ratio or what the user

I have looked into the unwrap.getarea but it feels like it cant be used for this purpose?

1 Reply

Is it somehow possible to calculate and compare the uv area ratio to the geometry area ratio.

as uv is unitary i.e usually in the range 0 to 1, the ratio you are looking is the Island geometry coordinate within it’s bounds. That is the bottom left of the island bounding box would be [0,0] and top right [1,1];

possibly something like

u =  pos.x/(max.x - min.x) 
v = pos.y/(max.y- min.y)