NDOF: adjust when guides are shown
- Hide the axis guide when not orbiting this drew a permanent blue-dot in the middle of the viewport which is distracting & unnecessary. - Hide the orbit center when it's invalid or unused because of object/3d-cursor viewport locks.
This commit is contained in:
@@ -1492,18 +1492,27 @@ void view3d_draw_region_info(const bContext *C, ARegion *region)
|
||||
|
||||
#ifdef WITH_INPUT_NDOF
|
||||
if (U.ndof_flag & NDOF_SHOW_GUIDE_ORBIT_AXIS) {
|
||||
if (((RV3D_LOCK_FLAGS(rv3d) & RV3D_LOCK_ROTATION) == 0) && (rv3d->persp != RV3D_CAMOB)) {
|
||||
/* TODO: draw something else (but not this) during fly mode. */
|
||||
draw_ndof_guide_orbit_axis(rv3d);
|
||||
if ((RV3D_LOCK_FLAGS(rv3d) & RV3D_LOCK_ROTATION) == 0) {
|
||||
/* It only makes sense to show when orbiting. */
|
||||
if (rv3d->ndof_rot_angle != 0.0f) {
|
||||
/* TODO: draw something else (but not this) during fly mode. */
|
||||
draw_ndof_guide_orbit_axis(rv3d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (U.ndof_flag & NDOF_SHOW_GUIDE_ORBIT_CENTER) {
|
||||
/* Draw this only when orbiting and auto orbit-center is enabled */
|
||||
if ((U.ndof_flag & NDOF_MODE_ORBIT) && (U.ndof_flag & NDOF_ORBIT_CENTER_AUTO) &&
|
||||
(rv3d->ndof_rot_angle != 0.0f))
|
||||
{
|
||||
draw_ndof_guide_orbit_center(rv3d);
|
||||
if ((U.ndof_flag & NDOF_MODE_ORBIT) && (U.ndof_flag & NDOF_ORBIT_CENTER_AUTO)) {
|
||||
if (rv3d->ndof_flag & RV3D_NDOF_OFS_IS_VALID) {
|
||||
/* When the center is locked, the auto-center is not used. */
|
||||
if (!(v3d->ob_center_cursor || v3d->ob_center)) {
|
||||
/* It only makes sense to show when orbiting. */
|
||||
if (rv3d->ndof_rot_angle != 0.0f) {
|
||||
draw_ndof_guide_orbit_center(rv3d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user