diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-01 14:50:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-01 14:50:39 +0400 |
commit | 26cc3dd7086d7e0061322f5b6f29ce10fb9d8abb (patch) | |
tree | 831493412b0fa80ded28b294ab6e4a88602197c6 /source/blender/editors/space_clip | |
parent | 0fee289551e90865e9f2041d49f19f5a8c065304 (diff) |
misc mask fixes
- image space used wrong notifiers.
- image notifier now checks for mask mode before listening to mask edits.
- mask keyframes now draw in the image space.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 26 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_utils.c | 2 |
3 files changed, 7 insertions, 23 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 96eb6002840..c24cdab29e5 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -53,6 +53,7 @@ #include "ED_screen.h" #include "ED_clip.h" +#include "ED_mask.h" #include "ED_gpencil.h" #include "BIF_gl.h" @@ -73,7 +74,7 @@ /*********************** main area drawing *************************/ -void clip_draw_curfra_label(SpaceClip *sc, float x, float y) +void clip_draw_curfra_label(const int framenr, const float x, const float y) { uiStyle *style = UI_GetStyle(); int fontid = style->widget.uifont_id; @@ -82,7 +83,7 @@ void clip_draw_curfra_label(SpaceClip *sc, float x, float y) /* frame number */ BLF_size(fontid, 11.0f, U.dpi); - BLI_snprintf(numstr, sizeof(numstr), "%d", sc->user.framenr); + BLI_snprintf(numstr, sizeof(numstr), "%d", framenr); BLF_width_and_height(fontid, numstr, &font_dims[0], &font_dims[1]); @@ -212,7 +213,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc UI_ThemeColor(TH_CFRAME); glRecti(x, 0, x + framelen, 8); - clip_draw_curfra_label(sc, x, 8.0f); + clip_draw_curfra_label(sc->user.framenr, x, 8.0f); /* solver keyframes */ glColor4ub(175, 255, 0, 255); @@ -221,24 +222,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc /* movie clip animation */ if ((sc->mode == SC_MODE_MASKEDIT) && sc->mask_info.mask) { - MaskLayer *masklay = BKE_mask_layer_active(sc->mask_info.mask); - if (masklay) { - MaskLayerShape *masklay_shape; - - glColor4ub(255, 175, 0, 255); - glBegin(GL_LINES); - - for (masklay_shape = masklay->splines_shapes.first; - masklay_shape; - masklay_shape = masklay_shape->next) - { - i = masklay_shape->frame; - - draw_keyframe(i, CFRA, sfra, framelen, 1); - } - - glEnd(); - } + ED_mask_draw_frames(sc->mask_info.mask, ar, CFRA, sfra, efra); } } diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h index 3422aacf264..392367f9071 100644 --- a/source/blender/editors/space_clip/clip_intern.h +++ b/source/blender/editors/space_clip/clip_intern.h @@ -71,7 +71,7 @@ void CLIP_OT_dopesheet_select_channel(struct wmOperatorType *ot); /* clip_draw.c */ void clip_draw_main(const struct bContext *C, struct SpaceClip *sc, struct ARegion *ar); void clip_draw_grease_pencil(struct bContext *C, int onlyv2d); -void clip_draw_curfra_label(struct SpaceClip *sc, float x, float y); +void clip_draw_curfra_label(const int framenr, const float x, const float y); /* clip_graph_draw.c */ void clip_draw_graph(struct SpaceClip *sc, struct ARegion *ar, struct Scene *scene); diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index 9e93aed6df7..ddc624b4cdf 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -263,7 +263,7 @@ void clip_draw_cfra(SpaceClip *sc, ARegion *ar, Scene *scene) UI_view2d_getscale(v2d, &xscale, &yscale); glScalef(1.0f / xscale, 1.0f, 1.0f); - clip_draw_curfra_label(sc, (float)sc->user.framenr * xscale, 18); + clip_draw_curfra_label(sc->user.framenr, (float)sc->user.framenr * xscale, 18); /* restore view transform */ glScalef(xscale, 1.0, 1.0); |