diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_navigate_fly.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_navigate_fly.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate_fly.c b/source/blender/editors/space_view3d/view3d_navigate_fly.c index 399f422f411..3e83f8085c7 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_fly.c +++ b/source/blender/editors/space_view3d/view3d_navigate_fly.c @@ -122,7 +122,7 @@ void fly_modal_keymap(wmKeyConfig *keyconf) wmKeyMap *keymap = WM_modalkeymap_find(keyconf, "View3D Fly Modal"); - /* this function is called for each spacetype, only needs to add map once */ + /* This function is called for each space-type, only needs to add map once. */ if (keymap && keymap->modal_items) { return; } @@ -247,7 +247,7 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), ARegion *UNUSED(regio GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformThemeColor3(TH_VIEW_OVERLAY); @@ -1079,6 +1079,7 @@ static int fly_modal(bContext *C, wmOperator *op, const wmEvent *event) int exit_code; bool do_draw = false; FlyInfo *fly = op->customdata; + View3D *v3d = fly->v3d; RegionView3D *rv3d = fly->rv3d; Object *fly_object = ED_view3d_cameracontrol_object_get(fly->v3d_camera_control); @@ -1102,6 +1103,9 @@ static int fly_modal(bContext *C, wmOperator *op, const wmEvent *event) exit_code = flyEnd(C, fly); + if (exit_code == OPERATOR_FINISHED) { + ED_view3d_camera_lock_undo_push(op->type->name, v3d, rv3d, C); + } if (exit_code != OPERATOR_RUNNING_MODAL) { do_draw = true; } |