Skip to content

Fix duplicate display name for aliased animation clips - #1247

Merged
untoldengine merged 2 commits into
developfrom
bugfix/fix_registered_animation_names
Sep 24, 2026
Merged

untoldengine merged 2 commits into
developfrom
bugfix/fix_registered_animation_names

Conversation

@untoldengine

Copy link
Copy Markdown
Owner

Summary

  • registerRuntimeAnimationClips registers a single-clip asset under both its embedded name (e.g. Anim) and the caller's preferred filename-derived name (e.g. hol_idle_anim) when they differ, pointing both keys at the same AnimationClip instance so changeAnimation keeps working with either name.
  • getAllAnimationClips/removeAnimationClip treated every dictionary key as an independent clip, so the editor listed one logical animation twice, and removing one name could leave the other dangling.
  • AnimationComponent now tracks which keys are internal aliases (hiddenClipAliases) so getAllAnimationClips reports one display name per logical clip (the preferred name), and removeAnimationClip removes every key sharing the same clip identity.
  • Re-registering under the same preferred name against a clip with a different embedded name (e.g. a re-exported asset) prunes the old clip's stale alias too, so it doesn't linger as an unreachable entry.
  • changeAnimation and other lookups are unaffected: both names remain live keys in animationClips, preserving backward compatibility.

Test plan

  • Added Tests/UntoldEngineTests/AnimationClipAliasTests.swift (11 tests) covering: alias creation/skip, multi-clip assets, independently-exported clips sharing an embedded name, re-registration/replacement pruning, removal cascading via either name, and engine-level changeAnimation/getAllAnimationClips/removeAnimationClip through aliases.
  • swift test --filter Animation — all suites pass (98 + 9 tests, 0 failures).
  • swift build — clean build.

registerRuntimeAnimationClips registers a single-clip asset under both
its embedded name and the caller's preferred name when they differ,
pointing both keys at the same AnimationClip so changeAnimation keeps
working with either. getAllAnimationClips and removeAnimationClip
treated every key as an independent clip, so the editor listed one
animation twice and removing one name could leave the other dangling.

AnimationComponent now tracks which keys are internal aliases so
getAllAnimationClips reports the preferred name once, and
removeAnimationClip removes every key sharing the same clip identity.
Re-registering a preferred name against a clip with a different
embedded name (asset re-export) prunes the old clip's stale alias too.
@untoldengine
untoldengine merged commit 352b101 into develop Sep 24, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant