diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_mask.h | 13 | ||||
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 1 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_add.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_relationships.c | 1 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 26 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 |
8 files changed, 21 insertions, 37 deletions
diff --git a/source/blender/editors/include/ED_mask.h b/source/blender/editors/include/ED_mask.h index 7039d6d9fc7..92df3d8d682 100644 --- a/source/blender/editors/include/ED_mask.h +++ b/source/blender/editors/include/ED_mask.h @@ -22,6 +22,19 @@ struct wmKeyConfig; /* mask_edit.c */ +/* Returns true when the following conditions are met: + * - Current space supports mask editing. + * - The space is configured to interact with mask. + * + * It is not required to have mask opened for editing. */ +bool ED_maskedit_poll(struct bContext *C); + +/* Returns true when the following conditions are met: + * - Current space supports mask editing. + * - The space is configured to interact with mask. + * - The space has mask open for editing. */ +bool ED_maskedit_mask_poll(struct bContext *C); + void ED_mask_deselect_all(const struct bContext *C); void ED_operatortypes_mask(void); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index aa62a6209e4..a24c8625a63 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -595,7 +595,6 @@ bool ED_operator_object_active_local_editable_posemode_exclusive(struct bContext bool ED_operator_posemode_context(struct bContext *C); bool ED_operator_posemode(struct bContext *C); bool ED_operator_posemode_local(struct bContext *C); -bool ED_operator_mask(struct bContext *C); bool ED_operator_camera_poll(struct bContext *C); /* screen_user_menu.c */ diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index 194170b1677..42f3acaa6bc 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -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_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_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -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_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; 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 f2e9c94c25b..3ca9f4d06e2 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"); @@ -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_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -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_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/mask/mask_relationships.c b/source/blender/editors/mask/mask_relationships.c index 9d8b84de66b..afeb1500267 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 */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 55721e6380d..212fb846b43 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -659,32 +659,6 @@ bool ED_operator_editmball(bContext *C) return false; } -bool ED_operator_mask(bContext *C) -{ - ScrArea *area = CTX_wm_area(C); - if (area && area->spacedata.first) { - switch (area->spacetype) { - case SPACE_CLIP: { - SpaceClip *space_clip = area->spacedata.first; - return ED_space_clip_check_show_maskedit(space_clip); - } - case SPACE_SEQ: { - SpaceSeq *sseq = area->spacedata.first; - Scene *scene = CTX_data_scene(C); - return ED_space_sequencer_check_show_maskedit(sseq, scene); - } - case SPACE_IMAGE: { - SpaceImage *sima = area->spacedata.first; - ViewLayer *view_layer = CTX_data_view_layer(C); - Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); - return ED_space_image_check_show_maskedit(sima, obedit); - } - } - } - - return false; -} - bool ED_operator_camera_poll(bContext *C) { struct Camera *cam = CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index fa49e996c2a..537132ac428 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -964,7 +964,7 @@ static int image_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) static bool image_view_selected_poll(bContext *C) { - return (space_image_main_region_poll(C) && (ED_operator_uvedit(C) || ED_operator_mask(C))); + return (space_image_main_region_poll(C) && (ED_operator_uvedit(C) || ED_maskedit_poll(C))); } void IMAGE_OT_view_selected(wmOperatorType *ot) |