[Bf-blender-cvs] [9a8b6d51c12] blender2.8: Fix T58850: NDOF navigation guide not shown
Campbell Barton
noreply at git.blender.org
Tue Dec 11 02:35:30 CET 2018
Commit: 9a8b6d51c129aec9385b83391745ce4ac38e953b
Author: Campbell Barton
Date: Tue Dec 11 12:34:37 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB9a8b6d51c129aec9385b83391745ce4ac38e953b
Fix T58850: NDOF navigation guide not shown
===================================================================
M source/blender/draw/intern/draw_view.c
M source/blender/editors/space_view3d/view3d_draw.c
===================================================================
diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c
index 8867c85ac2f..f56cbd68077 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -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);
}
}
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index b9db773aaee..f6b2c79b88b 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -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);
More information about the Bf-blender-cvs
mailing list