Collada exporter update
[blender.git] / source / blender / collada / SceneExporter.h
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
17 /** \file
18  * \ingroup collada
19  */
20
21 #ifndef __SCENEEXPORTER_H__
22 #define __SCENEEXPORTER_H__
23
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <math.h>
27
28 extern "C" {
29 #include "DNA_scene_types.h"
30 #include "DNA_object_types.h"
31 #include "DNA_collection_types.h"
32 #include "DNA_meshdata_types.h"
33 #include "DNA_mesh_types.h"
34 #include "DNA_image_types.h"
35 #include "DNA_material_types.h"
36 #include "DNA_texture_types.h"
37 #include "DNA_anim_types.h"
38 #include "DNA_action_types.h"
39 #include "DNA_curve_types.h"
40 #include "DNA_constraint_types.h"
41 #include "DNA_armature_types.h"
42 #include "DNA_modifier_types.h"
43 #include "DNA_userdef_types.h"
44
45 #include "BKE_fcurve.h"
46 #include "BKE_animsys.h"
47 #include "BLI_path_util.h"
48 #include "BKE_constraint.h"
49 #include "BLI_fileops.h"
50 #include "ED_keyframing.h"
51 }
52
53 #include "COLLADASWAsset.h"
54 #include "COLLADASWLibraryVisualScenes.h"
55 #include "COLLADASWNode.h"
56 #include "COLLADASWSource.h"
57 #include "COLLADASWInstanceGeometry.h"
58 #include "COLLADASWInputList.h"
59 #include "COLLADASWPrimitves.h"
60 #include "COLLADASWVertices.h"
61 #include "COLLADASWLibraryAnimations.h"
62 #include "COLLADASWLibraryImages.h"
63 #include "COLLADASWLibraryEffects.h"
64 #include "COLLADASWImage.h"
65 #include "COLLADASWEffectProfile.h"
66 #include "COLLADASWColorOrTexture.h"
67 #include "COLLADASWParamTemplate.h"
68 #include "COLLADASWParamBase.h"
69 #include "COLLADASWSurfaceInitOption.h"
70 #include "COLLADASWSampler.h"
71 #include "COLLADASWScene.h"
72 #include "COLLADASWTechnique.h"
73 #include "COLLADASWTexture.h"
74 #include "COLLADASWLibraryMaterials.h"
75 #include "COLLADASWBindMaterial.h"
76 #include "COLLADASWInstanceCamera.h"
77 #include "COLLADASWInstanceLight.h"
78 #include "COLLADASWConstants.h"
79 #include "COLLADASWLibraryControllers.h"
80 #include "COLLADASWInstanceController.h"
81 #include "COLLADASWInstanceNode.h"
82 #include "COLLADASWBaseInputElement.h"
83
84 #include "ArmatureExporter.h"
85 #include "ExportSettings.h"
86
87 extern void bc_get_children(std::vector<Object *> &child_set, Object *ob, ViewLayer *view_layer);
88
89 class SceneExporter : COLLADASW::LibraryVisualScenes,
90                       protected TransformWriter,
91                       protected InstanceWriter {
92  public:
93   SceneExporter(BlenderContext &blender_context,
94                 COLLADASW::StreamWriter *sw,
95                 ArmatureExporter *arm,
96                 BCExportSettings &export_settings)
97       : COLLADASW::LibraryVisualScenes(sw),
98         blender_context(blender_context),
99         arm_exporter(arm),
100         export_settings(export_settings)
101   {
102   }
103
104   void exportScene();
105
106  private:
107   BlenderContext &blender_context;
108   friend class ArmatureExporter;
109   ArmatureExporter *arm_exporter;
110   BCExportSettings &export_settings;
111
112   void exportHierarchy();
113   void writeNodeList(std::vector<Object *> &child_objects, Object *parent);
114   void writeNode(Object *ob);
115 };
116
117 #endif