diff --git a/examples/gltf_exporter.html b/examples/gltf_exporter.html index d9fef2dcf7fb916e238d498a8ef053ab291de501..66e6bcefb7e0d2e63371f2fab384c8fcd16d430b 100644 --- a/examples/gltf_exporter.html +++ b/examples/gltf_exporter.html @@ -66,6 +66,7 @@ camera.position.y = 400; scene = new THREE.Scene(); + scene.name = 'Scene1'; var light, object; @@ -188,8 +189,16 @@ scene.add( object ); */ + var scene2 = new THREE.Scene(); + object = new THREE.Mesh( new THREE.BoxBufferGeometry( 100, 100, 100 ), material ); + object.position.set( 0, 0, 0 ); + object.name = "Cube2ndScene"; + scene2.name = 'Scene2'; + scene2.add(object); + + var gltfExporter = new THREE.GLTFExporter(); - gltfExporter.parse( scene, function( result ) { + gltfExporter.parse( [scene, scene2], function( result ) { console.log( JSON.stringify( result, null, 2 ) ); } ); diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js index 08be3cd718348664a1fa5fe01d32ae5e01a93a76..6ef365fff7529076e99e12dc324d9572e36149ac 100644 --- a/examples/js/exporters/GLTFExporter.js +++ b/examples/js/exporters/GLTFExporter.js @@ -420,7 +420,8 @@ THREE.GLTFExporter.prototype = { * @param {THREE.Scene} node Scene to process */ function processScene( scene ) { - if ( !outputJSON.scene ) { + console.log('Processing scene'); + if ( !outputJSON.scenes ) { outputJSON.scenes = []; outputJSON.scene = 0; }