Jump to content

if extension != ".gltf" then fail to load


cx20
 Share

Recommended Posts

This is the version v2.4.0 and later of the problem.

"halloween.gltf" was successful in loading. However, "halloween_gltf.txt" was failed in loading. 

BABYLON.SceneLoader.Load("./", "halloween_gltf.txt", engine, function (newScene) {

Version v2.3.0 previously did not have a problem.

 

I will sometimes post jsdo.it the JavaScript code. jsdo.it is a coding community for JavaScript users.

File name is changed to when registering the assets in jsdo.it.

http://jsdo.it/cx20/Ygfv

BABYLON.SceneLoader.Load("/assets/0/2/I/8/", "02I89", engine, function (newScene) {

 

Because I want to post a sample of Babylon.js to jsdo.it in future, I hope that this problem is resolved.

 

Link to comment
Share on other sites

Deltakosh san Thanks for the advice.

I understood that Babylon.js sees extensions to determine plugins.

I tried the following changes, and I was able to load the gltf file with jsdo.it.

http://jsdo.it/cx20/20ju

The jsdo.it recognizes the extension of some image files.  (but, extension gltf is not supported.)

I changed the extension ".gltf" to ".png" and registered in jsdo.it, and I fixed gltf Loader of Babylon.js as follows.

    function GLTFFileLoader() {
        /**
        * Public members
        */
        this.extensions = {
            ".png": { isBinary: false }, // Add (dummy extension)
            ".gltf": { isBinary: false },
            ".glb": { isBinary: true }
        };
    }

I think that it is a problem of jsdo.it that the extension gltf is not recognized.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...