SceneLoader.ImportMesh onSuccess callback function return empty mesh, particleSystems etc

Hi,

I downloaded the “dummy2.babylon” file and tried to import it with ImportMesh function but nothing showed up. So I put some console log into onSuccess callback as follow:

BABYLON.SceneLoader.ImportMesh("dummy", "./src/babylonModels/", "dummy2.babylon", this._scene,
            (meshes, particleSystems, skeletons, animationGroups) => {
                console.log("onSuccess");
                console.log("meshes", meshes);
                console.log("particleSystems", particleSystems);
                console.log("skeletons", skeletons);
            },
            (event1) => {
                console.log("onProgress");
            },
            (scene1, message, exception) => {
                console.log("onError");
            })

The console output:

onProgress
onSuccess
meshes []
particleSystems []
skeletons []

I changed several different .babylon files, none of them work. But if I throw them into the babylon sandbox, they all showed up correctly.

Any idea what I do wrong here?
Thanks!

try to remove “dummy” :slight_smile:

BABYLON.SceneLoader.ImportMesh("", …

if no success, can you make a playground? playground.babylonjs.com

Ah, I see, it’s a group of meshes so a single string here is not sufficient.

It works, Thanks man!

1 Like

no problem :slight_smile:

it can also be an array of names, but if the names don’t match the names within the file, they’ll be filtered out and not imported