Cleanup: Remove macro usage in vertex group mirror operator

Avoiding a few lines of duplication is not worth the
confusion and worse debugging experience of macros.
This commit is contained in:
Hans Goudey 2022-10-12 09:51:37 -05:00
parent a35d5378ad
commit 7e4786503c
1 changed files with 30 additions and 15 deletions

View File

@ -2376,18 +2376,6 @@ void ED_vgroup_mirror(Object *ob,
/* TODO: vgroup locking.
* TODO: face masking. */
#define VGROUP_MIRR_OP \
dvert_mirror_op(dvert, \
dvert_mirr, \
sel, \
sel_mirr, \
flip_map, \
flip_map_len, \
mirror_weights, \
flip_vgroups, \
all_vgroups, \
def_nr)
BMVert *eve, *eve_mirr;
MDeformVert *dvert_mirr;
char sel, sel_mirr;
@ -2452,7 +2440,16 @@ void ED_vgroup_mirror(Object *ob,
dvert_mirr = static_cast<MDeformVert *>(
BM_ELEM_CD_GET_VOID_P(eve_mirr, cd_dvert_offset));
VGROUP_MIRR_OP;
dvert_mirror_op(dvert,
dvert_mirr,
sel,
sel_mirr,
flip_map,
flip_map_len,
mirror_weights,
flip_vgroups,
all_vgroups,
def_nr);
totmirr++;
}
@ -2503,7 +2500,16 @@ void ED_vgroup_mirror(Object *ob,
MDeformVert *dvert = &dverts[vidx];
dvert_mirr = &dverts[vidx_mirr];
VGROUP_MIRR_OP;
dvert_mirror_op(dvert,
dvert_mirr,
sel,
sel_mirr,
flip_map,
flip_map_len,
mirror_weights,
flip_vgroups,
all_vgroups,
def_nr);
totmirr++;
}
@ -2557,7 +2563,16 @@ void ED_vgroup_mirror(Object *ob,
MDeformVert *dvert = &lt->dvert[i1];
dvert_mirr = &lt->dvert[i2];
VGROUP_MIRR_OP;
dvert_mirror_op(dvert,
dvert_mirr,
sel,
sel_mirr,
flip_map,
flip_map_len,
mirror_weights,
flip_vgroups,
all_vgroups,
def_nr);
totmirr++;
}
}