From f04206cbc7129603a7c437b79b1d1c99bd191783 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Sun, 24 Jan 2021 20:39:09 +0100 Subject: Cleanup: Add/use helper to check if dragging a certain ID type or asset ID type This check is a common pattern, avoid duplication by using a helper function. --- source/blender/editors/space_view3d/space_view3d.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index b5b7f0b22cd..9f7cf48da0c 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -489,7 +489,7 @@ static bool view3d_drop_id_in_main_region_poll(bContext *C, return false; } - return WM_drag_get_local_ID(drag, id_type) || WM_drag_get_asset_data(drag, id_type); + return WM_drag_is_ID_type(drag, id_type); } static bool view3d_ob_drop_poll(bContext *C, @@ -544,7 +544,7 @@ static bool view3d_ima_drop_poll(bContext *C, return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE)); } - return WM_drag_get_local_ID(drag, ID_IM) || WM_drag_get_asset_data(drag, ID_IM); + return WM_drag_is_ID_type(drag, ID_IM); } static bool view3d_ima_bg_is_camera_view(bContext *C) -- cgit v1.2.3