diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2021-04-02 15:44:26 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2021-04-02 15:44:26 +0300 |
commit | fa9b05149c2ca3915a4fb2670c87a648d927336c (patch) | |
tree | cd7e57cc72697b62260297b993507ff79a6114a9 /source/blender/makesdna/DNA_mesh_types.h | |
parent | e7a0a75919fd2e33869b4b8efbf0e69bf5904ea7 (diff) |
Fix T84520: Make the different weight paint code paths exclusive to each other
Before this change, you could have the new sculpt symmetry code and the
older weight paint symmetry code active at the same time. This would
lead to users easily trashing their weigh paint data if they were not
careful when switching between modes.
Now the specific weight paint symmetry code is an exclusive toggle so
the user can't accidentally mirror strokes and vertex groups at the same
time. This also paves the way of supporting Y and Z symmetry in the
future for weight groups mirroring if we decide to add it in the future.
Reviewed By: Sybren
Differential Revision: http://developer.blender.org/D10426
Diffstat (limited to 'source/blender/makesdna/DNA_mesh_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index af20a63b907..23323a36250 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -263,7 +263,7 @@ enum { /* me->editflag */ enum { - ME_EDIT_VERTEX_GROUPS_X_SYMMETRY = 1 << 0, + ME_EDIT_MIRROR_VERTEX_GROUPS = 1 << 0, ME_EDIT_MIRROR_Y = 1 << 1, /* unused so far */ ME_EDIT_MIRROR_Z = 1 << 2, /* unused so far */ @@ -272,12 +272,16 @@ enum { ME_EDIT_PAINT_VERT_SEL = 1 << 5, }; -/* we cant have both flags enabled at once, +/* Helper macro to see if vertex group X mirror is on. */ +#define ME_USING_MIRROR_X_VERTEX_GROUPS(_me) \ + (((_me)->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) && ((_me)->symmetry & ME_SYMMETRY_X)) + +/* We cant have both flags enabled at once, * flags defined in DNA_scene_types.h */ #define ME_EDIT_PAINT_SEL_MODE(_me) \ - (((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? \ - SCE_SELECT_FACE : \ - ((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : 0) + (((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? SCE_SELECT_FACE : \ + ((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : \ + 0) /* me->flag */ enum { |