diff options
Diffstat (limited to 'source/blender/blenkernel/intern/mask.c')
-rw-r--r-- | source/blender/blenkernel/intern/mask.c | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index 1d3ebaac303..12bbab57cf2 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -38,6 +38,7 @@ #include "BLT_translation.h" +#include "DNA_defaults.h" #include "DNA_mask_types.h" #include "BKE_animsys.h" @@ -255,6 +256,7 @@ IDTypeInfo IDType_ID_MSK = { .name_plural = "masks", .translation_context = BLT_I18NCONTEXT_ID_MASK, .flags = IDTYPE_FLAGS_APPEND_IS_REUSABLE, + .asset_type_info = NULL, .init_data = NULL, .copy_data = mask_copy_data, @@ -262,6 +264,7 @@ IDTypeInfo IDType_ID_MSK = { .make_local = NULL, .foreach_id = mask_foreach_id, .foreach_cache = NULL, + .foreach_path = NULL, .owner_get = NULL, .blend_write = mask_blend_write, @@ -371,7 +374,6 @@ MaskLayer *BKE_mask_layer_new(Mask *mask, const char *name) return masklay; } -/* NOTE: may still be hidden, caller needs to check. */ MaskLayer *BKE_mask_layer_active(Mask *mask) { return BLI_findlink(&mask->masklayers, mask->masklay_act); @@ -787,12 +789,11 @@ BLI_INLINE void orthogonal_direction_get(const float vec[2], float result[2]) normalize_v2(result); } -/* TODO(sergey): This function will re-calculate loads of stuff again and again - * when differentiating feather points. This might be easily cached - * in the callee function for this case. - */ void BKE_mask_point_normal(MaskSpline *spline, MaskSplinePoint *point, float u, float n[2]) { + /* TODO(sergey): This function will re-calculate loads of stuff again and again + * when differentiating feather points. This might be easily cached + * in the callee function for this case. */ MaskSplinePoint *point_prev, *point_next; @@ -1132,7 +1133,6 @@ MaskSpline *BKE_mask_spline_copy(const MaskSpline *spline) return nspline; } -/* NOTE: Does NOT add to the list. */ MaskLayerShape *BKE_mask_layer_shape_alloc(MaskLayer *masklay, const int frame) { MaskLayerShape *masklay_shape; @@ -1156,8 +1156,6 @@ void BKE_mask_layer_shape_free(MaskLayerShape *masklay_shape) MEM_freeN(masklay_shape); } -/** \brief Free all animation keys for a mask layer - */ void BKE_mask_layer_free_shapes(MaskLayer *masklay) { MaskLayerShape *masklay_shape; @@ -1245,7 +1243,6 @@ void BKE_mask_coord_from_image(Image *image, ImageUser *iuser, float r_co[2], co BKE_mask_coord_from_frame(r_co, co, frame_size); } -/* as above but divide */ void BKE_mask_coord_to_frame(float r_co[2], const float co[2], const float frame_size[2]) { if (frame_size[0] == frame_size[1]) { @@ -1312,7 +1309,7 @@ void BKE_mask_point_parent_matrix_get(MaskSplinePoint *point, MovieTrackingObject *ob = BKE_tracking_object_get_named(tracking, parent->parent); if (ob) { - MovieClipUser user = {0}; + MovieClipUser user = *DNA_struct_default_get(MovieClipUser); float clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, ctime); BKE_movieclip_user_set_frame(&user, ctime); @@ -1428,8 +1425,6 @@ void BKE_mask_get_handle_point_adjacent(MaskSpline *spline, *r_point_next = mask_spline_point_next(spline, points_array, point); } -/* calculates the tangent of a point by its previous and next - * (ignoring handles - as if its a poly line) */ void BKE_mask_calc_tangent_polyline(MaskSpline *spline, MaskSplinePoint *point, float t[2]) { float tvec_a[2], tvec_b[2]; @@ -1513,11 +1508,6 @@ void BKE_mask_calc_handle_adjacent_interp(MaskSpline *spline, } } -/** - * \brief Resets auto handles even for non-auto bezier points - * - * Useful for giving sane defaults. - */ void BKE_mask_calc_handle_point_auto(MaskSpline *spline, MaskSplinePoint *point, const bool do_recalc_length) @@ -1640,7 +1630,6 @@ static void mask_layer_shape_to_mask_point(BezTriple *bezt, bezt->radius = fp[7]; } -/* these functions match. copy is swapped */ void BKE_mask_layer_shape_from_mask(MaskLayer *masklay, MaskLayerShape *masklay_shape) { int tot = BKE_mask_layer_shape_totvert(masklay); @@ -1696,7 +1685,6 @@ BLI_INLINE void interp_v2_v2v2_flfl( target[1] = s * a[1] + t * b[1]; } -/* linear interpolation only */ void BKE_mask_layer_shape_to_mask_interp(MaskLayer *masklay, MaskLayerShape *masklay_shape_a, MaskLayerShape *masklay_shape_b, @@ -1757,9 +1745,6 @@ MaskLayerShape *BKE_mask_layer_shape_find_frame(MaskLayer *masklay, const int fr return NULL; } -/** - * When returning 2 - the frame isn't found but before/after frames are. - */ int BKE_mask_layer_shape_find_frame_range(MaskLayer *masklay, const float frame, MaskLayerShape **r_masklay_shape_a, @@ -1922,7 +1907,6 @@ static void interp_weights_uv_v2_apply(const float uv[2], r_pt[1] += dvec[0] * uv[1]; } -/* When a new points added - resize all shape-key array. */ void BKE_mask_layer_shape_changed_add(MaskLayer *masklay, int index, bool do_init, @@ -2017,7 +2001,6 @@ void BKE_mask_layer_shape_changed_add(MaskLayer *masklay, } } -/* move array to account for removed point */ void BKE_mask_layer_shape_changed_remove(MaskLayer *masklay, int index, int count) { MaskLayerShape *masklay_shape; @@ -2079,13 +2062,11 @@ static void mask_clipboard_free_ex(bool final_free) } } -/* Free the clipboard. */ void BKE_mask_clipboard_free(void) { mask_clipboard_free_ex(true); } -/* Copy selected visible splines from the given layer to clipboard. */ void BKE_mask_clipboard_copy_from_layer(MaskLayer *mask_layer) { MaskSpline *spline; @@ -2120,13 +2101,11 @@ void BKE_mask_clipboard_copy_from_layer(MaskLayer *mask_layer) } } -/* Check clipboard is empty. */ bool BKE_mask_clipboard_is_empty(void) { return BLI_listbase_is_empty(&mask_clipboard.splines); } -/* Paste the contents of clipboard to given mask layer */ void BKE_mask_clipboard_paste_to_layer(Main *bmain, MaskLayer *mask_layer) { MaskSpline *spline; |