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

Handle missing batch ID attributes #147

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Handle missing batch ID attributes #147

merged 1 commit into from
Aug 19, 2024

Conversation

javagl
Copy link
Contributor

@javagl javagl commented Aug 17, 2024

(This was originally causally thrown into #146 , but should be a dedicated PR:)

When running the upgrade with targetVersion 1.1, then the tools will try to convert B3DM to GLB. The batch table from the B3DM is converted into glTF extensions (EXT_mesh_features and EXT_structural_metadata).

But apparently, there are some very old/legacy B3DM files that define a batch table, but contain glTF 1.0 that do not define a BATCHID or _BATCHID attribute. From a quick (somewhat shallow) inspection, it looks like the batch ID might somehow have been defined programmatically via the shader that was stored in the glTF 1.0. There is no data available that has such a missing batch ID and is known to be "valid". So any attempt to migrate this to new structures (to emulate the old behavior) would involve lots of guesses and/or code archeology.

Therefore, this PR handles this case in the most simple form: When such a B3DM with a glTF 1.0 without batch IDs is encuntered during the upgrade to 1.1, then it will print a warning, and the resulting GLB will not contain EXT_mesh_features.

@lilleyse lilleyse merged commit 95dd93b into main Aug 19, 2024
2 checks passed
@lilleyse lilleyse deleted the allow-missing-batch-id branch August 19, 2024 13:01
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.

2 participants