Blender V4.3
ExportSettings.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "BLI_linklist.h"
12#include "BlenderContext.h"
13
14#ifdef __cplusplus
15# include "BCMath.h"
16# include <vector>
17
18extern "C" {
19#endif
20
25
30
35
43
82
83#ifdef __cplusplus
84}
85
86void bc_get_children(std::vector<Object *> &child_set,
87 Object *ob,
88 const Scene *scene,
89 ViewLayer *view_layer);
90
91class BCExportSettings {
92
93 private:
94 const ExportSettings &export_settings;
95 BlenderContext &blender_context;
96 const BCMatrix global_transform;
97
98 public:
99 BCExportSettings(ExportSettings *exportSettings, BlenderContext &blenderContext)
100 : export_settings(*exportSettings),
101 blender_context(blenderContext),
102 global_transform(BCMatrix(exportSettings->global_forward, exportSettings->global_up))
103 {
104 }
105
106 const BCMatrix &get_global_transform()
107 {
108 return global_transform;
109 }
110
111 bool get_apply_modifiers()
112 {
113 return export_settings.apply_modifiers;
114 }
115
116 BC_global_forward_axis get_global_forward()
117 {
118 return export_settings.global_forward;
119 }
120
121 BC_global_up_axis get_global_up()
122 {
123 return export_settings.global_up;
124 }
125
126 bool get_apply_global_orientation()
127 {
128 return export_settings.apply_global_orientation;
129 }
130
131 BC_export_mesh_type get_export_mesh_type()
132 {
133 return export_settings.export_mesh_type;
134 }
135
136 bool get_selected()
137 {
138 return export_settings.selected;
139 }
140
141 bool get_include_children()
142 {
143 return export_settings.include_children;
144 }
145
146 bool get_include_armatures()
147 {
148 return export_settings.include_armatures;
149 }
150
151 bool get_include_shapekeys()
152 {
153 return export_settings.include_shapekeys;
154 }
155
156 bool get_deform_bones_only()
157 {
158 return export_settings.deform_bones_only;
159 }
160
161 bool get_include_animations()
162 {
163 return export_settings.include_animations;
164 }
165
166 bool get_include_all_actions()
167 {
168 return export_settings.include_all_actions;
169 }
170
171 int get_sampling_rate()
172 {
173 return export_settings.sampling_rate;
174 }
175
176 bool get_keep_smooth_curves()
177 {
178 return export_settings.keep_smooth_curves;
179 }
180
181 bool get_keep_keyframes()
182 {
183 return export_settings.keep_keyframes;
184 }
185
186 bool get_keep_flat_curves()
187 {
188 return export_settings.keep_flat_curves;
189 }
190
191 bool get_active_uv_only()
192 {
193 return export_settings.active_uv_only;
194 }
195
196 BC_export_animation_type get_export_animation_type()
197 {
198 return export_settings.export_animation_type;
199 }
200
201 bool get_use_texture_copies()
202 {
203 return export_settings.use_texture_copies;
204 }
205
206 bool get_triangulate()
207 {
208 return export_settings.triangulate;
209 }
210
211 bool get_use_object_instantiation()
212 {
213 return export_settings.use_object_instantiation;
214 }
215
216 bool get_use_blender_profile()
217 {
218 return export_settings.use_blender_profile;
219 }
220
221 bool get_sort_by_name()
222 {
223 return export_settings.sort_by_name;
224 }
225
226 BC_export_transformation_type get_object_transformation_type()
227 {
228 return export_settings.object_transformation_type;
229 }
230
231 BC_export_transformation_type get_animation_transformation_type()
232 {
233 return export_settings.animation_transformation_type;
234 }
235
236 bool get_open_sim()
237 {
238 return export_settings.open_sim;
239 }
240
241 bool get_limit_precision()
242 {
243 return export_settings.limit_precision;
244 }
245
246 bool get_keep_bind_info()
247 {
248 return export_settings.keep_bind_info;
249 }
250
251 char *get_filepath()
252 {
253 return export_settings.filepath;
254 }
255
256 LinkNode *get_export_set()
257 {
258 return export_settings.export_set;
259 }
260
261 BlenderContext &get_blender_context()
262 {
263 return blender_context;
264 }
265
266 Scene *get_scene()
267 {
268 return blender_context.get_scene();
269 }
270
271 ViewLayer *get_view_layer()
272 {
273 return blender_context.get_view_layer();
274 }
275
276 bool is_export_root(Object *ob)
277 {
278 return bc_is_base_node(get_export_set(), ob, get_scene(), get_view_layer());
279 }
280};
281
282#endif
bool bc_is_base_node(LinkNode *export_set, Object *ob, const Scene *scene, ViewLayer *view_layer)
void bc_get_children(std::vector< Object * > &child_set, Object *ob, const Scene *scene, ViewLayer *view_layer)
BC_global_up_axis
BC_global_forward_axis
BC_export_animation_type
@ BC_ANIMATION_EXPORT_KEYS
@ BC_ANIMATION_EXPORT_SAMPLES
BC_export_mesh_type
@ BC_MESH_TYPE_RENDER
@ BC_MESH_TYPE_VIEW
BC_ui_export_section
@ BC_UI_SECTION_ANIMATION
@ BC_UI_SECTION_MAIN
@ BC_UI_SECTION_ARMATURE
@ BC_UI_SECTION_GEOMETRY
@ BC_UI_SECTION_COLLADA
struct ExportSettings ExportSettings
BC_export_transformation_type
@ BC_TRANSFORMATION_TYPE_MATRIX
@ BC_TRANSFORMATION_TYPE_DECOMPOSED
bool use_object_instantiation
BC_export_animation_type export_animation_type
bool apply_global_orientation
BC_global_forward_axis global_forward
BC_export_transformation_type animation_transformation_type
BC_export_transformation_type object_transformation_type
LinkNode * export_set
BC_export_mesh_type export_mesh_type
BC_global_up_axis global_up