diff options
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_buttons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_editor.c | 33 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 10 |
4 files changed, 31 insertions, 16 deletions
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c index 5b2c3530aa4..ca2ae6e8461 100644 --- a/source/blender/editors/space_clip/clip_buttons.c +++ b/source/blender/editors/space_clip/clip_buttons.c @@ -168,7 +168,7 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname) scopes->track_preview_height = (scopes->track_preview_height <= UI_UNIT_Y)?UI_UNIT_Y : scopes->track_preview_height; uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, rect.xmax - rect.xmin, - scopes->track_preview_height, scopes, 0, 0, 0, 0, ""); + scopes->track_preview_height, scopes, 0, 0, 0, 0, ""); } /********************* Marker Template ************************/ diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 003fa5c5cef..47825462565 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -198,7 +198,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc clip_draw_curfra_label(sc, x, 8.0f); /* movie clip animation */ - if ((sc->mode == SC_MODE_MASKEDITING) && sc->mask) { + if ((sc->mode == SC_MODE_MASKEDIT) && sc->mask) { MaskLayer *masklay = BKE_mask_layer_active(sc->mask); if (masklay) { MaskLayerShape *masklay_shape; diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index f16ef21b707..3349a61cd86 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -129,7 +129,7 @@ int ED_space_clip_tracking_frame_poll(bContext *C) return FALSE; } -int ED_space_clip_maskediting_poll(bContext *C) +int ED_space_clip_maskedit_poll(bContext *C) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -140,9 +140,9 @@ int ED_space_clip_maskediting_poll(bContext *C) return FALSE; } -int ED_space_clip_maskediting_mask_poll(bContext *C) +int ED_space_clip_maskedit_mask_poll(bContext *C) { - if (ED_space_clip_maskediting_poll(C)) { + if (ED_space_clip_maskedit_poll(C)) { MovieClip *clip = CTX_data_edit_movieclip(C); if (clip) { @@ -282,7 +282,7 @@ void ED_space_clip_mask_aspect(SpaceClip *sc, float *aspx, float *aspy) *aspy *= (float)h; #endif - if(*aspx < *aspy) { + if (*aspx < *aspy) { *aspy= *aspy / *aspx; *aspx= 1.0f; } @@ -329,7 +329,7 @@ void ED_space_clip_aspect_dimension_aware(SpaceClip *sc, float *aspx, float *asp *aspx *= (float)w; *aspy *= (float)h; - if(*aspx < *aspy) { + if (*aspx < *aspy) { *aspy= *aspy / *aspx; *aspx= 1.0f; } @@ -544,7 +544,10 @@ typedef struct SpaceClipDrawContext { struct ImBuf *texture_ibuf; /* image buffer for which texture was created */ int image_width, image_height; /* image width and height for which texture was created */ unsigned last_texture; /* ID of previously used texture, so it'll be restored after clip drawing */ - int framenr; + + /* fields to check if cache is still valid */ + int framenr, start_frame; + short custom_start_frame; } SpaceClipDrawContext; int ED_space_clip_texture_buffer_supported(SpaceClip *sc) @@ -583,6 +586,14 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) need_rebind |= context->texture_ibuf != ibuf; need_rebind |= context->framenr != sc->user.framenr; + if (clip->flag & MCLIP_CUSTOM_START_FRAME) { + need_rebind |= context->custom_start_frame != TRUE; + need_rebind |= context->start_frame != clip->start_frame; + } + else { + need_rebind |= context->custom_start_frame != FALSE; + } + if (need_rebind) { int width = ibuf->x, height = ibuf->y; int need_recreate = 0; @@ -636,6 +647,8 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) context->image_width = ibuf->x; context->image_height = ibuf->y; context->framenr = sc->user.framenr; + context->start_frame = clip->start_frame; + context->custom_start_frame = (clip->flag & MCLIP_CUSTOM_START_FRAME) ? TRUE : FALSE; } else { /* displaying exactly the same image which was loaded t oa texture, @@ -681,7 +694,7 @@ int ED_space_clip_show_trackedit(SpaceClip *sc) int ED_space_clip_show_maskedit(SpaceClip *sc) { if (sc) { - return sc->mode == SC_MODE_MASKEDITING; + return sc->mode == SC_MODE_MASKEDIT; } return FALSE; @@ -691,9 +704,11 @@ void ED_space_clip_set_mask(bContext *C, SpaceClip *sc, Mask *mask) { sc->mask = mask; - if(sc->mask && sc->mask->id.us==0) + if (sc->mask && sc->mask->id.us==0) { sc->clip->id.us = 1; + } - if(C) + if (C) { WM_event_add_notifier(C, NC_MASK|NA_SELECTED, mask); + } } diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index b24db67cfc2..51157bc2ed4 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -367,14 +367,14 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn) } break; case NC_MASK: - switch(wmn->data) { + switch (wmn->data) { case ND_SELECT: case ND_DATA: case ND_DRAW: ED_area_tag_redraw(sa); break; } - switch(wmn->action) { + switch (wmn->action) { case NA_SELECTED: clip_scopes_tag_refresh(sa); ED_area_tag_redraw(sa); @@ -1050,7 +1050,7 @@ static void clip_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Mask Editor", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); @@ -1100,7 +1100,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) /* Grease Pencil */ clip_draw_grease_pencil((bContext *)C, 1); - if(sc->mode == SC_MODE_MASKEDITING) { + if (sc->mode == SC_MODE_MASKEDIT) { int x, y; int width, height; float zoomx, zoomy, aspx, aspy; @@ -1326,7 +1326,7 @@ static void clip_header_area_listener(ARegion *ar, wmNotifier *wmn) /* for proportional editmode only */ case ND_TOOLSETTINGS: /* TODO - should do this when in mask mode only but no datas available */ - // if(sc->mode == SC_MODE_MASKEDITING) + // if (sc->mode == SC_MODE_MASKEDIT) { ED_region_tag_redraw(ar); } |