54 std::optional<Library *> ,
60 const Mask *mask_src = (
const Mask *)id_src;
90 for (
int i = 0; i < mask_spline->tot_point; i++) {
112 spline->points_deform =
nullptr;
117 spline->points_deform = points_deform;
119 for (i = 0; i < spline->tot_point; i++) {
153 for (
int i = 0; i < spline->tot_point; i++) {
162 if ((act_point_search ==
nullptr) && (masklay->act_point >= points_old) &&
163 (masklay->act_point < points_old + spline->tot_point))
165 act_point_search = &spline->points[masklay->act_point - points_old];
177 masklay->act_point = act_point_search;
220 if (point == &points_array[spline->tot_point - 1]) {
222 return &points_array[0];
235 if (point == points_array) {
237 return &points_array[spline->tot_point - 1];
250 if (point == &points_array[spline->tot_point - 1]) {
252 return &(points_array[0].
bezt);
258 return &(point + 1)->bezt;
263 return spline->points_deform ? spline->points_deform : spline->points;
269 if ((point_ref >= spline->points) && (point_ref < &spline->points[spline->tot_point])) {
270 return spline->points;
273 if ((point_ref >= spline->points_deform) &&
274 (point_ref < &spline->points_deform[spline->tot_point]))
276 return spline->points_deform;
287 MaskLayer *masklay = MEM_cnew<MaskLayer>(__func__);
298 masklay->
alpha = 1.0f;
311 mask->masklay_act =
BLI_findindex(&mask->masklayers, masklay);
321 if (mask->masklay_act >= mask->masklay_tot) {
322 mask->masklay_act = mask->masklay_tot - 1;
333 sizeof(masklay->
name));
351 MaskLayer *masklay_new = MEM_cnew<MaskLayer>(
"new mask layer");
371 if (masklay->
act_point >= spline->points &&
372 masklay->
act_point < spline->points + spline->tot_point)
374 const size_t point_index = masklay->
act_point - spline->points;
382 MaskLayerShape *masklay_shape_new = MEM_cnew<MaskLayerShape>(
"new mask layer shape");
384 masklay_shape_new->
data =
static_cast<float *
>(
MEM_dupallocN(masklay_shape->data));
385 masklay_shape_new->
tot_vert = masklay_shape->tot_vert;
386 masklay_shape_new->
flag = masklay_shape->flag;
387 masklay_shape_new->
frame = masklay_shape->frame;
409 MaskSpline *spline = MEM_cnew<MaskSpline>(
"new mask spline");
414 spline->points = MEM_cnew<MaskSplinePoint>(
"new mask spline point");
415 spline->tot_point = 1;
443 const int tot_uw = point->tot_uw;
444 const int tot_uw_half = tot_uw / 2;
450 copy_v2_v2(point->bezt.vec[0], point->bezt.vec[2]);
453 std::swap(point->bezt.f1, point->bezt.f3);
454 std::swap(point->bezt.h1, point->bezt.h2);
459 for (
int i = 0; i < tot_uw_half; i++) {
462 std::swap(*uw_a, *uw_b);
466 for (
int i = 0; i < tot_uw; i++) {
468 uw->
u = 1.0f - uw->
u;
474 const int tot_point = spline->tot_point;
475 const int tot_point_half = tot_point / 2;
483 for (i = 0; i < tot_point_half; i++) {
486 std::swap(*point_a, *point_b);
490 i_prev = tot_point - 1;
491 for (i = 0; i < tot_point; i++) {
495 std::swap(spline->points[i].uw, spline->points[i_prev].uw);
496 std::swap(spline->points[i].tot_uw, spline->points[i_prev].tot_uw);
508 for (i = 0; i < tot_point_half; i++) {
511 std::swap(*fp_a, *fp_b);
523 const float proj_eps = 1
e-3;
524 const float proj_eps_sq = proj_eps * proj_eps;
526 float u = -1.0f, du = 1.0f /
N, u1 = start_u, u2 = start_u;
531 while (u1 > 0.0f || u2 < 1.0f) {
532 float n1[2], n2[2], co1[2], co2[2];
547 if (ang1 >
float(
M_PI_2)) {
551 if (ang < 0.0f || ang1 < ang) {
574 if (ang2 >
float(
M_PI_2)) {
621 r_handle[0] = (bezt->
vec[1][0] + vec[1]);
622 r_handle[1] = (bezt->
vec[1][1] - vec[0]);
631 BLI_assert_msg(0,
"Unknown handle passed to BKE_mask_point_handle");
639 float orig_handle[2],
640 float orig_vec[3][3])
645 float v1[2],
v2[2], vec[2];
646 if (keep_direction) {
684 BLI_assert_msg(0,
"unknown handle passed to BKE_mask_point_set_handle");
692 BezTriple *bezt = &point->bezt, *bezt_next;
702 co, bezt->
vec[1], bezt->
vec[2], bezt_next->vec[0], bezt_next->vec[1], u);
721 const float du = 0.05f;
725 if (u - du < 0.0f && point_prev ==
nullptr) {
731 else if (u + du > 1.0f && point_next ==
nullptr) {
738 float prev_co[2], next_co[2], co[2];
739 float dir1[2], dir2[2], dir[2];
770 return (bezt->
weight * (1.0f - u)) + (bezt_next->
weight * u);
776 BezTriple *bezt = &point->bezt, *bezt_next;
787 return bezt_next->weight;
796 BezTriple *bezt = &point->bezt, *bezt_next;
807 return bezt_next->weight;
810 float cur_u = 0.0f, cur_w = 0.0f, next_u = 0.0f, next_w = 0.0f, fac;
812 for (
int i = 0; i <= point->tot_uw; i++) {
818 cur_u = point->uw[i - 1].u;
819 cur_w = point->uw[i - 1].w;
822 if (i == point->tot_uw) {
827 next_u = point->uw[i].u;
828 next_w = point->uw[i].w;
831 if (u >= cur_u && u <= next_u) {
836 fac = (u - cur_u) / (next_u - cur_u);
842 return cur_w + (next_w - cur_w) * (3.0f * fac * fac - 2.0f * fac * fac * fac);
845 return (1.0f - fac) * cur_w + fac * next_w;
850 if (point->tot_uw > 1) {
851 int idx = uw - point->uw;
853 if (idx > 0 && point->uw[idx - 1].u > uw->
u) {
854 while (idx > 0 && point->uw[idx - 1].u > point->uw[idx].u) {
855 std::swap(point->uw[idx - 1], point->uw[idx]);
860 if (idx < point->tot_uw - 1 && point->uw[idx + 1].u < uw->
u) {
861 while (idx < point->tot_uw - 1 && point->uw[idx + 1].u < point->uw[idx].u) {
862 std::swap(point->uw[idx + 1], point->uw[idx]);
867 return &point->uw[idx];
876 point->uw = MEM_cnew<MaskSplinePointUW>(
"mask point uw");
880 MEM_reallocN(point->uw, (point->tot_uw + 1) *
sizeof(*point->uw)));
883 point->uw[point->tot_uw].
u = u;
884 point->uw[point->tot_uw].w =
w;
885 point->uw[point->tot_uw].flag = 0;
901 for (
int i = 0; i < point->tot_uw; i++) {
903 point->uw[i].flag |=
SELECT;
906 point->uw[i].flag &= ~SELECT;
913 const bool do_select)
927 BLI_assert_msg(0,
"Wrong which_handle passed to BKE_mask_point_select_set_handle");
932 point->bezt.f1 &= ~SELECT;
933 point->bezt.f3 &= ~SELECT;
936 point->bezt.f1 &= ~SELECT;
939 point->bezt.f3 &= ~SELECT;
942 BLI_assert_msg(0,
"Wrong which_handle passed to BKE_mask_point_select_set_handle");
962 STRNCPY(mask_name, (name && name[0]) ? name :
DATA_(
"Mask"));
986 for (i = 0; i < spline->tot_point; i++) {
988 point = &spline->points[i];
991 if (spline->points_deform) {
992 point = &spline->points_deform[i];
999 if (spline->points_deform) {
1015 spline = next_spline;
1023 for (
int i = 0; i < tot_point; i++) {
1036 MaskSpline *nspline = MEM_cnew<MaskSpline>(
"new spline");
1043 if (spline->points_deform) {
1055 masklay_shape = MEM_cnew<MaskLayerShape>(__func__);
1056 masklay_shape->
frame = frame;
1057 masklay_shape->
tot_vert = tot_vert;
1060 return masklay_shape;
1065 if (masklay_shape->
data) {
1078 while (masklay_shape) {
1084 masklay_shape = next_masklay_shape;
1109 masklay = masklay_next;
1115 if (frame_size[0] == frame_size[1]) {
1119 else if (frame_size[0] < frame_size[1]) {
1120 r_co[0] = ((co[0] - 0.5f) * (frame_size[0] / frame_size[1])) + 0.5f;
1125 r_co[1] = ((co[1] - 0.5f) * (frame_size[1] / frame_size[0])) + 0.5f;
1135 float frame_size[2];
1141 frame_size[1] *= (aspy / aspx);
1149 float frame_size[2];
1154 frame_size[1] *= (aspy / aspx);
1161 if (frame_size[0] == frame_size[1]) {
1165 else if (frame_size[0] < frame_size[1]) {
1166 r_co[0] = ((co[0] - 0.5f) / (frame_size[0] / frame_size[1])) + 0.5f;
1171 r_co[1] = ((co[1] - 0.5f) / (frame_size[1] / frame_size[0])) + 0.5f;
1181 float frame_size[2];
1187 frame_size[1] *= (aspy / aspx);
1195 float frame_size[2];
1201 frame_size[1] *= (aspy / aspx);
1208 float parent_matrix[3][3])
1234 float marker_position[2], parent_co[2];
1245 float corners[4][2];
1247 float frame_size[2],
H[3][3], mask_from_clip_matrix[3][3], mask_to_clip_matrix[3][3];
1252 unit_m3(mask_from_clip_matrix);
1257 frame_size[1] *= (aspy / aspx);
1258 if (frame_size[0] == frame_size[1]) {
1261 else if (frame_size[0] < frame_size[1]) {
1262 mask_from_clip_matrix[0][0] = frame_size[1] / frame_size[0];
1263 mask_from_clip_matrix[2][0] = -0.5f * (frame_size[1] / frame_size[0]) + 0.5f;
1266 mask_from_clip_matrix[1][1] = frame_size[1] / frame_size[0];
1267 mask_from_clip_matrix[2][1] = -0.5f * (frame_size[1] / frame_size[0]) + 0.5f;
1270 invert_m3_m3(mask_to_clip_matrix, mask_from_clip_matrix);
1271 mul_m3_series(parent_matrix, mask_from_clip_matrix,
H, mask_to_clip_matrix);
1284 BezTriple *bezt_prev =
nullptr, *bezt_next =
nullptr;
1288 bezt_prev = &point_prev->
bezt;
1292 bezt_next = &point_next->
bezt;
1296 if (bezt_prev || bezt_next) {
1303 else if (handle_type ==
HD_AUTO) {
1343 float tvec_a[2], tvec_b[2];
1384 float length_average = 0.0f;
1385 float weight_average = 0.0f;
1393 if (point_prev && point_next) {
1415 length_average /=
float(length_tot);
1416 weight_average /=
float(length_tot);
1420 point->bezt.weight = weight_average;
1426 const bool do_recalc_length)
1429 const char h_back[2] = {point->
bezt.
h1, point->bezt.h2};
1430 const float length_average = (do_recalc_length) ?
1432 (
len_v3v3(point->bezt.vec[0], point->bezt.vec[1]) +
1433 len_v3v3(point->bezt.vec[1], point->bezt.vec[2])) /
1442 point->bezt.h1 = h_back[0];
1443 point->bezt.h2 = h_back[1];
1446 if (do_recalc_length ==
false) {
1455 for (
int i = 0; i < spline->tot_point; i++) {
1463 int allocated_points = (
MEM_allocN_len(spline->points_deform) /
sizeof(*spline->points_deform));
1466 if (spline->points_deform ==
nullptr || allocated_points != spline->tot_point) {
1469 if (spline->points_deform) {
1470 for (
int i = 0; i < allocated_points; i++) {
1478 spline->points_deform = MEM_cnew_array<MaskSplinePoint>(spline->tot_point, __func__);
1515 tot += spline->tot_point;
1545 if (masklay_shape->
tot_vert == tot) {
1546 float *fp = masklay_shape->
data;
1549 for (
int i = 0; i < spline->tot_point; i++) {
1557 "vert mismatch %d != %d (frame %d)",
1560 masklay_shape->
frame);
1568 if (masklay_shape->
tot_vert == tot) {
1569 float *fp = masklay_shape->
data;
1572 for (
int i = 0; i < spline->tot_point; i++) {
1580 "vert mismatch %d != %d (frame %d)",
1583 masklay_shape->
frame);
1588 float target[2],
const float a[2],
const float b[2],
const float t,
const float s)
1590 target[0] = s * a[0] + t *
b[0];
1591 target[1] = s * a[1] + t *
b[1];
1600 if (masklay_shape_a->
tot_vert == tot && masklay_shape_b->
tot_vert == tot) {
1601 const float *fp_a = masklay_shape_a->
data;
1602 const float *fp_b = masklay_shape_b->
data;
1603 const float ifac = 1.0f - fac;
1606 for (
int i = 0; i < spline->tot_point; i++) {
1607 BezTriple *bezt = &spline->points[i].bezt;
1618 bezt->
weight = (fp_a[0] * ifac) + (fp_b[0] * fac);
1619 bezt->
radius = (fp_a[1] * ifac) + (fp_b[1] * fac);
1627 "vert mismatch %d != %d != %d (frame %d - %d)",
1631 masklay_shape_a->
frame,
1632 masklay_shape_b->
frame);
1639 if (frame == masklay_shape->frame) {
1640 return masklay_shape;
1642 if (frame < masklay_shape->frame) {
1658 masklay_shape = masklay_shape->
next)
1660 if (frame == masklay_shape->
frame) {
1661 *r_masklay_shape_a = masklay_shape;
1662 *r_masklay_shape_b =
nullptr;
1665 if (frame < masklay_shape->frame) {
1666 if (masklay_shape->
prev) {
1667 *r_masklay_shape_a = masklay_shape->
prev;
1668 *r_masklay_shape_b = masklay_shape;
1672 *r_masklay_shape_a = masklay_shape;
1673 *r_masklay_shape_b =
nullptr;
1679 *r_masklay_shape_a = masklay_shape;
1680 *r_masklay_shape_b =
nullptr;
1684 *r_masklay_shape_a =
nullptr;
1685 *r_masklay_shape_b =
nullptr;
1696 if (masklay_shape ==
nullptr) {
1702 return masklay_shape;
1713 return masklay_shape_copy;
1724 const void *masklay_shape_b_ptr)
1729 if (masklay_shape_a->
frame < masklay_shape_b->
frame) {
1732 if (masklay_shape_a->
frame > masklay_shape_b->
frame) {
1750 if (index < spline->tot_point) {
1751 *r_masklay_shape = spline;
1766 spline_iter && spline_iter != spline;
1767 i_abs += spline_iter->
tot_point, spline_iter = spline_iter->
next)
1778 const float pt_a[2],
1779 const float pt_b[2])
1781 const float segment_len =
len_v2v2(pt_a, pt_b);
1782 if (segment_len == 0.0f) {
1788 float pt_on_line[2];
1791 r_uv[1] = (
len_v2v2(pt_on_line, pt) / segment_len) *
1798 const float pt_a[2],
1799 const float pt_b[2])
1801 const float dvec[2] = {pt_b[0] - pt_a[0], pt_b[1] - pt_a[1]};
1807 r_pt[0] += -dvec[1] * uv[1];
1808 r_pt[1] += dvec[0] * uv[1];
1814 bool do_init_interpolate)
1818 int spline_point_index;
1829 const int pi_curr = spline_point_index;
1830 const int pi_prev = ((spline_point_index - 1) + spline->tot_point) % spline->
tot_point;
1831 const int pi_next = (spline_point_index + 1) % spline->tot_point;
1833 const int index_offset = index - spline_point_index;
1835 const int pi_prev_abs = pi_prev + index_offset;
1836 const int pi_next_abs = pi_next + index_offset;
1838 if (do_init_interpolate) {
1839 for (
int i = 0; i < 3; i++) {
1841 spline->points[pi_curr].bezt.vec[i],
1842 spline->points[pi_prev].bezt.vec[i],
1843 spline->points[pi_next].bezt.vec[i]);
1848 if (tot == masklay_shape->tot_vert) {
1849 float *data_resized;
1851 masklay_shape->tot_vert++;
1855 memcpy(data_resized,
1856 masklay_shape->data,
1860 if (index != masklay_shape->tot_vert - 1) {
1863 (masklay_shape->tot_vert - (index + 1)) *
sizeof(
float) *
1872 if (do_init_interpolate && spline->tot_point > 2) {
1873 for (
int i = 0; i < 3; i++) {
1889 masklay_shape->data = data_resized;
1893 "vert mismatch %d != %d (frame %d)",
1894 masklay_shape->tot_vert,
1896 masklay_shape->frame);
1908 if (tot == masklay_shape->tot_vert -
count) {
1909 float *data_resized;
1911 masklay_shape->tot_vert -=
count;
1915 memcpy(data_resized,
1916 masklay_shape->data,
1920 if (index != masklay_shape->tot_vert) {
1927 masklay_shape->data = data_resized;
1931 "vert mismatch %d != %d (frame %d)",
1932 masklay_shape->tot_vert -
count,
1934 masklay_shape->frame);
1941 return max_ii(1, mask->efra - mask->sfra);
1978 if (spline->flag &
SELECT) {
1980 for (
int i = 0; i < spline_new->
tot_point; i++) {
1982 if (point->parent.id) {
1984 int len = strlen(point->parent.id->name);
1985 char *name_copy =
static_cast<char *
>(
MEM_mallocN(
len + 1,
"mask clipboard ID name"));
1986 memcpy(name_copy, point->parent.id->name,
len + 1);
2007 for (
int i = 0; i < spline_new->
tot_point; i++) {
2009 if (point->parent.id) {
2010 const char *
id_name =
static_cast<const char *
>(
2017 point->parent.id =
static_cast<ID *
>(
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)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BLI_remlink_safe(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_listbase_sort(struct ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT 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(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_read_float_array(BlendDataReader *reader, int 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)
void BLO_write_float_array(BlendWriter *writer, uint num, const float *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)
#define MASK_OBJECT_SHAPE_ELEM_SIZE
@ MASK_PARENT_POINT_TRACK
@ MASK_SPLINE_INTERP_EASE
@ MASK_LAYERFLAG_FILL_OVERLAP
@ MASK_LAYERFLAG_FILL_DISCRETE
void DRW_drawdata_free(ID *id)
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
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)
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)
static struct @87 mask_clipboard
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])
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)
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.
std::string id_name(void *id)
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
void *(* MEM_mallocN)(size_t len, const char *str)
size_t(* MEM_allocN_len)(const void *vmemh)
void MEM_freeN(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
ccl_device_inline float4 mask(const int4 mask, const float4 a)
struct MaskLayerShape * prev
struct MaskLayerShape * next
struct MaskSplinePoint * act_point
struct MaskSpline * act_spline
float parent_corners_orig[4][2]
MaskSplinePoint * points_deform
ccl_device_inline int abs(int x)