diff options
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r-- | source/blender/editors/mask/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_add.c | 14 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_draw.c | 78 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 32 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_editaction.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_ops.c | 34 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_query.c | 3 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_relationships.c | 3 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_select.c | 20 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_shapekey.c | 16 |
11 files changed, 114 insertions, 92 deletions
diff --git a/source/blender/editors/mask/CMakeLists.txt b/source/blender/editors/mask/CMakeLists.txt index fdb0d13f364..593eeb6c69d 100644 --- a/source/blender/editors/mask/CMakeLists.txt +++ b/source/blender/editors/mask/CMakeLists.txt @@ -10,7 +10,6 @@ set(INC ../../makesdna ../../makesrna ../../windowmanager - ../../../../intern/glew-mx ../../../../intern/guardedalloc ) diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index 194170b1677..df30870007f 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -258,7 +258,7 @@ static bool add_vertex_subdivide(const bContext *C, Mask *mask, const float co[2 &u, NULL)) { Scene *scene = CTX_data_scene(C); - const float ctime = CFRA; + const float ctime = scene->r.cfra; MaskSplinePoint *new_point; int point_index = point - spline->points; @@ -295,7 +295,7 @@ static bool add_vertex_extrude(const bContext *C, const float co[2]) { Scene *scene = CTX_data_scene(C); - const float ctime = CFRA; + const float ctime = scene->r.cfra; MaskSpline *spline; MaskSplinePoint *point; @@ -394,7 +394,7 @@ static bool add_vertex_extrude(const bContext *C, static bool add_vertex_new(const bContext *C, Mask *mask, MaskLayer *mask_layer, const float co[2]) { Scene *scene = CTX_data_scene(C); - const float ctime = CFRA; + const float ctime = scene->r.cfra; MaskSpline *spline; MaskSplinePoint *new_point = NULL, *ref_point = NULL; @@ -583,7 +583,7 @@ void MASK_OT_add_vertex(wmOperatorType *ot) /* api callbacks */ ot->exec = add_vertex_exec; ot->invoke = add_vertex_invoke; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -862,7 +862,7 @@ void MASK_OT_primitive_circle_add(wmOperatorType *ot) /* api callbacks */ ot->exec = primitive_circle_add_exec; ot->invoke = primitive_add_invoke; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -874,7 +874,7 @@ void MASK_OT_primitive_circle_add(wmOperatorType *ot) /** \} */ /* -------------------------------------------------------------------- */ -/** \name Primitive Add Suqare Operator +/** \name Primitive Add Square Operator * \{ */ static int primitive_square_add_exec(bContext *C, wmOperator *op) @@ -897,7 +897,7 @@ void MASK_OT_primitive_square_add(wmOperatorType *ot) /* api callbacks */ ot->exec = primitive_square_add_exec; ot->invoke = primitive_add_invoke; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index aab4007854f..3b16497f09f 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -110,7 +110,7 @@ static void draw_single_handle(const MaskLayer *mask_layer, uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); const uchar rgb_gray[4] = {0x60, 0x60, 0x60, 0xff}; - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor3ubv(rgb_gray); /* this could be split into its own loop */ @@ -171,12 +171,10 @@ static void draw_single_handle(const MaskLayer *mask_layer, static void draw_spline_points(const bContext *C, MaskLayer *mask_layer, MaskSpline *spline, - const char draw_flag, const char draw_type) { const bool is_spline_sel = (spline->flag & SELECT) && (mask_layer->visibility_flag & MASK_HIDE_SELECT) == 0; - const bool is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH) != 0; uchar rgb_spline[4]; MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); @@ -253,9 +251,7 @@ static void draw_spline_points(const bContext *C, immUnbindProgram(); - if (is_smooth) { - GPU_line_smooth(true); - } + GPU_line_smooth(true); /* control points */ INIT_MINMAX2(min, max); @@ -323,9 +319,7 @@ static void draw_spline_points(const bContext *C, minmax_v2v2_v2(min, max, vert); } - if (is_smooth) { - GPU_line_smooth(false); - } + GPU_line_smooth(false); if (is_spline_sel) { float x = (min[0] + max[0]) * 0.5f; @@ -414,7 +408,7 @@ static void mask_draw_curve_type(const bContext *C, /* TODO(merwin): use fancy line shader here * probably better with geometry shader (after core profile switch) */ - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); GPU_line_width(3.0f); @@ -433,7 +427,7 @@ static void mask_draw_curve_type(const bContext *C, case MASK_DT_BLACK: case MASK_DT_WHITE: - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); GPU_line_width(1.0f); if (draw_type == MASK_DT_BLACK) { @@ -471,7 +465,7 @@ static void mask_draw_curve_type(const bContext *C, mask_color_active_tint(rgb_tmp, rgb_black, is_active); rgba_uchar_to_float(colors[1], rgb_tmp); - immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR); float viewport_size[4]; GPU_viewport_size_get_f(viewport_size); @@ -502,7 +496,6 @@ static void mask_draw_curve_type(const bContext *C, static void draw_spline_curve(const bContext *C, MaskLayer *mask_layer, MaskSpline *spline, - const char draw_flag, const char draw_type, const bool is_active, const int width, @@ -515,7 +508,6 @@ static void draw_spline_curve(const bContext *C, const bool is_spline_sel = (spline->flag & SELECT) && (mask_layer->visibility_flag & MASK_HIDE_SELECT) == 0; - const bool is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH) != 0; const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0; uint tot_diff_point; @@ -530,9 +522,7 @@ static void draw_spline_curve(const bContext *C, return; } - if (is_smooth) { - GPU_line_smooth(true); - } + GPU_line_smooth(true); feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution( spline, resol, (is_fill != false), &tot_feather_point); @@ -567,14 +557,11 @@ static void draw_spline_curve(const bContext *C, C, spline, diff_points, tot_diff_point, false, is_active, rgb_tmp, draw_type); MEM_freeN(diff_points); - if (is_smooth) { - GPU_line_smooth(false); - } + GPU_line_smooth(false); } static void draw_layer_splines(const bContext *C, MaskLayer *layer, - const char draw_flag, const char draw_type, const int width, const int height, @@ -582,11 +569,11 @@ static void draw_layer_splines(const bContext *C, { LISTBASE_FOREACH (MaskSpline *, spline, &layer->splines) { /* draw curve itself first... */ - draw_spline_curve(C, layer, spline, draw_flag, draw_type, is_active, width, height); + draw_spline_curve(C, layer, spline, 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); + draw_spline_points(C, layer, spline, draw_type); } /* show undeform for testing */ @@ -594,19 +581,15 @@ static void draw_layer_splines(const bContext *C, 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); + draw_spline_curve(C, layer, spline, draw_type, is_active, width, height); + draw_spline_points(C, layer, spline, draw_type); spline->points_deform = back; } } } -static void draw_mask_layers(const bContext *C, - Mask *mask, - const char draw_flag, - const char draw_type, - const int width, - const int height) +static void draw_mask_layers( + const bContext *C, Mask *mask, const char draw_type, const int width, const int height) { GPU_blend(GPU_BLEND_ALPHA); GPU_program_point_size(true); @@ -628,11 +611,11 @@ static void draw_mask_layers(const bContext *C, continue; } - draw_layer_splines(C, mask_layer, draw_flag, draw_type, width, height, is_active); + draw_layer_splines(C, mask_layer, draw_type, width, height, is_active); } if (active != NULL) { - draw_layer_splines(C, active, draw_flag, draw_type, width, height, true); + draw_layer_splines(C, active, draw_type, width, height, true); } GPU_program_point_size(false); @@ -663,6 +646,7 @@ void ED_mask_draw_region( const char draw_flag, const char draw_type, const eMaskOverlayMode overlay_mode, + const float blend_factor, /* convert directly into aspect corrected vars */ const int width_i, const int height_i, @@ -721,12 +705,14 @@ void ED_mask_draw_region( } if (draw_flag & MASK_DRAWFLAG_OVERLAY) { - const float red[4] = {1.0f, 0.0f, 0.0f, 0.0f}; + float buf_col[4] = {1.0f, 0.0f, 0.0f, 0.0f}; float *buffer = mask_rasterize(mask_eval, width, height); if (overlay_mode != MASK_OVERLAY_ALPHACHANNEL) { /* More blending types could be supported in the future. */ - GPU_blend(GPU_BLEND_MULTIPLY); + GPU_blend(GPU_BLEND_ALPHA); + buf_col[0] = -1.0f; + buf_col[3] = 1.0f; } GPU_matrix_push(); @@ -737,10 +723,18 @@ void ED_mask_draw_region( } IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR); GPU_shader_uniform_vector( - state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, red); - immDrawPixelsTexTiled( - &state, 0.0f, 0.0f, width, height, GPU_R16F, false, buffer, 1.0f, 1.0f, NULL); + state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, buf_col); + + if (overlay_mode == MASK_OVERLAY_COMBINED) { + const float blend_col[4] = {0.0f, 0.0f, 0.0f, blend_factor}; + immDrawPixelsTexTiled( + &state, 0.0f, 0.0f, width, height, GPU_R16F, false, buffer, 1.0f, 1.0f, blend_col); + } + else { + immDrawPixelsTexTiled( + &state, 0.0f, 0.0f, width, height, GPU_R16F, false, buffer, 1.0f, 1.0f, NULL); + } GPU_matrix_pop(); if (overlay_mode != MASK_OVERLAY_ALPHACHANNEL) { @@ -765,7 +759,9 @@ void ED_mask_draw_region( } /* draw! */ - draw_mask_layers(C, mask_eval, draw_flag, draw_type, width, height); + if (draw_flag & MASK_DRAWFLAG_SPLINE) { + draw_mask_layers(C, mask_eval, draw_type, width, height); + } if (do_draw_cb) { ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_VIEW); @@ -796,7 +792,7 @@ void ED_mask_draw_frames( uint pos = GPU_vertformat_attr_add( immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4ub(255, 175, 0, 255); immBegin(GPU_PRIM_LINES, 2 * num_lines); @@ -806,7 +802,7 @@ void ED_mask_draw_frames( mask_layer_shape = mask_layer_shape->next) { int frame = mask_layer_shape->frame; - // draw_keyframe(i, CFRA, sfra, framelen, 1); + // draw_keyframe(i, scene->r.cfra, sfra, framelen, 1); int height = (frame == cfra) ? 22 : 10; int x = (frame - sfra) * framelen; immVertex2i(pos, x, region_bottom); diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index b2d49bcc642..915f90a1537 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -42,6 +42,22 @@ bool ED_maskedit_poll(bContext *C) return false; } +bool ED_maskedit_visible_splines_poll(bContext *C) +{ + ScrArea *area = CTX_wm_area(C); + if (area) { + switch (area->spacetype) { + case SPACE_CLIP: + return ED_space_clip_maskedit_visible_splines_poll(C); + case SPACE_SEQ: + return ED_space_sequencer_maskedit_poll(C); + case SPACE_IMAGE: + return ED_space_image_maskedit_visible_splines_poll(C); + } + } + return false; +} + bool ED_maskedit_mask_poll(bContext *C) { ScrArea *area = CTX_wm_area(C); @@ -58,6 +74,22 @@ bool ED_maskedit_mask_poll(bContext *C) return false; } +bool ED_maskedit_mask_visible_splines_poll(bContext *C) +{ + const ScrArea *area = CTX_wm_area(C); + if (area) { + switch (area->spacetype) { + case SPACE_CLIP: + return ED_space_clip_maskedit_mask_visible_splines_poll(C); + case SPACE_SEQ: + return ED_space_sequencer_maskedit_mask_poll(C); + case SPACE_IMAGE: + return ED_space_image_maskedit_mask_visible_splines_poll(C); + } + } + return false; +} + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/editors/mask/mask_editaction.c b/source/blender/editors/mask/mask_editaction.c index 8a23a53a5d2..9819532224e 100644 --- a/source/blender/editors/mask/mask_editaction.c +++ b/source/blender/editors/mask/mask_editaction.c @@ -304,7 +304,7 @@ static bool snap_mask_layer_nearestsec(MaskLayerShape *mask_layer_shape, Scene * static bool snap_mask_layer_cframe(MaskLayerShape *mask_layer_shape, Scene *scene) { if (mask_layer_shape->flag & MASK_SHAPE_SELECT) { - mask_layer_shape->frame = (int)CFRA; + mask_layer_shape->frame = (int)scene->r.cfra; } return false; } diff --git a/source/blender/editors/mask/mask_intern.h b/source/blender/editors/mask/mask_intern.h index c620d781c7f..2e99b45f215 100644 --- a/source/blender/editors/mask/mask_intern.h +++ b/source/blender/editors/mask/mask_intern.h @@ -86,9 +86,6 @@ 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); - /* Generalized solution for preserving editor viewport when making changes while lock-to-selection * is enabled. * Any mask operator can use this API, without worrying that some editors do not have an idea of diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index 3c0e7ee399c..d34b274c111 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -113,7 +113,7 @@ void MASK_OT_new(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_new_exec; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_poll; /* properties */ RNA_def_string(ot->srna, "name", NULL, MAX_ID_NAME - 2, "Name", "Name of new mask"); @@ -146,7 +146,7 @@ void MASK_OT_layer_new(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_layer_new_exec; - ot->poll = ED_maskedit_poll; + ot->poll = ED_maskedit_mask_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -181,7 +181,7 @@ void MASK_OT_layer_remove(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_layer_remove_exec; - ot->poll = ED_maskedit_poll; + ot->poll = ED_maskedit_mask_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -856,7 +856,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) /* Don't key sliding feather UW's. */ if ((data->action == SLIDE_ACTION_FEATHER && data->uw) == false) { if (IS_AUTOKEY_ON(scene)) { - ED_mask_layer_shape_auto_key(data->mask_layer, CFRA); + ED_mask_layer_shape_auto_key(data->mask_layer, scene->r.cfra); } } @@ -907,7 +907,7 @@ void MASK_OT_slide_point(wmOperatorType *ot) /* api callbacks */ ot->invoke = slide_point_invoke; ot->modal = slide_point_modal; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1262,7 +1262,7 @@ static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEve if (event->type == slide_data->event_invoke_type && event->val == KM_RELEASE) { /* Don't key sliding feather UW's. */ if (IS_AUTOKEY_ON(scene)) { - ED_mask_layer_shape_auto_key(slide_data->mask_layer, CFRA); + ED_mask_layer_shape_auto_key(slide_data->mask_layer, scene->r.cfra); } WM_event_add_notifier(C, NC_MASK | NA_EDITED, slide_data->mask); @@ -1297,7 +1297,7 @@ void MASK_OT_slide_spline_curvature(wmOperatorType *ot) /* api callbacks */ ot->invoke = slide_spline_curvature_invoke; ot->modal = slide_spline_curvature_modal; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1336,7 +1336,7 @@ void MASK_OT_cyclic_toggle(wmOperatorType *ot) /* api callbacks */ ot->exec = cyclic_toggle_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1493,7 +1493,7 @@ void MASK_OT_delete(wmOperatorType *ot) /* api callbacks */ ot->invoke = WM_operator_confirm; ot->exec = delete_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1525,7 +1525,7 @@ static int mask_switch_direction_exec(bContext *C, wmOperator *UNUSED(op)) if (changed_layer) { if (IS_AUTOKEY_ON(scene)) { - ED_mask_layer_shape_auto_key(mask_layer, CFRA); + ED_mask_layer_shape_auto_key(mask_layer, scene->r.cfra); } } } @@ -1551,7 +1551,7 @@ void MASK_OT_switch_direction(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_switch_direction_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1587,7 +1587,7 @@ static int mask_normals_make_consistent_exec(bContext *C, wmOperator *UNUSED(op) if (changed_layer) { if (IS_AUTOKEY_ON(scene)) { - ED_mask_layer_shape_auto_key(mask_layer, CFRA); + ED_mask_layer_shape_auto_key(mask_layer, scene->r.cfra); } } } @@ -1613,7 +1613,7 @@ void MASK_OT_normals_make_consistent(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_normals_make_consistent_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1693,7 +1693,7 @@ void MASK_OT_handle_type_set(wmOperatorType *ot) /* api callbacks */ ot->invoke = WM_menu_invoke; ot->exec = set_handle_type_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1849,7 +1849,7 @@ void MASK_OT_feather_weight_clear(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_feather_weight_clear_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -2043,7 +2043,7 @@ void MASK_OT_duplicate(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_duplicate_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -2084,7 +2084,7 @@ void MASK_OT_copy_splines(wmOperatorType *ot) static bool paste_splines_poll(bContext *C) { - if (ED_maskedit_mask_poll(C)) { + if (ED_maskedit_mask_visible_splines_poll(C)) { return BKE_mask_clipboard_is_empty() == false; } diff --git a/source/blender/editors/mask/mask_query.c b/source/blender/editors/mask/mask_query.c index 02e1524e23e..bb865e925d7 100644 --- a/source/blender/editors/mask/mask_query.c +++ b/source/blender/editors/mask/mask_query.c @@ -682,8 +682,7 @@ void ED_mask_get_size(ScrArea *area, int *width, int *height) } case SPACE_SEQ: { // Scene *scene = CTX_data_scene(C); - // *width = (scene->r.size * scene->r.xsch) / 100; - // *height = (scene->r.size * scene->r.ysch) / 100; + // BKE_render_resolution(&scene->r, false, width, height); break; } case SPACE_IMAGE: { diff --git a/source/blender/editors/mask/mask_relationships.c b/source/blender/editors/mask/mask_relationships.c index 9d8b84de66b..1f175ce51fc 100644 --- a/source/blender/editors/mask/mask_relationships.c +++ b/source/blender/editors/mask/mask_relationships.c @@ -21,6 +21,7 @@ #include "WM_types.h" #include "ED_clip.h" /* frame remapping functions */ +#include "ED_mask.h" #include "ED_screen.h" #include "mask_intern.h" /* own include */ @@ -61,7 +62,7 @@ void MASK_OT_parent_clear(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_parent_clear_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index e5fe108b6cd..95cad3f54ca 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -31,8 +31,6 @@ #include "RNA_access.h" #include "RNA_define.h" -#include "DEG_depsgraph.h" - #include "mask_intern.h" /* own include */ /* -------------------------------------------------------------------- */ @@ -222,7 +220,7 @@ void MASK_OT_select_all(wmOperatorType *ot) /* api callbacks */ ot->exec = select_all_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -398,7 +396,7 @@ void MASK_OT_select(wmOperatorType *ot) /* api callbacks */ ot->exec = select_exec; ot->invoke = select_invoke; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; ot->get_name = ED_select_pick_get_name; /* flags */ @@ -504,7 +502,7 @@ void MASK_OT_select_box(wmOperatorType *ot) ot->invoke = WM_gesture_box_invoke; ot->exec = box_select_exec; ot->modal = WM_gesture_box_modal; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_UNDO; @@ -627,7 +625,7 @@ void MASK_OT_select_lasso(wmOperatorType *ot) ot->invoke = WM_gesture_lasso_invoke; ot->modal = WM_gesture_lasso_modal; ot->exec = clip_lasso_select_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; ot->cancel = WM_gesture_lasso_cancel; /* flags */ @@ -745,7 +743,7 @@ void MASK_OT_select_circle(wmOperatorType *ot) ot->invoke = WM_gesture_circle_invoke; ot->modal = WM_gesture_circle_modal; ot->exec = circle_select_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; ot->get_name = ED_select_circle_get_name; /* flags */ @@ -809,7 +807,7 @@ void MASK_OT_select_linked_pick(wmOperatorType *ot) /* api callbacks */ ot->invoke = mask_select_linked_pick_invoke; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -864,7 +862,7 @@ void MASK_OT_select_linked(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_select_linked_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -963,7 +961,7 @@ void MASK_OT_select_more(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_select_more_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -983,7 +981,7 @@ void MASK_OT_select_less(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_select_less_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c index dd54d84a90b..48944c081a8 100644 --- a/source/blender/editors/mask/mask_shapekey.c +++ b/source/blender/editors/mask/mask_shapekey.c @@ -33,7 +33,7 @@ static int mask_shape_key_insert_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - const int frame = CFRA; + const int frame = scene->r.cfra; Mask *mask = CTX_data_edit_mask(C); bool changed = false; @@ -67,7 +67,7 @@ void MASK_OT_shape_key_insert(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_shape_key_insert_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -76,7 +76,7 @@ void MASK_OT_shape_key_insert(wmOperatorType *ot) static int mask_shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - const int frame = CFRA; + const int frame = scene->r.cfra; Mask *mask = CTX_data_edit_mask(C); bool changed = false; @@ -113,7 +113,7 @@ void MASK_OT_shape_key_clear(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_shape_key_clear_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -122,7 +122,7 @@ void MASK_OT_shape_key_clear(wmOperatorType *ot) static int mask_shape_key_feather_reset_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - const int frame = CFRA; + const int frame = scene->r.cfra; Mask *mask = CTX_data_edit_mask(C); bool changed = false; @@ -197,7 +197,7 @@ void MASK_OT_shape_key_feather_reset(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_shape_key_feather_reset_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -214,7 +214,7 @@ void MASK_OT_shape_key_feather_reset(wmOperatorType *ot) static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - const int frame = CFRA; + const int frame = scene->r.cfra; Mask *mask = CTX_data_edit_mask(C); bool changed = false; @@ -356,7 +356,7 @@ void MASK_OT_shape_key_rekey(wmOperatorType *ot) /* api callbacks */ ot->exec = mask_shape_key_rekey_exec; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_maskedit_mask_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |