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@blender.org>2022-05-12 18:15:18 +0300
committerSergey Sharybin <sergey@blender.org>2022-05-12 18:20:54 +0300
commitb24f204e91265891da04fbfe42d4b42650a4967a (patch)
tree5644d4fb906ea9a0d30f62e2ad180d07b9473682
parentccd18691fcc6441bf1c53956c931b1148b37d3f3 (diff)
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.
-rw-r--r--source/blender/editors/space_clip/clip_intern.h6
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c4
-rw-r--r--source/blender/editors/space_clip/tracking_select.c6
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);