UV Export: add option to export UV tiles #104940
No reviewers
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104940
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "pioverfour/blender-addons:dp_export_uv_udim"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tiles can now be exported, with either the UDIM or UVTILE numbering
scheme.
Exporters for PNG, SVG and EPS were updated. The vector formats simply
offset the view, so all UVs can end up being exported multiple times.
Only tiles containing UV points will be exported. In theory, this may
result in some polygons being ignored, if they cross a whole otherwise
empty tile, but this should not happen in practice.
Fixes #74325
Ah, thanks for picking this task up! I should have done so when adding the UDIM and UVTILE patterns last year. Left 2 comments to consider but functionally it works well on some simple setups as well as the "Monster - UDIM" demo file.
@ -57,0 +62,4 @@
('UDIM', "UDIM",
"Export tiles in the UDIM notation: 1001 + u-tile + 10*v-tile"),
('UV', "UV Tiles",
"Export tiles in the UV notation: u(u-tile + 1)_v(v-tile + 1)"),
I wonder if we should be more descriptive here? Maybe call the items "UDIM format" and "UVTILE format" as these are the 2 formats that both Blender and MaterialX supports and their names are somewhat known in the ecosystem [1]. Also because there's another "uvtile format" (lowercase) which is slightly different [2]
[1] https://materialx.org/assets/MaterialX.v1.38.Spec.pdf (Page 18)
[2] https://openimageio.readthedocs.io/en/v2.5.4.0/texturesys.html#udim-texture-atlases
Thanks, I wasn’t aware of that! I agree that “UVTILE” should be used instead of “UV Tiles”, but I’m not sure about adding “Format”, it seems redundant to me for the label. From your link, OIIO seems to call these “numbering schemes”, which is more descriptive than “notation”.
How about:
@ -164,0 +210,4 @@
tiles = set()
for poly in polygon_data:
for uv in poly[0]:
tiles.add((floor(uv[0]), floor(uv[1])))
There's a small gotcha here in that UV coords that "touch" the upper edge or the right edge of a tile might be categorized as existing in the tile above or to the right of its "real" tile. I.e. export the default Cube in UDIM layout and you'll get 2 tiles, 1001 and 1011.
You can mimic what's done in Cycles here to lie about such UV coords: https://projects.blender.org/blender/blender/blame/branch/main/intern/cycles/scene/attribute.cpp#L461
This works well on the cube!
Looks good to me.