Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical bug removes strides from animation accessors in mixed bufferViews without repacking their data, corrupting animation timing.
2 open issues
What changed in this PR
Replaces in-place legacy glTF upgrades with typed conversions, continuing the workspace typing work in #14123 and #13949.
Changes:
- Builds upgraded assets through typed converters and updates the loader to use the returned object.
- Removes remaining
anytypes and adds interleaved-accessor coverage. - Generates ellipsoid-region extension types for bounding-volume conversion.
| File | Description |
|---|---|
| packages/gltf/Specs/updateVersionSpec.js | Uses returned assets and tests interleaved attributes. |
| packages/gltf/Specs/ForEachSpec.js | Removes tests for deleted helpers. |
| packages/gltf/Source/usesExtension.js | Includes glTF 0.8 input types. |
| packages/gltf/Source/updateVersion.js | Introduces typed object converters. |
| packages/gltf/Source/removePipelineExtras.js | Types pipeline-buffer access. |
| packages/gltf/Source/removeExtension.js | Replaces unrestricted types with unknown. |
| packages/gltf/Source/parseGlb.js | Includes glTF 0.8 return types. |
| packages/gltf/Source/KHR_materials_common.ts | Defines private material-extension types. |
| packages/gltf/Source/IdMaps.ts | Types legacy ID-to-index maps. |
| packages/gltf/Source/gltf08to1.js | Extracts typed glTF 0.8 conversion. |
| packages/gltf/Source/Gltf08.ts | Defines legacy glTF 0.8 types. |
| packages/gltf/Source/ForEachNamedHandler.ts | Adds generic callback value types. |
| packages/gltf/Source/ForEachIdHandler.ts | Uses unknown callback returns. |
| packages/gltf/Source/ForEachElementHandler.ts | Adds generic element types. |
| packages/gltf/Source/forEachBuffer.js | Types callbacks and legacy inputs. |
| packages/gltf/Source/ForEach.js | Types iterators and removes unused helpers. |
| packages/gltf/Source/convert08Material.js | Converts legacy material technique properties. |
| packages/gltf/Source/constructBoundingVolumeJson.js | Uses generated ellipsoid-region types. |
| packages/gltf/Source/addPipelineExtras.js | Includes glTF 0.8 input types. |
| packages/gltf/scripts/gltfSchemaSources.json | Registers the ellipsoid-region schema. |
| packages/gltf/SchemaTypes/index.ts | Exports generated extension types. |
| packages/gltf/SchemaTypes/Gltf2.ts | Adds typed shape-extension support. |
| packages/gltf/SchemaTypes/Extensions/3DTILES_shape_ellipsoid_region.ts | Defines generated ellipsoid-region types. |
| packages/gltf/gltf.entry.d.ts | Exports Gltf08. |
| packages/engine/Source/Scene/GltfJsonLoader.js | Consumes the returned upgraded asset. |
| eslint.config.js | Allows unused rest-destructuring siblings. |
Review effort: Balanced
jjhembd
force-pushed
the
gltf-typed-upgrade
branch
from
December 4, 2026 15:06
7205c6e to
0eb3d9e
Compare
jjhembd
force-pushed
the
gltf-typed-upgrade
branch
3 times, most recently
from
December 4, 2026 18:26
560f577 to
2bd8a0e
Compare
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Changes to legacy glTF object identity and buffer-view ranges require loading and rendering validation on representative glTF 0.8/1.0 assets that this source-only review cannot provide.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
5 of 8 tasks
jjhembd
force-pushed
the
gltf-typed-upgrade
branch
from
December 4, 2026 18:44
2bd8a0e to
fe8fe73
Compare
jjhembd
force-pushed
the
gltf-typed-upgrade
branch
from
December 4, 2026 18:44
fe8fe73 to
833a678
Compare
added 12 commits
December 4, 2026 15:30
added 5 commits
December 4, 2026 15:30
jjhembd
force-pushed
the
gltf-typed-upgrade
branch
from
December 4, 2026 20:30
833a678 to
59fb017
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
updateVersionupgraded glTF 0.8 and 1.0 assets in place, passing them through states that match no glTF version, so #14123 typed its helpers asany. This PR replaces the in-place upgrade with typed conversions:gltf08to1builds a newGltf1from aGltf08, andgltf1to2builds a newGltf2from aGltf1, one object type at a time. After this PR,packages/gltf/Sourcehas noanytypes.Code changes
The changes are organized so that they can be reviewed one commit at a time.
Preparation
glTF08to10andglTF10to20becomegltf08to1andgltf1to2, andupdateVersioncalls them directly.A converter per glTF object type
Each commit replaces the in-place reference fixes for some object types with converters that build a new glTF 2.0 object from a glTF 1.0 object:
convertAsset,convertBuffer,convertCamera,convertImage,convertTexture,convertMesh,convertAnimation,convertMaterial,convertNode,convertScene,convertSkin, andconvertBufferViewsAndAccessors.IdMapstypes the maps from glTF 1.0 ids to glTF 2.0 indices. ESLint'sno-unused-varsnow setsignoreRestSiblings, so converters can leave out properties with rest destructuring.updateVersionreturns the upgraded glTFupdateVersionreturns the upgraded asset, which may be a new object, andGltfJsonLoaderuses the return value. Most of theupdateVersionSpec.jsdiff is from this commit, which makes each test assign the result. Later commits leaveupdateVersionSpec.jsunchanged.gltf1to2builds a newGltf2gltf1to2takes aGltf1and assembles theGltf2from the converted arrays, andobjectsToArraysis deleted.objectToArraynow only converts id-keyed objects to arrays, and the newgetIdMapbuilds the id map.Typed glTF 0.8 upgrade
The glTF 0.8 upgrade moves to
gltf08to1.js, then becomes a conversion fromGltf08, a new@internaltype with the glTF 0.8 properties thatgltf08to1reads, since glTF 0.8 has no schema.convert08Materialconverts the 0.8instanceTechnique, which some non-compliant glTF 1.0 assets also have.Remaining
anytypesForEachfunctions that the new converters no longer call are deleted, with their specs.ForEachfunctions and handler types are generic in the value type, andForEach.topLevelis replaced withForEach.objecton each top-level array.KHR_materials_commonmaterial extension gets a private type, since it has no schema file.Adding types for a new extension
The last commit shows how to add a new extension's types: it adds
3DTILES_shape_ellipsoid_regiontogltfSchemaSources.json, regeneratesSchemaTypes, and uses the generated type inconstructBoundingVolumeJsonin place of an inline cast.Changes to the upgraded glTF JSON
byteLengththat ends at the last byte of its accessors' data, which can be shorter than its glTF 1.0byteLength.extensionsRequiredof a glTF 2.0 asset upgraded from glTF 1.0 listsCESIUM_RTCandWEB3D_quantized_attributeswhen they're inextensionsUsed, and ignores anyextensionsRequiredin the input, which glTF 1.0 doesn't define.updateVersionis@internal, so this PR needs noCHANGES.mdentry.Issue number and link
Part of #13949.
Testing plan
npm run tsc -w @cesium/gltf,npm run eslint, andnpm run sg-scanshould pass.npm run test -w @cesium/gltfandnpm run test -- --includeName Scene/Gltfshould pass. A new test checks that interleaved glTF 1.0 vertex attributes share one bufferView.npx jsdoc --configure Tools/jsdoc/conf.json --pedanticshould print no errors.grep -rnE "\{any\}|\{\*\}|[<,] ?\*>|: any\b|<any>" packages/gltf/Sourceshould print nothing.Specs/Data/Models/glTF-1.0, should load and render as onmain.Author checklist
CONTRIBUTORS.mdCHANGES.mdwith a short summary of my changeAI acknowledgment
If yes, I used the following Tools(s) and/or Service(s): GitHub Copilot
If yes, I used the following Model(s): Claude Opus 5.5