Cleanup: Unify, move and rename transform flags

Flags unified:
T_CURSOR -> CTX_CURSOR
T_TEXTURE -> CTX_TEXTURE

Flags moved:
T_CAMERA -> CTX_CAMERA
T_POSE -> CTX_POSE_BONE
T_OBJECT -> CTX_OBJECT
T_TEXTURE -> CTX_TEXTURE_SPACE

Flag renamed:
CTX_EDGE -> CTX_EDGE_DATA
This commit is contained in:
2021-02-05 11:56:43 -03:00
parent be60b3b239
commit 0bc07ea090
12 changed files with 76 additions and 79 deletions

View File

@@ -440,7 +440,7 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
}
else {
/* Do we need more refined tags? */
if (t->flag & T_POSE) {
if (t->options & CTX_POSE_BONE) {
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
}
else {
@@ -484,7 +484,7 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
wmWindow *window = CTX_wm_window(C);
WM_paint_cursor_tag_redraw(window, t->region);
}
else if (t->flag & T_CURSOR) {
else if (t->options & CTX_CURSOR) {
ED_area_tag_redraw(t->area);
}
else {
@@ -895,7 +895,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_ROTATE:
/* only switch when... */
if (!(t->options & CTX_TEXTURE) && !(t->options & (CTX_MOVIECLIP | CTX_MASK))) {
if (!(t->options & CTX_TEXTURE_SPACE) && !(t->options & (CTX_MOVIECLIP | CTX_MASK))) {
if (transform_mode_is_changeable(t->mode)) {
restoreTransObjects(t);
resetTransModal(t);
@@ -1069,7 +1069,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
t->modifiers &= ~(MOD_CONSTRAINT_SELECT | MOD_CONSTRAINT_PLANE);
}
else {
if (t->flag & T_CAMERA) {
if (t->options & CTX_CAMERA) {
/* Exception for switching to dolly, or trackball, in camera view. */
if (t->mode == TFM_TRANSLATION) {
setLocalConstraint(t, (CON_AXIS2), TIP_("along local Z"));
@@ -1382,7 +1382,7 @@ static void drawTransformPixel(const struct bContext *C, ARegion *region, void *
*/
if ((U.autokey_flag & AUTOKEY_FLAG_NOWARNING) == 0) {
if (region == t->region) {
if (t->flag & (T_OBJECT | T_POSE)) {
if (t->options & (CTX_OBJECT | CTX_POSE_BONE)) {
if (ob && autokeyframe_cfra_can_key(scene, &ob->id)) {
drawAutoKeyWarning(t, region);
}
@@ -1652,7 +1652,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
if ((prop = RNA_struct_find_property(op->ptr, "texture_space")) &&
RNA_property_is_set(op->ptr, prop)) {
if (RNA_property_boolean_get(op->ptr, prop)) {
options |= CTX_TEXTURE;
options |= CTX_TEXTURE_SPACE;
}
}