learning-threejs icon indicating copy to clipboard operation
learning-threejs copied to clipboard

Chapter 08- 04-load-save-json-scene

Open ashleynguci opened this issue 6 years ago • 1 comments

Codes don't work since THREE.SceneExporter isn't supported.

"Attempted import error: 'SceneExporter' is not exported from 'three' (imported as 'THREE')"

Is there any way to replace THREE.SceneExoprter? Thanks

ashleynguci avatar Jan 10 '20 08:01 ashleynguci

I found the replacement if someone faced the same issue. GLTFExporter. GLTFExporter works exactly the same as SceneExporter or ObjectExporter, depends on what you want to export.

exporter.parse( [ scene1, object1, object2, scene2 ], ... )

var exporter = new THREE.GLTFExporter();

// Parse the input and generate the glTF output exporter.parse( scene, function ( gltf ) { console.log( gltf ); downloadJSON( gltf ); }, options );

Hope it help.

https://threejs.org/docs/#examples/en/exporters/GLTFExporter

ashleynguci avatar Jan 13 '20 07:01 ashleynguci