Example #1
0
void freeSnapping(TransInfo *t)
{
	if (t->tsnap.object_context) {
		ED_transform_snap_object_context_destroy(t->tsnap.object_context);
		t->tsnap.object_context = NULL;
	}
}
Example #2
0
static int walkEnd(bContext *C, WalkInfo *walk)
{
	wmWindow *win;
	RegionView3D *rv3d;

	if (walk->state == WALK_RUNNING)
		return OPERATOR_RUNNING_MODAL;

#ifdef NDOF_WALK_DEBUG
	puts("\n-- walk end --");
#endif

	win = CTX_wm_window(C);
	rv3d = walk->rv3d;

	WM_event_remove_timer(CTX_wm_manager(C), win, walk->timer);

	ED_region_draw_cb_exit(walk->ar->type, walk->draw_handle_pixel);

	ED_transform_snap_object_context_destroy(walk->snap_context);

	ED_view3d_cameracontrol_release(walk->v3d_camera_control, walk->state == WALK_CANCEL);

	rv3d->rflag &= ~RV3D_NAVIGATING;

	if (walk->ndof)
		MEM_freeN(walk->ndof);

	/* restore the cursor */
	WM_cursor_modal_restore(win);

#ifdef USE_TABLET_SUPPORT
	if (walk->is_cursor_absolute == false)
#endif
	{
		/* center the mouse */
		WM_cursor_warp(
		        win,
		        walk->ar->winrct.xmin + walk->center_mval[0],
		        walk->ar->winrct.ymin + walk->center_mval[1]);
	}

	if (walk->state == WALK_CONFIRM) {
		MEM_freeN(walk);
		return OPERATOR_FINISHED;
	}

	MEM_freeN(walk);
	return OPERATOR_CANCELLED;
}