From ca689e88aac0e33bf0fd9701f5c6174b5ff5f3fd Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 22 Feb 2013 10:13:15 +0000 Subject: Motion tracking dopesheet Highlight background depending on number of tracks existing on frame. This is not so much mathematically accurate displaying where things shall be improved, but it's nice feedback about which frames better be reviewed. Bad frames are tracks < 8, highlighted with red. OK-ish frame are 8 <= tracks < 16, highlighted with yellow. Could be some artifacts with color region start/end, this is a bit unclear what exactly expected to be highlighted -- frames are displayed as dots, but in fact they're quite noticeable segments. --- svn merge -r54572:54573 ^/branches/soc-2011-tomato --- .../editors/space_clip/clip_dopesheet_draw.c | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source/blender/editors/space_clip') diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index 09d97c36436..b1be9217819 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -145,6 +145,31 @@ static void draw_keyframe_shape(float x, float y, float xscale, float yscale, sh glPopMatrix(); } +static void clip_draw_dopesheet_background(ARegion *ar, MovieClip *clip) +{ + View2D *v2d = &ar->v2d; + MovieTracking *tracking = &clip->tracking; + MovieTrackingDopesheet *dopesheet = &tracking->dopesheet; + MovieTrackingDopesheetCoverageSegment *coverage_segment; + + for (coverage_segment = dopesheet->coverage_segments.first; + coverage_segment; + coverage_segment = coverage_segment->next) + { + if (coverage_segment->coverage < TRACKING_COVERAGE_OK) { + int start_frame = BKE_movieclip_remap_clip_to_scene_frame(clip, coverage_segment->start_frame); + int end_frame = BKE_movieclip_remap_clip_to_scene_frame(clip, coverage_segment->end_frame); + + if (coverage_segment->coverage == TRACKING_COVERAGE_BAD) + glColor4f(1.0f, 0.0f, 0.0f, 0.07f); + else + glColor4f(1.0f, 1.0f, 0.0f, 0.07f); + + glRectf(start_frame, v2d->cur.ymin, end_frame, v2d->cur.ymax); + } + } +} + void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) { MovieClip *clip = ED_space_clip_get_clip(sc); @@ -179,6 +204,8 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) glEnable(GL_BLEND); + clip_draw_dopesheet_background(ar, clip); + for (channel = dopesheet->channels.first; channel; channel = channel->next) { float yminc = (float) (y - CHANNEL_HEIGHT_HALF); float ymaxc = (float) (y + CHANNEL_HEIGHT_HALF); -- cgit v1.2.3