create-motion-graphics

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Before using this skill, read the required continuation in full. It is part of this skill and contains mandatory workflow, tool-contract, and safety instructions; do not act from this entry file alone.
使用此 skill 前,请完整阅读必需的后续文档。它是此 skill 的一部分,包含强制性工作流、工具契约和安全说明;不要只根据此入口文件采取行动。

Create Motion Graphics

创建 Motion Graphics

Plugin host and project

插件宿主与项目

Use the plugin-provided
chatcut
MCP server (tool namespace
chatcut_chatcut
) and the project ID from the user's editor URL or the plugin's project result. This plugin works with the Web editor, including local development URLs. Do not open ChatCut Desktop or use
chatcut_desktop
for a Web project. If
chatcut
tools are unavailable, report the connection failure; do not submit the task to the editor's native Agent as a substitute.
使用插件提供的
chatcut
MCP 服务器(工具命名空间
chatcut_chatcut
),以及用户编辑器 URL 或插件项目结果中的项目 ID。此插件适用于 Web 编辑器,包括本地开发 URL。对于 Web 项目,不要打开 ChatCut Desktop,也不要使用
chatcut_desktop
。如果
chatcut
工具不可用,请报告连接失败;不要将任务提交给编辑器的原生 Agent 作为替代方案。

Find MG references before designing

设计前查找 MG 参考

Browse and confirm a visual direction

浏览并确认视觉方向

For production, reuse an accepted project style or user-supplied brand/reference. Use
manage_design_style get
when its full spec is not already known. Routine text/placement edits need no new style selection or catalog rescan.
When a new direction is needed or the user asks to browse alternatives, start with
browse_library
references: {view: "style-overview"}
. Read ALL numbered contact sheets, following
nextOffset
until
complete
. They contain published, agent-enabled style representatives, including linked existing Design Styles.
list_presets
is only the legacy catalog subset; it cannot replace this visual overview. Retry a failed page; report an incomplete overview instead of silently skipping it.
For speech-led video, understand the spoken content and inspect representative video frames before shortlisting styles. Reuse transcript and frame evidence already in context. Consider the topic, delivery tone, on-screen language, and the footage's color, subject framing and background alongside the style previews.
When the visual direction is not yet agreed, shortlist up to 6 distinct fits for the current content and footage, and read their
hero
parts. Load the host's
widget-forms
skill and, only when the host can display images in chat, show actual
heroPreview.url
images with short names. Otherwise describe the visual differences in text and say image previews are unavailable here. Keep each text choice mapped to its reference ID; use one Other choice for preferences or another batch without repeating choices or adding a separate Show more option. Wait for the selection before applying a new style and producing the MG, unless the user has already chosen a direction or explicitly delegated the style choice. An Other answer is not acceptance.
对于正式制作,复用已确认的项目样式或用户提供的品牌/参考素材。如果尚不清楚完整规范,请使用
manage_design_style get
。常规文本或位置调整不需要重新选择样式或重新扫描目录。
当需要新的方向或用户要求浏览备选方案时,先使用
browse_library
references: {view: "style-overview"}
。按照
nextOffset
继续操作直至
complete
,阅读所有带编号的样式总览图。它们包含已发布且支持 Agent 的样式代表,包括链接到现有 Design Styles 的样式。
list_presets
仅是旧版目录的子集,不能替代这一完整的视觉概览。页面加载失败时重试;如果概览不完整,应予以报告,而不是悄悄跳过。
对于口播主导的视频,先理解口述内容,并在筛选样式前检查有代表性的视频帧。复用上下文中已有的转录文本和帧证据。结合主题、表达语气、屏幕上的语言,以及素材的色彩、主体取景和背景,一并评估样式预览。
当视觉方向尚未达成一致时,针对当前内容和素材筛选最多 6 个不同且合适的候选项,并阅读它们的
hero
部分。加载宿主的
widget-forms
skill;仅当宿主能在聊天中显示图片时,使用简短名称展示实际的
heroPreview.url
图片。否则,以文字描述视觉差异,并说明此处无法提供图片预览。将每个文字选项映射到其参考 ID;使用一个
Other
选项来收集偏好或进行另一批次选择,不要重复选项,也不要添加单独的
Show more
选项。在应用新样式并生成 MG 之前,等待用户完成选择;但用户已经选定方向或明确委托选择样式的情况除外。回答
Other
不代表接受。

Apply the selected style

应用选定的样式

