Fix T58850: NDOF navigation guide not shown
This commit is contained in:
parent
3dfbb72b29
commit
9a8b6d51c1
Notes:
blender-bot
2023-02-14 06:21:59 +01:00
Referenced by issue #59197, crash upon openign files Referenced by issue #59182, Blender 2.8 win64 crashes on start Referenced by issue #59168, Blender 2.8 (9a8b6d51c1
) - Crash when going in Edit Mode with Multiresolution modifier Referenced by issue #59171, Something weird in Eevee render view Referenced by issue #59173, Blender 2.8 (9a8b6d51c1
) - Empty or incomplete render at the first frame, then crash several frames later (Animation Render) Referenced by issue #58850, Blender 2.80 Beta don't show 3d Mouse navigation guide
|
@ -227,6 +227,9 @@ void DRW_draw_cursor(void)
|
|||
immUnbindProgram();
|
||||
}
|
||||
|
||||
float original_proj[4][4];
|
||||
GPU_matrix_projection_get(original_proj);
|
||||
GPU_matrix_push();
|
||||
ED_region_pixelspace(ar);
|
||||
GPU_matrix_translate_2f(co[0] + 0.5f, co[1] + 0.5f);
|
||||
GPU_matrix_scale_2f(U.widget_unit, U.widget_unit);
|
||||
|
@ -239,6 +242,8 @@ void DRW_draw_cursor(void)
|
|||
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
GPU_matrix_pop();
|
||||
GPU_matrix_projection_set(original_proj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -877,7 +877,7 @@ static void draw_view_axis(RegionView3D *rv3d, const rcti *rect)
|
|||
|
||||
#ifdef WITH_INPUT_NDOF
|
||||
/* draw center and axis of rotation for ongoing 3D mouse navigation */
|
||||
static void UNUSED_FUNCTION(draw_rotation_guide)(RegionView3D *rv3d)
|
||||
static void draw_rotation_guide(const RegionView3D *rv3d)
|
||||
{
|
||||
float o[3]; /* center of rotation */
|
||||
float end[3]; /* endpoints for drawing */
|
||||
|
@ -1246,6 +1246,16 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar)
|
|||
Scene *scene = CTX_data_scene(C);
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
|
||||
#ifdef WITH_INPUT_NDOF
|
||||
if ((U.ndof_flag & NDOF_SHOW_GUIDE) &&
|
||||
((rv3d->viewlock & RV3D_LOCKED) == 0) &&
|
||||
(rv3d->persp != RV3D_CAMOB))
|
||||
{
|
||||
/* TODO: draw something else (but not this) during fly mode */
|
||||
draw_rotation_guide(rv3d);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* correct projection matrix */
|
||||
ED_region_pixelspace(ar);
|
||||
|
||||
|
|
Loading…
Reference in New Issue