Adom Wiki
Public Made by Adomby adom
How the Adom Wiki (wiki.adom.inc) works and how to drive it with the adom-wiki CLI: the two storage layers (git page repo vs package registry), hosting source by pushing files (not a tarball), making packages, cutting per-platform releases, and the three-tier skill layout (user skills ship, dev-skills/ and publish-skills/ stay source-only). adom-wiki is the current tool; adompkg is deprecated. Read this first before publishing or installing.
3D viewer: ground rebuild discards consumer styling (needs a hook, or no dispose)
Split out of adom/wiki#60 (@aravk item 3), which is closing with the cheap items done.
Problem
setGroundVisible(true) does not toggle the ground, it rebuilds it. The ground is created inside frameModel(), sized and positioned from the current content bounds, and each call disposes the existing mesh and constructs a fresh PBRMetallicRoughnessMaterial. Any consumer customization of the ground (material, colour, texture, opacity) is silently discarded, not just on an explicit visibility toggle but on every reframe, which happens on load and on layer changes too.
Ask, in AravK's words
Preserve the ground's material and state across visibility toggles, or expose a ground-style hook.
Why it is two different changes
These are worth separating, because one is easy and one is not:
A style hook is straightforward: a
groundMaterialoption, or anonGroundCreated(mesh)callback fired after each rebuild so a consumer can restyle it. This does not stop the rebuild, it just gives the consumer a reliable moment to reapply. Roughly 15 lines.Genuinely preserving arbitrary consumer state means not disposing at all: keeping the mesh across reframes and updating only its size and position. That is a rework of the ground block in
frameModel, and it needs care around the ground being tied tozUpand to content extent, both of which can change between frames.
Option 1 solves the stated need for most consumers and is cheap. Option 2 is the honest fix and is not.
My inclination is to ship the hook first and see whether anyone actually needs the second, since a callback that fires on every rebuild is a complete answer for restyling, and the rebuild itself exists for a real reason: the ground has to track content bounds.