Blender
V4.3
source
blender
io
grease_pencil
grease_pencil_io.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2024 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#include "
BLI_string_ref.hh
"
6
7
#include "
DNA_view3d_types.h
"
8
9
#pragma once
10
15
struct
ARegion
;
16
struct
View3D
;
17
struct
bContext
;
18
struct
Scene
;
19
struct
ReportList
;
20
struct
Depsgraph;
21
22
namespace
blender::io::grease_pencil
{
23
24
struct
IOContext
{
25
ReportList
*
reports
;
26
bContext
&
C
;
27
const
ARegion
*
region
;
28
const
View3D
*
v3d
;
29
const
RegionView3D
*
rv3d
;
30
Scene
*
scene
;
31
Depsgraph *
depsgraph
;
32
33
IOContext
(
bContext
&C,
34
const
ARegion
*region,
35
const
View3D
*
v3d
,
36
const
RegionView3D
*
rv3d
,
37
ReportList
*
reports
);
38
};
39
40
struct
ImportParams
{
41
float
scale = 1.0f;
42
int
frame_number
= 1;
43
int
resolution
= 10;
44
bool
use_scene_unit
=
false
;
45
bool
recenter_bounds
=
false
;
46
};
47
48
struct
ExportParams
{
49
/* Object to be exported. */
50
enum class
SelectMode
{
51
Active = 0,
52
Selected
= 1,
53
Visible
= 2,
54
};
55
57
enum class
FrameMode
{
58
Active = 0,
59
Selected
= 1,
60
Scene
= 2,
61
};
62
63
Object
*
object
=
nullptr
;
64
SelectMode
select_mode
=
SelectMode::Active
;
65
FrameMode
frame_mode
=
FrameMode::Active
;
66
bool
export_stroke_materials
=
true
;
67
bool
export_fill_materials
=
true
;
68
/* Clip drawings to camera size when exporting in camera view. */
69
bool
use_clip_camera
=
false
;
70
/* Enforce uniform stroke width by averaging radius. */
71
bool
use_uniform_width
=
false
;
72
/* Distance for resampling outline curves before export, disabled if zero. */
73
float
outline_resample_length
= 0.0f;
74
};
75
76
bool
import_svg
(
const
IOContext
&context,
const
ImportParams
&
params
,
StringRefNull
filepath);
77
bool
export_svg
(
const
IOContext
&context,
78
const
ExportParams
&
params
,
79
Scene
&scene,
80
StringRefNull
filepath);
81
bool
export_pdf
(
const
IOContext
&context,
82
const
ExportParams
&
params
,
83
Scene
&scene,
84
StringRefNull
filepath);
85
86
}
// namespace blender::io::grease_pencil
BLI_string_ref.hh
DNA_view3d_types.h
blender::StringRefNull
Definition
BLI_string_ref.hh:111
params
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
Definition
interface_widgets.cc:1055
blender::io::grease_pencil
Definition
grease_pencil_io.hh:22
blender::io::grease_pencil::export_svg
bool export_svg(const IOContext &context, const ExportParams ¶ms, Scene &scene, StringRefNull filepath)
Definition
grease_pencil_io_export_svg.cc:381
blender::io::grease_pencil::import_svg
bool import_svg(const IOContext &context, const ImportParams ¶ms, StringRefNull filepath)
Definition
grease_pencil_io_import_svg.cc:392
blender::io::grease_pencil::export_pdf
bool export_pdf(const IOContext &context, const ExportParams ¶ms, Scene &scene, StringRefNull filepath)
Definition
grease_pencil_io_export_pdf.cc:277
ARegion
Definition
DNA_screen_types.h:474
Object
Definition
DNA_object_types.h:193
RegionView3D
Definition
DNA_view3d_types.h:32
ReportList
Definition
DNA_windowmanager_types.h:110
Scene
Definition
DNA_scene_types.h:1988
View3D
Definition
DNA_view3d_types.h:279
bContext
Definition
blenkernel/intern/context.cc:61
blender::io::grease_pencil::ExportParams
Definition
grease_pencil_io.hh:48
blender::io::grease_pencil::ExportParams::SelectMode
SelectMode
Definition
grease_pencil_io.hh:50
blender::io::grease_pencil::ExportParams::SelectMode::Active
@ Active
blender::io::grease_pencil::ExportParams::SelectMode::Selected
@ Selected
blender::io::grease_pencil::ExportParams::SelectMode::Visible
@ Visible
blender::io::grease_pencil::ExportParams::outline_resample_length
float outline_resample_length
Definition
grease_pencil_io.hh:73
blender::io::grease_pencil::ExportParams::use_clip_camera
bool use_clip_camera
Definition
grease_pencil_io.hh:69
blender::io::grease_pencil::ExportParams::frame_mode
FrameMode frame_mode
Definition
grease_pencil_io.hh:65
blender::io::grease_pencil::ExportParams::export_fill_materials
bool export_fill_materials
Definition
grease_pencil_io.hh:67
blender::io::grease_pencil::ExportParams::FrameMode
FrameMode
Definition
grease_pencil_io.hh:57
blender::io::grease_pencil::ExportParams::FrameMode::Active
@ Active
blender::io::grease_pencil::ExportParams::export_stroke_materials
bool export_stroke_materials
Definition
grease_pencil_io.hh:66
blender::io::grease_pencil::ExportParams::use_uniform_width
bool use_uniform_width
Definition
grease_pencil_io.hh:71
blender::io::grease_pencil::ExportParams::select_mode
SelectMode select_mode
Definition
grease_pencil_io.hh:64
blender::io::grease_pencil::IOContext
Definition
grease_pencil_io.hh:24
blender::io::grease_pencil::IOContext::C
bContext & C
Definition
grease_pencil_io.hh:26
blender::io::grease_pencil::IOContext::IOContext
IOContext(bContext &C, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, ReportList *reports)
Definition
grease_pencil_io.cc:88
blender::io::grease_pencil::IOContext::depsgraph
Depsgraph * depsgraph
Definition
grease_pencil_io.hh:31
blender::io::grease_pencil::IOContext::reports
ReportList * reports
Definition
grease_pencil_io.hh:25
blender::io::grease_pencil::IOContext::scene
Scene * scene
Definition
grease_pencil_io.hh:30
blender::io::grease_pencil::IOContext::rv3d
const RegionView3D * rv3d
Definition
grease_pencil_io.hh:29
blender::io::grease_pencil::IOContext::region
const ARegion * region
Definition
grease_pencil_io.hh:27
blender::io::grease_pencil::IOContext::v3d
const View3D * v3d
Definition
grease_pencil_io.hh:28
blender::io::grease_pencil::ImportParams
Definition
grease_pencil_io.hh:40
blender::io::grease_pencil::ImportParams::recenter_bounds
bool recenter_bounds
Definition
grease_pencil_io.hh:45
blender::io::grease_pencil::ImportParams::frame_number
int frame_number
Definition
grease_pencil_io.hh:42
blender::io::grease_pencil::ImportParams::use_scene_unit
bool use_scene_unit
Definition
grease_pencil_io.hh:44
blender::io::grease_pencil::ImportParams::resolution
int resolution
Definition
grease_pencil_io.hh:43
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0