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

Fix gltf pipeline for some 3d Tilesets #5783

Closed
wants to merge 6 commits into from
Closed
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
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Jason Crow](https://github.com/jason-crow)
* [Flightradar24 AB](https://www.flightradar24.com)
* [Aleksei Kalmykov](https://github.com/kalmykov)
* [virtualcitySYSTEMS GmbH](https://www.virtualcitysystems.de)
* [Jannes Bolling](https://github.com/jbo023)

## [Individual CLA](Documentation/Contributors/CLAs/individual-cla-agi-v1.0.txt)
* [Victor Berchet](https://github.com/vicb)
Expand Down
5 changes: 5 additions & 0 deletions Source/ThirdParty/GltfPipeline/addPipelineExtras.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ define([
gltf.extras._pipeline = defaultValue(gltf.extras._pipeline, {});
gltf.asset = defaultValue(gltf.asset, {});
gltf.asset.extras = defaultValue(gltf.asset.extras, {});
if (defined(gltf.asset.extras) && typeof(gltf.asset.extras) !== 'object'){
gltf.asset.extras = {
extras : gltf.asset.extras
};
}
gltf.asset.extras._pipeline = defaultValue(gltf.asset.extras._pipeline, {});
return gltf;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/ThirdParty/GltfPipeline/updateVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ define([
var value = object[id];
mapping[id] = array.length;
array.push(value);
if (!defined(value.name)) {
if (!defined(value.name) && typeof(value) === 'object') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at a glTF in http://hosting.virtualcitysystems.de/demos/temp/b3dm there is a samplerRepeat property at the top level of the glTF which isn't support by the spec. Ideally the source data should be fixed. Also fine with this change for now as this area too is changed in the cleanup branch.

value.name = id;
}
}
Expand Down Expand Up @@ -737,7 +737,7 @@ define([
bufferViewsToDelete[oldBufferViewId] = true;
}
var bufferView = clone(bufferViews[oldBufferViewId]);
var accessorByteStride = getAccessorByteStride(gltf, accessor);
var accessorByteStride = (defined(accessor.byteStride) && accessor.byteStride !== 0) ? accessor.byteStride : getAccessorByteStride(gltf, accessor);
if (defined(accessorByteStride)) {
bufferView.byteStride = accessorByteStride;
if (bufferView.byteStride !== 0) {
Expand Down