In my experience, any .glb file is fine for importing models and materials.
But it is not so easy for animation data. Of course, the simplest way is to drop your .fbx animation to the Editor and download the .glb. It is working great, but you need to be online and upload/download a lot of data.
Unfortunately, it is impossible to export the .glb file directly from 3Ds Max or other mainstream software with DS Max BabylonJS exporter. I had tried it and got this error:
Uncaught TypeError: Cannot read property 'split' of undefined
at GraphNode.findByPath (playcanvas-stable.dbg.js:13714)
at DefaultAnimBinder.resolve (playcanvas-stable.dbg.js:36825)
at AnimEvaluator.addClip (playcanvas-stable.dbg.js:36506)
at AnimationComponent.play (playcanvas-stable.dbg.js:37210)
at scriptType.<anonymous> (loadSkinned.js?id=41492581&branchId=f4563652-f47f-4afd-add0-666fb786cf57:17)
It seems like the file structure is different from Babylon’s .glb.
So, the only suitable software to export animation .glb files that I found is Blender 2.82+.
Now I am following those steps:
- Create the animation in the MotionBuilder, save as .fbx
- Import .fbx to 3Ds Max, export as .glb with BabylonJS plugin (because Blender is bad at importing .fbx).
- Import the .glb to Blender, export to “proper” .glb
Is it really the best pipeline for animation files? Is there a simpler way?
Hi @Dan_Organ,
I don’t have experience with other modelling suites, but I can verify that exporting from Blender works fine both for regular models and animations.
1 Like
Hi @Dan_Organ,
I’m going to investigate this. Do you have a repro I can take a look at? A PlayCanvas project with the particular assets you tried in it would be great.
Thanks!
2 Likes
Hi @Dan_Organ,
I’ve tried testing these assets in various online glTF viewers and none of them seem to be able to play the test_pose.glb asset accurately. This https://gltf-viewer.donmccurdy.com/ viewer in particular may be able to point you in the direction of what could be going wrong as it provides a validation report.
I’m updating the animation system to fix the crash that you were experiencing with this asset, which will be fixed in the next version of the engine. However the asset in it’s current form will not play as expected.
2 Likes
Thanks.
test_pose.glb does not have anything in it except for bone nodes and 2 animation frames for each of them.
I’d tried to import it to blender 2.82, it loaded successfully. But it is strange, there are a lot of animation tracks, one individual track for each node:
It is probably a bug in the BabylonJS exporter. If I’ll have time, I’ll try another version of it.
I tried babylonjs plugin to export a simple animated model but it just give me a static model and the motion didn’t appear!
How can I fix that?
I made a simple cylinder and gave a ffd modifier to deform and made a 100 frames motion with that but when I dropped it on threejs it didn’t move anymore.
The BabylonJS plugin is not very stable. I would recommend you to try an older version of it.
Also, you can’t animate ffd modifiers if you want to export in to .glb. You must bake it to a blendshape.
1 Like