Read the selected representative's
summary
,
hero
and
members
. Follow its
designStyleAction
with
manage_design_style
:
  • apply_preset
    : use the returned
    presetId
    directly; do not clone or update the preset merely to save reference metadata.
  • apply
    : reuse the returned
    designStyleId
    for an existing saved user style.
  • create
    : only an independent reference needs a new user-owned style. Define and save its palette, fonts and reusable visual rules from the selected reference. Reuse the reference's documented palette; if absent, derive a coherent palette from its representative image. Save
    designSpec.referenceSources: [{id: "<reference ID>"}]
    and the individual
    heroPreview.url
    in BOTH
    thumbnailUrl
    and
    designSpec.images: [{role: "style reference", url: "<heroPreview.url>"}]
    . Use
    applyToProject: true
    ; preserve existing images when patching an array.
After applying, call
get
for the fresh full spec and source IDs; do not carry over the previous style's cached rules. For a new style, verify that its palette, fonts, source, cover and reference image were saved. A source ID alone does not save an image. Reference images are visual evidence, not footage/backgrounds to embed or example copy to reproduce.
Use
fontRecommendations["zh-Hans"]
/
.en
according to the actual on-screen text, including bilingual text and Latin numbers. Reuse an accepted font plan; an empty language group is unresolved. Match the reference's typographic character and heading/body hierarchy, and check glyph coverage and runtime availability. Save selected families/roles in
designSpec.fonts
, and language, weight, italic and required axes in
styleGuide
. A cross-style form example cannot replace this plan. Only when curating missing fonts or explicitly adapting typography, read Font matching; Chinese matching starts from a generated Chinese effect image, not English letterforms.
阅读所选代表的
summary
、
hero
和
members
。使用
manage_design_style
遵循其
designStyleAction
:
  • apply_preset
    :直接使用返回的
    presetId
    ;不要仅仅为了保存参考元数据而克隆或更新 preset。
  • apply
    :对于现有已保存的用户样式,复用返回的
    designStyleId
    。
  • create
    :只有独立参考项才需要创建新的用户自有样式。根据选定参考定义并保存其调色板、字体和可复用视觉规则。复用参考中已记录的调色板;如果没有,则从其代表图推导出一套协调的调色板。保存
    designSpec.referenceSources: [{id: "<reference ID>"}]
    ,并将单独的
    heroPreview.url
    同时保存到
    thumbnailUrl
    和
    designSpec.images: [{role: "style reference", url: "<heroPreview.url>"}]
    中。使用
    applyToProject: true
    ;修补数组时保留已有图片。
应用后,调用
get
获取最新的完整规范和源 ID;不要沿用上一个样式的缓存规则。对于新样式,验证其调色板、字体、来源、封面和参考图是否已保存。仅有源 ID 并不意味着图片已保存。
参考图片是视觉证据,不是要嵌入的素材或背景,也不是要复制的示例文案。
根据实际屏幕文本使用
fontRecommendations["zh-Hans"]
/
.en
,包括双语文本和拉丁数字。复用已确认的字体方案;空的语言组视为尚未解决。让字体匹配参考的排版特征及标题/正文层级,并检查字形覆盖范围和运行时可用性。
将选定的字体系列和角色保存到
designSpec.fonts
,并将语言、字重、斜体及所需可变轴保存到
styleGuide
。跨样式形式示例不能替代该方案。仅在整理缺失字体或明确需要调整排版时,才阅读字体匹配;中文匹配从生成的中文效果图片开始,而不是从英文字形开始。

Match instances to the needed MG forms

将实例匹配到所需 MG 形式

Use the spoken content and target frames to decide which MG forms are useful; let the reference previews refine those choices. Keep the confirmed visual language across the video, and find suitable instances for each needed form. Choose instances yourself unless the user asks to compare them. Different forms can use different instances; recurring components can reuse an inspected one. Follow
nextReferenceSearch
when returned:
  • With related members, browse
    kind: "instance", styleId: "<representative UUID>"
    or read relevant member IDs.
  • If a needed form has no fitting member, search the WHOLE instance library by content/form
    query
    or
    facets.form
    , omitting
    styleId
    ,
    facets.style
    and style-name terms, even if other forms already have same-style matches.
  • Compare the cover collage, then read selected IDs with
    parts: ["summary", "hero"]
    . Add
    motion
    for animation and
    code
    for implementation. If a code-backed reference returns
    templateInspection
    , use its read-only call for saved property schema/defaults; JSX may read props without declaring their values.
    legacyTemplateRefs
    are template IDs:
    manage_template get
    reads metadata, and
    list_assets
    reads MG properties. Neither applies or copies a template.
    inspect_asset
    is for current-project media/MGs, not catalog source IDs.
