Gizmo: adjust when gizmo protection flags are displayed

Restore behavior reverted in
0ea60cf6b8 but only for location
as it makes sense to use protection flags in global mode in that case.
This commit is contained in:
Campbell Barton 2021-11-13 00:28:13 +11:00
parent 0ea60cf6b8
commit 5f7d5c0809
Notes: blender-bot 2024-01-01 12:41:42 +01:00
Referenced by issue #116666, Regression: Rotate and Scale gizmo is always active when Rotation and Scale are locked
1 changed files with 7 additions and 3 deletions

View File

@ -1062,9 +1062,13 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
}
}
/* Protect-flags apply to world space in object mode, so only let them influence axis
* visibility if we show the global orientation, otherwise it's confusing. */
if (ELEM(orient_index, V3D_ORIENT_LOCAL, V3D_ORIENT_GIMBAL)) {
if (orient_index == V3D_ORIENT_GLOBAL) {
/* Protect-flags apply to world space in object mode,
* so only let them influence axis visibility if we show the global orientation,
* otherwise it's confusing. */
protectflag_to_drawflags(base->object->protectflag & OB_LOCK_LOC, &rv3d->twdrawflag);
}
else if (ELEM(orient_index, V3D_ORIENT_LOCAL, V3D_ORIENT_GIMBAL)) {
protectflag_to_drawflags(base->object->protectflag, &rv3d->twdrawflag);
}
totsel++;