I tried reducing memory usage for animation in an Unity3D.
So I removed some needless properties( like local scaling and local translation ) in nodes.
int nodecount = pScene->GetNodeCount();
for( int i = 0; i < nodecount; i++ )
{
FbxNode* node = pScene->GetNode( i );
bool ignoreThisBone = false;
auto pos = ignoringBoneNames.begin();
while( pos != ignoringBoneNames.end() )
{
std::string nodeName = node->GetName();
std::transform( nodeName.begin(), nodeName.end(), nodeName.begin(), tolower );
if( ( -1 != nodeName.find( "bip" ) ) && ( -1 != nodeName.find( ( *pos ).c_str() ) ) )
{
OutputDebugString( ( nodeName + " is ignored!!!\n" ).c_str() );
ignoreThisBone = true;
break;
}
++pos;
}
if( ignoreThisBone )
{
node->LclScaling.Destroy();
node->LclTranslation.Destroy();
}
}
When I exported it first time. It was OK.
But I re-imported the exported FBX, then did same job. But exporting failed with Access Violation.
Exception thrown at 0x00007FFBCD7E85EC (libfbxsdk.dll) in FbxOptimizer.exe: 0xC0000005: Access violation reading location 0x0000000000000028.
Why destroying exported FBX's properties occurs an exception?
What could I solve this problem.