Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FBX SDK Can't Get FbxMesh Name!!!

1 REPLY 1
Reply
Message 1 of 2
1255798766
201 Views, 1 Reply

FBX SDK Can't Get FbxMesh Name!!!

As the title suggests, I am unable to obtain the name of FbxMesh through GetName(), and there is no additional explanation in the documentation. I saw from VS that the obtained string is an empty string, and through

node->GetName(), only "RootNode" can be obtained, but FbxMesh ->GetName() remains empty.

1255798766_0-1723489007520.png

1255798766_1-1723489024328.png

1255798766_3-1723489168920.png

 

1 REPLY 1
Message 2 of 2
regalir
in reply to: 1255798766

Hi,

 

In the FBX SDK, the name property on the FbxNodeAttribute objects (FbxMesh, FbxCamera, FbxLight, etc.) is not mandatory and, therefore, it is up to the application that create the FBX scene to decide if it wants to put a name on them or not! Typically, the name is specified in the FbxNode object that "owns" the FbxNodeAttribute (rarely on the FbxNodeAttribute itself). However, since the name is not really enforced anywhere in the FBX, someone may still decide to not fill this property of the FbxNode. This is not very practical and can definitely cause some issue , but it is still doable 😉

In your code snippet, you should probably do something like this:

FbxNode* child = node->GetChild(i);
FbxMesh* mesh = child->GetMesh();
const char* n = child->GetName();
const char* mn = nullptr;
if (mesh) mn = mesh->GetName();

if (strlen(mn) > 0) { // there is a true name on the FbxMesh object
     ...
}
...

If the node correctly have a name (in 99.9% of the cases it will), then you will be able to get it with 'n' despite the fact that 'mn' remains empty!


In your exact case, I don't know where the FBX data is coming from but if you cannot get a name even with child->GetName() then you definitely have a scene that did not name its objects!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report