mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #2335] studio: list the shown model's size, meshes, materials and textures (STUDIO-MODEL-DETAILS) #2339
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2339
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2335
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:feat/studio-model-details📝 Commits (1)
d83cee9studio: list the shown model's size, meshes, materials and textures (STUDIO-MODEL-DETAILS)📊 Changes
2 files changed (+170 additions, -0 deletions)
View changed files
📝
tests/test_viewer_studio.cjs(+81 -0)📝
viewer/studio.html(+89 -0)📄 Description
Claimed in the coordination issue as: STUDIO-MODEL-DETAILS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193990202)
What and why
A feature for the 3D studio (
viewer/studio.html, served bytools/gallery.py). Its stats panel gave a model's triangles, vertices and file size. Checking an export needs the next layer too: how big the model came out, how many meshes and materials it has, and which textures each material uses at what size. The panel now shows that, read from the loaded glTF alone:0.0215 mand a building48.3 m. A wrong scale, or a model exported in centimetres, shows at once.map 1024×512,normalMap 512×512). A material with neither a texture nor vertex colours is marked no texture in the accent colour: that flat-colour look is often a texture the export lost. Vertex-coloured materials say so instead.Details:
userData.origMaterial, asdisposeModeldoes), not the studio clay.loadModelsit next to the other stats, so this merges cleanly with the open studio PRs that edit the camera fit (#1490, #2136) and the others on this file (#1138, #2100, #2250).Tested
Windows 11, Node 26.12.1, Chromium (app browser pane). No game files:
node --test tests/test_viewer_studio.cjs: 15 pass. Three new tests on synthetic objects: the size, counts and per-material texture list of a model with a shared textured material, an untextured one, a vertex-coloured one, a texture without an image (?) and a non-mesh node, loaded in clay mode; hostile material names render as text and the details followsetLanguage('eu'); the panel before any model, after a stale load, after a failed load (unchanged) and for an empty model (list hidden). The three fail onmain(the panel has no such fields); the 12 existing tests pass.tests/test_viewer_streaming.cjs,tests/test_gallery.pyandtests/test_viewer_cdn_integrity.pyalso pass.python -I tools/gallery.py --models-dir <dir>with a synthetic 2.9 KB.glbwritten by a stdlib script (three glTF meshes, one with two primitives; materialsBodywith a 64×32 base colour and a 32×32 normal texture on two meshes, an unnamed flat one,Decals<b>withCOLOR_0). The panel showed4.5 × 1.4 × 0.0215 m,4 / 3 / 2and the three materials as expected in RU and EU, with the name escaped; no console errors besides the existing/vendor/404s that fall back to the CDN.scripts/check_no_game_data.pyon both files.GPUs tested: n/a (no GPU-specific code; WebGL in the browser pane)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.