Hi,
I think I've found a bug when using FBX 2015.1 (Windows, VS2012) SDK, when I try to import an .fbx file that contains user data, the names returned are uninitialized memory.
To narrow this down, I could easily reproduce my problem using the attached .fbx file and by adding some code to the ImportScene FBX sample that comes with the SDK. When I run the sample in debug mode, I get output that looks like this (where (garbage) is uninitialized memory):
Mesh Name: box
User Data
Layer 0, Array 0:
Data Name: (garbage)
Data Type: Float
Layer 0, Array 1:
Data Name: (garbage)
Data Type: Float
Layer 0, Array 2:
Data Name:
Data Type: Float
Layer 0, Array 3:
Data Name: (garbage)
Data Type: Float
Layer 0, Array 4:
Data Name: P_3
Data Type: Float
Here's the simple method that I added to the ImportScene example:
// Call this from ImportScene's DisplayMesh()
// method in DisplayMesh.cxx
void DisplayUserData(FbxMesh* pMesh) { DisplayString(" User Data"); for (int i = 0, nlayers = pMesh->GetLayerCount(); i < nlayers; ++i) { FbxLayer *layer = pMesh->GetLayer(i); if (!layer) continue; FbxLayerElementUserData *user = layer->GetUserData(); if (!user) continue; for (int j = 0, narray = user->GetDirectArrayCount(); j < narray; ++j) { FBXSDK_printf(" Layer %d, Array %d:\n", i, j); FBXSDK_printf(" Data Name: %s\n", user->GetDataName(j)); FBXSDK_printf(" Data Type: %s\n", user->GetDataType(j).GetName()); } } }
Any help appreciated!
Thanks!
Can't find what you're looking for? Ask the community or share your knowledge.