[SOLVED] Error on inspector visibility for instances


os: MacOS
browser: Chrome
babylonjs: 4.RC1

was changing visibility for instance mesh in inspector and got error:

babylon.inspector.bundle.js:31 Uncaught TypeError: Cannot set property visibility of [object Object] which has only a getter
    at t.onChange (babylon.inspector.bundle.js:31)
    at onChange (babylon.inspector.bundle.js:31)
    at Object.<anonymous> (babylon.inspector.bundle.js:51)
    at d (babylon.inspector.bundle.js:51)
    at babylon.inspector.bundle.js:51
    at x (babylon.inspector.bundle.js:51)
    at w (babylon.inspector.bundle.js:51)
    at Array.forEach (<anonymous>)
    at k (babylon.inspector.bundle.js:51)
    at M (babylon.inspector.bundle.js:51)

as its getter only maybe its should not be slider but just text field ?

not related to error bu would be nice to have some link to source mesh of instance :slight_smile:

Thank you

Will fix the issue :slight_smile:
And add a link to source

1 Like

I’m also running into this issue

which version?

4.0.3. I need to get off the npm version and figure a good way to hookup package.json to the nightly dist folder because I appears most of my issues have been fixed there. Maybe gitsubmodules would work.

you can directly pick 4.1 in the preview channel from npm as well: babylonjs - npm

1 Like

Omg, how did I not see the version tags. So sorry for wasting your time, will test with latest.

1 Like

@Deltakosh, so still seeing this issue in Babylon.js v4.1.0-alpha.17 - WebGL2

    const instance = originalMesh.createInstance(e.entityId);
    instance.visibility = 0.5;

Cannot assign to ‘visibility’ because it is a read-only property.

https://www.babylonjs-playground.com/#AIU2FE#1 shows it not working but I don’t see the same error in the console.

Not a bug. Instances can only change position, rotation and scaling :slight_smile:
Everything else require you to use clones

So here i what i’m trying to do, turning on and off instance via animation. By abuse the BezierEasing got something close to what I wanted. Maybe its best to put each the instance under a TransformNode and scale that via animation to zero to hide? I definitely want to keep the instance cause of the amount of meshes.

scaling is fine (and no need for a transformnode as each instance can have a scaling)

1 Like