Transform: Use orientation of active object with Auto Constraint

Fix T81429.

This was an intentional change in rBc75a665c442e as it maintains the
same behavior as the constraint with or without modifier.

But from the user's PoV, it is better to keep the old behavior.

This makes drawing and behavior more intuitive.
This commit is contained in:
Germano Cavalcante 2020-10-05 10:04:02 -03:00
parent 3df90de6c2
commit 54f248fa87
Notes: blender-bot 2023-02-13 22:20:49 +01:00
Referenced by commit 736b0d6894, Revert "Transform: Use orientation of active object with Auto Constraint"
Referenced by issue #81429, move tool's axis constraints not drawn completely when using local orientation
Referenced by issue #80396, Potential candidates for corrective releases
1 changed files with 26 additions and 17 deletions

View File

@ -698,25 +698,34 @@ void setUserConstraint(TransInfo *t, int mode, const char ftext[])
const char *spacename = transform_orientations_spacename_get(t, orientation);
BLI_snprintf(text, sizeof(text), ftext, spacename);
switch (orientation) {
case V3D_ORIENT_LOCAL:
setLocalConstraint(t, mode, text);
break;
case V3D_ORIENT_NORMAL:
if (checkUseAxisMatrix(t)) {
setAxisMatrixConstraint(t, mode, text);
if (t->modifiers & (MOD_CONSTRAINT_SELECT | MOD_CONSTRAINT_PLANE)) {
/* Force the orientation of the active object.
* Although possible, it is not convenient to use the local or axis constraint
* with the modifier to select constraint.
* This also follows the convention of older versions. */
setConstraint(t, mode, text);
}
else {
switch (orientation) {
case V3D_ORIENT_LOCAL:
setLocalConstraint(t, mode, text);
break;
case V3D_ORIENT_NORMAL:
if (checkUseAxisMatrix(t)) {
setAxisMatrixConstraint(t, mode, text);
break;
}
ATTR_FALLTHROUGH;
case V3D_ORIENT_GLOBAL:
case V3D_ORIENT_VIEW:
case V3D_ORIENT_CURSOR:
case V3D_ORIENT_GIMBAL:
case V3D_ORIENT_CUSTOM_MATRIX:
case V3D_ORIENT_CUSTOM:
default: {
setConstraint(t, mode, text);
break;
}
ATTR_FALLTHROUGH;
case V3D_ORIENT_GLOBAL:
case V3D_ORIENT_VIEW:
case V3D_ORIENT_CURSOR:
case V3D_ORIENT_GIMBAL:
case V3D_ORIENT_CUSTOM_MATRIX:
case V3D_ORIENT_CUSTOM:
default: {
setConstraint(t, mode, text);
break;
}
}
t->con.mode |= CON_USER;