From c4e4329f29e795d4f1cead136804956d9dd22d86 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 10 Sep 2013 12:46:23 +0000 Subject: Don't show 2D cursor in tracking mode i pivoting is not set to 2D cursor --- source/blender/editors/space_clip/clip_ops.c | 8 ++++++++ source/blender/editors/space_clip/space_clip.c | 20 +++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_clip') diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 3d4a2ba96fc..a76f4364492 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1464,6 +1464,14 @@ void CLIP_OT_set_scene_frames(wmOperatorType *ot) static int clip_set_2d_cursor_exec(bContext *C, wmOperator *op) { SpaceClip *sclip = CTX_wm_space_clip(C); + bool show_cursor = false; + + show_cursor |= sclip->mode == SC_MODE_MASKEDIT; + show_cursor |= sclip->around == V3D_CURSOR; + + if (!show_cursor) { + return OPERATOR_CANCELLED; + } RNA_float_get_array(op->ptr, "location", sclip->cursor); diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 8db3a7e1525..9d68bb2129a 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -1129,6 +1129,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) MovieClip *clip = ED_space_clip_get_clip(sc); float aspx, aspy, zoomx, zoomy, x, y; int width, height; + bool show_cursor = false; /* if tracking is in progress, we should synchronize framenr from clipuser * so latest tracked frame would be shown */ @@ -1181,13 +1182,18 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) } } - glPushMatrix(); - glTranslatef(x, y, 0); - glScalef(zoomx, zoomy, 0); - glMultMatrixf(sc->stabmat); - glScalef(width, height, 0); - draw_image_cursor(ar, sc->cursor); - glPopMatrix(); + show_cursor |= sc->mode == SC_MODE_MASKEDIT; + show_cursor |= sc->around == V3D_CURSOR; + + if (show_cursor) { + glPushMatrix(); + glTranslatef(x, y, 0); + glScalef(zoomx, zoomy, 0); + glMultMatrixf(sc->stabmat); + glScalef(width, height, 0); + draw_image_cursor(ar, sc->cursor); + glPopMatrix(); + } if (sc->flag & SC_SHOW_GPENCIL) { /* Grease Pencil */ -- cgit v1.2.3