Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Blackbourn <chrisbblend@gmail.com>2022-08-11 05:18:31 +0300
committerChris Blackbourn <chrisbblend@gmail.com>2022-08-11 05:20:44 +0300
commitf35d671f466da324ebe70eef3edf12bd3b2b63c9 (patch)
treecc2187cd0844b1f6f911c9c9e2cc05cdec4b43d0 /source/blender/editors/uvedit/uvedit_ops.c
parentd52d71b834433c7da3ac671ba965305568d64529 (diff)
Cleanup: refactoring uvislands to prepare for python api
Add element_map->island_total_uvs. Add element_map->island_total_unique_uvs. Simplify callers based on new members. Add comments. Resolves: D15598
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_ops.c')
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 092f0c49d8a..6755630d3ef 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -541,14 +541,11 @@ static bool uvedit_uv_straighten(Scene *scene, BMesh *bm, eUVWeldAlign tool)
}
bool changed = false;
-
- /* Loop backwards to simplify logic. */
- int j1 = element_map->total_uvs;
- for (int i = element_map->totalIslands - 1; i >= 0; --i) {
- int j0 = element_map->islandIndices[i];
- changed |= uvedit_uv_straighten_elements(
- element_map->storage + j0, j1 - j0, cd_loop_uv_offset, tool);
- j1 = j0;
+ for (int i = 0; i < element_map->total_islands; i++) {
+ changed |= uvedit_uv_straighten_elements(element_map->storage + element_map->island_indices[i],
+ element_map->island_total_uvs[i],
+ cd_loop_uv_offset,
+ tool);
}
BM_uv_element_map_free(element_map);