Home › Forums › Bug Reports and Feature Requests › GLTFExporter is undefined
Tagged: gltf export
- This topic has 5 replies, 2 voices, and was last updated 7 years ago by
Yuri Kovelenov.
-
AuthorPosts
-
2018-10-19 at 2:44 pm #8275
Alin
ParticipantHello,
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 constructorI 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)
2018-10-19 at 2:54 pm #8278
Yuri KovelenovStaffHi,
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
2018-10-19 at 3:08 pm #8279Alin
Participantah, 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)2018-10-19 at 3:38 pm #8280
Yuri KovelenovStaff2018-10-19 at 5:25 pm #8282Alin
ParticipantFollowing the example, I modified the latest GLTFExporter from ThreeJS and made it work for my models.
2018-10-20 at 8:30 am #8283
Yuri KovelenovStaff -
AuthorPosts
- You must be logged in to reply to this topic.
