Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/io/io_gpencil_utils.c
| /* SPDX-License-Identifier: GPL-2.0-or-later | /* SPDX-License-Identifier: GPL-2.0-or-later | ||||
| * Copyright 2020 Blender Foundation. All rights reserved. */ | * Copyright 2020 Blender Foundation. All rights reserved. */ | ||||
| /** \file | /** \file | ||||
| * \ingroup editor/io | * \ingroup editor/io | ||||
| */ | */ | ||||
| #ifdef WITH_IO_GPENCIL | |||||
| #include "DNA_space_types.h" | # include "DNA_space_types.h" | ||||
| #include "BKE_context.h" | # include "BKE_context.h" | ||||
| #include "BKE_screen.h" | # include "BKE_screen.h" | ||||
| #include "WM_api.h" | # include "WM_api.h" | ||||
| #include "io_gpencil.h" | # include "io_gpencil.h" | ||||
| ARegion *get_invoke_region(bContext *C) | ARegion *get_invoke_region(bContext *C) | ||||
| { | { | ||||
| bScreen *screen = CTX_wm_screen(C); | bScreen *screen = CTX_wm_screen(C); | ||||
| if (screen == NULL) { | if (screen == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ScrArea *area = BKE_screen_find_big_area(screen, SPACE_VIEW3D, 0); | ScrArea *area = BKE_screen_find_big_area(screen, SPACE_VIEW3D, 0); | ||||
| Show All 17 Lines | if (area == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| if (area) { | if (area) { | ||||
| return area->spacedata.first; | return area->spacedata.first; | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| #endif /* WITH_IO_GPENCIL */ | |||||