I copied most of the code in Three.js export-examples. It looks like this now:
function exportGLTF(input){
exporter = new GLTFExporter();
var options = {
trs: true,
onlyVisible: true,
truncateDrawRange: true,
binary: false,
//animations: ,
forceIndices: false,
forcePowerOfTwoTextures: false,
maxTextureSize: Infinity
};
exporter.parse( input, function ( result ) {
if ( result instanceof ArrayBuffer ) {
saveArrayBuffer( result, 'scene.glb' );
} else {
var output = JSON.stringify( result, null, 2 );
console.log( output );
saveString( output, 'scene.gltf' );
}
}, options );
}
function exportSTLAscii(input) {
exporter = new STLExporter();
var result = exporter.parse(input);
saveString( result, 'scene.stl' );
}
function exportCollada(input) {
exporter = new ColladaExporter();
var result = exporter.parse(input);
saveString( result.data, 'scene.dae' );
/* result.textures.forEach( tex => {
saveArrayBuffer( tex.data, `${ tex.name }.${ tex.ext }` );
} ); */
}
The âinputâ variable of all three functions is an array, which contains all objects, i want to export.
If i want to export my imported gltf object, the gltf exporter works, the stl exporter prints out this error : âObject doesnt support property or method âtraverseââ (STLExporter.js (42,3)) and the Collada exporter prints out this error: "Object doesnt support property or method updateMatrix (ColladaExporter.js 196,3). Can somebody help me?
Also i am not sure if i have to use or delete the last code in the collada-function (which is at the moment a comment).