dart_fbx icon indicating copy to clipboard operation
dart_fbx copied to clipboard

Fbx crash when the pose is null

Open klaszlo8207 opened this issue 5 years ago • 1 comments

in the FbxMesh class I found an error:

in lne 178:

final refGlobalInitPos = pose.getMatrix(meshNode);

when the pose is null, you get an exception

    var refGlobalInitPos;

    if (pose == null) refGlobalInitPos = new Matrix4.identity();
    else refGlobalInitPos = pose.getMatrix(meshNode);

this is how I fix that

Also I can now convert a binary FBX file to an ASCII FBX file, that can handle your parser perfectly, I will make a WIKI page for that in my repo: https://github.com/klaszlo8207/Flutter-FBX-3D-Viewer

But in short:

1, u download an fbx animated file from turbosquid (rigged + animated) 2, in MotionBuilder 2020 u open that file 3, u export it via: Python tools->FBX Exporter (FBX 2014/2015) 4, save with a filename 5, on the next dialog u want to tilt the Settings all items, and on the Scene cameras fields (Element, Animation)

Now SAVE

After that in some reason the POSE will be NOTHING, and that is the probleme (pose.getMatrix will be called on NULL)

With my FIX the animation working like a charm

klaszlo8207 avatar Jan 19 '20 12:01 klaszlo8207

I updated my repo, So here is the steps:

Convert an FBX binary file to an FBX ASCII file that can this library handle

1, First step is to download an animated/rigged fbx binary file from the net:

https://www.turbosquid.com/3d-models/free-female-character-rigged-biped-3d-model/569036

Lets see this model. (you will download Mixamo-Joan_InjuredWalkAnimation.fbx Autodesk FBX - 4.22 MB)

2, Second is to load that modell with AUTODESK MotionBuilder 2020

You just drop you file to your MotionBuilder then FBX Open -> mixamo.com

3, Python Tools -> FBX Export on the MotionBuilder

FBX Version: FBX 2014/2015 -> Export

SAVE -> .fbx (ASCII)

Embed medias checked only

Save options:

Remove: (Settings)

Base Cameras

Camera switchers

Current camera

Global Lighting

Transport

Remove: (Scene)

Cameras (all)

Textures (all)

Video

4, SAVE

Now if everything is went good in the fbx file header you can see this: ; FBX 7.4.0 project file

klaszlo8207 avatar Jan 19 '20 12:01 klaszlo8207