Blender  V2.93
SceneExporter.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include <math.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 
27 #include "DNA_action_types.h"
28 #include "DNA_anim_types.h"
29 #include "DNA_armature_types.h"
30 #include "DNA_collection_types.h"
31 #include "DNA_constraint_types.h"
32 #include "DNA_curve_types.h"
33 #include "DNA_image_types.h"
34 #include "DNA_material_types.h"
35 #include "DNA_mesh_types.h"
36 #include "DNA_meshdata_types.h"
37 #include "DNA_modifier_types.h"
38 #include "DNA_object_types.h"
39 #include "DNA_scene_types.h"
40 #include "DNA_texture_types.h"
41 #include "DNA_userdef_types.h"
42 
43 #include "BKE_constraint.h"
44 #include "BKE_fcurve.h"
45 #include "BLI_fileops.h"
46 #include "BLI_path_util.h"
47 #include "ED_keyframing.h"
48 
49 #include "COLLADASWAsset.h"
50 #include "COLLADASWBaseInputElement.h"
51 #include "COLLADASWBindMaterial.h"
52 #include "COLLADASWColorOrTexture.h"
53 #include "COLLADASWConstants.h"
54 #include "COLLADASWEffectProfile.h"
55 #include "COLLADASWImage.h"
56 #include "COLLADASWInputList.h"
57 #include "COLLADASWInstanceCamera.h"
58 #include "COLLADASWInstanceController.h"
59 #include "COLLADASWInstanceGeometry.h"
60 #include "COLLADASWInstanceLight.h"
61 #include "COLLADASWInstanceNode.h"
62 #include "COLLADASWLibraryAnimations.h"
63 #include "COLLADASWLibraryControllers.h"
64 #include "COLLADASWLibraryEffects.h"
65 #include "COLLADASWLibraryImages.h"
66 #include "COLLADASWLibraryMaterials.h"
67 #include "COLLADASWLibraryVisualScenes.h"
68 #include "COLLADASWNode.h"
69 #include "COLLADASWParamBase.h"
70 #include "COLLADASWParamTemplate.h"
71 #include "COLLADASWPrimitves.h"
72 #include "COLLADASWSampler.h"
73 #include "COLLADASWScene.h"
74 #include "COLLADASWSource.h"
75 #include "COLLADASWSurfaceInitOption.h"
76 #include "COLLADASWTechnique.h"
77 #include "COLLADASWTexture.h"
78 #include "COLLADASWVertices.h"
79 
80 #include "ArmatureExporter.h"
81 #include "ExportSettings.h"
82 
83 class SceneExporter : COLLADASW::LibraryVisualScenes,
84  protected TransformWriter,
85  protected InstanceWriter {
86  public:
87  SceneExporter(BlenderContext &blender_context,
88  COLLADASW::StreamWriter *sw,
89  ArmatureExporter *arm,
90  BCExportSettings &export_settings)
91  : COLLADASW::LibraryVisualScenes(sw),
92  blender_context(blender_context),
93  arm_exporter(arm),
94  export_settings(export_settings)
95  {
96  }
97 
98  void exportScene();
99 
100  private:
101  BlenderContext &blender_context;
102  friend class ArmatureExporter;
103  ArmatureExporter *arm_exporter;
104  BCExportSettings &export_settings;
105 
106  void exportHierarchy();
107  void writeNodeList(std::vector<Object *> &child_objects, Object *parent);
108  void writeNode(Object *ob);
109 };
File and directory operations.
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
SceneExporter(BlenderContext &blender_context, COLLADASW::StreamWriter *sw, ArmatureExporter *arm, BCExportSettings &export_settings)
Definition: SceneExporter.h:87