Skip to content

Commit

Permalink
Indicate that a 1.0 to 2.0 upgrade has happened.
Browse files Browse the repository at this point in the history
  • Loading branch information
emackey committed May 25, 2018
1 parent c49ccfb commit 347e55f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/updateVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -906,4 +910,4 @@ function glTF10to20(gltf) {
stripTechniqueParameterCount(gltf);
// add KHR_technique_webgl extension
addKHRTechniqueExtension(gltf);
}
}
1 change: 1 addition & 0 deletions specs/lib/updateVersionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 347e55f

Please sign in to comment.