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/sculpt_paint/sculpt_uv.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/sculpt_paint/sculpt_uv.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 2e2abd30ea2..14b06f888fe 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -518,13 +518,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
/* Count 'unique' UV's */
int unique_uvs = data->elementMap->total_unique_uvs;
if (do_island_optimization) {
- unique_uvs = 0;
- for (int i = 0; i < data->elementMap->total_uvs; i++) {
- if (data->elementMap->storage[i].separate &&
- (data->elementMap->storage[i].island == island_index)) {
- unique_uvs++;
- }
- }
+ unique_uvs = data->elementMap->island_total_unique_uvs[island_index];
}
/* Allocate the unique uv buffers */
@@ -572,6 +566,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
uniqueUv[element - data->elementMap->storage] = counter;
}
}
+ BLI_assert(counter + 1 == unique_uvs);
/* Now, on to generate our uv connectivity data */
counter = 0;