Opus Motion Library
ルートディレクトリ:このリポジトリがクローンされたフォルダ、または現在のホストプロジェクト内のコピー。最初にそこの AGENTS.md を読んでください — 決定手順、レイヤリングルール、ウェブパフォーマンスルール、アンチパターン。次に docs/CHOOSING.md(意図 → モーション)と docs/INTEGRATION.md(スタック別)を読んでください。
1. 選択(記憶からの推測は禁止)
node cli/mgl.mjs suggest "<ユーザーの言葉による簡単な説明>"— ★レシピとモーションをランク付けし、理由を説明し、Propsスニペットを出力します。フィルタ:--overlay --image --text --loop --light --category <c> --json。node cli/mgl.mjs recipes— 既製ミックス(プレビューはrecipes/previews/<id>.jpg):hero-aurora-night, hero-paper-sketch, hero-blueprint-logo, product-launch, stats-reveal, testimonial-chat, testimonial-quote, loading-loop, section-divider, success-celebration, error-glitch, onboarding-steps, event-countdown, music-neon-promo, ocean-explainer, history-timeline, app-store-preview (9:16), social-short-captions (9:16), end-card。node cli/mgl.mjs info <id>— Props +roles,overlay/overlayProps,loopable,mood,weight,pairsWith,textProps。- ミックス = 背景 + 被写体 + タイプ + 控えめなアクセント;1ショットにつき1つのヒーロー;サポートレイヤーは薄く;すべてのサンプルテキストを置き換え;ブランドカラーを適用。
2. 動画(Remotion)
node cli/mgl.mjs render <id> --props '{"key":"value"}' [--format landscape|square|portrait] [--frames N] --out out/<name>.mp4
node cli/mgl.mjs recipe <id> --overrides '{"<motion-id>":{…}}' [--format …] --out out/<name>.mp4
node cli/mgl.mjs still <id> --at 10,60,120 --out out/<name>-sheet.jpg # まずプレビュー、シートを読む
node cli/mgl.mjs compose specs/<name>.json --out out/<name>.mp4 # scenes[] (motion or layers[]), transitions, overlays, audio
node cli/direct.mjs storyboards/<name>.json # ナレーション付き:ローカルQwen3-TTS -> キャプション -> レンダリング -> マスター
画像:public/ パス("demo/owl.jpg")または https URL。クラウド音声/音楽サービスは使用禁止;音楽/効果音は public/music、public/sfx から。別のRemotionプロジェクト内の場合:node cli/mgl.mjs add <motions|recipes> --to <host>/src(必要なソースとローカルレジストリのみをコピー;npm install行を出力)。
3. ウェブサイト / Webアプリ
- ライブラリ内で
npm run build:libを実行後、import {MotionBackground, MotionPlayer, MotionMix} from 'opus-motion-library/web'(Vite:resolve.dedupereact/remotion/@remotion/*/three)、またはmgl add … --player --to <app>/src(Next.js:'use client'ファイルから使用)。 - プレーンHTML / WordPress / Vue / Svelte:
<script src="opus-motion.element.js">+<opus-motion recipe="…" background>/<opus-motion motion="…" props='{…}'>。 MotionBackground上のHTML内のテキスト(typeレイヤーを削除します);overlayモーションはページ上に浮かびます;playOnView、縮小モーション静止フレーム、遅延マウント、ビューポートごとに最大2つのライブプレーヤー;重い3D → モバイルではエクスポートされた動画。- 使用するライブラリ
public/ファイルを提供します(またはassetBase/ 絶対URL)。
4. ネイティブアプリ、スライド、エディタ
node cli/mgl.mjs export <motion|recipe> --as mp4|webm|webm-alpha|prores-alpha|gif|png|poster [--format …] [--props …]
(α付きエクスポートは overlayProps を適用;ffprobe -c:v libvpx-vp9 … pix_fmt → yuva420p で確認)。
5. 引き渡し前の確認
レンダリングをタイル表示(ffmpeg -i out/x.mp4 -vf "fps=1,scale=480:-2,tile=6x5" -frames:v 1 out/x-sheet.jpg)またはページのスクリーンショットを撮る(node examples/screenshot.mjs <url> <dir> --targets "top,#section" — 1秒間隔で2枚撮影、変化率を報告)、それを読み、修正する。
ライブラリへのモーション追加
docs/AUTHORING.md に従い、src/motions/<family>/<id>.tsx に配置し、node cli/gen-registry.mjs && npx tsc --noEmit && node cli/gen-docs.mjs を実行;必要に応じて node cli/probe-meta.mjs --only <id>(ループ/オーバーレイ/輝度を測定)を実行し、docs/motion-meta.json にオーバーライドを追加します。