Skip to content

Renaming or moving an asset should update every reference to it #80

Description

@RenzoraEngine

Problem

Renaming or moving a file in the Assets panel breaks everything that pointed at it. The texture disappears off the material, the script stops running, the sound goes silent — with no warning that anything happened.

Some of this is already handled: there's an AssetPathChanged event that fires on rename and move, and it correctly updates model paths and animator clips. But it's only wired up to those two things, so every other kind of reference still breaks.

Proposed Solution

Extend the existing AssetPathChanged event so a rename or move fixes up references everywhere:

  • Cover the rest of the components. Materials and their textures, scripts, particles, audio, reflection probes, sprites, terrain, tilemaps — anything storing an asset path should patch itself when the event fires, the way models and animators already do.
  • Cover scenes that aren't open. Right now only the currently-loaded scene gets patched. Other scene files on disk keep pointing at the old path and break the next time they're opened.
  • Cover references inside files, not just components — texture paths saved in material files, asset paths written in scripts and UI markup, and file references inside blueprints.
  • Tell the user what happened. A short "after a rename, so it's clear the fix-up ran

Extend the existing AssetPathChanged event so a rename or move fixes up references everywhere:

  • Cover the rest of the components. Materials and their textures, scripts, particles, audio, reflection probes, sprites, terrain, tilemaps — anything storing an asset path should patch itself when the event fires, the way models and animators already do.
  • Cover scenes that aren't open. Right nscene gets patched. Other scene files on disk keep pointing at the old path and break the next time they're opened.
  • Cover references inside files, not just components — texture paths saved in material files, asset paths written in scripts and UI markup, and file references inside blueprints.
  • Tell the user what happened. A short "updated 12 references" toast after a rename, so it's clear the fix-up ran and how far it reached.

If a reference can't be updated, it should be reported rather than left silently broken.

Alternatives Considered

Give every asset a stable ID in a sidecar file and reference assets by ID instead of path. That's the robust version — renames and moves stop mattering entirely — but it's a large change to how every asset is referenced and saved, and
it'd need a migration for existing projects.ending the event that already exists getsmost of the benefit now.

Alternatively, just warn on rename ("3 things use this file, continue?") without fixing anything. Better than silence, but it leaves the actual work to the user.

Area

Which part of the engine does this affect?

  • Editor UI
  • Rendering / Post-Processing
  • Physics
  • Scripting (Rhai)
  • Blueprint Visual Scripting
  • Animation
  • Terrain
  • Particles
  • Scene Management
  • Import / Export
  • Audio
  • 2D
  • Runtime
  • Other: Asset management

Additional Context

Repro: put a texture on a material, then rename that texture in the Assets panel. The material loses it. Same for a script on an entity, a sound, or a particle effect. Rename a model or an animation clip instead and it survives —
those two are already handled.

Existing pieces to build on:

  • AssetPathChanged event and its rewrite() helper — crates/renzora/src/core/components.rs:843
  • Fired from rename and move — crates/renzora_asset_browser/src/lib.rs:98
  • The two existing listeners, which are the zora_engine/src/lib.rs:1134 andcrates/renzora_animation/src/lib.rs:120`

Adding a listener per component type is a goened scenes and references inside files isthe bigger piece.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestNew feature or requestbugSomething isn't workingplz helpExtra attention is needed

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions