CesiumGS / CesiumGS/cesium-native
glTF models should have `asset.version = "2.0"` by default
- Dominant language
- C++
- Stars
- 623
- Forks
- 277
- PR merge metrics
- No merged PRs in 30d
Description
Sparked by https://github.com/CesiumGS/cesium/issues/13032 :
Apparently, when creating a glTF model and just writing it with the `CesiumGltfWriter`, it does not contain the `asset.version = "2.0"` property. First, that's invalid. Second (in case more reasoning is necessary), CesiumJS gets confused by this and can cause hard-do-diagnose follow-up errors.
One could argue that ~"the model should, by default, be completely unititialized" - and that's a valid point. We're not inserting some random `Node` or `Animation` just ~"because it is convenient for us". But I think that the asset version is pretty much a baseline.
Given that large parts of the code are auto-generated, and the `version` field does (of course) not have a 'default' value as of the spec, the question may be where it should be inserted. But there should be some place - maybe around https://github.com/CesiumGS/cesium-native/blob/e876c133c829c539553cd8f320c0b38b1c961cd2/CesiumGltf/include/CesiumGltf/Model.h#L15 (given that the auto-generated part is `ModelSpec` anyhow...)
Contributor guide
Research direction
Start by tracing how CesiumGltfWriter serializes a newly created model and read CesiumGltf/include/CesiumGltf/Model.h, especially the generated ModelSpec relationship. Determine where the baseline asset.version value belongs without changing other default model contents, then verify that writing a default glTF model produces asset.version = "2.0".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100