提交 1ab1bb2e 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #12028 from fernandojsg/visible

GLTFExporter: Added onlyVisible option
......@@ -782,6 +782,9 @@ THREE.GLTFExporter.prototype = {
for ( var i = 0, l = object.children.length; i < l; i ++ ) {
var child = object.children[ i ];
if ( child.visible || options.onlyVisible === false ) {
if ( child instanceof THREE.Mesh ||
child instanceof THREE.Camera ||
child instanceof THREE.Group ||
......@@ -794,6 +797,8 @@ THREE.GLTFExporter.prototype = {
}
}
if ( children.length > 0 ) {
gltfNode.children = children;
......@@ -842,6 +847,8 @@ THREE.GLTFExporter.prototype = {
var child = scene.children[ i ];
if ( child.visible || options.onlyVisible === false ) {
// @TODO We don't process lights yet
if ( child instanceof THREE.Mesh ||
child instanceof THREE.Camera ||
......@@ -855,6 +862,8 @@ THREE.GLTFExporter.prototype = {
}
}
if ( nodes.length > 0 ) {
gltfScene.nodes = nodes;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册