Stamped prefabs flatten nested collections, losing the master's grouping #36

Open
opened 2026-08-19 15:22:11 +00:00 by ImBenji · 0 comments
Owner

stampPrefabInstance gathers canvas objects recursively through nested collections and emits them as a flat list of instance children, so a stamped instance loses whatever grouping the master had. Promoting a stamped result back into a new prefab won't reproduce the original hierarchy.

That was the agreed scope for the first cut of stamping (see #35) — instance ownership is typed to canvas objects, so cloning a collection means the instance owning collections too.

Worth keeping separate from what's left in #35 though. That issue's remainder is about cloning stations, segments and nodes, which drags in serialisation, deletion guards, hide-cascade and the line-reference question. This one only needs structure preserved for prefabs that are already pure canvas objects, and could be done without touching track at all.

Needs generatedChildIds (or a sibling list) to cover collections, _collectionParentOf entries for the clones, and the same deletion and hide-cascade handling that generated canvas objects already get.

`stampPrefabInstance` gathers canvas objects recursively through nested collections and emits them as a flat list of instance children, so a stamped instance loses whatever grouping the master had. Promoting a stamped result back into a new prefab won't reproduce the original hierarchy. That was the agreed scope for the first cut of stamping (see #35) — instance ownership is typed to canvas objects, so cloning a collection means the instance owning collections too. Worth keeping separate from what's left in #35 though. That issue's remainder is about cloning stations, segments and nodes, which drags in serialisation, deletion guards, hide-cascade and the line-reference question. This one only needs structure preserved for prefabs that are already pure canvas objects, and could be done without touching track at all. Needs `generatedChildIds` (or a sibling list) to cover collections, `_collectionParentOf` entries for the clones, and the same deletion and hide-cascade handling that generated canvas objects already get.
ImBenji added the enhancement label 2026-08-19 15:22:11 +00:00
ImBenji added this to the Arcs & Angles project 2026-08-19 15:22:11 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IMBENJI.NET/Metro-Map-Maker#36