Files
openmotion/docs/readme/diagrams/generate.py
Joey-nexu 24abb9cc3d Integrate the OpenMotion README and localized showcase into feature/motion (#220)
* docs: introduce openmotion through a launch-film remix and first demo

* docs: restore the Great motion. Made yours. cover for openmotion

* Show what creators can make in Codex with three editable motion films

* docs: enhance contributing guidelines and README for clarity and structure

- Updated CONTRIBUTING.md and CONTRIBUTING.zh-CN.md to include detailed contribution types and locations.
- Revised README.md and README.zh-CN.md for improved presentation and added AI editing context.
- Introduced a new media kit documentation for creators and agents.
- Clarified Motion Design MD specifications and usage in documentation.
- Enhanced agent adapter documentation to outline entry points and usage scenarios.

* docs: enhance agent integration and product positioning

- Added detailed entry points for connecting agents from OpenMotion and using OpenMotion within agents, clarifying user pathways.
- Updated the README and related documentation to reflect the unified product positioning as an AI-native, open-source CapCut alternative, emphasizing the Claude Motion reference for motion creation.
- Expanded on the editing lifecycle and product pillars, detailing intelligent cuts, media generation, and multiplatform capabilities.
- Corrected branding inconsistencies, ensuring the use of "Claude Motion" throughout the documentation.
- Improved navigation and accessibility of bilingual resources for creators and agents.

* docs: introduce collaboration roadmap for human-agent co-editing

- Added a new section in the README and media kit outlining the upcoming collaboration features, emphasizing shared editing, timeline comments, and iterative review processes.
- Included concept artwork to visually represent the planned collaboration experience, labeled as a concept preview.
- Updated related documentation to clarify the direction of human-agent collaboration in video creation and editing, ensuring consistency across bilingual resources.

* docs: update README and related documentation for All-in-One Studio and Super Motion Video Agent

- Revised the README to reflect the new product positioning as an All-in-One AI-native Studio for AI Cut & Motion, emphasizing the integrated creative workflow.
- Introduced the Super Motion Video Agent concept, detailing its role in understanding creators, organizing tasks, and facilitating collaboration.
- Enhanced sections on the editing lifecycle, collaboration features, and the overall product vision, ensuring clarity and consistency across bilingual resources.
- Updated the media kit and related documentation to align with the new branding and messaging strategy.

* chore: update versioning and enhance documentation for OpenMotion 0.1.0

- Changed version from 0.6.2 to 0.1.0 across package-lock.json, package.json, and plugin.json to reflect the new release.
- Expanded README and related documentation to introduce seven creative briefs for AI Cut, providing actionable insights for users.
- Added new examples and product tour documentation to guide users through the features and capabilities of OpenMotion.
- Updated references to align with the new branding and product positioning, ensuring clarity across bilingual resources.

* docs: showcase presenter stories and reusable Motion Design packages

* docs: bundle Presenter Tech as a local OpenMotion template

* docs: update media references in documentation to local paths

- Changed external media links to local paths in README, examples, and collections documentation for improved accessibility.
- Updated references across multiple files to ensure consistency and ease of use for users accessing media assets.

* docs: make creative resources portable and emphasize agent editing

* Document a reproducible brand video remix in Codex

* Present OpenMotion as a Codex plugin for making brand videos

* Lead README titles with reverse-engineering brand videos

* Show the Firecrawl reference and OpenMotion remake in Codex

* Show the Codex to Studio workflow with three synchronized brand studies

* Recreate full social footage from an original post in Codex

* Shorten the Codex walkthrough and show five-second brand comparisons

* Show the native Codex workflow and highlight one-click video templates

* Link the OpenDesign Developers X account from the README

* Feature the open-source Firecrawl motion brief in both README intros

* Show OpenMotion agent setups and visual brand comparisons

* Shorten the OpenMotion README headline

* Name brand videos in the OpenMotion headline

* Show the real Codex prompt and editable Studio timeline on the README covers

* Feature seven synchronized brand film studies and mobile README covers

* Feature the Figma butterfly reveal in the OpenMotion covers and demo

* Use the README headline and OpenMotion name in launch artwork

* docs: enhance README guidelines and introduce reverse engineering resources

- Added a new section in AGENTS.md outlining guidelines for README writing and acknowledgements, emphasizing the importance of focusing on OpenMotion's capabilities and avoiding product comparisons.
- Updated CLAUDE.md to reference the new README guidelines.
- Introduced a comprehensive README.REVERSE-ENGINEERING.md file, detailing the reverse engineering process and showcasing additional resources.
- Added various media assets and a brand showcase README to support the alternative README, ensuring proper attribution and ownership of external content.

* docs: update README with new diagrams and enhance creative context

- Replaced text-based diagrams in README.REVERSE-ENGINEERING.md with SVG visuals to improve clarity and engagement.
- Added new SVG diagrams illustrating the creative stack and context, enhancing understanding of the workflow and resources.
- Introduced a Python script for generating SVG diagrams, ensuring maintainability and ease of updates.
- Updated sections to reflect the integration of visual aids, reinforcing the documentation's focus on agent capabilities and creative processes.

* Simplify the OpenMotion README opening

* docs: enhance README and add multilingual support for OpenMotion

- Updated the main README to reflect a new focus on reverse engineering capabilities, emphasizing the full-stack video creation process.
- Expanded language support by adding Japanese and Korean translations, ensuring broader accessibility for users.
- Improved navigation links and content structure to facilitate user engagement and understanding of the platform's features.
- Enhanced visual elements, including updated cover images and diagrams, to better illustrate the creative workflow and resources available.

* Explain the full-stack agentic video workflow and its architecture

* Highlight free local use and list the four supported agents

* List WorkBuddy alongside the other local agents

* Show five synchronized brand film recreations in the launch READMEs

* Restore Tom's showcase layout and restage five brand film adaptations

* Anchor the brand gallery links at the top of each film

* Organize the OpenMotion README around examples, features and setup

* Pair brand film comparisons with their video use cases

* Restore the full-stack video positioning and original use-case order

* Restore the original feature explanations and unify the OpenMotion showcase

* Present the OpenMotion cases in grouped tables and clarify BYOA and BYOK

* Restore the repository badges beneath the OpenMotion tagline

* Unify the README case galleries and restore community badges

* Remove the Presenter Tech demo from the README showcase

* Rename the features section to Why OpenMotion

* Show the original clip and editable remake on the README cover

* Restore the watercolor README cover and update the product introduction

* Restore the visual resource library and shared-project architecture guide

* Group the remake workflow with generation and fix README navigation

* Restore the community chapter and mark the README highlights

* Feature the agent gallery and numbered benefits in the README cover

* Restore local agent setup buttons and feature WorkBuddy

* Give every agent an equal gallery card and shorten the cover label

* Use the plain OpenMotion wordmark in README headings

* Remove the new label from WorkBuddy in README artwork

* Show a talking-head caption remake in the README cover

* Explain full-stack video recreation in the README highlights

Lead the four highlights with the editable HTML recreation workflow and keep the cover as the single entry point to the talking-head comparison.

* Unify the OpenMotion logo and localize the public READMEs

* Use the product name as text in README headings

* Lead with the OpenMotion logo and place the text title above the introduction

* Align the README resource language count with the three localized guides

The resource contract in docs/readme/RESOURCES.md still said the four
language introductions share the local assets, and the architecture
document described the same contract as four language READMEs. The
Korean guide was removed, so both now name English, Simplified Chinese
and Japanese and note the four README files those three languages use.

Generated-By: looper 0.16.2 (runner=fixer, agent=pi)

* Use the hosted Chrome installation for PR rendering checks

---------

Co-authored-by: joey <joey@Joeys-MacBook-Pro.local>
Co-authored-by: pftom <1043269994@qq.com>
Co-authored-by: joey <joey@Mac.lan>
Co-authored-by: joeylee12629-star <236967869+joeylee12629-star@users.noreply.github.com>
Co-authored-by: luogao <luogao@refly.ai>
2026-11-10 18:31:08 +08:00

108 lines
5.8 KiB
Python

"""Build the README's editable SVG diagrams with Python's standard library.
Run: python3 docs/readme/diagrams/generate.py
The cover paper is embedded so each diagram also works as a standalone image.
Content follows docs/product/architecture.md, docs/motion-md.md and the
resource responsibilities in library/ENTRY_TEMPLATE.md.
"""
from base64 import b64encode
from html import escape
import json
from pathlib import Path
OUT = Path(__file__).resolve().parent
INK = "#101820"
MUTED = "#34535A"
class Diagram:
def __init__(self, title, description, height, locale, labels):
self.locale = locale
self.labels = labels
title_text = self.translate(title)
description_text = self.translate(description)
paper = b64encode((OUT / "cover-paper.jpg").read_bytes()).decode("ascii")
self.parts = [f'''<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1200" height="{height}" viewBox="0 0 1200 {height}" role="img" aria-labelledby="title desc">
<title id="title">{escape(title_text)}</title><desc id="desc">{escape(description_text)}</desc>
<defs><marker id="arrow" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="6" markerHeight="6" orient="auto"><path d="m1 1 5 3-5 3" fill="none" stroke="#34535A" stroke-width="1.4"/></marker></defs>
<image width="1200" height="{height}" preserveAspectRatio="none" xlink:href="data:image/jpeg;base64,{paper}"/>
<rect x="28" y="28" width="1144" height="{height-56}" rx="8" fill="#fffdf8" fill-opacity=".93"/>
<g font-family="Arial, Helvetica, sans-serif" text-anchor="middle">''']
self.text(600, 100, title, 42, bold=True)
def translate(self, text):
return self.labels[text] if self.locale else text
def text(self, x, y, content, size=22, bold=False):
self.parts.append(f'<text x="{x}" y="{y}" font-size="{size}" font-weight="{700 if bold else 400}" fill="{INK if bold else MUTED}">{escape(self.translate(content))}</text>')
def line(self, path, arrow=False):
marker = ' marker-end="url(#arrow)"' if arrow else ''
self.parts.append(f'<path d="{path}" fill="none" stroke="{MUTED}" stroke-width="2"{marker}/>')
def save(self, slug):
(OUT / (f"{slug}.{self.locale}.svg" if self.locale else f"{slug}.svg")).write_text("\n".join(self.parts) + "\n</g></svg>\n", encoding="utf-8")
def creation_stack(locale, labels):
d = Diagram("From a reference clip to an editable video", "Bring your local agent, your brand and optional media models. Break down the reference, write HTML scenes, generate missing media, edit in Studio and render the MP4.", 495, locale, labels)
for x, name, detail in [(225, "Your local agent", "Skills and project tools"), (600, "Your media models", "Optional, with your keys"), (975, "Your brand", "Motion.md and assets")]:
d.text(x, 170, name, 28, bold=True)
d.text(x, 205, detail)
d.line(f"M{x} 224 v28")
d.line("M225 252 H975")
d.line("M600 252 V285", arrow=True)
for i, (step, detail) in enumerate([("Analyze", "Shots and beats"), ("Code", "Editable HTML"), ("Generate", "Missing media"), ("Edit", "Studio timeline"), ("Render", "Local MP4")]):
x = 155 + i * 222
d.text(x, 341, step, 31, bold=True)
d.text(x, 379, detail, 21)
if i < 4:
d.line(f"M{x+72} 330 h70", arrow=True)
d.text(600, 442, "Keep the video, its source and the assets you used.", 24)
d.save("creation-stack")
def creative_context(locale, labels):
d = Diagram("Inside Motion.md", "The Brand Kit, story, movement, sound and review notes give your agent the creative decisions to carry into the editable project.", 465, locale, labels)
fields = [(188, "Brand Kit", "Logo, type, palette", "Voice and product facts"), (465, "Story", "Opening, shot order", "Reveal and closing beat"), (740, "Motion & sound", "Timing, transitions", "Music and voice cues"), (1010, "Review", "What to keep", "What you can change")]
for x, name, first, second in fields:
d.text(x, 179, name, 29, bold=True)
d.text(x, 218, first, 20)
d.text(x, 247, second, 20)
d.line(f"M{x} 267 V292")
d.line("M188 292 H1010")
d.line("M600 292 V325", arrow=True)
d.text(600, 371, "Give Motion.md and your assets to your agent.", 31, bold=True)
d.text(600, 413, "Use the same creative decisions in a new cut.", 22)
d.save("creative-context")
def runtime_architecture(locale, labels):
d = Diagram("One project, from agent to render", "Your local agent uses MCP and Studio uses local HTTP. Both share the local application. The gateway supplies assets to the editable project and a fixed revision is rendered and verified.", 630, locale, labels)
for x, name, detail in [(350, "Your local agent", "MCP · 9 project tools"), (850, "Studio", "Local HTTP")]:
d.text(x, 173, name, 31, bold=True)
d.text(x, 213, detail)
d.line(f"M{x} 232 V257")
d.line("M350 257 H850")
d.line("M600 257 V285", arrow=True)
d.text(600, 328, "Local application", 34, bold=True)
d.text(600, 364, "Projects, media, versions and export jobs")
d.line("M600 378 V404", arrow=True)
for x, title, detail in [(231, "Model Gateway", "Your API keys"), (600, "Editable project", "HTML, CSS, JS and media"), (970, "Render and verify", "Fixed project revision")]:
d.text(x, 453, title, 30, bold=True)
d.text(x, 491, detail, 21)
d.line("M360 446 H462", arrow=True)
d.line("M735 446 H827", arrow=True)
d.line("M970 507 V533 H600 V551", arrow=True)
d.text(600, 590, "MP4 + editable source", 30, bold=True)
d.save("runtime-architecture")
if __name__ == "__main__":
translations = json.loads((OUT / "translations.json").read_text(encoding="utf-8"))
for locale, labels in [(None, {}), *translations.items()]:
creation_stack(locale, labels)
creative_context(locale, labels)
runtime_architecture(locale, labels)