Adapt the instance's composition, hierarchy, spacing and reveal structure to the fixed project fonts, palette, materials and actual shot. If the broader form search also has no fit, extend the style board and state that limitation. Batch relevant detail reads; finding one instance does not cover unrelated forms. Follow
pendingIds
for split responses;
known
may include only returned versions and parts still in context. Each motion sheet is ONE design at real timestamps; a montage is not one layout, and a static image does not establish animation.
For a new/substantially redesigned talking-head overlay, read Overlay composition. Import only production files from
materials
that will appear in the result; use their project asset IDs. Review the MG composed with the target footage.
根据口述内容和目标帧判断哪些 MG 形式有用;让参考预览进一步优化这些选择。保持整个视频中已确认的视觉语言,并为每种所需形式寻找合适的实例。除非用户要求比较,否则由你自行选择实例。不同形式可以使用不同实例;重复出现的组件可以复用一个已检查的实例。
当返回
nextReferenceSearch
时遵循其指引:
  • 对于相关成员,浏览
    kind: "instance", styleId: "<representative UUID>"
    ,或读取相关成员 ID。
  • 如果某种所需形式没有合适成员,则按内容或形式
    query
    或
    facets.form
    搜索整个实例库,并省略
    styleId
    、
    facets.style
    和样式名称相关词项,即使其他形式已经有同风格匹配项,也仍要执行此搜索。
  • 比较封面拼图,然后使用
    parts: ["summary", "hero"]
    读取选定 ID。需要动画时添加
    motion
    ,需要实现代码时添加
    code
    。如果代码型参考返回
    templateInspection
    ,使用其只读调用获取已保存的属性 schema 和默认值;JSX 可以读取 props,而无需在其中声明其值。
    legacyTemplateRefs
    是模板 ID:
    manage_template get
    读取元数据,
    list_assets
    读取 MG 属性;两者都不会应用或复制模板。
    inspect_asset
    用于当前项目的媒体或 MG,而不是目录中的源 ID。
根据固定的项目字体、调色板、材质和实际镜头,调整实例的构图、层级、间距和显现结构。如果更广泛的形式搜索仍无匹配项,则扩展样式板并说明该限制。批量执行相关详情读取;找到一个实例并不涵盖无关形式。对于拆分响应,遵循
pendingIds
;
known
只能包含已返回的版本以及仍保留在上下文中的部分。每张动态分镜表都只对应一个按真实时间戳呈现的设计;拼贴不能代表单一布局,静态图片也不能证明存在动画。
对于新建或经过大幅重设计的口播人物叠加层,请阅读叠加构图。仅从
materials
中导入会出现在最终结果中的正式文件;使用其项目资产 ID。查看 MG 与目标素材合成后的效果。

Use the references when authoring

编写时使用参考

Read the selected instance's
code
when borrowing its implementation, or read linked template properties with
manage_template list_assets
. Use it as reference in the code workflow below while preserving the project style.
Inspect selected images as well: a URL, ID or search result alone is not a viewed reference. Keep STYLE evidence for appearance and cross-style FORM evidence for structure. If a selected reference fails, retry or report the missing evidence rather than claiming it was inspected.
Use this skill when a ChatCut plugin task requires a Motion Graphic asset authored or patched as inline JSX. The built-in ChatCut Agent has its own
motion-graphic-gen
workflow; do not switch to it from this plugin task.
Antigravity plugin Motion Graphics are direct-authored. Use
create_motion_graphic_from_code
for new JSX assets and
edit_asset
for existing MG JSX. This surface does not provide
submit_motion_graphic
; do not translate the request into a Gemini prompt or generation brief. If the direct-authoring tools are missing, stop and report the unavailable ChatCut plugin tools.
Pass Motion Graphic source inline through the
chatcut
MCP tools. Do not stage code in the ChatCut repository,
ai-working/
,
/tmp
, a local HTTP server, generated code files, or guessed application paths when the tool accepts inline JSX directly.
借用实现方式时,阅读所选实例的
code
;或者使用
manage_template list_assets
读取关联模板属性。在下面的代码工作流中将其作为参考,同时保持项目样式。
也要实际检查选中的图片;仅有 URL、ID 或搜索结果并不代表已经查看参考。保留用于体现外观的 STYLE 证据,以及用于体现结构的跨样式 FORM 证据。如果所选参考检查失败,应重试或报告缺少证据,而不是声称已经检查。
当 ChatCut 插件任务要求以内联 JSX 编写或修补 Motion Graphic 资产时,使用此 skill。内置 ChatCut Agent 有自己的
motion-graphic-gen
工作流;不要从本插件任务切换到该工作流。
Antigravity 插件的 Motion Graphics 采用直接编写方式。对于新的 JSX 资产,使用
create_motion_graphic_from_code
;对于现有 MG JSX,使用
edit_asset
。此操作界面不提供
submit_motion_graphic
;不要将请求改写为 Gemini 提示词或生成简介。如果缺少直接编写工具,请停止操作并报告 ChatCut 插件工具不可用。
通过
chatcut
MCP 工具内联传递 Motion Graphic 源代码。当工具接受内联 JSX 时,不要在 ChatCut 仓库、
ai-working/
、
/tmp
、本地 HTTP 服务器、生成的代码文件或猜测的应用路径中暂存代码。

