Expand description
Layout convention for where a scaffolded project’s bundled demo simulation images live under
<project>/assets/images/ (asset layout consolidation follow-up to the “unsupported content
tyoe” MuJoCo crash fix).
Two independent places need to agree on this exact convention so a scaffolded project ends
up with exactly one copy of each bundled demo image, never a silently duplicated one under
simulation/environments/<env>/assets/...:
scripts/release/build/package-templates.sh, which stages the downloaded-templates tarball (statically, frompackages/mecha10-templates/templates/assets/) - the single template-resolution pathmecha10 initcopies from (LAB-2034).mecha10_cli::handlers::init::rewrite_bundled_image_source_paths, which fixes up a copiedenvironment.json’stype: "image"sourcefields to point at wherever the tarball above actually placed the file.
§The rule
- An image referenced by exactly one bundled environment’s
type: "image"objects is environment-specific: it lands atassets/images/<env_name>/<basename>. - An image referenced by more than one bundled environment is shared: it lands at
assets/images/<basename>directly - written/copied once, not once per environment.
As of this writing only basic_arena is bundled, so every one of its demo images
(aiko.jpg/phoebe.jpg) lands in the env-specific tier at
assets/images/basic_arena/. This module’s logic re-derives the tier from whatever set of
environments is actually present, so a second bundled environment sharing one of these files
would automatically start landing it in the shared tier.
A user’s own hand-authored image (e.g. dropped at assets/images/my_photo.jpg and referenced
from their own edited environment.json) is untouched by any of this - it was never part of
the bundled catalog, so it never appears in the references this module reasons about.
Functions§
- bundled_
image_ project_ path - Where a bundled demo image with the given
basename, declared byenv_name, belongs under a project’s canonicalassets/images/tree - see the module docs for the shared-vs-env-specific rule.referencing_env_countis the number of distinct environments that reference this basename (fromcount_referencing_environments). - count_
referencing_ environments - Count how many distinct environments reference each image basename, given every
(environment_name, image_basename)pair found across a set of bundled environments’type: "image"objects.