Cleanup/Refactor: Unify similar flags

This commit is contained in:
Germano Cavalcante 2021-04-24 11:24:53 -03:00
parent f8d5d03ebc
commit b6542f71e1
5 changed files with 13 additions and 15 deletions

View File

@ -88,12 +88,11 @@ typedef enum {
CTX_TEXTURE_SPACE = (1 << 9),
CTX_NO_PET = (1 << 10),
CTX_NO_MIRROR = (1 << 11),
CTX_AUTOCONFIRM = (1 << 12),
CTX_AUTOCONFIRM = (1 << 11),
/** When transforming object's, adjust the object data so it stays in the same place. */
CTX_OBMODE_XFORM_OBDATA = (1 << 13),
CTX_OBMODE_XFORM_OBDATA = (1 << 12),
/** Transform object parents without moving their children. */
CTX_OBMODE_XFORM_SKIP_CHILDREN = (1 << 14),
CTX_OBMODE_XFORM_SKIP_CHILDREN = (1 << 13),
} eTContext;
/** #TransInfo.flag */

View File

@ -1122,8 +1122,7 @@ static void init_TransDataContainers(TransInfo *t,
for (int i = 0; i < objects_len; i++) {
TransDataContainer *tc = &t->data_container[i];
if (((t->flag & T_NO_MIRROR) == 0) && ((t->options & CTX_NO_MIRROR) == 0) &&
(objects[i]->type == OB_MESH)) {
if (!(t->flag & T_NO_MIRROR) && (objects[i]->type == OB_MESH)) {
tc->use_mirror_axis_x = (((Mesh *)objects[i]->data)->symmetry & ME_SYMMETRY_X) != 0;
tc->use_mirror_axis_y = (((Mesh *)objects[i]->data)->symmetry & ME_SYMMETRY_Y) != 0;
tc->use_mirror_axis_z = (((Mesh *)objects[i]->data)->symmetry & ME_SYMMETRY_Z) != 0;

View File

@ -1624,7 +1624,7 @@ void recalcData_mesh(TransInfo *t)
if (!is_canceling) {
applyProject(t);
bool do_mirror = !(t->flag & T_NO_MIRROR) && !(t->options & CTX_NO_MIRROR);
bool do_mirror = !(t->flag & T_NO_MIRROR);
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
/* Apply clipping after so we never project past the clip plane T25423. */
transform_convert_clip_mirror_modifier_apply(tc);

View File

@ -48,8 +48,8 @@
* \{ */
static float *tc_mesh_skin_transdata_center(const struct TransIslandData *island_data,
const int island_index,
BMVert *eve)
const int island_index,
BMVert *eve)
{
if (island_data->center && island_index != -1) {
return island_data->center[island_index];
@ -58,10 +58,10 @@ static float *tc_mesh_skin_transdata_center(const struct TransIslandData *island
}
static void tc_mesh_skin_transdata_create(TransDataBasic *td,
BMEditMesh *em,
BMVert *eve,
const struct TransIslandData *island_data,
const int island_index)
BMEditMesh *em,
BMVert *eve,
const struct TransIslandData *island_data,
const int island_index)
{
BLI_assert(BM_elem_flag_test(eve, BM_ELEM_HIDDEN) == 0);
MVertSkin *vs = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MVERT_SKIN);
@ -292,7 +292,7 @@ void recalcData_mesh_skin(TransInfo *t)
bool is_canceling = t->state == TRANS_CANCEL;
/* mirror modifier clipping? */
if (!is_canceling) {
if ((t->flag & T_NO_MIRROR) == 0 && (t->options & CTX_NO_MIRROR) == 0) {
if (!(t->flag & T_NO_MIRROR)) {
tc_mesh_skin_apply_to_mirror(t);
}
}

View File

@ -538,7 +538,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
else {
/* Avoid mirroring for unsupported contexts. */
t->options |= CTX_NO_MIRROR;
t->flag |= T_NO_MIRROR;
}
/* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */