Skip to content

feat(export): 新增 Cocos Creator 2D 一键导入 - #494

Open
xyh202131 wants to merge 18 commits into
1024XEngineer:mainfrom
xyh202131:feat/directional-generation-backend
Open

feat(export): 新增 Cocos Creator 2D 一键导入#494
xyh202131 wants to merge 18 commits into
1024XEngineer:mainfrom
xyh202131:feat/directional-generation-backend

Conversation

@xyh202131

Copy link
Copy Markdown
Contributor

改动概述

为 Windup 增加 Cocos Creator 3.8.8 2D 资产一键导入能力:

  • 网页端新增 Cocos Creator 导出目标、配对、进度展示和失败后下载回退。
  • 提供 Creator 扩展,在本机通过六位连接码完成授权,并把资产事务式写入当前工程。
  • 生成 Creator 可识别的纹理、SpriteFrame、AnimationClip、Prefab 与稳定 .meta
  • 增加 ZIP 完整性、路径穿越、容量上限、来源校验、任务幂等和失败回滚保护。
  • 保留命令行导入方式,并附带可直接安装的扩展包。

验收结果

  • 使用真实“网站看板娘-46-默认造型”2D 资产在 Cocos Creator 3.8.8 中连续导入 2 次。
  • 每次导入均得到 64 张 256×256 RGBA8 帧、2 个动画和 1 个 Prefab。
  • 重复导入更新同一目录,动画时序、引用、锚点和资源 UUID 校验通过。
  • 前端:70 个测试文件、943 项测试通过。
  • 覆盖率:语句 92.65%、分支 87.42%、函数 94.87%、行 95.56%。
  • 导入器 49 项测试、Creator 扩展 31 项测试通过。
  • 格式检查、静态检查、类型检查、生产构建和扩展安装包校验通过。

范围说明

本 PR 不修改后端。未包含本地记忆文件和测试临时输出。

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 20, 2026 12:18pm

@github-actions

Copy link
Copy Markdown

⚠️ @xyh202131,此 PR 尚未关联 issue。请在 PR 描述中使用 Closes #123 等关闭关键字;更新描述后,此提醒将自动标记为已解决。

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.61977% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ntend/src/features/export-package/export-panel.tsx 98.95% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本次重点核对了网页桥接、导出清单、旧包兼容路径、Creator 扩展的事务/回滚以及生成资产引用。扩展与清单的聚焦测试通过,但旧版通用包转换在带方向或需清洗名称的动作上会构造错误的帧目录,导致导入直接失败。

验证:扩展/清单/规划/UUID 共 65 项测试通过;最小复现返回 IMPORT_SOURCE_MISSING: frames/Walk / Forward/Walk-Forward-south_000.png。完整前端测试因当前工作区依赖可执行权限问题未能运行。

View job run

return {
id: String(action.id ?? `legacy-action-${index}`),
name: String(action.name ?? `action-${index}`),
export_name: String(action.name ?? `action-${index}`),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] 从旧版实际路径恢复 export_name

这里把旧版 meta.json 的显示名直接当成 export_name,但旧导出器实际用经过清洗并附加方向的名称创建目录(例如动作名 Walk / Forward、方向 south 会落到 frames/Walk-Forward-south/)。随后 planImport() 会查找 frames/${export_name}/${frame.file},因此所有非默认方向或名称含空格/斜杠的旧包都会报 IMPORT_SOURCE_MISSING,与本函数声明的旧包兼容目标冲突。请从 atlas.file/帧文件名恢复原始导出目录名,或按旧导出器的命名规则重建并覆盖重复名场景。

@huyanxius

Copy link
Copy Markdown
Collaborator

建议拆几个 PR,这个没法review

@huyanxius
huyanxius self-requested a review August 20, 2026 12:34
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deployment failed for project windup with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/huyan-s-projects1?upgradeToPro=build-rate-limit

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.

2 participants