Core Principles

核心原则

  • Inspect project state when canvas size, fps, existing visual language, placement, or timeline conflicts are not already known.
  • Identify the required inputs in Before You Code before authoring JSX.
  • Create or update Motion Graphic assets through the available inline-code asset workflow; use current tool schemas for exact payload shapes.
  • Place or move assets through the timeline editing workflow when the edit requires timeline placement.
  • Re-read project state and verify the visible frame after structural or visual changes.
  • 当画布尺寸、fps、现有视觉语言、放置位置或时间线冲突情况尚不明确时,检查项目状态。
  • 在编写 JSX 前,从 编码前 环节中确定所需输入。
  • 通过可用的内联代码资产工作流创建或更新 Motion Graphic 资产;使用当前工具 schema 获取准确的 payload 结构。
  • 当编辑需要放置到时间线时,通过时间线编辑工作流放置或移动资产。
  • 在进行结构或视觉更改后,重新读取项目状态并验证可见帧。

Before You Code

编码前

Before writing JSX, identify only the information needed for this edit:
  • Placement: start time, duration, target layer if known, and the target frame the graphic must compose with.
  • Role in the edit: what job this Motion Graphic performs in the video.
  • Content: exact text, numbers, media, or visual facts that must appear.
  • Timing: whether internal motion should sync to speech, music, or a visual event.
  • Visual source: user-provided style, project Design Style, brand colors/fonts, or an accepted existing Motion Graphic.
  • Editable fields: which text, colors, numbers, booleans, image, or video values should become properties.
Ask only for missing high-leverage inputs that would materially change the result.
在编写 JSX 前,仅确定此次编辑所需的信息:
  • 放置:开始时间、持续时间、已知的目标图层,以及图形必须合成到的目标帧。
  • 在编辑中的职责:此 Motion Graphic 在视频中承担的任务。
  • 内容:必须显示的确切文本、数字、媒体或视觉事实。
  • 时序:内部动效是否需要与语音、音乐或视觉事件同步。
  • 视觉来源:用户提供的样式、项目 Design Style、品牌颜色和字体,或已确认的现有 Motion Graphic。
  • 可编辑字段:哪些文本、颜色、数字、布尔值、图片或视频值应公开为属性。
只询问缺失且会实质性改变结果的高杠杆输入。

Visual system and placement

视觉系统与放置

Use the confirmed full Design Style and inspected references above. For a new custom direction, establish one composed result before batching; accepted directions and routine fixes need no renewed style confirmation.
Choose each composition, position, size and reading time from the actual shot and speech span. Keep shared typography, palette, materials and motion, while adapting the reference's form to the content. A fixed left/right anchor or card container is appropriate only when the composition calls for it.
Reuse an asset with per-item properties for an intentionally recurring component with the same information structure. New structures need their own instance reference and composition. Overlay bounds should tightly contain the graphic; use timeline dimensions only for a design that visibly spans the frame.
Match asset duration and internal beats to the placed timeline span. If timing changes materially, update the MG instead of truncating unfinished animation. Review composed settled frames side by side for a batch, correcting collisions, readability and unintended repetition before reporting completion.
使用上文已确认的完整 Design Style 和已检查的参考。对于新的自定义方向,在批量处理前先建立一个合成结果;已确认的方向和常规修复不需要重新确认样式。
根据实际镜头和语音片段时长选择每个构图、位置、尺寸和阅读时长。保持共享的排版、调色板、材质和动效,同时使参考的形式适应内容。只有在构图确实需要时,才使用固定的左侧或右侧锚点或卡片容器。
对于有意重复出现、且信息结构和视觉形式相同的组件,可复用一个资产并使用条目级属性。新结构需要自己的实例参考和构图。叠加层边界应紧密包含图形;只有当设计明确跨越整个画面时,才使用时间线尺寸。
使资产时长和内部节拍与放置后的时间线区间相匹配。如果时序发生实质变化,应更新 MG,而不是截断尚未完成的动画。
对于批量任务,并排检查合成后的稳定帧,在报告完成前修正碰撞、可读性问题和非预期重复。

