83 if (
mask ==
nullptr) {
90 if (mask_layer ==
nullptr) {
114 ot->name =
"New Mask";
115 ot->description =
"Create new mask";
116 ot->idname =
"MASK_OT_new";
139 mask->masklay_act =
mask->masklay_tot - 1;
150 ot->name =
"Add Mask Layer";
151 ot->description =
"Add new mask layer for masking";
152 ot->idname =
"MASK_OT_layer_new";
185 ot->name =
"Remove Mask Layer";
186 ot->description =
"Remove mask layer";
187 ot->idname =
"MASK_OT_layer_remove";
259 const float threshold = 19.0f;
262 float closest_dist_squared = 0.0f;
265 bool undistort =
false;
266 *r_mask_layer =
nullptr;
267 *r_mask_spline =
nullptr;
275 pixel_co[0] = co[0] * width;
276 pixel_co[1] = co[1] * height;
278 undistort = (sc->
clip !=
nullptr) &&
284 mask_layer_orig !=
nullptr;
285 mask_layer_orig = mask_layer_orig->
next, mask_layer_eval = mask_layer_eval->
next)
291 *spline_eval =
static_cast<MaskSpline *
>(mask_layer_eval->splines.first);
292 spline_orig !=
nullptr;
293 spline_orig = spline_orig->
next, spline_eval = spline_eval->
next)
295 if ((spline_orig->flag &
SELECT) == 0) {
299 float min[2],
max[2], center[2];
301 for (
int i = 0;
i < spline_orig->tot_point;
i++) {
316 center[0] = (
min[0] +
max[0]) / 2.0f * width;
317 center[1] = (
min[1] +
max[1]) / 2.0f * height;
320 if (dist_squared <= max_bb_side * max_bb_side * 0.5f &&
321 (closest_spline ==
nullptr || dist_squared < closest_dist_squared))
323 closest_layer = mask_layer_orig;
324 closest_spline = spline_orig;
325 closest_dist_squared = dist_squared;
329 if (closest_dist_squared <
square_f(threshold) && closest_spline !=
nullptr) {
345 if (
square_f(diff_score) < closest_dist_squared) {
350 *r_mask_layer = closest_layer;
351 *r_mask_spline = closest_spline;
378 switch (which_handle) {
393 BLI_assert_msg(0,
"Unexpected situation in select_sliding_point()");
432 MaskLayer *mask_layer, *cv_mask_layer, *feather_mask_layer;
433 MaskSpline *spline, *cv_spline, *feather_spline;
438 float co[2], cv_score, feather_score;
439 const float threshold = 19;
449 C,
mask, co, threshold, &cv_mask_layer, &cv_spline, &which_handle, &cv_score);
461 if (slide_feather || !cv_point || feather_score < cv_score) {
464 mask_layer = feather_mask_layer;
465 spline = feather_spline;
466 point = feather_point;
478 mask_layer = cv_mask_layer;
495 customdata->
spline = spline;
496 customdata->
point = point;
497 customdata->
width = width;
498 customdata->
height = height;
499 customdata->
action = action;
554 const int zero_mouse[2] = {0, 0};
566 if (
mask ==
nullptr) {
590 for (
int i = 0;
i <
data->spline->tot_point;
i++) {
601 for (
int i = 0;
i <
data->spline->tot_point;
i++) {
607 for (
int j = 0; j < point->
tot_uw; j++) {
608 point->
uw[j] = orig_point->
uw[j];
617 if (
data->orig_spline) {
626 data->point->bezt.weight =
data->weight;
631 data->point->bezt.h1 =
data->old_h1;
632 data->point->bezt.h2 =
data->old_h2;
639 if (
data->orig_spline) {
652 switch (event->
type) {
683 const int zero_mouse[2] = {0, 0};
694 if (
data->is_accurate) {
703 &
data->spline->points[0],
704 &
data->spline->points[
data->spline->tot_point - 1]))
706 std::swap(delta[0], delta[1]);
710 if (
data->point != &
data->spline->points[0]) {
721 data->is_curvature_only,
722 data->orig_handle_coord,
726 if (
data->is_sliding_new_point) {
743 float vec[2], no[2], p[2], c[2],
w, offco[2];
744 float *weight =
nullptr;
745 float weight_scalar = 1.0f;
746 bool is_overall_feather =
data->is_overall_feather ||
data->is_initial_feather;
763 if (u_pos > 0.0f && u_pos < 1.0f) {
768 if (u_neg > 0.0f && u_neg < 1.0f) {
773 u = dist_pos < dist_neg ? u_pos : u_neg;
775 if (u > 0.0f && u < 1.0f) {
779 weight = &
data->uw->w;
781 if (weight_scalar != 0.0f) {
782 weight_scalar = 1.0f / weight_scalar;
802 if (is_overall_feather) {
809 w_delta =
w -
data->weight *
data->weight_scalar;
811 if (
data->orig_spline ==
nullptr) {
815 *weight =
data->weight;
820 if (
data->is_initial_feather) {
821 *weight =
w * weight_scalar;
831 if (
data->orig_spline) {
836 data->orig_spline =
nullptr;
839 if (weight_scalar != 0.0f) {
840 *weight =
w * weight_scalar;
848 if (
data->orig_spline ==
nullptr) {
852 for (
int i = 0;
i <
data->spline->tot_point;
i++) {
878 if (
data->is_sliding_new_point) {
922 ot->name =
"Slide Point";
923 ot->description =
"Slide control points";
924 ot->idname =
"MASK_OT_slide_point";
938 "First try to slide feather instead of vertex");
941 ot->srna,
"is_new_point",
false,
"Slide New Point",
"Newly created vertex is being slid");
981 const float threshold = 19.0f;
990 C,
mask, co, threshold,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr))
1001 const float threshold = 19.0f;
1034 if (next_bezt ==
nullptr) {
1042 slide_data->
spline = spline;
1043 slide_data->
point = point;
1109 if (
mask ==
nullptr) {
1119 if (slide_data !=
nullptr) {
1136 const float u2 = u * u, u3 = u * u * u;
1137 const float v = 1.0f - u;
1138 const float v2 =
v *
v, v3 =
v *
v *
v;
1139 const float inv_divider = 1.0f / (3.0f *
v2 * u);
1140 const float t = 3.0f *
v * u2;
1141 solution[0] = -(v3 * P0[0] + t * P2[0] + u3 * P3[0] -
B[0]) * inv_divider;
1142 solution[1] = -(v3 * P0[1] + t * P2[1] + u3 * P3[1] -
B[1]) * inv_divider;
1152 const float u2 = u * u, u3 = u * u * u;
1153 const float v = 1.0f - u;
1154 const float v2 =
v *
v, v3 =
v *
v *
v;
1155 const float inv_divider = 1.0f / (3.0f *
v * u2);
1156 const float t = 3.0f *
v2 * u;
1157 solution[0] = -(v3 * P0[0] + t * P1[0] + u3 * P3[0] -
B[0]) * inv_divider;
1158 solution[1] = -(v3 * P0[1] + t * P1[1] + u3 * P3[1] -
B[1]) * inv_divider;
1166 const float margin = 0.2f;
1168 float u = slide_data->
u;
1170 switch (event->
type) {
1182 if ((u > margin && u < 0.5f) || (u >= 0.5f && u < 1.0f - margin)) {
1205 float B[2], mouse_coord[2], delta[2];
1219 bool need_restore_P2 =
false;
1223 float x = (u - margin) * 0.5f / (0.5f - margin);
1224 float weight = (3 *
x *
x - 2 *
x *
x *
x);
1231 need_restore_P2 =
true;
1234 if (weight > 0.0f) {
1244 if (need_restore_P2) {
1250 bool need_restore_P1 =
false;
1252 if (u < 1.0f - margin) {
1254 float x = ((1.0f - u) - margin) * 0.5f / (0.5f - margin);
1255 float weight = 3 *
x *
x - 2 *
x *
x *
x;
1262 need_restore_P1 =
true;
1265 if (weight > 0.0f) {
1275 if (need_restore_P1) {
1322 ot->name =
"Slide Spline Curvature";
1323 ot->description =
"Slide a point on the spline to define its curvature";
1324 ot->idname =
"MASK_OT_slide_spline_curvature";
1362 ot->name =
"Toggle Cyclic";
1363 ot->description =
"Toggle cyclic for selected splines";
1364 ot->idname =
"MASK_OT_cyclic_toggle";
1384 for (
int i = 0;
i < point->
tot_uw;
i++) {
1392 point->
uw =
nullptr;
1401 for (
int i = 0;
i < point->
tot_uw;
i++) {
1403 new_uw[j++] = point->
uw[
i];
1417 bool changed =
false;
1421 int mask_layer_shape_ofs = 0;
1427 spline =
static_cast<MaskSpline *
>(mask_layer->splines.first);
1430 const int tot_point_orig = spline->
tot_point;
1446 if (mask_layer->act_point) {
1448 mask_layer->act_point =
nullptr;
1451 if (spline == mask_layer->act_spline) {
1452 mask_layer->act_spline =
nullptr;
1466 for (
int i = 0, j = 0;
i < tot_point_orig;
i++) {
1470 if (point == mask_layer->act_point) {
1471 mask_layer->act_point = &new_points[j];
1476 new_points[j] = *point;
1480 if (point == mask_layer->act_point) {
1481 mask_layer->act_point =
nullptr;
1491 mask_layer_shape_ofs += spline->
tot_point;
1494 spline->
points = new_points;
1500 spline = next_spline;
1526 IFACE_(
"Delete selected control points and splines?"),
1538 ot->name =
"Delete";
1539 ot->description =
"Delete selected control points or splines";
1540 ot->idname =
"MASK_OT_delete";
1558 bool changed =
false;
1562 bool changed_layer =
false;
1572 changed_layer =
true;
1576 if (changed_layer) {
1598 ot->name =
"Switch Direction";
1599 ot->description =
"Switch direction of selected splines";
1600 ot->idname =
"MASK_OT_switch_direction";
1616 bool changed =
false;
1620 bool changed_layer =
false;
1627 for (
int i = 0;
i < spline->tot_point;
i++) {
1633 changed_layer =
true;
1638 if (changed_layer) {
1660 ot->name =
"Recalculate Handles";
1661 ot->description =
"Recalculate the direction of selected handles";
1662 ot->idname =
"MASK_OT_normals_make_consistent";
1679 bool changed =
false;
1687 for (
int i = 0;
i < spline->tot_point;
i++) {
1694 bezt->
h1 = handle_type;
1695 bezt->
h2 = handle_type;
1699 bezt->
h1 = handle_type;
1702 bezt->
h2 = handle_type;
1730 {
HD_AUTO,
"AUTO", 0,
"Auto",
""},
1731 {
HD_VECT,
"VECTOR", 0,
"Vector",
""},
1732 {
HD_ALIGN,
"ALIGNED", 0,
"Aligned Single",
""},
1734 {
HD_FREE,
"FREE", 0,
"Free",
""},
1735 {0,
nullptr, 0,
nullptr,
nullptr},
1739 ot->name =
"Set Handle Type";
1740 ot->description =
"Set type of handles for selected control points";
1741 ot->idname =
"MASK_OT_handle_type_set";
1752 ot->prop =
RNA_def_enum(
ot->srna,
"type", editcurve_handle_type_items, 1,
"Type",
"Spline type");
1759 bool changed =
false;
1784 ot->name =
"Clear Restrict View";
1785 ot->description =
"Reveal temporarily hidden mask layers";
1786 ot->idname =
"MASK_OT_hide_view_clear";
1802 bool changed =
false;
1844 ot->name =
"Set Restrict View";
1845 ot->description =
"Temporarily hide mask layers";
1846 ot->idname =
"MASK_OT_hide_view_set";
1856 ot->srna,
"unselected",
false,
"Unselected",
"Hide unselected rather than selected layers");
1862 bool changed =
false;
1870 for (
int i = 0;
i < spline->tot_point;
i++) {
1896 ot->name =
"Clear Feather Weight";
1897 ot->description =
"Reset the feather weight to zero";
1898 ot->idname =
"MASK_OT_feather_weight_clear";
1915 return mask->masklay_tot > 0;
1933 if (direction == -1) {
1934 mask_layer_other = mask_layer->
prev;
1936 if (!mask_layer_other) {
1942 mask->masklay_act--;
1944 else if (direction == 1) {
1945 mask_layer_other = mask_layer->
next;
1947 if (!mask_layer_other) {
1953 mask->masklay_act++;
1965 {-1,
"UP", 0,
"Up",
""},
1966 {1,
"DOWN", 0,
"Down",
""},
1967 {0,
nullptr, 0,
nullptr,
nullptr},
1971 ot->name =
"Move Layer";
1972 ot->description =
"Move the active layer up/down in the list";
1973 ot->idname =
"MASK_OT_layer_move";
1988 "Direction to move the active layer");
1999 const bool act_point_in_spline = mask_layer->act_point &&
2003 const void *act_point_prev = mask_layer->act_point;
2008 int start =
i, end = -1;
2013 if (
i >= spline->tot_point - 1) {
2021 int tot_point_shape_start = 0;
2028 if (new_spline->
points) {
2033 new_spline->
flag = spline->flag;
2039 new_spline->
tot_point = end - start + 1;
2041 "duplicated mask points");
2043 memcpy(new_spline->
points,
2044 spline->points + start,
2050 if (mask_layer->act_point) {
2051 ptrdiff_t act_index = mask_layer->act_point - &spline->points[start];
2052 if (
size_t(act_index) < new_spline->
tot_point) {
2053 mask_layer->act_point = &new_spline->
points[act_index];
2056 if (mask_layer->act_spline) {
2057 if (mask_layer->act_spline == spline) {
2058 mask_layer->act_spline = new_spline;
2063 if (mask_layer->splines_shapes.first) {
2069 for (
b = 0, new_point = new_spline->
points;
b < tot_point;
b++, new_point++) {
2070 if (new_point->
uw) {
2075 if (mask_layer->splines_shapes.first) {
2083 if (start != 0 || end != spline->tot_point - 1) {
2096 if (act_point_in_spline && (mask_layer->act_point == act_point_prev)) {
2099 mask_layer->act_point =
nullptr;
2114 ot->name =
"Duplicate Mask";
2115 ot->description =
"Duplicate selected control points and segments between them";
2116 ot->idname =
"MASK_OT_duplicate";
2133 if (mask_layer ==
nullptr) {
2145 ot->name =
"Copy Splines";
2146 ot->description =
"Copy the selected splines to the internal clipboard";
2147 ot->idname =
"MASK_OT_copy_splines";
2173 if (mask_layer ==
nullptr) {
2189 ot->name =
"Paste Splines";
2190 ot->description =
"Paste splines from the internal clipboard";
2191 ot->idname =
"MASK_OT_paste_splines";
Functions to insert, delete or modify keyframes.
Mask * CTX_data_edit_mask(const bContext *C)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
SpaceClip * CTX_wm_space_clip(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
struct Mask * BKE_mask_new(struct Main *bmain, const char *name)
#define MASKPOINT_ISSEL_ANY(p)
void BKE_mask_layer_shape_changed_add(struct MaskLayer *masklay, int index, bool do_init, bool do_init_interpolate)
struct MaskSplinePointUW * BKE_mask_point_sort_uw(struct MaskSplinePoint *point, struct MaskSplinePointUW *uw)
void BKE_mask_layer_remove(struct Mask *mask, struct MaskLayer *masklay)
void BKE_mask_point_select_set(struct MaskSplinePoint *point, bool do_select)
void BKE_mask_calc_handle_point_auto(struct MaskSpline *spline, struct MaskSplinePoint *point, bool do_recalc_length)
Resets auto handles even for non-auto bezier points.
@ MASK_WHICH_HANDLE_RIGHT
@ MASK_WHICH_HANDLE_STICK
struct MaskSpline * BKE_mask_spline_add(struct MaskLayer *masklay)
struct MaskSpline * BKE_mask_spline_copy(const struct MaskSpline *spline)
void BKE_mask_spline_free(struct MaskSpline *spline)
void BKE_mask_point_free(struct MaskSplinePoint *point)
void BKE_mask_layer_active_set(struct Mask *mask, struct MaskLayer *masklay)
struct BezTriple * BKE_mask_spline_point_next_bezt(struct MaskSpline *spline, struct MaskSplinePoint *points_array, struct MaskSplinePoint *point)
struct MaskLayer * BKE_mask_layer_new(struct Mask *mask, const char *name)
float BKE_mask_point_weight_scalar(struct MaskSpline *spline, struct MaskSplinePoint *point, float u)
void BKE_mask_point_set_handle(struct MaskSplinePoint *point, eMaskWhichHandle which_handle, float loc[2], bool keep_direction, float orig_handle[2], float orig_vec[3][3])
void BKE_mask_clipboard_paste_to_layer(struct Main *bmain, struct MaskLayer *mask_layer)
void BKE_mask_coord_to_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2])
void BKE_mask_layer_free_shapes(struct MaskLayer *masklay)
Free all animation keys for a mask layer.
void BKE_mask_point_handle(const struct MaskSplinePoint *point, eMaskWhichHandle which_handle, float r_handle[2])
void BKE_mask_point_normal(struct MaskSpline *spline, struct MaskSplinePoint *point, float u, float n[2])
void BKE_mask_point_segment_co(struct MaskSpline *spline, struct MaskSplinePoint *point, float u, float co[2])
int BKE_mask_layer_shape_spline_to_index(struct MaskLayer *masklay, struct MaskSpline *spline)
void BKE_mask_coord_from_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2])
void BKE_mask_layer_shape_changed_remove(struct MaskLayer *masklay, int index, int count)
bool BKE_mask_clipboard_is_empty(void)
float BKE_mask_spline_project_co(struct MaskSpline *spline, struct MaskSplinePoint *point, float start_u, const float co[2], eMaskSign sign)
struct MaskLayer * BKE_mask_layer_active(struct Mask *mask)
void BKE_mask_clipboard_copy_from_layer(struct MaskLayer *mask_layer)
void BKE_mask_spline_direction_switch(struct MaskLayer *masklay, struct MaskSpline *spline)
struct MaskSplinePoint * BKE_mask_spline_point_array(struct MaskSpline *spline)
#define BLI_assert_msg(a, msg)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
MINLINE float square_f(float a)
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void project_v2_v2v2_normalized(float out[2], const float p[2], const float v_proj[2])
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v2_fl(float r[2], float f)
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
MINLINE void copy_v2_v2(float r[2], const float a[2])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE void add_v2_v2(float r[2], const float a[2])
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 dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
#define INIT_MINMAX2(min, max)
#define ARRAY_HAS_ITEM(arr_item, arr_start, arr_len)
void DEG_id_tag_update(ID *id, unsigned int flags)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ MCLIP_PROXY_RENDER_UNDISTORT
Object is a sort of wrapper for general info.
void ED_space_clip_set_mask(bContext *C, SpaceClip *sc, Mask *mask)
void ED_clip_point_undistorted_pos(const SpaceClip *sc, const float co[2], float r_co[2])
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float r_co[2])
void ED_mask_layer_shape_auto_key(MaskLayer *mask_layer, int frame)
void ED_mask_get_size(ScrArea *area, int *r_width, int *r_height)
bool ED_maskedit_mask_poll(bContext *C)
bool ED_maskedit_poll(bContext *C)
bool ED_maskedit_mask_visible_splines_poll(bContext *C)
Read Guarded memory(de)allocation.
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
BPy_StructRNA * depsgraph
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static wmOperatorStatus set_handle_type_exec(bContext *C, wmOperator *op)
static wmOperatorStatus delete_exec(bContext *C, wmOperator *op)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
void ED_mask_view_lock_state_restore_no_jump(const bContext *C, const MaskViewLockState *state)
void ED_mask_view_lock_state_store(const bContext *C, MaskViewLockState *state)
bool ED_mask_spline_select_check(const MaskSpline *spline)
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)
bool ED_mask_layer_select_check(const MaskLayer *mask_layer)
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)
void ED_mask_select_flush_all(Mask *mask)
void ED_mask_select_toggle_all(Mask *mask, int action)
void ED_mask_layer_select_set(MaskLayer *mask_layer, bool do_select)
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)
static wmOperatorStatus mask_feather_weight_clear_exec(bContext *C, wmOperator *)
static void cancel_slide_point(SlidePointData *data)
static bool paste_splines_poll(bContext *C)
static SlideSplineCurvatureData * slide_spline_curvature_customdata(bContext *C, const wmEvent *event)
static wmOperatorStatus mask_duplicate_exec(bContext *C, wmOperator *)
static void cancel_slide_spline_curvature(SlideSplineCurvatureData *slide_data)
static SlidePointData * slide_point_customdata(bContext *C, wmOperator *op, const wmEvent *event)
void MASK_OT_slide_spline_curvature(wmOperatorType *ot)
void MASK_OT_copy_splines(wmOperatorType *ot)
static wmOperatorStatus slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void check_sliding_handle_type(MaskSplinePoint *point, eMaskWhichHandle which_handle)
static wmOperatorStatus slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEvent *event)
void MASK_OT_layer_move(wmOperatorType *ot)
void MASK_OT_feather_weight_clear(wmOperatorType *ot)
void MASK_OT_layer_remove(wmOperatorType *ot)
static bool slide_point_check_initial_feather(MaskSpline *spline)
static wmOperatorStatus mask_hide_view_clear_exec(bContext *C, wmOperator *op)
static wmOperatorStatus delete_exec(bContext *C, wmOperator *)
void MASK_OT_paste_splines(wmOperatorType *ot)
static wmOperatorStatus paste_splines_exec(bContext *C, wmOperator *)
static wmOperatorStatus mask_layer_remove_exec(bContext *C, wmOperator *)
void MASK_OT_layer_new(wmOperatorType *ot)
static wmOperatorStatus copy_splines_exec(bContext *C, wmOperator *)
static bool slide_spline_curvature_check(bContext *C, const wmEvent *event)
static void select_sliding_point(Mask *mask, MaskLayer *mask_layer, MaskSpline *spline, MaskSplinePoint *point, eMaskWhichHandle which_handle)
static wmOperatorStatus mask_switch_direction_exec(bContext *C, wmOperator *)
static void mask_point_undistort_pos(SpaceClip *sc, float r_co[2], const float co[2])
static wmOperatorStatus slide_point_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void free_slide_spline_curvature_data(SlideSplineCurvatureData *slide_data)
MaskLayer * ED_mask_layer_ensure(bContext *C, bool *r_added_mask)
Mask * ED_mask_new(bContext *C, const char *name)
static wmOperatorStatus cyclic_toggle_exec(bContext *C, wmOperator *)
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])
static wmOperatorStatus mask_new_exec(bContext *C, wmOperator *op)
void MASK_OT_hide_view_clear(wmOperatorType *ot)
static bool mask_layer_move_poll(bContext *C)
static wmOperatorStatus mask_layer_move_exec(bContext *C, wmOperator *op)
void MASK_OT_new(wmOperatorType *ot)
static wmOperatorStatus mask_layer_new_exec(bContext *C, wmOperator *op)
static void slide_point_delta_all_feather(SlidePointData *data, float delta)
static wmOperatorStatus mask_normals_make_consistent_exec(bContext *C, wmOperator *)
void MASK_OT_handle_type_set(wmOperatorType *ot)
void MASK_OT_duplicate(wmOperatorType *ot)
void MASK_OT_cyclic_toggle(wmOperatorType *ot)
static wmOperatorStatus delete_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus mask_hide_view_set_exec(bContext *C, wmOperator *op)
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])
static wmOperatorStatus slide_spline_curvature_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void free_slide_point_data(SlidePointData *data)
void MASK_OT_delete(wmOperatorType *ot)
static void delete_feather_points(MaskSplinePoint *point)
static wmOperatorStatus set_handle_type_exec(bContext *C, wmOperator *op)
static bool spline_under_mouse_get(const bContext *C, Mask *mask_orig, const float co[2], MaskLayer **r_mask_layer, MaskSpline **r_mask_spline)
void MASK_OT_hide_view_set(wmOperatorType *ot)
void MASK_OT_slide_point(wmOperatorType *ot)
void MASK_OT_switch_direction(wmOperatorType *ot)
void MASK_OT_normals_make_consistent(wmOperatorType *ot)
static void slide_point_restore_spline(SlidePointData *data)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
bool is_autokey_on(const Scene *scene)
VecBase< float, 2 > float2
std::string RNA_string_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
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_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
struct MaskSplinePoint * act_point
struct MaskSpline * act_spline
float orig_handle_coord[2]
float prev_handle_coord[2]
float prev_feather_coord[2]
eMaskWhichHandle which_handle
bool is_sliding_new_point
float prev_mouse_coord[2]
float prev_spline_coord[2]
float prev_mouse_coord[2]
BezTriple other_bezt_backup
struct MovieClipUser user
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operator_properties_confirm_or_exec(wmOperatorType *ot)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_confirm_ex(bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, int icon, bool cancel_default)