2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADAMaya.
6
Portions of the code are:
7
Copyright (c) 2005-2007 Feeling Software Inc.
8
Copyright (c) 2005-2007 Sony Computer Entertainment America
9
Copyright (c) 2004-2005 Alias Systems Corp.
11
Licensed under the MIT Open Source License,
12
for details please see LICENSE file or the website
13
http://www.opensource.org/licenses/mit-license.php
16
#include "COLLADAMayaStableHeaders.h"
17
#include "COLLADAMayaExportOptions.h"
18
#include "COLLADAMayaSetHelper.h"
19
#include "COLLADAMayaAnimationHelper.h"
26
bool ExportOptions::mBakeTransforms = true;
27
bool ExportOptions::mRelativePaths = true;
28
bool ExportOptions::mCopyTextures = false;
29
bool ExportOptions::mExportPolygonMeshes = true;
30
bool ExportOptions::mExportLights = true;
31
bool ExportOptions::mExportCgfxFileReferences = true;
32
bool ExportOptions::mExportCameras = true;
33
bool ExportOptions::mExportJointsAndSkin = true;
34
bool ExportOptions::mExportMaterialsOnly = false;
35
bool ExportOptions::mExportReferencedMaterials = true;
36
bool ExportOptions::mExportAnimations = true;
37
bool ExportOptions::mRemoveStaticCurves = true;
38
bool ExportOptions::mExportInvisibleNodes = false;
39
bool ExportOptions::mExportDefaultCameras = false;
40
bool ExportOptions::mExportNormals = true;
41
bool ExportOptions::mExportNormalsPerVertex = true;
42
bool ExportOptions::mExportTexCoords = true;
43
bool ExportOptions::mExportVertexColors = true;
44
bool ExportOptions::mExportVertexColorsPerVertex = true;
45
bool ExportOptions::mExportTangents = false;
46
bool ExportOptions::mExportTexTangents = false;
47
bool ExportOptions::mExportCameraAsLookat = true;
48
bool ExportOptions::mExportTriangles = false;
49
bool ExportOptions::mExportXRefs = true;
50
bool ExportOptions::mDereferenceXRefs = false;
51
bool ExportOptions::mCameraXFov = false;
52
bool ExportOptions::mCameraYFov = true;
53
bool ExportOptions::mDoublePrecision = false;
54
bool ExportOptions::mIsSampling = false;
55
bool ExportOptions::mCurveConstrainSampling = false;
57
// Parse the options String
58
void ExportOptions::set ( const MString& optionsString )
60
// Reset everything to the default value
61
mBakeTransforms = false;
62
mRelativePaths = true;
64
/** True, if the texture files should be copied to the destination folder. */
65
mCopyTextures = false;
68
mCurveConstrainSampling = false;
69
mRemoveStaticCurves = true;
70
mExportCameraAsLookat = false;
71
mExportTriangles = false;
73
mExportPolygonMeshes = true;
75
mExportCameras = true;
76
mExportMaterialsOnly = false;
77
mExportReferencedMaterials = true;
78
mExportJointsAndSkin = true;
79
mExportAnimations = true;
80
mExportInvisibleNodes = false;
81
mExportDefaultCameras = false;
82
mExportNormals = true;
83
mExportNormalsPerVertex = true;
84
mExportTexCoords = true;
85
mExportVertexColors = true;
86
mExportVertexColorsPerVertex = true;
87
mExportTangents = false;
88
mExportTexTangents = false;
90
mDereferenceXRefs = true;
93
mDoublePrecision = false;
94
mExportCgfxFileReferences = true;
96
// Parse option String
97
if ( optionsString.length() > 0 )
99
MStringArray optionList;
100
optionsString.split ( ';', optionList );
101
uint optionCount = optionList.length();
103
for ( uint i = 0; i < optionCount; ++i )
105
MString& currentOption = optionList[i];
107
// Process option name and values.
108
MStringArray decomposedOption;
109
currentOption.split ( '=', decomposedOption );
110
MString& optionName = decomposedOption[0];
112
// For boolean values, the value is assumed to be true
116
if ( decomposedOption.length() > 1 &&
117
decomposedOption[1] != "true" &&
118
decomposedOption[1] != "1" )
122
if ( optionName == "bakeTransforms" ) mBakeTransforms = value;
123
else if ( optionName == "relativePaths" ) mRelativePaths = value;
124
else if ( optionName == "exportTriangles" ) mExportTriangles = value;
125
else if ( optionName == "cgfxFileReferences" ) mExportCgfxFileReferences = value;
126
else if ( optionName == "copyTextures" ) mCopyTextures = value;
127
else if ( optionName == "exportPolygonMeshes" ) mExportPolygonMeshes = value;
128
else if ( optionName == "exportLights" ) mExportLights = value;
129
else if ( optionName == "exportCameras" ) mExportCameras = value;
130
else if ( optionName == "exportJointsAndSkin" ) mExportJointsAndSkin = value;
131
else if ( optionName == "exportMaterialsOnly" ) mExportMaterialsOnly = value;
132
else if ( optionName == "exportReferencedMaterials" ) mExportReferencedMaterials = value;
133
else if ( optionName == "exportAnimations" ) mExportAnimations = value;
134
else if ( optionName == "exportInvisibleNodes" ) mExportInvisibleNodes = value;
135
else if ( optionName == "exportDefaultCameras" ) mExportDefaultCameras = value;
136
else if ( optionName == "exportNormals" ) mExportNormals = value;
137
else if ( optionName == "exportNormalsPerVertex" ) mExportNormalsPerVertex = value;
138
else if ( optionName == "exportTexCoords" ) mExportTexCoords = value;
139
else if ( optionName == "exportVertexColors" ) mExportVertexColors = value;
140
else if ( optionName == "exportVertexColorsPerVertex" ) mExportVertexColorsPerVertex = value;
141
else if ( optionName == "exportTangents" ) mExportTangents = value;
142
else if ( optionName == "exportTexTangents" ) mExportTexTangents = value;
143
else if ( optionName == "exportCameraAsLookat" ) mExportCameraAsLookat = value;
144
else if ( optionName == "cameraXFov" ) mCameraXFov = value;
145
else if ( optionName == "cameraYFov" ) mCameraYFov = value;
146
else if ( optionName == "doublePrecision" ) mDoublePrecision = value;
147
else if ( optionName == "isSampling" ) mIsSampling = value;
148
else if ( optionName == "curveConstrainSampling" ) mCurveConstrainSampling = value;
149
else if ( optionName == "removeStaticCurves" ) mRemoveStaticCurves = value;
150
else if ( optionName == "exportXRefs" ) mExportXRefs = value;
151
else if ( optionName == "dereferenceXRefs" ) mDereferenceXRefs = value;
157
AnimationHelper::generateSamplingFunction();
161
bool ExportOptions::bakeTransforms()
163
return mBakeTransforms;
166
bool ExportOptions::exportPolygonMeshes()
168
return mExportPolygonMeshes;
171
bool ExportOptions::isSampling()
176
bool ExportOptions::curveConstrainSampling()
178
return mCurveConstrainSampling;
181
bool ExportOptions::removeStaticCurves()
183
return mRemoveStaticCurves;
186
bool ExportOptions::exportCameraAsLookat()
188
return mExportCameraAsLookat;
191
bool ExportOptions::relativePaths()
193
return mRelativePaths;
196
bool ExportOptions::exportLights()
198
return mExportLights;
201
bool ExportOptions::exportCameras()
203
return mExportCameras;
206
bool ExportOptions::exportJointsAndSkin()
208
return mExportJointsAndSkin;
211
bool ExportOptions::exportMaterialsOnly ()
213
return mExportMaterialsOnly;
216
bool ExportOptions::exportReferencedMaterials ()
218
return mExportReferencedMaterials;
221
bool ExportOptions::exportAnimations()
223
return mExportAnimations;
226
bool ExportOptions::exportTriangles()
228
return mExportTriangles;
231
bool ExportOptions::exportInvisibleNodes()
233
return mExportInvisibleNodes;
236
bool ExportOptions::exportDefaultCameras()
238
return mExportDefaultCameras;
241
bool ExportOptions::exportNormals()
243
return mExportNormals;
246
bool ExportOptions::exportNormalsPerVertex()
248
return mExportNormalsPerVertex;
251
bool ExportOptions::exportTexCoords()
253
return mExportTexCoords;
256
bool ExportOptions::exportVertexColors()
258
return mExportVertexColors;
261
bool ExportOptions::exportVertexColorsPerVertex()
263
return mExportVertexColorsPerVertex;
266
bool ExportOptions::exportTangents()
268
return mExportTangents;
271
bool ExportOptions::exportTexTangents()
273
return mExportTexTangents;
276
bool ExportOptions::exportXRefs()
281
bool ExportOptions::dereferenceXRefs()
283
return mDereferenceXRefs;
286
bool ExportOptions::cameraXFov()
291
bool ExportOptions::cameraYFov()
296
bool ExportOptions::doublePrecision()
298
return mDoublePrecision;
301
bool ExportOptions::copyTextures()
303
return mCopyTextures;
306
bool ExportOptions::exportCgfxFileReferences ()
308
return mExportCgfxFileReferences;
b'\\ No newline at end of file'