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:
Diffstat (limited to 'source/blender/editors/space_clip/tracking_ops.c')
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 05a84f04cd4..a4592e9fc25 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1824,13 +1824,20 @@ static int clear_track_path_exec(bContext *C, wmOperator *op)
MovieTrackingTrack *track;
ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
int action= RNA_enum_get(op->ptr, "action");
+ int clear_active= RNA_boolean_get(op->ptr, "clear_active");
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track))
- BKE_tracking_clear_path(track, sc->user.framenr, action);
+ if (clear_active) {
+ track= BKE_tracking_active_track(&clip->tracking);
+ BKE_tracking_clear_path(track, sc->user.framenr, action);
+ }
+ else {
+ track= tracksbase->first;
+ while(track) {
+ if(TRACK_VIEW_SELECTED(sc, track))
+ BKE_tracking_clear_path(track, sc->user.framenr, action);
- track= track->next;
+ track= track->next;
+ }
}
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip);
@@ -1861,6 +1868,7 @@ void CLIP_OT_clear_track_path(wmOperatorType *ot)
/* proeprties */
RNA_def_enum(ot->srna, "action", clear_path_actions, TRACK_CLEAR_REMAINED, "Action", "Clear action to execute");
+ RNA_def_boolean(ot->srna, "clear_active", 0, "Clear Active", "Clear active track only instead of all selected tracks");
}
/********************** disable markers operator *********************/