From e658c8851a2921560ad5df579a8250e1e97b6769 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 Jun 2022 09:58:23 +0200 Subject: Refactor: De-duplicate mask operator poll functions The poll function with same semantic was defined in both screen and mask space modules. The only reason for this seems to be that the image editor needed a mask poll function which was private to the mask module. Make the mask editing poll functions public, avoiding code duplication. Also, added a brief explanation about what the poll functions are checking for. No user-level changes are expected to happen. --- source/blender/editors/screen/screen_ops.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'source/blender/editors/screen/screen_ops.c') 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; -- cgit v1.2.3