#include "MyOwnWriter.h"
MyOwnWriter::MyOwnWriter(
FbxManager &pManager,
int pID):
mManager(&pManager)
{
}
MyOwnWriter::~MyOwnWriter()
{
FileClose();
}
bool MyOwnWriter::FileCreate(char* pFileName)
{
{
FileClose();
}
FBXSDK_fopen(mFilePointer,pFileName,"w");
{
return false;
}
return true;
}
bool MyOwnWriter::FileClose()
{
{
fclose(mFilePointer);
return true;
}
return false;
}
bool MyOwnWriter::IsFileOpen()
{
return true;
return false;
}
void MyOwnWriter::GetWriteOptions()
{
}
{
if (!pDocument)
{
return false;
}
FbxScene* lScene = FbxCast<FbxScene>(pDocument);
bool lIsAScene = (lScene !=
NULL);
bool lResult = false;
if(lIsAScene)
{
PreprocessScene(*lScene);
FBXSDK_printf("I'm in my own writer\n");
PrintHierarchy(lRootNode);
PostprocessScene(*lScene);
lResult = true;
}
return lResult;
}
void MyOwnWriter::PrintHierarchy(
FbxNode* pStartNode)
{
const char* lParentName = pStartNode->
GetName();
{
const char* lChildName = lChildNode->
GetName();
FBXSDK_fprintf(mFilePointer,"%s%s%s%s%s%s%s","\"",lChildName,"\"",", parent is ","\"",lParentName,"\"\n");
}
while (lNodeChildCount > 0)
{
lNodeChildCount--;
lChildNode = pStartNode->
GetChild (lNodeChildCount);
PrintHierarchy(lChildNode);
}
}
bool MyOwnWriter::PreprocessScene(
FbxScene& )
{
FBXSDK_printf("I'm in pre-process\n");
return true;
}
bool MyOwnWriter::PostprocessScene(
FbxScene& )
{
FBXSDK_printf("I'm in post process\n");
return true;
}