Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-02-22 14:13:15 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-02-22 14:13:15 +0400
commitca689e88aac0e33bf0fd9701f5c6174b5ff5f3fd (patch)
tree4ac995bce7fee0b4b8fd44c21c5efec767a98a68 /source/blender/editors/space_clip/clip_dopesheet_draw.c
parent4cf9034f6d59840f8312094c184b9708a251fe0a (diff)
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
Diffstat (limited to 'source/blender/editors/space_clip/clip_dopesheet_draw.c')
-rw-r--r--source/blender/editors/space_clip/clip_dopesheet_draw.c27
1 files changed, 27 insertions, 0 deletions
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);