fbxsdk/fileio/collada/fbxwritercollada14.h Source File

fbxwritercollada14.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2014 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_FILEIO_COLLADA_WRITER_H_
14 #define _FBXSDK_FILEIO_COLLADA_WRITER_H_
15 
16 #include <fbxsdk.h>
17 
19 
20 #include <fbxsdk/fbxsdk_nsbegin.h>
21 
25 class FbxWriterCollada : public FbxWriter
26 {
27 public:
32 
38  FbxWriterCollada(FbxManager& pManager, int pID, FbxStatus& pStatus);
39 
41  virtual ~FbxWriterCollada();
42 
44 
49 
54  virtual bool FileCreate(char* pFileName);
55 
59  virtual bool FileClose();
60 
64  virtual bool IsFileOpen();
65 
67 
72 
75  virtual void GetWriteOptions(){}
76 
81  virtual bool Write(FbxDocument* pDocument);
82 
88  virtual bool PreprocessScene(FbxScene &pScene);
89 
94  virtual bool PostprocessScene(FbxScene &pScene);
95 
97 
98 
99 /*****************************************************************************************************************************
100 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
101 *****************************************************************************************************************************/
102 #ifndef DOXYGEN_SHOULD_SKIP_THIS
103 private:
108 
116  xmlNode* ExportAsset(xmlNode* pXmlNode, FbxDocumentInfo* pSceneInfo);
117 
122  xmlNode * ExportScene(FbxScene* pScene);
123 
130  bool ExportLibraries(xmlNode* pXmlNode);
131 
140  xmlNode* ExportNodeRecursive(xmlNode* pXmlNode, const FbxNode* pNode);
141 
146  void ExportVisualSceneMAX3DExtension(xmlNode * pExtraElement, FbxScene * pScene);
147 
152  void ExportVisualSceneFCOLLADAExtension(xmlNode * pExtraElement, FbxScene * pScene);
153 
161  xmlNode* ExportNode(xmlNode* pXmlNode, const FbxNode* pNode);
162 
170  bool ExportTransform(xmlNode* pXmlNode, const FbxNode* pNode);
171 
179  bool ExportNodeAttribute(xmlNode* pXmlNode, const FbxNode* pNode);
180 
187  xmlNode* CreateMeshLibrary(const FbxNode* pNode);
188 
195  xmlNode* CreateCameraLibrary(const FbxNode* pNode);
196 
203  xmlNode* CreateLightLibrary(const FbxNode* pNode);
204 
211  xmlNode* ExportMesh(const FbxNode* pNode);
212 
219  xmlNode* ExportShapeGeometry(FbxMesh* pMeshShape, FbxString pShapeId);
220 
231  //Note why internally set pExportControlPoints to true?
232  xmlNode* ExportVertexPositions(xmlNode* pXmlNode, FbxMesh* pMesh, FbxString pMeshName, bool pInGeometry, bool pExportControlPoints);
233 
242  xmlNode* ExportLayerElements(xmlNode* pXmlMesh, FbxMesh* pMesh, FbxString pName);
243 
253  xmlNode* ExportNormals(xmlNode* pXmlNode, FbxMesh* pMesh, FbxString pName, FbxString pExt, int pLayerIndex);
254 
263  xmlNode* ExportUVs(xmlNode* pXmlNode, FbxMesh* pMesh, FbxString pName, int pLayerIndex);
264 
273  xmlNode* ExportVertexColors(xmlNode* pXmlNode, FbxMesh* pMesh, FbxString pName, int pLayerIndex);
274 
281  xmlNode* ExportVertices(xmlNode* pXmlNode, FbxMesh* pMesh, FbxString pName);
282 
293  xmlNode* ExportPolygons(xmlNode* pMeshElement, FbxMesh* pMesh, FbxString pMaterialName, int pMaterialIndexInNode, FbxString pName, bool pShape = false);
294 
300  bool ExportMeshMaterials(FbxMesh *pMesh, int pNbMat);
301 
308  xmlNode* ExportMaterial(FbxSurfaceMaterial *pMaterial);
309 
320  xmlNode* ExportEffect(FbxSurfaceMaterial *pMaterial, FbxString pEffectId);
321 
330  //Note why return true when failed and popped waring?
331  bool AddMaterialTextureInput(xmlNode *pXmlMaterial, FbxFileTexture *pTexture, FbxString pImageId, int pLayerIndex, int pLayerElementType);
332 
339  xmlNode* ExportTexture(FbxFileTexture *pTexture, FbxString pImageId, int pLayerIndex);
340 
346  bool ExportMeshTextures(FbxMesh *pMesh);
347 
353  xmlNode* ExportCamera(const FbxNode* pNode);
354 
360  xmlNode* ExportLight(const FbxNode* pNode);
361 
364  void ExportSceneAmbient(xmlNode * pVisualSceneElement);
365 
371  bool ExportController(FbxMesh *pMesh);
372 
378  bool ExportControllerShape(FbxMesh *pMesh);
379 
386  //Note : empty method now
387  xmlNode* ExportJointWeights(xmlNode* pXmlNode, FbxMesh* pMesh, FbxString pExt);
388 
395  bool UpdateMeshLibraryWithShapes(xmlNode* pXmlNode);
396 
402  bool ExportAnimation(FbxNode* pNode);
403 
409  bool ExportAnimationCurves(FbxNode* pNode, xmlNode* pAnimationNode);
410 
415  const FbxString ExportImage(FbxFileTexture * pTexture);
416 
428  bool ExportCurve(xmlNode* pAnimationNode, FbxAnimCurve* pCurve,
429  const char* pChannelName, const char* pSubChannelName,
430  bool pExportShape=false, bool pExportIntensity=false, bool pExportLib=false);
431 
437  bool NotZero(FbxVector4 pV);
438 
444  bool NotValue(FbxVector4 pV, double pValue);
445 
451  bool NotZero(double pD);
452 
458  bool IsTranslationAnimated(const FbxNode *pNode);
459 
465  bool IsRotationAnimated(const FbxNode *pNode);
466 
473  bool IsRotationAnimated(const FbxNode *pNode, int pAxis);
474 
480  bool IsScaleAnimated(const FbxNode *pNode);
481 
487  void CopyMesh(FbxMesh *lNewMesh, FbxMesh *lRefMesh);
488 
494  void ConvertFocalLengthCurveToFOV(FbxAnimCurve *pFOVCurve, FbxAnimCurve *pFLCurve, FbxCamera *pCamera);
495 
502  void PreprocessNodeRecursive(FbxNode* pNode);
503 
508  void ExportPropertyValue(const FbxProperty & pProperty,
509  xmlNode * pParentElement);
510 
512 
517 
521  void AddNotificationError( FbxString pError );
522 
526  void AddNotificationWarning( FbxString pWarning );
527 
529 
530  FbxFile* mFileObject;
531  FbxString mFileName;
532  bool mStatus;
533 
534  // XML lib stuff
535  //
536  xmlDocPtr mXmlDoc;
537 
538  // Scene information
539  FbxScene* mScene;
540 
541  // AnimStack/Layer holding the animation
542  FbxAnimStack* mAnimStack;
543  FbxAnimLayer* mAnimLayer;
544 
545  // Libraries
546  // NB: CODE and PROGRAM libraries are unused, so they are not created.
547  xmlNode* mLibraryAnimation;
548  xmlNode* mLibraryCamera;
549  xmlNode* mLibraryController;
550  xmlNode* mLibraryGeometry;
551  xmlNode* mLibraryImage;
552  xmlNode* mLibraryLight;
553  xmlNode* mLibraryMaterial;
554  xmlNode* mLibraryEffect;
555  xmlNode* mLibraryTexture;
556  xmlNode* mLibraryVisualScene;
557 
558  // Shape information
559  FbxStringList *mShapeMeshesList;
560 
561  // export options
562  bool mTriangulate;
563  bool mSingleMatrix;
564  FbxTime mSamplingPeriod;
565 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
566 };
567 
568 #include <fbxsdk/fbxsdk_nsend.h>
569 
570 #endif /* _FBXSDK_FILEIO_COLLADA_WRITER_H_ */
The animation layer is a collection of animation curve nodes.
Definition: fbxanimlayer.h:30
This class describes image mapping on top of geometry.
SDK object manager.
Definition: fbxmanager.h:56
The Animation stack is a collection of animation layers.
Definition: fbxanimstack.h:37
virtual bool PostprocessScene(FbxScene &pScene)
Process FBX scene after exporting FBX scene to Collada file.
Array that stores pairs of FbxString and a pointer.
This class contains material settings.
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxDocument is a base class for FbxScene and FbxLibrary classes.
Definition: fbxdocument.h:46
virtual bool PreprocessScene(FbxScene &pScene)
Process FBX scene before exporting FBX scene to Collada file.
FbxWriterCollada(FbxManager &pManager, int pID, FbxStatus &pStatus)
Constructor.
virtual ~FbxWriterCollada()
Destructor.
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:26
virtual void GetWriteOptions()
Get Collada export options settings.
Class to export FBX scene into a Collada file.
This class contains scene thumbnails and user-defined summary data.
virtual bool FileClose()
Close file.
Class to encapsulate time units.
Definition: fbxtime.h:44
Represents an element in the scene graph.
Definition: fbxnode.h:72
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
Base class of other writers used internally.
Definition: fbxwriter.h:58
virtual bool Write(FbxDocument *pDocument)
Export the FBX document to Collada file, according to the given options settings. ...
Class to hold user properties.
Definition: fbxproperty.h:37
A four double mathematic vector class.
Definition: fbxvector4.h:25
An animation curve, defined by a collection of keys (FbxAnimCurveKey), and indicating how a value cha...
Definition: fbxanimcurve.h:779
This node attribute contains methods for accessing the properties of a camera.
Definition: fbxcamera.h:34
Class for interfacing with files, providing a similar interface for files independant of the OS or fi...
Definition: fbxfile.h:27
virtual bool IsFileOpen()
Check if current file is open.
virtual bool FileCreate(char *pFileName)
Create and open file with the given name.
A mesh is a geometry made of polygons.
Definition: fbxmesh.h:32