This repo is a browser port of the Babylonjs Editor FBXLoader
a testcase of glb animation
transfer to fbx, add public async loadAssetContainer
to enable ImportAnimationsAsync
and etc.
https://metameta-libs.s3.eu-central-1.amazonaws.com/FBXLoader.js
After the import you can access to FBXLoaderModule global object and use it like this
BABYLON.SceneLoader.RegisterPlugin(new FBXLoaderModule.FBXLoader());
...
await BABYLON.SceneLoader.ImportMeshAsync(null, 'path/to', 'filename.fbx', scene);
To install va npm package manager use:
npm i babylon-fbx-loader
This will allow you to import it using:
import { FBXLoader } from 'babylon-fbx-loader';
import { SceneLoader } from "@babylonjs/core";
SceneLoader.RegisterPlugin(new FBXLoader());
...
await SceneLoader.ImportMeshAsync(null, 'path/to', 'filename.fbx', scene);
Additionally, you can install with yarn:
yarn add babylon-fbx-loader
- mainly supports geometries, bones
- partially supports materials (only standard material and no video support at the moment)
- issues with animations
- no support of morph targets
- no support of cameras and lights
The loader is in the pretty raw state, but if you need static meshes rather than dynamic it can give pretty decent results: