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-10-13 13:06:52 +0300
committerChris Blackbourn <chrisbblend@gmail.com>2022-10-13 13:07:12 +0300
commit4767a8eb4aae460ecbee8e6c3eacf4aa81a24c07 (patch)
treeba9e36d916afed5afcdce7b0c9088eccaa406b50 /source/blender/editors/uvedit/uvedit_islands.cc
parent057e99d6dfc3b2bed70be24ebe28724bc6dca7f2 (diff)
Cleanup: simplify uv packing api
Affects paint.add_simple_uvs No user visible changes. Differential Revision: https://developer.blender.org/D16231
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_islands.cc')
-rw-r--r--source/blender/editors/uvedit/uvedit_islands.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/uvedit/uvedit_islands.cc b/source/blender/editors/uvedit/uvedit_islands.cc
index 4009447ba7e..bdd05b06d94 100644
--- a/source/blender/editors/uvedit/uvedit_islands.cc
+++ b/source/blender/editors/uvedit/uvedit_islands.cc
@@ -609,6 +609,7 @@ static BoxPack *pack_islands_params(const blender::Vector<FaceIsland *> &island_
void ED_uvedit_pack_islands_multi(const Scene *scene,
Object **objects,
const uint objects_len,
+ BMesh **bmesh_override,
const struct UVMapUDIM_Params *udim_params,
const struct UVPackIsland_Params *params)
{
@@ -616,9 +617,17 @@ void ED_uvedit_pack_islands_multi(const Scene *scene,
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- BMEditMesh *em = BKE_editmesh_from_object(obedit);
-
- const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
+ BMesh *bm = nullptr;
+ if (bmesh_override) {
+ /* Note: obedit is still required for aspect ratio and ID_RECALC_GEOMETRY. */
+ bm = bmesh_override[ob_index];
+ }
+ else {
+ BMEditMesh *em = BKE_editmesh_from_object(obedit);
+ bm = em->bm;
+ }
+ BLI_assert(bm);
+ const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
if (cd_loop_uv_offset == -1) {
continue;
}
@@ -634,7 +643,7 @@ void ED_uvedit_pack_islands_multi(const Scene *scene,
ListBase island_list = {nullptr};
bm_mesh_calc_uv_islands(scene,
- em->bm,
+ bm,
&island_list,
params->only_selected_faces,
params->only_selected_uvs,