Editable Properties

可编辑属性

Expose user-visible and likely-to-change values as editable properties.
  • Visible text, primary colors, accent colors, and key numeric values should be properties.
  • Font choices should be
    font
    properties when users may reasonably change them.
  • Image and video sources must be
    image
    /
    video
    properties.
  • Code keys must match the property schema keys exactly.
  • Read values from
    item.props
    ; do not hardcode visible content that the user may reasonably want to change later.
  • Use item-level property overrides only for intentionally recurring components with the same viewer task, information structure, and visual form. If any of those differ, create another MG asset and share palette, type, and motion logic instead.
Property entries should declare a stable key, user-facing label, type, and default value. Supported property types include text, number, color, boolean, select, font, image, and video.
将用户可见及可能发生变化的值公开为可编辑属性。
  • 可见文本、主要颜色、强调色和关键数值应设为属性。
  • 当用户可能合理地更改字体选择时,应将其设为
    font
    属性。
  • 图片和视频来源必须使用
    image
    或
    video
    属性。
  • 代码中的键必须与属性 schema 的键完全匹配。
  • 从
    item.props
    读取值;不要硬编码用户之后可能合理地希望更改的可见内容。
  • 仅当条目级属性覆盖对应于有意重复的组件,并且查看任务、信息结构和视觉形式均相同时,才使用该方式。如果其中任何一项不同,应创建另一个 MG 资产,并共享调色板、字体和动效逻辑。
属性条目应声明稳定的键、面向用户的标签、类型和默认值。支持的属性类型包括 text、number、color、boolean、select、font、image 和 video。

Fonts

字体

Motion Graphics must use fonts available to ChatCut's renderer so preview and local export stay consistent. Do not rely on machine-specific system fonts such as
STKaiti
,
PingFang SC
,
Microsoft YaHei
,
Arial
,
Helvetica
,
Comic Sans MS
,
system-ui
,
-apple-system
, or generic CSS families as the primary rendered font; availability differs between machines and may cause fallback.
When choosing or replacing a font, call
search_fonts
and use the returned canonical family name verbatim as the
fontFamily
value and matching
font
property
defaultValue
. Use Google Fonts or project custom fonts returned by the catalog. If a requested machine-specific font is not in the catalog, explain that consistent local rendering cannot be guaranteed, search for a supported alternative with a similar feel, and use it unless the user explicitly accepts font fallback.
Motion Graphics 必须使用 ChatCut 渲染器可用的字体,以确保预览和本地导出保持一致。不要将机器特定的系统字体,如
STKaiti
、
PingFang SC
、
Microsoft YaHei
、
Arial
、
Helvetica
、
Comic Sans MS
、
system-ui
、
-apple-system
或通用 CSS 字体族作为主要渲染字体;不同机器上的可用性可能不同,并可能触发字体回退。
选择或替换字体时,调用
search_fonts
,并将返回的规范字体系列名称原样用作
fontFamily
值和对应
font
属性的
defaultValue
。使用目录中返回的 Google Fonts 或项目自定义字体。如果请求的机器特定字体不在目录中,请说明无法保证一致的本地渲染效果,搜索具有相似感觉的受支持替代字体并使用它,除非用户明确接受字体回退。

Assets and composition

资产与合成

One reference instance may describe a complete composition made from several timeline items. It does not imply one self-contained MG asset. Keep reference screenshots, production materials, and current-project footage distinct.
Default to separate items when the design combines ordinary media with graphics:
  • Reusable paper/texture/background: an image or video item behind the composition.
  • Current-project photo, product image, or footage: its own media item. The agent selects/replaces, crops, positions, and applies supported effects to it; the user is not expected to assemble the layers manually.
  • Typography, shapes, and animated decoration: transparent MG item(s). Split background decoration from foreground text when media must sit between them.
Plan layer order, target media rectangle, start/duration, and entrance timing before authoring. State in the MG brief/code scope which layers already exist outside the MG, so the reference's photo or paper is not generated again. Apply black-and-white/color/grain to the intended media item rather than accidentally affecting foreground text. Verify effect support on the actual playback/export surface; splitting layers does not by itself prove Web/Desktop parity.
  1. Reuse assets from
    browse_assets
    in the current project. Import only production files needed in the output into My Assets. Load
    asset-import
    and use its
    import_media
    session/upload helper. Registering project media does not publish it to the public resource library.
  2. Place normal production media through
    edit_item
    , using the returned current-project asset IDs. The agent handles replacing example people, copy, and data with the current task's content. Do not use the reference's complete effect screenshot as a background.
  3. Embed media inside an MG only when its visual mechanism needs it, such as image-filled lettering or a tightly synchronized internal mask that available timeline tools cannot express. For this exception, bind
    image
    /
    video
    property defaults and overrides to full current-project asset IDs, never URLs, local paths, or reference-library IDs. Read via
    item.props
    , guard empty values, and let the runtime resolve the source. Declaring an image property does not import the file.
  4. Verify the composed timeline at entrance and settled frames, including media presence, cropping, effects, layer order, and timing. A standalone transparent MG preview intentionally omits separately placed photos/backgrounds; judge the complete design on the timeline. For intentionally embedded media, a correct thumbnail alone does not prove playback works; check import, ID binding, and byte readiness when it is missing.
