Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Detect whether FBX is animated or not in backend application

Anonymous

Detect whether FBX is animated or not in backend application

Anonymous
Not applicable

Dear FBX Community,


We have a backend that is working with different  filetypes. For instance, a non-animated FBX file, is sent off to Forge. However, animated FBX files need to be processed differently. 

 

Is there an easy way to detect on a web Backend whether a FBX file is animated or not (ideally without installing the NodeJS FBX SDK)? 

 

 

Thanks,

 

Max

0 Likes
Reply
514 Views
1 Reply
Reply (1)

regalir
Autodesk
Autodesk

Hi, I don't know what the "NodeJS FBX SDK" is but, generally speaking, in the C++ FBX SDK library you can query how many objects of a certain type are present in the scene. Technically, you could simply look for FbxAnimStack objects and if there are none, then it is certain that the FBX file is not animated. However, you may get some files where an FbxAnimStack is present but there is actually nothing animated (no animation curves) so it is better to look how many FbxAnimCurve objects are in the scene:

 

FbxScene* lScene = ....

if (lScene->GetSrcObjectCount<FbxAnimCurve>() == 0) ... // nothing animated

 

An even more precise test (but more time consuming), consists in calling FbxAnimUtilities::IsAnimated(obj) on every object of the scene:

 

bool isAnimated = False;

for (int i = 0; i < lScene->GetSrcObjectCount(); i++)

{

    isAnimated |= FbxAnimUtilities::IsAnimated(lScene->GetSrcObject(i))

}

0 Likes