UV: Improve UV Packing efficiency with non-square aspect ratio #105784

Merged
Chris Blackbourn merged 3 commits from Chris_Blackbourn/blender:uv-pack-aspect-ratio into main 2023-03-15 21:29:43 +01:00

Improve pre-conditioning of UV Islands before passing them to the UV Packing API.

Improve pre-conditioning of UV Islands before passing them to the UV Packing API.
Chris Blackbourn added 1 commit 2023-03-15 06:56:01 +01:00
6b6b3261e5 UV: Improve UV Packer for non-square aspect ratios.
When packing UVs on non-square materials, care must be taken when
rotating to maintain the original aspect ratio.

In this change:
 * Improve packing efficiency on non-square materials.
 * Add aspect ratio in UV Packing API.
 * Add output angle to UV Packing API for future use.
Chris Blackbourn requested review from Brecht Van Lommel 2023-03-15 06:56:25 +01:00
Chris Blackbourn requested review from Campbell Barton 2023-03-15 06:56:26 +01:00

This seems fine, prefer not to add angle though (can be added when it's used).

This seems fine, prefer not to add angle though (can be added when it's used).
Campbell Barton approved these changes 2023-03-15 08:07:00 +01:00
Brecht Van Lommel requested changes 2023-03-15 09:55:34 +01:00
Brecht Van Lommel left a comment
Owner

I don't think we should be adding members for future use, add them as part of implementing the functionality. Doing so risks leaving in unused things in the API.

But also, it makes it hard to review the correctness of the next pull request that actually uses it, or where the conclusion may be this is not the correct approach.

I don't think we should be adding members for future use, add them as part of implementing the functionality. Doing so risks leaving in unused things in the API. But also, it makes it hard to review the correctness of the next pull request that actually uses it, or where the conclusion may be this is not the correct approach.
@ -1187,3 +1187,3 @@
float size[2];
sub_v2_v2v2(size, bounds_max, bounds_min);
if (size[1] < size[0]) {
if (size[1] < size[0] * (aspect_y * aspect_y)) {

What is the meaning of the squared aspect ratio here? Deserves a comment if this is correct.

What is the meaning of the squared aspect ratio here? Deserves a comment if this is correct.
Chris Blackbourn added 1 commit 2023-03-15 11:20:04 +01:00
9f7ae89e5c UV: Improve UV Packing efficiency with non-square aspect ratio
Improve pre-conditioning of UV Islands before passing them to the
UV Packing API.
Chris Blackbourn changed title from UV: Improve UV Packer for non-square aspect ratios. to UV: Improve UV Packing efficiency with non-square aspect ratio 2023-03-15 11:21:18 +01:00
Brecht Van Lommel approved these changes 2023-03-15 13:13:36 +01:00
@ -1185,2 +1187,4 @@
}
/* "Stand-up" islands, corresponding to "step b)" of
* https://twitter.com/pixelmager/status/1434847825955852291

Don't add twitter links in Blender code, you can mention it in the pull request description instead.

Don't add twitter links in Blender code, you can mention it in the pull request description instead.
Chris Blackbourn added 1 commit 2023-03-15 21:17:45 +01:00
442fafbd7b UV: Improve UV Packing efficiency with non-square aspect ratio
Improve pre-conditioning of UV Islands before passing them to the
UV Packing API.
Chris Blackbourn merged commit c38fe87127 into main 2023-03-15 21:29:43 +01:00
Chris Blackbourn deleted branch uv-pack-aspect-ratio 2023-03-15 21:29:44 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#105784
No description provided.