Library
hero
/
motion
images are study inputs and need no project import merely to be viewed. Missing production files must be reported or replaced with suitable available materials; never silently omit a required layer.
一个参考实例可能描述由多个时间线条目构成的完整合成。这并不意味着它就是一个自包含的 MG 资产。
务必区分参考截图、正式素材和当前项目 footage。
当设计将普通媒体与图形结合时,默认使用独立条目:
  • 可复用的纸张、纹理或背景:放在合成后方的图片或视频条目。
  • 当前项目的照片、产品图片或 footage:使用其独立的媒体条目。Agent 负责选择或替换、裁剪、定位并应用受支持的效果;不应要求用户手动组装各个图层。
  • 排版、形状和动画装饰:使用透明的 MG 条目。当媒体需要位于两层之间时,将背景装饰与前景文字分开。
编写前先规划图层顺序、目标媒体矩形、开始时间、持续时间和入场时序。在 MG 简报或代码范围中说明哪些图层已存在于 MG 之外,以免再次生成参考中的照片或纸张。将黑白、彩色或颗粒效果应用到目标媒体条目,而不是意外影响前景文字。在实际播放或导出界面上验证效果支持情况;仅拆分图层并不能证明 Web 与 Desktop 表现一致。
  1. 复用当前项目中通过
    browse_assets
    找到的资产。仅将输出中需要的正式文件导入 My Assets。加载
    asset-import
    ,并使用其
    import_media
    会话或上传辅助工具。注册项目媒体不会将其发布到公共资源库。
  2. 通过
    edit_item
    放置普通正式媒体,使用返回的当前项目资产 ID。Agent 负责使用当前任务的内容替换示例人物、文案和数据。不要将参考中的完整效果截图用作背景。
  3. 仅当视觉机制需要时,才在 MG 内嵌入媒体,例如图片填充文字,或使用现有时间线工具无法表达的紧密同步内部蒙版。对于这种例外,将
    image
    或
    video
    属性的默认值和覆盖值绑定到完整的当前项目资产 ID,绝不能使用 URL、本地路径或参考库 ID。通过
    item.props
    读取,检查空值,并由运行时解析来源。声明图片属性并不会导入文件。
  4. 在入场帧和稳定帧验证合成后的时间线,包括媒体是否存在、裁剪、效果、图层顺序和时序。独立的透明 MG 预览会有意省略单独放置的照片或背景;应在时间线上判断完整设计。对于有意嵌入的媒体,仅有正确的缩略图不能证明播放正常;当媒体缺失时,应检查导入情况、ID 绑定和字节就绪状态。
库中的
hero
和
motion
图片是研究素材,仅供查看时无需导入项目。缺失的正式文件必须报告或替换为合适的可用素材;绝不能悄悄省略必需图层。

Design Principles

设计原则

Design the settled frame from the confirmed style and inspected instance, then animate into it. Use the reference's hierarchy and visual relationships to make the current content legible; do not add filler labels or a default card wrapper.
Treat explicit type, material and motion rules as constraints. A hard-cut style should not acquire fades or springs; glass, grain, glow and other treatments belong only where the accepted visual language calls for them. Preserve a reference's expressive choices as well as its restraint.
A character, illustration, or compound shape is one visual entity. When multiple parts must visually connect, attach, or align, render those parts inside a single
<svg>
with one shared coordinate space and named anchors. Independent hardcoded
left
/
top
across separate wrappers produces visible gaps.
根据已确认的样式和已检查的实例设计稳定帧,然后为其添加动画。利用参考的层级和视觉关系,让当前内容易于理解;不要添加填充标签或默认卡片容器。
将明确的字体、材质和动效规则视为约束。硬切风格不应增加淡入淡出或弹性动画;玻璃、颗粒、辉光等处理只应出现在已确认的视觉语言需要的位置。既要保留参考富有表现力的选择,也要保留其克制。
人物、插画或复合形状是一个视觉实体。当多个部分必须在视觉上连接、对齐或保持一致时,应在单个
<svg>
中以共享坐标空间和命名锚点呈现这些部分。在不同包装元素中分别硬编码
left
或
top
会产生可见间隙。

