Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r--source/blender/editors/mask/mask_draw.c58
-rw-r--r--source/blender/editors/mask/mask_editaction.c11
-rw-r--r--source/blender/editors/mask/mask_intern.h12
-rw-r--r--source/blender/editors/mask/mask_ops.c4
-rw-r--r--source/blender/editors/mask/mask_query.c3
-rw-r--r--source/blender/editors/mask/mask_relationships.c1
-rw-r--r--source/blender/editors/mask/mask_select.c1
7 files changed, 50 insertions, 40 deletions
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index 22232e9c87e..9504a8783a0 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -587,6 +587,35 @@ static void draw_spline_curve(const bContext *C,
}
}
+static void draw_layer_splines(const bContext *C,
+ MaskLayer *layer,
+ const char draw_flag,
+ const char draw_type,
+ const int width,
+ const int height,
+ const bool is_active)
+{
+ LISTBASE_FOREACH (MaskSpline *, spline, &layer->splines) {
+ /* draw curve itself first... */
+ draw_spline_curve(C, layer, spline, draw_flag, draw_type, is_active, width, height);
+
+ if (!(layer->visibility_flag & MASK_HIDE_SELECT)) {
+ /* ...and then handles over the curve so they're nicely visible */
+ draw_spline_points(C, layer, spline, draw_flag, draw_type);
+ }
+
+ /* show undeform for testing */
+ if (0) {
+ void *back = spline->points_deform;
+
+ spline->points_deform = NULL;
+ draw_spline_curve(C, layer, spline, draw_flag, draw_type, is_active, width, height);
+ draw_spline_points(C, layer, spline, draw_flag, draw_type);
+ spline->points_deform = back;
+ }
+ }
+}
+
static void draw_mask_layers(const bContext *C,
Mask *mask,
const char draw_flag,
@@ -600,6 +629,7 @@ static void draw_mask_layers(const bContext *C,
MaskLayer *mask_layer;
int i;
+ MaskLayer *active = NULL;
for (mask_layer = mask->masklayers.first, i = 0; mask_layer != NULL;
mask_layer = mask_layer->next, i++) {
const bool is_active = (i == mask->masklay_act);
@@ -608,26 +638,16 @@ static void draw_mask_layers(const bContext *C,
continue;
}
- LISTBASE_FOREACH (MaskSpline *, spline, &mask_layer->splines) {
-
- /* draw curve itself first... */
- draw_spline_curve(C, mask_layer, spline, draw_flag, draw_type, is_active, width, height);
-
- if (!(mask_layer->visibility_flag & MASK_HIDE_SELECT)) {
- /* ...and then handles over the curve so they're nicely visible */
- draw_spline_points(C, mask_layer, spline, draw_flag, draw_type);
- }
+ if (is_active) {
+ active = mask_layer;
+ continue;
+ }
- /* show undeform for testing */
- if (0) {
- void *back = spline->points_deform;
+ draw_layer_splines(C, mask_layer, draw_flag, draw_type, width, height, is_active);
+ }
- spline->points_deform = NULL;
- draw_spline_curve(C, mask_layer, spline, draw_flag, draw_type, is_active, width, height);
- draw_spline_points(C, mask_layer, spline, draw_flag, draw_type);
- spline->points_deform = back;
- }
- }
+ if (active != NULL) {
+ draw_layer_splines(C, active, draw_flag, draw_type, width, height, true);
}
GPU_program_point_size(false);
@@ -666,8 +686,6 @@ static float *mask_rasterize(Mask *mask, const int width, const int height)
return buffer;
}
-/* sets up the opengl context.
- * width, height are to match the values from ED_mask_get_size() */
void ED_mask_draw_region(
Depsgraph *depsgraph,
Mask *mask_,
diff --git a/source/blender/editors/mask/mask_editaction.c b/source/blender/editors/mask/mask_editaction.c
index d9efbef4b42..3668f3bb34e 100644
--- a/source/blender/editors/mask/mask_editaction.c
+++ b/source/blender/editors/mask/mask_editaction.c
@@ -52,7 +52,6 @@
/* ***************************************** */
/* Generics - Loopers */
-/* Loops over the mask-frames for a mask-layer, and applies the given callback */
bool ED_masklayer_frames_looper(MaskLayer *mask_layer,
Scene *scene,
bool (*mask_layer_shape_cb)(MaskLayerShape *, Scene *))
@@ -80,7 +79,6 @@ bool ED_masklayer_frames_looper(MaskLayer *mask_layer,
/* ****************************************** */
/* Data Conversion Tools */
-/* make a listing all the mask-frames in a layer as cfraelems */
void ED_masklayer_make_cfra_list(MaskLayer *mask_layer, ListBase *elems, bool onlysel)
{
MaskLayerShape *mask_layer_shape;
@@ -108,7 +106,6 @@ void ED_masklayer_make_cfra_list(MaskLayer *mask_layer, ListBase *elems, bool on
/* ***************************************** */
/* Selection Tools */
-/* check if one of the frames in this layer is selected */
bool ED_masklayer_frame_select_check(const MaskLayer *mask_layer)
{
MaskLayerShape *mask_layer_shape;
@@ -150,7 +147,6 @@ static void mask_layer_shape_select(MaskLayerShape *mask_layer_shape, short sele
}
}
-/* set all/none/invert select (like above, but with SELECT_* modes) */
void ED_mask_select_frames(MaskLayer *mask_layer, short select_mode)
{
MaskLayerShape *mask_layer_shape;
@@ -167,7 +163,6 @@ void ED_mask_select_frames(MaskLayer *mask_layer, short select_mode)
}
}
-/* set all/none/invert select */
void ED_masklayer_frame_select_set(MaskLayer *mask_layer, short mode)
{
/* error checking */
@@ -179,7 +174,6 @@ void ED_masklayer_frame_select_set(MaskLayer *mask_layer, short mode)
ED_mask_select_frames(mask_layer, mode);
}
-/* select the frame in this layer that occurs on this frame (there should only be one at most) */
void ED_mask_select_frame(MaskLayer *mask_layer, int selx, short select_mode)
{
MaskLayerShape *mask_layer_shape;
@@ -195,7 +189,6 @@ void ED_mask_select_frame(MaskLayer *mask_layer, int selx, short select_mode)
}
}
-/* select the frames in this layer that occur within the bounds specified */
void ED_masklayer_frames_select_box(MaskLayer *mask_layer, float min, float max, short select_mode)
{
MaskLayerShape *mask_layer_shape;
@@ -213,7 +206,6 @@ void ED_masklayer_frames_select_box(MaskLayer *mask_layer, float min, float max,
}
}
-/* select the frames in this layer that occur within the lasso/circle region specified */
void ED_masklayer_frames_select_region(KeyframeEditData *ked,
MaskLayer *mask_layer,
short tool,
@@ -253,7 +245,6 @@ void ED_masklayer_frames_select_region(KeyframeEditData *ked,
/* ***************************************** */
/* Frame Editing Tools */
-/* Delete selected frames */
bool ED_masklayer_frames_delete(MaskLayer *mask_layer)
{
MaskLayerShape *mask_layer_shape, *mask_layer_shape_next;
@@ -278,7 +269,6 @@ bool ED_masklayer_frames_delete(MaskLayer *mask_layer)
return changed;
}
-/* Duplicate selected frames from given mask-layer */
void ED_masklayer_frames_duplicate(MaskLayer *mask_layer)
{
MaskLayerShape *mask_layer_shape, *gpfn;
@@ -344,7 +334,6 @@ static bool snap_mask_layer_nearmarker(MaskLayerShape *mask_layer_shape, Scene *
return false;
}
-/* snap selected frames to ... */
void ED_masklayer_snap_frames(MaskLayer *mask_layer, Scene *scene, short mode)
{
switch (mode) {
diff --git a/source/blender/editors/mask/mask_intern.h b/source/blender/editors/mask/mask_intern.h
index ee1784011ea..41ff14dcd5f 100644
--- a/source/blender/editors/mask/mask_intern.h
+++ b/source/blender/editors/mask/mask_intern.h
@@ -32,13 +32,18 @@ struct wmOperatorType;
/* internal exports only */
/* mask_add.c */
+
void MASK_OT_add_vertex(struct wmOperatorType *ot);
void MASK_OT_add_feather_vertex(struct wmOperatorType *ot);
void MASK_OT_primitive_circle_add(struct wmOperatorType *ot);
void MASK_OT_primitive_square_add(struct wmOperatorType *ot);
/* mask_ops.c */
+
struct Mask *ED_mask_new(struct bContext *C, const char *name);
+/**
+ * Get active layer. Will create mask/layer to be sure there's an active layer.
+ */
struct MaskLayer *ED_mask_layer_ensure(struct bContext *C, bool *r_added_mask);
void MASK_OT_new(struct wmOperatorType *ot);
@@ -55,6 +60,7 @@ void MASK_OT_hide_view_clear(struct wmOperatorType *ot);
void MASK_OT_hide_view_set(struct wmOperatorType *ot);
void MASK_OT_feather_weight_clear(struct wmOperatorType *ot);
void MASK_OT_switch_direction(struct wmOperatorType *ot);
+/* Named to match mesh recalculate normals. */
void MASK_OT_normals_make_consistent(struct wmOperatorType *ot);
void MASK_OT_handle_type_set(struct wmOperatorType *ot);
@@ -66,10 +72,13 @@ void MASK_OT_copy_splines(struct wmOperatorType *ot);
void MASK_OT_paste_splines(struct wmOperatorType *ot);
/* mask_relationships.c */
+
+/** based on #OBJECT_OT_parent_set */
void MASK_OT_parent_set(struct wmOperatorType *ot);
void MASK_OT_parent_clear(struct wmOperatorType *ot);
/* mask_select.c */
+
void MASK_OT_select(struct wmOperatorType *ot);
void MASK_OT_select_all(struct wmOperatorType *ot);
@@ -81,6 +90,7 @@ void MASK_OT_select_linked(struct wmOperatorType *ot);
void MASK_OT_select_more(struct wmOperatorType *ot);
void MASK_OT_select_less(struct wmOperatorType *ot);
+/* 'check' select */
bool ED_mask_spline_select_check(const struct MaskSpline *spline);
bool ED_mask_layer_select_check(const struct MaskLayer *mask_layer);
bool ED_mask_select_check(const struct Mask *mask);
@@ -91,6 +101,7 @@ void ED_mask_select_toggle_all(struct Mask *mask, int action);
void ED_mask_select_flush_all(struct Mask *mask);
/* mask_editor.c */
+
bool ED_maskedit_poll(struct bContext *C);
bool ED_maskedit_mask_poll(struct bContext *C);
@@ -108,6 +119,7 @@ void ED_mask_view_lock_state_restore_no_jump(const struct bContext *C,
const MaskViewLockState *state);
/* mask_query.c */
+
bool ED_mask_find_nearest_diff_point(const struct bContext *C,
struct Mask *mask,
const float normal_co[2],
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index fd5925bbd0c..8feb526c8d5 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -83,9 +83,6 @@ Mask *ED_mask_new(bContext *C, const char *name)
return mask;
}
-/**
- * Get active layer. Will create mask/layer to be sure there's an active layer.
- */
MaskLayer *ED_mask_layer_ensure(bContext *C, bool *r_added_mask)
{
Mask *mask = CTX_data_edit_mask(C);
@@ -1616,7 +1613,6 @@ static int mask_normals_make_consistent_exec(bContext *C, wmOperator *UNUSED(op)
return OPERATOR_CANCELLED;
}
-/* Named to match mesh recalculate normals. */
void MASK_OT_normals_make_consistent(wmOperatorType *ot)
{
/* identifiers */
diff --git a/source/blender/editors/mask/mask_query.c b/source/blender/editors/mask/mask_query.c
index e66c4e45e27..de80d9f04bd 100644
--- a/source/blender/editors/mask/mask_query.c
+++ b/source/blender/editors/mask/mask_query.c
@@ -489,7 +489,6 @@ bool ED_mask_feather_find_nearest(const bContext *C,
return false;
}
-/* takes event->mval */
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float co[2])
{
if (area) {
@@ -523,8 +522,6 @@ void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float
}
}
-/* input: x/y - mval space
- * output: xr/yr - mask point space */
void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr)
{
float co[2];
diff --git a/source/blender/editors/mask/mask_relationships.c b/source/blender/editors/mask/mask_relationships.c
index 9c4740b3087..259402efbf1 100644
--- a/source/blender/editors/mask/mask_relationships.c
+++ b/source/blender/editors/mask/mask_relationships.c
@@ -168,7 +168,6 @@ static int mask_parent_set_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-/** based on #OBJECT_OT_parent_set */
void MASK_OT_parent_set(wmOperatorType *ot)
{
/* identifiers */
diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c
index fe6acac7d29..dd4a557f449 100644
--- a/source/blender/editors/mask/mask_select.c
+++ b/source/blender/editors/mask/mask_select.c
@@ -52,7 +52,6 @@
/** \name Public Mask Selection API
* \{ */
-/* 'check' select */
bool ED_mask_spline_select_check(const MaskSpline *spline)
{
for (int i = 0; i < spline->tot_point; i++) {