We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Cannot read property ‘dispose’ of null

Home Forums Bug Reports and Feature Requests Cannot read property ‘dispose’ of null

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29876
    web
    Customer

    I’ve got an issue creating a material on runtime. I get the error “Cannot read property ‘dispose’ of null” in the console.
    However the application is running normal and the material is also created normally. But I would like to get rid of that error.

    Maybe it has something todo with the 3.3.0 pre1 version I’m testing.

    This is the code:

    var video = loadVideo('./assets/Testvideo.mp4');
    var singleObj = getObjectByName('Testobject');
    var texture = new v3d.VideoTexture(video);    
    singleObj.material = new v3d.MeshStandardMaterial({ emissive : 0xFFFFFF, emissiveMap : texture, emissiveIntensity: 0.7});
    • This topic was modified 1 year, 3 months ago by web.
    #29992

    Hi,
    That’s strange. dispose happens when you’re unloading something. Are you sure these lines of code generate the error?

    Verge3D’s Tech Chief
    FB | Twitter | VK

    #30001
    web
    Customer

    As soon as I got the last line for creating the material I get this error. At the moment the workaround I’m using is creating a “MeshLambertMaterial” instead of “MeshStandardMaterial”. With the lambert one there is no error, dont know why? :unsure:

    #30036

    I made a simple test case based on your code, still no errors :unsure: Can you share a link to your project sources?

    Verge3D’s Tech Chief
    FB | Twitter | VK

    #30125
    web
    Customer

    I think I found the issue. I’ve upped the world cubemap res on runtime. As soon as I got the updateEnvironment in the code, I get the error with the MeshStandardMaterial.

    This is the code in the runCode()

    app.worldCubemapRes = 2048;
    app.updateEnvironment(app.worldMaterial);

    This is the error log in chrome:

    v3d.js:1 Uncaught TypeError: Cannot read property 'dispose' of null
    at v3d.js:1
    at v3d.js:1
    at Ci.traverse (v3d.js:1)
    at zn.traverse (v3d.js:1)
    at sy._traverseSceneForEnvUpdates (v3d.js:1)
    at sy.disposeEnvironment (v3d.js:1)
    at sy.updateEnvironment (v3d.js:1)
    at runCode (test.js?ver=0.1:227)
    at test.js?ver=0.1:96
    at v3d.js:1
    • This reply was modified 1 year, 3 months ago by web.
    • This reply was modified 1 year, 3 months ago by web.
    #30136

    I think I found the issue. I’ve upped the world cubemap res on runtime. As soon as I got the updateEnvironment in the code, I get the error with the MeshStandardMaterial.

    Thanks for investigating the issue! It will be fixed in the next verge3d update.

    Co-founder and lead developer at Soft8Soft.

    #30148
    web
    Customer

    Great :good:

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.