Preview stamping a prefab region
tiled_preview_prefabStamp a source map region as a prefab into a target map, copying tiles and optional objects while verifying source revisions for safe reuse.
Instructions
Stamps one source-map region as a prefab: tiles from one source tile layer — carried as tileset+localId references, so a target map missing the tileset fails closed — and optionally objects anchored inside the region's pixel bounds from one source object layer, materialized at planning time into ordinary setTiles and createObject operations against the target map (the plan itself is the frozen prefab; nothing re-reads the source at apply, and an optional expectedSourceRevision asserts the source up front). Empty source cells are skipped unless copyEmpty stamps the rectangle verbatim as erasure; extraTileLayers stamps additional source-to-target tile-layer pairs over the same region in one plan, and flipHorizontal mirrors the tile stamp with official TileLayer::flip bit semantics (tile layers only — combining it with objects fails closed). Objects outside the supported draft profile — custom properties, template instances, unknown members — fail closed rather than being silently dropped, as do cross-map object stamps between maps with differing tile sizes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| target | Yes | ||
| mapPath | Yes | Canonical project-relative POSIX path; absolute paths and .. are forbidden | |
| objects | No | ||
| copyEmpty | No | ||
| sourceMapPath | Yes | Canonical project-relative POSIX path; absolute paths and .. are forbidden | |
| flipHorizontal | No | ||
| extraTileLayers | No | ||
| expectedMapRevision | Yes | SHA-256 revision returned by a read or preview | |
| expectedSourceRevision | No | SHA-256 revision returned by a read or preview | |
| expectedDependencyRevisions | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |