57 mask->runtime.last_update = 0;
61 std::optional<Library *> ,
67 const Mask *mask_src = (
const Mask *)id_src;
93 for (
int i = 0;
i < mask_spline->tot_point;
i++) {
115 spline->points_deform =
nullptr;
120 spline->points_deform = points_deform;
122 for (
i = 0;
i < spline->tot_point;
i++) {
156 for (
int i = 0;
i < spline->tot_point;
i++) {
165 if ((act_point_search ==
nullptr) && (masklay->act_point >= points_old) &&
166 (masklay->act_point < points_old + spline->tot_point))
168 act_point_search = &spline->points[masklay->act_point - points_old];
180 masklay->act_point = act_point_search;
226 if (point == &points_array[spline->
tot_point - 1]) {
228 return &points_array[0];
241 if (point == points_array) {
243 return &points_array[spline->
tot_point - 1];
256 if (point == &points_array[spline->
tot_point - 1]) {
258 return &(points_array[0].
bezt);
264 return &(point + 1)->bezt;
275 if ((point_ref >= spline->
points) && (point_ref < &spline->points[spline->
tot_point])) {
280 (point_ref < &spline->points_deform[spline->
tot_point]))
304 masklay->
alpha = 1.0f;
327 if (
mask->masklay_act >=
mask->masklay_tot) {
328 mask->masklay_act =
mask->masklay_tot - 1;
339 sizeof(masklay->
name));
377 if (masklay->
act_point >= spline->points &&
378 masklay->
act_point < spline->points + spline->tot_point)
380 const size_t point_index = masklay->
act_point - spline->points;
390 masklay_shape_new->
data =
static_cast<float *
>(
MEM_dupallocN(masklay_shape->data));
391 masklay_shape_new->
tot_vert = masklay_shape->tot_vert;
392 masklay_shape_new->
flag = masklay_shape->flag;
393 masklay_shape_new->
frame = masklay_shape->frame;
449 const int tot_uw = point->
tot_uw;
450 const int tot_uw_half = tot_uw / 2;
465 for (
int i = 0;
i < tot_uw_half;
i++) {
468 std::swap(*uw_a, *uw_b);
472 for (
int i = 0;
i < tot_uw;
i++) {
474 uw->
u = 1.0f - uw->
u;
481 const int tot_point_half = tot_point / 2;
489 for (
i = 0;
i < tot_point_half;
i++) {
492 std::swap(*point_a, *point_b);
496 i_prev = tot_point - 1;
497 for (
i = 0;
i < tot_point;
i++) {
514 for (
i = 0;
i < tot_point_half;
i++) {
517 std::swap(*fp_a, *fp_b);
529 const float proj_eps = 1
e-3;
530 const float proj_eps_sq = proj_eps * proj_eps;
532 float u = -1.0f, du = 1.0f /
N, u1 = start_u, u2 = start_u;
537 while (u1 > 0.0f || u2 < 1.0f) {
538 float n1[2], n2[2], co1[2], co2[2];
553 if (ang1 >
float(
M_PI_2)) {
557 if (ang < 0.0f || ang1 < ang) {
580 if (ang2 >
float(
M_PI_2)) {
627 r_handle[0] = (bezt->
vec[1][0] + vec[1]);
628 r_handle[1] = (bezt->
vec[1][1] - vec[0]);
637 BLI_assert_msg(0,
"Unknown handle passed to BKE_mask_point_handle");
645 float orig_handle[2],
646 float orig_vec[3][3])
651 float v1[2],
v2[2], vec[2];
652 if (keep_direction) {
690 BLI_assert_msg(0,
"unknown handle passed to BKE_mask_point_set_handle");
708 co, bezt->
vec[1], bezt->
vec[2], bezt_next->vec[0], bezt_next->vec[1], u);
727 const float du = 0.05f;
731 if (u - du < 0.0f && point_prev ==
nullptr) {
737 else if (u + du > 1.0f && point_next ==
nullptr) {
744 float prev_co[2], next_co[2], co[2];
745 float dir1[2], dir2[2], dir[2];
776 return (bezt->
weight * (1.0f - u)) + (bezt_next->
weight * u);
793 return bezt_next->weight;
813 return bezt_next->weight;
816 float cur_u = 0.0f, cur_w = 0.0f, next_u = 0.0f, next_w = 0.0f, fac;
818 for (
int i = 0;
i <= point->
tot_uw;
i++) {
824 cur_u = point->
uw[
i - 1].
u;
825 cur_w = point->
uw[
i - 1].
w;
833 next_u = point->
uw[
i].
u;
834 next_w = point->
uw[
i].
w;
837 if (u >= cur_u && u <= next_u) {
842 fac = (u - cur_u) / (next_u - cur_u);
848 return cur_w + (next_w - cur_w) * (3.0f * fac * fac - 2.0f * fac * fac * fac);
851 return (1.0f - fac) * cur_w + fac * next_w;
857 int idx = uw - point->
uw;
859 if (idx > 0 && point->
uw[idx - 1].
u > uw->
u) {
860 while (idx > 0 && point->
uw[idx - 1].
u > point->
uw[idx].
u) {
861 std::swap(point->
uw[idx - 1], point->
uw[idx]);
866 if (idx < point->tot_uw - 1 && point->
uw[idx + 1].
u < uw->
u) {
867 while (idx < point->tot_uw - 1 && point->
uw[idx + 1].
u < point->
uw[idx].
u) {
868 std::swap(point->
uw[idx + 1], point->
uw[idx]);
873 return &point->
uw[idx];
907 for (
int i = 0;
i < point->
tot_uw;
i++) {
919 const bool do_select)
933 BLI_assert_msg(0,
"Wrong which_handle passed to BKE_mask_point_select_set_handle");
948 BLI_assert_msg(0,
"Wrong which_handle passed to BKE_mask_point_select_set_handle");
1021 spline = next_spline;
1029 for (
int i = 0;
i < tot_point;
i++) {
1062 masklay_shape->
frame = frame;
1063 masklay_shape->
tot_vert = tot_vert;
1066 return masklay_shape;
1071 if (masklay_shape->
data) {
1084 while (masklay_shape) {
1090 masklay_shape = next_masklay_shape;
1115 masklay = masklay_next;
1121 if (frame_size[0] == frame_size[1]) {
1125 else if (frame_size[0] < frame_size[1]) {
1126 r_co[0] = ((co[0] - 0.5f) * (frame_size[0] / frame_size[1])) + 0.5f;
1131 r_co[1] = ((co[1] - 0.5f) * (frame_size[1] / frame_size[0])) + 0.5f;
1141 float frame_size[2];
1147 frame_size[1] *= (aspy / aspx);
1155 float frame_size[2];
1160 frame_size[1] *= (aspy / aspx);
1167 if (frame_size[0] == frame_size[1]) {
1171 else if (frame_size[0] < frame_size[1]) {
1172 r_co[0] = ((co[0] - 0.5f) / (frame_size[0] / frame_size[1])) + 0.5f;
1177 r_co[1] = ((co[1] - 0.5f) / (frame_size[1] / frame_size[0])) + 0.5f;
1187 float frame_size[2];
1193 frame_size[1] *= (aspy / aspx);
1201 float frame_size[2];
1207 frame_size[1] *= (aspy / aspx);
1214 float parent_matrix[3][3])
1240 float marker_position[2], parent_co[2];
1251 float corners[4][2];
1253 float frame_size[2],
H[3][3], mask_from_clip_matrix[3][3], mask_to_clip_matrix[3][3];
1258 unit_m3(mask_from_clip_matrix);
1263 frame_size[1] *= (aspy / aspx);
1264 if (frame_size[0] == frame_size[1]) {
1267 else if (frame_size[0] < frame_size[1]) {
1268 mask_from_clip_matrix[0][0] = frame_size[1] / frame_size[0];
1269 mask_from_clip_matrix[2][0] = -0.5f * (frame_size[1] / frame_size[0]) + 0.5f;
1272 mask_from_clip_matrix[1][1] = frame_size[1] / frame_size[0];
1273 mask_from_clip_matrix[2][1] = -0.5f * (frame_size[1] / frame_size[0]) + 0.5f;
1276 invert_m3_m3(mask_to_clip_matrix, mask_from_clip_matrix);
1277 mul_m3_series(parent_matrix, mask_from_clip_matrix,
H, mask_to_clip_matrix);
1290 BezTriple *bezt_prev =
nullptr, *bezt_next =
nullptr;
1294 bezt_prev = &point_prev->
bezt;
1298 bezt_next = &point_next->
bezt;
1302 if (bezt_prev || bezt_next) {
1309 else if (handle_type ==
HD_AUTO) {
1349 float tvec_a[2], tvec_b[2];
1390 float length_average = 0.0f;
1391 float weight_average = 0.0f;
1399 if (point_prev && point_next) {
1421 length_average /=
float(length_tot);
1422 weight_average /=
float(length_tot);
1432 const bool do_recalc_length)
1435 const char h_back[2] = {point->
bezt.
h1, point->
bezt.
h2};
1436 const float length_average = (do_recalc_length) ?
1448 point->
bezt.
h1 = h_back[0];
1449 point->
bezt.
h2 = h_back[1];
1452 if (do_recalc_length ==
false) {
1461 for (
int i = 0;
i < spline->tot_point;
i++) {
1476 for (
int i = 0;
i < allocated_points;
i++) {
1521 tot += spline->tot_point;
1551 if (masklay_shape->
tot_vert == tot) {
1552 float *fp = masklay_shape->
data;
1555 for (
int i = 0;
i < spline->tot_point;
i++) {
1563 "vert mismatch %d != %d (frame %d)",
1566 masklay_shape->
frame);
1574 if (masklay_shape->
tot_vert == tot) {
1575 float *fp = masklay_shape->
data;
1578 for (
int i = 0;
i < spline->tot_point;
i++) {
1586 "vert mismatch %d != %d (frame %d)",
1589 masklay_shape->
frame);
1594 float target[2],
const float a[2],
const float b[2],
const float t,
const float s)
1596 target[0] = s * a[0] + t *
b[0];
1597 target[1] = s * a[1] + t *
b[1];
1606 if (masklay_shape_a->
tot_vert == tot && masklay_shape_b->
tot_vert == tot) {
1607 const float *fp_a = masklay_shape_a->
data;
1608 const float *fp_b = masklay_shape_b->
data;
1609 const float ifac = 1.0f - fac;
1612 for (
int i = 0;
i < spline->tot_point;
i++) {
1624 bezt->
weight = (fp_a[0] * ifac) + (fp_b[0] * fac);
1625 bezt->
radius = (fp_a[1] * ifac) + (fp_b[1] * fac);
1633 "vert mismatch %d != %d != %d (frame %d - %d)",
1637 masklay_shape_a->
frame,
1638 masklay_shape_b->
frame);
1645 if (frame == masklay_shape->frame) {
1646 return masklay_shape;
1648 if (frame < masklay_shape->frame) {
1664 masklay_shape = masklay_shape->
next)
1666 if (frame == masklay_shape->
frame) {
1667 *r_masklay_shape_a = masklay_shape;
1668 *r_masklay_shape_b =
nullptr;
1671 if (frame < masklay_shape->frame) {
1672 if (masklay_shape->
prev) {
1673 *r_masklay_shape_a = masklay_shape->
prev;
1674 *r_masklay_shape_b = masklay_shape;
1678 *r_masklay_shape_a = masklay_shape;
1679 *r_masklay_shape_b =
nullptr;
1685 if (masklay_shape) {
1686 *r_masklay_shape_a = masklay_shape;
1687 *r_masklay_shape_b =
nullptr;
1691 *r_masklay_shape_a =
nullptr;
1692 *r_masklay_shape_b =
nullptr;
1703 if (masklay_shape ==
nullptr) {
1709 return masklay_shape;
1720 return masklay_shape_copy;
1731 const void *masklay_shape_b_ptr)
1736 if (masklay_shape_a->
frame < masklay_shape_b->
frame) {
1739 if (masklay_shape_a->
frame > masklay_shape_b->
frame) {
1757 if (index < spline->tot_point) {
1758 *r_masklay_shape = spline;
1762 index -= spline->tot_point;
1773 spline_iter && spline_iter != spline;
1774 i_abs += spline_iter->
tot_point, spline_iter = spline_iter->
next)
1785 const float pt_a[2],
1786 const float pt_b[2])
1788 const float segment_len =
len_v2v2(pt_a, pt_b);
1789 if (segment_len == 0.0f) {
1795 float pt_on_line[2];
1798 r_uv[1] = (
len_v2v2(pt_on_line, pt) / segment_len) *
1805 const float pt_a[2],
1806 const float pt_b[2])
1808 const float dvec[2] = {pt_b[0] - pt_a[0], pt_b[1] - pt_a[1]};
1814 r_pt[0] += -dvec[1] * uv[1];
1815 r_pt[1] += dvec[0] * uv[1];
1821 bool do_init_interpolate)
1825 int spline_point_index;
1836 const int pi_curr = spline_point_index;
1837 const int pi_prev = ((spline_point_index - 1) + spline->
tot_point) % spline->
tot_point;
1838 const int pi_next = (spline_point_index + 1) % spline->
tot_point;
1840 const int index_offset = index - spline_point_index;
1842 const int pi_prev_abs = pi_prev + index_offset;
1843 const int pi_next_abs = pi_next + index_offset;
1845 if (do_init_interpolate) {
1846 for (
int i = 0;
i < 3;
i++) {
1855 if (tot == masklay_shape->tot_vert) {
1856 float *data_resized;
1858 masklay_shape->tot_vert++;
1862 memcpy(data_resized,
1863 masklay_shape->data,
1867 if (index != masklay_shape->tot_vert - 1) {
1870 (masklay_shape->tot_vert - (index + 1)) *
sizeof(
float) *
1879 if (do_init_interpolate && spline->
tot_point > 2) {
1880 for (
int i = 0;
i < 3;
i++) {
1896 masklay_shape->data = data_resized;
1900 "vert mismatch %d != %d (frame %d)",
1901 masklay_shape->tot_vert,
1903 masklay_shape->frame);
1915 if (tot == masklay_shape->tot_vert -
count) {
1916 float *data_resized;
1918 masklay_shape->tot_vert -=
count;
1922 memcpy(data_resized,
1923 masklay_shape->data,
1927 if (index != masklay_shape->tot_vert) {
1934 masklay_shape->data = data_resized;
1938 "vert mismatch %d != %d (frame %d)",
1939 masklay_shape->tot_vert -
count,
1941 masklay_shape->frame);
1985 if (spline->flag &
SELECT) {
2017 const char *id_name =
static_cast<const char *
>(
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
void BKE_nurb_handle_calc(BezTriple *bezt, BezTriple *prev, BezTriple *next, bool is_fcurve, char smoothing)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
void BKE_image_get_size_fl(Image *image, ImageUser *iuser, float r_size[2])
void BKE_image_get_aspect(Image *image, float *r_aspx, float *r_aspy)
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
void id_fake_user_set(ID *id)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
ListBase * which_libbase(Main *bmain, short type)
@ MASK_HANDLE_MODE_INDIVIDUAL_HANDLES
void BKE_mask_layer_evaluate_deform(struct MaskLayer *masklay, float ctime)
@ MASK_WHICH_HANDLE_RIGHT
@ MASK_WHICH_HANDLE_STICK
#define MASKPOINT_SEL_ALL(p)
#define MASKPOINT_DESEL_ALL(p)
void BKE_mask_layer_evaluate_animation(struct MaskLayer *masklay, float ctime)
void BKE_movieclip_get_aspect(struct MovieClip *clip, float *aspx, float *aspy)
float BKE_movieclip_remap_scene_to_clip_frame(const struct MovieClip *clip, float framenr)
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr)
void BKE_movieclip_get_size_fl(struct MovieClip *clip, const struct MovieClipUser *user, float r_size[2])
struct MovieTrackingPlaneTrack * BKE_tracking_object_find_plane_track_with_name(struct MovieTrackingObject *tracking_object, const char *name)
struct MovieTrackingObject * BKE_tracking_object_get_named(struct MovieTracking *tracking, const char *name)
void BKE_tracking_plane_marker_get_subframe_corners(struct MovieTrackingPlaneTrack *plane_track, float framenr, float corners[4][2])
struct MovieTrackingTrack * BKE_tracking_object_find_track_with_name(struct MovieTrackingObject *tracking_object, const char *name)
void BKE_tracking_marker_get_subframe_position(struct MovieTrackingTrack *track, float framenr, float pos[2])
void BKE_tracking_homography_between_two_quads(float reference_corners[4][2], float corners[4][2], float H[3][3])
#define BLI_assert_msg(a, msg)
void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_listbase_sort(ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
bool BLI_remlink_safe(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
float closest_to_line_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2])
void unit_m3(float m[3][3])
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
#define mul_m3_series(...)
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
float angle_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void interp_v2_v2v2v2v2_cubic(float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2], float u)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
void dist_ensure_v2_v2fl(float v1[2], const float v2[2], float dist)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v2(float r[2])
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v2(float n[2])
void project_v2_v2v2(float out[2], const float p[2], const float v_proj[2])
#define STRNCPY_UTF8(dst, src)
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
void BLO_write_float_array(BlendWriter *writer, int64_t num, const float *data_ptr)
void BLO_read_float_array(BlendDataReader *reader, int64_t array_size, float **ptr_p)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct_array(reader, struct_name, array_size, ptr_p)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BLT_I18NCONTEXT_ID_MASK
#define CLOG_ERROR(clg_ref,...)
void DEG_relations_tag_update(Main *bmain)
#define DNA_struct_default_get(struct_name)
@ MASK_PARENT_POINT_TRACK
#define MASK_OBJECT_SHAPE_ELEM_SIZE
@ MASK_LAYERFLAG_FILL_OVERLAP
@ MASK_LAYERFLAG_FILL_DISCRETE
@ MASK_SPLINE_INTERP_EASE
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
static void mask_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_mask_clipboard_free()
void BKE_mask_layer_shape_unlink(MaskLayer *masklay, MaskLayerShape *masklay_shape)
void BKE_mask_coord_from_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
void BKE_mask_calc_handle_point(MaskSpline *spline, MaskSplinePoint *point)
void BKE_mask_layer_calc_handles(MaskLayer *masklay)
void BKE_mask_layer_shape_from_mask(MaskLayer *masklay, MaskLayerShape *masklay_shape)
float BKE_mask_point_weight(MaskSpline *spline, MaskSplinePoint *point, const float u)
MaskLayerShape * BKE_mask_layer_shape_verify_frame(MaskLayer *masklay, const int frame)
static void mask_layer_shape_to_mask_point(BezTriple *bezt, const float fp[MASK_OBJECT_SHAPE_ELEM_SIZE])
static int mask_layer_shape_sort_cb(const void *masklay_shape_a_ptr, const void *masklay_shape_b_ptr)
void BKE_mask_calc_handle_adjacent_interp(MaskSpline *spline, MaskSplinePoint *point, const float u)
static Mask * mask_alloc(Main *bmain, const char *name)
static void mask_runtime_reset(Mask *mask)
MaskSplinePoint * BKE_mask_spline_point_array_from_point(MaskSpline *spline, const MaskSplinePoint *point_ref)
static void mask_foreach_id(ID *id, LibraryForeachIDData *data)
void BKE_mask_get_handle_point_adjacent(MaskSpline *spline, MaskSplinePoint *point, MaskSplinePoint **r_point_prev, MaskSplinePoint **r_point_next)
void BKE_mask_layer_unique_name(Mask *mask, MaskLayer *masklay)
void BKE_mask_point_add_uw(MaskSplinePoint *point, float u, float w)
void BKE_mask_clipboard_paste_to_layer(Main *bmain, MaskLayer *mask_layer)
static MaskSplinePoint * mask_spline_point_next(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
BLI_INLINE void interp_v2_v2v2_flfl(float target[2], const float a[2], const float b[2], const float t, const float s)
MaskLayer * BKE_mask_layer_new(Mask *mask, const char *name)
Mask * BKE_mask_new(Main *bmain, const char *name)
void BKE_mask_point_normal(MaskSpline *spline, MaskSplinePoint *point, float u, float n[2])
void BKE_mask_layer_shape_changed_remove(MaskLayer *masklay, int index, int count)
void BKE_mask_layer_free_list(ListBase *masklayers)
MaskSpline * BKE_mask_spline_add(MaskLayer *masklay)
void BKE_mask_spline_direction_switch(MaskLayer *masklay, MaskSpline *spline)
bool BKE_mask_spline_remove(MaskLayer *mask_layer, MaskSpline *spline)
static void interp_weights_uv_v2_apply(const float uv[2], float r_pt[2], const float pt_a[2], const float pt_b[2])
void BKE_mask_point_select_set_handle(MaskSplinePoint *point, const eMaskWhichHandle which_handle, const bool do_select)
int BKE_mask_layer_shape_find_frame_range(MaskLayer *masklay, const float frame, MaskLayerShape **r_masklay_shape_a, MaskLayerShape **r_masklay_shape_b)
void BKE_mask_layer_shape_sort(MaskLayer *masklay)
MaskLayer * BKE_mask_layer_active(Mask *mask)
void BKE_mask_point_select_set(MaskSplinePoint *point, const bool do_select)
void BKE_mask_parent_init(MaskParent *parent)
eMaskhandleMode BKE_mask_point_handles_mode_get(const MaskSplinePoint *point)
void BKE_mask_point_handle(const MaskSplinePoint *point, eMaskWhichHandle which_handle, float r_handle[2])
static void mask_blend_read_data(BlendDataReader *reader, ID *id)
void BKE_mask_layer_copy_list(ListBase *masklayers_new, const ListBase *masklayers)
bool BKE_mask_clipboard_is_empty()
void BKE_mask_layer_shape_to_mask_interp(MaskLayer *masklay, MaskLayerShape *masklay_shape_a, MaskLayerShape *masklay_shape_b, const float fac)
void BKE_mask_point_segment_co(MaskSpline *spline, MaskSplinePoint *point, float u, float co[2])
void BKE_mask_layer_rename(Mask *mask, MaskLayer *masklay, const char *oldname, const char *newname)
MaskSpline * BKE_mask_spline_copy(const MaskSpline *spline)
void BKE_mask_coord_to_image(Image *image, ImageUser *iuser, float r_co[2], const float co[2])
bool BKE_mask_layer_shape_spline_from_index(MaskLayer *masklay, int index, MaskSpline **r_masklay_shape, int *r_index)
static MaskSplinePoint * mask_spline_point_prev(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
void BKE_mask_point_set_handle(MaskSplinePoint *point, eMaskWhichHandle which_handle, float loc[2], bool keep_direction, float orig_handle[2], float orig_vec[3][3])
void BKE_mask_point_parent_matrix_get(MaskSplinePoint *point, float ctime, float parent_matrix[3][3])
static void mask_layer_shape_from_mask_point(BezTriple *bezt, float fp[MASK_OBJECT_SHAPE_ELEM_SIZE])
float BKE_mask_point_weight_scalar(MaskSpline *spline, MaskSplinePoint *point, const float u)
void BKE_mask_coord_to_frame(float r_co[2], const float co[2], const float frame_size[2])
void BKE_mask_layer_free(MaskLayer *masklay)
void BKE_mask_coord_to_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
void BKE_mask_layer_shape_to_mask(MaskLayer *masklay, MaskLayerShape *masklay_shape)
MaskSplinePoint * BKE_mask_spline_point_array(MaskSpline *spline)
float BKE_mask_spline_project_co(MaskSpline *spline, MaskSplinePoint *point, float start_u, const float co[2], const eMaskSign sign)
static MaskSplinePoint * mask_spline_points_copy(const MaskSplinePoint *points, int tot_point)
static float mask_point_interp_weight(BezTriple *bezt, BezTriple *bezt_next, const float u)
static void mask_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
void BKE_mask_coord_from_image(Image *image, ImageUser *iuser, float r_co[2], const float co[2])
void BKE_mask_layer_remove(Mask *mask, MaskLayer *masklay)
int BKE_mask_layer_shape_totvert(MaskLayer *masklay)
MaskLayerShape * BKE_mask_layer_shape_find_frame(MaskLayer *masklay, const int frame)
BezTriple * BKE_mask_spline_point_next_bezt(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
static void mask_free_data(ID *id)
BLI_INLINE void orthogonal_direction_get(const float vec[2], float result[2])
void BKE_mask_layer_shape_free(MaskLayerShape *masklay_shape)
void BKE_mask_spline_ensure_deform(MaskSpline *spline)
void BKE_mask_spline_free(MaskSpline *spline)
void BKE_mask_layer_free_shapes(MaskLayer *masklay)
Free all animation keys for a mask layer.
int BKE_mask_layer_shape_spline_to_index(MaskLayer *masklay, MaskSpline *spline)
static void mask_calc_point_handle(MaskSplinePoint *point, MaskSplinePoint *point_prev, MaskSplinePoint *point_next)
int BKE_mask_get_duration(Mask *mask)
MaskLayerShape * BKE_mask_layer_shape_alloc(MaskLayer *masklay, const int frame)
static void mask_clipboard_free_ex(bool final_free)
void BKE_mask_point_free(MaskSplinePoint *point)
void BKE_mask_layer_evaluate(MaskLayer *masklay, const float ctime, const bool do_newframe)
void BKE_mask_layer_active_set(Mask *mask, MaskLayer *masklay)
void BKE_mask_point_direction_switch(MaskSplinePoint *point)
void BKE_mask_clipboard_copy_from_layer(MaskLayer *mask_layer)
void BKE_mask_spline_free_list(ListBase *splines)
static void interp_weights_uv_v2_calc(float r_uv[2], const float pt[2], const float pt_a[2], const float pt_b[2])
MaskLayerShape * BKE_mask_layer_shape_duplicate(MaskLayerShape *masklay_shape)
void BKE_mask_coord_from_frame(float r_co[2], const float co[2], const float frame_size[2])
static struct @337113272175365276371025132263302043000243361112 mask_clipboard
MaskLayer * BKE_mask_layer_copy(const MaskLayer *masklay)
void BKE_mask_calc_tangent_polyline(MaskSpline *spline, MaskSplinePoint *point, float t[2])
void BKE_mask_layer_shape_changed_add(MaskLayer *masklay, int index, bool do_init, bool do_init_interpolate)
void BKE_mask_evaluate(Mask *mask, const float ctime, const bool do_newframe)
void BKE_mask_calc_handle_point_auto(MaskSpline *spline, MaskSplinePoint *point, const bool do_recalc_length)
Resets auto handles even for non-auto bezier points.
MaskSplinePointUW * BKE_mask_point_sort_uw(MaskSplinePoint *point, MaskSplinePointUW *uw)
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_dupallocN(const void *vmemh)
size_t(* MEM_allocN_len)(const void *vmemh)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
struct MaskLayerShape * prev
struct MaskLayerShape * next
struct MaskSplinePoint * act_point
struct MaskSpline * act_spline
float parent_corners_orig[4][2]
MaskSplinePoint * points_deform
struct MovieTracking tracking