54 if (area && area->spacedata.first) {
55 switch (area->spacetype) {
81 if (mask ==
nullptr) {
88 if (mask_layer ==
nullptr) {
137 mask->masklay_act = mask->masklay_tot - 1;
148 ot->
name =
"Add Mask Layer";
183 ot->
name =
"Remove Mask Layer";
185 ot->
idname =
"MASK_OT_layer_remove";
257 const float threshold = 19.0f;
260 float closest_dist_squared = 0.0f;
263 bool undistort =
false;
264 *r_mask_layer =
nullptr;
265 *r_mask_spline =
nullptr;
273 pixel_co[0] = co[0] * width;
274 pixel_co[1] = co[1] * height;
276 undistort = (sc->
clip !=
nullptr) &&
282 mask_layer_orig !=
nullptr;
283 mask_layer_orig = mask_layer_orig->
next, mask_layer_eval = mask_layer_eval->
next)
289 *spline_eval =
static_cast<MaskSpline *
>(mask_layer_eval->splines.first);
290 spline_orig !=
nullptr;
291 spline_orig = spline_orig->
next, spline_eval = spline_eval->
next)
293 if ((spline_orig->flag &
SELECT) == 0) {
297 float min[2], max[2], center[2];
299 for (
int i = 0; i < spline_orig->tot_point; i++) {
314 center[0] = (
min[0] + max[0]) / 2.0f * width;
315 center[1] = (
min[1] + max[1]) / 2.0f * height;
317 float max_bb_side =
min_ff((max[0] -
min[0]) * width, (max[1] -
min[1]) * height);
318 if (dist_squared <= max_bb_side * max_bb_side * 0.5f &&
319 (closest_spline ==
nullptr || dist_squared < closest_dist_squared))
321 closest_layer = mask_layer_orig;
322 closest_spline = spline_orig;
323 closest_dist_squared = dist_squared;
327 if (closest_dist_squared <
square_f(threshold) && closest_spline !=
nullptr) {
343 if (
square_f(diff_score) < closest_dist_squared) {
348 *r_mask_layer = closest_layer;
349 *r_mask_spline = closest_spline;
357 for (
int i = 0; i < spline->tot_point; i++) {
360 if (point->bezt.weight != 0.0f) {
376 switch (which_handle) {
391 BLI_assert_msg(0,
"Unexpected situation in select_sliding_point()");
430 MaskLayer *mask_layer, *cv_mask_layer, *feather_mask_layer;
431 MaskSpline *spline, *cv_spline, *feather_spline;
436 float co[2], cv_score, feather_score;
437 const float threshold = 19;
447 C, mask, co, threshold, &cv_mask_layer, &cv_spline, &which_handle, &cv_score);
459 if (slide_feather || !cv_point || feather_score < cv_score) {
462 mask_layer = feather_mask_layer;
463 spline = feather_spline;
464 point = feather_point;
476 mask_layer = cv_mask_layer;
489 customdata = MEM_cnew<SlidePointData>(
"mask slide point data");
493 customdata->
spline = spline;
495 customdata->
width = width;
496 customdata->
height = height;
497 customdata->
action = action;
503 customdata->
old_h1 = point->bezt.h1;
504 customdata->
old_h2 = point->bezt.h2;
552 const int zero_mouse[2] = {0, 0};
564 if (mask ==
nullptr) {
588 for (
int i = 0; i < data->spline->tot_point; i++) {
593 if (point->bezt.weight < 0.0f) {
594 point->bezt.weight = 0.0f;
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) {
623 data->uw->w = data->weight;
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) {
659 data->is_overall_feather = (
event->val ==
KM_PRESS);
662 data->is_curvature_only = (
event->val ==
KM_PRESS);
667 data->is_accurate = (
event->val ==
KM_PRESS);
683 const int zero_mouse[2] = {0, 0};
688 sub_v2_v2v2(zero_delta, zero_coord, data->prev_zero_coord);
691 copy_v2_v2(data->prev_zero_coord, zero_coord);
694 if (data->is_accurate) {
702 if (
ELEM(data->point,
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]) {
716 add_v2_v2v2(new_handle, data->prev_handle_coord, delta);
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;
748 add_v2_v2v2(offco, data->prev_feather_coord, delta);
754 data->spline, data->point, data->uw->u, offco,
MASK_PROJ_NEG);
756 data->spline, data->point, data->uw->u, offco,
MASK_PROJ_POS);
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) {
893 else if (event->
type != data->event_invoke_type && event->
val ==
KM_PRESS) {
935 "First try to slide feather instead of vertex");
938 ot->
srna,
"is_new_point",
false,
"Slide New Point",
"Newly created vertex is being slid");
978 const float threshold = 19.0f;
987 C, mask, co, threshold,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr))
998 const float threshold = 19.0f;
1031 if (next_bezt ==
nullptr) {
1035 slide_data = MEM_cnew<SlideSplineCurvatureData>(
"slide curvature slide");
1039 slide_data->
spline = spline;
1104 if (mask ==
nullptr) {
1114 if (slide_data !=
nullptr) {
1131 const float u2 = u * u, u3 = u * u * u;
1132 const float v = 1.0f - u;
1133 const float v2 =
v *
v, v3 =
v *
v *
v;
1134 const float inv_divider = 1.0f / (3.0f *
v2 * u);
1135 const float t = 3.0f *
v * u2;
1136 solution[0] = -(v3 * P0[0] + t * P2[0] + u3 * P3[0] -
B[0]) * inv_divider;
1137 solution[1] = -(v3 * P0[1] + t * P2[1] + u3 * P3[1] -
B[1]) * inv_divider;
1147 const float u2 = u * u, u3 = u * u * u;
1148 const float v = 1.0f - u;
1149 const float v2 =
v *
v, v3 =
v *
v *
v;
1150 const float inv_divider = 1.0f / (3.0f *
v * u2);
1151 const float t = 3.0f *
v2 * u;
1152 solution[0] = -(v3 * P0[0] + t * P1[0] + u3 * P3[0] -
B[0]) * inv_divider;
1153 solution[1] = -(v3 * P0[1] + t * P1[1] + u3 * P3[1] -
B[1]) * inv_divider;
1159 const float margin = 0.2f;
1161 float u = slide_data->
u;
1163 switch (event->
type) {
1175 if ((u > margin && u < 0.5f) || (u >= 0.5f && u < 1.0f - margin)) {
1198 float B[2], mouse_coord[2], delta[2];
1212 bool need_restore_P2 =
false;
1216 float x = (u - margin) * 0.5f / (0.5f - margin);
1217 float weight = (3 * x * x - 2 * x * x *
x);
1224 need_restore_P2 =
true;
1227 if (weight > 0.0f) {
1237 if (need_restore_P2) {
1243 bool need_restore_P1 =
false;
1245 if (u < 1.0f - margin) {
1247 float x = ((1.0f - u) - margin) * 0.5f / (0.5f - margin);
1248 float weight = 3 * x * x - 2 * x * x *
x;
1255 need_restore_P1 =
true;
1258 if (weight > 0.0f) {
1268 if (need_restore_P1) {
1312 ot->
name =
"Slide Spline Curvature";
1313 ot->
description =
"Slide a point on the spline to define its curvature";
1314 ot->
idname =
"MASK_OT_slide_spline_curvature";
1352 ot->
name =
"Toggle Cyclic";
1354 ot->
idname =
"MASK_OT_cyclic_toggle";
1370 if (!point->tot_uw) {
1374 for (
int i = 0; i < point->tot_uw; i++) {
1375 if ((point->uw[i].flag &
SELECT) == 0) {
1382 point->uw =
nullptr;
1389 new_uw = MEM_cnew_array<MaskSplinePointUW>(
count,
"new mask uw points");
1391 for (
int i = 0; i < point->tot_uw; i++) {
1392 if ((point->uw[i].flag &
SELECT) == 0) {
1393 new_uw[j++] = point->uw[i];
1400 point->tot_uw =
count;
1407 bool changed =
false;
1411 int mask_layer_shape_ofs = 0;
1417 spline =
static_cast<MaskSpline *
>(mask_layer->splines.first);
1420 const int tot_point_orig = spline->
tot_point;
1425 for (
int i = 0; i < spline->tot_point; i++) {
1436 if (mask_layer->act_point) {
1437 if (
ARRAY_HAS_ITEM(mask_layer->act_point, spline->points, spline->tot_point)) {
1438 mask_layer->act_point =
nullptr;
1441 if (spline == mask_layer->act_spline) {
1442 mask_layer->act_spline =
nullptr;
1454 new_points = MEM_cnew_array<MaskSplinePoint>(
count,
"deleteMaskPoints");
1456 for (
int i = 0, j = 0; i < tot_point_orig; i++) {
1460 if (point == mask_layer->act_point) {
1461 mask_layer->act_point = &new_points[j];
1466 new_points[j] = *
point;
1470 if (point == mask_layer->act_point) {
1471 mask_layer->act_point =
nullptr;
1475 spline->tot_point--;
1481 mask_layer_shape_ofs += spline->tot_point;
1484 spline->points = new_points;
1490 spline = next_spline;
1516 IFACE_(
"Delete selected control points and splines?"),
1529 ot->
description =
"Delete selected control points or splines";
1548 bool changed =
false;
1552 bool changed_layer =
false;
1562 changed_layer =
true;
1566 if (changed_layer) {
1588 ot->
name =
"Switch Direction";
1590 ot->
idname =
"MASK_OT_switch_direction";
1606 bool changed =
false;
1610 bool changed_layer =
false;
1617 for (
int i = 0; i < spline->tot_point; i++) {
1623 changed_layer =
true;
1628 if (changed_layer) {
1650 ot->
name =
"Recalculate Handles";
1651 ot->
description =
"Recalculate the direction of selected handles";
1652 ot->
idname =
"MASK_OT_normals_make_consistent";
1669 bool changed =
false;
1677 for (
int i = 0; i < spline->tot_point; i++) {
1684 bezt->
h1 = handle_type;
1685 bezt->
h2 = handle_type;
1689 bezt->
h1 = handle_type;
1692 bezt->
h2 = handle_type;
1720 {
HD_AUTO,
"AUTO", 0,
"Auto",
""},
1721 {
HD_VECT,
"VECTOR", 0,
"Vector",
""},
1722 {
HD_ALIGN,
"ALIGNED", 0,
"Aligned Single",
""},
1724 {
HD_FREE,
"FREE", 0,
"Free",
""},
1725 {0,
nullptr, 0,
nullptr,
nullptr},
1729 ot->
name =
"Set Handle Type";
1730 ot->
description =
"Set type of handles for selected control points";
1731 ot->
idname =
"MASK_OT_handle_type_set";
1749 bool changed =
false;
1756 mask_layer->visibility_flag &= ~OB_HIDE_VIEWPORT;
1774 ot->
name =
"Clear Restrict View";
1776 ot->
idname =
"MASK_OT_hide_view_clear";
1792 bool changed =
false;
1834 ot->
name =
"Set Restrict View";
1836 ot->
idname =
"MASK_OT_hide_view_set";
1846 ot->
srna,
"unselected",
false,
"Unselected",
"Hide unselected rather than selected layers");
1852 bool changed =
false;
1860 for (
int i = 0; i < spline->tot_point; i++) {
1886 ot->
name =
"Clear Feather Weight";
1888 ot->
idname =
"MASK_OT_feather_weight_clear";
1905 return mask->masklay_tot > 0;
1923 if (direction == -1) {
1924 mask_layer_other = mask_layer->
prev;
1926 if (!mask_layer_other) {
1932 mask->masklay_act--;
1934 else if (direction == 1) {
1935 mask_layer_other = mask_layer->
next;
1937 if (!mask_layer_other) {
1943 mask->masklay_act++;
1955 {-1,
"UP", 0,
"Up",
""},
1956 {1,
"DOWN", 0,
"Down",
""},
1957 {0,
nullptr, 0,
nullptr,
nullptr},
1962 ot->
description =
"Move the active layer up/down in the list";
1978 "Direction to move the active layer");
1989 const bool act_point_in_spline = mask_layer->act_point &&
1993 const void *act_point_prev = mask_layer->act_point;
1997 while (i < spline->tot_point) {
1998 int start = i, end = -1;
2003 if (i >= spline->tot_point - 1) {
2011 int tot_point_shape_start = 0;
2018 if (new_spline->
points) {
2023 new_spline->
flag = spline->flag;
2029 new_spline->
tot_point = end - start + 1;
2030 new_spline->
points = MEM_cnew_array<MaskSplinePoint>(new_spline->
tot_point,
2031 "duplicated mask points");
2033 memcpy(new_spline->
points,
2034 spline->points + start,
2040 if (mask_layer->act_point) {
2041 ptrdiff_t act_index = mask_layer->act_point - &spline->points[start];
2042 if (
size_t(act_index) < new_spline->
tot_point) {
2043 mask_layer->act_point = &new_spline->
points[act_index];
2046 if (mask_layer->act_spline) {
2047 if (mask_layer->act_spline == spline) {
2048 mask_layer->act_spline = new_spline;
2053 if (mask_layer->splines_shapes.first) {
2059 for (
b = 0, new_point = new_spline->
points;
b < tot_point;
b++, new_point++) {
2060 if (new_point->
uw) {
2065 if (mask_layer->splines_shapes.first) {
2073 if (start != 0 || end != spline->tot_point - 1) {
2074 new_spline->
flag &= ~MASK_SPLINE_CYCLIC;
2080 spline->flag &= ~SELECT;
2086 if (act_point_in_spline && (mask_layer->act_point == act_point_prev)) {
2089 mask_layer->act_point =
nullptr;
2104 ot->
name =
"Duplicate Mask";
2105 ot->
description =
"Duplicate selected control points and segments between them";
2123 if (mask_layer ==
nullptr) {
2135 ot->
name =
"Copy Splines";
2136 ot->
description =
"Copy the selected splines to the internal clipboard";
2137 ot->
idname =
"MASK_OT_copy_splines";
2163 if (mask_layer ==
nullptr) {
2179 ot->
name =
"Paste Splines";
2180 ot->
description =
"Paste splines from the internal clipboard";
2181 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)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct 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])
MINLINE void negate_v2(float r[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)
ID * DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *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.
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
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
local_group_size(16, 16) .push_constant(Type b
const Depsgraph * depsgraph
void MEM_freeN(void *vmemh)
void *(* MEM_dupallocN)(const 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 int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event)
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 void cancel_slide_spline_curvature(SlideSplineCurvatureData *slide_data)
static int delete_exec(bContext *C, wmOperator *)
static SlidePointData * slide_point_customdata(bContext *C, wmOperator *op, const wmEvent *event)
static int mask_hide_view_set_exec(bContext *C, wmOperator *op)
void MASK_OT_slide_spline_curvature(wmOperatorType *ot)
void MASK_OT_copy_splines(wmOperatorType *ot)
static int mask_new_exec(bContext *C, wmOperator *op)
static void check_sliding_handle_type(MaskSplinePoint *point, eMaskWhichHandle which_handle)
void MASK_OT_layer_move(wmOperatorType *ot)
static int slide_point_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void MASK_OT_feather_weight_clear(wmOperatorType *ot)
void MASK_OT_layer_remove(wmOperatorType *ot)
static bool slide_point_check_initial_feather(MaskSpline *spline)
void MASK_OT_paste_splines(wmOperatorType *ot)
static int mask_hide_view_clear_exec(bContext *C, wmOperator *op)
void MASK_OT_layer_new(wmOperatorType *ot)
static int copy_splines_exec(bContext *C, wmOperator *)
static bool slide_spline_curvature_check(bContext *C, const wmEvent *event)
static int delete_invoke(bContext *C, wmOperator *op, const wmEvent *)
static int mask_feather_weight_clear_exec(bContext *C, wmOperator *)
static int 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)
static int set_handle_type_exec(bContext *C, wmOperator *op)
static int cyclic_toggle_exec(bContext *C, wmOperator *)
static void mask_point_undistort_pos(SpaceClip *sc, float r_co[2], const float co[2])
static void free_slide_spline_curvature_data(SlideSplineCurvatureData *slide_data)
MaskLayer * ED_mask_layer_ensure(bContext *C, bool *r_added_mask)
static int mask_normals_make_consistent_exec(bContext *C, wmOperator *)
Mask * ED_mask_new(bContext *C, const char *name)
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 MASK_OT_hide_view_clear(wmOperatorType *ot)
static bool mask_layer_move_poll(bContext *C)
static int mask_layer_new_exec(bContext *C, wmOperator *op)
void MASK_OT_new(wmOperatorType *ot)
static int mask_duplicate_exec(bContext *C, wmOperator *)
static void slide_point_delta_all_feather(SlidePointData *data, float delta)
void MASK_OT_handle_type_set(wmOperatorType *ot)
void MASK_OT_duplicate(wmOperatorType *ot)
void MASK_OT_cyclic_toggle(wmOperatorType *ot)
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 void free_slide_point_data(SlidePointData *data)
void MASK_OT_delete(wmOperatorType *ot)
static void delete_feather_points(MaskSplinePoint *point)
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)
static int mask_switch_direction_exec(bContext *C, wmOperator *)
static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEvent *event)
void MASK_OT_slide_point(wmOperatorType *ot)
void MASK_OT_switch_direction(wmOperatorType *ot)
static int mask_layer_remove_exec(bContext *C, wmOperator *)
void MASK_OT_normals_make_consistent(wmOperatorType *ot)
static int mask_layer_move_exec(bContext *C, wmOperator *op)
static void slide_point_restore_spline(SlidePointData *data)
static int paste_splines_exec(bContext *C, wmOperator *)
ccl_device_inline float4 mask(const int4 mask, const float4 a)
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
bool is_autokey_on(const Scene *scene)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
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
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
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)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
int WM_operator_confirm_ex(bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, int icon, bool cancel_default)