Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate that a 1.0 to 2.0 upgrade has happened. #371

Merged
merged 1 commit into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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