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)