Closed general

3D viewer: per-page control visibility (Ground, Bottom light) and custom animation button labels

John Lauer · ·closed by Colby Knox

Feature request: let a page choose which controls the 3D viewer shows, and what the animation button says.

Why: on site/plan models (not PCBs) the Ground and Bottom light buttons don't apply. The model brings its own ground, and they only confuse readers. A GLB whose one animation is a gate swinging shows "Replay", which reads oddly; the owner asked for "Open gate" / "Close gate".

Ask (page.json component.viewer_3d, plus the same as embed query params):

  • "controls": { "ground": false, "bottomLight": false } to hide those buttons (today "ground": false only turns the plane off; the button stays).
  • "animationLabel": "Open gate", or better, named segments from the GLB so the button toggles between two labels and plays half the clip each time, e.g. "animationSegments": [{"label":"Open gate","from":6.5,"to":12.5},{"label":"Close gate","from":15.5,"to":21.5}].
  • Optionally, a way to show a hidden layer as a top-level toggle button (not only inside the Layers panel), e.g. "layerButtons": ["old"].

Seen on a private project page; repro with any GLB that has one animation group and its own ground mesh.

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Shipped on wiki.adom.inc. Everything here goes in page.json under component.viewer_3d, with the same as query parameters on an embed:

"viewer_3d": {
  "controls": { "ground": false, "bottomLight": false },
  "animationSegments": [
    { "label": "Open gate", "from": 6.5, "to": 12.5 },
    { "label": "Close gate", "from": 15.5, "to": 21.5 }
  ],
  "layerButtons": ["old"]
}
  • controls hides those buttons ("replay": false hides the animation button). Query: ?hide=ground,bottomlight.
  • animationLabel: "Open gate" renames the animation button. Query: ?animlabel=Open gate.
  • animationSegments: times are seconds on the GLB's timeline. The model opens at the first segment's start and does not autoplay; each click plays one segment and holds its last frame, then the button names the next one. Query: ?segments=Open gate:6.5-12.5;Close gate:15.5-21.5.
  • layerButtons gives a layer (by name or label) its own toggle beside the other buttons. A name the model does not have gets no button. Query: ?layerbuttons=old.

One thing to do: these are read when the page is pushed, so if your page.json already has them from before today, push it once more and they take effect.

Pushing a page.json with a key the viewer does not know returns VIEWER_3D_OPTIONS_IGNORED listing every key, and pushing an animated GLB to a page that has not named its animation returns VIEWER_3D_ANIMATION_BUTTON. The wiki-hero-glb skill in adom-wiki-skillpack 0.8.61 documents all of it.

Colby Knox closed this ·

Log in to reply.