diff options
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_editor.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 5 |
4 files changed, 25 insertions, 4 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 18652aabefe..d417776b1f2 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -974,6 +974,10 @@ static bool prefetch_check_early_out(const bContext *C) int first_uncached_frame, end_frame; int clip_len; + if (clip == NULL) { + return true; + } + clip_len = BKE_movieclip_get_duration(clip); /* check whether all the frames from prefetch range are cached */ diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index bb6c50d6224..0e152dbebcf 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -110,10 +110,21 @@ static void sclip_zoom_set(const bContext *C, float zoom, float location[2]) } if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) { + float dx, dy; + ED_space_clip_get_size(sc, &width, &height); - sc->xof += ((location[0] - 0.5f) * width - sc->xof) * (sc->zoom - oldzoom) / sc->zoom; - sc->yof += ((location[1] - 0.5f) * height - sc->yof) * (sc->zoom - oldzoom) / sc->zoom; + dx = ((location[0] - 0.5f) * width - sc->xof) * (sc->zoom - oldzoom) / sc->zoom; + dy= ((location[1] - 0.5f) * height - sc->yof) * (sc->zoom - oldzoom) / sc->zoom; + + if (sc->flag & SC_LOCK_SELECTION) { + sc->xlockof += dx; + sc->ylockof += dy; + } + else { + sc->xof += dx; + sc->yof += dy; + } } } diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 2f1d78b2ccd..c56bc33ef15 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -577,7 +577,10 @@ static void clip_keymap(struct wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "sequence", TRUE); /* mode */ - WM_keymap_add_menu(keymap, "CLIP_MT_select_mode", TABKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", TABKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.mode"); + RNA_string_set(kmi->ptr, "value_1", "TRACKING"); + RNA_string_set(kmi->ptr, "value_2", "MASK"); WM_keymap_add_item(keymap, "CLIP_OT_solve_camera", SKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 6f44b47ed61..2b7bb01cea1 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -1309,10 +1309,13 @@ static void track_markers_updatejob(void *tmv) static void track_markers_endjob(void *tmv) { TrackMarkersJob *tmj = (TrackMarkersJob *)tmv; + wmWindowManager *wm = tmj->main->wm.first; tmj->clip->tracking_context = NULL; tmj->scene->r.cfra = BKE_movieclip_remap_clip_to_scene_frame(tmj->clip, tmj->lastfra); - ED_update_for_newframe(tmj->main, tmj->scene, 0); + if (wm != NULL) { + ED_update_for_newframe(tmj->main, tmj->scene, 0); + } BKE_tracking_context_sync(tmj->context); BKE_tracking_context_finish(tmj->context); |