#ifndef DUST3D_FBX_FILE_H #define DUST3D_FBX_FILE_H #include #include #include #include #include #include #include "outcome.h" #include "document.h" class FbxFileWriter : public QObject { Q_OBJECT public: FbxFileWriter(Outcome &outcome, const std::vector *resultRigBones, const std::map *resultRigWeights, const QString &filename, QImage *textureImage=nullptr, QImage *normalImage=nullptr, QImage *metalnessImage=nullptr, QImage *roughnessImage=nullptr, QImage *ambientOcclusionImage=nullptr, const std::vector>>> *motions=nullptr); bool save(); private: void createFbxHeader(); void createCreationTime(); void createFileId(); void createCreator(); void createGlobalSettings(); void createDocuments(); void createReferences(); void createDefinitions(size_t deformerCount, size_t textureCount=0, size_t videoCount=0, bool hasAnimtion=false, size_t animationStackCount=0, size_t animationLayerCount=0, size_t animationCurveNodeCount=0, size_t animationCurveCount=0); void createTakes(); std::vector matrixToVector(const QMatrix4x4 &matrix); void quaternionToFbxEulerAngles(const QQuaternion &q, double *pitch, double *yaw, double *roll); int64_t secondsToKtime(double seconds); int64_t to64Id(const QUuid &uuid); int64_t m_next64Id = 612150000; QString m_filename; QString m_baseName; fbx::FBXDocument m_fbxDocument; std::map m_uuidTo64Map; static std::vector m_identityMatrix; }; #endif