diff options
Diffstat (limited to 'source/blender/editors/animation/anim_markers.c')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index c802ba621f1..b3338396598 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -50,6 +50,7 @@ #include "BKE_main.h" #include "BKE_report.h" #include "BKE_scene.h" +#include "BKE_screen.h" #include "WM_api.h" #include "WM_types.h" @@ -717,7 +718,7 @@ static void ed_marker_move_apply(wmOperator *op) } /* only for modal */ -static void ed_marker_move_cancel(bContext *C, wmOperator *op) +static int ed_marker_move_cancel(bContext *C, wmOperator *op) { RNA_int_set(op->ptr, "frames", 0); ed_marker_move_apply(op); @@ -725,6 +726,8 @@ static void ed_marker_move_cancel(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL); + + return OPERATOR_CANCELLED; } @@ -886,6 +889,7 @@ static void MARKER_OT_move(wmOperatorType *ot) ot->invoke= ed_marker_move_invoke_wrapper; ot->modal= ed_marker_move_modal; ot->poll= ed_markers_poll_selected_markers; + ot->cancel= ed_marker_move_cancel; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER; @@ -980,6 +984,7 @@ static void MARKER_OT_duplicate(wmOperatorType *ot) ot->invoke= ed_marker_duplicate_invoke_wrapper; ot->modal= ed_marker_move_modal; ot->poll= ed_markers_poll_selected_markers; + ot->cancel= ed_marker_move_cancel; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1185,6 +1190,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot) ot->exec= ed_marker_border_select_exec; ot->invoke= ed_marker_select_border_invoke_wrapper; ot->modal= WM_border_select_modal; + ot->cancel= WM_border_select_cancel; ot->poll= ed_markers_poll_markers_exist; @@ -1411,7 +1417,9 @@ static void MARKER_OT_make_links_scene(wmOperatorType *ot) static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op)) { + bScreen *sc= CTX_wm_screen(C); Scene *scene= CTX_data_scene(C); + Object *ob = CTX_data_active_object(C); ListBase *markers= ED_context_get_markers(C); TimeMarker *marker; @@ -1419,10 +1427,15 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op)) if(marker == NULL) return OPERATOR_CANCELLED; - marker->camera= scene->camera; + marker->camera= ob; + + /* camera may have changes */ + scene_camera_switch_update(scene); + BKE_screen_view3d_scene_sync(sc); WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL); + WM_event_add_notifier(C, NC_SCENE|NA_EDITED, scene); /* so we get view3d redraws */ return OPERATOR_FINISHED; } |