diff options
Diffstat (limited to 'source/blender/editors')
19 files changed, 216 insertions, 212 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index ed530bea4bd..3f53f0403d7 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -146,7 +146,7 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr) case SPACE_CLIP: /* Nodes Editor */ { SpaceClip *sc = (SpaceClip *)CTX_wm_space_data(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (clip) { if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) { diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h index 9284f547047..3a9d73ccf10 100644 --- a/source/blender/editors/include/ED_clip.h +++ b/source/blender/editors/include/ED_clip.h @@ -41,7 +41,7 @@ struct MovieClip; struct SpaceClip; struct wmEvent; -/* clip_editor.c */ +/* ** clip_editor.c ** */ int ED_space_clip_poll(struct bContext *C); int ED_space_clip_view_clip_poll(struct bContext *C); @@ -50,18 +50,16 @@ int ED_space_clip_tracking_poll(struct bContext *C); int ED_space_clip_maskedit_poll(struct bContext *C); int ED_space_clip_maskedit_mask_poll(bContext *C); -void ED_space_clip_set(struct bContext *C, struct bScreen *screen, struct SpaceClip *sc, struct MovieClip *clip); -struct MovieClip *ED_space_clip(struct SpaceClip *sc); -struct Mask *ED_space_clip_mask(struct SpaceClip *sc); -void ED_space_clip_size(struct SpaceClip *sc, int *width, int *height); -void ED_space_clip_zoom(struct SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy); -void ED_space_clip_aspect(struct SpaceClip *sc, float *aspx, float *aspy); -void ED_space_clip_aspect_dimension_aware(struct SpaceClip *sc, float *aspx, float *aspy); +struct MovieClip *ED_space_clip_get_clip(struct SpaceClip *sc); +void ED_space_clip_set_clip(struct bContext *C, struct bScreen *screen, struct SpaceClip *sc, struct MovieClip *clip); -int ED_space_clip_clip_framenr(struct SpaceClip *sc); +void ED_space_clip_get_zoom(struct SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy); -void ED_space_clip_mask_size(struct SpaceClip *sc, int *width, int *height); -void ED_space_clip_mask_aspect(struct SpaceClip *sc, float *aspx, float *aspy); +void ED_space_clip_get_clip_size(struct SpaceClip *sc, int *width, int *height); +void ED_space_clip_get_clip_aspect(struct SpaceClip *sc, float *aspx, float *aspy); +void ED_space_clip_get_clip_aspect_dimension_aware(struct SpaceClip *sc, float *aspx, float *aspy); + +int ED_space_clip_get_clip_frame_number(struct SpaceClip *sc); struct ImBuf *ED_space_clip_get_buffer(struct SpaceClip *sc); struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2], float *scale, float *angle); @@ -69,21 +67,27 @@ struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2] void ED_clip_update_frame(const struct Main *mainp, int cfra); int ED_clip_view_selection(struct SpaceClip *sc, struct ARegion *ar, int fit); -void ED_clip_point_undistorted_pos(SpaceClip * sc, const float co[2], float r_co[2]); +void ED_clip_point_undistorted_pos(SpaceClip *sc, const float co[2], float r_co[2]); void ED_clip_point_stable_pos(const struct bContext *C, float x, float y, float *xr, float *yr); void ED_clip_point_stable_pos__reverse(SpaceClip *sc, ARegion *ar, const float co[2], float r_co[2]); void ED_clip_mouse_pos(const struct bContext *C, struct wmEvent *event, float co[2]); +int ED_space_clip_check_show_trackedit(struct SpaceClip *sc); +int ED_space_clip_check_show_maskedit(struct SpaceClip *sc); + +void ED_space_clip_get_mask_size(struct SpaceClip *sc, int *width, int *height); +void ED_space_clip_get_mask_aspect(struct SpaceClip *sc, float *aspx, float *aspy); + +struct Mask *ED_space_clip_get_mask(struct SpaceClip *sc); +void ED_space_clip_set_mask(struct bContext *C, struct SpaceClip *sc, struct Mask *mask); + +/* textures buffer */ int ED_space_clip_texture_buffer_supported(struct SpaceClip *sc); int ED_space_clip_load_movieclip_buffer(struct SpaceClip *sc, struct ImBuf *ibuf); void ED_space_clip_unload_movieclip_buffer(struct SpaceClip *sc); void ED_space_clip_free_texture_buffer(struct SpaceClip *sc); -int ED_space_clip_show_trackedit(struct SpaceClip *sc); -int ED_space_clip_show_maskedit(struct SpaceClip *sc); -void ED_space_clip_set_mask(struct bContext *C, struct SpaceClip *sc, struct Mask *mask); - -/* clip_ops.c */ +/* ** clip_ops.c ** */ void ED_operatormacros_clip(void); -#endif /* ED_TEXT_H */ +#endif /* ED_CLIP_H */ diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 3396f664820..fdf72043464 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -138,7 +138,7 @@ void ED_mask_size(const bContext *C, int *width, int *height) if (sa && sa->spacedata.first) { if (sa->spacetype == SPACE_CLIP) { SpaceClip *sc = sa->spacedata.first; - ED_space_clip_mask_size(sc, width, height); + ED_space_clip_get_mask_size(sc, width, height); return; } else if (sa->spacetype == SPACE_SEQ) { @@ -159,7 +159,7 @@ void ED_mask_aspect(const bContext *C, float *aspx, float *aspy) SpaceClip *sc = CTX_wm_space_clip(C); if (sc) { - ED_space_clip_mask_aspect(sc, aspx, aspy); + ED_space_clip_get_mask_aspect(sc, aspx, aspy); } else { /* possible other spaces from which mask editing is available */ @@ -177,9 +177,9 @@ void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley) int width, height; float zoomx, zoomy, aspx, aspy; - ED_space_clip_size(sc, &width, &height); - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); *scalex = ((float)width * aspx) * zoomx; *scaley = ((float)height * aspy) * zoomy; diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index 55e09529320..e34823278cb 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -595,8 +595,8 @@ static int circle_select_exec(bContext *C, wmOperator *op) /* TODO - make generic! - this is SpaceClip only! */ /* compute ellipse and position in unified coordinates */ - ED_space_clip_size(sc, &width, &height); - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); width = height = MAX2(width, height); ellipse[0] = width * zoomx / radius; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 55fb130e2c0..cacd6d01291 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -460,7 +460,7 @@ int ED_operator_mask(bContext *C) { SpaceClip *sc= CTX_wm_space_clip(C); - return ED_space_clip_show_maskedit(sc); + return ED_space_clip_check_show_maskedit(sc); } /* *************************** action zone operator ************************** */ diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index 361a3a7d906..83d895067cc 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -146,7 +146,7 @@ static void draw_keyframe_shape(float x, float y, float xscale, float yscale, sh void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); View2D *v2d = &ar->v2d; /* frame range */ @@ -256,7 +256,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar) ScrArea *sa = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); View2D *v2d = &ar->v2d; - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking; MovieTrackingDopesheet *dopesheet; MovieTrackingDopesheetChannel *channel; diff --git a/source/blender/editors/space_clip/clip_dopesheet_ops.c b/source/blender/editors/space_clip/clip_dopesheet_ops.c index 716994f7487..6d1610f3f91 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_ops.c +++ b/source/blender/editors/space_clip/clip_dopesheet_ops.c @@ -91,7 +91,7 @@ static int dopesheet_select_channel_poll(bContext *C) static int dopesheet_select_channel_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *object = BKE_tracking_object_get_active(tracking); MovieTrackingDopesheet *dopesheet = &tracking->dopesheet; diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index f5d1f132b56..9b9e2223ae6 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -226,7 +226,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc static void draw_movieclip_notes(SpaceClip *sc, ARegion *ar) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; char str[256] = {0}; int block = FALSE; @@ -255,7 +255,7 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, int width, int height, float zoomx, float zoomy) { int x, y; - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); /* find window pixel coordinates of origin */ UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y); @@ -344,7 +344,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin if (count == 0) return; - start_frame = framenr = ED_space_clip_clip_framenr(sc); + start_frame = framenr = ED_space_clip_get_clip_frame_number(sc); marker = BKE_tracking_marker_get(track, framenr); if (marker->framenr != framenr || marker->flag & MARKER_DISABLED) @@ -924,7 +924,7 @@ static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTra if (marker->flag & MARKER_DISABLED) strcpy(state, "disabled"); - else if (marker->framenr != ED_space_clip_clip_framenr(sc)) + else if (marker->framenr != ED_space_clip_get_clip_frame_number(sc)) strcpy(state, "estimated"); else if (marker->flag & MARKER_TRACKED) strcpy(state, "tracked"); @@ -972,7 +972,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip, ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track, *act_track; MovieTrackingMarker *marker; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); int undistort = sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT; float *marker_pos = NULL, *fp, *active_pos = NULL, cur_pos[2]; @@ -1410,7 +1410,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); ImBuf *ibuf; int width, height; float zoomx, zoomy; @@ -1419,8 +1419,8 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene) if (!clip) return; - ED_space_clip_size(sc, &width, &height); - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); if (sc->flag & SC_SHOW_STABLE) { float smat[4][4], ismat[4][4]; @@ -1476,7 +1476,7 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene) void clip_draw_grease_pencil(bContext *C, int onlyv2d) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (!clip) return; diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index aeddb24d84d..4dd2f82df02 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -91,7 +91,7 @@ int ED_space_clip_tracking_poll(bContext *C) SpaceClip *sc = CTX_wm_space_clip(C); if (sc && sc->clip) - return ED_space_clip_show_trackedit(sc); + return ED_space_clip_check_show_trackedit(sc); return FALSE; } @@ -101,7 +101,7 @@ int ED_space_clip_maskedit_poll(bContext *C) SpaceClip *sc = CTX_wm_space_clip(C); if (sc && sc->clip) { - return ED_space_clip_show_maskedit(sc); + return ED_space_clip_check_show_maskedit(sc); } return FALSE; @@ -124,7 +124,7 @@ int ED_space_clip_maskedit_mask_poll(bContext *C) /* ******** editing functions ******** */ -void ED_space_clip_set(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip) +void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip) { MovieClip *old_clip; @@ -160,12 +160,12 @@ void ED_space_clip_set(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *c WM_event_add_notifier(C, NC_MOVIECLIP | NA_SELECTED, sc->clip); } -MovieClip *ED_space_clip(SpaceClip *sc) +MovieClip *ED_space_clip_get_clip(SpaceClip *sc) { return sc->clip; } -Mask *ED_space_clip_mask(SpaceClip *sc) +Mask *ED_space_clip_get_mask(SpaceClip *sc) { return sc->mask; } @@ -204,7 +204,7 @@ ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale return NULL; } -void ED_space_clip_size(SpaceClip *sc, int *width, int *height) +void ED_space_clip_get_clip_size(SpaceClip *sc, int *width, int *height) { if (!sc->clip) { *width = *height = 0; @@ -214,7 +214,7 @@ void ED_space_clip_size(SpaceClip *sc, int *width, int *height) } } -void ED_space_clip_mask_size(SpaceClip *sc, int *width, int *height) +void ED_space_clip_get_mask_size(SpaceClip *sc, int *width, int *height) { /* quite the same as ED_space_clip_size, but it also runs aspect correction on output resolution * this is needed because mask should be rasterized with exactly the same resolution as @@ -228,20 +228,20 @@ void ED_space_clip_mask_size(SpaceClip *sc, int *width, int *height) } else { float aspx, aspy; - ED_space_clip_size(sc, width, height); - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_size(sc, width, height); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); *width *= aspx; *height *= aspy; } } -void ED_space_clip_mask_aspect(SpaceClip *sc, float *aspx, float *aspy) +void ED_space_clip_get_mask_aspect(SpaceClip *sc, float *aspx, float *aspy) { int w, h; - ED_space_clip_aspect(sc, aspx, aspy); - ED_space_clip_size(sc, &w, &h); + ED_space_clip_get_clip_aspect(sc, aspx, aspy); + ED_space_clip_get_clip_size(sc, &w, &h); /* now this is not accounted for! */ #if 0 @@ -259,19 +259,19 @@ void ED_space_clip_mask_aspect(SpaceClip *sc, float *aspx, float *aspy) } } -void ED_space_clip_zoom(SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy) +void ED_space_clip_get_zoom(SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy) { int width, height; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); *zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1) / (float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin) * width); *zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1) / (float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin) * height); } -void ED_space_clip_aspect(SpaceClip *sc, float *aspx, float *aspy) +void ED_space_clip_get_clip_aspect(SpaceClip *sc, float *aspx, float *aspy) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (clip) BKE_movieclip_aspect(clip, aspx, aspy); @@ -279,7 +279,7 @@ void ED_space_clip_aspect(SpaceClip *sc, float *aspx, float *aspy) *aspx = *aspy = 1.0f; } -void ED_space_clip_aspect_dimension_aware(SpaceClip *sc, float *aspx, float *aspy) +void ED_space_clip_get_clip_aspect_dimension_aware(SpaceClip *sc, float *aspx, float *aspy) { int w, h; @@ -290,8 +290,8 @@ void ED_space_clip_aspect_dimension_aware(SpaceClip *sc, float *aspx, float *asp * mainly this is sued for transformation stuff */ - ED_space_clip_aspect(sc, aspx, aspy); - ED_space_clip_size(sc, &w, &h); + ED_space_clip_get_clip_aspect(sc, aspx, aspy); + ED_space_clip_get_clip_size(sc, &w, &h); *aspx *= (float)w; *aspy *= (float)h; @@ -330,23 +330,23 @@ void ED_clip_update_frame(const Main *mainp, int cfra) } /* return current frame number in clip space */ -int ED_space_clip_clip_framenr(SpaceClip *sc) +int ED_space_clip_get_clip_frame_number(SpaceClip *sc) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); return BKE_movieclip_remap_scene_to_clip_frame(clip, sc->user.framenr); } static int selected_boundbox(SpaceClip *sc, float min[2], float max[2]) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTrackingTrack *track; int width, height, ok = FALSE; ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); INIT_MINMAX2(min, max); - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); track = tracksbase->first; while (track) { @@ -388,7 +388,7 @@ int ED_clip_view_selection(SpaceClip *sc, ARegion *ar, int fit) int w, h, frame_width, frame_height; float min[2], max[2]; - ED_space_clip_size(sc, &frame_width, &frame_height); + ED_space_clip_get_clip_size(sc, &frame_width, &frame_height); if (frame_width == 0 || frame_height == 0) return FALSE; @@ -408,7 +408,7 @@ int ED_clip_view_selection(SpaceClip *sc, ARegion *ar, int fit) int width, height; float zoomx, zoomy, newzoom, aspx, aspy; - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); width = ar->winrct.xmax - ar->winrct.xmin + 1; height = ar->winrct.ymax - ar->winrct.ymin + 1; @@ -430,11 +430,11 @@ void ED_clip_point_undistorted_pos(SpaceClip *sc, const float co[2], float r_co[ copy_v2_v2(r_co, co); if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); float aspy = 1.0f / clip->tracking.camera.pixel_aspect; int width, height; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); r_co[0] *= width; r_co[1] *= height * aspy; @@ -453,8 +453,8 @@ void ED_clip_point_stable_pos(const bContext *C, float x, float y, float *xr, fl int sx, sy, width, height; float zoomx, zoomy, pos[3], imat[4][4]; - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_size(sc, &width, &height); UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &sx, &sy); @@ -469,7 +469,7 @@ void ED_clip_point_stable_pos(const bContext *C, float x, float y, float *xr, fl *yr = pos[1] / height; if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; float aspy = 1.0f / tracking->camera.pixel_aspect; float tmp[2] = {*xr * width, *yr * height * aspy}; @@ -493,8 +493,8 @@ void ED_clip_point_stable_pos__reverse(SpaceClip *sc, ARegion *ar, const float c int sx, sy; UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &sx, &sy); - ED_space_clip_size(sc, &width, &height); - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); ED_clip_point_undistorted_pos(sc, co, pos); pos[2] = 0.0f; @@ -552,7 +552,7 @@ int ED_space_clip_texture_buffer_supported(SpaceClip *sc) int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) { SpaceClipDrawContext *context = sc->draw_context; - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); int need_rebind = 0; context->last_texture = glaGetOneInteger(GL_TEXTURE_2D); @@ -657,7 +657,7 @@ void ED_space_clip_free_texture_buffer(SpaceClip *sc) /* ******** masking editing related functions ******** */ -int ED_space_clip_show_trackedit(SpaceClip *sc) +int ED_space_clip_check_show_trackedit(SpaceClip *sc) { if (sc) { return ELEM3(sc->mode, SC_MODE_TRACKING, SC_MODE_RECONSTRUCTION, SC_MODE_DISTORTION); @@ -666,7 +666,7 @@ int ED_space_clip_show_trackedit(SpaceClip *sc) return FALSE; } -int ED_space_clip_show_maskedit(SpaceClip *sc) +int ED_space_clip_check_show_maskedit(SpaceClip *sc) { if (sc) { return sc->mode == SC_MODE_MASKEDIT; diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 323594ea469..91501971d9d 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -147,7 +147,7 @@ static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track, static void draw_tracks_curves(View2D *v2d, SpaceClip *sc) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); int width, height; @@ -181,7 +181,7 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc) static void draw_frame_curves(SpaceClip *sc) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingReconstruction *reconstruction = BKE_tracking_get_active_reconstruction(tracking); int i, lines = 0, prevfra = 0; @@ -214,7 +214,7 @@ static void draw_frame_curves(SpaceClip *sc) void clip_draw_graph(SpaceClip *sc, ARegion *ar, Scene *scene) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); View2D *v2d = &ar->v2d; View2DGrid *grid; short unitx = V2D_UNIT_FRAMESCALE, unity = V2D_UNIT_VALUES; diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index b7687eba717..abf7f416b9c 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -166,7 +166,7 @@ static void mouse_select_init_data(MouseSelectUserData *userdata, float *co) static int mouse_select_knot(bContext *C, float co[2], int extend) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); ARegion *ar = CTX_wm_region(C); View2D *v2d = &ar->v2d; MovieTracking *tracking = &clip->tracking; @@ -211,7 +211,7 @@ static int mouse_select_knot(bContext *C, float co[2], int extend) static int mouse_select_curve(bContext *C, float co[2], int extend) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); MouseSelectUserData userdata; @@ -345,7 +345,7 @@ static int border_select_graph_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); BorderSelectuserData userdata; @@ -400,7 +400,7 @@ void CLIP_OT_graph_select_border(wmOperatorType *ot) static int graph_select_all_markers_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); MovieTrackingMarker *marker; @@ -466,7 +466,7 @@ void CLIP_OT_graph_select_all_markers(wmOperatorType *ot) static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); @@ -498,7 +498,7 @@ void CLIP_OT_graph_delete_curve(wmOperatorType *ot) static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); @@ -648,7 +648,7 @@ void CLIP_OT_graph_center_current_frame(wmOperatorType *ot) static int graph_disable_markers_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); MovieTrackingMarker *marker; diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index d5ec65e68c7..b3f7b221af0 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -78,7 +78,7 @@ static void sclip_zoom_set(SpaceClip *sc, ARegion *ar, float zoom, float locatio if (sc->zoom < 0.1f || sc->zoom > 4.0f) { /* check zoom limits */ - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); width *= sc->zoom; height *= sc->zoom; @@ -92,7 +92,7 @@ static void sclip_zoom_set(SpaceClip *sc, ARegion *ar, float zoom, float locatio } if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) { - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_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; @@ -208,7 +208,7 @@ static int open_exec(bContext *C, wmOperator *op) RNA_property_update(C, &pprop->ptr, pprop->prop); } else if (sc) { - ED_space_clip_set(C, screen, sc, clip); + ED_space_clip_set_clip(C, screen, sc, clip); } WM_event_add_notifier(C, NC_MOVIECLIP | NA_ADDED, clip); @@ -225,7 +225,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) MovieClip *clip = NULL; if (sc) - clip = ED_space_clip(sc); + clip = ED_space_clip_get_clip(sc); if (clip) { strncpy(path, clip->name, sizeof(path)); @@ -713,8 +713,8 @@ static int view_all_exec(bContext *C, wmOperator *op) sc = CTX_wm_space_clip(C); ar = CTX_wm_region(C); - ED_space_clip_size(sc, &w, &h); - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_size(sc, &w, &h); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); w = w * aspx; h = h * aspy; @@ -1031,7 +1031,7 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); ScrArea *sa = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if ((clip->flag & MCLIP_USE_PROXY) == 0) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index 3f8fd5966ec..1c040c69fa9 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -69,7 +69,7 @@ void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack void (*segment_start)(void *userdata, MovieTrackingTrack *track, int coord), void (*segment_end)(void *userdata)) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); int width, height, coord; BKE_movieclip_get_size(clip, &sc->user, &width, &height); @@ -128,7 +128,7 @@ void clip_graph_tracking_values_iterate(SpaceClip *sc, int selected_only, int in void (*segment_start)(void *userdata, MovieTrackingTrack *track, int coord), void (*segment_end)(void *userdata)) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track; @@ -147,7 +147,7 @@ void clip_graph_tracking_values_iterate(SpaceClip *sc, int selected_only, int in void clip_graph_tracking_iterate(SpaceClip *sc, int selected_only, int include_hidden, void *userdata, void (*func)(void *userdata, MovieTrackingMarker *marker)) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track; @@ -228,8 +228,8 @@ void clip_view_center_to_point(SpaceClip *sc, float x, float y) int width, height; float aspx, aspy; - ED_space_clip_size(sc, &width, &height); - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); sc->xof = (x - 0.5f) * width * aspx; sc->yof = (y - 0.5f) * height * aspy; diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index bca0b2a476d..49ee6b65256 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -227,7 +227,7 @@ static void clip_scopes_check_gpencil_change(ScrArea *sa) static void clip_stabilization_tag_refresh(ScrArea *sa) { SpaceClip *sc = (SpaceClip *) sa->spacedata.first; - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (clip) { MovieTrackingStabilization *stab = &clip->tracking.stabilization; @@ -1010,11 +1010,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa) /* sets up the fields of the View2D from zoom and offset */ static void movieclip_main_area_set_view2d(SpaceClip *sc, ARegion *ar) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); float x1, y1, w, h; int width, height, winx, winy; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); w = width; h = height; @@ -1079,7 +1079,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) /* draw entirely, view changes should be handled here */ SpaceClip *sc = CTX_wm_space_clip(C); Scene *scene = CTX_data_scene(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); /* if tracking is in progress, we should synchronize framenr from clipuser * so latest tracked frame would be shown */ @@ -1123,9 +1123,9 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) /* find window pixel coordinates of origin */ UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y); - ED_space_clip_size(sc, &width, &height); - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); /* frame the image */ maxdim = maxf(width, height); @@ -1226,7 +1226,7 @@ static void dopesheet_area_draw(const bContext *C, ARegion *ar) { Scene *scene = CTX_data_scene(C); SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); View2D *v2d = &ar->v2d; View2DGrid *grid; View2DScrollers *scrollers; @@ -1289,7 +1289,7 @@ static void clip_channels_area_init(wmWindowManager *wm, ARegion *ar) static void clip_channels_area_draw(const bContext *C, ARegion *ar) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); View2D *v2d = &ar->v2d; View2DScrollers *scrollers; diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index e4af24040a5..8f58df1cb2c 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -83,14 +83,14 @@ static void add_marker(SpaceClip *sc, float x, float y) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track; int width, height; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); track = BKE_tracking_track_add(tracking, tracksbase, x, y, framenr, width, height); @@ -102,11 +102,11 @@ static void add_marker(SpaceClip *sc, float x, float y) static int add_marker_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); float pos[2]; int width, height; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); if (!width || !height) return OPERATOR_CANCELLED; @@ -160,7 +160,7 @@ void CLIP_OT_add_marker(wmOperatorType *ot) static int delete_track_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track = tracksbase->first, *next; @@ -201,10 +201,10 @@ void CLIP_OT_delete_track(wmOperatorType *ot) static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track = tracksbase->first, *next; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); int has_selection = 0; while (track) { @@ -283,7 +283,7 @@ static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTra int area, int corner, int action, int width, int height) { SlideMarkerData *data = MEM_callocN(sizeof(SlideMarkerData), "slide marker data"); - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); marker = BKE_tracking_marker_ensure(track, framenr); @@ -524,15 +524,15 @@ static void show_cursor(bContext *C) MovieTrackingTrack *tracking_marker_check_slide(bContext *C, wmEvent *event, int *area_r, int *action_r, int *corner_r) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTrackingTrack *track; int width, height; float co[2]; ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); int action = -1, area = 0, corner = -1; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); if (width == 0 || height == 0) return NULL; @@ -625,10 +625,10 @@ static void *slide_marker_customdata(bContext *C, wmEvent *event) int width, height; float co[2]; void *customdata = NULL; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); int area, action, corner; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); if (width == 0 || height == 0) return NULL; @@ -651,7 +651,7 @@ static int slide_marker_invoke(bContext *C, wmOperator *op, wmEvent *event) if (slidedata) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; tracking->act_track = slidedata->track; @@ -950,7 +950,7 @@ static int track_count_markers(SpaceClip *sc, MovieClip *clip) int tot = 0; ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); track = tracksbase->first; while (track) { @@ -994,7 +994,7 @@ static void track_init_markers(SpaceClip *sc, MovieClip *clip, int *frames_limit { ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); int frames_limit = 0; clear_invisible_track_selection(sc, clip); @@ -1037,14 +1037,14 @@ static int track_markers_check_direction(int backwards, int curfra, int efra) static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backwards) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); Scene *scene = CTX_data_scene(C); MovieTrackingSettings *settings = &clip->tracking.settings; int frames_limit; track_init_markers(sc, clip, &frames_limit); - tmj->sfra = ED_space_clip_clip_framenr(sc); + tmj->sfra = ED_space_clip_get_clip_frame_number(sc); tmj->clip = clip; tmj->backwards = backwards; @@ -1161,10 +1161,10 @@ static void track_markers_freejob(void *tmv) static int track_markers_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); Scene *scene = CTX_data_scene(C); struct MovieTrackingContext *context; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); int sfra = framenr, efra; int backwards = RNA_boolean_get(op->ptr, "backwards"); int sequence = RNA_boolean_get(op->ptr, "sequence"); @@ -1224,7 +1224,7 @@ static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve TrackMarkersJob *tmj; ScrArea *sa = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); wmJob *steve; int backwards = RNA_boolean_get(op->ptr, "backwards"); int sequence = RNA_boolean_get(op->ptr, "sequence"); @@ -1330,7 +1330,7 @@ typedef struct { static int solve_camera_initjob(bContext *C, SolveCameraJob *scj, wmOperator *op, char *error_msg, int max_error) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); Scene *scene = CTX_data_scene(C); MovieTracking *tracking = &clip->tracking; MovieTrackingSettings *settings = &clip->tracking.settings; @@ -1454,7 +1454,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even SolveCameraJob *scj; ScrArea *sa = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingReconstruction *reconstruction = BKE_tracking_get_active_reconstruction(tracking); wmJob *steve; @@ -1536,7 +1536,7 @@ void CLIP_OT_solve_camera(wmOperatorType *ot) static int clear_solution_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingReconstruction *reconstruction = BKE_tracking_get_active_reconstruction(tracking); @@ -1584,12 +1584,12 @@ void CLIP_OT_clear_solution(wmOperatorType *ot) static int clear_track_path_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTrackingTrack *track; ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); int action = RNA_enum_get(op->ptr, "action"); int clear_active = RNA_boolean_get(op->ptr, "clear_active"); - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); if (clear_active) { track = BKE_tracking_track_get_active(&clip->tracking); @@ -1641,12 +1641,12 @@ void CLIP_OT_clear_track_path(wmOperatorType *ot) static int disable_markers_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track = tracksbase->first; int action = RNA_enum_get(op->ptr, "action"); - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); while (track) { if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) { @@ -1723,7 +1723,7 @@ static Object *get_orientation_object(bContext *C) { Scene *scene = CTX_data_scene(C); SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking); Object *object = NULL; @@ -1747,7 +1747,7 @@ static int set_orientation_poll(bContext *C) if (sc) { Scene *scene = CTX_data_scene(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (clip) { MovieTracking *tracking = &clip->tracking; @@ -1768,7 +1768,7 @@ static int set_orientation_poll(bContext *C) static int count_selected_bundles(bContext *C) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track; int tot = 0; @@ -1839,7 +1839,7 @@ static Object *object_solver_camera(Scene *scene, Object *ob) static int set_origin_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *track; MovieTrackingObject *tracking_object; @@ -2035,7 +2035,7 @@ static void set_axis(Scene *scene, Object *ob, MovieClip *clip, MovieTrackingOb static int set_plane_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); Scene *scene = CTX_data_scene(C); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object; @@ -2173,7 +2173,7 @@ void CLIP_OT_set_plane(wmOperatorType *ot) static int set_axis_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking); MovieTrackingTrack *track; @@ -2245,7 +2245,7 @@ void CLIP_OT_set_axis(wmOperatorType *ot) static int do_set_scale(bContext *C, wmOperator *op, int scale_solution) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking); MovieTrackingTrack *track; @@ -2326,7 +2326,7 @@ static int set_scale_exec(bContext *C, wmOperator *op) static int set_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (!RNA_struct_property_is_set(op->ptr, "distance")) RNA_float_set(op->ptr, "distance", clip->tracking.settings.dist); @@ -2361,7 +2361,7 @@ static int set_solution_scale_poll(bContext *C) SpaceClip *sc = CTX_wm_space_clip(C); if (sc) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (clip) { MovieTracking *tracking = &clip->tracking; @@ -2382,7 +2382,7 @@ static int set_solution_scale_exec(bContext *C, wmOperator *op) static int set_solution_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (!RNA_struct_property_is_set(op->ptr, "distance")) RNA_float_set(op->ptr, "distance", clip->tracking.settings.object_distance); @@ -2415,7 +2415,7 @@ void CLIP_OT_set_solution_scale(wmOperatorType *ot) static int set_center_principal_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); int width, height; BKE_movieclip_get_size(clip, &sc->user, &width, &height); @@ -2451,7 +2451,7 @@ void CLIP_OT_set_center_principal(wmOperatorType *ot) static int hide_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTrackingTrack *track; MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); @@ -2510,7 +2510,7 @@ void CLIP_OT_hide_tracks(wmOperatorType *ot) static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track; @@ -2567,7 +2567,7 @@ static bGPDlayer *detect_get_layer(MovieClip *clip) static int detect_features_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); int clip_flag = clip->flag & MCLIP_TIMECODE_FLAGS; ImBuf *ibuf = BKE_movieclip_get_ibuf_flag(clip, &sc->user, clip_flag, MOVIECLIP_CACHE_SKIP); MovieTracking *tracking = &clip->tracking; @@ -2578,7 +2578,7 @@ static int detect_features_exec(bContext *C, wmOperator *op) int min_trackability = RNA_int_get(op->ptr, "min_trackability"); int min_distance = RNA_int_get(op->ptr, "min_distance"); int place_outside_layer = 0; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); bGPDlayer *layer = NULL; if (!ibuf) { @@ -2644,7 +2644,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTrackingTrack *track; int pos = RNA_enum_get(op->ptr, "position"); int delta; @@ -2669,7 +2669,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op) } else { /* to to failed frame */ if (clip->tracking.reconstruction.flag & TRACKING_RECONSTRUCTED) { - int a = ED_space_clip_clip_framenr(sc); + int a = ED_space_clip_get_clip_frame_number(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *object = BKE_tracking_object_get_active(tracking); @@ -2736,7 +2736,7 @@ void CLIP_OT_frame_jump(wmOperatorType *ot) static int join_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *act_track, *track, *next; @@ -2790,7 +2790,7 @@ void CLIP_OT_join_tracks(wmOperatorType *ot) static int lock_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track = tracksbase->first; @@ -2843,7 +2843,7 @@ void CLIP_OT_lock_tracks(wmOperatorType *ot) static int track_copy_color_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track, *act_track = BKE_tracking_track_get_active(tracking); @@ -2890,7 +2890,7 @@ void CLIP_OT_track_copy_color(wmOperatorType *ot) static int stabilize_2d_add_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track; @@ -2939,7 +2939,7 @@ void CLIP_OT_stabilize_2d_add(wmOperatorType *ot) static int stabilize_2d_remove_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingStabilization *stab = &tracking->stabilization; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); @@ -2999,7 +2999,7 @@ void CLIP_OT_stabilize_2d_remove(wmOperatorType *ot) static int stabilize_2d_select_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track; @@ -3042,7 +3042,7 @@ void CLIP_OT_stabilize_2d_select(wmOperatorType *ot) static int stabilize_2d_set_rotation_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); @@ -3172,7 +3172,7 @@ static int is_track_clean(MovieTrackingTrack *track, int frames, int del) static int clean_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *track, *next, *act_track = BKE_tracking_track_get_active(tracking); @@ -3228,7 +3228,7 @@ static int clean_tracks_exec(bContext *C, wmOperator *op) static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (!RNA_struct_property_is_set(op->ptr, "frames")) RNA_int_set(op->ptr, "frames", clip->tracking.settings.clean_frames); @@ -3277,7 +3277,7 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot) static int tracking_object_new_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; BKE_tracking_object_add(tracking, "Object"); @@ -3307,7 +3307,7 @@ void CLIP_OT_tracking_object_new(wmOperatorType *ot) static int tracking_object_remove_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *object; @@ -3345,7 +3345,7 @@ void CLIP_OT_tracking_object_remove(wmOperatorType *ot) static int copy_tracks_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *object = BKE_tracking_object_get_active(tracking); @@ -3385,7 +3385,7 @@ static int paste_tracks_poll(bContext *C) static int paste_tracks_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingObject *object = BKE_tracking_object_get_active(tracking); diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index 640af498c1f..f8f786e549c 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -112,13 +112,13 @@ static int mouse_on_crns(float co[2], float pos[2], float crns[4][2], float epsx static int track_mouse_area(SpaceClip *sc, float co[2], MovieTrackingTrack *track) { - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr); float pat_min[2], pat_max[2]; float epsx, epsy; int width, height; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max); @@ -187,7 +187,7 @@ static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, ListBase *tracksbas { MovieTrackingTrack *track = NULL, *cur; float mindist = 0.0f; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); cur = tracksbase->first; while (cur) { @@ -226,7 +226,7 @@ static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, ListBase *tracksbas static int mouse_select(bContext *C, float co[2], int extend) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); @@ -288,7 +288,7 @@ static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) if (track) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); clip->tracking.act_track = track; @@ -332,14 +332,14 @@ void CLIP_OT_select(wmOperatorType *ot) static int border_select_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *track; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); rcti rect; rctf rectf; int change = FALSE, mode, extend; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); /* get rectangle from operator */ rect.xmin = RNA_int_get(op->ptr, "xmin"); @@ -414,13 +414,13 @@ static int do_lasso_select_marker(bContext *C, int mcords[][2], short moves, sho { ARegion *ar = CTX_wm_region(C); SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *track; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); rcti rect; int change = FALSE; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); /* get rectangle from operator */ BLI_lasso_boundbox(&rect, mcords, moves); @@ -519,14 +519,14 @@ static int marker_inside_ellipse(MovieTrackingMarker *marker, float offset[2], f static int circle_select_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); ARegion *ar = CTX_wm_region(C); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *track; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); int x, y, radius, width, height, mode, change = FALSE; float zoomx, zoomy, offset[2], ellipse[2]; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); /* get operator properties */ x = RNA_int_get(op->ptr, "x"); @@ -536,8 +536,8 @@ static int circle_select_exec(bContext *C, wmOperator *op) mode = RNA_int_get(op->ptr, "gesture_mode"); /* compute ellipse and position in unified coordinates */ - ED_space_clip_size(sc, &width, &height); - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); ellipse[0] = width * zoomx / radius; ellipse[1] = height * zoomy / radius; @@ -602,13 +602,13 @@ void CLIP_OT_select_circle(wmOperatorType *ot) static int select_all_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *track = NULL; /* selected track */ MovieTrackingMarker *marker; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); int action = RNA_enum_get(op->ptr, "action"); - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); int has_selection = FALSE; if (action == SEL_TOGGLE) { @@ -692,13 +692,13 @@ void CLIP_OT_select_all(wmOperatorType *ot) static int select_groped_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTrackingTrack *track; MovieTrackingMarker *marker; MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); int group = RNA_enum_get(op->ptr, "group"); - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); track = tracksbase->first; while (track) { diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 9e7facf1b6f..67e87afc5c3 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -183,11 +183,11 @@ void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy) r_vec[2] = 0.0f; if (t->options & CTX_MOVIECLIP) { - ED_space_clip_aspect_dimension_aware(t->sa->spacedata.first, &aspx, &aspy); + ED_space_clip_get_clip_aspect_dimension_aware(t->sa->spacedata.first, &aspx, &aspy); } else if (t->options & CTX_MASK) { /* TODO - NOT WORKING, this isnt so bad since its only display aspect */ - ED_space_clip_mask_aspect(t->sa->spacedata.first, &aspx, &aspy); + ED_space_clip_get_mask_aspect(t->sa->spacedata.first, &aspx, &aspy); } r_vec[0] *= aspx; @@ -254,9 +254,9 @@ void projectIntView(TransInfo *t, const float vec[3], int adr[2]) copy_v2_v2(v, vec); if (t->options & CTX_MOVIECLIP) - ED_space_clip_aspect_dimension_aware(t->sa->spacedata.first, &aspx, &aspy); + ED_space_clip_get_clip_aspect_dimension_aware(t->sa->spacedata.first, &aspx, &aspy); else if (t->options & CTX_MASK) - ED_space_clip_mask_aspect(t->sa->spacedata.first, &aspx, &aspy); + ED_space_clip_get_mask_aspect(t->sa->spacedata.first, &aspx, &aspy); v[0] /= aspx; v[1] /= aspy; @@ -317,13 +317,13 @@ void applyAspectRatio(TransInfo *t, float vec[2]) if (t->options & CTX_MOVIECLIP) { - ED_space_clip_aspect_dimension_aware(sc, &aspx, &aspy); + ED_space_clip_get_clip_aspect_dimension_aware(sc, &aspx, &aspy); vec[0] /= aspx; vec[1] /= aspy; } else if (t->options & CTX_MASK) { - ED_space_clip_mask_aspect(sc, &aspx, &aspy); + ED_space_clip_get_mask_aspect(sc, &aspx, &aspy); vec[0] /= aspx; vec[1] /= aspy; @@ -356,10 +356,10 @@ void removeAspectRatio(TransInfo *t, float vec[2]) float aspx = 1.0f, aspy = 1.0f; if (t->options & CTX_MOVIECLIP) { - ED_space_clip_aspect_dimension_aware(sc, &aspx, &aspy); + ED_space_clip_get_clip_aspect_dimension_aware(sc, &aspx, &aspy); } else if (t->options & CTX_MASK) { - ED_space_clip_mask_aspect(sc, &aspx, &aspy); + ED_space_clip_get_mask_aspect(sc, &aspx, &aspy); } vec[0] *= aspx; @@ -410,16 +410,16 @@ static void viewRedrawForce(const bContext *C, TransInfo *t) else if (t->spacetype == SPACE_CLIP) { SpaceClip *sc = (SpaceClip *)t->sa->spacedata.first; - if (ED_space_clip_show_trackedit(sc)) { - MovieClip *clip = ED_space_clip(sc); + if (ED_space_clip_check_show_trackedit(sc)) { + MovieClip *clip = ED_space_clip_get_clip(sc); /* objects could be parented to tracking data, so send this for viewport refresh */ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip); } - else if (ED_space_clip_show_maskedit(sc)) { - Mask *mask = ED_space_clip_mask(sc); + else if (ED_space_clip_check_show_maskedit(sc)) { + Mask *mask = ED_space_clip_get_mask(sc); WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask); } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index fbc59f4c2cb..a9716483db7 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5046,7 +5046,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (t->spacetype == SPACE_CLIP) { if (t->options & CTX_MOVIECLIP) { SpaceClip *sc = t->sa->spacedata.first; - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (t->scene->nodetree) { /* tracks can be used for stabilization nodes, @@ -5057,7 +5057,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) } else if (t->options & CTX_MASK) { SpaceClip *sc = t->sa->spacedata.first; - Mask *mask = ED_space_clip_mask(sc); + Mask *mask = ED_space_clip_get_mask(sc); if (t->scene->nodetree) { /* tracks can be used for stabilization nodes, @@ -5653,7 +5653,7 @@ static void markerToTransDataInit(TransData *td, TransData2D *td2d, TransDataTra static void trackToTransData(SpaceClip *sc, TransData *td, TransData2D *td2d, TransDataTracking *tdt, MovieTrackingTrack *track, float aspx, float aspy) { - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); MovieTrackingMarker *marker = BKE_tracking_marker_ensure(track, framenr); tdt->flag = marker->flag; @@ -5702,12 +5702,12 @@ static void createTransTrackingTracksData(bContext *C, TransInfo *t) TransData *td; TransData2D *td2d; SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track; MovieTrackingMarker *marker; TransDataTracking *tdt; - int framenr = ED_space_clip_clip_framenr(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); float aspx, aspy; /* count */ @@ -5736,7 +5736,7 @@ static void createTransTrackingTracksData(bContext *C, TransInfo *t) if (t->total == 0) return; - ED_space_clip_aspect_dimension_aware(sc, &aspx, &aspy); + ED_space_clip_get_clip_aspect_dimension_aware(sc, &aspx, &aspy); td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransTracking TransData"); td2d = t->data2d = MEM_callocN(t->total * sizeof(TransData2D), "TransTracking TransData2D"); @@ -5830,7 +5830,7 @@ static void createTransTrackingCurvesData(bContext *C, TransInfo *t) TransData *td; TransData2D *td2d; SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track; MovieTrackingMarker *marker, *prev_marker; @@ -5908,7 +5908,7 @@ static void createTransTrackingData(bContext *C, TransInfo *t) { ARegion *ar = CTX_wm_region(C); SpaceClip *sc = CTX_wm_space_clip(C); - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); int width, height; t->total = 0; @@ -5931,11 +5931,11 @@ static void cancelTransTracking(TransInfo *t) { TransDataTracking *tdt = t->customData; SpaceClip *sc = t->sa->spacedata.first; - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track; MovieTrackingMarker *marker; - int a, framenr = ED_space_clip_clip_framenr(sc); + int a, framenr = ED_space_clip_get_clip_frame_number(sc); if (tdt->mode == transDataTracking_ModeTracks) { track = tracksbase->first; @@ -5992,7 +5992,7 @@ void flushTransTracking(TransInfo *t) int a; float aspx, aspy; - ED_space_clip_aspect_dimension_aware(sc, &aspx, &aspy); + ED_space_clip_get_clip_aspect_dimension_aware(sc, &aspx, &aspy); if (t->state == TRANS_CANCEL) cancelTransTracking(t); @@ -6072,7 +6072,7 @@ static void MaskPointToTransData(SpaceClip *sc, MaskSplinePoint *point, tdm->point = point; copy_m3_m3(tdm->vec, bezt->vec); - ED_space_clip_mask_aspect(sc, &aspx, &aspy); + ED_space_clip_get_mask_aspect(sc, &aspx, &aspy); if (propmode || is_sel_point) { int i; @@ -6250,7 +6250,7 @@ void flushTransMasking(TransInfo *t) int a; float aspx, aspy, invx, invy; - ED_space_clip_mask_aspect(sc, &aspx, &aspy); + ED_space_clip_get_mask_aspect(sc, &aspx, &aspy); invx = 1.0f / aspx; invy = 1.0f / aspy; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index b7857be5afb..0ecfa2695e0 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -639,8 +639,8 @@ static void recalcData_spaceclip(TransInfo *t) { SpaceClip *sc = t->sa->spacedata.first; - if (ED_space_clip_show_trackedit(sc)) { - MovieClip *clip = ED_space_clip(sc); + if (ED_space_clip_check_show_trackedit(sc)) { + MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track; int framenr = sc->user.framenr; @@ -675,8 +675,8 @@ static void recalcData_spaceclip(TransInfo *t) DAG_id_tag_update(&clip->id, 0); } - else if (ED_space_clip_show_maskedit(sc)) { - Mask *mask = ED_space_clip_mask(sc); + else if (ED_space_clip_check_show_maskedit(sc)) { + Mask *mask = ED_space_clip_get_mask(sc); flushTransMasking(t); @@ -1128,9 +1128,9 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->view = &ar->v2d; t->around = sclip->around; - if (ED_space_clip_show_trackedit(sclip)) + if (ED_space_clip_check_show_trackedit(sclip)) t->options |= CTX_MOVIECLIP; - else if (ED_space_clip_show_maskedit(sclip)) + else if (ED_space_clip_check_show_maskedit(sclip)) t->options |= CTX_MASK; } else { |