UV Export: add option to export UV tiles #104940

Merged
Damien Picard merged 4 commits from pioverfour/blender-addons:dp_export_uv_udim into main 2023-10-09 22:32:24 +02:00
Showing only changes of commit aca4e34fb9 - Show all commits

View File

@ -213,11 +213,11 @@ class ExportUVLayout(bpy.types.Operator):
# Ignore UVs at corners - precisely touching the right or upper edge
# of a tile should not load its right/upper neighbor as well.
# From intern/cycles/scene/attribute.cpp
u, v = (uv[0], uv[1])
x, y = (floor(u), floor(v))
if (x > 0 and (u < x + 1e-6)):
u, v = uv[0], uv[1]
x, y = floor(u), floor(v)
if x > 0 and u < x + 1e-6:
x -= 1
if (y > 0 and (v < y + 1e-6)):
if y > 0 and v < y + 1e-6:
y -= 1
tiles.add((x, y))
return tiles