diff options
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_buttons.c | 69 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_dopesheet_draw.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_dopesheet_ops.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_editor.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_draw.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_toolbar.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_utils.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 31 | ||||
-rw-r--r-- | source/blender/editors/space_clip/tracking_select.c | 8 |
13 files changed, 66 insertions, 93 deletions
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c index 889613b5d13..f8299a8d335 100644 --- a/source/blender/editors/space_clip/clip_buttons.c +++ b/source/blender/editors/space_clip/clip_buttons.c @@ -69,26 +69,9 @@ /* Panels */ -static int clip_grease_pencil_panel_poll(const bContext *C, PanelType *UNUSED(pt)) +void ED_clip_buttons_register(ARegionType *UNUSED(art)) { - SpaceClip *sc = CTX_wm_space_clip(C); - return sc->view == SC_VIEW_CLIP; -} - -void ED_clip_buttons_register(ARegionType *art) -{ - PanelType *pt; - - pt = MEM_callocN(sizeof(PanelType), "spacetype clip panel gpencil"); - strcpy(pt->idname, "CLIP_PT_gpencil"); - strcpy(pt->label, N_("Grease Pencil")); - strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); - pt->draw_header = ED_gpencil_panel_standard_header; - pt->draw = ED_gpencil_panel_standard; - pt->flag |= PNL_DEFAULT_CLOSED; - pt->poll = clip_grease_pencil_panel_poll; - BLI_addtail(&art->paneltypes, pt); } /********************* MovieClip Template ************************/ @@ -130,7 +113,7 @@ void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, const c row = uiLayoutRow(layout, false); block = uiLayoutGetBlock(row); - uiDefBut(block, LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, NULL, 0, 0, 0, 0, ""); + uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, NULL, 0, 0, 0, 0, ""); row = uiLayoutRow(layout, false); split = uiLayoutSplit(row, 0.0f, false); @@ -183,10 +166,10 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname) col = uiLayoutColumn(layout, true); block = uiLayoutGetBlock(col); - uiDefBut(block, TRACKPREVIEW, 0, "", 0, 0, UI_UNIT_X * 10, scopes->track_preview_height, scopes, 0, 0, 0, 0, ""); + uiDefBut(block, UI_BTYPE_TRACK_PREVIEW, 0, "", 0, 0, UI_UNIT_X * 10, scopes->track_preview_height, scopes, 0, 0, 0, 0, ""); /* Resize grip. */ - uiDefIconButI(block, GRIP, 0, ICON_GRIP, 0, 0, UI_UNIT_X * 10, (short)(UI_UNIT_Y * 0.8f), + uiDefIconButI(block, UI_BTYPE_GRIP, 0, ICON_GRIP, 0, 0, UI_UNIT_X * 10, (short)(UI_UNIT_Y * 0.8f), &scopes->track_preview_height, UI_UNIT_Y, UI_UNIT_Y * 20.0f, 0.0f, 0.0f, ""); } @@ -403,9 +386,9 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P else tip = TIP_("Marker is enabled at current frame"); - bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, UI_UNIT_X, UI_UNIT_Y, + bt = uiDefIconButBitI(block, UI_BTYPE_TOGGLE_N, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, UI_UNIT_X, UI_UNIT_Y, &cb->marker_flag, 0, 0, 1, 0, tip); - uiButSetNFunc(bt, marker_update_cb, cb, NULL); + UI_but_funcN_set(bt, marker_update_cb, cb, NULL); } else { int width, height, step, digits; @@ -417,7 +400,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P if (track->flag & TRACK_LOCKED) { uiLayoutSetActive(layout, false); block = uiLayoutAbsoluteBlock(layout); - uiDefBut(block, LABEL, 0, IFACE_("Track is locked"), 0, 0, UI_UNIT_X * 15.0f, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("Track is locked"), 0, 0, UI_UNIT_X * 15.0f, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); return; } @@ -442,53 +425,53 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P cb->marker_flag = marker->flag; block = uiLayoutAbsoluteBlock(layout); - uiBlockSetHandleFunc(block, marker_block_handler, cb); - uiBlockSetNFunc(block, marker_update_cb, cb, NULL); + UI_block_func_handle_set(block, marker_block_handler, cb); + UI_block_funcN_set(block, marker_update_cb, cb, NULL); if (cb->marker_flag & MARKER_DISABLED) tip = TIP_("Marker is disabled at current frame"); else tip = TIP_("Marker is enabled at current frame"); - uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 0.5 * UI_UNIT_X, 9.5 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, + uiDefButBitI(block, UI_BTYPE_CHECKBOX_N, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 0.5 * UI_UNIT_X, 9.5 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_flag, 0, 0, 0, 0, tip); col = uiLayoutColumn(layout, true); uiLayoutSetActive(col, (cb->marker_flag & MARKER_DISABLED) == 0); block = uiLayoutAbsoluteBlock(col); - uiBlockBeginAlign(block); + UI_block_align_begin(block); - uiDefBut(block, LABEL, 0, IFACE_("Position:"), 0, 10 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_MARKER_POS, IFACE_("X:"), 0.5 * UI_UNIT_X, 9 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pos[0], + uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("Position:"), 0, 10 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_POS, IFACE_("X:"), 0.5 * UI_UNIT_X, 9 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pos[0], -10 * width, 10.0 * width, step, digits, TIP_("X-position of marker at frame in screen coordinates")); - uiDefButF(block, NUM, B_MARKER_POS, IFACE_("Y:"), 8.25 * UI_UNIT_X, 9 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pos[1], + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_POS, IFACE_("Y:"), 8.25 * UI_UNIT_X, 9 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pos[1], -10 * height, 10.0 * height, step, digits, TIP_("Y-position of marker at frame in screen coordinates")); - uiDefBut(block, LABEL, 0, IFACE_("Offset:"), 0, 8 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("X:"), 0.5 * UI_UNIT_X, 7 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->track_offset[0], + uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("Offset:"), 0, 8 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_OFFSET, IFACE_("X:"), 0.5 * UI_UNIT_X, 7 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->track_offset[0], -10 * width, 10.0 * width, step, digits, TIP_("X-offset to parenting point")); - uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("Y:"), 8.25 * UI_UNIT_X, 7 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->track_offset[1], + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_OFFSET, IFACE_("Y:"), 8.25 * UI_UNIT_X, 7 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->track_offset[1], -10 * height, 10.0 * height, step, digits, TIP_("Y-offset to parenting point")); - uiDefBut(block, LABEL, 0, IFACE_("Pattern Area:"), 0, 6 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Width:"), 0.5 * UI_UNIT_X, 5 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pat[0], 3.0f, + uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("Pattern Area:"), 0, 6 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_PAT_DIM, IFACE_("Width:"), 0.5 * UI_UNIT_X, 5 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pat[0], 3.0f, 10.0 * width, step, digits, TIP_("Width of marker's pattern in screen coordinates")); - uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Height:"), 0.5 * UI_UNIT_X, 4 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pat[1], 3.0f, + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_PAT_DIM, IFACE_("Height:"), 0.5 * UI_UNIT_X, 4 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pat[1], 3.0f, 10.0 * height, step, digits, TIP_("Height of marker's pattern in screen coordinates")); - uiDefBut(block, LABEL, 0, IFACE_("Search Area:"), 0, 3 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("X:"), 0.5 * UI_UNIT_X, 2 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search_pos[0], + uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("Search Area:"), 0, 3 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_SEARCH_POS, IFACE_("X:"), 0.5 * UI_UNIT_X, 2 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search_pos[0], -width, width, step, digits, TIP_("X-position of search at frame relative to marker's position")); - uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("Y:"), 8.25 * UI_UNIT_X, 2 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search_pos[1], + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_SEARCH_POS, IFACE_("Y:"), 8.25 * UI_UNIT_X, 2 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search_pos[1], -height, height, step, digits, TIP_("Y-position of search at frame relative to marker's position")); - uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Width:"), 0.5 * UI_UNIT_X, 1 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search[0], 3.0f, + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_SEARCH_DIM, IFACE_("Width:"), 0.5 * UI_UNIT_X, 1 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search[0], 3.0f, 10.0 * width, step, digits, TIP_("Width of marker's search in screen coordinates")); - uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Height:"), 0.5 * UI_UNIT_X, 0 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search[1], 3.0f, + uiDefButF(block, UI_BTYPE_NUM, B_MARKER_SEARCH_DIM, IFACE_("Height:"), 0.5 * UI_UNIT_X, 0 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search[1], 3.0f, 10.0 * height, step, digits, TIP_("Height of marker's search in screen coordinates")); - uiBlockEndAlign(block); + UI_block_align_end(block); } } diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index 2a457bf503f..4bf4c1e7baa 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -30,7 +30,6 @@ */ #include "DNA_movieclip_types.h" -#include "DNA_object_types.h" /* SELECT */ #include "DNA_scene_types.h" #include "BLI_utildefines.h" @@ -283,7 +282,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar) MovieTracking *tracking; MovieTrackingDopesheet *dopesheet; MovieTrackingDopesheetChannel *channel; - uiStyle *style = UI_GetStyle(); + uiStyle *style = UI_style_get(); uiBlock *block; int fontid = style->widget.uifont_id; int height; @@ -348,7 +347,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar) } /* second pass: widgets */ - block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); + block = UI_block_begin(C, ar, __func__, UI_EMBOSS); y = (float) CHANNEL_FIRST; /* get RNA properties (once) */ @@ -370,11 +369,11 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar) RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track, &ptr); - uiBlockSetEmboss(block, UI_EMBOSSN); - uiDefIconButR_prop(block, ICONTOG, 1, icon, + UI_block_emboss_set(block, UI_EMBOSS_NONE); + uiDefIconButR_prop(block, UI_BTYPE_ICON_TOGGLE, 1, icon, v2d->cur.xmax - UI_UNIT_X - CHANNEL_PAD, y - UI_UNIT_Y / 2.0f, UI_UNIT_X, UI_UNIT_Y, &ptr, chan_prop_lock, 0, 0, 0, 0, 0, NULL); - uiBlockSetEmboss(block, UI_EMBOSS); + UI_block_emboss_set(block, UI_EMBOSS); } /* adjust y-position for next one */ @@ -382,6 +381,6 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar) } glDisable(GL_BLEND); - uiEndBlock(C, block); - uiDrawBlock(C, block); + UI_block_end(C, block); + UI_block_draw(C, block); } diff --git a/source/blender/editors/space_clip/clip_dopesheet_ops.c b/source/blender/editors/space_clip/clip_dopesheet_ops.c index 7ae5eda7139..d2f2fdd0b46 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_ops.c +++ b/source/blender/editors/space_clip/clip_dopesheet_ops.c @@ -29,7 +29,6 @@ * \ingroup spclip */ -#include "DNA_object_types.h" /* SELECT */ #include "DNA_scene_types.h" #include "BLI_utildefines.h" diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index a35251e71ef..6f63979b8fa 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -63,7 +63,6 @@ #include "UI_resources.h" #include "UI_view2d.h" -#include "RNA_access.h" #include "BLF_api.h" diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index f25f035db32..89693a403fe 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -57,7 +57,6 @@ #include "BKE_tracking.h" #include "BKE_library.h" -#include "GPU_extensions.h" #include "IMB_colormanagement.h" #include "IMB_imbuf_types.h" diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 723c8bd144a..2c3b8acf672 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -50,7 +50,6 @@ #include "UI_resources.h" #include "UI_view2d.h" -#include "BLF_api.h" #include "clip_intern.h" // own include diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index d1e2c770ade..2a2f15c94bb 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -45,8 +45,6 @@ #include "ED_screen.h" #include "ED_clip.h" -#include "UI_interface.h" - #include "RNA_access.h" #include "RNA_define.h" diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 9f7bcae800a..9f9ac66de60 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -168,7 +168,7 @@ static void open_init(bContext *C, wmOperator *op) PropertyPointerRNA *pprop; op->customdata = pprop = MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA"); - uiIDContextProperty(C, &pprop->ptr, &pprop->prop); + UI_context_active_but_prop_get_templateID(C, &pprop->ptr, &pprop->prop); } static void open_cancel(bContext *UNUSED(C), wmOperator *op) @@ -1307,7 +1307,14 @@ static void proxy_endjob(void *pjv) if (pj->index_context) IMB_anim_index_rebuild_finish(pj->index_context, pj->stop); - BKE_movieclip_reload(pj->clip); + if (pj->clip->source == MCLIP_SRC_MOVIE) { + /* Timecode might have changed, so do a full reload to deal with this. */ + BKE_movieclip_reload(pj->clip); + } + else { + /* For image sequences we'll preserve original cache. */ + BKE_movieclip_clear_proxy_cache(pj->clip); + } WM_main_add_notifier(NC_MOVIECLIP | ND_DISPLAY, pj->clip); } diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c index 55b78219770..608c1136070 100644 --- a/source/blender/editors/space_clip/clip_toolbar.c +++ b/source/blender/editors/space_clip/clip_toolbar.c @@ -242,7 +242,7 @@ static void clip_panel_operator_redo(const bContext *C, Panel *pa) uiLayoutSetEnabled(pa->layout, false); /* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */ - uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op); + UI_block_func_handle_set(block, ED_undo_operator_repeat_cb_evt, op); clip_panel_operator_redo_operator(C, pa, op); } diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index a79ac1f7b82..5f919c9b51d 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -30,12 +30,10 @@ */ #include "DNA_scene_types.h" -#include "DNA_object_types.h" /* SELECT */ #include "MEM_guardedalloc.h" #include "BLI_utildefines.h" -#include "BLI_math.h" #include "BLI_listbase.h" #include "BLI_string.h" @@ -54,8 +52,6 @@ #include "ED_screen.h" #include "ED_clip.h" -#include "RNA_access.h" -#include "RNA_define.h" #include "UI_interface.h" #include "UI_resources.h" diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index a797a60f74c..fc2c0d3d45c 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -55,7 +55,7 @@ #include "ED_screen.h" #include "ED_clip.h" #include "ED_transform.h" -#include "ED_uvedit.h" /* just for draw_image_cursor */ +#include "ED_uvedit.h" /* just for ED_image_draw_cursor */ #include "IMB_imbuf.h" @@ -420,6 +420,9 @@ static void clip_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn) clip_scopes_check_gpencil_change(sa); ED_area_tag_redraw(sa); } + else if (wmn->data & ND_GPENCIL_EDITMODE) { + ED_area_tag_redraw(sa); + } break; } } @@ -1159,7 +1162,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) /* if tracking is in progress, we should synchronize framenr from clipuser * so latest tracked frame would be shown */ if (clip && clip->tracking_context) - BKE_tracking_context_sync_user(clip->tracking_context, &sc->user); + BKE_autotrack_context_sync_user(clip->tracking_context, &sc->user); if (sc->flag & SC_LOCK_SELECTION) { ImBuf *tmpibuf = NULL; @@ -1218,7 +1221,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) glScalef(zoomx, zoomy, 0); glMultMatrixf(sc->stabmat); glScalef(width, height, 0); - draw_image_cursor(ar, sc->cursor); + ED_image_draw_cursor(ar, sc->cursor); glPopMatrix(); } @@ -1245,6 +1248,8 @@ static void clip_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), AR case NC_GPENCIL: if (wmn->action == NA_EDITED) ED_region_tag_redraw(ar); + else if (wmn->data & ND_GPENCIL_EDITMODE) + ED_region_tag_redraw(ar); break; } } @@ -1495,7 +1500,7 @@ static void clip_properties_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(s /* context changes */ switch (wmn->category) { case NC_GPENCIL: - if (wmn->data == ND_DATA) + if (ELEM(wmn->data, ND_DATA, ND_GPENCIL_EDITMODE)) ED_region_tag_redraw(ar); break; case NC_BRUSH: diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index fb6b1a0033c..742e58d80dd 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -41,7 +41,6 @@ #include "BLI_utildefines.h" #include "BLI_math.h" #include "BLI_listbase.h" -#include "BLI_rect.h" #include "BLI_blenlib.h" #include "BKE_main.h" @@ -65,7 +64,6 @@ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -#include "UI_interface.h" #include "RNA_access.h" #include "RNA_define.h" @@ -74,7 +72,6 @@ #include "PIL_time.h" -#include "UI_view2d.h" #include "clip_intern.h" // own include @@ -1083,7 +1080,7 @@ void CLIP_OT_slide_marker(wmOperatorType *ot) /********************** track operator *********************/ typedef struct TrackMarkersJob { - struct MovieTrackingContext *context; /* tracking context */ + struct AutoTrackContext *context; /* tracking context */ int sfra, efra, lastfra; /* Start, end and recently tracked frames */ int backwards; /* Backwards tracking flag */ MovieClip *clip; /* Clip which is tracking */ @@ -1231,7 +1228,7 @@ static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backward tmj->delay /= 2; } - tmj->context = BKE_tracking_context_new(clip, &sc->user, backwards, 1); + tmj->context = BKE_autotrack_context_new(clip, &sc->user, backwards, 1); clip->tracking_context = tmj->context; @@ -1265,14 +1262,14 @@ static void track_markers_startjob(void *tmv, short *stop, short *do_update, flo double start_time = PIL_check_seconds_timer(), exec_time; - if (!BKE_tracking_context_step(tmj->context)) + if (!BKE_autotrack_context_step(tmj->context)) break; exec_time = PIL_check_seconds_timer() - start_time; if (tmj->delay > (float)exec_time) PIL_sleep_ms(tmj->delay - (float)exec_time); } - else if (!BKE_tracking_context_step(tmj->context)) + else if (!BKE_autotrack_context_step(tmj->context)) break; *do_update = true; @@ -1296,7 +1293,7 @@ static void track_markers_updatejob(void *tmv) { TrackMarkersJob *tmj = (TrackMarkersJob *)tmv; - BKE_tracking_context_sync(tmj->context); + BKE_autotrack_context_sync(tmj->context); } static void track_markers_endjob(void *tmv) @@ -1310,8 +1307,8 @@ static void track_markers_endjob(void *tmv) ED_update_for_newframe(tmj->main, tmj->scene, 0); } - BKE_tracking_context_sync(tmj->context); - BKE_tracking_context_finish(tmj->context); + BKE_autotrack_context_sync(tmj->context); + BKE_autotrack_context_finish(tmj->context); WM_main_add_notifier(NC_SCENE | ND_FRAME, tmj->scene); } @@ -1319,7 +1316,7 @@ static void track_markers_endjob(void *tmv) static void track_markers_freejob(void *tmv) { TrackMarkersJob *tmj = (TrackMarkersJob *)tmv; - BKE_tracking_context_free(tmj->context); + BKE_autotrack_context_free(tmj->context); MEM_freeN(tmj); } @@ -1328,7 +1325,7 @@ static int track_markers_exec(bContext *C, wmOperator *op) SpaceClip *sc; MovieClip *clip; Scene *scene = CTX_data_scene(C); - struct MovieTrackingContext *context; + struct AutoTrackContext *context; MovieClipUser *user, fake_user = {0}; int framenr, sfra, efra; const bool backwards = RNA_boolean_get(op->ptr, "backwards"); @@ -1388,10 +1385,10 @@ static int track_markers_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* do not disable tracks due to threshold when tracking frame-by-frame */ - context = BKE_tracking_context_new(clip, user, backwards, sequence); + context = BKE_autotrack_context_new(clip, user, backwards, sequence); while (framenr != efra) { - if (!BKE_tracking_context_step(context)) + if (!BKE_autotrack_context_step(context)) break; if (backwards) framenr--; @@ -1401,9 +1398,9 @@ static int track_markers_exec(bContext *C, wmOperator *op) break; } - BKE_tracking_context_sync(context); - BKE_tracking_context_finish(context); - BKE_tracking_context_free(context); + BKE_autotrack_context_sync(context); + BKE_autotrack_context_finish(context); + BKE_autotrack_context_free(context); /* update scene current frame to the lastes tracked frame */ scene->r.cfra = BKE_movieclip_remap_clip_to_scene_frame(clip, framenr); diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index 860d9dc6b3c..bc6ac507f03 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -36,7 +36,6 @@ #include "BLI_utildefines.h" #include "BLI_math.h" -#include "BLI_listbase.h" #include "BLI_rect.h" #include "BLI_lasso.h" @@ -49,16 +48,9 @@ #include "ED_screen.h" #include "ED_clip.h" -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "UI_interface.h" - #include "RNA_access.h" #include "RNA_define.h" -#include "PIL_time.h" - #include "UI_view2d.h" #include "clip_intern.h" // own include |