diff --git a/lib/updateVersion.js b/lib/updateVersion.js index f966c43a..6622357b 100644 --- a/lib/updateVersion.js +++ b/lib/updateVersion.js @@ -872,8 +872,12 @@ function glTF10to20(gltf) { if (!defined(gltf.asset)) { gltf.asset = {}; } + if (!defined(gltf.asset.extras)) { + gltf.asset.extras = {}; + } var asset = gltf.asset; asset.version = '2.0'; + asset.extras.gltf_pipeline_upgrade_10to20 = true; // material.instanceTechnique properties should be directly on the material. instanceTechnique is a gltf 0.8 property but is seen in some 1.0 models. updateInstanceTechniques(gltf); // animation.samplers now refers directly to accessors and animation.parameters should be removed @@ -906,4 +910,4 @@ function glTF10to20(gltf) { stripTechniqueParameterCount(gltf); // add KHR_technique_webgl extension addKHRTechniqueExtension(gltf); -} \ No newline at end of file +} diff --git a/specs/lib/updateVersionSpec.js b/specs/lib/updateVersionSpec.js index 0f0da1d7..91c356cb 100644 --- a/specs/lib/updateVersionSpec.js +++ b/specs/lib/updateVersionSpec.js @@ -33,6 +33,7 @@ describe('updateVersion', function() { }; updateVersion(gltf); expect(gltf.asset.version).toEqual('2.0'); + expect(gltf.asset.extras.gltf_pipeline_upgrade_10to20).toEqual(true); }); it('updates a glTF with non-standard version to 2.0', function() {