90 if (
mask ==
nullptr) {
97 if (mask_layer ==
nullptr) {
149 if (pprop.
prop !=
nullptr) {
159 ot->
name =
"New Mask";
161 ot->
idname =
"MASK_OT_new";
184 mask->masklay_act =
mask->masklay_tot - 1;
195 ot->
name =
"Add Mask Layer";
196 ot->
description =
"Add new mask layer for masking";
197 ot->
idname =
"MASK_OT_layer_new";
230 ot->
name =
"Remove Mask Layer";
232 ot->
idname =
"MASK_OT_layer_remove";
304 const float threshold = 19.0f;
307 float closest_dist_squared = 0.0f;
310 bool undistort =
false;
311 *r_mask_layer =
nullptr;
312 *r_mask_spline =
nullptr;
320 pixel_co[0] = co[0] * width;
321 pixel_co[1] = co[1] * height;
323 undistort = (sc->
clip !=
nullptr) &&
328 *mask_layer_eval = mask_eval->
masklayers.first();
329 mask_layer_orig !=
nullptr;
330 mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next)
335 for (
MaskSpline *spline_orig = mask_layer_orig->splines.first(),
336 *spline_eval = mask_layer_eval->splines.first();
337 spline_orig !=
nullptr;
338 spline_orig = spline_orig->
next, spline_eval = spline_eval->
next)
340 if ((spline_orig->flag &
SELECT) == 0) {
344 float min[2],
max[2], center[2];
346 for (
int i = 0; i < spline_orig->tot_point; i++) {
361 center[0] = (
min[0] +
max[0]) / 2.0f * width;
362 center[1] = (
min[1] +
max[1]) / 2.0f * height;
365 if (dist_squared <= max_bb_side * max_bb_side * 0.5f &&
366 (closest_spline ==
nullptr || dist_squared < closest_dist_squared))
368 closest_layer = mask_layer_orig;
369 closest_spline = spline_orig;
370 closest_dist_squared = dist_squared;
374 if (closest_dist_squared <
square_f(threshold) && closest_spline !=
nullptr) {
390 if (
square_f(diff_score) < closest_dist_squared) {
395 *r_mask_layer = closest_layer;
396 *r_mask_spline = closest_spline;
404 for (
int i = 0; i < spline->
tot_point; i++) {
423 switch (which_handle) {
438 BLI_assert_msg(0,
"Unexpected situation in select_sliding_point()");
477 MaskLayer *mask_layer, *cv_mask_layer, *feather_mask_layer;
478 MaskSpline *spline, *cv_spline, *feather_spline;
483 float co[2], cv_score, feather_score;
484 const float threshold = 19;
494 C,
mask, co, threshold, &cv_mask_layer, &cv_spline, &which_handle, &cv_score);
506 if (slide_feather || !cv_point || feather_score < cv_score) {
509 mask_layer = feather_mask_layer;
510 spline = feather_spline;
511 point = feather_point;
523 mask_layer = cv_mask_layer;
540 customdata->
spline = spline;
541 customdata->
point = point;
542 customdata->
width = width;
543 customdata->
height = height;
544 customdata->
action = action;
599 const int zero_mouse[2] = {0, 0};
611 if (
mask ==
nullptr) {
635 for (
int i = 0; i <
data->spline->tot_point; i++) {
646 for (
int i = 0; i <
data->spline->tot_point; i++) {
652 for (
int j = 0; j < point->
tot_uw; j++) {
653 point->
uw[j] = orig_point->
uw[j];
662 if (
data->orig_spline) {
671 data->point->bezt.weight =
data->weight;
676 data->point->bezt.h1 =
data->old_h1;
677 data->point->bezt.h2 =
data->old_h2;
684 if (
data->orig_spline) {
697 switch (event->
type) {
728 const int zero_mouse[2] = {0, 0};
739 if (
data->is_accurate) {
748 &
data->spline->points[0],
749 &
data->spline->points[
data->spline->tot_point - 1]))
751 std::swap(delta[0], delta[1]);
755 if (
data->point != &
data->spline->points[0]) {
766 data->is_curvature_only,
767 data->orig_handle_coord,
771 if (
data->is_sliding_new_point) {
788 float vec[2], no[2], p[2], c[2],
w, offco[2];
789 float *weight =
nullptr;
790 float weight_scalar = 1.0f;
791 bool is_overall_feather =
data->is_overall_feather ||
data->is_initial_feather;
808 if (u_pos > 0.0f && u_pos < 1.0f) {
813 if (u_neg > 0.0f && u_neg < 1.0f) {
818 u = dist_pos < dist_neg ? u_pos : u_neg;
820 if (u > 0.0f && u < 1.0f) {
824 weight = &
data->uw->w;
826 if (weight_scalar != 0.0f) {
827 weight_scalar = 1.0f / weight_scalar;
847 if (is_overall_feather) {
854 w_delta =
w -
data->weight *
data->weight_scalar;
856 if (
data->orig_spline ==
nullptr) {
860 *weight =
data->weight;
865 if (
data->is_initial_feather) {
866 *weight =
w * weight_scalar;
876 if (
data->orig_spline) {
881 data->orig_spline =
nullptr;
884 if (weight_scalar != 0.0f) {
885 *weight =
w * weight_scalar;
893 if (
data->orig_spline ==
nullptr) {
897 for (
int i = 0; i <
data->spline->tot_point; i++) {
923 if (
data->is_sliding_new_point) {
967 ot->
name =
"Slide Point";
969 ot->
idname =
"MASK_OT_slide_point";
983 "First try to slide feather instead of vertex");
986 ot->
srna,
"is_new_point",
false,
"Slide New Point",
"Newly created vertex is being slid");
1019 MEM_delete(slide_data);
1026 const float threshold = 19.0f;
1035 C,
mask, co, threshold,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr))
1046 const float threshold = 19.0f;
1079 if (next_bezt ==
nullptr) {
1083 slide_data = MEM_new<SlideSplineCurvatureData>(
"slide curvature slide");
1087 slide_data->
spline = spline;
1088 slide_data->
point = point;
1154 if (
mask ==
nullptr) {
1164 if (slide_data !=
nullptr) {
1181 const float u2 = u * u, u3 = u * u * u;
1182 const float v = 1.0f - u;
1183 const float v2 =
v *
v, v3 =
v *
v *
v;
1184 const float inv_divider = 1.0f / (3.0f *
v2 * u);
1185 const float t = 3.0f *
v * u2;
1186 solution[0] = -(v3 * P0[0] + t * P2[0] + u3 * P3[0] -
B[0]) * inv_divider;
1187 solution[1] = -(v3 * P0[1] + t * P2[1] + u3 * P3[1] -
B[1]) * inv_divider;
1197 const float u2 = u * u, u3 = u * u * u;
1198 const float v = 1.0f - u;
1199 const float v2 =
v *
v, v3 =
v *
v *
v;
1200 const float inv_divider = 1.0f / (3.0f *
v * u2);
1201 const float t = 3.0f *
v2 * u;
1202 solution[0] = -(v3 * P0[0] + t * P1[0] + u3 * P3[0] -
B[0]) * inv_divider;
1203 solution[1] = -(v3 * P0[1] + t * P1[1] + u3 * P3[1] -
B[1]) * inv_divider;
1211 const float margin = 0.2f;
1213 float u = slide_data->
u;
1215 switch (event->
type) {
1227 if ((u > margin && u < 0.5f) || (u >= 0.5f && u < 1.0f - margin)) {
1250 float B[2], mouse_coord[2], delta[2];
1264 bool need_restore_P2 =
false;
1268 float x = (u - margin) * 0.5f / (0.5f - margin);
1269 float weight = (3 *
x *
x - 2 *
x *
x *
x);
1276 need_restore_P2 =
true;
1279 if (weight > 0.0f) {
1289 if (need_restore_P2) {
1295 bool need_restore_P1 =
false;
1297 if (u < 1.0f - margin) {
1299 float x = ((1.0f - u) - margin) * 0.5f / (0.5f - margin);
1300 float weight = 3 *
x *
x - 2 *
x *
x *
x;
1307 need_restore_P1 =
true;
1310 if (weight > 0.0f) {
1320 if (need_restore_P1) {
1367 ot->
name =
"Slide Spline Curvature";
1368 ot->
description =
"Slide a point on the spline to define its curvature";
1369 ot->
idname =
"MASK_OT_slide_spline_curvature";
1407 ot->
name =
"Toggle Cyclic";
1408 ot->
description =
"Toggle cyclic for selected splines";
1409 ot->
idname =
"MASK_OT_cyclic_toggle";
1429 for (
int i = 0; i < point->
tot_uw; i++) {
1436 MEM_delete(point->
uw);
1437 point->
uw =
nullptr;
1444 new_uw = MEM_new_array<MaskSplinePointUW>(count,
"new mask uw points");
1446 for (
int i = 0; i < point->
tot_uw; i++) {
1448 new_uw[j++] = point->
uw[i];
1452 MEM_delete(point->
uw);
1462 bool changed =
false;
1466 int mask_layer_shape_ofs = 0;
1472 spline = mask_layer.
splines.first();
1475 const int tot_point_orig = spline->
tot_point;
1480 for (
int i = 0; i < spline->
tot_point; i++) {
1509 new_points = MEM_new_array<MaskSplinePoint>(count,
"deleteMaskPoints");
1511 for (
int i = 0, j = 0; i < tot_point_orig; i++) {
1521 new_points[j] = *point;
1536 mask_layer_shape_ofs += spline->
tot_point;
1538 MEM_delete(spline->
points);
1539 spline->
points = new_points;
1545 spline = next_spline;
1550 if (mask_layer.
splines.is_empty()) {
1571 IFACE_(
"Delete selected control points and splines?"),
1583 ot->
name =
"Delete";
1584 ot->
description =
"Delete selected control points or splines";
1585 ot->
idname =
"MASK_OT_delete";
1603 bool changed =
false;
1607 bool changed_layer =
false;
1617 changed_layer =
true;
1621 if (changed_layer) {
1643 ot->
name =
"Switch Direction";
1644 ot->
description =
"Switch direction of selected splines";
1645 ot->
idname =
"MASK_OT_switch_direction";
1661 bool changed =
false;
1665 bool changed_layer =
false;
1672 for (
int i = 0; i < spline.
tot_point; i++) {
1678 changed_layer =
true;
1683 if (changed_layer) {
1705 ot->
name =
"Recalculate Handles";
1706 ot->
description =
"Recalculate the direction of selected handles";
1707 ot->
idname =
"MASK_OT_normals_make_consistent";
1724 bool changed =
false;
1732 for (
int i = 0; i < spline.
tot_point; i++) {
1739 bezt->
h1 = handle_type;
1740 bezt->
h2 = handle_type;
1744 bezt->
h1 = handle_type;
1747 bezt->
h2 = handle_type;
1775 {
HD_AUTO,
"AUTO", 0,
"Auto",
""},
1776 {
HD_VECT,
"VECTOR", 0,
"Vector",
""},
1777 {
HD_ALIGN,
"ALIGNED", 0,
"Aligned Single",
""},
1779 {
HD_FREE,
"FREE", 0,
"Free",
""},
1780 {0,
nullptr, 0,
nullptr,
nullptr},
1784 ot->
name =
"Set Handle Type";
1785 ot->
description =
"Set type of handles for selected control points";
1786 ot->
idname =
"MASK_OT_handle_type_set";
1797 ot->
prop =
RNA_def_enum(ot->
srna,
"type", editcurve_handle_type_items, 1,
"Type",
"Spline type");
1804 bool changed =
false;
1829 ot->
name =
"Clear Restrict View";
1830 ot->
description =
"Reveal temporarily hidden mask layers";
1831 ot->
idname =
"MASK_OT_hide_view_clear";
1847 bool changed =
false;
1889 ot->
name =
"Set Restrict View";
1891 ot->
idname =
"MASK_OT_hide_view_set";
1901 ot->
srna,
"unselected",
false,
"Unselected",
"Hide unselected rather than selected layers");
1907 bool changed =
false;
1915 for (
int i = 0; i < spline.
tot_point; i++) {
1941 ot->
name =
"Clear Feather Weight";
1942 ot->
description =
"Reset the feather weight to zero";
1943 ot->
idname =
"MASK_OT_feather_weight_clear";
1960 return mask->masklay_tot > 0;
1978 if (direction == -1) {
1979 mask_layer_other = mask_layer->
prev;
1981 if (!mask_layer_other) {
1987 mask->masklay_act--;
1989 else if (direction == 1) {
1990 mask_layer_other = mask_layer->
next;
1992 if (!mask_layer_other) {
1998 mask->masklay_act++;
2010 {-1,
"UP", 0,
"Up",
""},
2011 {1,
"DOWN", 0,
"Down",
""},
2012 {0,
nullptr, 0,
nullptr,
nullptr},
2016 ot->
name =
"Move Layer";
2017 ot->
description =
"Move the active layer up/down in the list";
2018 ot->
idname =
"MASK_OT_layer_move";
2033 "Direction to move the active layer");
2043 return mask->masklay_tot > 0;
2054 const std::string target_layer_name =
RNA_string_get(op->
ptr,
"target_layer_name");
2063 if (&mask_layer == target_mask_layer) {
2098 [&](
const StringRef check_name) {
return names.
contains(check_name); },
'.', name);
2106 if (add_new_layer) {
2109 const char *unique_name = unique_name_string.c_str();
2113 C, op, event,
IFACE_(
"Move to New Layer"),
IFACE_(
"Create"));
2132 ot->
name =
"Move to Layer";
2133 ot->
description =
"Move the active spline to layer";
2134 ot->
idname =
"MASK_OT_move_to_layer";
2146 ot->
srna,
"target_layer_name",
nullptr,
INT16_MAX,
"Name",
"Target Mask Layer");
2149 ot->
srna,
"add_new_layer",
false,
"New Layer",
"Move selection to a new layer");
2164 const void *act_point_prev = mask_layer.
act_point;
2168 while (i < spline.tot_point) {
2169 int start = i, end = -1;
2174 if (i >= spline.tot_point - 1) {
2182 int tot_point_shape_start = 0;
2189 if (new_spline->
points) {
2190 MEM_delete(new_spline->
points);
2194 new_spline->
flag = spline.flag;
2200 new_spline->
tot_point = end - start + 1;
2201 new_spline->
points = MEM_new_array<MaskSplinePoint>(new_spline->
tot_point,
2202 "duplicated mask points");
2204 memcpy(new_spline->
points,
2205 spline.points + start,
2212 ptrdiff_t act_index = mask_layer.
act_point - &spline.points[start];
2213 if (
size_t(act_index) < new_spline->
tot_point) {
2230 for (
b = 0, new_point = new_spline->
points;
b < tot_point;
b++, new_point++) {
2231 if (new_point->
uw) {
2232 new_point->
uw = MEM_dupalloc(new_point->
uw);
2239 &mask_layer, tot_point_shape_start +
b,
true,
false);
2245 if (start != 0 || end != spline.tot_point - 1) {
2258 if (act_point_in_spline && (mask_layer.
act_point == act_point_prev)) {
2276 ot->
name =
"Duplicate Mask";
2277 ot->
description =
"Duplicate selected control points and segments between them";
2278 ot->
idname =
"MASK_OT_duplicate";
2295 if (mask_layer ==
nullptr) {
2307 ot->
name =
"Copy Splines";
2308 ot->
description =
"Copy the selected splines to the internal clipboard";
2309 ot->
idname =
"MASK_OT_copy_splines";
2335 if (mask_layer ==
nullptr) {
2351 ot->
name =
"Paste Splines";
2352 ot->
description =
"Paste splines from the internal clipboard";
2353 ot->
idname =
"MASK_OT_paste_splines";
Functions to insert, delete or modify keyframes.
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
#define INIT_MINMAX2(min, max)
#define ARRAY_HAS_ITEM(arr_item, arr_start, arr_len)
#define BLI_assert_msg(a, msg)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool contains(const Key &key) const
constexpr bool is_empty() const
bool is_autokey_on(const Scene *scene)
void context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
MINLINE float min_ff(float a, float b)
@ MASK_WHICH_HANDLE_RIGHT
@ MASK_WHICH_HANDLE_STICK
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus mask_hide_view_set_exec(bContext *C, wmOperator *op)
ScrArea * CTX_wm_area(const bContext *C)
bool BKE_mask_clipboard_is_empty()
static bool spline_under_mouse_get(const bContext *C, Mask *mask_orig, const float co[2], MaskLayer **r_mask_layer, MaskSpline **r_mask_spline)
static wmOperatorStatus mask_layer_new_exec(bContext *C, wmOperator *op)
void BKE_mask_spline_free(MaskSpline *spline)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
void MASK_OT_switch_direction(wmOperatorType *ot)
void BKE_mask_layer_shape_changed_remove(MaskLayer *masklay, int index, int count)
static void slide_spline_solve_P2(const float u, const float B[2], const float P0[2], const float P1[2], const float P3[2], float solution[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void BKE_mask_point_handle(const MaskSplinePoint *point, eMaskWhichHandle which_handle, float r_handle[2])
PointerRNA RNA_id_pointer_create(ID *id)
void BKE_mask_clipboard_copy_from_layer(MaskLayer *mask_layer)
MINLINE void mul_v2_fl(float r[2], float f)
Mask * BKE_mask_new(Main *bmain, const char *name)
static wmOperatorStatus delete_invoke(bContext *C, wmOperator *op, const wmEvent *)
MINLINE void copy_v2_v2(float r[2], const float a[2])
void ED_mask_select_toggle_all(Mask *mask, int action)
void ED_mask_view_lock_state_store(const bContext *C, MaskViewLockState *state)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
MaskLayer * BKE_mask_layer_new(Mask *mask, const char *name)
static bool slide_spline_curvature_check(bContext *C, const wmEvent *event)
void ED_clip_point_undistorted_pos(const SpaceClip *sc, const float co[2], float r_co[2])
static wmOperatorStatus mask_move_to_layer_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void project_v2_v2v2_normalized(float out[2], const float p[2], const float v_proj[2])
static void cancel_slide_point(SlidePointData *data)
MaskSpline * BKE_mask_spline_copy(const MaskSpline *spline)
static void mask_point_undistort_pos(SpaceClip *sc, float r_co[2], const float co[2])
SpaceClip * CTX_wm_space_clip(const bContext *C)
static wmOperatorStatus slide_spline_curvature_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void select_sliding_point(Mask *mask, MaskLayer *mask_layer, MaskSpline *spline, MaskSplinePoint *point, eMaskWhichHandle which_handle)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static void cancel_slide_spline_curvature(SlideSplineCurvatureData *slide_data)
MaskSplinePoint * ED_mask_point_find_nearest(const bContext *C, Mask *mask_orig, const float normal_co[2], float threshold, MaskLayer **r_mask_layer, MaskSpline **r_spline, eMaskWhichHandle *r_which_handle, float *r_score)
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
static wmOperatorStatus delete_exec(bContext *C, wmOperator *op)
void MASK_OT_layer_remove(wmOperatorType *ot)
void MASK_OT_delete(wmOperatorType *ot)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static wmOperatorStatus slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEvent *event)
@ MCLIP_PROXY_RENDER_UNDISTORT
void MASK_OT_hide_view_set(wmOperatorType *ot)
void MASK_OT_slide_point(wmOperatorType *ot)
static wmOperatorStatus mask_move_to_layer_exec(bContext *C, wmOperator *op)
MaskLayer * ED_mask_layer_ensure(bContext *C, bool *r_added_mask)
void MASK_OT_layer_move(wmOperatorType *ot)
void MASK_OT_duplicate(wmOperatorType *ot)
void MASK_OT_cyclic_toggle(wmOperatorType *ot)
void ED_space_clip_set_mask(bContext *C, SpaceClip *sc, Mask *mask)
void BKE_mask_layer_active_set(Mask *mask, MaskLayer *masklay)
void MASK_OT_feather_weight_clear(wmOperatorType *ot)
size_t void BLI_uniquename_cb(FunctionRef< bool(StringRefNull)> unique_check, const char *defname, char delim, char *name, size_t name_maxncpy) ATTR_NONNULL(2
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool ED_mask_spline_select_check(const MaskSpline *spline)
void WM_operator_properties_confirm_or_exec(wmOperatorType *ot)
void BKE_mask_coord_to_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
VecBase< float, 2 > float2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
MINLINE void add_v2_v2(float r[2], const float a[2])
bool BKE_mask_point_selected(const MaskSplinePoint *p)
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
BezTriple * BKE_mask_spline_point_next_bezt(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void DEG_id_tag_update(ID *id, unsigned int flags)
static bool slide_point_check_initial_feather(MaskSpline *spline)
float BKE_mask_point_weight_scalar(MaskSpline *spline, MaskSplinePoint *point, float u)
BMesh const char void * data
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
bool ED_maskedit_poll(bContext *C)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
MaskSplinePointUW * BKE_mask_point_sort_uw(MaskSplinePoint *point, MaskSplinePointUW *uw)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
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])
MaskLayer * BKE_mask_layer_by_name(Mask *mask, const char *layer_name)
MaskSpline * BKE_mask_spline_add(MaskLayer *masklay)
void BKE_mask_coord_from_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
void MASK_OT_new(wmOperatorType *ot)
void WM_menu_name_call(bContext *C, const char *menu_name, wm::OpCallContext context)
MaskLayer * BKE_mask_layer_active(Mask *mask)
void BKE_mask_point_select_set(MaskSplinePoint *point, bool do_select)
void ED_mask_get_size(ScrArea *area, int *r_width, int *r_height)
static void free_slide_point_data(SlidePointData *data)
void BKE_mask_spline_move_to_layer(MaskSpline *spline, MaskLayer *src_mask_layer, MaskLayer *dst_mask_layer)
void BKE_mask_point_normal(MaskSpline *spline, MaskSplinePoint *point, float u, float n[2])
void ED_mask_layer_shape_auto_key(const bContext *C, MaskLayer *mask_layer, int frame)
void BKE_mask_clipboard_paste_to_layer(Main *bmain, MaskLayer *mask_layer)
Mask * CTX_data_edit_mask(const bContext *C)
void ED_mask_select_flush_all(Mask *mask)
static void slide_spline_solve_P1(const float u, const float B[2], const float P0[2], const float P2[2], const float P3[2], float solution[2])
void ED_mask_view_lock_state_restore_no_jump(const bContext *C, const MaskViewLockState *state)
static bool paste_splines_poll(bContext *C)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
static wmOperatorStatus mask_normals_make_consistent_exec(bContext *C, wmOperator *)
wmOperatorStatus WM_operator_confirm_ex(bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, ui::AlertIcon icon, bool cancel_default)
static wmOperatorStatus mask_duplicate_exec(bContext *C, wmOperator *)
static VectorSet< StringRef > get_layer_names(Mask *mask)
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void MASK_OT_normals_make_consistent(wmOperatorType *ot)
static wmOperatorStatus copy_splines_exec(bContext *C, wmOperator *)
bool ED_maskedit_mask_poll(bContext *C)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool ED_maskedit_mask_visible_splines_poll(bContext *C)
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
static wmOperatorStatus mask_feather_weight_clear_exec(bContext *C, wmOperator *)
static wmOperatorStatus mask_layer_remove_exec(bContext *C, wmOperator *)
static void free_slide_spline_curvature_data(SlideSplineCurvatureData *slide_data)
wmOperatorStatus WM_operator_props_popup_confirm_ex(bContext *C, wmOperator *op, const wmEvent *, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message)
void MASK_OT_paste_splines(wmOperatorType *ot)
static std::string unique_layer_name(Mask *mask, const StringRef name)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void ED_mask_layer_select_set(MaskLayer *mask_layer, bool do_select)
Main * CTX_data_main(const bContext *C)
int BKE_mask_layer_shape_spline_to_index(MaskLayer *masklay, MaskSpline *spline)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
static bool mask_move_to_layer_poll(bContext *C)
static wmOperatorStatus paste_splines_exec(bContext *C, wmOperator *)
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
void MASK_OT_copy_splines(wmOperatorType *ot)
void BKE_mask_point_free(MaskSplinePoint *point)
static wmOperatorStatus mask_switch_direction_exec(bContext *C, wmOperator *)
static wmOperatorStatus cyclic_toggle_exec(bContext *C, wmOperator *)
MINLINE float square_f(float a)
static wmOperatorStatus slide_point_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void MASK_OT_move_to_layer(wmOperatorType *ot)
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
void MASK_OT_handle_type_set(wmOperatorType *ot)
void BKE_id_move_to_same_lib(Main &bmain, ID &id, const ID &owner_id)
void BKE_mask_layer_free_shapes(MaskLayer *masklay)
Free all animation keys for a mask layer.
void MASK_OT_hide_view_clear(wmOperatorType *ot)
static wmOperatorStatus mask_new_exec(bContext *C, wmOperator *op)
Scene * CTX_data_scene(const bContext *C)
static void slide_point_delta_all_feather(SlidePointData *data, float delta)
MINLINE void sub_v2_v2(float r[2], const float a[2])
static bool mask_layer_move_poll(bContext *C)
static wmOperatorStatus set_handle_type_exec(bContext *C, wmOperator *op)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
bool ED_mask_layer_select_check(const MaskLayer *mask_layer)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float r_co[2])
Mask * ED_mask_new(bContext *C, const char *name)
MaskSplinePoint * BKE_mask_spline_point_array(MaskSpline *spline)
static void slide_point_restore_spline(SlidePointData *data)
void BKE_mask_spline_direction_switch(MaskLayer *masklay, MaskSpline *spline)
void MASK_OT_slide_spline_curvature(wmOperatorType *ot)
static wmOperatorStatus mask_hide_view_clear_exec(bContext *C, wmOperator *op)
ARegion * CTX_wm_region(const bContext *C)
static void check_sliding_handle_type(MaskSplinePoint *point, eMaskWhichHandle which_handle)
static wmOperatorStatus mask_layer_move_exec(bContext *C, wmOperator *op)
void BKE_mask_layer_remove(Mask *mask, MaskLayer *masklay)
void BKE_mask_point_segment_co(MaskSpline *spline, MaskSplinePoint *point, float u, float co[2])
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
static bool mask_new_poll(bContext *C)
void BKE_mask_layer_shape_changed_add(MaskLayer *masklay, int index, bool do_init, bool do_init_interpolate)
static SlideSplineCurvatureData * slide_spline_curvature_customdata(bContext *C, const wmEvent *event)
float BKE_mask_spline_project_co(MaskSpline *spline, MaskSplinePoint *point, float start_u, const float co[2], eMaskSign sign)
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
void BKE_mask_calc_handle_point_auto(MaskSpline *spline, MaskSplinePoint *point, bool do_recalc_length)
Resets auto handles even for non-auto bezier points.
static void delete_feather_points(MaskSplinePoint *point)
void MASK_OT_layer_new(wmOperatorType *ot)
static SlidePointData * slide_point_customdata(bContext *C, wmOperator *op, const wmEvent *event)
bool ED_mask_find_nearest_diff_point(const bContext *C, Mask *mask_orig, const float normal_co[2], int threshold, bool feather, float tangent[2], bool use_deform, bool use_project, MaskLayer **r_mask_layer, MaskSpline **r_spline, MaskSplinePoint **r_point, float *r_u, float *r_score)
bool ED_mask_feather_find_nearest(const bContext *C, Mask *mask_orig, const float normal_co[2], float threshold, MaskLayer **r_mask_layer, MaskSpline **r_spline, MaskSplinePoint **r_point, MaskSplinePointUW **r_uw, float *r_score)
struct MaskSplinePoint * act_point
struct MaskSpline * act_spline
ListBaseT< MaskLayerShape > splines_shapes
MaskLayerVisibility visibility_flag
ListBaseT< MaskSpline > splines
MaskSplineInterp weight_interp
MaskSplineOffset offset_mode
ListBaseT< struct MaskLayer > masklayers
eMovieClipProxy_RenderFlag render_flag
ListBaseT< SpaceLink > spacedata
float prev_mouse_coord[2]
eMaskWhichHandle which_handle
float prev_feather_coord[2]
float orig_handle_coord[2]
bool is_sliding_new_point
float prev_handle_coord[2]
BezTriple other_bezt_backup
float prev_mouse_coord[2]
float prev_spline_coord[2]
struct MovieClipUser user
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT