Blender V4.3
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
15struct ARegion;
16struct View3D;
17struct bContext;
18struct Scene;
19struct ReportList;
20struct Depsgraph;
21
23
24struct IOContext {
28 const View3D *v3d;
31 Depsgraph *depsgraph;
32
34 const ARegion *region,
35 const View3D *v3d,
36 const RegionView3D *rv3d,
38};
39
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
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;
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. */
74};
75
76bool import_svg(const IOContext &context, const ImportParams &params, StringRefNull filepath);
77bool export_svg(const IOContext &context,
78 const ExportParams &params,
79 Scene &scene,
80 StringRefNull filepath);
81bool export_pdf(const IOContext &context,
82 const ExportParams &params,
83 Scene &scene,
84 StringRefNull filepath);
85
86} // namespace blender::io::grease_pencil
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
bool export_svg(const IOContext &context, const ExportParams &params, Scene &scene, StringRefNull filepath)
bool import_svg(const IOContext &context, const ImportParams &params, StringRefNull filepath)
bool export_pdf(const IOContext &context, const ExportParams &params, Scene &scene, StringRefNull filepath)
IOContext(bContext &C, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, ReportList *reports)