Vrm Uncaught TypeError: Cannot create property 'CAMERA_ORTHOGRAPHIC' on boolean 'false'

Hello and thank you for being a member of the community!
If you want to report a bug, please make sure to share a repro on the forum:


var canvas = document.getElementById("renderCanvas");
var engine = new BABYLON.Engine(canvas, true);
const vrmLoaderScript = document.createElement('script');
vrmLoaderScript.src = '../../common/js/babylon-vrm-loader/dist/index.js';

/******* Add the create scene function ******/

var createScene = function () {
    // Create a scene.
    var scene = new BABYLON.Scene(engine);
    var camera = myArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 2, new BABYLON.Vector3(0, 1, 0), scene);
    camera.attachControl(canvas, true);
    var objHemisphericLight = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene);
    objHemisphericLight.intensity = 1;

    vrmLoaderScript.onload = () => {
        // BABYLON.SceneLoader.Append('./', 'AliciaSolid_vrm-0.51.vrm', scene, () => {
        //     console.log("scene", scene);
        // });
        BABYLON.SceneLoader.Append('https://www.3dyzt.com/', 'AliciaSolid_vrm-0.51.vrm', scene, () => {
            console.log("scene", scene);
    return scene;

/******* End of the create scene function ******/

//Call the createScene function
var scene = createScene();
engine.runRenderLoop(function() {
window.addEventListener("resize", function () {

bug demo

cc @il-m-yamagishi and @Spencer17x in case they have a solution for this.

1 Like

It looks like @sebavan made some changes to the MaterialHelper.PrepareDefinesForFrameBoundValues function that is being used by VRM? I’m not sure where https://cdn.jsdelivr.net/npm/babylon-vrm-loader/dist/index.js comes from.

Thank you for posting about bugs.

I say sorry but could you submit to GitHub issues at babylon-vrm-loader about this problem!

1 Like

ohhhh could definitely be this I thought it was only used internally after looking the search playground results :frowning:

is there a way to handle this question?

I get a crash when I try to enter VR experience with the Immersive Web Emmulator - Questions - Babylon.js — 当我尝试使用沉浸式 Web 模拟器进入 VR 体验时发生崩溃 - 问题 - Babylon.js (babylonjs.com)

solution of the post help me.

does it have anything to do with the issue presented here? want to share a playground that fails?

Mybe you can use babylonjs-vrm-loader:https://github.com/spencer17x/arca/tree/main/packages/awesome-babylonjs/babylonjs-vrm-loader

I’m migrating babylonjs-vrm-loader to GitHub - spencer17x/babylonjs-vrm: Use VRM on Babylon.js.
You can stay tuned.

I have successfully migrated babylonjs-vrm-loader to GitHub - spencer17x/babylonjs-vrm: Use VRM on Babylon.js repo


Nice !!!