Separate code

Delete some useless code
This commit is contained in:
Perfare
2018-04-11 23:45:39 +08:00
parent 500f7788d4
commit e3a0ab4e4a
12 changed files with 1210 additions and 1220 deletions

View File

@ -41,11 +41,7 @@ namespace AssetStudio {
private:
HashSet<String^>^ frameNames;
HashSet<String^>^ meshNames;
bool EulerFilter;
float filterPrecision;
bool exportSkins;
bool embedMedia;
float boneSize;
IImported^ imported;
@ -72,39 +68,11 @@ namespace AssetStudio {
void ExportMesh(FbxNode* pFrameNode, ImportedMesh^ meshList, bool normals);
FbxFileTexture* ExportTexture(ImportedTexture^ matTex, FbxMesh* pMesh);
void ExportAnimations(bool EulerFilter, float filterValue, bool flatInbetween);
void ExportKeyframedAnimation(ImportedKeyframedAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* EulerFilter, float filterPrecision,
FbxPropertyT<FbxDouble3>& scale, FbxPropertyT<FbxDouble4>& rotate, FbxPropertyT<FbxDouble3>& translate, List<String^>^ pNotFound);
void ExportSampledAnimation(ImportedSampledAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* EulerFilter, float filterPrecision, bool flatInbetween,
FbxPropertyT<FbxDouble3>& scale, FbxPropertyT<FbxDouble4>& rotate, FbxPropertyT<FbxDouble3>& translate, List<String^>^ pNotFound);
void ExportKeyframedAnimation(ImportedKeyframedAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* EulerFilter, float filterPrecision, List<String^>^ pNotFound);
void ExportSampledAnimation(ImportedSampledAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* EulerFilter, float filterPrecision, bool flatInbetween, List<String^>^ pNotFound);
void ExportMorphs(IImported^ imported, bool morphMask, bool flatInbetween);
};
private:
ref class InterpolationHelper
{
private:
FbxScene * pScene;
FbxAnimLayer* pAnimLayer;
FbxAnimEvaluator* pAnimEvaluator;
FbxAnimCurveDef::EInterpolationType interpolationMethod;
FbxAnimCurveFilterUnroll* lFilter;
float filterPrecision;
FbxPropertyT<FbxDouble3>* scale, *translate;
FbxPropertyT<FbxDouble4>* rotate;
FbxAnimCurve* pScaleCurveX, *pScaleCurveY, *pScaleCurveZ,
*pRotateCurveX, *pRotateCurveY, *pRotateCurveZ, *pRotateCurveW,
*pTranslateCurveX, *pTranslateCurveY, *pTranslateCurveZ;
array<FbxAnimCurve*>^ allCurves;
public:
static const char* pScaleName = "Scale";
static const char* pRotateName = "Rotate";
static const char* pTranslateName = "Translate";
};
static char* StringToCharArray(String^ s);
static void Init(FbxManager** pSdkManager, FbxScene** pScene);
};

View File

@ -21,14 +21,6 @@ namespace AssetStudio
}
if (pTextures != NULL)
{
if (embedMedia)
{
for (int i = 0; i < pTextures->GetCount(); i++)
{
FbxFileTexture* tex = pTextures->GetAt(i);
File::Delete(gcnew String(tex->GetFileName()));
}
}
delete pTextures;
}
if (pExporter != NULL)

View File

@ -675,10 +675,6 @@ namespace AssetStudio
List<String^>^ pNotFound = gcnew List<String^>();
FbxPropertyT<FbxDouble3> scale = FbxProperty::Create(pScene, FbxDouble3DT, InterpolationHelper::pScaleName);
FbxPropertyT<FbxDouble4> rotate = FbxProperty::Create(pScene, FbxDouble4DT, InterpolationHelper::pRotateName);
FbxPropertyT<FbxDouble3> translate = FbxProperty::Create(pScene, FbxDouble3DT, InterpolationHelper::pTranslateName);
FbxAnimCurveFilterUnroll* lFilter = EulerFilter ? new FbxAnimCurveFilterUnroll() : NULL;
for (int i = 0; i < importedAnimationList->Count; i++)
@ -702,12 +698,12 @@ namespace AssetStudio
if (keyframed)
{
ImportedKeyframedAnimation^ parser = (ImportedKeyframedAnimation^)importedAnimation;
ExportKeyframedAnimation(parser, kTakeName, lFilter, filterPrecision, scale, rotate, translate, pNotFound);
ExportKeyframedAnimation(parser, kTakeName, lFilter, filterPrecision, pNotFound);
}
else
{
ImportedSampledAnimation^ parser = (ImportedSampledAnimation^)importedAnimation;
ExportSampledAnimation(parser, kTakeName, lFilter, filterPrecision, flatInbetween, scale, rotate, translate, pNotFound);
ExportSampledAnimation(parser, kTakeName, lFilter, filterPrecision, flatInbetween, pNotFound);
}
}
@ -722,8 +718,7 @@ namespace AssetStudio
}*/
}
void Fbx::Exporter::ExportKeyframedAnimation(ImportedKeyframedAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* EulerFilter, float filterPrecision,
FbxPropertyT<FbxDouble3>& scale, FbxPropertyT<FbxDouble4>& rotate, FbxPropertyT<FbxDouble3>& translate, List<String^>^ pNotFound)
void Fbx::Exporter::ExportKeyframedAnimation(ImportedKeyframedAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* EulerFilter, float filterPrecision, List<String^>^ pNotFound)
{
List<ImportedAnimationKeyframedTrack^>^ pAnimationList = parser->TrackList;
@ -834,8 +829,7 @@ namespace AssetStudio
}
}
void Fbx::Exporter::ExportSampledAnimation(ImportedSampledAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* EulerFilter, float filterPrecision, bool flatInbetween,
FbxPropertyT<FbxDouble3>& scale, FbxPropertyT<FbxDouble4>& rotate, FbxPropertyT<FbxDouble3>& translate, List<String^>^ pNotFound)
void Fbx::Exporter::ExportSampledAnimation(ImportedSampledAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* EulerFilter, float filterPrecision, bool flatInbetween, List<String^>^ pNotFound)
{
List<ImportedAnimationSampledTrack^>^ pAnimationList = parser->TrackList;