Babylon VRM Demo Does Not Work

Hi Everyone,

I am trying to use the bablyon.js library with vrm loader demo on CodePen. However, when I upload a .vrm it does not load. I receive the error "“BJS - [12:21:19]: Unable to load from file:Sendagaya_Shibu.vrm: e.getScene is not a function”. I also try it locally on my machine and I receive the same error.
"
CodePen Link Below.

I looked at this for a while without a solution. I suspect it is somehow related to how JS is being loaded and/or version mismatches between babylon and the 3rd party libraries, but I’m not positive. In case it helps though:

I noticed the underlying error is a little clearer when SceneLoader.AppendAsync is used. That shows a stacktrace like this:

index.js:16 Uncaught (in promise) TypeError: b.DetailMapConfiguration
is not a constructor
    at new t (VM510 index.js:16:6860)
    at e.createMaterialByShader (VM510 index.js:31:12767)
    at e.generate (VM510 index.js:31:10726)
    at e._loadMaterialAsync (VM510 index.js:31:16080)
    at babylonjs.loaders.min.js:1:43555
    at e._applyExtensions (babylonjs.loaders.min.js:1:42238)
    at e._extensionsLoadMaterialAsync (babylonjs.loaders.min.js:1:43477)
    at e._loadMaterialAsync (babylonjs.loaders.min.js:1:31660)
    at e._loadMeshPrimitiveAsync (babylonjs.loaders.min.js:1:14932)
    at e._loadMeshAsync (babylonjs.loaders.min.js:1:13224)

So something about the DetailMapConfiguration constructor signature is not as expected in the material that is being loaded. That would generally indicate a version mismatch, but I tried with Babylon 4.2.1 as well, and same error.

Note that simply loading underlying material being used directly results in the same error. You can see that in this PG:

According to the source repo, it should work with babylon-mtoon-material-3.0.0 and babylon-4.2.0.

I think from another thread that @il-m-yamagishi is working on an update for the VRM loader.

Thanks. I will try the older versions as recommended. Really trying to avoid using three.js as I read their documentation is quite poor.

3 Likes

your answer will make @Deltakosh @RaananW and @PirateJC pretty happy

4 Likes

Hello @dalow24 just checking in if you still have an issue :slight_smile:

Hi all! It doesn’t work for me either. All examples from the documentation also do not work.

https://doc.babylonjs.com/extensions/Babylon.js+ExternalLibraries/BabylonJS_and_VRM

Unfortunately this is a community plugin

Maybe @Limes2018 can help?

Hi @Nawar and @Deltakosh
I searched past forum posts and npm official page. These are tips.

Babylon VRM Demos no longer works - Bugs - Babylon.js (babylonjs.com)

babylon-vrm-loader - npm (npmjs.com)

babylon.js version babylon-vrm-loader version
~4.1.0 <1.5.0
~4.2.0 ^1.5.0
~5.0.0 unreleased(will be ^1.6.0)

I modified the two PG in the official documents like this. It works.

babylon-vrm-loader | Babylon.js Playground (babylonjs.com)

babylon-vrm-loader | Babylon.js Playground (babylonjs.com)

If you have any comments or suggestions, it would be helpful. > @il-m-yamagishi

3 Likes

Hi. Thanks for the answer!

I get this error:

Hi @Nawar

If you try my temporary countermeasure, you should change Babylon.js version on the Playground setting.

Not use “LATEST” (= 5.9.0), but use “4.2.1”.

Hope it works on your environment.

1 Like

Oh! Sorry I didn’t notice this.

Yes it works. When will he start working with babylon 5?

Congrat!

I’m sorry to say that I don’t know when it works on BJS 5. The core contributor seems to be busy for a while.

1 Like

Thank you limes. I and collegue are working on the support Babylon.js 5.x for babylon-vrm-loader.

babylon-mtoon-material has finished upgrading. We will work babylon-vrm-loader version up next week. Please stand by for next version(it may causes to crash backward compatibility).

2 Likes