Text Layout Safety

文本布局安全

For text-bearing MGs, design the settled frame as a real layout before animating. Use flexbox or grid,
gap
,
padding
,
maxWidth
,
lineHeight
, and natural wrapping for related text blocks. Do not stack readable text with independent hardcoded
top
values unless the text is intentionally decorative or typographic art.
Editable text may become longer than the default. Reserve space for plausible longer copy, allow wrapping with
whiteSpace: "normal"
and
overflowWrap: "break-word"
, and reduce hierarchy, size, density, or change form when the content cannot fit cleanly.
Animated transforms do not affect layout. If text scales, pulses, slides, or staggers near other text, leave visual headroom for the largest animated state. Intentional overlap may be used for graphic layers, shadows, marks, or decorative typography; ordinary readable text must not collide.
Avoid forced
<br>
or manual line breaks for dynamic text unless each line is deliberately fixed. Prefer width-constrained wrapping.
Use this base component shape:
javascript
const Component = ({ item }) => {
  const frame = useCurrentFrame();
  const { durationInFrames } = useVideoConfig();

  const props = item.props || {};
  const accentColor = props.accentColor;

  const rootStyle = {
    position: "absolute",
    inset: 0,
    backgroundColor: "transparent",
  };

  return <div style={rootStyle}>{/* content */}</div>;
};
对于包含文本的 MG,在添加动画前先将稳定帧设计为真实布局。对于相关文本块,使用 flexbox 或 grid,以及
gap
、
padding
、
maxWidth
、
lineHeight
和自然换行。除非文本有意作为装饰或字体艺术,否则不要使用彼此独立的硬编码
top
值堆叠可读文本。
可编辑文本可能比默认值更长。应为合理情况下更长的文案预留空间,允许使用
whiteSpace: "normal"
和
overflowWrap: "break-word"
进行换行;当内容无法干净地容纳时,应降低层级、尺寸或密度,或者改变形式。
动画变换不会影响布局。如果文本在靠近其他文本时进行缩放、脉冲、滑动或错峰显现,应为最大动画状态预留视觉空间。有意重叠可用于图形图层、阴影、标记或装饰性字体;普通可读文本不得发生碰撞。
除非每一行都是有意固定的,否则避免对动态文本强制使用
<br>
或手动换行。优先采用宽度约束换行。
使用以下基础组件结构:
javascript
const Component = ({ item }) => {
  const frame = useCurrentFrame();
  const { durationInFrames } = useVideoConfig();

  const props = item.props || {};
  const accentColor = props.accentColor;

  const rootStyle = {
    position: "absolute",
    inset: 0,
    backgroundColor: "transparent",
  };

  return <div style={rootStyle}>{/* content */}</div>;
};

Motion Graphic Code Contract

Motion Graphic 代码契约

Violations cause runtime crashes. Strict compliance required.
  1. Syntax: Pure JavaScript JSX. No TypeScript.
  2. Imports: No import statements. Globals are pre-injected:
    React
    ,
    spring
    ,
    useCurrentFrame
    ,
    useVideoConfig
    ,
    interpolate
    ,
    interpolateColors
    ,
    Math
    ,
    random
    ,
    Easing
    ,
    AbsoluteFill
    ,
    Sequence
    ,
    Series
    ,
    Img
    ,
    Video
    , and
    Audio
    .
  3. Use injected globals: Hooks and components are available directly; do not reach through a namespace object.
  4. Exports: No
    export default
    . Define
    const Component = ...
    .
  5. Timing: No
    Sequence
    wrappers inside the component. Use flat frame-driven logic.
  6. Logic: No inline logic in JSX props. Pre-compute values in variables before
    return
    .
  7. Helpers: No undefined functions. Use
    interpolateColors
    plural. Define any helpers locally.
  8. AbsoluteFill:
    AbsoluteFill
    is a component, not a style object. Never spread it. It may be used for inner layers, but never as the root.
  9. Root element: The root must be
    <div style={rootStyle}>
    .
  10. Assets:
    <Img>
    and
    <Video>
    sources must read from image/video editable props. Never hardcode URLs. If no assets are provided, design with shapes, text, and CSS.
  11. Hooks: Get frame from
    useCurrentFrame()
    , not from
    useVideoConfig()
    .
  12. Local box: Component must accept
    ({ item })
    props. The asset
    width
    /
    height
    are the MG's natural box around its visible local composition, not the timeline canvas; fill that box with
    position:absolute; inset:0
    . Timeline placement sets final screen size and position.
  13. Layout control: Use flexbox or grid for text blocks and structured content. Use SVG or absolute geometry when the design depends on spatial relationships, compound shapes, frame treatments, or drawn/animated marks. Allow text to wrap naturally unless the request requires single-line text.
  14. Editable props: Component must read editable values from
    item.props
    . Never add fallback values like
    || "Default"
    or
    ?? false
    after
    props.key
    ; declared runtime properties already have values.
  15. Property schema: Declare matching editable properties. Include all visible text content and primary/accent colors.
  16. Image/video props: Store project asset IDs in media properties, read runtime values from
    item.props
    , and render
    <Img>
    /
    <Video>
    only when that value is truthy.
  17. Background: Default background is transparent. If a background surface is added, expose a
    transparentBackground
    boolean property.
  18. Export cost: Keep inline
    <svg>
    markup frame-invariant: animate the wrapper
    <div>
    (transform, opacity) instead of
    <svg>
    attributes, because the export redraws an SVG only when its markup changes. Prefer HTML/CSS shapes over SVGs that carry photos, and a
    boxShadow
    glow over a large blurred layer; both cost several times more per exported frame.
