From b34e122ca8992f6304880ba6eb775a7f36f41f5c Mon Sep 17 00:00:00 2001 From: Fernando Serrano Date: Fri, 18 Aug 2017 08:35:05 +0200 Subject: [PATCH] GLTFExporter: Added onlyVisible option --- examples/js/exporters/GLTFExporter.js | 2 -- examples/misc_exporter_gltf.html | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js index 58142ab3fc..c41289fc8b 100644 --- a/examples/js/exporters/GLTFExporter.js +++ b/examples/js/exporters/GLTFExporter.js @@ -57,8 +57,6 @@ THREE.GLTFExporter.prototype = { */ parse: function ( input, onDone, options ) { - options = options || {}; - var outputJSON = { asset: { diff --git a/examples/misc_exporter_gltf.html b/examples/misc_exporter_gltf.html index 2a6dbbee38..887b0144fd 100644 --- a/examples/misc_exporter_gltf.html +++ b/examples/misc_exporter_gltf.html @@ -29,7 +29,8 @@
- TRS + + @@ -44,7 +45,8 @@ var gltfExporter = new THREE.GLTFExporter(); var options = { - trs: document.getElementById('option_trs').checked + trs: document.getElementById('option_trs').checked, + onlyVisible: document.getElementById('option_visible').checked, } gltfExporter.parse( input, function( result ) { @@ -400,6 +402,17 @@ object.position.set( 200, 0, 400 ); scene1.add( object ); + // --------------------------------------------------------------------- + // Big red box hidden just for testing `onlyVisible` option + // --------------------------------------------------------------------- + material = new THREE.MeshBasicMaterial( { + color: 0xff0000 + } ); + object = new THREE.Mesh( new THREE.BoxBufferGeometry( 200, 200, 200 ), material ); + object.position.set( 0, 0, 0 ); + object.name = "CubeHidden"; + object.visible = false; + scene1.add( object ); // --------------------------------------------------------------------- // 2nd Scene -- GitLab