This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/editors/io/io_gpencil_utils.c
Campbell Barton 8edd1d8aa5 CMake: optionally disable OBJ, STL & GPencil SVG support
The following CMake options have been added (enabled by default),
except for the lite build configuration.

- WITH_IO_STL
- WITH_IO_WAVEFRONT_OBJ
- WITH_IO_GPENCIL (for grease pencil SVG importing).
  Note that it was already possible to disable grease pencil export
  by disabling WITH_PUGIXML & WITH_HARU.

This is intended to keep the lite builds fast and small for building,
linking & execution.

Reviewed By: iyadahmed2001, aras_p, antoniov, mont29

Ref D15141
2022-06-08 13:29:32 +10:00

53 lines
970 B
C

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2020 Blender Foundation. All rights reserved. */
/** \file
* \ingroup editor/io
*/
#ifdef WITH_IO_GPENCIL
# include "DNA_space_types.h"
# include "BKE_context.h"
# include "BKE_screen.h"
# include "WM_api.h"
# include "io_gpencil.h"
ARegion *get_invoke_region(bContext *C)
{
bScreen *screen = CTX_wm_screen(C);
if (screen == NULL) {
return NULL;
}
ScrArea *area = BKE_screen_find_big_area(screen, SPACE_VIEW3D, 0);
if (area == NULL) {
return NULL;
}
ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
return region;
}
View3D *get_invoke_view3d(bContext *C)
{
bScreen *screen = CTX_wm_screen(C);
if (screen == NULL) {
return NULL;
}
ScrArea *area = BKE_screen_find_big_area(screen, SPACE_VIEW3D, 0);
if (area == NULL) {
return NULL;
}
if (area) {
return area->spacedata.first;
}
return NULL;
}
#endif /* WITH_IO_GPENCIL */