违反契约会导致运行时崩溃。必须严格遵守。
  1. **语法:**使用纯 JavaScript JSX。不要使用 TypeScript。
  2. **导入:**不要使用 import 语句。以下全局变量已预先注入:
    React
    、
    spring
    、
    useCurrentFrame
    、
    useVideoConfig
    、
    interpolate
    、
    interpolateColors
    、
    Math
    、
    random
    、
    Easing
    、
    AbsoluteFill
    、
    Sequence
    、
    Series
    、
    Img
    、
    Video
    和
    Audio
    。
  3. **使用注入的全局变量:**Hooks 和组件可直接使用;不要通过命名空间对象访问。
  4. **导出:**不要使用
    export default
    。定义
    const Component = ...
    。
  5. **时序:**组件内部不要使用
    Sequence
    包装器。使用扁平的逐帧驱动逻辑。
  6. **逻辑:**不要在 JSX 属性中使用内联逻辑。在
    return
    前将值预先计算到变量中。
  7. **辅助函数:**不要使用未定义的函数。使用复数形式的
    interpolateColors
    。在本地定义所有辅助函数。
  8. AbsoluteFill:
    AbsoluteFill
    是组件,不是样式对象。切勿将其展开。它可用于内部图层,但绝不能作为根元素。
  9. **根元素:**根元素必须是
    <div style={rootStyle}>
    。
  10. 资产:
    <Img>
    和
    <Video>
    的来源必须读取自 image 或 video 可编辑属性。绝不能硬编码 URL。如果没有提供资产,请使用形状、文本和 CSS 进行设计。
  11. **Hooks:**从
    useCurrentFrame()
    获取帧,不要从
    useVideoConfig()
    获取。
  12. **局部框:**组件必须接受
    ({ item })
    props。资产的
    width
    和
    height
    是可见局部合成周围的 MG 自然框,而不是时间线画布;使用
    position:absolute; inset:0
    填充该框。时间线放置决定最终屏幕尺寸和位置。
  13. **布局控制:**对于文本块和结构化内容,使用 flexbox 或 grid。当设计依赖空间关系、复合形状、框处理或绘制及动画标记时,使用 SVG 或绝对几何布局。除非请求要求单行文本,否则允许文本自然换行。
  14. **可编辑属性:**组件必须从
    item.props
    读取可编辑值。绝不要在
    props.key
    后添加
    || "Default"
    或
    ?? false
    之类的回退值;已声明的运行时属性已经具有值。
  15. **属性 schema:**声明匹配的可编辑属性。包含所有可见文本内容以及主要颜色和强调色。
  16. **图片和视频属性:**在媒体属性中存储项目资产 ID,从
    item.props
    读取运行时值,并且仅当该值为真时渲染
    <Img>
    或
    <Video>
    。
  17. **背景:**默认背景为透明。如果添加背景表面,请公开一个
    transparentBackground
    布尔属性。
  18. **导出成本:**保持内联
    <svg>
    标记不随帧变化:改为对外层
    <div>
    应用动画(transform、opacity),而不是修改
    <svg>
    属性,因为导出仅在 SVG 标记发生变化时才会重新绘制 SVG。相比包含照片的 SVG,优先使用 HTML/CSS 形状;相比大型模糊图层,优先使用
    boxShadow
    辉光,因为这两种方式的每帧导出成本都会高出数倍。