diff --git a/examples/gltf_exporter.html b/examples/gltf_exporter.html
index 7e8016a41cfde414a6d3155389e5927089d708ff..5009afcb7f926f9527907ada7ae15e89168acdad 100644
--- a/examples/gltf_exporter.html
+++ b/examples/gltf_exporter.html
@@ -64,6 +64,7 @@
camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 2000 );
camera.position.y = 400;
+ camera.name = "PerspectiveCamera";
scene1 = new THREE.Scene();
scene1.name = 'Scene1';
@@ -147,20 +148,24 @@
object.add( object2 );
*/
- object = new THREE.Group();
- object.name = "Group";
- scene1.add( object );
+ group1 = new THREE.Group();
+ group1.name = "Group";
+ scene1.add( group1 );
+
+ group2 = new THREE.Group();
+ group2.name = "subGroup";
+ group1.add( group2 );
object2 = new THREE.Mesh( new THREE.BoxBufferGeometry( 30, 30, 30 ), material );
object2.name = "Cube in group";
object2.position.set( 0, 100, 100 );
- object.add( object2 );
-
+ group2.add( object2 );
scene1.add( camera );
var cameraOrtho = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 10, 10 );
scene1.add( cameraOrtho );
+ cameraOrtho.name = 'OrthographicCamera';
/*
object = new THREE.Mesh( new THREE.CircleGeometry( 50, 20, 0, Math.PI * 2 ), material );
diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js
index 5bc88df7865eabeda0b9a9bc9181202a375c1b93..66ed884c5eea1cc5c4cca041e0a73221dd87378e 100644
--- a/examples/js/exporters/GLTFExporter.js
+++ b/examples/js/exporters/GLTFExporter.js
@@ -544,7 +544,7 @@ THREE.GLTFExporter.prototype = {
for ( var i = 0, l = object.children.length; i < l; i ++ ) {
var child = object.children[ i ];
- if ( child instanceof THREE.Mesh ) {
+ if ( child instanceof THREE.Mesh || child instanceof THREE.Camera || child instanceof THREE.Group ) {
gltfNode.children.push( processNode( child ) );
}
}
@@ -580,7 +580,7 @@ THREE.GLTFExporter.prototype = {
var child = scene.children[ i ];
// @TODO Right now we just process meshes and lights
- if ( child instanceof THREE.Mesh || child instanceof THREE.Camera ) {
+ if ( child instanceof THREE.Mesh || child instanceof THREE.Camera || child instanceof THREE.Group ) {
gltfScene.nodes.push( processNode( child ) );
}
}