UV: disable best fit rotation of all islands at end of UV packing

This has a tendency to place islands diagonally in the image which is
not usually wanted, even if it's maximimizing the number of pixels for
the island.

Fix #109906: UV unwrap packs island diagonally instead of straight

Pull Request: https://projects.blender.org/blender/blender/pulls/112295
This commit is contained in:
Brecht Van Lommel
2023-09-12 15:24:03 +02:00
parent f014e44e8b
commit d4cc0d02cb

View File

@@ -1919,8 +1919,10 @@ static float pack_islands_scale_margin(const Span<PackIsland *> islands,
/* At this stage, `extent` contains the fast/optimal/box_pack/xatlas UVs. */
if (all_can_rotate) {
/* Attempt to improve the layout even further by finding the minimal-bounding-square. */
/* If more islands remain to be packed, attempt to improve the layout further by finding the
* minimal-bounding-square. Disabled for other cases as users often prefer to avoid diagonal
* islands. */
if (all_can_rotate && aabbs.size() > slow_aabbs.size()) {
rotate_inside_square(slow_aabbs, islands, params, scale, margin, r_phis, &extent);
}