diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-12 21:11:00 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-12 21:11:00 +0400 |
commit | d3e098bb42dd9eb6346c41f1f400050010161549 (patch) | |
tree | 2fb1c83c4519c39c8247c30831fc6152846ea427 /source/blender | |
parent | 37612200fd6ce86dcece90c491238b4d6bd0d662 (diff) |
Some Clip Editor interface clean-ups:
- Display track's reprojection error in dopesheet
- Make sure track is selected when clicking on dopesheet channel
- Attempt to make headers a bit cleaner without long labels which
doesn't actually make sense.
Diffstat (limited to 'source/blender')
4 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index f1b251f54dd..57983062e3f 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -3587,7 +3587,9 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking) MovieTrackingObject *object = BKE_tracking_active_object(tracking); MovieTrackingDopesheet *dopesheet = &tracking->dopesheet; MovieTrackingTrack *track; + MovieTrackingReconstruction *reconstruction; ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object); + short sort_method = dopesheet->sort_method; short inverse = dopesheet->flag & TRACKING_DOPE_SORT_INVERSE; short sel_only = dopesheet->flag & TRACKING_DOPE_SELECTED_ONLY; @@ -3598,6 +3600,8 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking) tracking_dopesheet_free(dopesheet); + reconstruction = BKE_tracking_object_reconstruction(tracking, object); + for (track = tracksbase->first; track; track = track->next) { MovieTrackingDopesheetChannel *channel; @@ -3610,6 +3614,13 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking) channel = MEM_callocN(sizeof(MovieTrackingDopesheetChannel), "tracking dopesheet channel"); channel->track = track; + if (reconstruction->flag & TRACKING_RECONSTRUCTED) { + BLI_snprintf(channel->name, sizeof(channel->name), "%s (%.4f)", track->name, track->error); + } + else { + BLI_strncpy(channel->name, track->name, sizeof(channel->name)); + } + channels_segments_calc(channel); BLI_addtail(&dopesheet->channels, channel); diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index 2ce0e13b8bd..361a3a7d906 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -313,10 +313,10 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar) else UI_ThemeColor(TH_TEXT); - font_height = BLF_height(fontid, track->name); + font_height = BLF_height(fontid, channel->name); BLF_position(fontid, v2d->cur.xmin + CHANNEL_PAD, y - font_height / 2.0f, 0.0f); - BLF_draw(fontid, track->name, strlen(track->name)); + BLF_draw(fontid, channel->name, strlen(channel->name)); } /* adjust y-position for next one */ diff --git a/source/blender/editors/space_clip/clip_dopesheet_ops.c b/source/blender/editors/space_clip/clip_dopesheet_ops.c index 914e82472bb..744c7ba46fd 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_ops.c +++ b/source/blender/editors/space_clip/clip_dopesheet_ops.c @@ -76,8 +76,10 @@ static int dopesheet_select_channel_exec(bContext *C, wmOperator *op) SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip(sc); MovieTracking *tracking = &clip->tracking; + MovieTrackingObject *object = BKE_tracking_active_object(tracking); MovieTrackingDopesheet *dopesheet = &tracking->dopesheet; MovieTrackingDopesheetChannel *channel; + ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object); float location[2]; int extend = RNA_boolean_get(op->ptr, "extend"); int current_channel_index = 0, channel_index; @@ -96,6 +98,7 @@ static int dopesheet_select_channel_exec(bContext *C, wmOperator *op) if (track->flag & TRACK_DOPE_SEL) { tracking->act_track = track; + BKE_tracking_select_track(tracksbase, track, TRACK_AREA_ALL, TRUE); } } else if (!extend) diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h index 4eb1626f1cb..e1e7408fe14 100644 --- a/source/blender/makesdna/DNA_tracking_types.h +++ b/source/blender/makesdna/DNA_tracking_types.h @@ -232,6 +232,8 @@ typedef struct MovieTrackingDopesheetChannel { MovieTrackingTrack *track; /* motion track for which channel is created */ int pad; + char name[64]; /* name of channel */ + int tot_segment; /* total number of segments */ int *segments; /* tracked segments */ int max_segment, total_frames; /* longest segment length and total number of tracked frames */ |