forked from bartvdbraak/blender
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.
This commit is contained in:
parent
37612200fd
commit
d3e098bb42
@ -62,7 +62,7 @@ class CLIP_HT_header(Header):
|
|||||||
r = active_object.reconstruction
|
r = active_object.reconstruction
|
||||||
|
|
||||||
if r.is_valid and sc.view == 'CLIP':
|
if r.is_valid and sc.view == 'CLIP':
|
||||||
layout.label(text="Average solve error: %.4f" %
|
layout.label(text="Solve error: %.4f" %
|
||||||
(r.average_error))
|
(r.average_error))
|
||||||
elif sc.view == 'GRAPH':
|
elif sc.view == 'GRAPH':
|
||||||
layout.prop(sc, "view", text="", expand=True)
|
layout.prop(sc, "view", text="", expand=True)
|
||||||
@ -89,9 +89,9 @@ class CLIP_HT_header(Header):
|
|||||||
row.prop(dopesheet, "show_only_selected", text="")
|
row.prop(dopesheet, "show_only_selected", text="")
|
||||||
row.prop(dopesheet, "show_hidden", text="")
|
row.prop(dopesheet, "show_hidden", text="")
|
||||||
|
|
||||||
layout.label(text="Sort by:")
|
row = layout.row(align=True)
|
||||||
layout.prop(dopesheet, "sort_method", text="")
|
row.prop(dopesheet, "sort_method", text="")
|
||||||
layout.prop(dopesheet, "use_invert_sort", text="Invert")
|
row.prop(dopesheet, "use_invert_sort", text="Invert", toggle=True)
|
||||||
else:
|
else:
|
||||||
layout.prop(sc, "view", text="", expand=True)
|
layout.prop(sc, "view", text="", expand=True)
|
||||||
|
|
||||||
|
@ -3587,7 +3587,9 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking)
|
|||||||
MovieTrackingObject *object = BKE_tracking_active_object(tracking);
|
MovieTrackingObject *object = BKE_tracking_active_object(tracking);
|
||||||
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
|
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
|
||||||
MovieTrackingTrack *track;
|
MovieTrackingTrack *track;
|
||||||
|
MovieTrackingReconstruction *reconstruction;
|
||||||
ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
|
ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
|
||||||
|
|
||||||
short sort_method = dopesheet->sort_method;
|
short sort_method = dopesheet->sort_method;
|
||||||
short inverse = dopesheet->flag & TRACKING_DOPE_SORT_INVERSE;
|
short inverse = dopesheet->flag & TRACKING_DOPE_SORT_INVERSE;
|
||||||
short sel_only = dopesheet->flag & TRACKING_DOPE_SELECTED_ONLY;
|
short sel_only = dopesheet->flag & TRACKING_DOPE_SELECTED_ONLY;
|
||||||
@ -3598,6 +3600,8 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking)
|
|||||||
|
|
||||||
tracking_dopesheet_free(dopesheet);
|
tracking_dopesheet_free(dopesheet);
|
||||||
|
|
||||||
|
reconstruction = BKE_tracking_object_reconstruction(tracking, object);
|
||||||
|
|
||||||
for (track = tracksbase->first; track; track = track->next) {
|
for (track = tracksbase->first; track; track = track->next) {
|
||||||
MovieTrackingDopesheetChannel *channel;
|
MovieTrackingDopesheetChannel *channel;
|
||||||
|
|
||||||
@ -3610,6 +3614,13 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking)
|
|||||||
channel = MEM_callocN(sizeof(MovieTrackingDopesheetChannel), "tracking dopesheet channel");
|
channel = MEM_callocN(sizeof(MovieTrackingDopesheetChannel), "tracking dopesheet channel");
|
||||||
channel->track = track;
|
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);
|
channels_segments_calc(channel);
|
||||||
|
|
||||||
BLI_addtail(&dopesheet->channels, channel);
|
BLI_addtail(&dopesheet->channels, channel);
|
||||||
|
@ -313,10 +313,10 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
|
|||||||
else
|
else
|
||||||
UI_ThemeColor(TH_TEXT);
|
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,
|
BLF_position(fontid, v2d->cur.xmin + CHANNEL_PAD,
|
||||||
y - font_height / 2.0f, 0.0f);
|
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 */
|
/* adjust y-position for next one */
|
||||||
|
@ -76,8 +76,10 @@ static int dopesheet_select_channel_exec(bContext *C, wmOperator *op)
|
|||||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||||
MovieClip *clip = ED_space_clip(sc);
|
MovieClip *clip = ED_space_clip(sc);
|
||||||
MovieTracking *tracking = &clip->tracking;
|
MovieTracking *tracking = &clip->tracking;
|
||||||
|
MovieTrackingObject *object = BKE_tracking_active_object(tracking);
|
||||||
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
|
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
|
||||||
MovieTrackingDopesheetChannel *channel;
|
MovieTrackingDopesheetChannel *channel;
|
||||||
|
ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
|
||||||
float location[2];
|
float location[2];
|
||||||
int extend = RNA_boolean_get(op->ptr, "extend");
|
int extend = RNA_boolean_get(op->ptr, "extend");
|
||||||
int current_channel_index = 0, channel_index;
|
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) {
|
if (track->flag & TRACK_DOPE_SEL) {
|
||||||
tracking->act_track = track;
|
tracking->act_track = track;
|
||||||
|
BKE_tracking_select_track(tracksbase, track, TRACK_AREA_ALL, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!extend)
|
else if (!extend)
|
||||||
|
@ -232,6 +232,8 @@ typedef struct MovieTrackingDopesheetChannel {
|
|||||||
MovieTrackingTrack *track; /* motion track for which channel is created */
|
MovieTrackingTrack *track; /* motion track for which channel is created */
|
||||||
int pad;
|
int pad;
|
||||||
|
|
||||||
|
char name[64]; /* name of channel */
|
||||||
|
|
||||||
int tot_segment; /* total number of segments */
|
int tot_segment; /* total number of segments */
|
||||||
int *segments; /* tracked segments */
|
int *segments; /* tracked segments */
|
||||||
int max_segment, total_frames; /* longest segment length and total number of tracked frames */
|
int max_segment, total_frames; /* longest segment length and total number of tracked frames */
|
||||||
|
Loading…
Reference in New Issue
Block a user