Exporting from Three.js and importing into Blender
For this example, we’ll just take a simple sample reusing the parametric geometry we saw in Chapter 6, Exploring Advanced Geometries. If you open export-to-blender.html
in the browser, you can create some parametric geometries. At the bottom of the menu on the right, we’ve added an exportScene button:
Figure 13.1 – A simple scene that we’ll export
When you click on that button, the model will be saved in the GLTF format and downloaded onto your computer. To export a model with Three.js, we can use GLTFexporter
like so:
const exporter = new GLTFExporter() const options = { trs: false, onlyVisible: true, binary: false } exporter.parse( scene, (result) => { const output = JSON.stringify(result, null, 2) save(new Blob([output], { type: 'text/plain' }), ...