Skip to content

AnimationPlayer keyframe resource cache prevents valid deletion of swapped sprite (Ghost Dependency) #114637

@bazsupport

Description

@bazsupport

Tested versions

4.4.1 and 4.5.1

System information

Windows 10

Issue description

I have found a reproducible bug where the editor fails to release a file dependency after it has been swapped out in an AnimationPlayer keyframe. This prevents the file from being cleanly deleted, causing "Unable to open file" errors and failing to show up in the Orphan Resource Explorer.

Steps to reproduce

  1. Create a Scene with a Sprite2D and an AnimationPlayer.
  2. Create an animation track that keys the texture property of the Sprite2D to use image_A.png.
  3. In the animation track (or Inspector), swap the keyframe's value to use image_B.png.
  4. Immediately delete image_A.png from the FileSystem.
  5. Bug: The console begins spamming ERROR: Unable to open file: res://.godot/imported/image_A.png... even though the file is no longer referenced in the scene.
  6. Verification: Open Tools > Orphan Resource Explorer. The deleted file is NOT listed, implying the editor still thinks it has an owner (likely the UndoHistory or Animation resource cache).
  7. Fix: The workaround is to close editor, delete .godot folder, and then reopen the editor.

Minimal reproduction project (MRP)

anim keyframe bug.zip

Godot_v4.5.1-stable_win64_dWRKdQnGnZ.mp4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions