Having trouble opening a model in the playground

Hello. I writing a program locally and able to load these models without any issues. I was stuck on shadow casting and I was going to make a playground example to use when asking a question here.

But in doing that I found that I am now having issues linking to my example .glb assets from Git.

I am wondering if it is possibly related to git lfs. I see the below text when I visit the URL directly:

version https://git-lfs.github.com/spec/v1
oid sha256:641a070933ae15383a5d4db55d8874dea444355f634e658d376b218b97534972
size 9491580

URL: https://raw.githubusercontent.com/rootVIII/models/master/wet_intersection.glb

I am using following the example at Using External Assets In the Playground | Babylon.js Documentation for reference.

playground example

And here is the code from that playground just in case:

const createScene = function () {

    const scene = new BABYLON.Scene(engine);

    const camera = new BABYLON.ArcRotateCamera("camera", -Math.PI / 2, Math.PI / 2.5, 15, new BABYLON.Vector3(0, 0, 0));
    camera.attachControl(canvas, true);
    const light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(1, 1, 0));


    BABYLON.SceneLoader.ImportMeshAsync(
        null,
        "https://raw.githubusercontent.com/rootVIII/models/master/",
        "wet_intersection.glb"
    ).then((result) => {
        console.log(result);
        result.meshes[0].position = new Vector3(0.0, 0.0, 0.0);
        result.meshes[0].scaling = new Vector3(0.1, 0.1, 0.1);
    });

    return scene;
};

I get an error in the JS console:

 RuntimeError: Unexpected magic: 1936876918
    at t 

Thanks for the help!

find model

After editing my answer a few times (I deleted it because I thought it was misdirected), I realized that my initial reaction was correct: GLT-LTS was causing the problem.
Can you put the original unmodified GLB into git?
Everything else you had done was correct.

3 Likes

Yep thanks for taking the time to look. That fixed it!

1 Like