From 7e2708c2b25db004aecd3ae7e1af722249816e37 Mon Sep 17 00:00:00 2001 From: hpinkos Date: Thu, 28 Sep 2017 12:53:13 -0400 Subject: [PATCH 1/2] Update ForEach and addDefaults --- Source/ThirdParty/GltfPipeline/ForEach.js | 4 ++-- Source/ThirdParty/GltfPipeline/addDefaults.js | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Source/ThirdParty/GltfPipeline/ForEach.js b/Source/ThirdParty/GltfPipeline/ForEach.js index 814af92e5e7b..483fc1d15391 100644 --- a/Source/ThirdParty/GltfPipeline/ForEach.js +++ b/Source/ThirdParty/GltfPipeline/ForEach.js @@ -6,9 +6,8 @@ define([ /** * Contains traversal functions for processing elements of the glTF hierarchy. - * @constructor */ - function ForEach() {} + var ForEach = {}; ForEach.object = function(arrayOfObjects, handler) { if (defined(arrayOfObjects)) { @@ -211,5 +210,6 @@ define([ ForEach.texture = function(gltf, handler) { ForEach.topLevel(gltf, 'textures', handler); }; + return ForEach; }); diff --git a/Source/ThirdParty/GltfPipeline/addDefaults.js b/Source/ThirdParty/GltfPipeline/addDefaults.js index edb4f5d80ef9..a7a7228ee23e 100644 --- a/Source/ThirdParty/GltfPipeline/addDefaults.js +++ b/Source/ThirdParty/GltfPipeline/addDefaults.js @@ -384,14 +384,8 @@ define([ } function selectDefaultScene(gltf) { - var scenes = gltf.scenes; - - if (!defined(gltf.scene)) { - var scenesLength = scenes.length; - for (var sceneId = 0; sceneId < scenesLength; sceneId++) { - gltf.scene = sceneId; - break; - } + if (defined(gltf.scenes) && !defined(gltf.scene)) { + gltf.scene = 0; } } From 63f20527787acf45c3291a5727cf3a638f3a0251 Mon Sep 17 00:00:00 2001 From: hpinkos Date: Thu, 28 Sep 2017 13:01:35 -0400 Subject: [PATCH 2/2] whitespace --- Source/ThirdParty/GltfPipeline/ForEach.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ThirdParty/GltfPipeline/ForEach.js b/Source/ThirdParty/GltfPipeline/ForEach.js index 483fc1d15391..7c20fc07e679 100644 --- a/Source/ThirdParty/GltfPipeline/ForEach.js +++ b/Source/ThirdParty/GltfPipeline/ForEach.js @@ -210,6 +210,6 @@ define([ ForEach.texture = function(gltf, handler) { ForEach.topLevel(gltf, 'textures', handler); }; - + return ForEach; });