I am following this tutorial on babylon.js and managed to export a .babylon file, but when I load it with:
SceneLoader.ImportMesh('meshName-01', './scenes/', 'character01.babylon', scene, sceneLoadedCallback)
The SceneLoadedCallback function gets an empty array for skeletons and newMeshes, according to this example I expected skeletons to be populated.
Some background information:
- To export from Blender I use the plugin BlenderToBabylon Exporter version 3.3
- Im running Babylon v5.27.1 on Ubuntu, building with webpack 5.53 although babylon assets are just copied to the dist folder
- When exporting from Blender I did not check "Export only selected objects"
- In Blender, all objects in the Scene Collection are visible and I am able to play animations on the character.
- The babylon code is written on JS, there are no warnings or errors, the callback function is executed fine (it has only a console.log but it works fine).
- The exported babylon file is around 5 MBs big, which seems ok since the downloaded assets from Mixamo are around 2.5 MBs combined (ybot + animation punching + animation block)
- Here is a chunk of the implementing code:
const canvas = document.getElementById(container_id)
const engine = new Engine(canvas)
const scene = new Scene(engine)
const camera = new FreeCamera('camera1', new Vector3(0, 5, -10), scene)
camera.setTarget(Vector3.Zero())
camera.attachControl(canvas, true)
const light = new HemisphericLight('light1', new Vector3(0, 1, 0), scene)
SceneLoader.ImportMesh('meshName-01', './scenes/', 'character01.babylon', scene, sceneLoadedCallback)
function sceneLoadedCallback(newMeshes, particleSystems, skeletons) {
console.log('sceneLoadedCallback', {newMeshes, skeletons})
}
Have I done something wrong that causes the skeletons to be empty? maybe I did a bad export from blender? a bad import on babylon code?