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 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: