Repository navigation
支持 Lottie、dotLottie 和动画 SVG 素材 - #87
devin-ai-integration[bot] wants to merge 18 commits into
Conversation
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
…the dev server Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
…orever Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
|
Browser UI tested on #87: Vector import, preview, and MP4 export passedLottie, dotLottie, SMIL, and CSS animations all moved in preview and in the decoded MP4. The cyan and magenta SVG #83–#86: Stack results and one persistence caveatCanvas backgrounds, reverse, both tested speed curves, the 3-second freeze, stickers, and shapes all rendered in the saved MP4s. Five beat markers matched exported audio onsets within 34 ms. Exports with noise reduction enabled completed. The video clip's denoise toggle read off after the first reload but persisted on two retests; the audio toggle persisted on the first reload. |
Summary
支持把 Lottie(
.json)、dotLottie(.lottie)和动画 SVG(SMIL 或 CSS 动画)导入素材库。导入时逐帧渲染成 APNG,之后按现有的动图素材处理,所以预览、MP4 导出、工程保存和剪映草稿都不用单独适配。代价是导入后不能再改矢量内容。静态 SVG 仍和以前一样栅格化成 WebP。getSimpleDuration(),CSS 取getComputedTiming();都没有时按 3 秒)。lottie-web的lottie_light_canvas版本,按需动态加载,goToAndStop(frame, true)逐帧绘制到 canvas。light 版本不带表达式引擎,导入文件里的表达式不会被当作脚本执行。dotLottie 用fflate解包,读取manifest.json里的第一个动画,images/或i/下的图片内嵌为 data URL。pauseAnimations()/setCurrentTime()和Animation.currentTime定到每一帧,再把当前状态写进副本:transform等,以及适用元素上的d/cx/r/x…)写成行内样式points、x1)从animVal读取animateMotion的位移换算成相对父元素的矩阵<img>绘制<script>、foreignObject、on*事件属性和javascript:链接mediaAccept新增.svg,.json,.lottie,mediaKind把这几类文件识别为图片;MCPimport_file新增对应 MIME,import_asset/import_file的描述也已更新。vite.config.ts预构建lottie_light_canvas,避免开发时首次导入 Lottie 触发页面重载。测试:新增
apng.test.ts;e2eMCP imports Lottie, dotLottie and animated SVG as animated images导入动画 SVG、静态 SVG、Lottie、dotLottie 和一个非法 JSON,导出 MP4 后按像素检查 SMIL 位移、CSS 淡入和 Lottie 位移,并确认 SVG 里的脚本没有执行。Link to Devin session: https://app.devin.ai/sessions/a882af08b80c444280600c6cdc988c2e
Open in Devin Desktop: https://app.devin.ai/desktop/session/a882af08b80c444280600c6cdc988c2e?variant=devin
Requested by: @x007xyz
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work