Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_clip/tracking_ops.c
| Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static int add_marker_exec(bContext *C, wmOperator *op) | static int add_marker_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| SpaceClip *sc = CTX_wm_space_clip(C); | SpaceClip *sc = CTX_wm_space_clip(C); | ||||
| MovieClip *clip = ED_space_clip_get_clip(sc); | MovieClip *clip = ED_space_clip_get_clip(sc); | ||||
| float pos[2]; | float pos[2]; | ||||
| ClipViewLockState lock_state; | |||||
| ED_clip_view_lock_state_store(C, &lock_state); | |||||
| RNA_float_get_array(op->ptr, "location", pos); | RNA_float_get_array(op->ptr, "location", pos); | ||||
| if (!add_marker(C, pos[0], pos[1])) { | if (!add_marker(C, pos[0], pos[1])) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* Reset offset from locked position, so frame jumping wouldn't be so | ED_clip_view_lock_state_restore_no_jump(C, &lock_state); | ||||
| * confusing. | |||||
| */ | |||||
| sc->xlockof = 0; | |||||
| sc->ylockof = 0; | |||||
| WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip); | WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static int add_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int add_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 2,111 Lines • Show Last 20 Lines | |||||