I want export model from AssimpLoader to GLTFExporter I used
const loader = new AssimpLoader();
loader.load(url, function ( result ) {
const object = result.object;
object.position.y = - 100;
object.rotation.x = Math.PI * 2;
group.add(object)
animation = result.animation;
export_animates = [result.animation]
console.log(result.animation)
} );
function ani() {
if ( animation ) animation.setTime( performance.now() / 1000 );
}
const gltfExporter = new GLTFExporter();
const options = {
trs: document.getElementById( 'option_trs' ).checked,
onlyVisible: document.getElementById( 'option_visible' ).checked,
truncateDrawRange: document.getElementById( 'option_drawrange' ).checked,
binary: document.getElementById( 'option_binary' ).checked,
animations: export_animates,
maxTextureSize: Number( document.getElementById( 'option_maxsize' ).value ) || Infinity // To prevent NaN value
};
gltfExporter.parse( input, function ( result ) {
if ( result instanceof ArrayBuffer ) {
console.log(result)
} else {
const output = JSON.stringify( result, null, 2 );
// generate object output
console.log(output)
//saveString( output, 'scene.gltf' );
}
}, options );
but i get error
AssimpLoader.js:302 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'name')
When i try export from FBX to GLTF.
It is work.
What am i doing wrong?