glb_inspect: show the default scene and named root nodes #1746

Open
github-bot wants to merge 2 commits from github-bot/gh-1746 into main AGit
Owner

@⁠kirigayakazima on GitHub · 2026-11-25 11:04 UTC · original
kirigayakazima:codex/glb-inspect-scene-roots → main · +78 −1 · 2 files · 2 commits · open

Claimed in the coordination issue as: GLB-INSPECT-SCENE-ROOTS

What and why

The scene count alone does not show which scene a viewer opens or which roots it contains. Both report formats now give the declared default and each scene's ordered root indices and names. Broken references are reported alongside their scene. An omitted default stays unspecified. glTF scene schema

Tested

Two synthetic tests cover an omitted and nonzero default scene, declared root order, node names, absent and empty root arrays, duplicate roots and references to missing or non-object entries.

  • python -I tests/test_glb_inspect.py on Windows with Python 3.14.7 ran 38 tests on this branch with one platform skip. The new tests also failed against the original inspector.
  • python -I scripts/check_no_game_data.py tools/glb_inspect.py tests/test_glb_inspect.py and git diff --check passed.
  • The shared base at bcaa13da passed 6,287 semantic tests across 488 files.

GPUs tested: N/A (CPU-only metadata inspection).
AI-assisted: Yes.

Checklist

  • Based on current upstream main.
  • One topic.
  • All test inputs are synthetic. No game data, keys or decryption.
  • Translator contract table: N/A.
**@⁠kirigayakazima** on GitHub · 2026-11-25 11:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1746) `kirigayakazima:codex/glb-inspect-scene-roots` → `main` · +78 −1 · 2 files · 2 commits · open Claimed in the coordination issue as: [GLB-INSPECT-SCENE-ROOTS](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why The scene count alone does not show which scene a viewer opens or which roots it contains. Both report formats now give the declared default and each scene's ordered root indices and names. Broken references are reported alongside their scene. An omitted default stays unspecified. [glTF scene schema](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/schema/scene.schema.json) ### Tested Two synthetic tests cover an omitted and nonzero default scene, declared root order, node names, absent and empty root arrays, duplicate roots and references to missing or non-object entries. - `python -I tests/test_glb_inspect.py` on Windows with Python 3.14.7 ran 38 tests on this branch with one platform skip. The new tests also failed against the original inspector. - `python -I scripts/check_no_game_data.py tools/glb_inspect.py tests/test_glb_inspect.py` and `git diff --check` passed. - The shared base at `bcaa13da` passed 6,287 semantic tests across 488 files. GPUs tested: N/A (CPU-only metadata inspection). AI-assisted: Yes. ### Checklist - [x] Based on current upstream main. - [x] One topic. - [x] All test inputs are synthetic. No game data, keys or decryption. - Translator contract table: N/A.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:03:32 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 11:19 UTC · original · reviewed

Independent check at "08bbbaef". Windows: 37 tests reported, 1 platform skip. The new default-scene and repeated-reference coverage passes. A separate GLB exposed a hierarchy case that is still reported as a valid root. Details inline.

AI-assisted review and CPU-only testing with synthetic inputs.

**@⁠lixonik** on GitHub · 2026-11-25 11:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1746#pullrequestreview-6056670706) · **reviewed** Independent check at "08bbbaef". Windows: 37 tests reported, 1 platform skip. The new default-scene and repeated-reference coverage passes. A separate GLB exposed a hierarchy case that is still reported as a valid root. Details inline. AI-assisted review and CPU-only testing with synthetic inputs.
@ -109,0 +114,4 @@
issues.append("nodes must be a non-empty array when present")
for slot, ref in enumerate(_array(scene.get("nodes"))):
node = _entry(gltf, "nodes", ref)
roots.append({"node": _index(ref), "name": _text(node.get("name")) if node is not None else None})
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 11:19 UTC · original

This checks whether the referenced node exists but still reports a child as a valid scene root. With nodes: [{"children":[1]},{"name":"child"}] and scenes: [{"nodes":[1]}], the JSON shows node 1 under roots with an empty issues list. Could the inspector check root indices against the valid indices found in node children? glTF requires scene root nodes to have no parent. glTF 2.0 scene specification

**@⁠lixonik** on GitHub · 2026-11-25 11:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1746#discussion_r4694121337) This checks whether the referenced node exists but still reports a child as a valid scene root. With `nodes: [{"children":[1]},{"name":"child"}]` and `scenes: [{"nodes":[1]}]`, the JSON shows node 1 under roots with an empty issues list. Could the inspector check root indices against the valid indices found in node children? glTF requires scene root nodes to have no parent. [glTF 2.0 scene specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#scenes)
@ -109,0 +121,4 @@
issues.append("nodes must be a non-empty array when present")
for slot, ref in enumerate(_array(scene.get("nodes"))):
node = _entry(gltf, "nodes", ref)
roots.append({"node": _index(ref), "name": _text(node.get("name")) if node is not None else None})
Author
Owner

@⁠kirigayakazima on GitHub · 2026-11-27 12:11 UTC · original

Fixed: _scene_report() now collects valid child indices from nodes[*].children and reports an issue whenever a scene root references a child node. Added regression test in tests/test_glb_inspect.py.

**@⁠kirigayakazima** on GitHub · 2026-11-27 12:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1746#discussion_r4719209591) Fixed: `_scene_report()` now collects valid child indices from `nodes[*].children` and reports an issue whenever a scene root references a child node. Added regression test in `tests/test_glb_inspect.py`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1746/head:github-bot/gh-1746'
git switch 'github-bot/gh-1746'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1746'
git switch 'github-bot/gh-1746'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1746'
git switch 'github-bot/gh-1746'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1746'
git switch 'main'
git merge --squash 'github-bot/gh-1746'
git switch 'main'
git merge --ff-only 'github-bot/gh-1746'
git switch 'main'
git merge 'github-bot/gh-1746'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.