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: