Fix T44915 vertex color lost when adding new layer in edit mode.

Was copying new layer colors to old layer colors.
This commit is contained in:
Antonis Ryakiotakis 2015-06-01 19:06:46 +02:00
parent 893677a76a
commit 7173069cbe
Notes: blender-bot 2023-02-14 09:17:57 +01:00
Referenced by issue #44915, Adding vertex color layer in edit mode destroys the active color layer data
1 changed files with 1 additions and 1 deletions

View File

@ -429,7 +429,7 @@ int ED_mesh_color_add(Mesh *me, const char *name, const bool active_set)
/* copy data from active vertex color layer */
if (layernum) {
const int layernum_dst = CustomData_get_active_layer(&em->bm->ldata, CD_MLOOPCOL);
BM_data_layer_copy(em->bm, &em->bm->ldata, CD_MLOOPCOL, layernum, layernum_dst);
BM_data_layer_copy(em->bm, &em->bm->ldata, CD_MLOOPCOL, layernum_dst, layernum);
}
if (active_set || layernum == 0) {
CustomData_set_layer_active(&em->bm->ldata, CD_MLOOPCOL, layernum);