Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_clip/tracking_ops_track.c
| Show All 19 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup spclip | * \ingroup spclip | ||||
| */ | */ | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_string.h" | |||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_movieclip.h" | #include "BKE_movieclip.h" | ||||
| #include "BKE_tracking.h" | #include "BKE_tracking.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| ▲ Show 20 Lines • Show All 357 Lines • ▼ Show 20 Lines | static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) | ||||
| switch (event->type) { | switch (event->type) { | ||||
| case EVT_ESCKEY: | case EVT_ESCKEY: | ||||
| return OPERATOR_RUNNING_MODAL; | return OPERATOR_RUNNING_MODAL; | ||||
| } | } | ||||
| return OPERATOR_PASS_THROUGH; | return OPERATOR_PASS_THROUGH; | ||||
| } | } | ||||
| static char *track_markers_desc(bContext *UNUSED(C), wmOperatorType *UNUSED(op), PointerRNA *ptr) | |||||
| { | |||||
| const bool backwards = RNA_boolean_get(ptr, "backwards"); | |||||
| const bool sequence = RNA_boolean_get(ptr, "sequence"); | |||||
| if (backwards && sequence) { | |||||
| return BLI_strdup("Tracks the selected markers backward for the entire clip"); | |||||
mont29: We try to avoid third person in UI message, just stick to the infinitive (without the 'to', so… | |||||
| } | |||||
| if (backwards && !sequence) { | |||||
| return BLI_strdup("Tracks the selected markers backward by one frame"); | |||||
| } | |||||
| if (!backwards && sequence) { | |||||
| return BLI_strdup("Tracks the selected markers forward for the entire clip"); | |||||
| } | |||||
| if (!backwards && !sequence) { | |||||
| return BLI_strdup("Tracks the selected markers forward by one frame"); | |||||
| } | |||||
| /* Use default description. */ | |||||
| return NULL; | |||||
| } | |||||
| void CLIP_OT_track_markers(wmOperatorType *ot) | void CLIP_OT_track_markers(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Track Markers"; | ot->name = "Track Markers"; | ||||
| ot->description = "Track selected markers"; | ot->description = "Track selected markers"; | ||||
| ot->idname = "CLIP_OT_track_markers"; | ot->idname = "CLIP_OT_track_markers"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->exec = track_markers_exec; | ot->exec = track_markers_exec; | ||||
| ot->invoke = track_markers_invoke; | ot->invoke = track_markers_invoke; | ||||
| ot->modal = track_markers_modal; | ot->modal = track_markers_modal; | ||||
| ot->poll = ED_space_clip_tracking_poll; | ot->poll = ED_space_clip_tracking_poll; | ||||
| ot->get_description = track_markers_desc; | |||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_UNDO; | ot->flag = OPTYPE_UNDO; | ||||
| /* properties */ | /* properties */ | ||||
| RNA_def_boolean(ot->srna, "backwards", 0, "Backwards", "Do backwards tracking"); | RNA_def_boolean(ot->srna, "backwards", 0, "Backwards", "Do backwards tracking"); | ||||
| RNA_def_boolean(ot->srna, | RNA_def_boolean(ot->srna, | ||||
| "sequence", | "sequence", | ||||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||
We try to avoid third person in UI message, just stick to the infinitive (without the 'to', so imperative?) form: Track the selected...
See also https://wiki.blender.org/wiki/Style_Guide/C_Cpp#UI_Messages
Same below of course.