From b24f204e91265891da04fbfe42d4b42650a4967a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 12 May 2022 17:15:18 +0200 Subject: Cleanup: Clarify function name and comment logic This is a bit tricky exceptional case, which originates to an original motion tracking commit. Took a while to remember what it is ab out so here is a comment for the future developers. --- source/blender/editors/space_clip/clip_intern.h | 6 +++--- source/blender/editors/space_clip/tracking_ops.c | 4 ++-- source/blender/editors/space_clip/tracking_select.c | 6 +++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h index 90ede7e951b..8e1df133189 100644 --- a/source/blender/editors/space_clip/clip_intern.h +++ b/source/blender/editors/space_clip/clip_intern.h @@ -187,10 +187,10 @@ void clip_draw_sfra_efra(struct View2D *v2d, struct Scene *scene); /* tracking_ops.c */ -/* Find track in a proximity of the given event. +/* Find track which can be slid in a proximity of the given event. * Uses the same rules w.r.t distance tolerances for track sliding and selection operators. */ -struct MovieTrackingTrack *tracking_find_track_in_proximity(struct bContext *C, - const struct wmEvent *event); +struct MovieTrackingTrack *tracking_find_slidable_track_in_proximity(struct bContext *C, + const struct wmEvent *event); void CLIP_OT_add_marker(struct wmOperatorType *ot); void CLIP_OT_add_marker_at_click(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 260f56dfe9f..239e9925997 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -655,8 +655,8 @@ static MovieTrackingTrack *tracking_marker_check_slide( return NULL; } -struct MovieTrackingTrack *tracking_find_track_in_proximity(struct bContext *C, - const struct wmEvent *event) +struct MovieTrackingTrack *tracking_find_slidable_track_in_proximity(struct bContext *C, + const struct wmEvent *event) { return tracking_marker_check_slide(C, event, NULL, NULL, NULL); } diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index 3ef32886995..5b2a1b945e7 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -405,8 +405,12 @@ static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) float co[2]; const bool extend = RNA_boolean_get(op->ptr, "extend"); + /* Special code which allows to slide a marker which belongs to currently selected but not yet + * active track. If such track is found activate it and return pass-though so that marker slide + * operator can be used immediately after. + * This logic makes it convenient to slide markers when left mouse selection is used. */ if (!extend) { - MovieTrackingTrack *track = tracking_find_track_in_proximity(C, event); + MovieTrackingTrack *track = tracking_find_slidable_track_in_proximity(C, event); if (track != NULL) { MovieClip *clip = ED_space_clip_get_clip(sc); -- cgit v1.2.3