Skip to content

Conversation

@timoore
Copy link
Contributor

@timoore timoore commented Nov 25, 2025

An new method CesiumGltfReader::readGltfAndExternalData has been added which reads external data and then does postprocessing.

Addresses #1034

timoore and others added 5 commits November 26, 2025 00:18
Copy link
Member

@kring kring left a comment

Choose a reason for hiding this comment

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

Thanks @timoore. A few comments below, but I'm going to fix them myself so that we can include this in today's release.

assetFetcher.baseUrl,
options)
.thenInWorkerThread(
[&assetFetcher](CesiumGltfReader::GltfReaderResult&& gltfResult) {
Copy link
Member

Choose a reason for hiding this comment

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

It's not safe to lambda capture a parameter by reference if the lambda will outlive the function invocation.

options)
.thenInWorkerThread(
[&assetFetcher](CesiumGltfReader::GltfReaderResult&& gltfResult) {
if (gltfResult.model) {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the convertImmediate function above has been inlined here, so it can be removed.


result.contentKind = std::move(*gltfResult.model);
return asyncSystem
.runInWorkerThread([result = std::move(result),
Copy link
Member

Choose a reason for hiding this comment

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

postProcessContentInWorkerThread is already running in a worker thread, so this runInWorkerThread is unnecessary.

Comment on lines 415 to 416
CesiumAsync::HttpHeaders httpHeaders;
httpHeaders.insert(headers.begin(), headers.end());
Copy link
Member

@kring kring Nov 30, 2025

Choose a reason for hiding this comment

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

Suggested change
CesiumAsync::HttpHeaders httpHeaders;
httpHeaders.insert(headers.begin(), headers.end());
CesiumAsync::HttpHeaders httpHeaders(headers.begin(), headers.end());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @kring for fixing my broken code!

@kring
Copy link
Member

kring commented Nov 30, 2025

I've addressed all of my comments above, but there's a more subtle problem remaining. Previously, TilesetContentManager passed in the GltfSharedAssetSystem when resolving external data. Now, that isn't happening. This is slightly tricky to fix because the new load mechanism is invoked by the TilesetContentLoaders, which don't have a readily-available shared asset system. Will just have to weave one through, I guess.

@kring
Copy link
Member

kring commented Dec 1, 2025

Thanks @timoore!

@kring kring merged commit b815407 into main Dec 1, 2025
28 checks passed
@kring kring deleted the external-bin-file branch December 1, 2025 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants