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.

GLTFExporter is undefined

Home Forums Bug Reports and Feature Requests GLTFExporter is undefined

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8275
    Alin
    Participant

    Hello,
    I tried to export the scene as GLTF as described in the documentation (https://www.soft8soft.com/docs/examples/exporters/GLTFExporter.html), but I had the following issues:

    if I call

    
    var exporter = new v3d.GLTFExporter()
    

    I get this error:
    TypeError: v3d.GLTFExporter is not a constructor

    I tried to load the exporter like this (inside runCode function):

    
    var script=document.createElement('script');
        script.src='https://threejs.org/examples/js/exporters/GLTFExporter.js';
        script.onload = function () {
          console.log("exporter loaded");
          app.exporter = new THREE.GLTFExporter({onlyVisible:true});
        }
        document.head.appendChild(script);

    this step was ok, but when I export (inside an ExternalInterface function) I get this other error:

    Uncaught TypeError: Cannot convert undefined or null to object
        at Function.keys (<anonymous>)
        at processMesh (GLTFExporter.js:1204)
        at processNode (GLTFExporter.js:1584)
        at processNode (GLTFExporter.js:1614)
        at processScene (GLTFExporter.js:1679)
        at processObjects (GLTFExporter.js:1716)
        at processInput (GLTFExporter.js:1742)
        at THREE.GLTFExporter.parse (GLTFExporter.js:1760)

    :cry:

    • This topic was modified 4 years, 1 month ago by Alin.
    • This topic was modified 4 years, 1 month ago by Alin.
    #8278

    Hi,

    GLTFExporter is not a part of the core engine, but rather an external example. Check its source code here: https://cdn.soft8soft.com/demo/examples/index.html?q=expor#misc_exporter_gltf

    Chief 3D Verger | LinkedIn | Twitter

    #8279
    Alin
    Participant

    ah, thanks!

    that seems to work. maybe you could add that in the documentation?

    now I have another problem about the materials:

    
    VM12802 GLTFExporter.js:460 Uncaught TypeError: Cannot read property 'toArray' of undefined
        at processMaterial (VM12802 GLTFExporter.js:460)
    
    #8280

    We intend to synchronize with the latest Three.js version by the next release. The GLTFExporter will be updated too – most likely it will work better. The release is scheduled to the beginning of November.

    Chief 3D Verger | LinkedIn | Twitter

    #8282
    Alin
    Participant

    Following the example, I modified the latest GLTFExporter from ThreeJS and made it work for my models. :yahoo:

    #8283

    Glad you worked it out! :good:

    Chief 3D Verger | LinkedIn | Twitter

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