Fix #79163: Bevel operation produces disconnected UVs #139595.

Fix #79163 bug related to the bevel operation producing disconnected UVs for
new bevel faces. This change replaces previous approach using scattered and
selective usage of functions: bev_merge_uvs, bev_merge_edge_uvs and
bev_merge_end_uvs with one coherent technique for all stages of the bevel operation.
It is utilizing a concept of loop (BMLoop) buckets to keep track of UV vertices
that should be merged at the end of bevel operation by a single call to
bevel_merge_uvs function. This approach doesn't touch initial UV position
calculation done by interpolation algorithm in bev_create_ngon function and
keeps the concept of representative faces (called frep, facerep or rep_face in
code) to help decide to which bucket specific loops should be assigned.

This is from PR https://projects.blender.org/blender/blender/pulls/139595,
which has more explanation and discussion.
This commit is contained in:
Piotr Makal
2025-06-19 09:33:52 -04:00
committed by Howard Trickey
parent eb5d630db1
commit 8412c0b42d
4 changed files with 361 additions and 202 deletions

View File

@@ -52,7 +52,7 @@ def main():
SpecMeshTest('Cube_test_11', 'Cube_test', 'Cube_result_11',
[OperatorSpecEditMode('bevel',
{'offset': 0.4, 'segments': 5, 'profile': 1.0}, 'EDGE', {8, 10, 7}, )]),
SpecMeshTest("test 12", 'Cube_test', 'Cube_result_12',
SpecMeshTest("Cube_test_12", 'Cube_test', 'Cube_result_12',
[OperatorSpecEditMode('bevel',
{'offset': 0.4, 'segments': 8}, 'EDGE',
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, )]),
@@ -217,7 +217,7 @@ def main():
SpecMeshTest('Tray', 'Tray', 'Tray_result_1',
[OperatorSpecEditMode('bevel',
{'offset': 0.01, 'segments': 2}, 'EDGE', {0, 1, 6, 7, 12, 14, 16, 17}, )]),
SpecMeshTest("test 73", 'Bumptop', 'Bumptop_result_1',
SpecMeshTest("Bumptop", 'Bumptop', 'Bumptop_result_1',
[OperatorSpecEditMode('bevel',
{'offset': 0.1, 'segments': 4}, 'EDGE',
{33, 4, 38, 8, 41, 10, 42, 12, 14, 17, 24, 31}, )]),
@@ -228,7 +228,7 @@ def main():
[OperatorSpecEditMode('bevel',
{'offset': 0.05, 'segments': 2}, 'EDGE', {19, 20, 23, 15}, )]),
# 75
SpecMeshTest("test 77", 'Cube_hn_test', 'Cube_hn_result_1',
SpecMeshTest("Cube_hn_test", 'Cube_hn_test', 'Cube_hn_result_1',
[OperatorSpecEditMode('bevel', {'offset': 0.2, 'harden_normals': True}, 'EDGE', {8}, )]),
SpecMeshTest('Blocksteps_test_1', 'Blocksteps_test', 'Blocksteps_result_1',
[OperatorSpecEditMode('bevel',