diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-09-10 16:46:23 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-09-10 16:46:23 +0400 |
commit | c4e4329f29e795d4f1cead136804956d9dd22d86 (patch) | |
tree | 966d3f790677a2d35197aa61aca3e704b3ebdce1 /source/blender/editors/space_clip | |
parent | e72c6f191f296ee772562b00b5de72688ca6f4cf (diff) |
Don't show 2D cursor in tracking mode i pivoting is not set to 2D cursor
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 20 |
2 files changed, 21 insertions, 7 deletions
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 */ |