Skip to content

feat(animation): preserve embedded player track metadata - #913

Open
YuchenWell wants to merge 1 commit into
cocos:mainfrom
YuchenWell:0.1.36/feat/migrateEmbeddedPlayer
Open

feat(animation): preserve embedded player track metadata#913
YuchenWell wants to merge 1 commit into
cocos:mainfrom
YuchenWell:0.1.36/feat/migrateEmbeddedPlayer

Conversation

@YuchenWell

@YuchenWell YuchenWell commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Background

Creator stores each embedded player's track group and display name in __editorExtras__. cocos-cli initializes the engine with CC_EDITOR=false, so EmbeddedPlayer does not register this property at runtime.

As a result, animation clip import drops the metadata while deserializing source .anim files. The players remain present, but their group assignments are lost and consumers have to treat them as ungrouped players.

Changes

  • Register __editorExtras__ in the EmbeddedPlayer runtime property and serialization metadata through the existing cc-module overwrite entry point.
  • Keep the compatibility patch guarded against unavailable engine modules and unsupported class metadata.
  • Bump the animation clip importer versionCode from 2 to 3 so existing library artifacts are reimported once with the corrected metadata.

Impact

  • Existing .anim assets are reimported once after upgrading.
  • The public importer version remains 2.0.4 because the source asset format is unchanged.
  • The compatibility change is limited to Embedded Player editor metadata; playback data and frame ranges are unaffected.

@YuchenWell
YuchenWell marked this pull request as ready for review September 4, 2026 07:46
@YuchenWell

Copy link
Copy Markdown
Contributor Author

背景

Creator 将每个嵌入播放器的轨道分组和显示名称存储在 __editorExtras__ 中。cocos-cli 使用 CC_EDITOR=false 初始化引擎,因此 EmbeddedPlayer 在运行时没有注册该属性。

动画剪辑导入器反序列化源 .anim 文件时,会因此丢弃这些编辑器元数据。播放器本身仍然存在,但轨道归属会丢失,使用方只能将它们作为未分组播放器处理。

改动

  • 通过现有的 cc-module overwrite 入口,为 EmbeddedPlayer 补充 __editorExtras__ 运行时属性和序列化元数据。
  • 对引擎模块不存在或类元数据不受支持的情况进行兼容保护。
  • 将动画剪辑导入器的 versionCode2 提升到 3,使已有 Library 产物能够使用修正后的元数据重新导入一次。

影响

  • 升级后,已有 .anim 资源会自动重新导入一次。
  • 由于源资源格式没有变化,对外的导入器版本仍保持为 2.0.4
  • 兼容处理仅影响嵌入播放器的编辑器元数据,不改变播放数据和帧区间。

@YuchenWell YuchenWell changed the title fix(animation): preserve embedded player track metadata feat(animation): preserve embedded player track metadata Sep 4, 2026
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