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