Fix T103051: Changed behavior when removing a material slot

Before f1c0249f34 the material was assigned to the previous
slot rather than the next. Though the behavior is arbitrary, there
is no reason to change it.
This commit is contained in:
Hans Goudey 2022-12-13 13:36:48 -06:00
parent 2c5a525d64
commit bdd34f4fa2
Notes: blender-bot 2023-02-14 03:44:41 +01:00
Referenced by issue #103051, Regression: Deleting a material slot in 3.4 assigns faces to the material below instead of the material above
Referenced by issue #102967, 3.4: Potential candidates for corrective releases
1 changed files with 1 additions and 1 deletions

View File

@ -1363,7 +1363,7 @@ void BKE_mesh_material_index_remove(Mesh *me, short index)
}
MutableVArraySpan<int> indices_span(material_indices.varray);
for (const int i : indices_span.index_range()) {
if (indices_span[i] > 0 && indices_span[i] > index) {
if (indices_span[i] > 0 && indices_span[i] >= index) {
indices_span[i]--;
}
}