[Bf-blender-cvs] [881cdbf8853] refactor-mesh-uv-map-generic: Merge branch 'master' into refactor-mesh-uv-map-generic
Martijn Versteegh
noreply at git.blender.org
Fri Oct 28 12:05:48 CEST 2022
Commit: 881cdbf88530415534cf987ad444e4c265421ff6
Author: Martijn Versteegh
Date: Wed Oct 26 20:17:24 2022 +0200
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rB881cdbf88530415534cf987ad444e4c265421ff6
Merge branch 'master' into refactor-mesh-uv-map-generic
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/properties_data_mesh.py
index 36d2c4af406,a6b97fbdc85..77fe1ba9200
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@@ -594,8 -594,12 +594,11 @@@ class DATA_PT_mesh_attributes(MeshButto
# Built-in names.
{"position": None, "shade_smooth": None, "normal": None, "crease": None},
mesh.attributes,
- ob.vertex_groups,
- mesh.uv_layers,
+ None if ob is None else ob.vertex_groups,
):
+ if collection is None:
+ colliding_names.append("Cannot check for object vertex groups when pinning mesh")
+ continue
for name in collection.keys():
unique_names_len = len(unique_names)
unique_names.add(name)
diff --cc source/blender/blenkernel/intern/mesh_tangent.cc
index 9964f217830,49ea23a1552..3e24cc9e39b
--- a/source/blender/blenkernel/intern/mesh_tangent.cc
+++ b/source/blender/blenkernel/intern/mesh_tangent.cc
@@@ -570,11 -567,9 +570,9 @@@ void BKE_mesh_calc_loop_tangent_ex(cons
void BKE_mesh_calc_loop_tangents(Mesh *me_eval,
bool calc_active_tangent,
- const char (*tangent_names)[MAX_NAME],
+ const char (*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME],
int tangent_names_len)
{
- BKE_mesh_runtime_looptri_ensure(me_eval);
-
/* TODO(@campbellbarton): store in Mesh.runtime to avoid recalculation. */
short tangent_mask = 0;
BKE_mesh_calc_loop_tangent_ex(
diff --cc source/blender/blenloader/intern/versioning_defaults.cc
index f9179bc7b34,da23e9cb49f..9593b519852
--- a/source/blender/blenloader/intern/versioning_defaults.cc
+++ b/source/blender/blenloader/intern/versioning_defaults.cc
@@@ -344,8 -349,9 +349,8 @@@ static void blo_update_defaults_scene(M
}
/* Correct default startup UV's. */
- Mesh *me = BLI_findstring(&bmain->meshes, "Cube", offsetof(ID, name) + 2);
+ Mesh *me = static_cast<Mesh *>(BLI_findstring(&bmain->meshes, "Cube", offsetof(ID, name) + 2));
if (me && (me->totloop == 24) && CustomData_has_layer(&me->ldata, CD_MLOOPUV)) {
- MLoopUV *mloopuv = static_cast<MLoopUV *>(CustomData_get_layer(&me->ldata, CD_MLOOPUV));
const float uv_values[24][2] = {
{0.625, 0.50}, {0.875, 0.50}, {0.875, 0.75}, {0.625, 0.75}, {0.375, 0.75}, {0.625, 0.75},
{0.625, 1.00}, {0.375, 1.00}, {0.375, 0.00}, {0.625, 0.00}, {0.625, 0.25}, {0.375, 0.25},
diff --cc source/blender/editors/sculpt_paint/paint_image_proj.c
index 4955fc4afc1,d9aa11a2847..d84aa2b6975
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@@ -4073,9 -4074,9 +4073,9 @@@ static bool proj_paint_state_mesh_eval_
ps->totloop_eval = ps->me_eval->totloop;
ps->mlooptri_eval = BKE_mesh_runtime_looptri_ensure(ps->me_eval);
- ps->totlooptri_eval = ps->me_eval->runtime.looptris.len;
+ ps->totlooptri_eval = BKE_mesh_runtime_looptri_len(ps->me_eval);
- ps->poly_to_loop_uv = MEM_mallocN(ps->totpoly_eval * sizeof(MLoopUV *), "proj_paint_mtfaces");
+ ps->poly_to_loop_uv = MEM_mallocN(ps->totpoly_eval * sizeof(float(*)[2]), "proj_paint_mtfaces");
return true;
}
diff --cc source/blender/editors/uvedit/uvedit_islands.cc
index 5fdc223e23e,92745667505..cc743aaf5d2
--- a/source/blender/editors/uvedit/uvedit_islands.cc
+++ b/source/blender/editors/uvedit/uvedit_islands.cc
@@@ -614,11 -633,18 +631,19 @@@ void ED_uvedit_pack_islands_multi(cons
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- BMEditMesh *em = BKE_editmesh_from_object(obedit);
+ 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) {
+
+ const BMUVOffsets offsets = BM_uv_map_get_offsets(em->bm);
-
+ if (offsets.uv == -1) {
continue;
}
@@@ -639,10 -665,16 +664,16 @@@
params->only_selected_uvs,
params->use_seams,
aspect_y,
- cd_loop_uv_offset);
+ offsets);
- int index;
- LISTBASE_FOREACH_INDEX (struct FaceIsland *, island, &island_list, index) {
+ /* Remove from linked list and append to blender::Vector. */
+ LISTBASE_FOREACH_MUTABLE (struct FaceIsland *, island, &island_list) {
+ BLI_remlink(&island_list, island);
+ if (params->ignore_pinned && island_has_pins(island)) {
+ MEM_freeN(island->faces);
+ MEM_freeN(island);
+ continue;
+ }
island_vector.append(island);
}
}
More information about the Bf-blender-cvs
mailing list