AssetStudio/AssetStudioFBX/AssetStudioFBX.h

87 lines
2.5 KiB
C
Raw Normal View History

2018-04-06 23:51:33 +00:00
#pragma once
2019-07-15 20:33:37 +00:00
#include <fbxsdk.h>
2018-04-06 23:51:33 +00:00
#ifdef IOS_REF
#undef IOS_REF
#define IOS_REF (*(pSdkManager->GetIOSettings()))
#endif
using namespace System;
using namespace System::Collections::Generic;
using namespace System::IO;
#define WITH_MARSHALLED_STRING(name,str,block)\
{ \
char* name; \
try \
{ \
2019-07-15 21:32:54 +00:00
name = StringToUTF8(str); \
2018-04-06 23:51:33 +00:00
block \
} \
finally \
{ \
2019-07-15 21:32:54 +00:00
delete name; \
2018-04-06 23:51:33 +00:00
} \
}
2018-09-13 12:52:17 +00:00
static char* FBXVersion[] =
{
FBX_2010_00_COMPATIBLE,
FBX_2011_00_COMPATIBLE,
FBX_2012_00_COMPATIBLE,
FBX_2013_00_COMPATIBLE,
2018-10-07 11:38:07 +00:00
FBX_2014_00_COMPATIBLE,
FBX_2016_00_COMPATIBLE
2018-09-13 12:52:17 +00:00
};
2018-04-06 23:51:33 +00:00
namespace AssetStudio {
public ref class Fbx
{
public:
static Vector3 QuaternionToEuler(Quaternion q);
static Quaternion EulerToQuaternion(Vector3 v);
2019-07-15 21:32:54 +00:00
static char* StringToUTF8(String^ s);
2018-09-13 12:52:17 +00:00
static void Init(FbxManager** pSdkManager, FbxScene** pScene);
2018-04-06 23:51:33 +00:00
ref class Exporter
{
public:
2019-07-28 10:55:08 +00:00
static void Export(String^ path, IImported^ imported, bool eulerFilter, float filterPrecision,
bool allNodes, bool skins, bool animation, bool blendShape, bool castToBone, float boneSize, float scaleFactor, int versionIndex, bool isAscii);
2018-04-06 23:51:33 +00:00
private:
bool exportSkins;
float boneSize;
IImported^ imported;
2019-07-15 20:33:37 +00:00
HashSet<String^>^ framePaths;
Dictionary<ImportedFrame^, size_t>^ frameToNode;
List<ImportedFrame^>^ meshFrames;
2018-04-06 23:51:33 +00:00
char* cDest;
FbxManager* pSdkManager;
FbxScene* pScene;
FbxExporter* pExporter;
FbxArray<FbxSurfacePhong*>* pMaterials;
FbxArray<FbxFileTexture*>* pTextures;
2019-03-06 20:50:36 +00:00
FbxPose* pBindPose;
2018-04-06 23:51:33 +00:00
2019-07-28 10:55:08 +00:00
Exporter(String^ name, IImported^ imported, bool allNodes, bool skins, bool castToBone, float boneSize, float scaleFactor, int versionIndex, bool isAscii);
2018-04-06 23:51:33 +00:00
~Exporter();
2018-12-24 00:28:26 +00:00
void Exporter::LinkTexture(ImportedMaterialTexture^ texture, FbxFileTexture* pTexture, FbxProperty& prop);
2019-07-15 20:33:37 +00:00
void SetJointsNode(ImportedFrame^ frame, HashSet<String^>^ bonePaths, bool allBones);
2018-04-06 23:51:33 +00:00
HashSet<String^>^ SearchHierarchy();
void SearchHierarchy(ImportedFrame^ frame, HashSet<String^>^ exportFrames);
void SetJointsFromImportedMeshes(bool allBones);
void ExportFrame(FbxNode* pParentNode, ImportedFrame^ frame);
2019-08-06 01:48:21 +00:00
void ExportMesh(FbxNode* pFrameNode, ImportedMesh^ iMesh);
2018-12-24 00:28:26 +00:00
FbxFileTexture* ExportTexture(ImportedTexture^ matTex);
2019-07-16 05:21:32 +00:00
void ExportAnimations(bool eulerFilter, float filterValue);
void ExportKeyframedAnimation(ImportedKeyframedAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* eulerFilter, float filterPrecision);
void ExportMorphs();
2018-04-06 23:51:33 +00:00
};
};
}