Transform: remove MOD_CONSTRAINT_PLANE

It conflicts with MOD_PRECISION and was not really working properly.
This commit is contained in:
2020-09-01 10:50:50 -03:00
parent 8170c92ed4
commit c7287ffaec
3 changed files with 6 additions and 29 deletions

View File

@@ -972,7 +972,6 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_PLANE_X:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
t->modifiers |= MOD_CONSTRAINT_PLANE;
transform_event_xyz_constraint(t, EVT_XKEY, true);
t->redraw |= TREDRAW_HARD;
handled = true;
@@ -980,7 +979,6 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_PLANE_Y:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
t->modifiers |= MOD_CONSTRAINT_PLANE;
transform_event_xyz_constraint(t, EVT_YKEY, true);
t->redraw |= TREDRAW_HARD;
handled = true;
@@ -988,7 +986,6 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_PLANE_Z:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
t->modifiers |= MOD_CONSTRAINT_PLANE;
transform_event_xyz_constraint(t, EVT_ZKEY, true);
t->redraw |= TREDRAW_HARD;
handled = true;
@@ -1209,7 +1206,6 @@ int transformEvent(TransInfo *t, const wmEvent *event)
/* Disable modifiers. */
int modifiers = t->modifiers;
modifiers &= ~MOD_CONSTRAINT_SELECT;
modifiers &= ~MOD_CONSTRAINT_PLANE;
if (modifiers != t->modifiers) {
if (t->modifiers & MOD_CONSTRAINT_SELECT) {
postSelectConstraint(t);

View File

@@ -497,7 +497,6 @@ enum {
MOD_PRECISION = 1 << 1,
MOD_SNAP = 1 << 2,
MOD_SNAP_INVERT = 1 << 3,
MOD_CONSTRAINT_PLANE = 1 << 4,
};
/* use node center for transform instead of upper-left corner.

View File

@@ -1079,34 +1079,16 @@ static void setNearestAxis3d(TransInfo *t)
}
if (len[0] <= len[1] && len[0] <= len[2]) {
if (t->modifiers & MOD_CONSTRAINT_PLANE) {
t->con.mode |= (CON_AXIS1 | CON_AXIS2);
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" locking %s X axis"), t->spacename);
}
else {
t->con.mode |= CON_AXIS0;
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" along %s X axis"), t->spacename);
}
t->con.mode |= CON_AXIS0;
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" along %s X axis"), t->spacename);
}
else if (len[1] <= len[0] && len[1] <= len[2]) {
if (t->modifiers & MOD_CONSTRAINT_PLANE) {
t->con.mode |= (CON_AXIS0 | CON_AXIS2);
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" locking %s Y axis"), t->spacename);
}
else {
t->con.mode |= CON_AXIS1;
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" along %s Y axis"), t->spacename);
}
t->con.mode |= CON_AXIS1;
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" along %s Y axis"), t->spacename);
}
else if (len[2] <= len[1] && len[2] <= len[0]) {
if (t->modifiers & MOD_CONSTRAINT_PLANE) {
t->con.mode |= (CON_AXIS0 | CON_AXIS1);
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" locking %s Z axis"), t->spacename);
}
else {
t->con.mode |= CON_AXIS2;
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" along %s Z axis"), t->spacename);
}
t->con.mode |= CON_AXIS2;
BLI_snprintf(t->con.text, sizeof(t->con.text), TIP_(" along %s Z axis"), t->spacename);
}
}