Skip to content

Make Asset.Replaces a proper reference + editor UX - #3295

Merged
xen2 merged 7 commits into
stride3d:masterfrom
xen2:feature/asset-replaces-reference
Jul 26, 2026
Merged

xen2 merged 7 commits into
stride3d:masterfrom
xen2:feature/asset-replaces-reference

Conversation

@xen2

@xen2 xen2 commented Jul 25, 2026

Copy link
Copy Markdown
Member

Turns Asset.Replaces from a URL into an AssetReference (id + location, like Archetype), and surfaces replacements in the editor.

Core

  • Asset.Replaces is now an AssetReference, resolved by id so it survives the target being renamed or moved. As a reference it skips path relativization, which also fixes the save-time crash.
  • Recorded as a design-time Replace dependency link: visible to the editor, but excluded from the default Reference queries so it is never a build dependency.
  • A replacing asset is included in the build only when its target is reachable (dropped the force-root), so the replacer is not compiled a second time.

Editor

  • "Replaced by" link on the replaced asset's property grid (mirror of the forward "Replaces:" node).
  • "Replaced by" badge and tooltip on the replaced asset tile.
  • Inclusion dots reflect what actually ships: a replacing asset's dot follows its target, and a replaced asset shows an orange "overridden" dot (its slot ships someone else's content).
image

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

xen2 added 7 commits July 26, 2026 01:13
Carry id + location like Archetype: resolved id-first with location
fallback, so it survives the target being renamed or moved, and as a
reference it skips path relativization. It is kept out of the dependency
graph so the target is not collected as a build dependency.
Add ContentLinkType.Replace and register Replaces under it. It is
excluded from the default Reference queries so it is never a build
dependency, but the editor can now see who replaces an asset.
Drop the force-root of assets that declare Replaces: the content is
swapped into the target's slot before enumeration, so the target's own
reachability decides whether it ships.
Mirror the forward "Replaces:" node on the target: when another asset
replaces this one, add a read-only link to it.
The replacing asset ships its content through the asset it replaces, so
its dot now mirrors that target's inclusion. It is never a root on its own.
Mirror the "Replaces" overlay icon and tooltip on the target asset, kept
live through CheckAssetReplacements.
The dot means the asset's content is used in the build. A replaced asset
ships its slot with the replacement's content, so it shows an orange
"overridden" dot when reachable (grey when unreachable). The replacing
asset keeps its green dot since its content is what ships.
@xen2 xen2 added ci-enduser Run the end-user sample screenshot + packaging suite on this PR ci-editor Run the GameStudio editor screenshot suite on this PR labels Jul 25, 2026
@xen2
xen2 merged commit c2d5ca7 into stride3d:master Jul 26, 2026
56 of 64 checks passed
@xen2
xen2 deleted the feature/asset-replaces-reference branch July 26, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-editor Run the GameStudio editor screenshot suite on this PR ci-enduser Run the end-user sample screenshot + packaging suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant