I believe BJS scene serializer (.babylon) no longer works properly for scenes with skeletons?
Here’s a PG
I exported it and stored it in the comment here
The output is a cube O.o
I believe BJS scene serializer (.babylon) no longer works properly for scenes with skeletons?
Here’s a PG
I exported it and stored it in the comment here
The output is a cube O.o
Can you make sure to clear your cache maybe?
Ok so I just tested it in Sandbox and yea it works, any reason why it doesn’t work normally with SceneLoader.ImportMesh?
I can confirm this issue happens locally too, even if I change filename etc (so I know it’s not a cache issue)
I am not able to repro in the playground either.
can you repro your loading code in the pG?
Oh sorry about that, I’ve updated the PG
It imports the exported .babylon file (I put it into my github folder), and you can see the output is a cube
The .babylon file content should be correct because the console.log(skeleton) shows that it’s the mixamo skeleton
We are seeing the environment box there
Here is the file I exported with your initial PG, you can drop it there: sandbox.babylonjs.com
scene.zip (2.4 MB)
Yea I know, the sandbox works well
But I don’t think the ImportMesh function works the same since I’m not seeing the same thing in the PG vs sandbox
Or perhaps I should use another function for importing .babylon files?
importMesh and Append are based on the same code. ImportMesh does not import the camera so you do not have the same position of course
As you want to import more than meshes I would recommend using Append in your case:
Simple Dude.babylon import and animation playing | Babylon.js Playground (babylonjs.com)
Code for reference:
var delayCreateScene = async function () {
var scene = new BABYLON.Scene(engine);
var myExportFile = "https://raw.githubusercontent.com/mrlooi/Data/master/dummy3_exported_5rc7.babylon"
await BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/mrlooi/Data/master/", "dummy3_exported_5rc7.babylon", scene);
scene.beginAnimation(scene.skeletons[0], 0, 100, true, 1.0);
scene.activeCamera.attachControl();
return scene;
};
If you are going to load everything in the file, then Append is better than ImportMesh. ImportMesh must assume that there are multiple meshes, materials, & skeletons. It spends time getting just the stuff required. If everything ends up being required, then the checking is just a waste of time.
Oh nice did not know the nuances of this, since the docs recommended ImportMesh for .babylon files (i.e. those are the top results on google search)
Thank you so much!
Perhaps Append should be the default in all docs, esp if what JC says is true re ImportMesh