Agent skills that make real-time game VFX: procedural Effekseer effects, video-model flipbooks, or both, played in Godot and Unity (Claude Code, Codex and other Agent Skills hosts).
Python
Initial release of the effekseer-vfx agent skills
KanaWorks_AI5e7b81ff2d0f
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonnew file mode 100644index 0000000..e1e8e6a--- /dev/null+++ b/.claude-plugin/marketplace.json@@ -0,0 +1,17 @@+{+ "name": "effekseer-vfx",+ "owner": {+ "name": "KanaWorks_AI"+ },+ "metadata": {+ "description": "Game VFX authoring skills for Effekseer and Godot."+ },+ "plugins": [+ {+ "name": "effekseer-vfx",+ "source": "./",+ "description": "Author real-time game VFX as code for Effekseer and verify them in real Godot renders.",+ "version": "0.1.0"+ }+ ]+}diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonnew file mode 100644index 0000000..29fb155--- /dev/null+++ b/.claude-plugin/plugin.json@@ -0,0 +1,18 @@+{+ "name": "effekseer-vfx",+ "version": "0.1.0",+ "description": "Author real-time game VFX as code for Effekseer and verify them in real Godot renders: briefs, textures, recipes, EffekseerCore build, filmstrip review and independent scoring.",+ "author": {+ "name": "KanaWorks_AI",+ "url": "https://x.com/KanaWorks_AI"+ },+ "license": "MIT",+ "keywords": [+ "vfx",+ "effekseer",+ "godot",+ "gamedev",+ "particles",+ "game-effects"+ ]+}diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlnew file mode 100644index 0000000..dda83f5--- /dev/null+++ b/.github/workflows/ci.yml@@ -0,0 +1,23 @@+name: ci+on:+ push:+ pull_request:+jobs:+ authoring:+ # Pure-Python checks: no EffekseerCore or Godot on CI runners, so build/render tests skip.+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-python@v5+ with:+ python-version: "3.12"+ - name: Install the authoring toolchain+ env:+ EFFEKSEER_VFX_HOME: ${{ runner.temp }}/effekseer-vfx+ run: |+ sh skills/effekseer-vfx/scripts/setup.sh --authoring-only+ "$EFFEKSEER_VFX_HOME/venv/bin/python" -m pip install pytest==9.1.1+ - name: Tests+ env:+ EFFEKSEER_VFX_HOME: ${{ runner.temp }}/effekseer-vfx+ run: '"$EFFEKSEER_VFX_HOME/venv/bin/python" -m pytest -q tests'diff --git a/.gitignore b/.gitignorenew file mode 100644index 0000000..1f63bf4--- /dev/null+++ b/.gitignore@@ -0,0 +1,6 @@+__pycache__/+.pytest_cache/+*.egg-info/+.DS_Store+# A project workspace created while trying the skill inside this repository.+/vfx/diff --git a/LICENSE b/LICENSEnew file mode 100644index 0000000..2549e5f--- /dev/null+++ b/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 KanaWorks_AI (https://x.com/KanaWorks_AI)++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/README.ja.md b/README.ja.mdnew file mode 100644index 0000000..6957ffc--- /dev/null+++ b/README.ja.md@@ -0,0 +1,155 @@+# effekseer-vfx-skill++[English](README.md) | [简体中文](README.zh-CN.md) | 日本語++> 日本語のドキュメントは英語版の翻訳です。エージェントが実際に読み込むのは `skills/` 以下の英語ファイルで、内容が食い違う場合は英語版が正です。翻訳の一覧は [docs/ja/README.md](docs/ja/README.md) にあります。++コーディングエージェント(Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode など+[Agent Skills](https://agentskills.io) に対応したホスト)が、VFX アーティストと同じ反復の進め方で、リアルタイムのゲーム VFX をコードで制作できるようにするエージェントスキルです。++**デザインブリーフ → テクスチャ → Python レシピ → EffekseerCore ビルド → Godot 実レンダーのフィルムストリップ → 見る → 一つだけ直す → 繰り返す → 独立レビュー**++- **`effekseer-vfx`** — 制作スキル。クラフトルール、実測で確認済みの Effekseer/Godot エンジン規約、組み合わせて使える約 30 個のレイヤープリミティブ、静的 linter、save/open の読み戻し検証付きの公式 EffekseerCore コンパイラ、すべてのエフェクトを 2 体のダミー間のやり取りとして演出する Godot Lab、ピクセルフラグ付きのフィルムストリップ撮影、反復履歴、そしてレビューを実際に見たビルドへ結び付ける改ざん検知可能なエビデンスを備えています。+- **`vfx-review`** — レビュアースキル。作者は自分の作品を採点しないため、別のエージェントがレシピを見ずに、固定の評価基準でストリップを採点します。+- **サンプル** — 完成済みのエフェクト 13 種。ブリーフとテクスチャ付き:遠距離ペア 4 組(炎、氷、毒、闇:飛翔体 + 着弾)と、ヒット・斬撃・チャージ・シールド・ヒール各 1 種。前後比較の診断事例 3 件も付属。++## 動作要件++| モード | できること | 必要なもの |+|---|---|---|+| authoring | ブリーフとレシピの作成、lint、テクスチャの処理と計測 | macOS または Linux 上の Python 3.11+ または [uv](https://docs.astral.sh/uv/)(macOS 標準の Python 3.9 は古すぎます。Windows では WSL を使用) |+| build | 公式 EffekseerCore による `.efkefc` / `.efk` のコンパイル | **Apple silicon の macOS**、初回セットアップ時のネットワーク接続(`~/.cache/effekseer-vfx` に約 250 MB) |+| render | Godot のフィルムストリップレビュー、Lab、プレビュー、パッケージング | 上記 + `PATH` 上または `GODOT` で指定した [Godot 4](https://godotengine.org)(Forward+)。リファレンスクリップと録画には `ffmpeg` |++build と render は macOS ARM64(Effekseer Core 1.80.7、EffekseerForGodot4 1.80.5.1、Godot 4.7、.NET 9)でのみ検証済みです。Linux では authoring モードで動作し、build の経路は検証されていません。++## インストール++いちばん簡単な方法:このリポジトリの URL をコーディングエージェントに渡し、スキルのインストールを頼みます。エージェントが+従う手順は [エージェント向け:この URL からのインストール](#エージェント向けこの-url-からのインストール) にあります。自分でインストールする場合:++**Claude Code**(Claude Code で入力)++```text+/plugin marketplace add kanaworksai-hue/effekseer-vfx-skill+/plugin install effekseer-vfx@effekseer-vfx+```++**Codex**(Codex のチャットで依頼します。スキルは `~/.codex/skills`(`$CODEX_HOME` 設定時は `$CODEX_HOME/skills`)に入り、+次のターンか新しいセッションから使えます)++```text+$skill-installer install https://github.com/kanaworksai-hue/effekseer-vfx-skill/tree/main/skills/effekseer-vfx+$skill-installer install https://github.com/kanaworksai-hue/effekseer-vfx-skill/tree/main/skills/vfx-review+```++**その他のエージェント**(Cursor、Gemini CLI、Copilot、OpenCode など)++```sh+npx skills add kanaworksai-hue/effekseer-vfx-skill+```++または `skills/effekseer-vfx` と `skills/vfx-review` を、使用するエージェントのスキルフォルダ(`~/.claude/skills/`、+`.agents/skills/` など)にコピーしてください。各スキルフォルダには `LICENSE`(`effekseer-vfx` には `THIRD_PARTY_NOTICES.md` も)が同梱されているため、フォルダ単体でコピーしても失われません。++### エージェント向け:この URL からのインストール++1. **ファイルを取得する。** ホストにプラグインやスキルのインストーラーがあればそれを優先します(上のコマンド)。`/plugin` のような+ スラッシュコマンドはユーザー自身が入力する必要があるので、コマンドをユーザーに示します。そうでなければリポジトリをクローンし、+ 2 つのスキルフォルダを名前を変えずにスキルフォルダへコピーします:`git clone --depth 1 <このリポジトリの URL>` の後、+ `skills/effekseer-vfx` と `skills/vfx-review` を `~/.claude/skills/`(Claude Code、全プロジェクト)、`<project>/.claude/skills/`+ (Claude Code、単一プロジェクト)、`~/.codex/skills/`(Codex。`$CODEX_HOME` 設定時は `$CODEX_HOME/skills`)、またはホストのスキルフォルダ(例:`.agents/skills/`)にコピーします。それ以外はコピーしません。+ スキルは自己完結しており、実行時は読み取り専用です。+2. **読み込む。** スキル一覧にまだ表示されない場合は、ユーザーに新しいセッションを始めてもらいます。+3. **マシンを確認する。** ユーザーのゲームプロジェクトで `sh <skill>/scripts/vfx doctor` を実行し(`<skill>` はインストールした+ `effekseer-vfx` フォルダ)、その `next` に従います。+4. **ダウンロード前に確認する。** `sh <skill>/scripts/setup.sh` はツールチェーンを `~/.cache/effekseer-vfx` に入れます(macOS ARM64 で+ 約 250 MB。その他の環境では `--authoring-only`)。最初の `vfx init` は公式 Effekseer Godot プラグイン(約 34 MB)もダウンロードします。Python 3.11+ か uv が必要で、`doctor` がどちらもないと報告したらユーザーに+ どちらかのインストールを頼みます。Godot 4 はユーザーの代わりにインストールしません。ユーザーにインストールしてもらう(または+ 許可を得る)こと、`PATH` にない場合は `GODOT` を設定することを伝えます。+5. **Godot はサンドボックスの外で実行する。** `vfx review`、`preview`、`showcase` はユーザーのデスクトップに Godot のウィンドウを開きます。+ サンドボックス内のエージェント(ワークスペースサンドボックス内の Codex など)はウィンドウを開けないので、ユーザーの承認を得てサンドボックスの外で+ 実行します。ホストがサンドボックスの外に出られない場合は、完全なコマンドをユーザーに渡し、デスクトップのターミナルで実行してもらいます。+ 1 フレームも描画できない review は約 90 秒後に "rendered no frame" で停止します(ウィンドウを開けなかった可能性が最も高く、+ 含まれる Godot の出力で確認します)。`doctor` の `render: true` は Godot が見つかったことだけを示します。+6. **動作を確認する。** もう一度 `vfx doctor` を実行し(`modes` がこのマシンでできることを示します)、[はじめの一歩](#はじめの一歩)+ に進みます。動くものと足りないものを正直に報告し、`doctor` が build や render を非対応とするマシンで動くと言わないこと。++## はじめの一歩++ゲームプロジェクトの中でエージェントに *「ここに effekseer-vfx スキルをセットアップして、炎のサンプルを見せて」* と頼みます。エージェントは次を実行します。++```sh+sh <skill>/scripts/vfx doctor # what this machine can do, and what to install+sh <skill>/scripts/setup.sh # macOS ARM64; use --authoring-only elsewhere (asks you first)+sh <skill>/scripts/vfx init # creates vfx/ with the Godot Lab, materials and math textures+sh <skill>/scripts/vfx examples add fire+sh <skill>/scripts/vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion+sh <skill>/scripts/vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"+sh <skill>/scripts/vfx showcase # play the library in the Lab+```++各コマンドの役割:`doctor` はこのマシンでできることと、インストールが必要なものを報告します。`setup.sh` は macOS ARM64 用で、それ以外では `--authoring-only` を使います(実行前に確認を求めます)。`init` は Godot Lab、マテリアル、数式テクスチャを含む `vfx/` を作成します。`showcase` は Lab でライブラリを再生します。++次にエフェクトを頼みます。*「ターゲット指定の魔法に使う落雷を作って。短く鋭く、リターンストロークあり」*。スキルに従ってエージェントは、ブリーフを書き、お使いの画像生成ツールに手描き風テクスチャを依頼し(またはあなたに用意を頼み)、レシピを書いてビルドし、数ラウンドにわたってストリップをレビューし、結果を独立レビュアーに渡してから、`effect-verify` の合格を報告します。独立レビューを提出して `vfx overview` を再実行するまでは、エフェクトが正しく描画されていても `effect-verify` は `verified: false` になります。その段階でエージェントは「検証済み」ではなく「ビルドと描画ができた」と報告すべきです。ツールチェーンの既定の場所は `~/.cache/effekseer-vfx` で、`EFFEKSEER_VFX_HOME` で変更できます([コマンドリファレンス](skills/effekseer-vfx/references/cli.md) を参照)。++## 画像生成++複雑なペイント系の形状(煙、斬撃の弧、炎、亀裂、氷、シンボル)は画像生成モデルで作らなければならず、スキルがコードでそれを偽装することはありません。エージェントに組み込みまたは接続済みの画像ツールがあれば、`vfx/texture_prompts.json` に記録したプロンプトでそれを使います。なければ、どの画像を生成してどこに保存すればよいかを正確に伝えます。+数式で作れる形状(グロー、リング、ノイズ、グラデーション、トレイル、ディストーションマップ)はプロシージャルに生成されます。++## ゲームでエフェクトを使う++エフェクトは `.efk` ランタイムエクスポートと `.efkefc` ソース、および `vfx_manifest.json` として出力されます。生成される Godot プロジェクトには小さな API が含まれます。++```gdscript+var handle = Vfx.play("VFX_Fire_Explosion", position)+var shot = Vfx.launch("VFX_Projectile_Fire", from, to)+shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))+```++[`docs/ja/references/godot.md`](docs/ja/references/godot.md) を参照してください(英語原文:[`skills/effekseer-vfx/references/godot.md`](skills/effekseer-vfx/references/godot.md))。++## リポジトリ構成++```+skills/effekseer-vfx/ SKILL.md, references/ (craft, engine conventions, review...), scripts/ (vfx CLI, setup.sh,+ vfxkit, vendored effekseer_ai), assets/ (Godot Lab, materials, rubric, brief schema, examples)+skills/vfx-review/ SKILL.md for the independent reviewer+docs/zh/, docs/ja/ Chinese and Japanese translations of the references+.claude-plugin/ Claude Code plugin and marketplace manifests+tests/ pure-Python tests (no Core or Godot needed)+```++| パス | 内容 |+|---|---|+| `skills/effekseer-vfx/` | SKILL.md、references/(クラフト、エンジン規約、レビューなど)、scripts/(vfx CLI、setup.sh、vfxkit、同梱の effekseer_ai)、assets/(Godot Lab、マテリアル、評価基準、ブリーフスキーマ、サンプル) |+| `skills/vfx-review/` | 独立レビュアー用の SKILL.md |+| `docs/zh/`、`docs/ja/` | リファレンスの中国語訳と日本語訳 |+| `.claude-plugin/` | Claude Code のプラグインとマーケットプレイスのマニフェスト |+| `tests/` | 純粋な Python テスト(Core も Godot も不要) |++## 制限事項++- レビューの指標は実 viewport 上のピクセルヒューリスティクスであり、GPU やオーバードローの計測ではありません。+- レビューのハーネスは macOS 上でウィンドウ表示の Godot を操作します。ヘッドレス Linux での撮影はまだサポートしていません。+- サンプルのスコアは、スキル同梱のカプセル Lab でのレンダーに対する独立レビューの結果です(13 種のうち 2 種は `iterate` 判定)。頼りにする前に、ビルドとレビューをやり直してください。+- `soft` パーティクルは Forward+ の Lab で未検証のため、使用していません。++## 開発++```sh+sh skills/effekseer-vfx/scripts/setup.sh --authoring-only+~/.cache/effekseer-vfx/venv/bin/python -m pip install pytest+~/.cache/effekseer-vfx/venv/bin/python -m pytest -q tests+```++新しいエンジン規約を確認したコントリビューションでは、それを計測方法と一緒に+`skills/effekseer-vfx/references/engine-conventions.md` に追記してください。++## ライセンス++MIT。[LICENSE](LICENSE) を参照してください。サードパーティのコンポーネントとダウンロード:[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。+Effekseer および Godot はそれぞれの所有者の商標です。本プロジェクトはそれらと提携していません。++作者:KanaWorks_AI(X:[@KanaWorks_AI](https://x.com/KanaWorks_AI))。diff --git a/README.md b/README.mdnew file mode 100644index 0000000..3fead6f--- /dev/null+++ b/README.md@@ -0,0 +1,164 @@+# effekseer-vfx-skill++English | [简体中文](README.zh-CN.md) | [日本語](README.ja.md)++Agent skills that let a coding agent (Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and other+[Agent Skills](https://agentskills.io) hosts) make real-time game VFX the way a VFX artist iterates, in code:++**design brief → textures → Python recipe → EffekseerCore build → real Godot filmstrip → look → fix one thing → repeat → independent review**++- **`effekseer-vfx`** — the authoring skill: craft rules, verified Effekseer/Godot engine conventions, about 30 composable+ layer primitives, a static linter, the official EffekseerCore compiler with save/open read-back, a Godot Lab that+ stages every effect as an exchange between two dummies, filmstrip capture with pixel flags, iteration history and+ tamper-evident evidence that ties a review to the exact build it saw.+- **`vfx-review`** — the reviewer skill: a separate agent scores the strip against a fixed rubric without seeing the+ recipe, because the author never grades its own work.+- **Examples** — thirteen finished effects with briefs and textures: four ranged pairs (fire, ice, poison, dark:+ projectile + impact) and one each of hit, slash, charge, shield and heal, plus three diagnosed before/after cases.++## Requirements++| Mode | What you can do | Needs |+|---|---|---|+| authoring | write briefs and recipes, lint, process and measure textures | Python 3.11+ or [uv](https://docs.astral.sh/uv/) on macOS or Linux (macOS's built-in Python 3.9 is too old; Windows: use WSL) |+| build | compile `.efkefc` / `.efk` through the official EffekseerCore | **macOS on Apple silicon**, network for the first setup (~250 MB into `~/.cache/effekseer-vfx`) |+| render | Godot filmstrip review, Lab, preview, packaging | the above + [Godot 4](https://godotengine.org) (Forward+) on `PATH` or in `GODOT`; `ffmpeg` for reference clips and recordings |++Build and render are verified only on macOS ARM64 (Effekseer Core 1.80.7, EffekseerForGodot4 1.80.5.1, Godot 4.7,+.NET 9). Linux runs authoring mode; its build path is not verified.++## Install++The simplest way: give this repository's URL to your coding agent and ask it to install the skill. The steps it+follows are in [For agents: installing from this URL](#for-agents-installing-from-this-url). Or install it yourself:++**Claude Code** (type these in Claude Code)++```text+/plugin marketplace add kanaworksai-hue/effekseer-vfx-skill+/plugin install effekseer-vfx@effekseer-vfx+```++**Codex** (ask in a Codex chat; the skills land in `~/.codex/skills`, or `$CODEX_HOME/skills`, and are+used from the next turn or a new session)++```text+$skill-installer install https://github.com/kanaworksai-hue/effekseer-vfx-skill/tree/main/skills/effekseer-vfx+$skill-installer install https://github.com/kanaworksai-hue/effekseer-vfx-skill/tree/main/skills/vfx-review+```++**Other agents** (Cursor, Gemini CLI, Copilot, OpenCode, ...)++```sh+npx skills add kanaworksai-hue/effekseer-vfx-skill+```++Or copy `skills/effekseer-vfx` and `skills/vfx-review` into your agent's skills folder (`~/.claude/skills/`,+`.agents/skills/`, ...). Each skill folder+carries its own `LICENSE` (and `effekseer-vfx` its `THIRD_PARTY_NOTICES.md`), so a copied folder keeps them.++### For agents: installing from this URL++1. **Get the files.** If your host has a plugin or skill installer, prefer it (the commands above); a slash command+ such as `/plugin` must be typed by the user, so show it to them. Otherwise clone the repository and copy both skill+ folders into your skills folder, keeping their names: `git clone --depth 1 <this repository URL>`, then copy+ `skills/effekseer-vfx` and `skills/vfx-review` to `~/.claude/skills/` (Claude Code, all projects),+ `<project>/.claude/skills/` (Claude Code, one project), `~/.codex/skills/` (Codex; `$CODEX_HOME/skills` if set) or+ your host's skills folder (for example `.agents/skills/`).+ Do not copy anything else; the skills are self-contained and read-only at run time.+2. **Load them.** If the skills do not appear in your skill list yet, ask the user to start a new session.+3. **Check the machine.** From the user's game project run `sh <skill>/scripts/vfx doctor` (`<skill>` is the+ installed `effekseer-vfx` folder) and follow its `next` steps.+4. **Ask before downloading.** `sh <skill>/scripts/setup.sh` installs the toolchain into `~/.cache/effekseer-vfx`+ (about 250 MB on macOS ARM64; `--authoring-only` elsewhere), and the first `vfx init` downloads the official+ Effekseer Godot plugin (about 34 MB). Setup needs Python 3.11+ or uv: if `doctor` reports neither, ask the user to+ install one. Godot 4 is never installed for the user; ask them to install it (or to allow+ you to) and set `GODOT` if it is not on `PATH`.+5. **Run Godot outside the sandbox.** `vfx review`, `preview` and `showcase` open a Godot window on the user's+ desktop. A sandboxed agent (Codex in its workspace sandbox, for example) cannot open one: run those commands with+ the user's approval outside the sandbox; if your host cannot leave its sandbox, give the user the exact command to+ run in a terminal on their desktop. A review that renders no frame stops after about 90 s with "rendered no frame"+ (most likely the window could not open; check the Godot output it includes). `doctor`'s `render: true` only means+ Godot was found.+6. **Confirm it works.** Run `vfx doctor` again (`modes` should show what this machine supports), then follow+ [First steps](#first-steps). Report what works and what is missing; do not claim build or render works on a+ machine where `doctor` says it does not.++## First steps++Ask your agent, in your game project: *"Set up the effekseer-vfx skill here and show me the fire example."* It will run:++```sh+sh <skill>/scripts/vfx doctor # what this machine can do, and what to install+sh <skill>/scripts/setup.sh # macOS ARM64; use --authoring-only elsewhere (asks you first)+sh <skill>/scripts/vfx init # creates vfx/ with the Godot Lab, materials and math textures+sh <skill>/scripts/vfx examples add fire+sh <skill>/scripts/vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion+sh <skill>/scripts/vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"+sh <skill>/scripts/vfx showcase # play the library in the Lab+```++Then ask for an effect: *"Make a lightning strike for a targeted spell, short and sharp, with a return stroke."* The+skill makes the agent write a brief, request painted textures from your image generation tool (or ask you for+them), write the recipe, build, review the strips over several rounds and hand the result to an independent reviewer+before it reports `effect-verify` as passed. Until that independent review is submitted and `vfx overview` has+been rerun, `effect-verify` says `verified: false` even when the effect renders correctly; an agent should report+"builds and renders" rather than "verified" at that point. The toolchain lives in `~/.cache/effekseer-vfx`; set+`EFFEKSEER_VFX_HOME` to put it elsewhere (see [the command reference](skills/effekseer-vfx/references/cli.md)).++## Image generation++Complex painted shapes (smoke, slash arcs, fire, cracks, ice, symbols) must come from an image generation model; the+skill never fakes them with code. If your agent has a built-in or connected image tool, it uses it with the prompts it+records in `vfx/texture_prompts.json`. Otherwise it tells you exactly which image to generate and where to save it.+Math shapes (glows, rings, noise, gradients, trails, distortion maps) are generated procedurally.++## Using the effects in a game++Effects end up as `.efk` runtime exports and `.efkefc` sources with a `vfx_manifest.json`. The generated Godot project+contains a small API:++```gdscript+var handle = Vfx.play("VFX_Fire_Explosion", position)+var shot = Vfx.launch("VFX_Projectile_Fire", from, to)+shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))+```++See [`skills/effekseer-vfx/references/godot.md`](skills/effekseer-vfx/references/godot.md).++## Repository layout++```+skills/effekseer-vfx/ SKILL.md, references/ (craft, engine conventions, review...), scripts/ (vfx CLI, setup.sh,+ vfxkit, vendored effekseer_ai), assets/ (Godot Lab, materials, rubric, brief schema, examples)+skills/vfx-review/ SKILL.md for the independent reviewer+docs/zh/, docs/ja/ Chinese and Japanese translations of the references+.claude-plugin/ Claude Code plugin and marketplace manifests+tests/ pure-Python tests (no Core or Godot needed)+```++## Limitations++- Review metrics are pixel heuristics on the real viewport, not GPU or overdraw measurements.+- The review harness drives a windowed Godot on macOS; headless Linux capture is not supported yet.+- Example scores are an independent review of the skill's own capsule-Lab renders (two of the thirteen were judged+ `iterate`); rebuild and review before relying on them.+- `soft` particles are unverified in the Forward+ Lab and not used.++## Development++```sh+sh skills/effekseer-vfx/scripts/setup.sh --authoring-only+~/.cache/effekseer-vfx/venv/bin/python -m pip install pytest+~/.cache/effekseer-vfx/venv/bin/python -m pytest -q tests+```++Contributions that confirm a new engine convention should add it to+`skills/effekseer-vfx/references/engine-conventions.md` together with how it was measured.++## License++MIT, see [LICENSE](LICENSE). Third-party components and downloads: [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).+Effekseer and Godot are trademarks of their respective owners; this project is not affiliated with them.++Made by KanaWorks_AI ([@KanaWorks_AI](https://x.com/KanaWorks_AI) on X).diff --git a/README.zh-CN.md b/README.zh-CN.mdnew file mode 100644index 0000000..913b454--- /dev/null+++ b/README.zh-CN.md@@ -0,0 +1,154 @@+# effekseer-vfx-skill++[English](README.md) | 简体中文 | [日本語](README.ja.md)++> 中文文档是英文原文的翻译,仅供阅读参考。agent 实际加载的是 `skills/` 下的英文文件(`SKILL.md` 与 `references/*.md`);两者不一致时以英文为准。中文译文索引见 [docs/zh/README.md](docs/zh/README.md)。++一组 agent 技能,让编程 agent(Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 以及其他+[Agent Skills](https://agentskills.io) 宿主)像 VFX 美术迭代那样,用代码制作实时游戏特效:++**设计简报 → 纹理 → Python 配方 → EffekseerCore 构建 → 真实 Godot 连拍 → 看图 → 修一处 → 重复 → 独立评审**++- **`effekseer-vfx`** —— 制作技能:制作规则、经过实测的 Effekseer/Godot 引擎约定、约 30 个可组合的层基元、+ 静态检查器、带 save/open 回读的官方 EffekseerCore 编译器、把每个效果演成两个假人之间一次交锋的 Godot Lab、+ 带像素 flag 的连拍采集、迭代历史,以及把评审绑定到它所看构建的防篡改证据。+- **`vfx-review`** —— 评审技能:由另一个 agent 在看不到配方的情况下,按固定评分表给连拍图打分,因为作者从不给自己的作品打分。+- **示例** —— 十三个完成的效果,附设计简报和纹理:四组远程配对(火、冰、毒、暗:飞行体 + 命中),以及打击、斩击、蓄力、护盾、治疗各一个;另有三个前后对照的诊断教案。++## 环境要求++| 模式 | 能做什么 | 需要 |+|---|---|---|+| authoring | 写简报和配方、lint、处理和测量纹理 | macOS 或 Linux 上的 Python 3.11+ 或 [uv](https://docs.astral.sh/uv/)(macOS 自带的 Python 3.9 太旧;Windows 请用 WSL) |+| build | 通过官方 EffekseerCore 编译 `.efkefc` / `.efk` | **Apple 芯片的 macOS**,首次安装需要联网(约 250 MB,装到 `~/.cache/effekseer-vfx`) |+| render | Godot 连拍复查、Lab、预览、打包 | 以上全部 + 位于 `PATH` 或 `GODOT` 中的 [Godot 4](https://godotengine.org)(Forward+);参考视频和录像需要 `ffmpeg` |++build 和 render 只在 macOS ARM64 上验证过(Effekseer Core 1.80.7、EffekseerForGodot4 1.80.5.1、Godot 4.7、+.NET 9)。Linux 可以运行 authoring 模式,构建路径未经验证。++## 安装++最简单的方式:把本仓库的 URL 交给你的编程 agent,让它安装这个技能。它要遵循的步骤见+[给 agent:通过这个 URL 安装](#给-agent通过这个-url-安装)。也可以自己安装:++**Claude Code**(在 Claude Code 里输入)++```text+/plugin marketplace add kanaworksai-hue/effekseer-vfx-skill+/plugin install effekseer-vfx@effekseer-vfx+```++**Codex**(在 Codex 对话里发送;技能装到 `~/.codex/skills`,设置了 `$CODEX_HOME` 时是 `$CODEX_HOME/skills`,+下一轮对话或新会话起生效)++```text+$skill-installer install https://github.com/kanaworksai-hue/effekseer-vfx-skill/tree/main/skills/effekseer-vfx+$skill-installer install https://github.com/kanaworksai-hue/effekseer-vfx-skill/tree/main/skills/vfx-review+```++**其他 agent**(Cursor、Gemini CLI、Copilot、OpenCode 等)++```sh+npx skills add kanaworksai-hue/effekseer-vfx-skill+```++也可以把 `skills/effekseer-vfx` 和 `skills/vfx-review` 复制到 agent 的技能目录(`~/.claude/skills/`、+`.agents/skills/` 等)。每个技能目录都自带 `LICENSE`(`effekseer-vfx` 还带 `THIRD_PARTY_NOTICES.md`),单独复制也不会丢失。++### 给 agent:通过这个 URL 安装++1. **获取文件。** 宿主有插件或技能安装器时优先用它(上面的命令);`/plugin` 这类斜杠命令必须由用户自己输入,请把命令展示给用户。+ 否则克隆仓库,把两个技能目录按原名复制到技能目录:`git clone --depth 1 <本仓库 URL>`,再把 `skills/effekseer-vfx` 和+ `skills/vfx-review` 复制到 `~/.claude/skills/`(Claude Code,所有项目)、`<project>/.claude/skills/`(Claude Code,单个项目)、+ `~/.codex/skills/`(Codex;设置了 `$CODEX_HOME` 时是 `$CODEX_HOME/skills`)或宿主的技能目录(例如 `.agents/skills/`)。不要复制其他内容;技能是自包含的,运行时只读。+2. **加载。** 如果技能还没出现在技能列表里,请用户新开一个会话。+3. **检查本机。** 在用户的游戏项目里运行 `sh <skill>/scripts/vfx doctor`(`<skill>` 是安装好的 `effekseer-vfx` 目录),按它的 `next` 步骤操作。+4. **下载前先询问。** `sh <skill>/scripts/setup.sh` 把工具链装到 `~/.cache/effekseer-vfx`(macOS ARM64 上约 250 MB;其他系统用+ `--authoring-only`),第一次 `vfx init` 还会下载官方 Effekseer Godot 插件(约 34 MB)。它需要 Python 3.11+ 或 uv:`doctor` 报告两者都没有时,请用户安装其中一个。Godot 4 永远不会替用户安装;+ 请用户自行安装(或允许你安装),不在 `PATH` 上时设置 `GODOT`。+5. **在沙箱外运行 Godot。** `vfx review`、`preview` 和 `showcase` 会在用户桌面上打开 Godot 窗口。处于沙箱中的 agent(例如在工作区沙箱里的 Codex)+ 打不开窗口:请在用户批准后到沙箱外运行这些命令;如果宿主无法离开沙箱,就把完整命令交给用户,让用户在自己桌面的终端里运行。+ 没有渲染出任何帧的 review 会在约 90 秒后以 "rendered no frame" 停止(最可能是窗口打不开,请结合它附带的 Godot 输出判断);+ `doctor` 的 `render: true` 只表示找到了 Godot。+6. **确认可用。** 再运行一次 `vfx doctor`(`modes` 显示本机支持什么),然后按 [第一步](#第一步) 操作。如实报告哪些可用、缺什么;+ `doctor` 说不支持 build 或 render 的机器上,不要声称它们可用。++## 第一步++在你的游戏项目里对 agent 说:*"在这里配置 effekseer-vfx 技能,并给我看火焰示例。"* 它会运行:++```sh+sh <skill>/scripts/vfx doctor # what this machine can do, and what to install+sh <skill>/scripts/setup.sh # macOS ARM64; use --authoring-only elsewhere (asks you first)+sh <skill>/scripts/vfx init # creates vfx/ with the Godot Lab, materials and math textures+sh <skill>/scripts/vfx examples add fire+sh <skill>/scripts/vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion+sh <skill>/scripts/vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"+sh <skill>/scripts/vfx showcase # play the library in the Lab+```++(各命令作用依次为:检查本机能力与需要安装的内容;安装依赖(macOS ARM64,其他系统用 `--authoring-only`,会先征得你同意);+创建包含 Godot Lab、材质和数学纹理的 `vfx/`;添加火焰示例;构建;复查;在 Lab 中播放效果库。)++然后提出一个效果需求:*"为指定目标的法术做一个落雷,短而锐利,带回击。"* 技能会让 agent 写简报、通过你的图像生成工具+请求手绘纹理(或向你索要),编写配方、构建、多轮复查连拍图,并在报告 `effect-verify` 通过之前把结果交给独立评审。在提交独立评审并重新运行 `vfx overview` 之前,即使效果渲染正常,`effect-verify` 也会显示 `verified: false`;此时 agent 应报告“能构建、能渲染”,而不是“已验证”。工具链默认装在 `~/.cache/effekseer-vfx`,设置 `EFFEKSEER_VFX_HOME` 可以换位置(见[命令参考](skills/effekseer-vfx/references/cli.md))。++## 图像生成++复杂的手绘形状(烟、斩击弧、火焰、裂纹、冰、符号)必须来自图像生成模型;本技能从不用代码伪造它们。如果 agent 有内置或+已连接的图像工具,就用它生成,并把提示词记录在 `vfx/texture_prompts.json` 中;否则它会明确告诉你要生成哪张图、保存到哪里。+数学形状(光晕、环、噪声、渐变、拖尾、扰动图)由程序生成。++## 在游戏中使用效果++效果最终产出为 `.efk` 运行时导出文件和 `.efkefc` 源文件,并附带 `vfx_manifest.json`。生成的 Godot 项目包含一个小 API:++```gdscript+var handle = Vfx.play("VFX_Fire_Explosion", position)+var shot = Vfx.launch("VFX_Projectile_Fire", from, to)+shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))+```++参见 [`skills/effekseer-vfx/references/godot.md`](skills/effekseer-vfx/references/godot.md)(中文译文:+[docs/zh/references/godot.md](docs/zh/references/godot.md))。++## 仓库结构++```+skills/effekseer-vfx/ SKILL.md, references/ (craft, engine conventions, review...), scripts/ (vfx CLI, setup.sh,+ vfxkit, vendored effekseer_ai), assets/ (Godot Lab, materials, rubric, brief schema, examples)+skills/vfx-review/ SKILL.md for the independent reviewer+docs/zh/, docs/ja/ Chinese and Japanese translations of the references+.claude-plugin/ Claude Code plugin and marketplace manifests+tests/ pure-Python tests (no Core or Godot needed)+```++各目录:`skills/effekseer-vfx/` 含 `SKILL.md`、`references/`(制作规则、引擎约定、复查等)、`scripts/`(`vfx` CLI、+`setup.sh`、`vfxkit`、内置的 `effekseer_ai`)和 `assets/`(Godot Lab、材质、评分表、简报 schema、示例);+`skills/vfx-review/` 是独立评审用的 `SKILL.md`;`docs/zh/`、`docs/ja/` 是参考文档的中文和日文译文;+`.claude-plugin/` 是 Claude Code 插件与 marketplace 清单;`tests/` 是纯 Python 测试(不需要 Core 或 Godot)。++## 限制++- 复查指标是基于真实 viewport 的像素启发式,不是 GPU 或 overdraw 测量。+- 复查工具驱动的是 macOS 上带窗口的 Godot;暂不支持无头 Linux 采集。+- 示例分数来自对 skill 自带胶囊 Lab 渲染的独立评审(十三个中有两个被判为 `iterate`);依赖它们之前请重新构建并复查。+- `soft` 粒子在 Forward+ Lab 中未经验证,未被使用。++## 开发++```sh+sh skills/effekseer-vfx/scripts/setup.sh --authoring-only+~/.cache/effekseer-vfx/venv/bin/python -m pip install pytest+~/.cache/effekseer-vfx/venv/bin/python -m pytest -q tests+```++确认了新引擎约定的贡献,应把它连同测量方法一起写进+`skills/effekseer-vfx/references/engine-conventions.md`(英文原文)。++## 许可证++MIT,见 [LICENSE](LICENSE)。第三方组件与下载内容:[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。+Effekseer 和 Godot 是其各自所有者的商标;本项目与它们没有关联。++作者:KanaWorks_AI(X:[@KanaWorks_AI](https://x.com/KanaWorks_AI))。diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdnew file mode 100644index 0000000..2227eb4--- /dev/null+++ b/THIRD_PARTY_NOTICES.md@@ -0,0 +1,21 @@+# Third-party notices++## Included in this repository++| Component | Where | License | Notes |+|---|---|---|---|+| effekseer-ai (laodeng000/effekseer-ai, commit `208922ef192220322c2a79e1243ed51ff7d2b7af`) | `skills/effekseer-vfx/scripts/effekseer_ai/` | MIT, see `scripts/effekseer_ai/LICENSE` | Vendored and extended: structured layer compiler, procedural models, texture processing, Godot preview. Its agent server entry point was removed; the skill uses a command line instead. |+| Example textures | `skills/effekseer-vfx/assets/examples/textures/` | this repository's MIT license | Made with an image generation model from the prompts in `assets/examples/texture_prompts.json`, then post-processed; originals are not included. |++## Downloaded on first use (not redistributed)++| Component | Downloaded by | License |+|---|---|---|+| Effekseer 1.80.7 for Windows (only its managed Core assemblies are loaded) — https://github.com/effekseer/Effekseer/releases/tag/1807 | `scripts/setup.sh`, SHA-256 pinned | MIT (Effekseer Project); the archive's `LICENSE_TOOL` lists its bundled components |+| EffekseerForGodot4 1.80.5.1 — https://github.com/effekseer/EffekseerForGodot4/releases/tag/1.80.5.1 | `vfx init`, SHA-256 pinned | MIT; its LICENSE is copied into `vfx/godot/addons/effekseer/`. `init` changes one line of `plugin.gd` so the editor icon loads before the first import; the renderer is unchanged. |+| .NET 9 runtime (9.0.20) — official Microsoft archive `dotnet-runtime-9.0.20-osx-arm64.tar.gz` | `scripts/setup.sh`, SHA-256 pinned | MIT |+| Python packages in `scripts/requirements.lock.txt` (numpy, Pillow, jsonschema, pythonnet, ...) | `scripts/setup.sh`, pinned by version (not by hash) | their own permissive licenses |++Godot and ffmpeg are not downloaded; install them yourself under their licenses.++This project is not affiliated with or endorsed by the Effekseer project or the Godot Foundation.diff --git a/docs/ja/README.md b/docs/ja/README.mdnew file mode 100644index 0000000..007e2a5--- /dev/null+++ b/docs/ja/README.md@@ -0,0 +1,32 @@+# effekseer-vfx-skill 日本語ドキュメント++これらのページは英語版ドキュメントの翻訳です。エージェントが実際に読み込むのは `skills/` 以下の英語ファイルで、内容が食い違う場合は英語版が正です。+リポジトリ全体の概要は [README.ja.md](../../README.ja.md) を参照してください。++## スキル本体++| ページ | 内容 |+|---|---|+| [SKILL.effekseer-vfx.md](SKILL.effekseer-vfx.md) | 制作スキル `effekseer-vfx`:初回セットアップ、エフェクト一つを作る手順、厳守ルール、ルーティング表、レシピの骨格 |+| [SKILL.vfx-review.md](SKILL.vfx-review.md) | 独立レビュアースキル `vfx-review`:受け取る入力、評価基準、JSON 出力の形式 |++## リファレンス++| ページ | 内容 |+|---|---|+| [craft.md](references/craft.md) | クラフトルール:時間構造、属性の違い、飛翔体、不規則で複数の役割を持つエフェクト、予算 |+| [design.md](references/design.md) | デザインブリーフ:用途、キーフレーム、パレットの役割、ブリーフの形式 |+| [layering.md](references/layering.md) | 明度、色、レイヤーの組み合わせ:暗い裏打ち・明暗ペア・煙の残像、白い塊と黒い塊の修正順序 |+| [timing.md](references/timing.md) | 強度、ボリューム、退場のリズム:サンプルの参考タイミング、カーブを実フレームに合わせる方法 |+| [skeletons.md](references/skeletons.md) | カテゴリ別の骨格:ヒット、斬撃、爆発、飛翔体、チャージ、シールド、ヒールとバフ |+| [motion.md](references/motion.md) | モーションと経路:ヘッド・トレイル・振りまきパーティクル、速度を形とリズムに込める |+| [shapes.md](references/shapes.md) | ボリュームと遮蔽:標準カメラでのボリュームの選び方、描画順 |+| [textures.md](references/textures.md) | テクスチャの役割、生成、受け入れ:プロンプトの内容、処理と計測、連番の変形 |+| [reference.md](references/reference.md) | リファレンスクリップとの比較:取り込み、フレームの読み取り、撮影フレームとの対比 |+| [review.md](references/review.md) | レビューループ、エビデンス、納品:フラグ、ストリップの読み方、独立レビュー、検証 |+| [cases.md](references/cases.md) | 診断済みのケース:火の爆発、飛翔体の煙のテール、シールドの崩れを再構成したビフォー/アフター(画像付き) |+| [cli.md](references/cli.md) | コマンドリファレンスと作業領域の構成 |+| [examples.md](references/examples.md) | 同梱サンプル:炎・氷・毒・闇の飛翔体と着弾のペア 4 組と、ヒット・斬撃・チャージ・シールド・ヒールの単体 5 つ |+| [godot.md](references/godot.md) | Godot でエフェクトを使う:API、Lab、チェック |+| [engine-conventions.md](references/engine-conventions.md) | 検証済みのエンジン規約:角度と軸、力、メッシュとフレネル、フリップブック、継承、HDR、アンカー、コンパイラの拡張 |+| [primitives.md](references/primitives.md) | レシピコードとプリミティブ:`effect()` のフィールド、プリミティブ、ヘルパー、レイヤーフィールド、単位 |diff --git a/docs/ja/SKILL.effekseer-vfx.md b/docs/ja/SKILL.effekseer-vfx.mdnew file mode 100644index 0000000..2ee42a0--- /dev/null+++ b/docs/ja/SKILL.effekseer-vfx.md@@ -0,0 +1,84 @@+> このページは [`skills/effekseer-vfx/SKILL.md`](../../skills/effekseer-vfx/SKILL.md) の日本語訳です(YAML フロントマターは省略)。エージェントが読み込むのは英語の SKILL.md で、内容が食い違う場合は英語版が正です。++# Effekseer VFX++VFX アーティストと同じ反復の進め方で、ただしコードでゲームエフェクトを作ります:**ブリーフ → テクスチャ → レシピ → EffekseerCore ビルド → Godot 実レンダーのフィルムストリップ → 見る → 一つだけ直す → 繰り返す → 独立レビュー**。++以下の `<skill>` は、このファイル(英語の SKILL.md)を含むディレクトリです。すべてのコマンドは+`sh <skill>/scripts/vfx [--project <game project>] <command> ...` の形式で、JSON オブジェクトを一つ出力します+(進捗は stderr に出ます)。プロジェクトの既定はカレントディレクトリで、エフェクトの作業領域は `<project>/vfx/` です。+全コマンドは `sh <skill>/scripts/vfx --help` で確認できます。説明は [references/cli.md](references/cli.md) にあります。++## プロジェクトでの初回実行++1. `vfx doctor` — `modes`(`authoring`、`build`、`render`)、作業領域、具体的な `next` ステップを報告します。`vfx init` が作成したのではない `vfx/` フォルダが存在すると報告された場合は、初期化する前に、それがゲームプロジェクトであることをユーザーに確認します(または `--project` を渡します)。+2. セットアップが必要な場合は、**まずユーザーに確認します**(フルモードは `~/.cache/effekseer-vfx` に約 250 MB をダウンロードします)。+ macOS ARM64 では `sh <skill>/scripts/setup.sh`、それ以外では `sh <skill>/scripts/setup.sh --authoring-only` です。+ setup には Python 3.11+ か uv が必要です(macOS 標準の Python 3.9 は古すぎます)。`doctor` がどちらもないと報告したら、ユーザーにどちらかのインストールを頼みます。Godot 4(Forward+)はユーザーがインストールする必要があります。`PATH` 上にない場合は `GODOT` を設定します。+3. `vfx init` は `vfx/`(Godot Lab、マテリアル、数式テクスチャ、公式 Effekseer プラグイン)を作成します。`--update-templates` を付けない限り、既存のファイルは上書きしません。+4. 任意:`vfx examples add <name>` で、完成済みで独立レビュー済みのサンプルを学習用にコピーします:ペアは `fire`、`ice`、`poison`、`dark`(飛翔体 + 着弾)、単体は `hit`、`slash`、`charge`、`shield`、`heal`、または `all`。[references/examples.md](references/examples.md) を参照してください。++`vfx review`、`preview`、`showcase` はユーザーのデスクトップに Godot のウィンドウを開きます。サンドボックス内で動いている場合(Codex のワークスペース+サンドボックスなど)は、ユーザーの承認を得てサンドボックスの外で実行します。外に出られない場合は、完全なコマンドをユーザーに渡してデスクトップの+ターミナルで実行してもらいます。"rendered no frame" で止まった review は、ウィンドウを開けなかった可能性が最も高いです(含まれる Godot の出力で確認します)。+`doctor` の `render: true` は Godot が見つかったことだけを示します。++`build`/`render` モードがなくても、ブリーフ、レシピ、テクスチャを書いて `lint` を実行することはできますが、見た目を判断することはできません。+そのことをはっきり伝え、作業は **未コンパイル・レンダー未検証** として報告します。エフェクトが改善したと主張してはいけません。++## エフェクトを一つ作る・変更する++1. **書く前に読む。** [craft](references/craft.md)、[design](references/design.md)、[layering](references/layering.md)、[timing](references/timing.md)、[skeletons](references/skeletons.md) は必ず読み、さらに下のルーティング表にあるトピック別ファイルと、該当するサンプルのレイヤー計画を示す `vfx examples show <name>` を読みます(名前:`hit`、`slash`、`charge`、`shield`、`heal`。飛翔体や爆発などの着弾はペア `fire`、`ice`、`poison`、`dark`。エフェクト ID も使えます)。既存のエフェクトでは `vfx effect-context <ID>` を実行して履歴を読み、失敗した変更を繰り返さないようにします。+2. **ブリーフ。** `vfx/briefs/<ID>.json` を書きます(キーフレーム 3 つ、パレットの役割、ビート、レイヤー計画、受け入れ条件、避けること)。形式は [design.md](references/design.md) にあります。+3. **テクスチャ。** 数式で作る形状(グロー、リング、ノイズ、トレイル、ディストーションマップ)と、ペイント系の煙・爆発・ウィスプ・亀裂・氷のスターターセットは、`init` の時点で揃っています。複雑なペイント系の形状(炎、斬撃、煙、亀裂、氷、ルーン)は画像生成モデルで作ります — [textures.md](references/textures.md) に従ってください。どのテクスチャも、その角度を使う前に `vfx texture-info` で計測します。+4. **レシピ。** [primitives.md](references/primitives.md) のプリミティブを使って `recipe()` を定義する `vfx/src/<ID>.py` を書きます。軸、単位、ブレンドの挙動は推測せず、[engine-conventions.md](references/engine-conventions.md) の検証済みエンジンルールに従います。+5. `vfx brief-validate <ID>` と `vfx lint --ids <ID>`。lint のエラーは必ず修正します。警告はクラフト上のヒントで、判断はレンダーで行います。+6. `vfx build --ids <ID>` の後、`vfx review --ids <ID> --note "<what this round changed>"`。+7. **画像を見る。** レビューが返すすべてのパス(`sheets`、`compare`、`details.*.sheet`)を画像表示ツールで開きます。フラグはありがちな問題を指し示すだけなので、フラグだけで判断してはいけません。手順とフラグの意味:[review.md](references/review.md)。+8. **1 ラウンドにつき 1 種類の問題** を直し、エフェクトごとに 3〜5 ラウンド行います。+9. **独立レビュー。** 作者は自分のエフェクトを採点しません。`vfx review-handoff <ID>` を実行します。これはレビュアー向けの完全なブリーフ(画像、撮影したフレーム番号、マニフェストの文脈、評価基準、レポートの保存先、このスキルの隣にインストールされた `vfx-review` スキルのパス)を書き出し、`prompt_file`、`report_file`、そのまま使える提出コマンドを返します。そのブリーフを手を加えずに、レシピを見ていない別のエージェントに渡します。ホストが可能ならそれでサブエージェントを起動し、エフェクトについてそれ以外のことは何も伝えません。できなければ、ユーザーに新しいセッションを開いて貼り付けてもらいます。`report_file` ができたら、返された `vfx review-submit <evidence_id> <report_file> --reviewer <that agent's identifier>` を実行します(識別子はサブエージェントの ID か名前、またはセッション ID。`author` や `self` は不可。フレームの既定値はレポートの `observed_frames` です)。レポートを自分で書いてはいけません。+10. `vfx overview`(`--ids` なし:ライブラリのベースライン)の後、`vfx effect-verify <ID>`。完了と報告してよいのは `verified: true` の場合だけで、そうでなければ不足しているものを列挙します。ラウンドの上限に達しても ship 判定が出なければ、未解決の項目を報告します。++## 厳守ルール++- すべてのエフェクトに時間構造(予備動作 → 接触 → 本体 → 二次モーション → 消散)と明度の階層(白熱コア、高彩度の本体、暗い外縁または残滓)を持たせます。ヒール、シールド、チャージには、文書化された独自の例外があります。+- 本体は形を変えます(ディゾルブ、スイープ、UV ディストーション、フリップブック、形状の打ち直し)。拡大とフェードだけで済ませてはいけません。パーティクルはイーズアウト(速く、そして遅く)で動かします。+- 属性同士は、形状、モーション、リズム、マテリアル、二次モーションのうち少なくとも 3 つで違いを持たせます — 色替えだけにしてはいけません。+- 複雑なペイント系の形状を Python で描いてはいけません。画像生成ツールが使えない場合は、プロンプトを `vfx/texture_prompts.json` に書き、ユーザーに画像を依頼します。+- 生成した原画は `vfx/textures/generated/` に保持し、処理済みのコピーは `vfx/textures/processed/` に書き出します。プロンプトはすべて記録します。+- 単位:レシピのタイミングは 60 FPS のフレーム数、F カーブはライフに対するパーセント、マニフェストの duration/peak は秒、Godot API の rotation はラジアンです。+- すべてのエフェクトは `delivery` を宣言します。飛翔体には、それを参照し返す対の着弾エフェクトが必要です。+- コンパイラが知っているレイヤーフィールド(`vfx layer-schema`)だけを使います。レシピに生のプロパティパスを書くのではなく、コンパイラを拡張します。+- `--ids` なしの全量 `vfx build` は、このスキルがビルドし、ソースが `vfx/src/` からなくなったエフェクトの出力を削除します。自分がビルドしていないエフェクトは決して削除せず、空のライブラリでは実行を拒否します。部分的な作業には `--ids` を使います(他の場所の壊れたソースは、作業を止めずに `unloaded` に報告されます)。+- 実際に実行して確認しない限り、エクスポート、再生、デバイス性能、録画の成功を主張してはいけません。++## ルーティング表++| タスク | 追加で読むもの |+|---|---|+| 新しいペイント系テクスチャ、フリップブック、テクスチャの問題 | [textures.md](references/textures.md) |+| 斬撃、飛翔体、チャージ、オーラなど移動するもの全般 | [motion.md](references/motion.md) |+| シールド、柱、ボス、状態異常、ボリューム、遮蔽 | [shapes.md](references/shapes.md) |+| リファレンス動画に合わせる | [reference.md](references/reference.md) |+| 特定の見た目の失敗(白い塊、空のテール、崩れが出ない) | [cases.md](references/cases.md) |+| コンパイラへのエンジン機能の追加 | [engine-conventions.md](references/engine-conventions.md#コンパイラの拡張)、`vfx discover`、`vfx core property-list/get/set` |+| ゲームでエフェクトを使う | [godot.md](references/godot.md) |++## レシピの骨格++```python+# vfx/src/VFX_Hit_Spark.py+from vfxkit.primitives import *++def recipe():+ hot = (255, 240, 200, 255)+ return effect('Hit_Spark', 'Spark Hit', 'hit', 'physical', .4, [+ flash('Contact flash', WHITE, 2.2, life=4, delay=1),+ glow('Bloom', (255, 170, 70, 170), 1.6, life=9, delay=1),+ radial_sparks('Sparks', 10, hot, color_end=(255, 120, 30, 255), distance=(.8, 1.7), life=(12, 16), delay=1, gravity=.0018),+ smoke('Dust', (185, 160, 135, 200), count=2, size=(.5, .7), life=(13, 14), delay=4),+ ], peak=.03, impact=.3, delivery=MELEE, design='One-line description of what the player sees.')+```++`effect('Hit_Spark', ...)` は ID `VFX_Hit_Spark` を生成し、これはファイル名と一致していなければなりません。`vfx/src/` 内の+`_` で始まるファイルは、レシピから import できる共有ヘルパーです。diff --git a/docs/ja/SKILL.vfx-review.md b/docs/ja/SKILL.vfx-review.mdnew file mode 100644index 0000000..34d5182--- /dev/null+++ b/docs/ja/SKILL.vfx-review.md@@ -0,0 +1,66 @@+> このページは [`skills/vfx-review/SKILL.md`](../../skills/vfx-review/SKILL.md) の日本語訳です(YAML フロントマターは省略)。エージェントが読み込むのは英語の SKILL.md で、内容が食い違う場合は英語版が正です。++# 独立 VFX レビュー++あなたはレビュアーであり、作者ではありません。渡された画像に見えるものだけで判断します。レシピのコード、ブリーフの意図、+作者のメモを開いたり、読んだり、求めたりしてはいけません。マニフェストにあるデザインの一文は文脈であって、証拠ではありません。++## 受け取るべき入力++通常は、`vfx review-handoff` が書き出したレビュー用ブリーフファイル(`vfx/work/handoff/<evidence_id>.md`)が一つ渡されます。+そこには以下のすべてと、JSON を書き込む `report_file` のパスが記載されています。そうでない場合は次のとおりです:++- タイムライン全体のストリップ `vfx/previews/strips/<ID>.png` とキーフレームシート(パスは `vfx review` から)。+ 任意で `<ID>_compare.png`(上が前のラウンド、下が現在)と `--bright` ストリップ。+- エフェクトのマニフェストエントリ:`id`、`category`、`element`、`duration`、`peak`、`impact`、`delivery`、`design`。+- そのレビューの `flags`。+- 撮影のエビデンス ID。++すべての画像を画像表示ツールで開きます。タイルには、エフェクト自体の開始から数えた 60 FPS の絶対フレーム番号がラベル付けされています。+フルサイズのフレームが必要なら、作者に `vfx frames <evidence_id> <frames...>` を実行してパスを渡すよう頼みます+(スキルをインストールしていれば自分で実行しても構いません)。画像が欠けている場合はそう伝えます — フラグから採点してはいけません。++## 評価基準++各項目を 0〜3 で採点します:**0** 欠けている・間違っている · **1** あるが弱く、プレイヤーは気付かない · **2** はっきり機能している ·+**3** 一目で伝わり、独自の個性がある。++| id | 問い | 見る場所 |+|---|---|---|+| `read` | 最初に光ったタイルだけで、それが何のエフェクトか(ヒット、斬撃、属性、バフなど)分かるか? | 最初に光った 2〜3 タイル |+| `timing` | 予備動作 → 接触 → 本体 → 二次モーション → 消散(ヒール、バフ、チャージではゆっくりしたフェードインや内向きの溜め)になっているか? 接触が最も明るい瞬間で、2〜5 フレームだけか? | マニフェストの `peak` に対するタイルラベル |+| `layering` | 最も強いタイルで、白熱コア、高彩度の本体、暗い外縁または残滓があり、平坦な単色になっていないか? | ピークのタイル。提供されていれば bright ストリップ |+| `shape_change` | メインの形状が時間とともに侵食・スイープ・変形するか、それともステッカーのように拡大とフェードだけか? | 連続するタイルにわたるメインの形状 |+| `motion` | 二次パーティクルは速く弾けてから減速し、属性らしく動いているか(炎は上へ、氷は落ち、闇は引き込み、聖は降りるか昇る)? | タイルにわたる二次パーティクル |+| `placement` | 弧、柱、地面のデカールが、ダミーの横や宙に浮かずに、ダミーの上または足元に収まっているか? | 全タイル |+| `tail` | 最後の 3 分の 1 に意図的な消散がまだ見えるか、それとも空っぽか途中で切れているか? | ストリップの最後の 3 分の 1 |+| `identity` | グレーに色替えしても、同じカテゴリの他のエフェクトと見分けられるか? | ストリップ全体 |++正となるのは `vfx rubric`(effekseer-vfx スキルの `assets/review_rubric.json` から)です。この表と異なる場合はそちらに従います。++用途による例外:ヒール、シールド、バフには攻撃のような白いフラッシュは不要です。チャージは内向きに溜めてから一度だけ解放します。+飛翔体のストリップは到達で終わり、着弾は含みません。++## 出力++JSON オブジェクトをちょうど一つ返し、作者が指定した場所(例えば `report.json`)に保存します。++```json+{"id": "VFX_Fire_Explosion",+ "scores": {"read": 2, "timing": 3, "layering": 3, "shape_change": 2, "motion": 3, "placement": 3, "tail": 2, "identity": 3},+ "worst": "shape_change",+ "fix": "From f18 to f30 let the main fire layer burn a large gap open on one side so the round outline breaks up.",+ "verdict": "ship",+ "observed_frames": [1, 4, 9, 10, 12, 18, 30, 42, 54, 72]}+```++ルール:+- すべての項目に 0〜3 の整数を付けます。`worst` は最低スコアの項目の一つを指します。+- いずれかのスコアが 2 未満なら `verdict` は `iterate`、そうでなければ `ship` です。+- `fix` は最悪項目に対する **一つ** の具体的な変更を、レシピの言葉(どのレイヤー、タイミング、テクスチャ、モーションか)で、+ フレームを挙げて書きます。修正は一つだけです:各反復ラウンドでは 1 種類の問題だけを変えます。+- `observed_frames` には、実際に見たフレームラベルを列挙します。++ブリーフに記された `report_file`(または作者に指定された場所)に保存し、スコア、判定、修正を返信します。+その後、作者が `vfx review-submit <evidence_id> <report_file> --reviewer <your reviewer id>` を実行します。+あなたのレビュアー ID は、ホストがあなたを識別するのに使っているもの(サブエージェント名やセッション ID)です。`author` や `self` は決して使いません。diff --git a/docs/ja/references/cases.md b/docs/ja/references/cases.mdnew file mode 100644index 0000000..e87884b--- /dev/null+++ b/docs/ja/references/cases.md@@ -0,0 +1,77 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/cases.md`](../../../skills/effekseer-vfx/references/cases.md)。エージェントが読み込むのは英語版です。++# 診断済みのケース++ビフォー/アフターの教訓が 3 つあり、それぞれが **再構成した 1 種類だけの A/B** です:同梱サンプルを、ある 1 種類の問題について既知の失敗へ戻し、+両方のバージョンをスキル既定のカプセル Lab で同じシード、カメラ、絶対フレームでレンダーし、実際のフレームはクロップ、縮小、配置だけを行いました。+出所(両方の撮影のエビデンス ID とフレームのハッシュ)は [case_images/cases.json](../../../skills/effekseer-vfx/references/case_images/cases.json) にあります。+失敗そのものはこれらのエフェクトの過去の反復から来ていますが、画像は新しいレンダーで、当時のものではありません。++ケースは、あなたのビルドに対する `vfx effect-verify` の代わりには決してなりません。まず目に見える問題を名指しし、それから修正の種類を一つ選びます。+最終的なパラメータをすべてのエフェクトにコピーしてはいけません。現在の最悪項目に合うケースを選びます:白い塊 → 爆発、+トレイルの退場 → 飛翔体、パラメータは書いたのに形が変わらない → シールド。再現するには、そのサンプルを `vfx examples add` し、+BEFORE の変更を加えて `vfx review`、変更を元に戻してもう一度レビューします:2 ラウンド目で同じ比較が `<ID>_compare.png` として書き出されます。++## 火の爆発:白いままの接触++++**BEFORE:** Detonation flash は 3 フレームではなく 14 フレーム、Fire core は 5 フレームではなく 22 フレーム生存し、Fireball のランプは+ライフの 12 % でオレンジに変わる代わりに 55 % まで白を保ちます。**f18 を見てください。** BEFORE はまだ一枚の白い円盤で、火球の形とターゲットを+隠しています。AFTER はすでに熱い中心を持つオレンジレッドの本体へ冷めているので、高彩度の形、破片、偏った投げ出しが読み取れます。+f42–78 はほぼ同じです:不具合は接触にしかありません。lint は 14 フレームのフラッシュに警告を出します(`contact should be 2-5`)。+その理由はストリップが示しています。++| 見える問題 | 最初に確認すること | 最初の修正の種類 | 再確認する場所 |+|---|---|---|---|+| フラッシュの後もまだ白い塊がある | フラッシュとコアのライフ、本体のカラーランプ、エミッシブ、重なった Add | 接触を短くする。本体の明るい区間を早めにオレンジレッドへ引き継ぐ | 本体の輪郭が接触を越えて残るか(f12–18) |+| 炎が退場すると小さな明るい点しか残らない | 本体の実際のライフ、炎 → 煙の引き継ぎ | ボリュームのある炎か煙のレイヤー一つに中盤を担わせる | f18–42 の形の変化 |+| テールが空、またはグレーの煙が描かれていないように見える | 連番が早く再生し終わっている、背景に対するグレーの明度 | 再生区間、ランプ、ライフを揃えて見える煙を保つ | f54、60、66 を 1 フレームずつ、そして終了後に消えているか |++1 ラウンドで変えるのは 1 種類だけです。すべてのサイズとすべてのエミッシブを同じ係数で掛けてはいけません。++## 飛翔体:ヘッドと一緒に消えるトレイルの煙++++**BEFORE:** Smoke trail は 38–42 フレームではなく 14–18 フレーム生存し、煙のシートを 1 セルあたり 4 フレームではなく 2 フレームで再生し、+duration は 1.2 s ではなく 1.0 s です。飛行はどちらも 0.45 s なので、ヘッドは同じフレームに到達します。**f27、f39、f54 を見てください。**+f27 では BEFORE の経路の始まりにもう煙がありませんが、AFTER は術者の近くにまだグレーの煙があります。到達後の f39 では、BEFORE はターゲットに+赤いウィスプが数本残るだけですが、AFTER は経路に沿って途切れたグレーの煙の線を保ち、それが f54 まで漂いながら薄れていきます。+フレームは、異なる duration の同じパーセンテージに押し込めるのではなく、絶対時刻で比較しています。++| 見えるもの | ありそうな原因 | 最初の修正の種類 |+|---|---|---|+| ヘッドが到達すると、そのフレームでトレイル全体が消える | 追従する継承、即時停止、または非常に短いインスタンス | ライフより先に `inherit=TRAIL`(`WhenCreating`)と解放を確認する |+| パーティクルは生きているのに、テクスチャがすでに空 | ライフが終わる前にシートが再生し終わっている | `frame_length` と使用するフレーム範囲を調整する |+| 白とオレンジはあるのに、煙がまだ見えない | Blend のグレーが背景に近すぎる | 既定のステージで適切な中間調に上げ、冷めていく変化は保つ |+| トレイルがパイプのように太い | 放出が密すぎる、全レイヤーで同じ幅とライフ | メインのテール、細いテール、振りまきパーティクルに分け、その後で余分な放出を減らす |++「トレイルのインスタンスはまだ生きている」と「プレイヤーにはまだ煙が見える」は別の主張です。パーティクル数ではなく、+模様の変化、素材、動きで判断します。`duration` を延ばすだけでは、空のテールが増えるだけです。++## シールド:隙間が一度も見えない崩れ++++**BEFORE:** 6 枚の `shell_fragments` を取り除いたので、崩れはシェルのアルファカットオフのカーブだけに頼っています。このカーブは正しく書かれ、+正しく読み戻されています。**f81、f90、f96 を見てください。** BEFORE では球は f84 で完全なまま、f86 で消えます:隙間を見せるフレームは一つもなく、+破片が数枚飛ぶだけで、スイッチを切ったように消えます。AFTER は f80 でシェルを 6 枚の実際の球面の破片に引き継ぎ、それらが目に見える隙間を空けて離れ、+外側へ回転しながら色が減衰し、f108 までに消えます。++| 見えるもの | 最初の確認 | 実現可能な方向 |+|---|---|---|+| カーブの読み戻しは正しいのに穴が開かない | この Model + マテリアル + プラグインの組み合わせでの実際の画 | 組み合わせが侵食しないなら、分割した弧か実際の球の断片に引き継ぐ |+| 破片が急に大きく明るく現れる | 破片のエミッシブ、色、発生の重なり | シェル全体を破片へ退場させる。明るい時間を制限する |+| `duration` の時点で大きな破片がまだ見える | 最後の発生、ライフ、カラーカーブ | RGB の減衰を早めに始め、消えるまでの余裕を残す |+| 断片が表面に貼り付いたように見える | travel、spin、実際の空間的な方向 | まず離し、それから減速する。少し回転させ、均一で整った放射状の広がりにはしない |++元の反復では幾何的な隙間が先に機能しましたが、f108 にまだ大きな破片が残っており、独立レビューの判定はまだ iterate でした。+さらに 1 ラウンドで破片のライフと RGB の減衰を調整し、退場を仕上げました。新しい形を足しても、最後のフレームの言い訳にはなりません。+この失敗が示すのは、このシェルのマテリアルの組み合わせが目に見えて侵食しないということだけで、Model レイヤーがアルファカットオフを+決してサポートしないということではありません。また、修正は公式レンダラーをそのまま使いました。++## ケースの使い方++ケースのチェック項目をブリーフの受け入れ条件に書き、それから自分の標準ストリップとアセットで検証します。基本的な方向性は+[layering](layering.md)、[timing](timing.md)、[skeletons](skeletons.md) から来るもので、ケースはエビデンスに裏付けられた診断を加えるだけです。diff --git a/docs/ja/references/cli.md b/docs/ja/references/cli.mdnew file mode 100644index 0000000..13d66d3--- /dev/null+++ b/docs/ja/references/cli.md@@ -0,0 +1,121 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/cli.md`](../../../skills/effekseer-vfx/references/cli.md)。エージェントが読み込むのは英語版です。++# コマンドリファレンス++`sh <skill>/scripts/vfx [--project DIR] <command> [options]`。出力:stdout に JSON オブジェクトを一つ。ビルド中の進捗と lint の+警告は stderr に出ます。終了コード:0 成功、1 チェック失敗またはエラー(`{"ok": false, "error": {...}}`)、+2 セットアップが必要:ツールチェーンがない(`SetupRequired`)か、ここに作業領域がない(`WorkspaceMissing`)。+画像の結果はファイルパスです — 開いて見てください。++`doctor`、`init`、`examples`、`rubric`、`layer-schema`、`process-texture` 以外のすべてのコマンドは、`vfx init` が作った作業領域+(`vfx/src/` と `vfx/vfx_manifest.json`)を必要とします。ゲームプロジェクトから実行するか、`--project` を渡してください。間違ったフォルダで+実行したコマンドは、余計な `vfx/` を作る代わりに `WorkspaceMissing` で失敗します。カレントディレクトリは Python の import パスから外され、+`vfx/src` のヘルパーは `_name` ファイルとしてしか解決されないので、プロジェクトのファイルが標準ライブラリを隠すことはありません。++環境変数:`VFX_PROJECT`(プロジェクト。既定はカレントディレクトリ)、`EFFEKSEER_VFX_HOME`(ツールチェーン。既定は+`~/.cache/effekseer-vfx`)、`GODOT`(Godot 4 の実行ファイル。既定は PATH 上の `godot`、次に `/Applications/Godot.app`)。++| コマンド | 必要なもの | 内容 |+|---|---|---|+| `doctor` | — | プラットフォーム、ツールチェーン、作業領域。`modes` と `next` ステップ |+| `init [--update-templates] [--no-plugin]` | Python | `vfx/`(Lab、マテリアル、数式テクスチャ、ペイント系テクスチャのスターター)を作成/更新。公式 Effekseer Godot プラグインをダウンロード(チェックサム固定) |+| `examples [list]` | — | 同梱のペアと単体エフェクト。過去のスコア、判定、最も弱い点付き |+| `examples show <name\|ID>` | Python | 絶対フレームと役割付きのレイヤー計画(ペアなら両方のエフェクト) |+| `examples add <name\|ID\|all> [--force]` | Python | サンプルのソース、ブリーフ、ペイント系テクスチャ、プロンプトをプロジェクトにコピー。名前:`fire`、`ice`、`poison`、`dark`、`hit`、`slash`、`charge`、`shield`、`heal` |+| `procedural` | Python | 数式プリミティブのテクスチャを再生成 |+| `list` | Python | `vfx/src` 内のエフェクトを、カテゴリ、タイミング、delivery、design、ビルド状態とともに一覧。読み込めないソースは `unloaded` に列挙 |+| `lint [--ids ...] [--timeline]` | Python | 静的ルール(エラー)とクラフト上のヒューリスティクス(警告)。下記参照 |+| `layer-schema` | Python | コンパイラが受け付けるすべてのレイヤーフィールド |+| `brief-validate <ID>` | Python | ブリーフとレシピの照合。展開した絶対レイヤータイムライン付き |+| `effect-context <ID>` | Python | ブリーフ、ビルドの問題、最新のエビデンス、直近 10 ラウンド |+| `texture-info [names...]` | Python | カバー率、bbox、縁への接触、向き、膨らみ、継ぎ目比率 |+| `texture-audit <name> [--role R] [--grid C R] [--loop] [--allow-empty i...]` | Python | 役割別のチェック + プレビュー画像 |+| `process-texture <src> <dst> [--size N] [--color] [--grid C R]` | Python | クロップ、アルファ、パディング、2 の累乗へのリサイズ |+| `build [--ids ...]` | Core | lint、コンパイル、save/open の読み戻し、マニフェスト、ビルドレシート。`--ids` なしでは、このスキルがビルドし、ソースが `vfx/src` からなくなったエフェクトも削除(下記参照) |+| `compile <recipe.json> [--source] [--runtime]` | Core | レシピ JSON を一つコンパイル |+| `export [--output DIR]` | Core | ビルド済みの全エフェクトを `resources/` 付きの `.efk` へ再エクスポート |+| `discover` | Core | Core のプロパティパス、型、列挙値を `vfx/work/property_schema.json` に書き出す |+| `core <command> ...` | Core | 同梱ブリッジの低レベルコマンドを明示した `.efkefc` ファイルに対して実行:`property-list`、`property-get`、`property-set`、`node-list`、`curve-list`、`curve-set`、`settings-list`、`settings-set`、…(`vfx core --help`)。[エンジン規約](engine-conventions.md#コンパイラの拡張) を参照 |+| `review [--ids] [--step N] [--note] [--key-frames ...] [--view standard\|close] [--profile default\|bare] [--bright]` | Core + Godot | ストリップ、キーフレームシート、フラグ、changes、エビデンス ID |+| `overview [--ids]` | review 済み | 最新の標準撮影によるライブラリの総覧ページ(`effect-verify` が確認するベースライン)。一度も撮影していないエフェクトは飛ばされ、`missing` に列挙される。`--ids` を付けると、ベースラインを置き換えない作業用ページ `overview_select_*.png` |+| `strip <ID> [--compare] [--bright]` | review 済み | ストリップのパスと保存された指標 |+| `frames <evidence_id> <frame...>` | review 済み | フルサイズのフレームのパスと鮮度の問題 |+| `history <ID> [--limit N]` | — | レビューのラウンド。最新が最後 |+| `rubric` | — | 独立レビューの評価基準 |+| `review-handoff <ID>` | review 済み | 鮮度が保たれた最新の撮影について、独立レビュアー向けの完全なブリーフ(`prompt_file`)を書き出し、`report_file` と提出コマンドを返す |+| `review-submit <evidence_id> <report.json> --reviewer ID [--frames f...]` | review 済み | 独立レポートを結び付ける。フレームの既定値はその `observed_frames` |+| `effect-verify <ID> [--no-overview]` | — | 現在のビルド、撮影、レビュー、総覧が一致しなければ終了コード 1。`--no-overview` は部分チェックで、`passed_without_overview` を報告するだけで `verified: true` にはならない |+| `preview [--ids] [--bright] [--output]` | Godot | ベースライン、ピーク、50 %、85 % での UI 付きスクリーンショット |+| `showcase [--movie]` | Godot(+ ffmpeg) | ライブラリを自動再生する Lab を開く。`--movie` で録画 |+| `package [--preview-dir]` | Godot | テクスチャ一覧付きで Godot プロジェクトを zip 化。デバイステストの合格は主張しない |+| `reference-import`、`reference-frames`、`reference-compare` | ffmpeg | [reference](reference.md) を参照 |++## `--ids` と壊れたソース++`--ids` を付けると、`lint` と `build` は指定したソースが読み込めることだけを要求します。読み込みに失敗するその他の `vfx/src/VFX_*.py`+(書きかけのエフェクト)は、作業を止める代わりに `unloaded` に報告され、エフェクト間のチェックから外されます。`--ids` なしでは、+すべてのソースが読み込めなければなりません。++## 全量ビルドが削除しうるもの++`vfx/src` にレシピが一つもないとき、全量 `vfx build` は実行を拒否します。それ以外の場合に削除するのは、**このスキルがビルドした**+エフェクトのうち `vfx/src/<ID>.py` がなくなったものだけです:`built_by: "effekseer-vfx"` が付き、`source` が自身の `vfx/src/<ID>.py`+と一致するマニフェスト項目、またはこのタグ導入前にビルドされたワークスペースで、`vfx/work/builds/` のビルドレシートがディスク上の+`.efkefc` と今も一致するエフェクトです。不正な ID は決して所有扱いにならず、削除の前にすべてのパスが `vfx/` の内側にあることを確認します。+他のツールや人が作ったマニフェスト項目や `vfx/effects/` 内のエフェクトは残り、`vfx doctor` は `unmanaged` として数えます。++全量ビルドは、どのレシピも使わなくなったリソースコピーも削除します。対象は `vfx/textures/processed/` のテクスチャと同一のファイル+(とその PNG 自身の `.import`)だけで、同じ接頭辞の他のファイルは削除せず、unmanaged なエフェクトが使う可能性のある名前+(その `.efkefc` にファイル名がある、またはファイルが欠けている)も削除しません。Core はテクスチャとモデルをファイル名で `resources/`+にコピーするため、異なる 2 つのファイルが同じ名前を持つとビルドは `Resource name conflict` で停止します:同じビルド内の衝突、+それを使っていて同時に再ビルドされない自前のエフェクトとの衝突(一緒に再ビルドする)、それを使う可能性のある unmanaged なエフェクト+との衝突(ファイル名を変える)。出力フォルダのどれかが `vfx/` の外を指す(別の場所へのシンボリックリンク)場合、ビルドは実行を拒否します。+各ビルドレシートはそのリソースコピーをすべて束縛するので、後のビルドがその一つを変えると以前の撮影は無効になります。++## lint がチェックするもの++エラー(一つでもある間はビルドを拒否):++- 未知またはスペルミスのレイヤーフィールド(候補付き)、および無効なフィールド値+- duration の外にある `peak`。`flight` または `interval` のない `infinite` レイヤー+- duration を越えて生存するレイヤー(ループしないエフェクト)。発生と飛翔体の解放を含めて数える+- カテゴリの上限を超えるパーティクル予算:`hit` 60、`projectile` 100、`boss` 250、その他のカテゴリはすべて 150+- 数式プリミティブでもなく `vfx/texture_prompts.json` に記録もされていない、または `vfx/textures/processed/` にないテクスチャ+- ランダムなサイズやスケールの範囲と組み合わせた `size_curve`/`scale_curve`(コンパイラはそれらを掛け合わせられない)+- フリップブックへの UV ディストーション(隣のセルをサンプリングし、硬い四角い縁が描かれる)+- 0.01 を超える重力(1 フレームの 2 乗あたりの値)++警告(クラフト上のヒント。判断はストリップで):++- 最短のライフより長い `fade_in + fade_out`(そのレイヤーは完全な不透明度に達しない)+- `impact >= 0.3` なのに接触がないエフェクト:`flash()` レイヤーも、生存 10 フレーム以下の白熱した加算レイヤー一つもない+- 接触の開始が、Lab が反応するマニフェストの `peak` から 6 フレーム以上離れている+- 6 フレームより長く生存する `flash()`(接触は 2〜5 フレームであるべき)+- 形を変えるレイヤーがない:ディゾルブのカットオフ、リングのスイープ、UV ディストーションやスクロール、フリップブック、後のフレームで打ち直すペイント系の形状のいずれもない+- 白熱した加算の色がない(luma ≥ 0.85 かつ全チャンネル ≥ 180)+- 同じカテゴリで属性の異なる 2 つのエフェクトが、形状、モーション、リズム、マテリアル、二次モーションのうち 3 つ未満でしか違わない(色替えの可能性が高い)++## 作業領域の構成++```+<project>/vfx/+ src/VFX_*.py recipe sources (yours) ┐+ briefs/VFX_*.json design briefs │+ texture_prompts.json prompts of painted textures │ the effect library:+ textures/generated/ image-model originals (never edited)│ keep under version control+ textures/processed/ game textures (incl. procedural) │+ recipes/*.json compiled recipe snapshots │+ effects/*.efkefc Effekseer sources + resources/ │+ exports/*.efk runtime exports + resources/ │+ vfx_manifest.json ids, timing, delivery, design │+ previews/strips/overview_*.png, metrics.json ┘+ characters/ optional rigged stand-ins (player.glb, target.glb)+ godot/ generated Godot Lab (ignored)+ work/ receipts, locks, reference frames, audits, property schema (ignored)+```++`src/` から `previews/strips/overview_*.png, metrics.json` までがエフェクトライブラリで、バージョン管理に入れます:レシピのソース(あなたが書くもの)、+デザインブリーフ、ペイント系テクスチャのプロンプト、画像生成モデルの原画(編集しない)、ゲーム用テクスチャ(プロシージャルを含む)、+コンパイル済みレシピのスナップショット、Effekseer ソース + `resources/`、ランタイムエクスポート + `resources/`、+マニフェスト(ID、タイミング、delivery、design)、総覧と指標。`characters/` は任意のリグ付き代役キャラクター(`player.glb`、`target.glb`)、+`godot/` は生成された Godot Lab(バージョン管理から除外)、`work/` はレシート、ロック、リファレンスフレーム、監査結果、プロパティスキーマ(除外)です。diff --git a/docs/ja/references/craft.md b/docs/ja/references/craft.mdnew file mode 100644index 0000000..4ed450c--- /dev/null+++ b/docs/ja/references/craft.md@@ -0,0 +1,75 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/craft.md`](../../../skills/effekseer-vfx/references/craft.md)。エージェントが読み込むのは英語版です。++# VFX クラフトルール++すべてのレシピの土台となるルールです。エフェクトを書く・変更する前に、[layering](layering.md)、[timing](timing.md)、[skeletons](skeletons.md) と一緒に読んでください。ここにあるクラフト上の出発点はユーザーのスタイルに合わせて調整して構いませんが、[engine-conventions](engine-conventions.md) にある実測済みのエンジン挙動は変えてはいけません。++目次:1. 「ステッカー」エフェクトが失敗する理由 · 2. 時間構造 · 3. 属性の違い · 4. 飛翔体 ·+5. 不規則で複数の役割を持つエフェクト · 6. 予算++## 1. 「ステッカー」エフェクトが失敗する理由++色を変え、拡大し、フェードアウトするだけの静的なビルボードは、ステッカーに見えます。エフェクトをエフェクトらしく見せる要素は 5 つあり、どれか一つが欠けても品質は目に見えて落ちます。++1. **時間構造**:予備動作 → 接触フラッシュ → 本体 → 二次モーション → 消散。接触は 2〜5 フレーム、消散は尺の大半を占めます。+2. **明度の階層**:白熱コア、高彩度の本体、暗い外縁または残滓 — 平坦な単色ではありません。+3. **形状の変化**:本体が侵食される(アルファカットオフによるディゾルブ)、揺らぐ(UV ディストーション)、スイープして開く。スケールと不透明度だけでは足りません。+4. **速度の変化**:パーティクルは弾け出てから、宙に留まり垂れ下がります(イージングした移動)。一直線に等速で動かしてはいけません。+5. **画面へのフィードバック**:着弾時のブルーム、環境フラッシュ、カメラキック。Lab はこれらをマニフェストの `impact`、`light`、`peak` から導き出します。それらをオフにしても(`--profile bare`)エフェクトは成立していなければなりません。++## 2. 時間構造++| フェーズ | フレーム数(60 FPS) | 方法 |+|---|---|---|+| 予備動作 | 2–14 | 縮んでいく小さなグロー、地面の警告リング、細いガイドライン。重いヒットほど予備動作を長く |+| 接触 | 2–5 | `flash` の白い星形。本体サイズの 1.5〜2 倍で、すぐに消える |+| 本体 | 8–20 | ペイント系の形状が `POP` で現れ、`DISSOLVE` で侵食される。`shock_ring` が広がる |+| 二次モーション | 10–40 | `radial_sparks`、`motes`、破片、炎の舌。重力・上昇・乱流を付ける |+| 消散 | 20–60 | 煙、残り火、地面の亀裂の光がゆっくり冷めていく |++ヒール、シールド、バフは接触フレームを持たず、代わりにゆっくりしたフェードイン、上昇する動き、わずかなオーバーシュートを使います。+チャージは構造が逆になります:長い内向きの溜めの後、解放の瞬間に一度だけフラッシュします。++## 3. 属性の違い++色替えは新しい属性ではありません。同じカテゴリの 2 つの属性は、+**形状、モーション、リズム、マテリアル、二次モーション** のうち少なくとも 3 つで違っていなければなりません(違わない場合は `vfx lint` が警告します)。++| 属性 | 形状 | モーション | リズム | 二次モーション |+|---|---|---|---|---|+| 物理 | ギザギザのバースト、集中線 | 放射状に弾けてから垂れる | 最も短い、0.3–0.65 s | 火花、土埃 |+| 炎 | もくもくと膨らむ火球、炎の舌 | 上昇、UV ディストーション | 中程度、長いテール | 立ち昇る残り火、黒い煙 |+| 氷 | 角柱、破片 | オーバーシュートして静止し、その後砕ける | 「溜め」がある | 重力で落ちる破片、沈んでいく冷気 |+| 雷 | ギザギザの折れ線 | 移動しない。フレームごとに差し替えたり反転したりする落雷 | 主落雷、リターンストローク、残りの明滅が別々のフレームに | 地面の亀裂、這い回るアーク |+| 闇 | 渦、黒いコア | 内側へ引き込む | 長い引き込みと一度の解放 | アルファブレンドの黒い本体、内向きのモート |+| 聖 | 紋章、光の柱 | 垂直に降りる、または昇る | イーズインして持続 | 立ち昇るハロー、きらめき |+| 毒 | 雲、泡 | ゆっくり漂う、沈む霧 | 最も遅い、約 2 s | 立ち昇る泡、胞子 |++## 4. 飛翔体(カテゴリ `projectile`)++飛翔体には接触フレームがありません。着弾は別のエフェクトで、`Vfx.launch` の `arrived` シグナルで発火します。+飛翔体のレシピは `flight`(基準となる飛行の秒数)を宣言し、山なりに飛ばす場合は `arc`(飛行中間点での持ち上がりをメートルで)も宣言します。着弾側は `delivery=dict(kind='projectile', projectile='VFX_...')` で飛翔体を参照し返します。++- **ヘッド** レイヤーはハンドルに追従します(既定の継承)。**トレイル** レイヤーは `inherit=TRAIL`(位置・回転・スケールを `WhenCreating`)を使い、生まれた場所に留まるので、軌跡が自然に描かれます。どちらも `sustain(layer, interval)`(`infinite`)で放出し、ゲームは到達時に `stop_root()` を呼びます。その後に残るのはトレイルの消散だけです。lint はライフタイムを `flight` の時点で解放されたものとして計算し、予算は同時に生存する life/interval のインスタンス数を数えます。+- 属性ごとに飛行のリズムと二次モーションにも違いを付けます:炎は揺らめき、上昇し、黒い煙に変わる。氷は速くまっすぐ飛び、落下する破片を振りまき、沈む霧を残す。闇はアルファブレンドの黒いコアで、縮んでいく航跡とともに針を内側へ引きずる。毒は弧を描いて飛び、滴り、泡立ち、漂う毒煙を残す。+- レビューのストリップでは、飛翔体は術者からターゲットへ飛び、到達で終わります。重心と半径は属性の動きではなく飛行経路に従うため、飛翔体では `sinks` と `expands while charging` のフラグはチェックされません。++## 5. 不規則で複数の役割を持つエフェクト++遠距離エフェクトと着弾エフェクトをプロの仕事に見せる技法です(同梱のサンプルペアはこれらを使っています)。++1. **完全なリングではなく、途切れた弧。** 本体を、それぞれ 60–200° をスイープし、半径・傾き・幅の異なる不完全なストロークを複数交差させて組み立てます。メインの形状にはきれいな `shock_ring`、`shell`、丸いビルボードではなく、`wisps`(常時侵食のかかったペイント系ウィスプの筋)を使います。+2. **複数の役割、それぞれに仕事を。** 複雑な遠距離スキルでは、弧、白熱コア、黒いコア、2 段階の火花、モート、土埃、破片、地面の痕跡を組み合わせることがあります。各役割の目的を明示し、レイヤー数を合格の目安として扱ってはいけません。軽いヒットや単純なスキルでは、はるかに少なくて済みます。+3. **暗い属性は見えなければならない。** 暗いステージでは、グレーの煙や破片の明度は約 90–150 必要です。`(40,10,70)` のような色は描いていないのと同じです。+4. **目的を持った小さなアクセント**:闇にはオレンジの下面、氷にはプリズムの縁取り、毒には下に暗いコア。面積の 5〜10 % は最初の試し値にすぎません。メインとアクセントの役割は、先にブリーフで決めておきます。+5. **グローは煙へと減衰する。** `decay()` は加算のストロークに、数フレーム遅れて始まり 1.6〜2.2 倍長く生きるアルファブレンドのグレーのコピーを付けます:光が先に消え、形は煙として残ります。+6. **長く細い一本線。** 解放の瞬間に、画面の半分を横切る縦横比 40:1 以上の `slice_line` を 8〜15 フレーム。+7. **方向性。** 破片、火花、飛沫は対称な球状ではなく、射線(+X)に沿ってやや上向きに飛ばします(`spray`、`debris`)。+8. **地面へのフィードバック。** 転がる土埃、着地して跳ねる破片、焦げ跡、亀裂、水たまり、紋章がエフェクトを床に繋ぎ止めます。+9. **インパクトフレーム。** ほぼ黒の全画面カードと白いフラッシュは **同じフレーム** に置きます(黒いカードをフラッシュより前にリストする)。黒いカードを早く置くと、闇の「expands while charging」チェックがそれを膨張と読んでしまいます。++## 6. 予算++パーティクルのインスタンス数(`particle_budget`、親 × 子):通常のヒット ≤ 60、飛翔体 ≤ 100、属性スキル ≤ 150、+ボススキル ≤ 250。画面サイズの加算レイヤーが同時に生存するのは最大 3 つまで。テクスチャは 128–256 px、ペイント系のメイン形状と+紋章は 512 px、4×4 のフリップブックシートは 1024 px です。diff --git a/docs/ja/references/design.md b/docs/ja/references/design.mdnew file mode 100644index 0000000..100ddda--- /dev/null+++ b/docs/ja/references/design.md@@ -0,0 +1,93 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/design.md`](../../../skills/effekseer-vfx/references/design.md)。エージェントが読み込むのは英語版です。++# デザインブリーフ++新しいエフェクトはすべて、レシピを書く前にブリーフから始めます:まず `vfx/briefs/<ID>.json` を作ります。`vfx brief-validate <ID>` はブリーフをレシピと照合する(レイヤーパス、ビートが長さ内に収まるか)ため、最初のレシピ案ができてから実行し、どちらかを変更するたびに再実行します。+小さな修正では、既存のブリーフを読み、影響を受ける目標を調整します。ブリーフの時間はエフェクト開始からの 60 FPS 絶対フレームで、+マニフェストは秒で保持します。++## ブリーフで決めること++**用途**(頻繁に出るヒット、単発のスキル、フィニッシュ技、持続する状態、見せ場の作品)、**プレイヤーが最初に読み取る形**、+標準カメラでの **キャラクターに対する大きさ**、**解放または接触の瞬間**、**最後に何が残るか** を明記します。+受け入れ条件には見える振る舞いを書きます — 「フラッシュが消えた後も炎は上へ巻き上がり続ける」のように。「レイヤーを増やす」や「高級感」とは書きません。++まずキーフレームを 3 つ決めます:**最初に読み取れる瞬間**、**接触から本体へ引き継ぐ瞬間**、**最後の意図的な残滓**。それぞれについて、+どんな形がどこにあり、どう変化しているかを書き、それからプリミティブを選びます。「ターゲットの胸を横切る傾いた弧。下の縁から炎が剥がれて昇り、+最後は残り火だけになる」は、「かっこいい炎の斬撃」よりもはるかに的確にコードを導きます。++| 用途 | 最初に読み取る形 | ボリュームとスケールの決定 | 空けておくべき空間 |+|---|---|---|---|+| 頻繁に出るヒット | 小さなバーストと短い方向線 | ヒット点を中心に。毎回キャラクター全体を覆わない | プレイヤーの体と周囲の戦闘情報 |+| 方向のある斬撃 | 傾いた平面上の弧と熱い縁 | 振りの平面がターゲットを通る。幅と余白の両方が見える | 弧の内側と背後にあるキャラクターのシルエット |+| 単発の爆発 | 接触点から噴き出すボリューム | 標準カメラで本体が目に見えて成長し、持ち上がり、残滓を残す | 二次モーションのための本体外の通り道 |+| 持続する状態 | 持ち主を囲む安定した輪郭 | 最高輝度を保持しない。保持中も表面に動きがある | シェル内のキャラクターとメインの視界 |++テクスチャ名から組み立ててはいけません。同じ煙の連番でも、火球の後の重みにも、飛行経路に沿った残滓にもなり得ますが、+発生位置、サイズ、方向、密度、再生するフレーム範囲は変えなければなりません。重要なレイヤーが中心を共有する場合は、+どれが手前でどれが奥か、どれが先に退場するかを明記します。++## パレットの役割++`palette` は **core**、**body**、**dark**、**matter** を割り当てます(accent は任意)。短く熱いコア、輪郭を持つ高彩度の本体、+輪郭や残滓にコントラストを与える暗色、そしてエフェクトに素材の重みを与える煙や破片。アクセントはレイヤーごとに色を足すのではなく、+ブリーフで宣言します。エフェクトはグレースケールでも読み取れるべきです。[layering](layering.md) を参照してください。++## 用途別の時間構造++通常のヒットは短い接触の後に減衰します。チャージは徐々に溜めても構いません。雷には明示的なリターンストロークがあってもよい。+シールドには安定した保持区間があってもよい。多段ヒットのスキルは各ピークを個別に明記します。爆発は明るさが落ちる間も本体が成長し、+昇り続けることがあります。小さな火花の群れが、消えた本体の代わりになることはありません。+[timing](timing.md) を参照してください。++## スタイルルールの例外++「不規則」は物質、破損、筆致に合うもので、紋章、照準の手がかり、光学的な星形に自動的に当てはまるわけではありません。+「多くの役割」は複雑なスキル向けで、軽いヒット向けではありません。「白いコア」は攻撃の接触を助けますが、ヒールが光らなければならないという意味ではありません。+[craft](craft.md) にあるリファレンスの技法は候補となる道具であり、スタイルと用途を決めるのはユーザーとブリーフです。+表を一つ読んだだけで、すべてのスキルに同じグロー、衝撃リング、火花を付けてはいけません。++## ブリーフの形式++`reference` 以外のフィールドはすべて必須です(`assets/brief.schema.json`)。以下は同梱の `VFX_Fire_Explosion` のブリーフ+(全 24 レイヤーを計画しています)からの抜粋です。++```json+{+ "schema_version": 1,+ "effect_id": "VFX_Fire_Explosion",+ "role": "paired ranged impact",+ "style": "stylized anime combat",+ "dominant_shape": "turbulent comet and ascending cooling smoke",+ "palette": {"core": [255, 250, 220], "body": [255, 120, 30], "dark": [60, 30, 20], "matter": [125, 110, 100]},+ "delivery": {"kind": "projectile", "projectile": "VFX_Projectile_Fire"},+ "anchor": "body",+ "beats": [+ {"frame": 4, "name": "gather", "expect": "Inward gathering at target"},+ {"frame": 10, "name": "contact", "expect": "White-hot detonation lasts only a few frames"},+ {"frame": 18, "name": "body", "expect": "Orange fire survives white flash"},+ {"frame": 54, "name": "tail", "expect": "Grey smoke thins while ascending"}+ ],+ "layer_plan": [+ {"name": "0:Scorch", "role": "ground footprint", "primitive": "Sprite T_Crack01", "exit": "gone by absolute f55"},+ {"name": "5:Detonation flash", "role": "contact", "primitive": "flash", "exit": "gone by absolute f12"}+ ],+ "acceptance": ["Head/body silhouette reads at standard camera after the brightest accent"],+ "avoid": ["Large persistent white blob erasing the body"]+}+```++- `effect_id`、`delivery`、`anchor` は、レシピの `id`、`delivery`、`attach` と一致していなければなりません。+- `beats` は順序付きの絶対フレーム(0 … duration + 12)です。レビューは常にこれらをキーフレームとして撮影します。+- `layer_plan[].name` はレイヤーの **インデックス付きフルパス** です — 兄弟内のインデックスと名前で、子は `/` で繋ぎます+ (`0:Swing plane/1:Blade body`)。これにより同じ名前があっても区別できます。レイヤーを移動したら更新します。すべてのレイヤーを+ 計画に含めるべきです(計画にないものは警告されます)。ブリーフのメタデータをレイヤーの dict に入れてはいけません。+- `brief-validate` は親の発生時刻を展開します:子の delay はエフェクトの開始時刻ではありません。++同梱のサンプル(`vfx examples add <pair>`)には、それぞれコピー元として使える完全なブリーフが付いています。++## 始める前に++色、エミッシブ、Add/Blend、そして Lab の HDR ブルームが組み合わさって画が決まります。[エンジン規約](engine-conventions.md) にある+ステージ設定を把握しておいてください。最初のスケールには既存のライブラリとダミーの大きさを使い、その後標準カメラで確認します。+優れたリファレンス作品はリズムとシルエットの目標であり、そのサイズや明るさの数値はこのエンジンの既定値ではありません。diff --git a/docs/ja/references/engine-conventions.md b/docs/ja/references/engine-conventions.mdnew file mode 100644index 0000000..74d7e8b--- /dev/null+++ b/docs/ja/references/engine-conventions.md@@ -0,0 +1,139 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/engine-conventions.md`](../../../skills/effekseer-vfx/references/engine-conventions.md)。エージェントが読み込むのは英語版です。++# 検証済みのエンジン規約(Effekseer Core 1.80.7 + EffekseerForGodot4 1.80.5.1)++以下の各項目は、実際のレンダーで確認したものです。そのまま使い、軸、単位、ブレンドの挙動を推測し直してはいけません。+新しい規約を確認したら、計測方法と一緒にここへ追記してください。++目次:角度と軸 · 力とモーション · メッシュとフレネル · テクスチャとフリップブック · 継承とライフタイム ·+レンダリング、HDR、Lab · アンカーと配置 · コンパイラの拡張++## 角度と軸++- **Ring の角度**:0° は上、90° は左を指し、反時計回りに増えます。スイープする弧をアンカーの中心に置くには、+ スイープの中央に対してリングの中心をオフセットします。+- **Sprite の Z 回転** は反時計回りです。ペイント系の形状の向きを目測してはいけません:`vfx texture-info <name>` は、+ カバー率、バウンディングボックス、縁への接触、主方向、三日月の膨らみの方向を同じ規約(+x が 0°、反時計回り)で報告します。+ レシピには実測した角度を使います。例:`T_Slash02` の膨らみは 108° と計測され、`slash_set()` は `SLASH02_BULGE = 105` を使います。+ このテクスチャを差し替えたら、計測し直して定数を更新してください。+- **`billboard='Billboard'` は Z 回転を無視します**(`rotation=[0,0,90]` のスプライトも直立したまま)。ロールが必要なスプライトは+ 既定の `RotatedBillboard` を使います。+- **`rotate=True` の球の放出**:パーティクルのローカル +Y が外側を向くので、`travel.end=[0,d,0]` は外へ飛び、+ 負の値は内側へ引き込みます。+- **`rotate=True` の円の放出(既定は Y 軸)は異なります**:Core は `Translation(r,0,0)*RotationY(angle)` を組み立てるので、+ ローカルの **+X** が外側を向き、+Y は上のままです。床に沿って転がり出る煙には `travel.end=[[d0,d1],0,0]` が必要で、+ `[0,d,0]` にするとまっすぐ立ち昇る柱になってしまいます。`rotate=False` では変位はワールド方向になります+ (立ち昇るパーティクルにはこちらを使います)。+- **`travel.end` は絶対的なローカル位置** であり、`position` からのオフセットではありません。また `rotate=True` の放出は+ そのローカル座標系も回転させます。床を転がる煙は、`position` を床の高さにした `renderer='None'` のピボットの下に置きます。+ ワールド方向の変位には `spawn rotate=False`(`spray`)を使います。++## 力とモーション++- **Drag が減衰させるのは力場で蓄積した速度だけで、PVA の速度は減衰させません。** 「弾けてから留まる」は、+ velocity + drag ではなく、EaseOut を付けた `travel` で作らなければなりません。+- **重力の単位は units per frame² です。** 落ちる火花は 0.001–0.002、岩は 0.004、立ち昇る煙は 0.0003–0.0006。桁が一つ大きいと+ パーティクルは画面外へ飛び出します(lint は 0.01 を超える値を拒否します)。+- **床との衝突 `collide`**:ワールド座標系で、`height` はワールドの高さです(Lab の床は 0.02)。高さ 1.35 m の着弾点から+ 重力 0.0015 では 20 フレーム以内に床に届くものはないので、跳ね返りが意味を持つのは爆発、ボスの叩きつけ、着地するものだけです。+- **Track + Circle の `Order` 放出では螺旋になりません**:1 フレームに 1 セグメントずつ進むので、飛行速度ではピッチが引き伸ばされ、+ 平らなジグザグになります。代わりに、ヘッドの周りにランダムな傾きの `wisps` のストロークを使います。++## メッシュとフレネル++- **プロシージャルな円柱と円錐** は、軸に沿って `DepthMin` から `DepthMax` までを占めます。`mesh()` はそれらを原点の上に立てます。+ **球** は正規化された -1..1 の奥行きを使います:サイズは Depth ではなく `scale_start` で決めます。+- **Cone は下を向きます**(底面が +Y 側の端にあります)。上を向いた結晶には `radius2≈0` の `Cylinder` を使います+ (`crystal()` はそうしています)。`Mesh/Divisions/X=6` で六角柱になります。`ShapeNoise/WaveNoisePower` は球を+ 凸凹した液体の塊にします。大きな球は `rings ≥ 24` が必要で、そうでないとシルエットが角張ります。+- **プロシージャルモデルの V は上から下へ走ります。** スクロールするカラーテクスチャはタイル可能でなければならず(`T_NoiseStreak02`)、+ グラデーションはスクロールしないアルファテクスチャ(`T_GradientV01`)に入れます。そうしないとくっきりした継ぎ目が出ます。+- **Falloff**:`begin` はカメラに面した中心、`end` は縁で、`pow` を大きくすると `begin` の領域は **小さく** なります+ (赤/緑のテスト:pow 8 では球のほぼ全体が `end` を示す)。細く明るいリム(フレネル、衝撃シェル)には `pow` 0.25–0.5 を使います。+ 球の前面だけを描くには `culling='Front'` を使います(Effekseer の命名:`Front` は前面を表示。`Double` は内側の裏面も+ 縁として光らせ、球が中身の詰まったものになります)。シールドは縁を光らせ、柱は縁を透明にします。+- **カラーテクスチャ、または常時カットオフ + エッジを持つ Model レイヤー** は、Godot プラグインではシェル球の上で灰色のまだらとしてレンダーされます。+ 平坦な色 + フレネルを使い、ディゾルブは効果切れの時だけにします。目に見える崩れには、シェル全体にカットオフをかけるのではなく+ `shell_fragments`(実際のジオメトリ)を使います。+- ブラックホール、闇の球、チャージに **カメラを向く「渦ステッカー」は使いません**:`orbit_band` で傾いた平面上にリングを置き、+ 描画順に積み重ねます — 奥の半リング → コア(Blend の黒い円盤または明るいコア)→ フォトンリング →+ 手前の半リング — こうすると手前の半分がコアの前を通ります。プラグインは **エフェクトレイヤー間の ZWrite を無視します**+ (深度を書き込む球と深度テストするリングの組み合わせは効果がありませんでした)。遮蔽はリストの順序だけで決まります。リングの表面を回すには、+ Z 回転ではなく `alpha_scroll` を使い、筋がリングに沿って流れるようにします。++## テクスチャとフリップブック++- **UV ディストーションのテクスチャは不透明な RG オフセットマップでなければなりません**(`T_Distort01/02`)。アルファ上の白いマスクを+ ディストーションマップとして使っても、何も歪みません。+- **アルファテクスチャはアルファチャンネルを読みます**。`T_Noise*` のマスクはどれも `cutoff` のディゾルブにそのまま使えます。+- **フリップブックの整数**:`flipbook.frame_length`、`x`、`y` は Core の整数プロパティで、正の整数でなければなりません+ (4.5 はネイティブで拒否され、その前にフィールドのバリデータが捕まえます)。再生を長くするには、整数のフレーム長とライフを一緒に延ばします。+- **フリップブックに UV ディストーションをかけない**:`distortion_intensity` はテクスチャ全体の UV で測られるので、4×4 シートで 0.12 は+ セルの半分ずれて隣のフレームをサンプリングします — 炎が縁のくっきりしたブロックに切り刻まれます。lint が拒否します。+ ディストーションが必要なら単一フレームのテクスチャを使います。+- **フリップブックシート**:画像生成モデルは、使える連続性を持った 4×4 の連番全体(1024²、セル 256²)を作れます。+ `vfx process-texture <original> <output> --size 1024 --grid 4 4` で処理します:セルは位置を保ち(クロップも再センタリングもしない。+ すればアニメーションががたつく)、各セルの縁はにじみを防ぐためにフェザーされます。+ `frame_length` ≈ life / 16。単発は `loop='Once'`、ループする炎は `Loop` とランダムな開始フレームで。+- **爆発シート一枚、レイヤー二枚**:加算の炎(ランプ:白 → 黄 → オレンジ → 暗い赤 → 消える)と、約 8 フレーム遅らせた+ Blend の暗い煙のレイヤー。煙は炎より **前にリストし**(炎の奥に描く)なければなりません。そうしないと火球に黒い穴が開きます。+- **侵食の縁の色** は冷めた赤の上に加算されます。黄色っぽい縁はオリーブ色になります。炎には `scaling≈2` で `(255,80,15)` を使います。+- **ウィスプの筋のテクスチャ**:ペイントされた筋の帯を、幅いっぱいのまま行方向にクロップし(横方向にタイルできるように)、+ アルファ = 輝度で 512×256 にリサイズします。既定の中央寄せ処理は左右に余白を加え、タイリングを壊します。++## 継承とライフタイム++- **継承**:Core の既定の `LocationEffectType` は `Already`(毎フレーム親に追従)です。`WhenCreating` は+ 誕生時にだけ親のトランスフォームを取るので、ハンドルが動いてもパーティクルはその場に留まります — 飛翔体のトレイルはこれに依存しています。+ `renderer='Track'` は一つのレイヤーの連続したインスタンスを繋いでリボンにします。`WhenCreating` と組み合わせると+ 途切れないトレイルになります。+- **`EffekseerEmitter3D.stop_root()`** は新しい放出を止めます。既存のパーティクルは自分のライフを全うし、その後で+ `finished` が発火します。+- **子のタイミング**:子の生成は、親インスタンスの死亡ではなく生成から計時されます。`renderer='None'` の親は子を回転させられ、+ `travel` で中心へイージングする子は螺旋状に落ち込みます。+- **ランダムなサイズにはカーブを付けられません**:ランダムな `size` / `scale_start` の範囲と `size_curve` / `scale_curve` の組み合わせは+ コンパイルに失敗します(コンパイラはカーブに固定の開始スケールを掛けるため。lint が拒否します)。サイズを変化させるには+ 2 つ目のレイヤーを使います。++## レンダリング、HDR、Lab++- **スクリーンディストーション `material='BackDistortion'`** は Godot プラグインで機能します(`hint_screen_texture`)。`distortion` は+ 強さです(0.4–1.2)。屈折させるのは不透明なオブジェクト(床、ダミー)だけで、他のエフェクトレイヤーは屈折させません。暗く無地の+ ステージでは床のリングとダミーの縁にしか現れないので、フレームを拡大して確認してください。ディストーションをオフにしても+ エフェクトは成立していなければなりません。+- **Lab のステージと HDR ブルーム**:既定のステージはライティングされた深いスレートブルーです(背景 `1a2433`、床 `1d2733`、+ 環境光 0.75、キー 1.5、フィル 1.0)。Forward+ では、プラグインの加算 / エミッシブ出力は HDR バッファに入ります。+ ライティングされた代役キャラクターで計測したところ、ダミーのハイライトのピークは約 3.4× だった一方、エフェクトのコアは 8× を超えたため、Glow は+ `smoothstep(threshold, threshold + hdr_scale)` で 2.8 から立ち上がり 6.0 で完全にオン、intensity 1.5、strength 1.1、+ トーンマッピング前に加算、5 段階のブラー 1.0/1.0/0.85/0.6/0.35、コアが早めに白く焼けるよう Filmic white 4、+ `glow_bloom=0` としています。これらの数値はライティングされたトゥーン調の代役キャラクターで計測したもので、既定の Lab のカプセルのダミーでは+ まだ計測し直していません。しきい値は出発点として扱い、ステージの明るさ、ダミーのライティング、代役を変えたら、しきい値を動かす前に+ ダミーのピークを計測し直してください(リニアトーンマップ、露出 1/8 で読み戻す)。+ `godot --path vfx/godot -- --no-glow` は比較用にポストプロセスを無効にします。レシピのプリミティブ+ `glow()` はテクスチャレイヤーであり、この HDR ポストプロセスではありません。ステージを変えたら総覧全体をレンダーし直します。+- ブルームが強いと、接触が正当に白熱しているエフェクトはピークのフレームで `washed out` を報告します。それは+ 1〜3 フレーム続くだけなので、ストリップで判断し、フラグを黙らせるためだけに接触を弱めてはいけません。+- **ソフトパーティクル `soft`** は、以前の Compatibility レンダラーの Lab では使えませんでした(深度テクスチャがなく、スプライトが+ ほぼ完全に透明になった)。現在の Lab は Forward+ を使っていますが、`soft` は再検証されていません:使わず、機能すると主張もしないでください。++## アンカーと配置++- Lab のアンカー:`body` は床から 0.95 m、`impact` は 1.35 m、`ground` は 0。`body` アンカーのエフェクトの床レイヤーは+ 約 `y = -0.93`、`impact` アンカーのエフェクトでは約 `y = -1.3` に置きます。それより低く書くと、深度テストされるデカールは床の下に消えます。+- 打撃の線を横切る近接の衝撃リングには `tilt=(0,58,0)` を使います:左から右への攻撃に垂直で、+ パースでは縦長の楕円に見えます。++## コンパイラの拡張++レシピのフィールドは Effekseer の機能を厳選したサブセットです。エフェクトに、コンパイラにまだないエンジン機能が必要なときは:++1. その機能を持つ参照用ノードを作り(またはそれを持つエフェクトを開き)、プロパティパスを見つけます:+ `vfx discover` は新しいノードのすべてのパスを型と列挙値付きで `vfx/work/property_schema.json` に書き出し、+ `vfx core property-list <file.efkefc> node/root/0` は実際のノードのパスを一覧にします。+2. **書く前に読む**:`vfx core property-get <file> <path>` で現在の値を読み、`vfx core property-set <file> <path> <json>` の後に+ もう一度 `property-get` して、Core が実際に保存した値を確認します。カーブは `vfx core curve-list` / `curve-set`、+ レンダラーのパネルは `settings-list` / `settings-set` を通します。+3. 現在の Core が保存するプロパティだけを使います。インポート時にしか読まれない古いフィールドに頼ってはいけません。+4. その機能をレイヤーフィールドとして `scripts/effekseer_ai/authoring.py` に追加し(`vfx layer-schema` に現れなければなりません)、+ レイヤーをコンパイルし、保存し、開き直して値を読み戻すテストを付けます。レシピに生のプロパティパスを書いてはいけません。+5. レンダーして、計測方法とともにこの規約をこのファイルに追記します。diff --git a/docs/ja/references/examples.md b/docs/ja/references/examples.mdnew file mode 100644index 0000000..a7edbbd--- /dev/null+++ b/docs/ja/references/examples.md@@ -0,0 +1,45 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/examples.md`](../../../skills/effekseer-vfx/references/examples.md)。エージェントが読み込むのは英語版です。++# 同梱サンプル++遠距離ペア 4 組(飛翔体と、その到達点で再生される着弾)と、よくあるカテゴリごとに一つずつの単体エフェクト 5 つがあります。+デザインブリーフ、ペイント系テクスチャ(処理済みのコピー)、それらを作ったプロンプトを備えた、完全なプロダクション用レシピです。+それぞれのレイヤーの役割は、[skeletons](skeletons.md) のカテゴリ別の骨格そのものです。++| ペア | 飛翔体 | 着弾 | 学べること |+|---|---|---|---|+| `fire` | `VFX_Projectile_Fire` — 沸き立つフリップブックの火球、引き伸ばされた彗星のテール、ワールド空間の炎と煙のトレイル | `VFX_Fire_Explosion` — 射線に沿って投げ出される偏った火球、昇っていくキノコ雲、煙へと減衰する地面を舐める炎、焦げ跡と亀裂 | フリップブックの膨らみ、カラーランプ、`decay()`、方向のある `spray`/`debris` |+| `ice` | `VFX_Projectile_Ice` — 紺色の裏打ちを持つ結晶の槍、プリズムの縁取りのあるリボン、経路上に凍り付いた霜のリング | `VFX_Ice_Spikes` — オーバーシュートしながら噴き出す結晶、昇るハローを伴う溜め、タイミングを合わせた砕け | `crystal` メッシュ、フレネルの縁、明度の裏打ち、溜めてから壊すリズム |+| `poison` | `VFX_Projectile_Poison` — 濡れたハイライトを持つ、弧を描いて飛ぶ光沢のある塊(変形メッシュ)、酸の糸、着地する滴 | `VFX_Poison_Cloud` — 酸の飛沫、泡を伴って広がる水たまり、濁った紫灰色へ冷めていく毒煙、転がる霧 | `arc`、Track トレイル、`ShapeNoise` の液体、補色の暗いコア、床との衝突 |+| `dark` | `VFX_Projectile_Dark` — 交差するマゼンタのウィスプの中で渦巻くアルファ黒の球、引き込まれる針と塵 | `VFX_Dark_Vortex` — 傾いた降着円盤の中で呑み込み続ける黒い地平、黒いインパクトフレーム、続いて引き裂かれた解放の弧と地面の渦巻き | 光を吸う Blend の本体、内向きの `travel`、円盤を手前と奥の 2 つに分けた遮蔽、インパクトフレーム |++| 単体 | エフェクト | 学べること |+|---|---|---|+| `hit` | `VFX_Hit_Heavy` | 2 フレームの予備動作、5 フレームの接触、ディゾルブするギザギザのバースト、3 段階の `spark_burst`、空気の泡と屈折の波 |+| `slash` | `VFX_Slash_Fire` | ヨーを付けた `swing()` の平面の中の `slash_set()`(残像、本体、熱い縁、屈折、セル調の三日月)。剥がれていく炎の舌 |+| `charge` | `VFX_Magic_Charge` | 傾いた `orbit_band` のリングと内側へ潰れていくシェルによる 1 秒間の内向きの溜め、そしてちょうど一度の解放 |+| `shield` | `VFX_Shield_Dome` | フレネルのシェルと細いリム、オーバーシュートするポップ、スキャンバンドを伴う保持、時間どおりに消える `shell_fragments` の崩れ |+| `heal` | `VFX_Heal` | インパクトフレームなし:床の紋章、スクロールする柱、リング、すべて昇ってイーズアウトするプラス記号と光の粒 |++```sh+vfx examples # list with historical scores and verdicts+vfx examples show slash # layer plan, absolute frames, roles, budget (a pair shows both effects)+vfx examples add fire # copy into vfx/src, vfx/briefs, vfx/textures/processed, vfx/texture_prompts.json+vfx lint --ids VFX_Projectile_Fire VFX_Fire_Explosion+vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion+vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"+```++`vfx examples` は過去のスコアと判定付きの一覧、`vfx examples show` はレイヤー計画・絶対フレーム・役割・予算(ペアなら両方のエフェクト)、+`vfx examples add fire` は `vfx/src`、`vfx/briefs`、`vfx/textures/processed`、`vfx/texture_prompts.json` へのコピーです。++過去のスコア(評価基準の項目ごとに 0〜3)は、スキル既定のカプセル Lab でのレンダーに対する独立レビューによるものです:ストリップ、+キーフレームシート、マニフェストのエントリ、フラグだけを見た 2 人のレビュアーが採点しました。11 個が `ship` と判定され、+`VFX_Projectile_Ice`(白いコアも暗い縁もない平板な槍で、飛行中に形が変わらない)と `VFX_Projectile_Dark`(到達後に経路に何も残らない)は+`iterate` と判定されました。`vfx examples` は各サンプルの最も弱い評価項目と、レビュアーによる修正案一つ(`historical_review.worst`)を一覧にします。+スコアは参考であって、あなたのビルドの検証では **ありません**:ビルド、レビュー、採点をやり直してください。`--force` を付けない限り、+サンプルを追加しても既存のファイルは上書きされません。++サンプルから新しいエフェクトを作るには、ソースを新しい ID でコピーし(ファイル名と `effect('...')` の名前、+ブリーフの `effect_id` を変更)、それから色だけでなく形、モーション、リズムを変えます([craft](craft.md) を参照)。+飛翔体と着弾の対応を一貫させてください:着弾の `delivery.projectile` は飛翔体の ID を指していなければなりません。diff --git a/docs/ja/references/godot.md b/docs/ja/references/godot.mdnew file mode 100644index 0000000..3b6befd--- /dev/null+++ b/docs/ja/references/godot.md@@ -0,0 +1,52 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/godot.md`](../../../skills/effekseer-vfx/references/godot.md)。エージェントが読み込むのは英語版です。++# Godot でエフェクトを使う++`vfx init` は `vfx/godot/` を生成します。これは公式 Effekseer プラグイン、`Vfx` オートロード、インスタンスごとの+`CombatVfxHandle`、VfxLab シーンを含む Godot 4 プロジェクトです。スキルの `assets/godot-lab/` にあるランタイムロジックを編集するのは、+スキルをメンテナンスする場合だけにしてください。ゲームプロジェクトでは、`scripts/Vfx.gd`、`scripts/VfxHandle.gd`、`effects/` フォルダ+(`resources/` 付き)、`vfx_manifest.json` を同じ `res://` パスでゲームにコピーし(`Vfx.gd` は `res://vfx_manifest.json` を読みます)、+そこで Effekseer プラグインを有効にし、autoload を登録します:プロジェクト設定 → グローバル → 自動読み込み、または `project.godot` の+`[autoload]` に `Vfx="*res://scripts/Vfx.gd"`。登録しないと `Vfx.play()` は存在しません。++## API++```gdscript+var handle = Vfx.play("VFX_Fire_Explosion", position, rotation, effect_scale) # rotation in radians+Vfx.set_speed(0.5) # all active effects, 0.05–4+Vfx.set_paused(true)+handle.stop() # immediately+handle.release() # stop emitting; live particles finish, then it frees itself++# Projectiles: flight time from the manifest unless options.speed (m/s) or options.flight (s); options.arc lifts it.+var shot = Vfx.launch("VFX_Projectile_Fire", from, to)+shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))+```++補足:`rotation` はラジアンです。`Vfx.set_speed` はアクティブなすべてのエフェクトに作用し、範囲は 0.05–4 です。`handle.stop()` は即座に停止し、+`handle.release()` は放出を止め、生きているパーティクルが終わった後に自身を解放します。飛翔体の飛行時間は、`options.speed`(m/s)か+`options.flight`(s)を指定しない限りマニフェストから取られ、`options.arc` で山なりに持ち上げます。++有限のエフェクトは `duration` の後に自動で片付けられ、ループするエフェクトは `stop()` まで再生を繰り返します。マニフェスト+(`vfx_manifest.json`)は `id`、`duration`、`peak`、`impact`、`light`、`delivery`、`flight`、`arc`、`attach`、+`design` を持ちます。Lab はステージのフラッシュとカメラキックに `impact`/`light`/`peak` を使いますが、ゲームではこれらを自前で実装します。++## Lab++`vfx showcase`(または `godot --path vfx/godot`)で Lab が開きます:PLAYER と TARGET の 2 体のダミーが向かい合い、すべての+エフェクトがその `delivery` に従って演出されます — `self` は術者に、`melee` は打撃の瞬間にターゲットに、+`projectile` は術者からターゲットへ飛んで到達時に着弾を、`targeted` はターゲットの上に降らせ、`area` はボスの叩きつけを中心に。+キー:←/→ 切り替え、Space 再生し直し、C 対戦/単体ステージ、L ループ、P 一時停止、1–4 速度、+B 背景、S 自動ショーケース。`-- --no-glow` は比較用に HDR ブルームを無効にします。++ダミーはカプセルです。任意のリグ付き代役で置き換えられます:`player.glb` と `target.glb`(高さ約 1 ユニット、+Mixamo 形式のボーン名、`idle`、`cast_a_spell`、`box_03`、`hit_to_head`、`hit_to_body_01`、`jump` という名前のクリップ)と、+任意の `<name>.materials.json`(部位 → 役割のマップ)を `vfx/characters/` に置き、`vfx init` を実行します。ダミーを変えると+ステージが変わります:ベースラインをレンダーし直し、ブルームのしきい値を計測し直してください+([エンジン規約](engine-conventions.md) を参照)。++## チェック++`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` は、現在のマニフェストに対して play、launch、pause、speed、loop、+自動回収を試験します。`godot --headless --path vfx/godot --script res://scripts/ExportRuntime.gd` は+Godot のランタイムリソースをエクスポートします。これらは実際に実行した後でのみ、合格と報告してください。diff --git a/docs/ja/references/layering.md b/docs/ja/references/layering.mdnew file mode 100644index 0000000..b323d67--- /dev/null+++ b/docs/ja/references/layering.md@@ -0,0 +1,91 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/layering.md`](../../../skills/effekseer-vfx/references/layering.md)。エージェントが読み込むのは英語版です。++# 明度、色、レイヤーの組み合わせ++標準カメラで見る人が読み取れるものを 3 つ計画します:短く明るい点、形を持つ本体、そして本体を引き立てる暗い側面または素材。+レイヤーを足すたびに、それが直す目に見える問題を言えなければなりません。レイヤー数は品質の尺度ではありません。++## まずパレットの役割++| 役割 | 見えるべきもの | 最初の調整 |+|---|---|---|+| core | 小さな最も熱い領域、または細く熱い縁。接触時にはっきり見える | エミッシブを足す前に、サイズと持続時間を制御する |+| body | 属性とアクションを伝える高彩度の輪郭 | 白いフラッシュが去った後も形を保つ。消すのではなく色を冷ます |+| dark | 裏打ち、凹み、亀裂、または本物の影 | Blend を使い、明るい背景と暗い背景の両方で確認する。黒の Add ではこの役目は果たせない |+| matter | 煙、土埃、破片、滴 — 重み | 彩度を下げ、内部の明度と見える退場を保つ |+| accent | 小さな第二色の手がかり | 一つの場所かフェーズに限定し、メインカラーを奪っていないか確認する |++メインカラーは単色でも、近い色の系統でも構いません。第二色には仕事が必要です(氷のプリズムの縁取り、毒の暗いコア)。+レイヤーごとに色を選んではいけませんし、補色は必須ではありません。炎の隣の煙が灰色になる前に暖色を経由するのは構いませんが、+煙を全部高彩度のオレンジで塗り直してはいけません。++色相より先に、グレースケールで明度を読みます。コア、本体、背景がすべて白に近いなら、オレンジのパーティクルを足しても構造は戻りません。+どのレイヤーが最初に画を白く飛ばしているのかを突き止めます:接触、グロー、本体、あるいは重なった複数の Add レイヤー。++## 3 種類のコピーはそれぞれ別の仕事をする++| 技法 | ジオメトリとタイミング | 目的 | よくある間違い |+|---|---|---|---|+| 暗い裏打ち(`shadow()`) | 独自の形で、やや大きくてもよい。本体とほぼ同じフェーズ | 明るい色を引き立てる。明るい背景での可読性 | 黒い塊が本体を飲み込む(ブラックホールに見える)。暗いステージでは見えない |+| 明暗ペア(`contrast_pair()`) | 同一の輪郭、固定の角度、同じ動きと発生時刻 | 一つの形の内部に明暗の構造を加える | ランダムな 2 つの輪郭がずれていき、無関係な 2 本のストロークになる |+| 煙の残像(`decay()`) | 遅らせても、遅く・長くしてもよく、色とブレンドも変えられる | 光が消えた後に物質を残す | 暗い刃の弧が長く漂い、汚れた擦れ跡に見える |++`decay()` はジオメトリが同一の明暗ペアではありません。++決定的なペアでは、`count=1`、life、size、rotation、position、spin、travel、フリップブックの開始フレームを固定します。+別々のパーティクルノードはそれぞれ独自に乱数を引くため、範囲を揃えてグローバルシードを一つにしても、同じ角度には **なりません**。+多くの方向が必要な場合は、外側のレイヤーで一つの固定角度を選び、両方のノードにその固定値を使います。各レイヤーに個別の `[0,360]` を与えてはいけません。++正確なペアでは、同じ life と正規化したカーブを保ちます。life を延ばすと、ライフの 50 % に達する実フレームも動くので、+スケールとスイープがずれていきます。暗いレイヤーを後で退場させたいなら、カーブを明示的に計算し直すか、独立した残像にして、+輪郭が一致したペアとは呼ばないようにします。++ここで実測済み:後のレイヤーが手前に描かれ、Model の ZWrite ではこの遮蔽は得られません — 描画順を使います。Add の明るい本体より前に+描かれる Blend の暗いコピーは出発点にすぎません。手前の暗い切り込みと奥の暗い裏打ちは別のデザインなので、レンダーを見て決めます。++```python+from vfxkit.primitives import *++body = sprite('Matched burst', 'T_Explosion01', (255, 120, 30, 255),+ life=16, delay=3, size=2.0, rotation=[0, 0, 30],+ size_curve=[[0, .8], [30, 1], [100, 1.1]],+ color_curve=ramp((0, (255, 120, 30, 255)), (100, (180, 35, 10, 0)))['color_curve'],+ alpha_texture='T_NoiseTile01', cutoff=[[0, 0], [100, .8]],+ fade_in=0, fade_out=4, emissive=1.2)+layers = contrast_pair(body) # [Blend dark underlay, the bright body]; splice into effect(..., [*layers, ...])+```++`contrast_pair(body)` は [Blend の暗い下敷き, 明るい本体] を返すので、`effect(..., [*layers, ...])` に展開して使います。+2 つのレイヤーはジオメトリと時計を共有し、色とマテリアルが異なります。それでもアルファ、ブレンド、カットオフは実際の縁を変えるので、+レンダーで確認してください。ピクセル単位で完全に重なることは保証されません。30° はデモ用の角度で、このテクスチャの向きではありません:+`vfx texture-info` を実行し、アクションの方向には実測した角度を使います。このヘルパーが扱うのは Sprite 一つだけです。+Ring と Model のペアは明示的に設計します。++## サイズとライフの出発点++スプライトカードのサイズではなく、本体の **見える幅 B** と **ライフ L** を基準に測ります:細い線が一本だけのテクスチャは、+同じサイズの塗りつぶされたカードと同じ重さにはなりません。++| レイヤー | 出発点 | 確認方法 |+|---|---|---|+| 熱いコア | 幅は約 0.2–0.5 B、または本体の細い縁一本 | ピークでコアが見つかり、その後も本体が見つかる |+| 暗いペア | 本体と同じサイズとライフ | サイズを変えたら、切り込みか裏打ちかを決め直す |+| 独立した裏打ち | やや大きく、約 1.1–1.4 B | 本体の外側にくっきりした黒い円ができない |+| 薄暗い残像 | 約 1.1–1.2 L | 明るいレイヤーが消えた後、短く意図的なレイヤーが残る |+| 煙の残像 | `decay()` が与える長めのライフ | 退場中も変形し続ける。静止した暗い弧ではない |++これらは調整の出発点であって、統計でも lint ルールでもありません。斬撃や持続する柱は長く細い熱い縁を使って構いません。+ヒールやシールドには攻撃のような白いフラッシュは不要です。比率よりも、カーブの一致、余白、標準カメラのほうが重要です。++## 白い塊と黒い塊の修正順序++本体が白で埋まる場合:原因を特定するため、グロー、接触、重複した Add レイヤーを一つずつオフにします。次に接触を短くし、+次に本体の長い高輝度区間を削り、暗色は最後に足します。テクスチャ、カーブ、煙、カメラシェイクを同時に変えてはいけません —+何が効いたのか分からなくなります。++暗いレイヤーが別の黒いストロークに見える場合:まず角度とサイズの位置合わせを確認し、次に発生時刻とライフ、その後でようやくグレーの明度です。+間違ったジオメトリを不透明度を下げてごまかしてはいけません。明るい背景では機能するのに既定のステージで機能しない場合は、+dark と matter の役割を区別したまま、素材レイヤーに適切なグレーか局所的に照らされた色を与えます。++完了したラウンドは、見たフレームを挙げて改善点を一文で言えるはずです。例:「f12 以降、白いフラッシュは消え、オレンジレッドの火球が輪郭を保っている」。+[火の爆発のケース](cases.md#火の爆発白いままの接触) を参照してください。diff --git a/docs/ja/references/motion.md b/docs/ja/references/motion.mdnew file mode 100644index 0000000..81e1ab9--- /dev/null+++ b/docs/ja/references/motion.md@@ -0,0 +1,39 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/motion.md`](../../../skills/effekseer-vfx/references/motion.md)。エージェントが読み込むのは英語版です。++# モーションと経路++飛翔体では 3 つの役割を計画します:ハンドルに追従する **ヘッド**、ワールド空間に残される **トレイル**、そして経路からこぼれ落ちる+**振りまきパーティクル**。`sustain()` で放出し、トレイルは `inherit=TRAIL` で残します。到達時にゲームが `stop_root()` を呼ぶと、+それらは自然に消散します。ヘッドにははっきりした輪郭が必要で、トレイルは長さと明度で差を付けます。発射の瞬間の集中線や短いリングは、+見る人が速度を読み取る助けになります。++斬撃は、実際の平面とスイープ(`swing()` + `slash_arc`)で経路を見せ、弧に沿って二次放出を時間差で行います。+二次パーティクルはイージングした `travel` で速いから遅いへ移ります。Drag は PVA の速度を減衰させません+([エンジン規約](engine-conventions.md) を参照)。`travel` を書く前に、回転後のローカル軸を確認してください:球と円の放出では+放射方向の軸が異なります。++ボリュームと経路は別々に診断します:トレイルが細いのは問題なくても、ヘッドがボリュームのない点になってはいけません。+飛翔体自身のストリップは到達で終わり、着弾は含みません。Lab の通常再生ではペア全体が表示されます。++モーションはスケールだけではありません。スイープ、侵食、UV フロー、回転するピボット、変形でメインの形を変え、+破片、煙、モートは属性の方向で組み立てます:氷は溜めてから砕け、闇は引き込み、炎は昇り、毒はゆっくり沈む — それぞれ連続したフレームで裏付けます。++ランタイムが提供するのは直線と放物線(`arc`)の経路です。曲線の経路、一斉射撃、持続するビームには、まずブリーフとランタイムの拡張が必要です。+このスキルにないツールや API が存在するとユーザーに伝えてはいけません。++## 速度を形とリズムに込める++| 見える問題 | 最初の確認 | 最初の変更 |+|---|---|---|+| 飛翔体が浮かぶボールに見える | 発射時に方向の変化と速度の担い手があるか? | 後ろへ流れる短い風の線、方向のある火花、長さの異なるテール |+| トレイルがプラスチックのチューブに見える | 幅が均一で、色が平坦で、全レイヤーのライフが同じではないか? | テクスチャに余白を与える。短く熱いテールと長く柔らかいテールを分ける |+| 火花が等速で漂う | `travel` は速いから遅いになっているか? | EaseOut の後、重力か軽い動きに引き継ぐ |+| 斬撃がカメラの前のステッカーに見える | 実際の傾いた平面、スイープ、それに沿った放出があるか? | まず平面とスイープを直し、それから弧に沿って細部を時間差で出す |+| 破片が規則的な花火に見える | 同じサイズ、同じ発生フレーム、球対称になっていないか? | サイズとリズムに段階を付ける。主な動きをアクションの方向に沿って組み立てる |++速度の担い手は見る人が方向を読み取るためにあるもので、新しいパーティクル群である必要はありません。トレイルや形がすでにその役目を果たしているなら、+シンプルなままにします。属性が一時停止しても構いませんが、その停止ははっきりしたアクションに繋がらなければなりません:+氷の結晶は成長を止めてから砕け、闇のエネルギーは集まってから解放されます。++角度の範囲を揃えても、明るいパーティクルと暗いパーティクルは一致しません。ジオメトリのペアは固定パラメータを使います。+モーションのずれは [layering](layering.md) の手順で診断します。煙の残像は意図的に別のリズムで動かしても構いませんが、そのことをブリーフに書きます。diff --git a/docs/ja/references/primitives.md b/docs/ja/references/primitives.mdnew file mode 100644index 0000000..2987fe0--- /dev/null+++ b/docs/ja/references/primitives.md@@ -0,0 +1,92 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/primitives.md`](../../../skills/effekseer-vfx/references/primitives.md)。エージェントが読み込むのは英語版です。++# レシピコードとプリミティブ++目次:レシピファイル · `effect()` のフィールド · プリミティブ · ヘルパー · レイヤーフィールド · 単位++## レシピファイル++1 ファイルにつき 1 エフェクト:`vfx/src/VFX_<Name>.py` は `effect('<Name>', ...)` を返す `recipe()` を定義します。ID+`VFX_<Name>` はファイル名と一致していなければなりません。`_` で始まるファイルは共有ヘルパーです(`from _palette import *`)。+ソースはコマンドのたびに再読み込みされます。`from vfxkit.primitives import *` で、すべてのプリミティブ、以下の+ヘルパー、`WHITE`、`fade`、`ramp`、`walk`、`math` が取り込まれます。++どのプリミティブもプレーンなレイヤー dict を返します。`| dict(...)` で任意のフィールドを上書き・追加できます。テクスチャは+ステム名(`'T_Glow01'`)で指定し、`vfx/textures/processed/` から解決されます。レイヤーはリストの順に描かれます:**後のレイヤーが+手前に描かれます**(Godot プラグインはエフェクトレイヤー間の ZWrite を無視します)。++## `effect()` のフィールド++`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None)`++| フィールド | 意味 |+|---|---|+| `category` | `hit`、`slash`、`projectile`、`element`、`status`、`boss` など(lint の予算を決める) |+| `element` | `physical`、`fire`、`ice`、`lightning`、`dark`、`holy`、`poison` など(属性の違いとモーションのチェック) |+| `duration`, `peak` | 秒。`peak` は Lab のフラッシュ、キック、ターゲットのリアクションが使う接触/解放の瞬間 |+| `attach` | アンカー:`ground`、`body`、`impact`、`caster`、`caster_ground`、`projectile` |+| `impact`, `light` | Lab のステージフラッシュとカメラキックの強さ(0–1)と RGB(デモ演出専用) |+| `delivery` | ゲームでの演出方法:`SELF`、`MELEE`、`TARGETED`、`dict(kind='area')`、飛翔体そのものには `dict(kind='projectile')`、その着弾には `dict(kind='projectile', projectile='VFX_X')` |+| `flight`, `arc` | 飛翔体のみ:基準となる飛行の秒数と、山なりの高さ(メートル) |+| `design` | プレイヤーに見えるものを一文で。Lab に表示され、レビュアーに渡される |++## プリミティブ++**まずボリューム、テクスチャはその次。** 本体、衝撃波、結晶、柱は、カメラを向くカードではなく、傾いた 3D 平面上のメッシュやリングにすべきです。+カメラを向くスプライトは、本質的にスクリーン空間のもの — 接触の星形、グロー、火花、煙のひと吹き(積み重ねてボリュームにする) — のために取っておきます。++| プリミティブ | 用途 | 主なネイティブ機能 |+|---|---|---|+| `flash` / `glow` | 接触の星形、形の下の柔らかいブルーム | 単一値の F カーブスケール |+| `shadow` | 加算コアの後ろの暗い裏打ち | フラッシュの 1〜2 フレーム後にピークを迎える Blend の柔らかい円盤 |+| `radial_sparks` | 火花、針、立ち昇る筋 | 球/円の放出 + イージングした `travel` + DirectionalBillboard |+| `spark_burst` | 3 段階のヒット/爆発の火花 | 長く速い筋(6〜10 フレーム)、主体、`floor` を与えると跳ねる約 20 % の重い火花 |+| `motes` | 残り火、霜の粉、魔法のモート、内向きの集束 | 上記 + 乱流の力 |+| `shock_ring` / `tilted_ring` | 衝撃波、昇るハロー、縮むリング。3D 平面上のリング | 内径をイージングする Ring レンダラー。近接の傾き `(0,58,0)` は左から右への打撃を横切る |+| `slash_arc` | 刃の弧 | 開始/終了角をイージングでスイープする Crescent Ring + ディゾルブ |+| `wisps` | 途切れたエネルギーのストローク、渦の筋、地面を舐める炎 | Crescent Ring + `T_WispTrail01`、放出ごとにランダムな傾きとサイズ。侵食が 0 より上から始まるので完全なリングにはならない |+| `orbit_band` | 降着円盤、周回するルーンのリング | 傾いた平面上の Ring、ノイズがリングに沿って流れる。`arc=(-90,90)` で奥の半分、`(90,270)` で手前の半分 |+| `smoke` | 煙、霧、土埃、暗い残滓 | ペイント系の煙のフリップブック `T_SmokeSheet01` + 軽い侵食。静止した単発の煙には `texture='T_Smoke02'` — 氷の霧は、炎の転がる煙と区別するため静止した煙を使い続ける |+| `billow` | 火球、煙と同じ膨らみ | 一度だけ再生するペイント系 4×4 フリップブック `T_ExplosionSheet01` + `ramp` のカラーストップ |+| `flame` | 炎の舌、炎の壁、地面の炎 | 根元から成長する爆発フリップブック。白 → 色 → 暗色へ冷め、熱い縁を伴うノイズに侵食される(クリップアート風の炎シルエットではない) |+| `decal` | 紋章、亀裂、焦げ跡 | 地面の平面に置くスプライト、深度テストあり |+| `standing` | 棘、稲妻、ビーム | 根元を軸にする YAxisFixed スプライト |+| `column` | 光の柱、オーラ | プロシージャル円柱 + スクロールする筋 + 静的なアルファグラデーション + フレネル |+| `mesh` | 球、円錐、円柱 | プロシージャルモデル + falloff。追加のプロシージャルフィールドには `model={...}` |+| `crystal` | 氷の棘、破片、槍 | 先端へ細くなる六角柱 + セル状テクスチャ + フレネルの縁 |+| `shell` | 衝撃の泡、内破、解放 | 前面のみ、フレネル `pow<1` でリムだけを光らせる、イージングした膨張 |+| `shell_fragments` | シェルの実際の幾何的な崩れ | 離れながら回転する 6 枚の部分球面シート(AngleBeginEnd) |+| `heat_haze` / `distortion_ring` | 陽炎、屈折する衝撃波 | `BackDistortion` によるスクリーンの屈折 |+| `slice_line` | 解放時の長く細い線 | 35 % から全長まで伸びながら細くなる `T_Streak01`。`width` は見える太さ |+| `spray(end)` / `debris` | 射線に沿った方向のある飛沫、暗く転がる塊 | 回転しない放出 + ワールド方向の `travel` ボックス。重力付きの Blend `T_Shard01`、着地できる |+| `decay(layer, color)` | グロー → 灰色の煙の残像 | Blend のグレーとしてコピーし、`lag` フレーム遅らせ、ライフ × `stretch`、エミッシブなし、流れを遅く |++## ヘルパー++| ヘルパー | 意味 |+|---|---|+| `ramp((0,c0),(30,c1),(100,c2))` | 3〜5 個のストップによるライフ上の色 → `color_curve`(2 色の線形補間は色味付けに見える) |+| `fade(color, alpha=0)` | 同じ RGB で新しいアルファ |+| `POP`, `DISSOLVE` | パッと出てから漂うスケールカーブ。保持してから侵食するカットオフカーブ |+| `sustain(layer, interval)` | 飛翔体のエミッター:解放まで `interval` フレームごとにインスタンスを一つ |+| `TRAIL` | 位置/回転/スケールを生成時にだけ継承:レイヤーは経路上に留まる |+| `slash_set(colors, roll, sweep=(110,260), radius=1.5, offset=(0,0,.5), lean=-18, delay=1, life=14)` | 3 つの幅を持つ一本の刃:2 フレーム遅れる幅広で薄暗い残像、高彩度の本体、細く白熱した縁(`slash_arc`)、屈折の弧、ペイント系のセル調の三日月(`T_Slash02`、刃の平面に置いた `billboard='Fixed'`、計測した `SLASH02_BULGE` で回転)。`colors` = (残像, 本体, 縁) |+| `swing(layers, yaw, pitch=0)` | 刃のレイヤーを `renderer='None'` のピボットで包み、弧が 3D 空間を切り裂くようにする。ヨーを約 ±30–40° にすると、画面上の三日月ではなく楕円に見える |+| `contrast_pair(layer)` | 固定したスプライト一つと、ジオメトリが同一の Blend の下敷き([layering](layering.md) を参照) |+| `lifetime(layer)`, `budget(layer)` | レイヤーまたはその子が生存しうる最後のフレーム。インスタンス数 |++## レイヤーフィールド++PVA、スケール、色のほかに、コンパイラは次をサポートします:`collide`(床での跳ね返り)、`soft`(エンジン規約を参照)、+`size` / `size_end` / `size_curve`(一様なスケール)、`color_end`、`color_curve`、`travel`(イージングした変位)、`spawn`+(球、円、線のエミッター)、`forces`(重力、乱流、渦)、`alpha_texture` + `cutoff` + `edge`+(熱い縁を伴うディゾルブ)、`distortion_texture`、`blend_texture`、`falloff`(フレネル)、`flipbook`、`pivot`、+`ring{...}`、`inherit`、`track_size`、`material`(`BackDistortion`)、`children`。`vfx layer-schema` は受け付けるすべての+キーを列挙します。未知のキーはスペルの候補とともに失敗します。それ以外のものは、レシピに生のプロパティパスとして書くのではなく、+save/open の読み戻しテストとともにコンパイラに追加しなければなりません(手順:[エンジン規約](engine-conventions.md#コンパイラの拡張))。++## 単位++レイヤーの `life`、`delay`、`interval`:60 FPS のフレーム数。速度と加速度:units per frame。重力:units per frame²。+角度:度。色:RGBA 0–255。カーブ(`size_curve`、`cutoff`、`color_curve` など):`[[percent_of_life, value], ...]`。+マニフェストの `duration` と `peak`:秒。ランダムな範囲は `[min, max]`。diff --git a/docs/ja/references/reference.md b/docs/ja/references/reference.mdnew file mode 100644index 0000000..cd6dfa1--- /dev/null+++ b/docs/ja/references/reference.md@@ -0,0 +1,21 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/reference.md`](../../../skills/effekseer-vfx/references/reference.md)。エージェントが読み込むのは英語版です。++# リファレンスクリップとの比較++`ffmpeg` と `ffprobe` が必要です。ユーザーが提供したクリップ、または使用を許可されたクリップだけを使い、出所を記録します。++1. `vfx reference-import <clip.mp4> --start 0 --end 2 --slow 2 [--roi x y w h] [--source-url <url>]` は、最大+ 30 秒分のメディアを、バージョン管理から除外された `vfx/work/references/` にデコードします。`--slow 2` はクリップが半分の速度で再生されることを意味するので、+ エフェクトの時間 = `--start` を基準としたクリップの時間 ÷ 2 です。返された `overview` 画像を開きます。リファレンス ID と時刻を+ ブリーフの `reference` フィールドに入れます。+2. ラベル付きのフレームを順に読み、予備動作、接触、本体、二次モーション、退場をブリーフの beats に書きます。詳細を見るには、+ クリップ全体を読み込み直すのではなく、短い区間一つに対して `vfx reference-frames <reference_id> <start> <end> --count 8` を使います。+ クリップの速度が不明で、リズムがそれに依存する場合は質問します。+3. レビュー後、`vfx reference-compare <reference_id> <evidence_id> --times 0.1 0.3` で、リファレンスの瞬間と+ 撮影済みの Godot フレームを正確に対にします(足りないものは `vfx review --key-frames` で撮影)。リズム、輪郭、+ 画面占有率、高彩度の本体、暗いレイヤー、残滓を比較します。各ビューは独自のアスペクト比と時刻ラベルを保ちます。明示しないクロップやスケールで+ 「同じサイズ」に揃えてはいけません。++この分析は近似です:圧縮、背景、ブルームはピクセルを変え、カメラの動きやカットは変化した面積を汚染します。カメラが動く場合は、+手動のキーフレームと明示的な ROI を使います。動画からワールドのサイズ、エミッシブの値、パーティクル数、見えないテクスチャを推測してはいけません。+近似はブリーフに明記します。リファレンスからの観察は形とリズムの指針であり、このエンジンで実測した単位、UV、HDR、継承のルールより優先されることはありません。diff --git a/docs/ja/references/review.md b/docs/ja/references/review.mdnew file mode 100644index 0000000..4d337d0--- /dev/null+++ b/docs/ja/references/review.md@@ -0,0 +1,110 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/review.md`](../../../skills/effekseer-vfx/references/review.md)。エージェントが読み込むのは英語版です。++# レビューループ、エビデンス、納品++静止画一枚ではリズムは分かりません。変更のたびに:`vfx lint`、`vfx build --ids <ID>`、`vfx review --ids <ID>+--note "<one problem, one change>"`(問題一つ、変更一つ)を実行し、それから **画像を開きます**。++目次:レビューが出力するもの · フラグ · ストリップの読み方 · ラウンドと履歴 · 独立レビュー ·+検証 · バリエーション · 撮影時の挙動++## `vfx review` が出力するもの++Godot Lab は、UI を隠した実 viewport で、対戦演出(プラットフォームの両端に立つ 2 体のダミー。エフェクトは `delivery` に従って演出される)を使ってエフェクトをレンダーします。+フレーム番号はエフェクト自体の開始(パンチ、詠唱、飛翔体の到達)から数え、ダミーは待機ポーズを保ちます。飛翔体のストリップは到達で終わり、+着弾は含みません。着弾のストリップは同じ着地点と到達時刻を保ちますが、飛来する飛翔体の残りは含みません。コマンドは次を返します。++- `sheets` — タイムライン全体のストリップ `vfx/previews/strips/<ID>.png`(最大 18 タイル。キーフレームは決して間引かれません)+- `compare` — 前のストリップがある場合の `<ID>_compare.png`。上が前のラウンド、下が現在のラウンド+- `details.<ID>.sheet` — キーフレームシート(接触の前後、ブリーフの beats、本体、退場、duration 後のチェック)、+ そして `details.<ID>.frames` — フルサイズのフレーム+- `flags`、`changes`(前のラウンドから追加・解消されたフラグの種類、動いたキータイミング)、`metrics`、+ `history`、そしてこの撮影の `evidence` ID++`vfx strip <ID> [--compare]`、`vfx frames <evidence_id> <frames...>`、`vfx history <ID>` で後から読み直せます。+比較画像がある場合は、まずそれを見てください。++## フラグ++ピクセル指標は空のステージに対する「変化エネルギー」なので、大きく淡い煙と小さな白いフラッシュを比較できます。読み取りの補助であって、+GPU やオーバードローの計測では **ありません**。++| フラグ | 意味 | 最初の修正 |+|---|---|---|+| `barely visible` | 最も強いフレームでステージの 0.25 % 未満しか変化していない | 本体が小さすぎるか暗すぎる |+| `dead tail` | 最後の 35 % に、ピークエネルギーの 5 % を超えるフレームも、ステージの 0.25 % 以上が変化したフレームもない | `duration` と後続のライフを短くするか、消散を見えるようにする |+| `blown out` | サンプリングした 2 フレームを超えて、10 % 以上が純白 | グローを小さく、エミッシブを下げる |+| `cut off` | 最後のフレームでまだはっきり見えている | duration が短すぎる |+| `off-peak contact` | 最も白いフレームが、マニフェストの `peak` から 6 フレームより離れている | 接触か `peak` を動かす。Lab のフラッシュとキックが別の場所に着地している |+| `lingering flash` | 接触付近でピーク近くの白が 12 フレームより長く続く | 接触は 2〜5 フレームにする。持続する熱い本体(ビームのコア、棘)は対象外 |+| `no white-hot core` / `washed out` | ピークで明るさ 85 % を超えるピクセルがほとんどない / 高彩度の中間調の本体がほとんどない | 熱いコアを足す / 本体の彩度を戻す |+| `sinks`(炎のみ) | 接触後に塊が下へ動く | 炎は昇るべき |+| `expands while charging`(闇のみ) | 解放前に半径が大きくなる | 闇は内側へ引き込むべき |++しきい値は、実際のライブラリのレンダーでタイルごとに調整したもので、その理由は `scripts/vfxkit/review.py` の冒頭にあります。+しきい値を変えるのは実際のストリップを確認した後だけにし、そこに理由を一行追記してください。++## ストリップの読み方++フラグだけではレビューになりません。ストリップとキーフレームシートで次を問います。++1. 最初に光ったタイルで、それが何のエフェクトか分かるか? 接触が最も明るい瞬間で、数フレームだけか?+2. メインの形は侵食・スイープしているか、それとも拡大とフェードだけか?+3. 二次パーティクルは速いから遅いへ、属性の方向(炎は上、氷は下、闇は内側)へ動いているか?+4. 弧、柱、地面のデカールが、ダミーの横や宙に浮かずに、ダミーの上または足元にあるか?+5. 明るい背景(`--bright`)でも、アルファブレンドのレイヤーは機能しているか?++テールは最後の 2 タイルだけでなく、最後の 3 分の 1 の中ほどを見ます。実際のフレームは `vfx frames` で取得するか、+`--key-frames` で追加の瞬間を撮影します。孤立した煙のひと吹きが一つあるだけでは、退場全体の証明にはなりません。++## ラウンドと履歴++各ラウンドでは **1 種類の問題** を直し、それを `--note` に書きます。メモ、フラグ、キータイミングは+`vfx/previews/strips/history/<ID>.jsonl` に追記されます。新しいラウンドの前に履歴を読み(`vfx effect-context <ID>`)、+エビデンスがすでに退けた変更を繰り返さないでください。エフェクトごとに 3〜5 ラウンド反復し、上限に達しても合格しなければ、+完了とは言わずに未解決の項目を報告します。++## 独立レビュー++作者は自分のエフェクトを採点しません。`vfx review-handoff <ID>` は、鮮度が保たれた最新の撮影について、レビュアー向けのブリーフ一式を+`vfx/work/handoff/<evidence_id>.md` に書き出します:ストリップとキーフレームの画像、撮影したフレーム番号、マニフェストのエントリとフラグ、+評価基準のコピー、このスキルの隣にインストールされていれば **vfx-review** スキルのパス、そしてレポートの書き込み先です。+そのブリーフだけを別のエージェントに渡し、それ以外は何も渡しません:サブエージェント(ブリーフ以上のことは伝えない)か、+ホストにサブエージェントがない場合はユーザーが開く新しいセッションです。レシピのコードは渡しません。レビュアーは JSON を `report_file` に書き込みます。++```json+{"id": "VFX_X", "scores": {"read": 2, "timing": 3, "layering": 2, "shape_change": 2, "motion": 2, "placement": 3, "tail": 2, "identity": 3},+ "worst": "shape_change", "fix": "one concrete change in recipe terms", "verdict": "ship"}+```++`fix` にはレシピの言葉で具体的な変更を一つ書きます。いずれかのスコアが 2 未満なら `verdict` は `iterate` で、`worst` は最低スコアの項目でなければなりません。+それをファイルに保存し、`review-handoff` が返したコマンドで結び付けます:`vfx review-submit <evidence_id> <report_file> --reviewer <reviewer id>`+(`--frames` の既定値はレポートの `observed_frames` です)。+ツールは構造、鮮度、観察したフレームを検証しますが、レビュアーの独立性は証明できません — ホスト(あなた)が実際に隔離しなければなりません。+判定が `iterate` なら、次のラウンドでその一つの修正を適用します。++## 検証++`vfx overview` は、最新の標準撮影を並べて `vfx/previews/strips/overview_*.png` を作ります。+`vfx effect-verify <ID>` は、展開した現在のレシピ、入力テクスチャ、Core の読み戻し、ビルドしたリソース、Lab のステージ、画像が、+すべて合格したレビューが見たものと同じであること、そして総覧にこの撮影が含まれていることをチェックします。完了は `verified: true` だけです。+スクリーンショットが存在すること、フラグがないこと、終了コード 0 は、品質の合格ではありません。レシピ、テクスチャ、ブリーフ、Lab の+どれかを変更すると古いエビデンスは無効になります。Lab のテンプレートを更新した後は、まず `vfx init --update-templates` を実行します。+ランタイムの挙動には独自の API チェックが必要で(`TestApi.gd`、[godot](godot.md) を参照)、デバイス性能にはデバイスでのエビデンスが必要です。++作業を終えたら、エフェクトライブラリ(`vfx/src`、`vfx/briefs`、テクスチャ、レシピ JSON、`.efkefc`、`.efk`、+マニフェスト、総覧ページ、`metrics.json`)をまとめてバージョン管理に入れます。フレームごとの撮影、ログ、レシート、+単一エフェクトのストリップはローカルに留めます(`init` が書き出す `vfx/.gitignore` がこれを処理します)。++## バリエーション++`--view close` は確認用のカメラだけを変えます。`--profile bare` は Lab のブルーム、インパクトライト、カメラキックをオフにして、+エフェクト単体で判断できるようにします。`--bright` は明るい背景を使います。それぞれ別々に保存され、標準/既定(standard/default)の+ベースラインやその指標を上書きすることはありません。検証のベースラインは standard/default です。++## 撮影時の挙動(macOS)++レビュー中もユーザーがマシンを使っていることがあります:macOS は完全に覆われたウィンドウの描画を止め、Godot は起動時にフォーカスを奪います。+撮影モードの Lab はウィンドウを最前面に保ち、右下隅に寄せて一部だけを見せ(viewport は 1280×800 でレンダーされ続けます)、+キーボード入力とクローズ要求を無視し、レビューはフォーカスを直前のアプリに戻します(起動ごとに約 0.2 秒のちらつき)。+早く退場してしまったり、まったく再生されなかったりしたエフェクトは、撮り直されます(最大 3 回)。diff --git a/docs/ja/references/shapes.md b/docs/ja/references/shapes.mdnew file mode 100644index 0000000..9c3d7ca--- /dev/null+++ b/docs/ja/references/shapes.md@@ -0,0 +1,37 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/shapes.md`](../../../skills/effekseer-vfx/references/shapes.md)。エージェントが読み込むのは英語版です。++# ボリュームと遮蔽++まず本体のボリュームを決めます:氷の棘は結晶、柱はプロシージャルな円柱、衝撃波は傾いたリングか薄いシェル、降着円盤は+奥の半リング + コア + 手前の半リングです。カメラを向くスプライトは、フラッシュ、煙、カメラに向くべき形のために取っておきます。+標準カメラと任意のクローズビュー(`vfx review --view close`)で確認しますが、ライブラリのベースラインは標準の対戦演出のままです。++ここで実測済み:球の奥行きは円柱とは扱いが異なります(球のサイズはスケールで決める)。Cone の先端方向は推測してはいけません+(結晶は端の半径を指定した Cylinder を使う)。Model レイヤーは ZWrite に頼れないので、遮蔽はリストの順序に従います。+Fresnel の `begin`/`end` と `pow` は、名前から想像される通りではなく、[エンジン規約](engine-conventions.md) に記載された通りに振る舞います。++大きなシェルや柱を、半透明の中身の詰まったドームにしてはいけません。まず輪郭、内側の透明度、キャラクターの視認性を確認し、+明るさはその後です。全画面のグローで形の問題は隠せません。暗いコアは既定のステージで読み取れなければならず、明るい背景(`--bright`)でも確認します。++既存の Ring、Model、UV スクロール、ディゾルブの機能を優先します。カスタムメッシュは後回しのアセット経路です:まずどのプリミティブでも+その形を表現できないことを示し、次にエクスポート、UV、リソースがパッケージと一緒に運ばれることを検証します。+未検証の前提を回避するために公式レンダラーにパッチを当ててはいけません。++## 標準カメラでボリュームを選ぶ++| メインの形 | ここで使える構成 | 確認すべき空間関係 |+|---|---|---|+| 斬撃 | 傾いた Ring を持つピボット、または平面固定の弧 | 弧がアクションの点を通り、内側に空間がある |+| 爆発 | `billow`、昇る本体、傾いた波、地面の物質 | 着地点と高さがある。手前と奥のレイヤーが分離している |+| 暗いコア | 奥の半リング、コア、手前の半リングをこの順で | 手前の半分がコアの前を通り、奥の半分はコアに隠れる |+| 氷の結晶 | 先端のある六角柱、破片、冷気 | 先端の向きと面の光が異なる。砕けが明るい点の集まり以上になっている |+| 持続するシェル | フレネルの輪郭、表面の動き、破片での退場 | 内側のキャラクター、シェルの表面、背景がそれぞれ読み取れる |+| 光の柱 | 円柱、静的なアルファグラデーション、スクロールする筋 | 上下が自然にフェードする。本体を貫く UV の継ぎ目がない |++標準カメラでは、低い地面のリングは細い線に見えることがあり、クローズアップで美しいディテールも戦闘距離では消えることがあります。+表面のテクスチャを足す前に、横方向か上方向のボリュームを作ります。クローズビューは問題を見つける助けにはなりますが、+スケールの判断で標準カメラの代わりにはなりません。++レイヤーが前後に重なる場合は、まず描画順を整え、それから画像で確認します。すべての破片の手前に描かれた完全なシェルの輪郭は、+現れるはずの隙間を再び塞いでしまいます。炎の手前に描かれた黒い煙は、残るべき高彩度の本体を隠します。ジオメトリが正しくても、+順序のせいで間違って見えることがあります。diff --git a/docs/ja/references/skeletons.md b/docs/ja/references/skeletons.mdnew file mode 100644index 0000000..949bbbe--- /dev/null+++ b/docs/ja/references/skeletons.md@@ -0,0 +1,91 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/skeletons.md`](../../../skills/effekseer-vfx/references/skeletons.md)。エージェントが読み込むのは英語版です。++# カテゴリ別の骨格++骨格はレイヤーの役割とタイミングの関係を示すもので、ゲームのスタイルに合わせて削ってください。メインの形を一つ選び、+それに必要な補助レイヤーだけを加えます。軽いヒットはごく単純で構いませんし、フィニッシュ技には複数の段階があってもよい。+以下のすべてのカテゴリに、独立レビュー済みの完全なサンプルがあります(`vfx examples show <name>` は絶対フレームと役割付きの+レイヤー計画を出力し、`vfx examples add <name>` はそれをプロジェクトにコピーします):`hit`、`slash`、`charge`、`shield`、`heal`、+および飛翔体 + 着弾のペア `fire`、`ice`、`poison`、`dark`。++## ヒット++参考:サンプル `hit`(`VFX_Hit_Heavy`)。接触点に集中した短い予備動作、短いフラッシュとギザギザのバーストが先に来て、その後に方向のある集中線と段階的な火花、+最後に土埃か少しの煙で終わります。白いフラッシュが接触を感じさせ、本体が力を伝えます。すべてのヒットに大きなリングと黒い煙が必要なわけではありません。++| 役割 | プリミティブ | 代替案 |+|---|---|---|+| 予備動作 | 縮んでいく `glow` | 内向きの線を数本 |+| 接触 | `flash` | 輪郭のある短く熱い形 |+| 本体 | `POP` + `DISSOLVE` のペイント系バースト `sprite`、`tilted_ring(..., tilt=(0,58,0))` | `shell` の空気の泡 |+| 二次モーション | `spark_burst`(2〜3 段階、噴射方向は一つ) | `spray` 付きの `radial_sparks` |+| 退場 | `smoke` の土埃、`motes` の残り火 | 素早く落ちる土埃。一回のヒットに数秒かけない |++ピーク後に細い針しか残らないなら、本体を長くするか強くします。花火のように見えるなら、パーティクルを足す前に放出方向と `travel` の方向を絞ります。予算 ≤ 60。++## 斬撃++参考:サンプル `slash`(`VFX_Slash_Fire`)。`swing()` のピボットが傾いた振りの平面を定義し、弧が空間を切り裂く楕円に見えるよう+約 ±30–40° ヨーを付けます。`slash_set()` はその中に残像、本体、熱い縁を置き(`slash_arc` を 3 つの幅で:2 フレーム遅れる幅広で薄暗い残像、+高彩度の本体、細く白い縁)、刃の後ろに屈折の弧を、さらに数フレーム保持するペイント系のセル調の三日月を加えます。三日月は+`billboard='Fixed'` で刃自身の平面(同じ lean)にあり、テクスチャの計測した膨らみ(`SLASH02_BULGE`)だけ回転しているので、+カメラの方を向くのではなく振りと一緒に傾きます。火花は弧に沿って時間差で出します。炎は剥がれる炎と立ち昇る残り火で、物理は短い金属の火花で、+氷は溜めと砕けで退場します。属性を変えると、色だけでなくモーションとマテリアルが変わります。++レイヤー間に弧の余白を保ちます。ターゲットの胸は配置のアンカーにすぎません:弧の見た目の中点は、テクスチャの膨らみ、回転、ピボットにも+左右されます — `vfx texture-info` で計測してください。テールがまだ三日月全体のままなら、煙の残像を足す前にスイープと侵食を直します。++## 爆発++参考:サンプル `VFX_Fire_Explosion`。Gather と Inward fuse がターゲットで引き締まり、短い Detonation flash が解放し、+Fireball と立ち昇る Mushroom が引き継ぎ、方向のある破片と火花が衝撃を運び、Smoke billow、土埃、地面の痕跡が重みを与えます。++炎はフラッシュの後も高彩度のボリュームを保たなければなりません — 広がるリングや小さな明るい点の集まりだけではいけません。+二次モーションは射線、地面、上方向に沿って組み立て、すべてのレイヤーが同じ球状の動きをしないようにします。+煙は炎の奥に描かれ、冷めた形を引き継ぎます。煙が中心を覆っているなら、まず順序と密度を確認します。地面の痕跡はどこに落ちたかを、+立ち昇るボリュームは噴き出したことを伝えます。全画面のグローを大きくしても、そのどちらの代わりにもなりません。+ピークだけでなく、引き継ぎは f18–42、煙は f54–66 を見てください。++## 飛翔体++参考:ペア `fire`、`ice`、`poison`、`dark`(`VFX_Projectile_Fire`、`VFX_Projectile_Ice`、+`VFX_Projectile_Poison`、`VFX_Projectile_Dark`)。ヘッドレイヤー(Fireball、+Hot core)はハンドルに追従し、Comet tail がヘッドに方向を与えます。Flame trail、Smoke trail、Embers は+`inherit=TRAIL` を使い、経路上に留まります。幅広のテール、細く熱い線、短く振りまかれるパーティクルにはそれぞれ異なるライフが必要で、+ヘッドと経路の両方が読み取れなければなりません。++発射、飛行中、到達、到達後、消去を確認します。飛行時間が固定なら、トレイルの密度は放出間隔とパーティクルのライフの組み合わせで決まります。+ヘッドの継承を変えると空間的な関係が変わります — トレイルを延ばして硬いチューブを隠してはいけません。着弾は対のエフェクトです:+飛翔体のストリップと着弾のストリップは別々にレビューし、やり取り全体は Lab で確認します。予算 ≤ 100。++## チャージと解放++参考:サンプル `charge`(`VFX_Magic_Charge`):約 1 秒の内向きの溜め(f0–64)、一度の解放 f64–70、解放の火花は約 f86 まで。+負の `travel` を持つ `motes` と `radial_sparks` が内側へ集まり、傾きの異なる平面上の `orbit_band` リング 2 本がボリュームを作り、+コアとオーラが蓄積し、解放フラッシュ、`shell`、火花が一度のはっきりした解放を与えます。カメラとステージのフィードバックで解放を強めても構いませんが、+集まる過程そのものが読み取れなければなりません。++内部に流れがなく Z 回転するだけのリングは、回転するアイコンになってしまいます。UV フロー(`alpha_scroll`)、傾いた平面、+内向きの移動を使います。解放が巨大で予備動作が弱いなら、すべての明るさを上げるのではなく、まず見える集束の経路を作ります。++## シールドと持続する状態++参考:サンプル `shield`(`VFX_Shield_Dome`)と [cases](cases.md) のシールドのケース。短い展開時のきらめき、持続するボリュームのための `mesh` 球体の `shell` とリム、保持中を生かす表面の流れ、スキャンバンド、きらめき。+最後にはシェル全体が、実際の隙間を持つ `shell_fragments` に引き継がれ、破片の動きと色の減衰が退場を作ります。++安定とは、毎フレーム点滅することでも、完全な球が一度に消えることでもありません。まずシェルの内側でキャラクターが読み取れるかを確認し、+次に表面の流れと退場を確認します。ここでは 6 枚の球体破片が検証済みの解決策です。他のマテリアルが本当にディゾルブできるかは、別途テストする必要があります。++## ヒールとバフ++参考:サンプル `heal`(`VFX_Heal`)。地面の `decal` の紋章が所有者を示し、`column` がゆっくり昇るボリュームを作り、昇るリング、シンボル、生命の `motes` が意味を運び、+グローときらめきで締めくくります。ヒールを、激しい白いフラッシュと飛び散る破片を持つ攻撃にしてはいけません。柔らかくても脈打ってもよいですが、+輪郭を保ち、標準カメラで見え続けなければなりません。白いピークはこのカテゴリの合格基準ではありません。評価基準の用途による例外を使います。++## サンプルコードの使い方++`vfx examples show <name|ID>` は、絶対フレームと役割付きの完全なレイヤー計画を出力します。`vfx examples add <name>` は、+ソース、ブリーフ、ペイント系テクスチャをプロジェクトにコピーします。サンプルをベースラインとして残しておきたい場合は、+その場で編集するのではなく、新しい ID でコピーを作って改造します。サンプルの過去のスコアはスキル自身のレンダーについてのもので、+あなたのビルドについてではありません:変更したら、ビルド、レビュー、独立した採点をやり直してください。2 つのサンプルは `iterate` と判定されました+(`vfx examples` の `historical_review.worst` を参照)。それでもそれぞれのパターンを教えてくれ、その最も弱い点は最初の練習課題に向いています。diff --git a/docs/ja/references/textures.md b/docs/ja/references/textures.mdnew file mode 100644index 0000000..430b6c0--- /dev/null+++ b/docs/ja/references/textures.md@@ -0,0 +1,81 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/textures.md`](../../../skills/effekseer-vfx/references/textures.md)。エージェントが読み込むのは英語版です。++# テクスチャの役割、生成、受け入れ++役割を選び、プロンプトを書き、それから生成します。**複雑なペイント系の形状** — 煙、斬撃の弧、炎の本体、亀裂、氷、シンボル — は+**画像生成モデル** で作ります。**数式で作る形状** — グロー、リング、ノイズ、グラデーション、トレイルの帯、RG ディストーションマップ — は+プロシージャルテクスチャです(`vfx procedural` で再生成できます。名前は [primitives](primitives.md) にあります)。`vfx init` は、+プリミティブが既定で使う 7 枚のペイント系テクスチャのスターターセット — `T_SmokeSheet01`、`T_ExplosionSheet01`(4×4 シート)、`T_WispTrail01`、`T_Smoke02`、`T_Explosion01`、+`T_Crack01`、`T_IceShard01` — とそのプロンプトもインストールします。`vfx examples add` は、それを使うサンプルと一緒にさらに 4 枚(`T_Impact01`、`T_Slash02`、+`T_Rune02`、`T_Vortex01`)をインストールします。スキルの `assets/examples/texture_prompts.json` には、同梱していない一般的なペイント系の形状の+プロンプトのひな形もあります(斬撃の三日月、炎の舌、稲妻、ルーンの円、氷の棘、炎のシート…。`source` にその旨が書かれています):+一つを `vfx/texture_prompts.json` にコピーして手直しし、生成して処理します。ペイント系の形状を Python で描いて真似してはいけません。++## 生成++- ホストが画像生成ツールを提供しているなら、書いたプロンプトでそれを使います。手を加えていない出力を+ `vfx/textures/generated/<T_Name>.png` に保存します。+- 提供していない場合は、**何も代用しません**:プロンプトを `vfx/texture_prompts.json` に追加し、どの画像を生成すればよいか+ (名前、サイズ、プロンプト)とどこに保存するかをユーザーに伝え、その画像を必要としない部分の作業を続けます。+- すべてのプロンプトを `vfx/texture_prompts.json` に `{"id": "T_Name", "size": 256, "prompt": "..."}` として記録します(シートには+ `"grid": [4, 4]` を、既定以外の処理には `"post"` を追加)。プロンプトが記録されていないペイント系テクスチャは lint が拒否します。+- 原画を上書きせずに、ゲーム用テクスチャへ処理します:+ `vfx process-texture vfx/textures/generated/T_Name.png vfx/textures/processed/T_Name.png --size 256`+ (`--color` は色をストレート RGBA のまま保持します。フリップブックシートには `--grid 4 4 --size 1024` を使い、セルの位置を保ちます)。+- 計測:角度、膨らみ、はみ出しは `vfx texture-info T_Name`。縁、アルファ、小サイズでの残り方、フレームの変化は `vfx texture-audit T_Name --role shape`+ (または `flipbook --grid 4 4`、`trail`、`symbol`、`light`、`uv_distortion`、`screen_distortion`)。監査の `preview` 画像を開いてください。++サイズ:通常のパーティクルは 128–256、メインの形と紋章は 512。検証済みの 4×4 連番は 1024² です。++## プロンプトの内容++視覚的な役割、輪郭と内部構造、必要な余白、背景または透過のモード、除外するもの(環境、キャラクター、文字、UI は不要)、+目標サイズを明記します。マスクの場合:純黒の上に白い形。連番では、グリッド、成長から崩壊への変化、一定の中心とスケール、+すべてのセルの余白を明記します。ループでは、最初と最後のフレームが繋がることを明記します。++塊のある形には読み取れる輪郭と変化のある太さが必要で、余白を持った非対称でも構いません。光にはコアからの滑らかな減衰が必要で、+対称でも構いません。紋章やシンボルは正確な幾何形状と密な装飾を使って構いません。煙は目標のスタイル — くっきりした外縁、+内部の明度、または柔らかいボリューム — に従いますが、すべての煙を漫画的な綿の玉にする必要はありません。+光学的な星形や紋章そのものに「ルールを崩す」を当てはめてはいけません。++| 種類 | 具体的に指定すること | 避けること |+|---|---|---|+| 斬撃と爪痕 | 主方向は一つ、根元は太く先は細く、途切れと不均一な太さ、弧の内側の空間 | 幅の均一な三日月のアイコン。等間隔の爪の線 |+| バーストと塊のあるフラッシュ | 重みのあるコアと方向のある縁。コアは完全に詰まっているか、はっきりリングになっている | 中央にランダムな小さな穴があり、目や顔に見える |+| 煙と土埃 | はっきりしたスタイル、輪郭と内部の明度、大きさの異なる房、段階的な崩壊 | 同じ形の綿の玉。輪郭のない灰色のグラデーション |+| 光と星 | 滑らかで熱いコア、まっすぐな減衰、役割で選んだ対称性 | 光を曲がった途切れ途切れのストロークにして、巨大なグローで救済する |+| 紋章とシンボル | はっきりした密度、構造の階層、細かなシンボルの帯 | 数文字の巨大な文字が縮んで空のリングになる |+| 地面の亀裂 | 衝撃点から枝分かれし、根元は太く先は細く、局所的に不規則 | 均一な格子やタイル状のセルが床のタイルに見える |++穴埋めして使える依頼の例(煙のテールの連番):++> 目的:炎の飛翔体の後に残る灰色の煙の残滓。連続した 4×4 の連番、1024²。塊は濃い状態から始まり、上へ巻き上がりながら、+> 次第に不揃いな断片へと崩れていく。中心とスケールは一定、すべてのセルに余白。内部の明度を保ち、外側の輪郭は重なり合うように。+> 規則的な丸い煙の玉や均一な放射状の広がりは避ける。キャラクター、環境、文字、UI は入れない。ゲーム内で色付けする独立したアセット。++これはテンプレートであって、生成済みアセットの出所記録ではありません:生成後は、実際のプロンプト、原画、処理設定を記録します。+紋章、斬撃の弧、炎の本体には、色を変えるだけでなく、それぞれの役割を書く必要があります。+`assets/examples/texture_prompts.json` にはサンプルテクスチャのプロンプトが入っています。++## 受け入れ++ハードエラー:ファイルの欠落、無効なグリッド、グリッドで割り切れない寸法。最初や最後のセルが空、フレームの保持は意図的な場合があります。+中間セルの空き、飛び、重複はヒントにすぎません — 画像を見てください。フルサイズで美しい細いテクスチャも、標準カメラでは消えることがあります:+64 px と 32 px のプレビューと実際のレンダーを確認します。++ここで実測済み:フリップブックへの UV ディストーションは隣のセルをサンプリングします(lint が禁止しています)。カラーテクスチャとアルファテクスチャは+異なるチャンネルを使います。UV ディストーションには不透明な RG マップが必要で、スクリーンディストーションはアルファで範囲を持たせても構いません。+炎には、クリップアート風の炎スプライトではなく、侵食を伴う検証済みの爆発連番を使います。++## 連番は変形しなければならない++セルを一つずつ見ていきます:形はあるキーポーズから別のキーポーズへ — 開く、巻く、裂ける、侵食される — と移っているか?+同じ輪郭を拡大しながら不透明度を下げるのは変形ではありません。濃い状態から崩れた状態への変化は速くても構いませんが、+見えるサイズに達した瞬間に本体がくずになってはいけません。++一つの連番を複数の役割で使う場合は、開始セルと再生速度を変え、その理由を書きます:熱いヘッドは濃く短い区間だけを再生してもよく、+煙のテールは色が先に冷めながらゆっくり変化させてもよい。+`frame_length × cell count` が再生時間で、life はインスタンスの寿命です。両者が異なる場合は、早期の退場、保持、カットを説明します。++小さなプレビューは一つのふるいにすぎません。テクスチャが 32 px で消えるなら、まず役に立つ見える線を太くし、無駄なディテールを取り除くか、+実際のレイヤーサイズを変えます。512 の原画をむやみに 2048 に上げてはいけません — 同じカメラでは、解像度を上げても画面占有率は変わりません。diff --git a/docs/ja/references/timing.md b/docs/ja/references/timing.mdnew file mode 100644index 0000000..c21a114--- /dev/null+++ b/docs/ja/references/timing.md@@ -0,0 +1,71 @@+> 英語原文の日本語訳です:[`skills/effekseer-vfx/references/timing.md`](../../../skills/effekseer-vfx/references/timing.md)。エージェントが読み込むのは英語版です。++# 強度、ボリューム、退場のリズム++先にキーフレームを書き、それから delay と life を埋めます。明るさとボリュームは 2 本の別々のカーブとして記述します:+明るさは解放の瞬間に跳ね上がりますが、爆発の炎や煙のボリュームのピークはもっと後かもしれません。シールドは安定した輪郭を保ち、+効果切れの時にだけ崩れます。レビューのピクセル `energy` は面積と明度を混ぜたもので、どちらのカーブとも一致しません。++## どのフェーズにも後継がある++| フェーズ | 答えるべき問い | よくある失敗 |+|---|---|---|+| 予備動作 | 見る人は、どこで・いつ何かが起こるか分かるか? | 大きすぎて最終的な爆発に見える。着弾ストリップが先行する飛翔体で汚れている |+| 接触または解放 | この瞬間は前後のフレームより明確か? | 大きな白い塊が残り続ける。接触が Lab のフィードバックとずれている |+| 本体 | フラッシュが消えた後も、アクションと属性が読み取れるか? | 本体が早く消えて火花だけが残る。最初から最後まで変わらない一つの輪郭 |+| 二次モーション | 破片、煙、火花に原因と方向があるか? | 装飾的なノイズのように、あらゆる方向へ一斉に撒き散らされる |+| 消散 | 残っているものはまだ変化しているか、時間どおりに終わるか? | 空のテール。静止した汚い残像。`duration` の時点でまだ大きな本体が見えている |++本体と二次モーションは重なっていて構いません。5 つの区間を機械的に分ける必要はありません。ずらすのは読み取りのポイントです:+フラッシュが最初に去り、形が引き継ぎ、破片は動き続け、煙は最後に薄れます。後のレイヤーのほうが明るい場合は、+二撃目、リターンストローク、シールドの破壊などとして説明できなければなりません。++## 同梱サンプルの参考タイミング++サンプルのレシピから求めた絶対フレーム範囲です(最初の発生から最後のインスタンスの最大ライフまで。飛翔体は `flight` で解放)。+見える時間は画像で決まります。これらはすべてのエフェクトに使える定数ではありません。++| サンプル | 接触または解放 | メインの形 | その後 |+|---|---|---|---|+| Hit Heavy(0.5 s) | Anticipation f0–3、Contact flash f2–7 | Impact burst f2–12、空気の泡と波は f14 まで | 重い火花は f28 まで、残り火と土埃は f30 まで |+| Fire Slash(0.6 s) | 刃と熱い縁は f1 から、セル調の三日月 f2–10 | 刃の本体は f17 まで、親の振りの平面は f22 まで | 炎の舌は f35 まで。煙と残り火は f34 で終わる |+| Magic Charge(1.5 s) | Charged flash f64–70(唯一のフラッシュ) | 集束とコア f0–64 | 解放の広がりと火花は f82–86 まで |+| Shield Dome(1.8 s) | 展開時のきらめき f0–5 | シェル全体は f84 まで | 球体の破片 f80–104、欠片は f106 まで。f108 までに消える |+| Heal(1.7 s) | —(接触なし。ゆっくりフェードイン) | 紋章 f0–88、柱 f8–82 | プラス記号と光の粒が f90–98 まで昇る |+| Fire Explosion(1.3 s) | Detonation flash f9–12 | Fireball f6–40、Mushroom f12–51 | Smoke billow f14–76。テールは f54、60、66 で確認 |+| Ice Spikes(1.35 s) | Eruption glint f8–13 | 結晶がオーバーシュートしながら f6–15 で噴出し、約 f47 まで保持 | Crack glint f47–50、その後 f50–78 で破片が砕け散る |+| Poison Cloud(1.75 s) | Splash flash f1–4 | Burst puff f1–25、酸の水たまり f3–104 | 毒煙と霧が約 f99 まで |+| Projectile Fire(flight 0.45 s) | —(接触なし) | ヘッドレイヤーは f27 の解放まで放出 | 煙のトレイルは解放後 f69 まで生存 |+| Projectile Ice(flight 0.35 s) | 発射口のリング f0–16 | 槍状のヘッドは f25 まで | 振りまかれた破片と欠片が約 f41 まで落下 |+| Projectile Dark(flight 0.6 s) | —(接触なし) | ヘッドレイヤーは f36 の解放まで放出 | 航跡と経路のきらめきは f54 まで生存 |+| Dark Vortex(1.65 s) | インパクトフレーム f62–64、解放 f62–70 | 地平と円盤が f0–62 で内側へ流れ込む | 解放の弧は f98 まで減衰して煙になる。地面の渦巻きは f88 まで |++「誰が誰から引き継ぐか」を借りる前に、用途と形を合わせます。頻繁に出る軽いヒットに爆発の長い煙のテールを与えてはいけませんし、+チャージを最初のフレームから暗くなるだけのものにしてもいけません。++## カーブは実フレームに着地させる++レシピの delay と life は 60 FPS のフレーム数、F カーブのキーはライフに対するパーセントです。delay d で生まれ、ライフ L が固定のレイヤーでは、+実フレーム t での変化はキー `100 × (t − d) / L` に置きます。ライフがランダムだと、インスタンスごとに変化する絶対時刻が異なります。+接触に合わせるには、ライフ固定のキーレイヤーを使います。++子の delay は親インスタンスの誕生から数えます。繰り返し生まれる親は、子ごとに独自の時計を与えます。`vfx brief-validate` が展開する、+最も早い誕生と最も遅い誕生を読んでください。「このレイヤーは 20 フレーム生きる」は、フレーム 20 で消えるという意味ではありません —+最後に生まれたインスタンスはまだ生きています。++飛翔体は `flight` で放出を止め、トレイルは各インスタンスのライフで終わります。煙のテールを延ばすには、フリップブックの区間を長くし、+色の減衰と適切なライフを組み合わせ、`duration` と同時生存インスタンスの予算を確認し直します。`duration` を上げるだけでは空のテールができ、+ライフを上げるだけでは連番が早く再生し終わってしまうことがあります。++## 最後のフレームに賭けない++ブリーフには退場の開始、退場の中間、消える時刻を記し、レビューでは少なくともその 3 つに加えて `duration` 後のチェック用フレームを+サンプリングします。長いエフェクトでは、ピークがサムネイルを占領してテールに空のタイルが一枚だけ、とならないよう、+80 % と 90 % のキーフレームを明示的に追加しても構いません。++シェル、柱、リングに目に見える崩れが出ない場合は、まずレンダラーがその組み合わせをサポートしているか確認し、+次に実際のジオメトリの断片、分割した弧、形状間の時間指定の受け渡しを検討します。コンパイルの読み戻しが正しくても、+「ディゾルブが効いている」ことにはなりません — [シールドのケース](cases.md#シールド隙間が一度も見えない崩れ) を参照してください。++各ラウンドでは、まず接触・本体の引き継ぎ・退場のどれを直すかを決め、そのレイヤーだけを変えます。順序と画面占有率は標準ストリップで、+侵食とトレイルは詳細シートで、リズムは Lab の等速再生で判断します。diff --git a/docs/zh/README.md b/docs/zh/README.mdnew file mode 100644index 0000000..4946bd5--- /dev/null+++ b/docs/zh/README.md@@ -0,0 +1,34 @@+# effekseer-vfx-skill 中文文档++这里是本技能包英文文档的简体中文译文,供人阅读参考。agent 实际加载的是 `skills/` 下的英文文件+([`skills/effekseer-vfx/SKILL.md`](../../skills/effekseer-vfx/SKILL.md)、[`skills/vfx-review/SKILL.md`](../../skills/vfx-review/SKILL.md)+和 [`skills/effekseer-vfx/references/`](../../skills/effekseer-vfx/references/));译文与英文不一致时以英文为准。+项目介绍见 [README.zh-CN.md](../../README.zh-CN.md)。++## 技能++| 页面 | 说明 |+|---|---|+| [SKILL.effekseer-vfx.md](SKILL.effekseer-vfx.md) | 制作技能主文档:首次运行、制作一个效果的完整流程、硬性规则、路由表和配方骨架 |+| [SKILL.vfx-review.md](SKILL.vfx-review.md) | 独立评审技能:评审应收到的输入、0–3 评分表和 JSON 输出格式 |++## 参考文档(`references/`)++| 页面 | 说明 |+|---|---|+| [craft.md](references/craft.md) | 制作规则:为什么"贴纸感"不行、时间结构、元素差别、飞行体、不规则多职责技巧、预算 |+| [design.md](references/design.md) | 设计简报:要决定什么、调色板职责、按用途的时间结构、风格例外和简报 JSON 格式 |+| [layering.md](references/layering.md) | 明暗、颜色与图层配对:调色板职责、三种副本、尺寸与寿命起点、白团/黑团的修复顺序 |+| [timing.md](references/timing.md) | 强度、体积与退场节奏:各阶段的接替、示例参考时间、曲线落帧、尾段检查 |+| [skeletons.md](references/skeletons.md) | 类别骨架:命中、斩击、爆炸、飞行体、蓄力、护盾、治疗与增益的层职责 |+| [motion.md](references/motion.md) | 运动与路径:飞行体的头部/拖尾/脱落粒子、斩击扫掠、把速度放进形状和节奏 |+| [shapes.md](references/shapes.md) | 体积与遮挡:按标准镜头选择体积、绘制顺序决定遮挡 |+| [textures.md](references/textures.md) | 纹理职责、生成与验收:图像生成模型与程序化纹理的分工、提示词写法、处理与实测 |+| [reference.md](references/reference.md) | 对照参考视频:导入、读帧、与采集帧配对比较及其局限 |+| [review.md](references/review.md) | 复查循环、证据与交付:review 产出、flag 含义、阅读连拍、独立评审、`effect-verify` |+| [cases.md](references/cases.md) | 诊断案例:火焰爆炸、飞行体烟尾、护盾破碎三个重建的前后对照案例,附真实渲染对照图 |+| [cli.md](references/cli.md) | 命令参考:所有 `vfx` 命令、所需环境和工作区结构 |+| [examples.md](references/examples.md) | 随附示例:火、冰、毒、暗四组飞行体 + 命中配对,以及命中、斩击、蓄力、护盾、治疗五个单独效果及其用法 |+| [godot.md](references/godot.md) | 在 Godot 中使用效果:`Vfx` API、Lab 操作、替身角色和运行时检查 |+| [engine-conventions.md](references/engine-conventions.md) | 已验证的引擎约定:角度与坐标轴、力、网格与 fresnel、序列帧、继承、HDR 与 Lab、锚点、扩展编译器 |+| [primitives.md](references/primitives.md) | 配方代码与基元:`effect()` 字段、基元表、辅助函数、层字段和单位 |diff --git a/docs/zh/SKILL.effekseer-vfx.md b/docs/zh/SKILL.effekseer-vfx.mdnew file mode 100644index 0000000..597ad44--- /dev/null+++ b/docs/zh/SKILL.effekseer-vfx.md@@ -0,0 +1,83 @@+> 本文是 [`skills/effekseer-vfx/SKILL.md`](../../skills/effekseer-vfx/SKILL.md) 正文的中文译文(省略 YAML frontmatter)。agent 加载的是英文 `SKILL.md`;两者不一致时以英文为准。++# Effekseer VFX++像 VFX 美术那样迭代制作游戏特效,只不过用代码:**简报 → 纹理 → 配方 → EffekseerCore 构建 → 真实 Godot 连拍 → 看图 → 修一处 → 重复 → 独立评审**。++下文的 `<skill>` 指包含本文件(英文 `SKILL.md`)的目录。所有命令的形式都是+`sh <skill>/scripts/vfx [--project <game project>] <command> ...`,输出一个 JSON 对象+(进度信息写到 stderr)。项目默认是当前目录,效果工作区是 `<project>/vfx/`。+运行 `sh <skill>/scripts/vfx --help` 查看全部命令;[references/cli.md](references/cli.md) 有完整说明。++## 在项目里第一次运行++1. `vfx doctor` —— 报告 `modes`(`authoring`、`build`、`render`)、工作区和确切的 `next` 步骤。如果它说存在一个不是由 `vfx init` 创建的 `vfx/` 文件夹,先与用户确认这就是游戏项目(或传入 `--project`),再进行初始化。+2. 如果需要安装,**先征求用户同意**(完整模式会下载约 250 MB 到 `~/.cache/effekseer-vfx`):+ macOS ARM64 上运行 `sh <skill>/scripts/setup.sh`,其他系统运行 `sh <skill>/scripts/setup.sh --authoring-only`。+ setup 需要 Python 3.11+ 或 uv(macOS 自带的 Python 3.9 太旧);如果 `doctor` 报告两者都没有,请用户安装其中一个。Godot 4(Forward+)必须由用户自行安装;如果它不在 `PATH` 上,设置 `GODOT`。+3. `vfx init` 创建 `vfx/`(Godot Lab、材质、数学纹理、官方 Effekseer 插件)。除非加 `--update-templates`,否则不会覆盖已有文件。+4. 可选:`vfx examples add <name>` 复制一个完成且经过独立评审的示例用于学习:配对 `fire`、`ice`、`poison`、`dark`(飞行体 + 命中),单独效果 `hit`、`slash`、`charge`、`shield`、`heal`,或 `all`。见 [references/examples.md](references/examples.md)。++`vfx review`、`preview` 和 `showcase` 会在用户桌面上打开 Godot 窗口。如果你运行在沙箱里(例如 Codex 的工作区沙箱),+请在用户批准后到沙箱外运行这些命令;无法离开沙箱时,把完整命令交给用户在自己桌面的终端里运行。以 "rendered no frame" 停止的 review+最可能是打不开窗口(请结合它附带的 Godot 输出判断)。`doctor` 的 `render: true` 只表示找到了 Godot。++没有 `build`/`render` 模式时,仍然可以写简报、配方和纹理并运行 `lint`,但无法判断外观。要明确说明:把工作报告为+**未编译、未经渲染验证**;绝不声称效果有所改善。++## 制作或修改一个效果++1. **先读再写。** 必读 [craft](references/craft.md)、[design](references/design.md)、[layering](references/layering.md)、[timing](references/timing.md) 和 [skeletons](references/skeletons.md);再按下面的路由表读对应主题文件,并用 `vfx examples show <name>` 查看对应示例的层计划(名称:`hit`、`slash`、`charge`、`shield`、`heal`,飞行体和爆炸等命中效果用配对 `fire`、`ice`、`poison`、`dark`;也可以直接用效果 ID)。修改已有效果时运行 `vfx effect-context <ID>` 并阅读它的历史,避免重复已经失败的改法。+2. **简报。** 编写 `vfx/briefs/<ID>.json`(三个关键画面、调色板职责、节拍、层计划、验收条件、避免事项)。格式见 [design.md](references/design.md)。+3. **纹理。** `init` 之后已经有数学形状(光晕、环、噪声、拖尾、扰动图),以及一套入门用的手绘烟、爆炸、丝状笔触、裂纹和冰纹理。复杂的手绘形状(火焰、斩击、烟、裂纹、冰、符文)来自图像生成模型 —— 按 [textures.md](references/textures.md) 操作。使用任何纹理的角度之前,先用 `vfx texture-info` 实测。+4. **配方。** 编写 `vfx/src/<ID>.py`,用 [primitives.md](references/primitives.md) 中的基元定义 `recipe()`。坐标轴、单位和混合行为遵循 [engine-conventions.md](references/engine-conventions.md) 中已实测的引擎规则,不要猜。+5. `vfx brief-validate <ID>` 和 `vfx lint --ids <ID>`。lint 的 error 必须修;warning 是制作提示,以渲染结果为准。+6. `vfx build --ids <ID>`,然后 `vfx review --ids <ID> --note "<what this round changed>"`(`--note` 写明本轮改了什么)。+7. **看图。** 用你的看图工具打开 review 返回的每一个路径(`sheets`、`compare`、`details.*.sheet`)。flag 只指出可能的问题;绝不只凭 flag 下结论。流程和各 flag 的含义见 [review.md](references/review.md)。+8. **每轮只修一类问题**,每个效果迭代 3–5 轮。+9. **独立评审。** 作者从不给自己的效果打分。运行 `vfx review-handoff <ID>`:它会写出一份完整的评审简报(图片、采集到的帧号、manifest 背景、评分表、报告的保存位置,以及安装在本技能旁边的 `vfx-review` 技能的路径),并返回 `prompt_file`、`report_file` 和确切的提交命令。把这份简报原样交给另一个没有看过配方的 agent:宿主支持时就用它启动一个子 agent,除此之外不告诉它任何关于这个效果的信息;否则请用户打开一个新会话并粘贴进去。`report_file` 出现后,运行返回的 `vfx review-submit <evidence_id> <report_file> --reviewer <that agent's identifier>`(标识用子 agent 的 ID 或名称,或会话 ID,不能是 `author` 或 `self`;帧号默认取报告中的 `observed_frames`)。绝不要自己写这份报告。+10. `vfx overview`(不带 `--ids`:效果库基线),然后 `vfx effect-verify <ID>`。只有 `verified: true` 才能报告为完成;否则列出缺什么。如果达到轮数上限仍没有 ship 结论,报告未解决的项目。++## 硬性规则++- 每个效果都有时间结构(预兆 → 接触 → 主体 → 次级运动 → 消散)和亮度分层(白热核心、饱和主体、更深的外沿或残留)。治疗、护盾和蓄力有各自文档化的例外。+- 主体会改变形状(溶解、扫掠、UV 扰动、序列帧、重新击出的形状);绝不只做缩放和淡出。粒子用缓出(先快后慢)。+- 元素之间至少在形状、运动、节奏、材质、次级运动中的三项上不同 —— 绝不只是换色。+- 不要用 Python 画复杂的手绘形状。如果没有图像生成工具,把提示词写进 `vfx/texture_prompts.json`,向用户索要图片。+- 生成的原图保留在 `vfx/textures/generated/`,处理后的副本写到 `vfx/textures/processed/`;记录每一条提示词。+- 单位:配方 timing 是 60 FPS 帧数,F-Curve 是生命周期百分比,manifest 的 duration/peak 是秒,Godot API 的 rotation 是弧度。+- 每个效果都声明 `delivery`;飞行体需要一个反向指向它的配对命中效果。+- 只使用编译器认识的层字段(`vfx layer-schema`);需要新功能时扩展编译器,不要把裸属性路径写进配方。+- 全量 `vfx build`(不带 `--ids`)会清除由本技能构建、但源码已离开 `vfx/src/` 的效果的产物;它绝不删除不是它构建的效果,并且拒绝在空的效果库上运行。只做局部工作时用 `--ids`(其他地方损坏的源码会列在 `unloaded` 中,而不会阻塞它)。+- 没有实际运行并检查过,绝不声称导出、播放、设备性能或录像成功。++## 路由表++| 任务 | 另外阅读 |+|---|---|+| 新的手绘纹理、序列帧、纹理问题 | [textures.md](references/textures.md) |+| 斩击、飞行体、蓄力、光环,任何会移动的东西 | [motion.md](references/motion.md) |+| 护盾、光柱、Boss、状态、体积、遮挡 | [shapes.md](references/shapes.md) |+| 对照参考视频 | [reference.md](references/reference.md) |+| 具体的视觉失败(白团、尾段空白、没有破碎) | [cases.md](references/cases.md) |+| 给编译器添加引擎功能 | [engine-conventions.md](references/engine-conventions.md#扩展编译器)、`vfx discover`、`vfx core property-list/get/set` |+| 在游戏中使用效果 | [godot.md](references/godot.md) |++## 配方骨架++```python+# vfx/src/VFX_Hit_Spark.py+from vfxkit.primitives import *++def recipe():+ hot = (255, 240, 200, 255)+ return effect('Hit_Spark', 'Spark Hit', 'hit', 'physical', .4, [+ flash('Contact flash', WHITE, 2.2, life=4, delay=1),+ glow('Bloom', (255, 170, 70, 170), 1.6, life=9, delay=1),+ radial_sparks('Sparks', 10, hot, color_end=(255, 120, 30, 255), distance=(.8, 1.7), life=(12, 16), delay=1, gravity=.0018),+ smoke('Dust', (185, 160, 135, 200), count=2, size=(.5, .7), life=(13, 14), delay=4),+ ], peak=.03, impact=.3, delivery=MELEE, design='One-line description of what the player sees.')+```++`effect('Hit_Spark', ...)` 生成 ID `VFX_Hit_Spark`,它必须与文件名一致。`vfx/src/` 中以 `_` 开头的文件是共享辅助模块,+配方可以 import 它们。diff --git a/docs/zh/SKILL.vfx-review.md b/docs/zh/SKILL.vfx-review.mdnew file mode 100644index 0000000..138cc7d--- /dev/null+++ b/docs/zh/SKILL.vfx-review.md@@ -0,0 +1,63 @@+> 本文是 [`skills/vfx-review/SKILL.md`](../../skills/vfx-review/SKILL.md) 正文的中文译文(省略 YAML frontmatter)。agent 加载的是英文 `SKILL.md`;两者不一致时以英文为准。++# 独立 VFX 评审++你是评审,不是作者。只根据给你的图片中看得到的东西做判断。不要打开、阅读或索要配方代码、简报的意图或作者的备注;+manifest 里的一句 design 描述只是背景,不是证据。++## 你应该收到的输入++通常是一份由 `vfx review-handoff` 写出的评审简报文件(`vfx/work/handoff/<evidence_id>.md`),其中列出下面的所有内容,+以及要写入 JSON 的 `report_file` 路径。否则:++- 全时间轴连拍图 `vfx/previews/strips/<ID>.png` 和关键帧拼图(路径来自 `vfx review`);+ 可选的 `<ID>_compare.png`(上方是上一轮,下方是当前轮)和 `--bright` 连拍图;+- 效果的 manifest 条目:`id`、`category`、`element`、`duration`、`peak`、`impact`、`delivery`、`design`;+- 它的复查 `flags`;+- 本次采集的 evidence ID。++用你的看图工具打开每一张图。每一格都标有以效果自身开始为起点、按 60 FPS 计的绝对帧号。如果需要原尺寸帧,请作者运行+`vfx frames <evidence_id> <frames...>` 并把路径给你(如果你也装了该技能,也可以自己运行)。如果缺少某张图,就直接说明 —— 不要凭 flag 打分。++## 评分表++每项打 0–3 分:**0** 缺失或错误 · **1** 有但很弱,玩家注意不到 · **2** 明确成立 · **3** 一眼可读且有鲜明个性。++| id | 问题 | 看哪里 |+|---|---|---|+| `read` | 只看第一个亮起的格子,能看出这是什么效果吗(命中、斩击、元素、增益……)? | 前 2–3 个亮起的格子 |+| `timing` | 是否有预兆 → 接触 → 主体 → 次级运动 → 消散(治疗、增益和蓄力则是慢速淡入 / 向内积蓄)?接触是否是最亮的时刻,且只持续 2–5 帧? | 格子帧号对照 manifest 的 `peak` |+| `layering` | 在最强的那一格:是否有白热核心、饱和主体和更深的外沿或残留,而不是一片平涂的颜色? | 峰值格;若提供则看 bright 连拍 |+| `shape_change` | 主形状是否随时间侵蚀、扫掠或扭曲,还是像贴纸一样只缩放和淡出? | 连续格子中的主形状 |+| `motion` | 次级粒子是否先快速爆出再变慢,并按元素应有的方式运动(火上升、冰下落、暗向内吸、圣光下降或上升)? | 各格中的次级粒子 |+| `placement` | 弧、光柱和地面贴花是否位于假人身上或脚下,而不是偏在一旁或悬空? | 所有格子 |+| `tail` | 最后三分之一是否仍然有刻意的消散,还是空白或被截断? | 连拍图的最后三分之一 |+| `identity` | 如果改成灰色,它还能与同类别的其他效果区分开吗? | 整张连拍图 |++权威版本是 `vfx rubric`(来自 effekseer-vfx 技能的 `assets/review_rubric.json`);如果它与本表不同,以它为准。++按用途的例外:治疗、护盾和增益不需要攻击式的白色闪光;蓄力先向内积蓄,再一次性释放;飞行体连拍在到达时结束,不包含它的命中效果。++## 输出++只返回一个 JSON 对象,并保存到作者要求的位置(例如 `report.json`):++```json+{"id": "VFX_Fire_Explosion",+ "scores": {"read": 2, "timing": 3, "layering": 3, "shape_change": 2, "motion": 3, "placement": 3, "tail": 2, "identity": 3},+ "worst": "shape_change",+ "fix": "From f18 to f30 let the main fire layer burn a large gap open on one side so the round outline breaks up.",+ "verdict": "ship",+ "observed_frames": [1, 4, 9, 10, 12, 18, 30, 42, 54, 72]}+```++规则:+- 每项都给 0–3 的整数分。`worst` 填一个得分最低的项。+- 任何一项低于 2 分时 `verdict` 为 `iterate`,否则为 `ship`。+- `fix` 是针对最差项的**一个**具体改动,用配方的语言写(哪一层、什么时间、哪张纹理或哪种运动),并注明帧号。+ 只写一个改动:每一轮迭代只改一类问题。+- `observed_frames` 列出你实际看过的帧号标签。++把它保存到简报中指定的 `report_file`(或作者要求的位置),然后回复你的分数、结论和修改。+作者随后运行 `vfx review-submit <evidence_id> <report_file> --reviewer <your reviewer id>`。+你的 reviewer id 是宿主用来标识你的名字(子 agent 名称或会话 ID);绝不能是 `author` 或 `self`。diff --git a/docs/zh/references/cases.md b/docs/zh/references/cases.mdnew file mode 100644index 0000000..922b881--- /dev/null+++ b/docs/zh/references/cases.md@@ -0,0 +1,70 @@+# 诊断案例++三个前后对照教训,每个都是**重建的单类 A/B**:把随附示例在某一类问题上改回一个已知的失败版本,两个版本在本技能默认的胶囊+Lab 中用相同的 seed、镜头和绝对帧号渲染,真实的帧只做了裁切、缩放和排版。出处(两次采集的 evidence ID 和帧 hash)见+[case_images/cases.json](../../../skills/effekseer-vfx/references/case_images/cases.json)。失败本身来自这些效果的早期迭代;+图片是新的渲染,不是当时的历史画面。++案例绝不能替代对你的构建运行 `vfx effect-verify`。先说出可见的问题,再选一类修法;不要把最终参数照搬到每个效果里。+选择与当前最差项匹配的案例:白团 → 爆炸;拖尾退场 → 飞行体;参数写了但形状不变 → 护盾。要复现一个案例,先 `vfx examples add`+对应示例,做出 BEFORE 的改动,`vfx review`,再撤销改动并再次 review:第二轮会把同样的对照写成 `<ID>_compare.png`。++## 火焰爆炸:一直不退的白色接触++++**BEFORE:** Detonation flash 存活 14 帧而不是 3 帧,Fire core 存活 22 帧而不是 5 帧,Fireball 的 ramp 一直保持白色到寿命的+55 %,而不是在 12 % 就转为橙色。**看 f18。** BEFORE 仍是一整块白色圆盘,遮住了火球的形状和目标;AFTER 已经冷却成带热中心的+橙红色主体,因此饱和的形状、碎片和不对称的甩出都能读出来。f42–78 几乎相同:问题只出在接触上。lint 会对 14 帧的闪光给出警告+(`contact should be 2-5`);连拍说明了原因。++| 可见问题 | 先检查 | 第一类修法 | 再看哪里 |+|---|---|---|---|+| 闪光之后仍是一团白 | 闪光和核心的寿命、主体颜色 ramp、emissive、重叠的 Add | 缩短接触;让主体的高亮段更早交给橙红色 | 主体轮廓能否在接触之后保留(f12–18) |+| 火焰退场后只剩小亮点 | 主体的实际寿命、火 → 烟的交接 | 让一个有体积的火或烟层承担中段 | f18–42 的形状变化 |+| 尾段空白,或灰烟像没画出来 | 序列提前播完、灰度值与背景相比 | 对齐播放片段、ramp 和寿命,保留可见的烟 | 逐帧看 f54、60、66,以及结束后的清空 |++每轮只改一类。不要把所有尺寸和所有 emissive 乘以同一个系数。++## 飞行体:随头部一起消失的拖尾烟++++**BEFORE:** Smoke trail 存活 14–18 帧而不是 38–42 帧,烟雾图集以每格 2 帧播放而不是 4 帧,duration 是 1.0 s 而不是 1.2 s。+两版的飞行都是 0.45 s,所以头部在同一帧到达。**看 f27、f39 和 f54。** f27 时 BEFORE 的路径起点已经没有烟,而 AFTER 在施法者附近+仍有灰烟;f39 到达之后,BEFORE 在目标处只剩几缕红色丝状笔触,而 AFTER 沿路径保留一条断续的灰色烟线,它一边漂移一边变薄,直到 f54。+帧按绝对时间对比,而不是压缩到不同 duration 的相同百分比。++| 你看到的 | 可能原因 | 第一类修法 |+|---|---|---|+| 头部到达,整条拖尾在同一帧消失 | 跟随式继承、立即停止或实例很短 | 先检查 `inherit=TRAIL`(`WhenCreating`)和释放,再看寿命 |+| 粒子还活着但纹理已经是空白 | 图集在寿命结束前就播完了 | 调整 `frame_length` 和使用的帧范围 |+| 白色和橙色都在,烟还是看不见 | Blend 灰色太接近背景 | 在默认舞台上提高到合适的中间调,保留冷却过程 |+| 拖尾粗得像管子 | 发射太密,每层宽度和寿命都相同 | 拆分主尾、细尾和脱落粒子;再去掉多余的发射 |++"拖尾实例仍然存活"和"玩家仍能看到烟"是两种不同的说法。根据图案变化、材质和运动来判断,而不是根据粒子数量;+只加长 `duration` 只会多出一段空白尾段。++## 护盾:始终不露出间隙的破碎++++**BEFORE:** 去掉了六片 `shell_fragments`,于是破碎只靠壳的 alpha cutoff 曲线,而这条曲线写入和回读都是正确的。+**看 f81、f90 和 f96。** BEFORE 中球在 f84 还是完整的,到 f86 就消失了:没有任何一帧露出间隙,只有几片碎片飞出;它是被关掉的。+AFTER 在 f80 把壳交接给六片真实的球面碎片,它们带着可见的间隙分开、向外翻滚、颜色衰减,到 f108 已经消失。++| 你看到的 | 先检查 | 可行方向 |+|---|---|---|+| 曲线回读正确但没有出现洞 | 这种 Model + 材质 + 插件组合的真实画面 | 如果这种组合不会侵蚀,交接给分段的弧或真实的球面碎片 |+| 碎片突然出现,而且更大更亮 | 碎片的 emissive、颜色和出生重叠 | 让整个壳退场成碎片;限制它们的高亮时间 |+| 到 `duration` 时仍能看到大碎片 | 最后一次出生、寿命和颜色曲线 | 更早开始 RGB 衰减,留出清空的余量 |+| 碎片看起来粘在表面上 | travel、spin 和真实的空间方向 | 先分开,再减速;带一点翻滚,不要均匀整齐的径向扩散 |++在最初的迭代中,几何间隙先成立了,但 f108 时仍残留大碎片,独立评审仍然给出 iterate;又一轮调整了碎片寿命和 RGB 衰减,完成了退场。+加入新形状不能成为忽视最后一帧的理由。这次失败只说明这种壳材质组合不会可见地侵蚀 —— 并不说明 Model 层从不支持 alpha cutoff ——+而且修复保留了官方渲染器。++## 使用案例++把案例中的检查问题写进简报的验收条件,再用你自己的标准连拍和素材验证。基本方向来自 [layering](layering.md)、[timing](timing.md)+和 [skeletons](skeletons.md);案例只是补充有证据支撑的诊断。diff --git a/docs/zh/references/cli.md b/docs/zh/references/cli.mdnew file mode 100644index 0000000..5e8da51--- /dev/null+++ b/docs/zh/references/cli.md@@ -0,0 +1,113 @@+# 命令参考++`sh <skill>/scripts/vfx [--project DIR] <command> [options]`。输出:stdout 上的一个 JSON 对象;构建期间的进度和 lint 警告写到 stderr。+退出码:0 成功,1 检查失败或出错(`{"ok": false, "error": {...}}`),2 需要先安装:缺少工具链(`SetupRequired`)或这里没有工作区(`WorkspaceMissing`)。+图片结果是文件路径 —— 要打开它们。++除 `doctor`、`init`、`examples`、`rubric`、`layer-schema` 和 `process-texture` 之外,每个命令都需要由 `vfx init` 创建的工作区+(`vfx/src/` 和 `vfx/vfx_manifest.json`)。在游戏项目中运行,或传入 `--project`;在错误的文件夹中运行的命令会以 `WorkspaceMissing`+失败,而不会创建一个多余的 `vfx/`。当前目录不在 Python 的 import 路径上,`vfx/src` 中的辅助模块只按 `_name` 文件解析,+因此项目文件绝不会遮蔽标准库。++环境变量:`VFX_PROJECT`(项目,默认当前目录)、`EFFEKSEER_VFX_HOME`(工具链,默认 `~/.cache/effekseer-vfx`)、+`GODOT`(Godot 4 可执行文件,默认先找 PATH 上的 `godot`,再找 `/Applications/Godot.app`)。++| 命令 | 需要 | 作用 |+|---|---|---|+| `doctor` | — | 平台、工具链、工作区;`modes` 和 `next` 步骤 |+| `init [--update-templates] [--no-plugin]` | Python | 创建/刷新 `vfx/`(Lab、材质、数学纹理、入门手绘纹理);下载官方 Effekseer Godot 插件(固定校验和) |+| `examples [list]` | — | 随附的配对和单独效果,以及它们的历史分数、结论和最弱项 |+| `examples show <name\|ID>` | Python | 带绝对帧号和职责的层计划(配对会同时显示两个效果) |+| `examples add <name\|ID\|all> [--force]` | Python | 把示例源码、简报、手绘纹理和提示词复制到项目中;名称:`fire`、`ice`、`poison`、`dark`、`hit`、`slash`、`charge`、`shield`、`heal` |+| `procedural` | Python | 重新生成数学基元纹理 |+| `list` | Python | `vfx/src` 中的效果及其类别、时间、delivery、design 和构建状态;加载失败的源码列在 `unloaded` 中 |+| `lint [--ids ...] [--timeline]` | Python | 静态规则(error)和制作启发式(warning),见下文 |+| `layer-schema` | Python | 编译器接受的每一个层字段 |+| `brief-validate <ID>` | Python | 简报与配方对照,并给出展开后的绝对层时间线 |+| `effect-context <ID>` | Python | 简报、构建问题、最新证据和最近 10 轮 |+| `texture-info [names...]` | Python | 覆盖率、包围盒、贴边情况、朝向、弧顶凸出、接缝比 |+| `texture-audit <name> [--role R] [--grid C R] [--loop] [--allow-empty i...]` | Python | 按职责检查 + 预览图 |+| `process-texture <src> <dst> [--size N] [--color] [--grid C R]` | Python | 裁切、alpha、留边、缩放到 2 的幂 |+| `build [--ids ...]` | Core | lint、编译、save/open 回读、manifest、构建 receipt;不带 `--ids` 时还会清除由本技能构建、但源码已离开 `vfx/src` 的效果(见下文) |+| `compile <recipe.json> [--source] [--runtime]` | Core | 编译一个配方 JSON |+| `export [--output DIR]` | Core | 把所有已构建的效果重新导出为带 `resources/` 的 `.efk` |+| `discover` | Core | 把 Core 的属性路径、类型和枚举导出到 `vfx/work/property_schema.json` |+| `core <command> ...` | Core | 内置桥接程序对明确指定的 `.efkefc` 文件执行的底层命令:`property-list`、`property-get`、`property-set`、`node-list`、`curve-list`、`curve-set`、`settings-list`、`settings-set`、……(`vfx core --help`);见 [引擎约定](engine-conventions.md#扩展编译器) |+| `review [--ids] [--step N] [--note] [--key-frames ...] [--view standard\|close] [--profile default\|bare] [--bright]` | Core + Godot | 连拍图、关键帧拼图、flags、changes、evidence ID |+| `overview [--ids]` | 已完成 review | 取自最新标准采集的效果库总览页(`effect-verify` 检查的基线);从未采集过的效果会被跳过并列在 `missing` 中。带 `--ids` 时生成一张临时页 `overview_select_*.png`,不会替换基线 |+| `strip <ID> [--compare] [--bright]` | 已完成 review | 连拍图路径和保存的 metrics |+| `frames <evidence_id> <frame...>` | 已完成 review | 原尺寸帧路径和新鲜度问题 |+| `history <ID> [--limit N]` | — | 复查轮次,最新的在最后 |+| `rubric` | — | 独立评审的评分表 |+| `review-handoff <ID>` | 已完成 review | 为最新的新鲜采集写出独立评审的完整简报(`prompt_file`),并给出 `report_file` 和提交命令 |+| `review-submit <evidence_id> <report.json> --reviewer ID [--frames f...]` | 已完成 review | 绑定一份独立评审报告;帧号默认取它的 `observed_frames` |+| `effect-verify <ID> [--no-overview]` | — | 除非当前构建、采集、评审和总览一致,否则以 1 退出;`--no-overview` 是部分检查,只报告 `passed_without_overview`,永远不会给出 `verified: true` |+| `preview [--ids] [--bright] [--output]` | Godot | 在基线、峰值、50 %、85 % 时刻的带 UI 截图 |+| `showcase [--movie]` | Godot(+ ffmpeg) | 打开自动播放效果库的 Lab;`--movie` 录制下来 |+| `package [--preview-dir]` | Godot | 把 Godot 项目连同纹理清单打成 zip;不声称做过设备测试 |+| `reference-import`、`reference-frames`、`reference-compare` | ffmpeg | 见 [reference](reference.md) |++## `--ids` 与损坏的源码++带 `--ids` 时,`lint` 和 `build` 只要求点名的源码能加载;其他任何加载失败的 `vfx/src/VFX_*.py`(写了一半的效果)会列在+`unloaded` 中并排除在跨效果检查之外,而不会阻塞工作。不带 `--ids` 时,每个源码都必须能加载。++## 全量构建可能删除什么++当 `vfx/src` 中没有配方时,全量 `vfx build` 拒绝运行。否则它只删除**由本技能构建**且 `vfx/src/<ID>.py` 已不存在的效果:+带有 `built_by: "effekseer-vfx"` 标记、且 `source` 等于自身 `vfx/src/<ID>.py` 的 manifest 条目;或在加这个标记之前构建的工作区里,+`vfx/work/builds/` 中构建回执仍与磁盘上 `.efkefc` 一致的效果。格式不对的 ID 永远不算本技能所有;删除任何东西之前,都会先检查每条路径+都在 `vfx/` 之内。manifest 或 `vfx/effects/` 里由其他工具或人工制作的效果会保留,`vfx doctor` 把它们计为 `unmanaged`。++全量构建还会清理没有配方使用的资源副本:只删与 `vfx/textures/processed/` 中纹理完全相同的文件(及该 PNG 自己的 `.import`),+从不删同前缀的其他文件,也从不删 unmanaged 效果可能用到的名字(其 `.efkefc` 里写着这个文件名,或其文件缺失)。Core 按文件名把每个纹理+和模型复制到 `resources/`,因此两个不同文件同名时构建会以 `Resource name conflict` 停止:同一次构建内冲突;与某个使用它、但本次没有一起+重建的自有效果冲突(把它们一起重建);或与可能用到它的 unmanaged 效果冲突(给文件改名)。任一输出目录解析到 `vfx/` 之外(指向别处的符号+链接)时,构建拒绝运行。每份构建回执都绑定了它全部的资源副本,之后的构建若改动其中一个,之前的采集就会失效。++## lint 检查什么++Error(只要存在,构建就会拒绝):++- 未知或拼错的层字段(附带建议),以及无效的字段值;+- `peak` 超出 duration;`infinite` 层没有 `flight` 或没有 `interval`;+- 某层存活超过 duration(非循环效果),计入出生时间和飞行体释放;+- 粒子预算超过类别上限:`hit` 60、`projectile` 100、`boss` 250,其他所有类别 150;+- 某纹理既不是数学基元,也没有记录在 `vfx/texture_prompts.json` 中,或在 `vfx/textures/processed/` 中缺失;+- `size_curve`/`scale_curve` 与随机尺寸或缩放范围同时使用(编译器无法把它们相乘);+- 在序列帧上使用 UV 扰动(它会采样相邻格子,渲染出生硬的方形边缘);+- 重力大于 0.01(它是按每帧的平方计算的)。++Warning(制作提示;以连拍为准):++- `fade_in + fade_out` 长于最短寿命(该层永远达不到完全不透明);+- `impact >= 0.3` 的效果没有接触:没有 `flash()` 层,也没有一个存活不超过 10 帧的白热 Add 层;+- 接触的开始与 manifest 的 `peak`(Lab 在此触发反馈)相差超过 6 帧;+- `flash()` 存活超过 6 帧(接触应为 2–5 帧);+- 没有任何层改变形状:没有溶解 cutoff、环扫掠、UV 扰动或滚动、序列帧,也没有在后续帧重新击出的手绘形状;+- 没有白热的 Add 颜色(luma ≥ 0.85 且每个通道 ≥ 180);+- 同一类别、不同元素的两个效果,在形状、运动、节奏、材质和次级运动中只有不到 3 项不同(很可能只是换色)。++## 工作区结构++```+<project>/vfx/+ src/VFX_*.py recipe sources (yours) ┐+ briefs/VFX_*.json design briefs │+ texture_prompts.json prompts of painted textures │ the effect library:+ textures/generated/ image-model originals (never edited)│ keep under version control+ textures/processed/ game textures (incl. procedural) │+ recipes/*.json compiled recipe snapshots │+ effects/*.efkefc Effekseer sources + resources/ │+ exports/*.efk runtime exports + resources/ │+ vfx_manifest.json ids, timing, delivery, design │+ previews/strips/overview_*.png, metrics.json ┘+ characters/ optional rigged stand-ins (player.glb, target.glb)+ godot/ generated Godot Lab (ignored)+ work/ receipts, locks, reference frames, audits, property schema (ignored)+```++从 `src/` 到 `previews/strips/overview_*.png, metrics.json` 的条目构成效果库,要纳入版本控制:配方源码(你写的)、设计简报、+手绘纹理的提示词、图像模型原图(从不编辑)、游戏纹理(含程序化纹理)、编译后的配方快照、Effekseer 源文件 + `resources/`、+运行时导出 + `resources/`、manifest(ID、时间、delivery、design)以及总览页和 metrics。`characters/` 放可选的绑骨替身角色+(`player.glb`、`target.glb`);`godot/` 是生成的 Godot Lab,`work/` 存放 receipt、锁、参考帧、audit 和属性 schema,两者都被忽略。diff --git a/docs/zh/references/craft.md b/docs/zh/references/craft.mdnew file mode 100644index 0000000..3736488--- /dev/null+++ b/docs/zh/references/craft.md@@ -0,0 +1,81 @@+# VFX 制作规则++所有配方都建立在这些规则之上。编写或修改效果之前先读它们,并一起读 [layering](layering.md)、[timing](timing.md) 和+[skeletons](skeletons.md)。这里的制作起点可以按用户的风格调整;[engine-conventions](engine-conventions.md) 中实测的引擎行为则不能改。++目录:1. 为什么"贴纸感"的效果不行 · 2. 时间结构 · 3. 元素之间的差别 · 4. 飞行体 · 5. 不规则与多职责的效果 · 6. 预算++## 1. 为什么"贴纸感"的效果不行++静态 billboard 换个颜色、放大再淡出,看起来就是一张贴纸。让效果读起来像效果的是下面五件事,缺任何一件质量都会明显下降:++1. **时间结构**:预兆 → 接触闪光 → 主体 → 次级运动 → 消散。接触只占 2–5 帧;消散占大半时长。+2. **亮度分层**:白热核心、饱和主体和更深的外沿或残留 —— 而不是整片同一种颜色。+3. **形状变化**:主体会侵蚀(alpha cutoff 溶解)、抖动(UV 扰动)或扫掠展开;只靠缩放和透明度不够。+4. **速度有变化**:粒子先爆出,再悬停下坠(缓动位移),绝不匀速排成一条线。+5. **画面反馈**:命中时的泛光、环境闪光和镜头抖动。Lab 根据 manifest 的 `impact`、`light` 和 `peak` 生成它们;+ 关掉它们(`--profile bare`)时效果也必须成立。++## 2. 时间结构++| 阶段 | 帧数 (60 FPS) | 做法 |+|---|---|---|+| 预兆 | 2–14 | 收缩的小光晕、地面警示圈、细引导线。打击越重,预兆越长 |+| 接触 | 2–5 | `flash` 白色星芒,尺寸是主体的 1.5–2 倍,随即消失 |+| 主体 | 8–20 | 手绘形状用 `POP` 弹出,再用 `DISSOLVE` 侵蚀;`shock_ring` 外扩 |+| 次级 | 10–40 | `radial_sparks`、`motes`、碎片、火舌,带重力 / 上升 / 湍流 |+| 消散 | 20–60 | 烟、余烬和地面裂纹的余光慢慢冷却 |++治疗、护盾和增益去掉接触帧,改用慢速淡入、上升运动和轻微过冲。蓄力把结构倒过来:长时间向内积蓄,释放时一次闪光。++## 3. 元素之间的差别++只换色不是新元素。同一类别的两个元素至少要在**形状、运动、节奏、材质、次级运动**中的三项上不同(不满足时 `vfx lint` 会警告):++| 元素 | 形状 | 运动 | 节奏 | 次级 |+|---|---|---|---|---|+| 物理 | 锯齿状爆点、速度线 | 径向爆开,然后下坠 | 最短,0.3–0.65 s | 火花、灰尘 |+| 火 | 翻滚的火球、火舌 | 上升、UV 扰动 | 中等,拖尾长 | 上飘的余烬、黑烟 |+| 冰 | 棱柱、碎片 | 过冲、静止停顿,然后碎裂 | 有停顿 | 受重力下落的碎片、下沉的冷雾 |+| 雷 | 锯齿折线 | 不移动;逐帧切换或镜像的闪击 | 主击、回击、余闪落在不同帧 | 地面裂纹、爬行电弧 |+| 暗 | 漩涡、黑色核心 | 向内吸入 | 长时间吸入 + 一次释放 | alpha 混合的黑色主体、内吸微粒 |+| 圣 | 法阵、光柱 | 垂直下落或上升 | 缓入,持续 | 上升的光环、闪烁星点 |+| 毒 | 团雾、气泡 | 缓慢漂移、下沉的雾 | 最慢,约 2 s | 上浮的气泡、孢子 |++## 4. 飞行体(category `projectile`)++飞行体没有接触帧。它的命中是一个单独的效果,由 `Vfx.launch` 的 `arrived` 信号触发。飞行体配方声明 `flight`+(参考飞行的秒数),抛射弧线还要声明 `arc`(飞行中点的抬升高度,单位米)。命中效果用+`delivery=dict(kind='projectile', projectile='VFX_...')` 反向指向它。++- **头部**层跟随 handle(默认继承)。**拖尾**层使用 `inherit=TRAIL`(位置、旋转和缩放都是 `WhenCreating`),+ 留在出生的位置,因此路径会自己画出来。两者都用 `sustain(layer, interval)`(`infinite`)发射;游戏在到达时调用+ `stop_root()`,之后只剩拖尾的消散。lint 按在 `flight` 时释放来计算寿命;预算按 life/interval 计算同时存活的实例数。+- 元素之间在飞行节奏和次级运动上也要有差别:火会闪动、上升并转成黑烟;冰又快又直,脱落的碎片下落,留下下沉的冷雾;+ 暗是 alpha 黑色核心,把针状粒子向内拖拽,尾迹收缩;毒走抛物线,滴落、冒泡,留下悬停的毒气。+- 复查连拍让飞行体从施法者飞向目标,在到达时结束。它的质心和半径跟随飞行路径,而不是元素本身的运动,+ 所以飞行体不检查 `sinks` 和 `expands while charging` 这两个 flag。++## 5. 不规则与多职责的效果++让远程和命中效果读起来像专业作品的技巧(随附的示例配对都用到了):++1. **用残缺的弧,不用完整的环。** 主体由几条不完整的笔触组成,每条扫过 60–200°,半径、倾角和宽度各不相同,彼此交叉。+ 用 `wisps`(带常驻侵蚀的手绘丝状笔触),不要用干净的 `shock_ring`、`shell` 或圆形 billboard 做主形状。+2. **多个职责,各有分工。** 复杂的远程技能可能同时有弧、白热核心、暗核、两档火花、微粒、灰尘、碎块和地面痕迹。+ 说明每个职责的用途;不要把层数当作合格线。轻击和简单技能需要的少得多。+3. **暗色元素必须看得见。** 在暗色舞台上,灰色烟雾和碎块的数值大约要在 90–150;`(40,10,70)` 这样的颜色画了等于没画。+4. **有用途的小面积强调色**:暗系的橙色下沿、冰的棱镜边、毒下方的暗核。5–10 % 的面积只是初次尝试的起点;+ 先在简报里确定主色和强调色的职责。+5. **光衰减成烟。** `decay()` 给一条加色笔触配一个 alpha 混合的灰色副本,晚几帧开始,寿命是 1.6–2.2 倍:+ 光先熄灭,形状以烟的形式留下。+6. **一根长细线。** 释放时用一条 `slice_line` 横穿半个画面,长宽比大于 40:1,持续 8–15 帧。+7. **方向性。** 碎块、火花和液滴沿射击方向(+X)略偏上喷出(`spray`、`debris`),而不是对称的球形。+8. **地面反馈。** 外滚的灰尘、落地弹跳的碎块、焦痕、裂纹、液池和法阵把效果钉在地面上。+9. **冲击帧。** 近黑的全屏卡和白色闪光放在**同一帧**(黑卡排在闪光之前)。把黑卡提前,暗系的+ "expands while charging" 检查就会把它读成扩张。++## 6. 预算++粒子实例(`particle_budget`,父 × 子):普通命中 ≤ 60,飞行体 ≤ 100,元素技能 ≤ 150,Boss 技能 ≤ 250。+同时存活的满屏加色层最多三个。纹理 128–256 px;手绘主形状和法阵 512 px;4×4 序列帧图集 1024 px。diff --git a/docs/zh/references/design.md b/docs/zh/references/design.mdnew file mode 100644index 0000000..91c74ec--- /dev/null+++ b/docs/zh/references/design.md@@ -0,0 +1,85 @@+# 设计简报++每个新效果都从一份简报开始:在编写配方之前写好 `vfx/briefs/<ID>.json`。`vfx brief-validate <ID>` 会对照配方检查简报(层路径、节拍是否在时长内),所以在第一版配方写好后运行它,之后两者任一改动都要再跑一次。+小修改则先读现有简报,再调整受影响的目标。简报里的时间是从效果开始算起的 60 FPS 绝对帧号;manifest 保留秒。++## 简报要决定什么++写明**用途**(频繁命中、单次技能、终结技、持续状态、展示作品)、**玩家最先读到的形状**、它在标准镜头中**相对角色的尺寸**、+**释放或接触的时刻**,以及**最后留下什么**。验收条件描述可见的行为 ——"闪光消失后火焰仍持续向上翻滚"——+而不是"更多层"或"高级感"。++从三个关键画面开始:**最早可读的画面**、**主体从接触手中接过画面**、**最后一个刻意保留的残留**。对每个画面,+说明什么形状在哪里、正在如何变化,然后再选基元。"一道倾斜的弧横过目标胸口,火焰从它的下沿剥落并上升,最后只剩余烬"+比"酷炫火焰斩"更能指导代码。++| 用途 | 最先读到的形状 | 体积与尺度的决定 | 要留空的空间 |+|---|---|---|---|+| 频繁命中 | 小爆点和短的方向线 | 以命中点为中心;绝不每次都盖住整个角色 | 玩家身体和周围的战斗信息 |+| 方向性斩击 | 倾斜平面内的弧和热边 | 挥砍平面穿过目标;宽度和负空间都可见 | 弧内侧和后方的角色剪影 |+| 单次爆炸 | 从接触点喷发的体积 | 在标准镜头中主体明显变大、抬升并留下残留 | 主体之外留给次级运动的通道 |+| 持续状态 | 围绕持有者的稳定轮廓 | 不保持最高亮度;保持段有表面运动 | 壳内的角色和主视野 |++不要按纹理名来拼。同一段烟雾序列可以给火球之后的画面增加分量,也可以作为飞行路径上的残留,但出生位置、尺寸、方向、+密度和播放的帧范围必须不同。当几个重要的层共用一个中心时,写明哪个在前、哪个在后、哪个先退出。++## 调色板职责++`palette` 分配 **core**、**body**、**dark** 和 **matter**(accent 可选)。短促的热核心;带轮廓的饱和主体;+给轮廓或残留提供对比的暗色;给效果带来物质重量的烟雾和碎片。强调色在简报中声明,不要每层加一种颜色。+效果在灰度下也应该可读。见 [layering](layering.md)。++## 按用途安排时间结构++普通命中是短促的接触,然后衰减。蓄力可以逐渐积累。雷可以有明确的回击。护盾可以有一段稳定的保持。多段技能分别标明每个峰值。+爆炸的亮度下降时主体可能仍在变大、上升。一群小火花绝不能代替一个已经消失的主体。见 [timing](timing.md)。++## 风格规则的例外++"不规则"适合物质、破碎和笔触;它不会自动适用于法阵、瞄准提示或光学星芒。"多职责"适合复杂技能,不适合轻击。+"白色核心"有助于攻击的接触;它并不意味着治疗也必须闪白。[craft](craft.md) 中的参考技巧是候选工具;风格和用途由用户和简报决定。+不要读了一张表就给每个技能都配上同样的光晕、冲击环和火花。++## 简报格式++除 `reference` 外所有字段都是必填的(`assets/brief.schema.json`)。下面节选自随附的 `VFX_Fire_Explosion` 简报,+原简报规划了全部 24 层:++```json+{+ "schema_version": 1,+ "effect_id": "VFX_Fire_Explosion",+ "role": "paired ranged impact",+ "style": "stylized anime combat",+ "dominant_shape": "turbulent comet and ascending cooling smoke",+ "palette": {"core": [255, 250, 220], "body": [255, 120, 30], "dark": [60, 30, 20], "matter": [125, 110, 100]},+ "delivery": {"kind": "projectile", "projectile": "VFX_Projectile_Fire"},+ "anchor": "body",+ "beats": [+ {"frame": 4, "name": "gather", "expect": "Inward gathering at target"},+ {"frame": 10, "name": "contact", "expect": "White-hot detonation lasts only a few frames"},+ {"frame": 18, "name": "body", "expect": "Orange fire survives white flash"},+ {"frame": 54, "name": "tail", "expect": "Grey smoke thins while ascending"}+ ],+ "layer_plan": [+ {"name": "0:Scorch", "role": "ground footprint", "primitive": "Sprite T_Crack01", "exit": "gone by absolute f55"},+ {"name": "5:Detonation flash", "role": "contact", "primitive": "flash", "exit": "gone by absolute f12"}+ ],+ "acceptance": ["Head/body silhouette reads at standard camera after the brightest accent"],+ "avoid": ["Large persistent white blob erasing the body"]+}+```++- `effect_id`、`delivery` 和 `anchor` 必须分别等于配方的 `id`、`delivery` 和 `attach`。+- `beats` 是按顺序排列的绝对帧号(0 … duration + 12);复查时总会把它们作为关键帧采集。+- `layer_plan[].name` 是层的**带索引完整路径** —— 同级索引加名称,子层用 `/` 连接(`0:Swing plane/1:Blade body`)——+ 这样同名层也能区分开。层移动后要更新它。每一层都应该被规划(未规划的层会收到警告)。绝不要把简报元数据写进 layer dict。+- `brief-validate` 会展开父层的出生时间:子层的 delay 不是效果的起点。++随附的示例(`vfx examples add <pair>`)都附有完整的简报,可以直接参照。++## 开始之前++颜色、emissive、Add/Blend 以及 Lab 的 HDR 泛光共同决定画面;先了解 [引擎约定](engine-conventions.md) 中的舞台设置。+把现有效果库和假人的尺寸作为第一参照尺度,然后在标准镜头中检查。优秀的参考作品是节奏和剪影的目标;+它的尺寸和亮度数值并不是本引擎的默认值。diff --git a/docs/zh/references/engine-conventions.md b/docs/zh/references/engine-conventions.mdnew file mode 100644index 0000000..37dc090--- /dev/null+++ b/docs/zh/references/engine-conventions.md@@ -0,0 +1,109 @@+# 已验证的引擎约定(Effekseer Core 1.80.7 + EffekseerForGodot4 1.80.5.1)++下面每一条都在真实渲染中确认过。照原样使用;不要重新猜坐标轴、单位或混合行为。确认了新的约定时,把它连同测量方法一起补充到这里+(请补充到英文原文 `skills/effekseer-vfx/references/engine-conventions.md`)。++目录:角度与坐标轴 · 力与运动 · 网格与 fresnel · 纹理与序列帧 · 继承与寿命 · 渲染、HDR 与 Lab · 锚点与放置 · 扩展编译器++## 角度与坐标轴++- **Ring 角度**:0° 指向上方,90° 指向左方,逆时针递增。要让一段扫掠弧以锚点为中心,就把环的中心朝其扫掠中点的反方向偏移。+- **Sprite 的 Z 旋转**是逆时针的。绝不目测手绘形状的朝向:`vfx texture-info <name>` 会报告覆盖率、包围盒、贴边情况、主朝向,+ 以及月牙形的弧顶凸出方向,采用同一约定(+x 为 0°,逆时针)。在配方中使用实测的角度。例如:`T_Slash02` 实测弧顶凸出为 108°,`slash_set()` 使用+ `SLASH02_BULGE = 105`;如果替换这张纹理,要重新实测并更新这个常量。+- **`billboard='Billboard'` 会忽略 Z 旋转**(`rotation=[0,0,90]` 的 sprite 仍然直立)。需要滚转的 sprite 使用默认的 `RotatedBillboard`。+- **`rotate=True` 的球形发射**:粒子的局部 +Y 指向外侧,所以 `travel.end=[0,d,0]` 向外飞,负值则向内吸。+- **`rotate=True` 的圆形发射(默认 Y 轴)不同**:Core 构造的是 `Translation(r,0,0)*RotationY(angle)`,所以局部 **+X** 指向外侧,+ +Y 仍然向上。沿地面向外滚动的烟需要 `travel.end=[[d0,d1],0,0]`;`[0,d,0]` 会把它变成笔直上升的柱子。`rotate=False` 时位移按世界方向计算+ (上升的粒子用它)。+- **`travel.end` 是绝对的局部位置**,不是相对 `position` 的偏移,而且 `rotate=True` 的发射也会旋转这个局部坐标系。+ 把沿地面滚动的烟放在一个 `renderer='None'`、`position` 位于地面高度的枢轴下;需要按世界方向位移时用 `spawn rotate=False`(`spray`)。++## 力与运动++- **Drag 只衰减力场累积的速度,不衰减 PVA 速度。** "先爆出再悬停"必须用带 EaseOut 的 `travel`,而不是速度 + drag。+- **重力的单位是 单位/帧²。** 下落的火花 0.001–0.002,石块 0.004,上升的烟 0.0003–0.0006。再大一个数量级,粒子就会飞出画面+ (lint 拒绝大于 0.01 的值)。+- **地面碰撞 `collide`**:世界坐标系;`height` 是世界高度(Lab 地面是 0.02)。从 1.35 m 高的命中点出发、重力 0.0015 时,20 帧内什么都到不了地面,+ 所以弹跳只对爆炸、Boss 重击和会落地的东西有意义。+- **Track + Circle 的 `Order` 发射做不出螺旋**:它每帧前进一段,所以在飞行速度下螺距被拉成一条扁平的锯齿线。改用在头部周围以随机倾角排布的 `wisps` 笔触。++## 网格与 fresnel++- **程序化圆柱和圆锥**沿其轴从 `DepthMin` 延伸到 `DepthMax`;`mesh()` 把它们立在原点上。**球体**使用 -1..1 的归一化 depth:+ 用 `scale_start` 控制尺寸,绝不用 Depth。+- **Cone 尖端朝下**(底面在 +Y 端)。要做尖端朝上的晶体,用 `radius2≈0` 的 `Cylinder`(`crystal()` 就是这样做的)。+ `Mesh/Divisions/X=6` 生成六棱柱。`ShapeNoise/WaveNoisePower` 把球体变成凹凸不平的液团。大球体需要 `rings ≥ 24`,否则剪影会出现棱面。+- **程序化模型的 V 从上到下。** 滚动的颜色纹理必须可平铺(`T_NoiseStreak02`);渐变放在不滚动的 alpha 纹理里(`T_GradientV01`),+ 否则会出现硬接缝。+- **Falloff**:`begin` 是面向镜头的中心,`end` 是边缘,`pow` 越大,`begin` 区域**越小**(红/绿测试:pow 8 时几乎整个球都显示 `end`)。+ 细亮边(fresnel、冲击壳)用 `pow` 0.25–0.5。用 `culling='Front'` 只绘制球体的正面(Effekseer 的命名:`Front` 显示正面;+ `Double` 会把内侧背面也当作边缘照亮,球就变成实心的)。护盾照亮边缘;光柱让边缘透明。+- **带颜色纹理或常驻 cutoff + edge 的 Model 层**,在 Godot 插件中用于壳球体时会渲染成灰色斑块。用纯色 + fresnel,只在到期时溶解;+ 需要可见的破碎时,用 `shell_fragments`(真实几何),而不是对整个壳做 cutoff。+- 黑洞、暗球或蓄力**不要用面向镜头的"漩涡贴纸"**:用 `orbit_band` 把环放在倾斜平面里,并按绘制顺序叠放 ——+ 远半环 → 核心(Blend 黑色圆盘或亮核心)→ 光子环 → 近半环 —— 这样近半部分会从核心前面经过。插件**在效果层之间忽略 ZWrite**+ (写深度的球体加上做深度测试的环没有任何效果);遮挡只来自列表顺序。用 `alpha_scroll` 让环表面旋转,使条纹绕环流动,而不是用 Z 旋转。++## 纹理与序列帧++- **UV 扰动纹理必须是不透明的 RG 偏移图**(`T_Distort01/02`)。把白色带 alpha 的遮罩用作扰动图,什么也不会扭曲。+- **Alpha 纹理读取 alpha 通道**;每个 `T_Noise*` 遮罩都可以直接用于 `cutoff` 溶解。+- **序列帧整数**:`flipbook.frame_length`、`x` 和 `y` 是 Core 的整数属性,必须是正整数(4.5 会被原生拒绝;字段校验器会先拦下它)。+ 要延长播放,就同时调整整数的帧长度和寿命。+- **序列帧上不能用 UV 扰动**:`distortion_intensity` 以整张纹理的 UV 计量,所以在 4×4 图集上 0.12 会偏移半格,采样到相邻帧 ——+ 火焰会被切成硬边的方块。lint 会拒绝;需要扰动时用单帧纹理。+- **序列帧图集**:图像模型可以生成一整张 4×4 序列(1024²,每格 256²),连续性可用。用+ `vfx process-texture <original> <output> --size 1024 --grid 4 4` 处理:各格保持原位(不裁切、不重新居中,否则动画会抖动),+ 每格边缘做羽化以防渗色。`frame_length` ≈ life / 16;单次播放用 `loop='Once'`,循环火焰用 `Loop` 加随机起始帧。+- **一张爆炸图集,两层**:加色火焰(ramp 白 → 黄 → 橙 → 暗红 → 消失)加上一个延迟约 8 帧的 Blend 暗烟层。烟必须**排在火之前**+ (画在火的后面),否则会在火球上打出一个黑洞。+- **侵蚀边缘颜色**叠加在冷却后的红色上;偏黄的边缘会变成橄榄色。火焰用 `(255,80,15)`,`scaling≈2`。+- **丝状笔触纹理**:手绘笔触带按行在全宽范围内裁切(这样可以横向平铺),缩放到 512×256,alpha = 亮度。默认的居中处理会添加左右留边,破坏平铺。++## 继承与寿命++- **继承**:Core 默认的 `LocationEffectType` 是 `Already`(每帧跟随父级)。`WhenCreating` 只在出生时取父级变换,+ 所以 handle 移动时粒子留在原地 —— 飞行体拖尾依赖这一点。`renderer='Track'` 把同一层的相继实例连成一条带;配合 `WhenCreating` 就是一条连续的拖尾。+- **`EffekseerEmitter3D.stop_root()`** 停止新的发射;已有的粒子各自走完寿命之后才触发 `finished`。+- **子层时间**:子层的生成从其父实例的创建开始计时,而不是从它的消亡开始。`renderer='None'` 的父层可以旋转它的子层,+ 子层再用 `travel` 缓动到中心,就形成螺旋内落。+- **随机尺寸不能配曲线**:随机的 `size` / `scale_start` 范围与 `size_curve` / `scale_curve` 组合会编译失败(编译器把曲线乘以固定的起始缩放;+ lint 会拒绝)。用第二层来变化尺寸。++## 渲染、HDR 与 Lab++- **屏幕扭曲 `material='BackDistortion'`** 在 Godot 插件中可用(`hint_screen_texture`);`distortion` 是强度(0.4–1.2)。+ 它只折射不透明物体(地面、假人),不折射其他效果层。在暗色的纯色舞台上,它只在地面环和假人边缘上显现 —— 要放大帧才能看到。+ 关掉扭曲时效果也必须成立。+- **Lab 舞台与 HDR 泛光**:默认舞台是受光的深石板蓝(背景 `1a2433`,地面 `1d2733`,ambient 0.75,key 1.5,fill 1.0)。+ 在 Forward+ 中,插件的加色 / emissive 输出进入 HDR 缓冲。用受光的替身角色测得,假人高光峰值约 3.4×,而效果核心超过 8×,+ 所以 Glow 按 `smoothstep(threshold, threshold + hdr_scale)` 从 2.8 开始渐入、到 6.0 完全开启,intensity 1.5,strength 1.1,+ 在 tonemapping 之前加色叠加,五级模糊 1.0/1.0/0.85/0.6/0.35,Filmic white 4 让核心更早烧白,`glow_bloom=0`。+ 这些数值是用带光照、卡通着色的替身角色测得的;默认 Lab 的胶囊假人尚未据此重新测量,因此把阈值当作起点,+ 在改变舞台亮度、假人光照或替身角色之后,先重新测量假人峰值(线性 tonemap,在曝光 1/8 下读回),再移动阈值。`godot --path vfx/godot -- --no-glow` 关闭后处理以便对比。+ 配方基元 `glow()` 是一个纹理层,不是这个 HDR 后处理。舞台改动之后重新渲染整个总览。+- 在强泛光下,接触本来就该白热的效果会在峰值帧报告 `washed out`;它只持续 1–3 帧 —— 看连拍判断,不要为了消掉这个 flag 而削弱接触。+- **软粒子 `soft`** 在早期的 Compatibility 渲染器 Lab 中不可用(没有深度纹理;sprite 几乎完全透明)。Lab 现在使用 Forward+,+ 但 `soft` 尚未重新验证:不要使用,也不要声称它可用。++## 锚点与放置++- Lab 锚点:`body` 距地面 0.95 m,`impact` 1.35 m,`ground` 0。以 `body` 为锚点的效果中,地面层位于约 `y = -0.93`,以 `impact` 为锚点的效果中位于约 `y = -1.3`;+ 写得更低的话,做深度测试的贴花会消失在地面之下。+- 横跨打击方向的近战冲击环用 `tilt=(0,58,0)`:与从左到右的攻击垂直,在透视中看起来是一个竖直的椭圆。++## 扩展编译器++配方字段是 Effekseer 的一个精选子集。当某个效果需要编译器尚不具备的引擎功能时:++1. 制作一个带有该功能的参考节点(或打开一个已有该功能的效果),找出属性路径:+ `vfx discover` 把一个新节点的所有路径连同类型和枚举值导出到 `vfx/work/property_schema.json`;+ `vfx core property-list <file.efkefc> node/root/0` 列出一个真实节点的路径。+2. **先读再写**:用 `vfx core property-get <file> <path>` 读取当前值,然后 `vfx core property-set <file> <path> <json>`,+ 再 `property-get` 一次,看 Core 实际保存了什么。曲线通过 `vfx core curve-list` / `curve-set`,渲染器面板通过+ `settings-list` / `settings-set`。+3. 只使用当前 Core 会保存的属性;不要依赖只在导入时读取的旧字段。+4. 把该功能作为层字段加入 `scripts/effekseer_ai/authoring.py`(它必须出现在 `vfx layer-schema` 中),并附带一个测试:+ 编译一个层、保存、重新打开并读回该值。绝不把裸属性路径写进配方。+5. 渲染它,并把这条约定连同测量方法补充到本文件中。diff --git a/docs/zh/references/examples.md b/docs/zh/references/examples.mdnew file mode 100644index 0000000..9c44eaa--- /dev/null+++ b/docs/zh/references/examples.md@@ -0,0 +1,39 @@+# 随附示例++四组远程配对(一个飞行体加上在它到达处播放的命中效果)和五个单独效果,每个常见类别各一个。它们是完整的成品配方,附有设计简报、+手绘纹理(处理后的副本)以及生成它们的提示词。它们的层职责就是 [skeletons](skeletons.md) 中的类别骨架。++| 配对 | 飞行体 | 命中 | 能学到什么 |+|---|---|---|---|+| `fire` | `VFX_Projectile_Fire` —— 翻滚的序列帧火球、拉长的彗星尾、世界空间中的火焰和烟雾拖尾 | `VFX_Fire_Explosion` —— 沿射击方向甩出的不对称火球、攀升的蘑菇云、衰减成烟的贴地火舌、焦痕和裂纹 | 序列帧翻滚、颜色 ramp、`decay()`、方向性的 `spray`/`debris` |+| `ice` | `VFX_Projectile_Ice` —— 带深蓝衬底的水晶冰枪、带棱镜边的飘带、冻结在路径上的霜环 | `VFX_Ice_Spikes` —— 带过冲喷出的晶体、伴随攀升光环的停顿、按时的碎裂 | `crystal` 网格、fresnel 边缘、明度衬底、先停顿后破碎的节奏 |+| `poison` | `VFX_Projectile_Poison` —— 抛射的光亮液团(变形网格)带湿润高光、酸液细丝、会落地的液滴 | `VFX_Poison_Cloud` —— 酸液飞溅、扩散并冒泡的液池、冷却成浑浊紫灰色的毒气、翻滚的雾 | `arc`、Track 拖尾、`ShapeNoise` 液体、互补色暗核、地面碰撞 |+| `dark` | `VFX_Projectile_Dark` —— 在交叉的品红丝状笔触中翻涌的 alpha 黑色球体,被吸入的细针和尘埃 | `VFX_Dark_Vortex` —— 倾斜吸积盘中不断吞噬的黑色视界、一个黑色冲击帧,然后是撕裂的释放弧和地面螺旋 | 吸光的 Blend 主体、向内的 `travel`、盘面分前后两半的遮挡、冲击帧 |++| 单独效果 | 效果 | 能学到什么 |+|---|---|---|+| `hit` | `VFX_Hit_Heavy` | 两帧预兆、5 帧接触、溶解的锯齿状爆点、三档 `spark_burst`、空气泡和折射波 |+| `slash` | `VFX_Slash_Fire` | 在偏航的 `swing()` 平面中使用 `slash_set()`(残影、主体、热边、折射、赛璐璐月牙);剥落的火舌 |+| `charge` | `VFX_Magic_Charge` | 一秒钟的向内蓄积,带倾斜的 `orbit_band` 环和向内塌缩的壳,然后恰好一次释放 |+| `shield` | `VFX_Shield_Dome` | fresnel 壳和细边缘、过冲弹出、带扫描带的保持段、按时清空的 `shell_fragments` 破碎 |+| `heal` | `VFX_Heal` | 没有冲击帧:地面法阵、滚动的光柱、环、全部上升并缓出的加号和光点 |++```sh+vfx examples # list with historical scores and verdicts+vfx examples show slash # layer plan, absolute frames, roles, budget (a pair shows both effects)+vfx examples add fire # copy into vfx/src, vfx/briefs, vfx/textures/processed, vfx/texture_prompts.json+vfx lint --ids VFX_Projectile_Fire VFX_Fire_Explosion+vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion+vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"+```++(`vfx examples` 列出示例及其历史分数和结论;`examples show` 显示层计划、绝对帧号、职责和预算(配对会同时显示两个效果);+`examples add fire` 复制到 `vfx/src`、`vfx/briefs`、`vfx/textures/processed` 和 `vfx/texture_prompts.json`。)++历史分数(每个评分项 0–3)来自对本技能默认胶囊 Lab 中渲染的一次独立评审:两位评审只看了连拍图、关键帧拼图、manifest 条目和 flags。+其中十一个被判为 `ship`;`VFX_Projectile_Ice`(扁平的冰枪,没有白色核心或暗边,飞行中形状不变)和 `VFX_Projectile_Dark`+(到达之后路径上什么都不留)被判为 `iterate`。`vfx examples` 列出每个示例最弱的评分项和评审给出的一条修法(`historical_review.worst`)。+这些分数只是参考,**不是**对你的构建的验证:要重新构建、复查并再次评分。添加示例时除非加 `--force`,否则绝不覆盖已有文件。++要从示例制作新效果,把源码复制为新 ID(重命名文件和 `effect('...')` 中的名称,以及简报的 `effect_id`),然后改变形状、运动和节奏 ——+而不只是颜色(见 [craft](craft.md))。保持飞行体/命中配对一致:命中效果的 `delivery.projectile` 必须写飞行体的 ID。diff --git a/docs/zh/references/godot.md b/docs/zh/references/godot.mdnew file mode 100644index 0000000..e76d4bf--- /dev/null+++ b/docs/zh/references/godot.md@@ -0,0 +1,46 @@+# 在 Godot 中使用效果++`vfx init` 生成 `vfx/godot/`,这是一个 Godot 4 项目,包含官方 Effekseer 插件、`Vfx` autoload、每个实例一个的 `CombatVfxHandle`+以及 VfxLab 场景。只有在维护本技能时才修改技能中 `assets/godot-lab/` 副本里的运行时逻辑;在游戏项目中,把 `scripts/Vfx.gd`、+`scripts/VfxHandle.gd`、`effects/` 文件夹(连同 `resources/`)和 `vfx_manifest.json` 按相同的 `res://` 路径复制到游戏里(`Vfx.gd` 读取+`res://vfx_manifest.json`),在那里启用 Effekseer 插件,并注册 autoload:项目设置 → 全局 → 自动加载,或在 `project.godot` 的 `[autoload]`+下写 `Vfx="*res://scripts/Vfx.gd"`。不注册的话 `Vfx.play()` 不存在。++## API++```gdscript+var handle = Vfx.play("VFX_Fire_Explosion", position, rotation, effect_scale) # rotation in radians+Vfx.set_speed(0.5) # all active effects, 0.05–4+Vfx.set_paused(true)+handle.stop() # immediately+handle.release() # stop emitting; live particles finish, then it frees itself++# Projectiles: flight time from the manifest unless options.speed (m/s) or options.flight (s); options.arc lifts it.+var shot = Vfx.launch("VFX_Projectile_Fire", from, to)+shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))+```++要点:`rotation` 的单位是弧度;`Vfx.set_speed` 作用于所有活动效果,范围 0.05–4;`handle.stop()` 立即停止;`handle.release()`+停止发射,存活的粒子播完后自动释放。飞行体的飞行时间取自 manifest,除非指定 `options.speed`(m/s)或 `options.flight`(s);+`options.arc` 让它抬升。++有限时长的效果在 `duration` 之后自行清理;循环效果一直重播,直到 `stop()`。manifest(`vfx_manifest.json`)包含 `id`、`duration`、+`peak`、`impact`、`light`、`delivery`、`flight`、`arc`、`attach` 和 `design`;Lab 用 `impact`/`light`/`peak` 驱动舞台闪光和镜头抖动,+这些需要你的游戏自己实现。++## Lab++`vfx showcase`(或 `godot --path vfx/godot`)打开 Lab:两个假人 PLAYER 和 TARGET 相对而立,每个效果按它的 `delivery` 演出 ——+`self` 在施法者身上,`melee` 在出招时打在目标身上,`projectile` 从施法者飞向目标并在到达时播放命中,`targeted` 降落在目标身上,+`area` 以 Boss 重击为中心。按键:←/→ 切换,Space 重播,C 切换对战/单目标舞台,L 循环,P 暂停,1–4 速度,B 背景,S 自动展示。+`-- --no-glow` 关闭 HDR 泛光以便对比。++假人是胶囊体。可以用可选的绑骨替身角色替换它们:把 `player.glb` 和 `target.glb`(约 1 个单位高,Mixamo 风格的骨骼名称,+动作片段命名为 `idle`、`cast_a_spell`、`box_03`、`hit_to_head`、`hit_to_body_01`、`jump`)以及可选的 `<name>.materials.json`+部件 → 着色用途映射放进 `vfx/characters/`,然后运行 `vfx init`。更换假人会改变舞台:要重新渲染基线并重新测量泛光阈值(见+[引擎约定](engine-conventions.md))。++## 检查++`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` 针对当前 manifest 测试播放、发射、暂停、速度、循环和自动回收。+`godot --headless --path vfx/godot --script res://scripts/ExportRuntime.gd` 导出 Godot 运行时资源。只有实际运行过之后,才能报告它们通过。diff --git a/docs/zh/references/layering.md b/docs/zh/references/layering.mdnew file mode 100644index 0000000..8a1093c--- /dev/null+++ b/docs/zh/references/layering.md@@ -0,0 +1,83 @@+# 明暗、颜色与图层配对++先规划观众在标准镜头中能读出的三样东西:一个短促的亮点、一个有形状的主体,以及一个能衬出主体的暗面或物质。+每增加一层都要说出它解决的是哪个可见问题;层数不是质量指标。++## 先定调色板职责++| 职责 | 应该看到什么 | 第一种调法 |+|---|---|---|+| core | 一小块最热的区域或一条细热边,接触时清晰 | 先控制尺寸和时长,再考虑加 emissive |+| body | 能认出元素和动作的饱和轮廓 | 白闪退出后保留形体;冷却它的颜色而不是把它去掉 |+| dark | 衬底、凹面、裂口或真实的阴影 | 用 Blend,并检查亮背景和暗背景;黑色 Add 做不了这件事 |+| matter | 烟、灰尘、碎片、液滴 —— 重量 | 降低饱和度,保留内部明暗和可见的退场 |+| accent | 一小块第二色线索 | 给它一个位置或阶段,再检查它没有抢走主色 |++主色可以是单一色,也可以是一组相邻色。第二种颜色需要有用途(冰的棱镜边、毒的暗核);绝不每层选一种颜色,+也不强制使用互补色。火旁边的烟可以先经过暖色再变灰,但不要把所有烟都重新涂成饱和的橙色。++先在灰度下看明暗,再看色相。如果核心、主体和背景都接近白色,加橙色粒子也恢复不了结构。先找出是哪一层先把画面推白:+接触、某个光晕、主体,还是多个 Add 层重叠。++## 三种副本承担不同的工作++| 做法 | 几何与时间关系 | 用途 | 典型错误 |+|---|---|---|---|+| 暗衬底(`shadow()`) | 独立的形状,可以略大,与主体大致同阶段 | 衬出亮色;提高亮背景下的可读性 | 一团黑吞没主体(看成黑洞);在暗舞台上看不见 |+| 明度配对(`contrast_pair()`) | 完全相同的轮廓、固定角度、相同的运动和出生时刻 | 在一个形状内部增加明暗结构 | 两个随机轮廓漂开,变成两条无关的笔触 |+| 烟化残影(`decay()`) | 可以延迟、更慢、更长,颜色和混合方式不同 | 光熄灭后留下物质 | 一道暗色刀弧长时间悬挂,看起来像一块脏拖影 |++`decay()` 不是几何完全一致的明度配对。++确定性的配对要固定 `count=1`、life、size、rotation、position、spin、travel 和 flipbook 起始帧。不同的粒子节点各自取随机值:+相同的范围和同一个全局 seed **不能**保证取到相同的角度。需要很多方向时,由外层选定一个固定角度,两个节点都使用这个固定值;+绝不要分别给每层 `[0,360]`。++严格的配对保持相同的寿命和归一化曲线。延长寿命也会移动到达生命周期 50 % 的实际帧,于是缩放和扫掠就会错开。+想让暗层更晚退出,要显式重算它的曲线,或者把它做成独立的残影,不再称它为匹配的轮廓。++本机实测:后面的层画在前面,Model 的 ZWrite 不能提供这里的遮挡 —— 用绘制顺序。先画 Blend 暗副本、再画 Add 亮主体是一个起点;+画在前面的暗色切口和画在后面的暗色衬底是两种不同的设计,要看渲染结果决定。++```python+from vfxkit.primitives import *++body = sprite('Matched burst', 'T_Explosion01', (255, 120, 30, 255),+ life=16, delay=3, size=2.0, rotation=[0, 0, 30],+ size_curve=[[0, .8], [30, 1], [100, 1.1]],+ color_curve=ramp((0, (255, 120, 30, 255)), (100, (180, 35, 10, 0)))['color_curve'],+ alpha_texture='T_NoiseTile01', cutoff=[[0, 0], [100, .8]],+ fade_in=0, fade_out=4, emissive=1.2)+layers = contrast_pair(body) # [Blend dark underlay, the bright body]; splice into effect(..., [*layers, ...])+```++两层共享几何和时钟,只在颜色和材质上不同。alpha、混合和 cutoff 仍会改变实际边缘,所以要检查渲染;不保证像素级重合。+30° 是演示用的角度,不是这张纹理的朝向:运行 `vfx texture-info`,按实测角度确定动作方向。这个辅助函数只处理一个 Sprite;+Ring 和 Model 的配对要显式设计。++## 尺寸与寿命的起点++以主体的**可见宽度 B** 和**寿命 L** 为基准,而不是 sprite 卡片的尺寸:只含一根细线的纹理,与同样大小的满卡分量并不相同。++| 层 | 起点 | 如何确认 |+|---|---|---|+| 热核心 | 约 0.2–0.5 B 宽,或主体的一条细边 | 峰值时能找到核心,之后仍能找到主体 |+| 暗配对 | 与主体同尺寸、同寿命 | 如果尺寸改变,重新决定它是切口还是衬底 |+| 独立衬底 | 略大,约 1.1–1.4 B | 主体外面没有形成一圈干净的黑色圆 |+| 暗残影 | 约 1.1–1.2 L | 亮层消失后,留下一小段刻意的层 |+| 烟化残影 | `decay()` 给出的更长寿命 | 退场时仍在变形;不是一道静止的暗弧 |++这些是调试起点,不是统计结论,也不是 lint 规则。斩击和持续光柱可以用细长的热边;治疗和护盾不需要攻击式的白闪。+曲线匹配、负空间和标准镜头比这些比例更重要。++## 白团与黑团的修复顺序++主体被白色填满时:逐个关掉光晕、接触和重复的 Add 层,定位原因;然后缩短接触;然后削减主体持续时间过长的高亮段;+最后再加暗色。不要同时改纹理、曲线、烟雾和镜头抖动 —— 那样你不会知道是哪一项起了作用。++暗层读起来像一条独立的黑色笔触时:先检查角度和尺寸是否对齐,然后检查出生时刻和寿命,最后才是灰度值。+不要用降低不透明度来掩盖错误的几何。如果在亮背景上成立而在默认舞台上不成立,给物质层一个合适的灰色或局部受光的颜色,+同时保持 dark 和 matter 两种职责的区分。++完成的一轮可以用一句话加上你看过的帧号说出改善点,例如"f12 之后白闪已经消失,橙红色火球保持住了轮廓"。+参见 [火焰爆炸案例](cases.md#火焰爆炸一直不退的白色接触)。diff --git a/docs/zh/references/motion.md b/docs/zh/references/motion.mdnew file mode 100644index 0000000..b5e1a1e--- /dev/null+++ b/docs/zh/references/motion.md@@ -0,0 +1,32 @@+# 运动与路径++飞行体规划三种职责:跟随 handle 的**头部**、留在世界空间中的**拖尾**,以及从路径上掉落的**脱落粒子**。用 `sustain()` 发射,+用 `inherit=TRAIL` 保留拖尾;到达时游戏调用 `stop_root()`,它们会自然消散。头部需要清晰的轮廓;拖尾在长度和明暗上要有区别;+发射瞬间的一条速度线或一个短环能帮助观众读出速度。++斩击用真实的平面和扫掠(`swing()` + `slash_arc`)展示路径,然后沿弧错开次级发射。次级粒子用缓动的 `travel` 从快到慢;+Drag 不会衰减 PVA 速度(见 [引擎约定](engine-conventions.md))。写 `travel` 之前先算清旋转后的局部坐标轴:球形发射和圆形发射的径向轴不同。++分开诊断体积和路径:细拖尾可以没问题,但头部不能变成没有体积的点。飞行体自己的连拍在到达时结束,不包含命中;+Lab 的正常播放会展示完整的配对。++运动不只是缩放。用扫掠、侵蚀、UV 流动、旋转枢轴和变形改变主形状;按元素方向组织碎片、烟雾和微粒:冰先停顿再碎裂,暗向内吸,+火上升,毒缓慢下沉 —— 每一种都要有连续帧支撑。++运行时提供直线和抛物线(`arc`)路径。曲线路径、齐射或持续光束需要先写简报并扩展运行时;绝不要告诉用户本技能没有的工具或 API 存在。++## 把速度放进形状和节奏++| 可见问题 | 先检查 | 先改什么 |+|---|---|---|+| 飞行体看起来像漂浮的球 | 发射时有没有方向变化和速度载体? | 短的后掠风线、方向性火花或长度不同的尾巴 |+| 拖尾看起来像塑料管 | 是否宽度均匀、颜色平、所有层寿命相同? | 给纹理留负空间;把短的热尾和长的柔和尾分开 |+| 火花匀速漂浮 | `travel` 是否先快后慢? | EaseOut,然后由重力或轻微运动接手 |+| 斩击像贴在镜头前的贴纸 | 有没有真实的倾斜平面、扫掠和跟随它的发射? | 先修平面和扫掠,再沿弧错开细节 |+| 碎片像规则的烟花 | 尺寸相同、出生帧相同、球形对称? | 分档尺寸和节奏;沿动作方向组织主运动 |++速度载体的存在是为了让观众读出方向;它不必是一组新粒子。如果拖尾或形状已经起到这个作用,就保持简单。元素可以停顿,+但停顿必须引出一个明确的动作:冰晶停止生长然后碎裂;暗能量汇聚然后释放。++相同的角度范围并不能让亮粒子和暗粒子对齐。几何配对使用固定参数;用 [layering](layering.md) 中的步骤诊断运动错位。+烟化残影可以刻意按不同的节奏运动,但要在简报中写明。diff --git a/docs/zh/references/primitives.md b/docs/zh/references/primitives.mdnew file mode 100644index 0000000..0446e0c--- /dev/null+++ b/docs/zh/references/primitives.md@@ -0,0 +1,86 @@+# 配方代码与基元++目录:配方文件 · `effect()` 字段 · 基元 · 辅助函数 · 层字段 · 单位++## 配方文件++一个文件一个效果:`vfx/src/VFX_<Name>.py` 定义 `recipe()`,返回 `effect('<Name>', ...)`。ID `VFX_<Name>` 必须与文件名一致。+以 `_` 开头的文件是共享辅助模块(`from _palette import *`)。每条命令都会重新加载源码。`from vfxkit.primitives import *`+会引入所有基元、下面的辅助函数,以及 `WHITE`、`fade`、`ramp`、`walk` 和 `math`。++每个基元都返回一个普通的 layer dict;用 `| dict(...)` 覆盖或添加任意字段。纹理按文件名主干命名(`'T_Glow01'`),+在 `vfx/textures/processed/` 中解析。层按列表顺序绘制:**后面的层画在上面**(Godot 插件在效果层之间忽略 ZWrite)。++## `effect()` 字段++`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None)`++| 字段 | 含义 |+|---|---|+| `category` | `hit`、`slash`、`projectile`、`element`、`status`、`boss` 等(决定 lint 预算) |+| `element` | `physical`、`fire`、`ice`、`lightning`、`dark`、`holy`、`poison` 等(用于元素差别和运动检查) |+| `duration`、`peak` | 秒;`peak` 是 Lab 闪光、镜头抖动和目标反应所用的接触/释放时刻 |+| `attach` | 锚点:`ground`、`body`、`impact`、`caster`、`caster_ground`、`projectile` |+| `impact`、`light` | Lab 舞台闪光和镜头抖动的强度(0–1)和 RGB(仅用于演示舞台) |+| `delivery` | 游戏如何演出它:`SELF`、`MELEE`、`TARGETED`、`dict(kind='area')`;飞行体本身用 `dict(kind='projectile')`,它的命中用 `dict(kind='projectile', projectile='VFX_X')` |+| `flight`、`arc` | 仅飞行体:参考飞行秒数和抛射高度(米) |+| `design` | 一句话描述玩家看到什么;显示在 Lab 中,并提供给评审 |++## 基元++**先想体积,再想纹理。** 主体、冲击波、晶体和光柱应该是位于倾斜 3D 平面中的网格或环,而不是面向镜头的卡片。+面向镜头的 sprite 留给本来就属于屏幕空间的东西:接触星芒、光晕、火花和烟团(叠加出体积)。++| 基元 | 用途 | 关键原生功能 |+|---|---|---|+| `flash` / `glow` | 接触星芒、形状下方的柔和光晕 | 单值 F-Curve 缩放 |+| `shadow` | 加色核心后面的暗衬底 | Blend 柔和圆盘,在闪光后 1–2 帧达到峰值 |+| `radial_sparks` | 火花、针刺、上升条纹 | 球形/圆形发射 + 缓动的 `travel` + DirectionalBillboard |+| `spark_burst` | 三档的命中/爆炸火花 | 长而快的条纹(6–10 帧)、主体、约 20 % 的重火花,给定 `floor` 时会弹跳 |+| `motes` | 余烬、冰尘、魔法微粒、向内汇聚 | 同上 + 湍流力场 |+| `shock_ring` / `tilted_ring` | 冲击波、上升光环、收缩环;位于 3D 平面中的环 | Ring 渲染器,内径缓动;近战倾角 `(0,58,0)` 横跨从左到右的打击 |+| `slash_arc` | 刀弧 | Crescent Ring,起止角缓动扫掠 + 溶解 |+| `wisps` | 断续的能量笔触、漩涡丝、贴地火舌 | Crescent Ring + `T_WispTrail01`,每次发射随机倾角和尺寸,侵蚀从大于 0 开始,因此绝不会是完整的环 |+| `orbit_band` | 吸积盘、环绕的符文环 | 倾斜平面中的 Ring,噪声绕环流动;`arc=(-90,90)` 为远半环,`(90,270)` 为近半环 |+| `smoke` | 烟、雾、尘、暗色残留 | 手绘烟雾序列帧 `T_SmokeSheet01` + 轻度侵蚀;单张静态烟团用 `texture='T_Smoke02'` —— 冰雾保留静态烟团,以区别于火的翻滚烟雾 |+| `billow` | 火球、与烟相同的翻滚团块 | 单次播放的手绘 4×4 序列帧 `T_ExplosionSheet01` + `ramp` 颜色节点 |+| `flame` | 火舌、火墙、地面火 | 从底部生长的爆炸序列帧,从白 → 本色 → 暗色冷却,被噪声侵蚀并带热边(不用剪贴画式的火焰剪影) |+| `decal` | 法阵、裂纹、焦痕 | 地平面 sprite,开启深度测试 |+| `standing` | 尖刺、闪电、光束 | 以底部为枢轴的 YAxisFixed sprite |+| `column` | 光柱、光环 | 程序化圆柱 + 滚动条纹 + 静态 alpha 渐变 + fresnel |+| `mesh` | 球体、圆锥、圆柱 | 程序化模型 + falloff;额外的程序化字段用 `model={...}` |+| `crystal` | 冰刺、碎片、冰枪 | 收尖的六棱圆柱 + 细胞纹理 + fresnel 边缘 |+| `shell` | 冲击泡、内爆、释放 | 只绘制正面,fresnel `pow<1` 只照亮边缘,缓动扩张 |+| `shell_fragments` | 壳的真实几何破碎 | 六片部分球面(AngleBeginEnd),彼此分离并翻滚 |+| `heat_haze` / `distortion_ring` | 热浪扭曲、折射冲击波 | `BackDistortion` 屏幕折射 |+| `slice_line` | 释放时的长细线 | `T_Streak01` 从 35 % 射到全长,同时变细;`width` 是可见粗细 |+| `spray(end)` / `debris` | 沿射击方向的定向喷射、翻滚的暗色碎块 | 不旋转的发射 + 世界方向的 `travel` 盒;Blend `T_Shard01` 带重力,可以落地 |+| `decay(layer, color)` | 光 → 灰烟残影 | 复制为 Blend 灰色,晚 `lag` 帧,寿命 × `stretch`,无 emissive,流动更慢 |++## 辅助函数++| 辅助函数 | 含义 |+|---|---|+| `ramp((0,c0),(30,c1),(100,c2))` | 用 3–5 个节点描述随寿命变化的颜色 → `color_curve`(两色插值读起来只是一层色调) |+| `fade(color, alpha=0)` | 相同的 RGB,新的 alpha |+| `POP`、`DISSOLVE` | 先弹出再缓慢漂移的缩放曲线;先保持再侵蚀的 cutoff 曲线 |+| `sustain(layer, interval)` | 飞行体发射器:每 `interval` 帧一个实例,直到释放 |+| `TRAIL` | 只在创建时继承位置/旋转/缩放:该层留在路径上 |+| `slash_set(colors, roll, sweep=(110,260), radius=1.5, offset=(0,0,.5), lean=-18, delay=1, life=14)` | 一把刀刃的三种宽度:晚两帧出现的宽而暗的残影、饱和的主体、细的白热边(`slash_arc`),一道折射弧,以及一个手绘赛璐璐月牙(`T_Slash02`,`billboard='Fixed'`,位于刀刃所在平面,按实测的 `SLASH02_BULGE` 旋转);`colors` = (残影, 主体, 热边) |+| `swing(layers, yaw, pitch=0)` | 把刀刃层包进一个 `renderer='None'` 枢轴,让弧在 3D 空间中劈过;约 ±30–40° 的 yaw 读起来是椭圆,而不是屏幕上的月牙 |+| `contrast_pair(layer)` | 一个固定的 sprite 加上一个几何完全一致的 Blend 衬底(见 [layering](layering.md)) |+| `lifetime(layer)`、`budget(layer)` | 一个层或其子层可能存活的最后一帧;实例数 |++## 层字段++除 PVA、缩放和颜色之外,编译器还支持:`collide`(地面弹跳)、`soft`(见引擎约定)、`size` / `size_end` / `size_curve`(统一缩放)、+`color_end`、`color_curve`、`travel`(缓动位移)、`spawn`(球形、圆形、线形发射器)、`forces`(重力、湍流、涡旋)、+`alpha_texture` + `cutoff` + `edge`(带热边的溶解)、`distortion_texture`、`blend_texture`、`falloff`(fresnel)、`flipbook`、`pivot`、+`ring{...}`、`inherit`、`track_size`、`material`(`BackDistortion`)、`children`。`vfx layer-schema` 列出所有接受的键;+未知的键会报错并给出拼写建议。其他任何东西都必须连同 save/open 回读测试一起加进编译器,而不是在配方里写裸属性路径(流程见 [引擎约定](engine-conventions.md#扩展编译器))。++## 单位++层的 `life`、`delay`、`interval`:60 FPS 帧数。速度和加速度:单位/帧;重力:单位/帧²。角度:度。颜色:RGBA 0–255。+曲线(`size_curve`、`cutoff`、`color_curve` 等):`[[percent_of_life, value], ...]`。manifest 的 `duration` 和 `peak`:秒。+随机范围写作 `[min, max]`。diff --git a/docs/zh/references/reference.md b/docs/zh/references/reference.mdnew file mode 100644index 0000000..f316583--- /dev/null+++ b/docs/zh/references/reference.md@@ -0,0 +1,16 @@+# 对照参考视频++需要 `ffmpeg` 和 `ffprobe`。只使用用户提供的或允许使用的视频;记录它们的来源。++1. `vfx reference-import <clip.mp4> --start 0 --end 2 --slow 2 [--roi x y w h] [--source-url <url>]` 最多解码 30 秒媒体时长,+ 写入被忽略的 `vfx/work/references/`。`--slow 2` 表示视频以半速播放,因此效果时间 = 相对 `--start` 的视频时间 ÷ 2。+ 打开返回的 `overview` 图片。把参考 ID 和时间写进简报的 `reference` 字段。+2. 按顺序阅读带标签的帧,把预兆、接触、主体、次级运动和退场写进简报的 beats。需要细节时,对一小段使用+ `vfx reference-frames <reference_id> <start> <end> --count 8`,而不是重新载入整个视频。如果不知道视频的速度而节奏又依赖它,就去问。+3. 复查之后,`vfx reference-compare <reference_id> <evidence_id> --times 0.1 0.3` 把参考时刻与精确采集到的 Godot 帧配对+ (缺失的帧用 `vfx review --key-frames` 补采)。对比节奏、轮廓、画面占比、饱和主体、暗层和残留。每个视图保留自己的宽高比和时间标签;+ 绝不用未说明的裁切或缩放把它们"做成一样大"。++这种分析是近似的:压缩、背景和泛光会改变像素;镜头移动或剪辑会污染变化区域。镜头移动时,使用手动关键帧和明确的 ROI。+不要从视频推断世界尺寸、emissive 数值、粒子数量或看不见的纹理;在简报中标明近似值。参考观察指导形状和节奏;+它们绝不能推翻本引擎实测的单位、UV、HDR 和继承规则。diff --git a/docs/zh/references/review.md b/docs/zh/references/review.mdnew file mode 100644index 0000000..f9a82d8--- /dev/null+++ b/docs/zh/references/review.md@@ -0,0 +1,97 @@+# 复查循环、证据与交付++静帧无法展示节奏。每次修改之后:`vfx lint`、`vfx build --ids <ID>`、`vfx review --ids <ID>+--note "<one problem, one change>"`(`--note` 写一个问题、一个改法),然后**打开图片**。++目录:review 产出什么 · flags · 阅读连拍图 · 轮次与历史 · 独立评审 · 验证 · 变体 · 采集行为++## `vfx review` 产出什么++Godot Lab 在隐藏 UI 的真实 viewport 中渲染效果,使用对战站位(两个假人站在平台两端;效果按其 `delivery` 演出)。+帧号从效果本身开始的那一帧算起(出拳、施法、飞行体到达);假人保持待机姿势。飞行体连拍在到达时结束,不包含它的命中;+命中连拍保持同一落点和到达时刻,但不含前导飞行体的残留。命令返回:++- `sheets` —— 全时间轴连拍图 `vfx/previews/strips/<ID>.png`(最多 18 格;关键帧从不被丢弃);+- `compare` —— `<ID>_compare.png`,存在上一轮连拍时生成,上方是上一轮,下方是当前轮;+- `details.<ID>.sheet` —— 关键帧拼图(接触前后、简报 beats、主体、退场和 duration 之后的检查帧),以及+ `details.<ID>.frames` —— 原尺寸帧;+- `flags`、`changes`(与上一轮相比新增或消除的 flag 类型、移动了的关键时间)、`metrics`、`history`,以及本次采集的 `evidence` ID。++之后可以用 `vfx strip <ID> [--compare]`、`vfx frames <evidence_id> <frames...>` 和 `vfx history <ID>` 重新读取。+有对比图时先看对比图。++## Flags++像素指标是相对空舞台的"变化能量",因此一大片淡烟和一个小白闪可以相互比较。它们是辅助阅读的工具,**不是** GPU 或 overdraw 测量。++| Flag | 含义 | 先怎么修 |+|---|---|---|+| `barely visible` | 最强一帧时舞台变化不到 0.25 % | 主体太小或太暗 |+| `dead tail` | 最后 35 % 中没有任何一帧超过峰值能量的 5 % 或舞台变化 0.25 % | 缩短 `duration` 和尾部寿命,或让消散可见 |+| `blown out` | 超过两个采样帧中纯白超过 10 % | 缩小光晕,降低 emissive |+| `cut off` | 最后一帧仍然清晰可见 | duration 太短 |+| `off-peak contact` | 最白的一帧与 manifest 的 `peak` 相差超过 6 帧 | 移动接触或 `peak`;否则 Lab 的闪光和镜头抖动落在别处 |+| `lingering flash` | 接触前后接近峰值的白色持续超过 12 帧 | 接触应为 2–5 帧;持续的热主体(光束核心、尖刺)不算 |+| `no white-hot core` / `washed out` | 峰值时几乎没有像素超过 85 % 亮度 / 几乎没有饱和的中间调主体 | 加热核心 / 恢复主体的饱和度 |+| `sinks`(仅火) | 接触后团块向下移动 | 火应该上升 |+| `expands while charging`(仅暗) | 释放前半径变大 | 暗应该向内吸 |++阈值是在真实效果库渲染上逐格校准的;理由写在 `scripts/vfxkit/review.py` 的开头。只有在检查过真实连拍之后才能修改阈值,+并在那里补一行理由。++## 阅读连拍图++只有 flag 不算复查。在连拍图和关键帧拼图中问:++1. 从第一个亮起的格子能看出这是什么效果吗?接触是否是最亮的时刻,且只有几帧?+2. 主形状是在侵蚀或扫掠,还是只在缩放和淡出?+3. 次级粒子是否先快后慢,并沿元素的方向运动(火向上、冰向下、暗向内)?+4. 弧、光柱和地面贴花是否位于假人身上或脚下,而不是偏在一旁或悬空?+5. 在亮背景(`--bright`)上,alpha 混合的层是否仍然成立?++看尾段时,看最后三分之一的中间,而不只是最后两格;用 `vfx frames` 取实际帧,或用 `--key-frames` 补采更多时刻。+一个孤立的烟团证明不了整个退场。++## 轮次与历史++每一轮修**一类问题**,并在 `--note` 中写明;note、flags 和关键时间会追加到 `vfx/previews/strips/history/<ID>.jsonl`。+开始新一轮之前阅读历史(`vfx effect-context <ID>`),不要重复证据已经否定的改法。每个效果迭代 3–5 轮;+达到上限仍未通过时,报告未解决的项目,而不是称其完成。++## 独立评审++作者从不给自己的效果打分。`vfx review-handoff <ID>` 会把针对最新一次新鲜采集的完整评审简报写到 `vfx/work/handoff/<evidence_id>.md`:+连拍图和关键帧图片、采集到的帧号、manifest 条目和 flags、一份评分表副本、**vfx-review** 技能的路径(当它安装在本技能旁边时),+以及报告的写入位置。只把这份简报交给另一个 agent,不给其他任何东西:子 agent(告诉它的内容不超出简报),或宿主没有子 agent 时+由用户打开的新会话。不给配方代码。它把 JSON 写到 `report_file`:++```json+{"id": "VFX_X", "scores": {"read": 2, "timing": 3, "layering": 2, "shape_change": 2, "motion": 2, "placement": 3, "tail": 2, "identity": 3},+ "worst": "shape_change", "fix": "one concrete change in recipe terms", "verdict": "ship"}+```++任何一项低于 2 分时 `verdict` 为 `iterate`;`worst` 必须是一个得分最低的项。把它保存为文件,并用 `review-handoff` 返回的命令绑定:+`vfx review-submit <evidence_id> <report_file> --reviewer <reviewer id>`(`--frames` 默认取报告中的 `observed_frames`)。+工具会校验结构、新鲜度和所看帧号;它无法证明评审的独立性 —— 宿主(你)必须真正把它隔离。如果结论是 `iterate`,下一轮就采用它给出的那一个修改。++## 验证++`vfx overview` 把最新的标准采集拼成 `vfx/previews/strips/overview_*.png`。+`vfx effect-verify <ID>` 检查展开后的当前配方、输入纹理、Core 回读、构建出的资源、Lab 舞台和图片是否都与通过的那次评审所看到的一致,+并检查总览页是否包含这次采集。只有 `verified: true` 才算完成。截图存在、没有 flag 或退出码为 0 都不是质量通过。+对配方、纹理、简报或 Lab 的任何修改都会让旧证据失效;更新 Lab 模板之后,先运行 `vfx init --update-templates`。+运行时行为需要单独的 API 检查(`TestApi.gd`,见 [godot](godot.md));设备性能需要设备上的证据。++完成之后,把效果库(`vfx/src`、`vfx/briefs`、纹理、配方 JSON、`.efkefc`、`.efk`、manifest、总览页和 `metrics.json`)一起纳入版本控制。+逐帧采集、日志、receipt 和单效果连拍图留在本地(`init` 写入的 `vfx/.gitignore` 会处理这些)。++## 变体++`--view close` 只改变检查用的镜头;`--profile bare` 关闭 Lab 的泛光、打击灯和镜头抖动,用来单独判断效果本身;`--bright` 使用亮背景。+每种变体分开保存,绝不覆盖 standard/default 基线及其 metrics;验证所用的基线是 standard/default。++## 采集行为(macOS)++复查期间用户可能正在使用这台机器:macOS 会停止绘制被完全遮住的窗口,而 Godot 启动时会抢走焦点。在采集模式下,Lab 让窗口保持置顶,+停在右下角只露出一小部分(viewport 仍以 1280×800 渲染),忽略键盘输入和关闭请求,复查结束后把焦点交还给之前的应用+(每次启动约有 0.2 s 的闪烁)。提前退出或从未播放的效果会被重新采集(最多 3 次)。diff --git a/docs/zh/references/shapes.md b/docs/zh/references/shapes.mdnew file mode 100644index 0000000..a796cf7--- /dev/null+++ b/docs/zh/references/shapes.md@@ -0,0 +1,32 @@+# 体积与遮挡++先决定主体的体积:冰刺是晶体,光柱是程序化圆柱,冲击波是倾斜的环或薄壳,吸积盘是远半环 + 核心 + 近半环。+面向镜头的 sprite 留给闪光、烟雾和本来就应该朝向镜头的形状。在标准镜头和可选的近景(`vfx review --view close`)中检查,+但效果库的基线仍然是标准的对战站位。++本机实测:球体的 depth 与圆柱的工作方式不同(球体用 scale 控制尺寸);Cone 尖端的方向不能靠猜(晶体用带端部半径的 Cylinder);+Model 层不能依赖 ZWrite,因此遮挡取决于列表顺序。Fresnel 的 `begin`/`end` 和 `pow` 的行为如 [引擎约定](engine-conventions.md)+中所记录,而不是像它们的名字暗示的那样。++大型的壳和柱不能变成半透明的实心穹顶。先检查轮廓、内部透明度和角色可见性,再看亮度;满屏光晕掩盖不了形状问题。+暗核必须在默认舞台上可读,也要检查亮背景(`--bright`)。++优先使用现有的 Ring、Model、UV 滚动和溶解功能。自定义网格是之后的资产路径:先证明没有任何基元能表达这个形状,+再验证导出、UV 以及资源能随包一起带走。绝不为了绕开未经验证的假设去修改官方渲染器。++## 从标准镜头出发选择体积++| 主形状 | 这里可用的构造 | 要检查的空间关系 |+|---|---|---|+| 斩击 | 带倾斜 Ring 的枢轴,或固定平面的弧 | 弧穿过动作点,内侧留有空间 |+| 爆炸 | `billow`、上升的主体、倾斜的波和地面物质 | 有落点和高度;近层和远层分开 |+| 暗核 | 按顺序:远半环、核心、近半环 | 前半部分从核心前面经过,后半部分被核心挡住 |+| 冰晶 | 带尖端的六棱柱、碎片和冷雾 | 尖端方向和棱面受光不同;碎裂不只是亮点 |+| 持续的壳 | fresnel 轮廓、表面运动、碎片退场 | 壳内的角色、壳表面和背景都可读 |+| 光柱 | 圆柱、静态 alpha 渐变和滚动条纹 | 顶部和底部自然淡出;主体上没有 UV 接缝 |++在标准镜头里,贴地的低矮环可能只读成一条细线,精致的近景细节在战斗距离上可能消失。先建立横向或向上的体积,再加更多表面纹理。+近景帮助发现问题;它不能代替标准镜头来判断尺度。++当层前后重叠时,先安排绘制顺序,再在图像中验证。画在所有碎片前面的完整壳轮廓会把本该出现的间隙重新封上;+画在火焰前面的暗烟会挡住本该留下的饱和主体。几何正确,也可能因为顺序而读错。diff --git a/docs/zh/references/skeletons.md b/docs/zh/references/skeletons.mdnew file mode 100644index 0000000..823b145--- /dev/null+++ b/docs/zh/references/skeletons.md@@ -0,0 +1,81 @@+# 类别骨架++骨架给出层的职责和时间关系;按游戏的风格删减。先选一个主形状,再只加它需要的辅助层。轻击可以非常简单;终结技可以有好几个阶段。+下面每个类别都有一个完整、经过独立评审的示例(`vfx examples show <name>` 打印它带绝对帧号和职责的层计划;+`vfx examples add <name>` 把它复制到项目中):`hit`、`slash`、`charge`、`shield`、`heal`,以及飞行体 + 命中配对+`fire`、`ice`、`poison`、`dark`。++## 命中++参考:示例 `hit`(`VFX_Hit_Heavy`)。集中在接触点的短预兆,一个短暂的闪光,先出一个锯齿状爆点,然后是方向性的速度线和分档火花,最后以灰尘或少量烟收尾。+白闪让接触被感受到;主体传达力量。并不是每次命中都需要大环和黑烟。++| 职责 | 基元 | 替代方案 |+|---|---|---|+| 预兆 | 收缩的 `glow` | 几条向内的线 |+| 接触 | `flash` | 一个带轮廓的短促热形状 |+| 主体 | 手绘爆点 `sprite` 配 `POP` + `DISSOLVE`,`tilted_ring(..., tilt=(0,58,0))` | `shell` 空气泡 |+| 次级 | `spark_burst`(两到三档,一个喷射方向) | 带 `spray` 的 `radial_sparks` |+| 退场 | `smoke` 灰尘、`motes` 余烬 | 快速下落的灰尘;一次命中绝不持续数秒 |++如果峰值之后只剩细针,就延长或加强主体。如果看起来像烟花,先收窄发射方向和 `travel` 方向,而不是加粒子。预算 ≤ 60。++## 斩击++参考:示例 `slash`(`VFX_Slash_Fire`)。用 `swing()` 枢轴定义一个倾斜的挥砍平面,偏航约 ±30–40°,让弧读起来像一个劈过空间的椭圆;+`slash_set()` 把残影、主体和热边放在其中(三种宽度的 `slash_arc`:晚两帧的宽而暗的残影、饱和的主体、细的白色热边),+在刀刃后面加一道折射弧,以及一个保持几帧的手绘赛璐璐月牙。月牙是 `billboard='Fixed'`,位于刀刃自身的平面中(相同的 lean),+按纹理实测的弧顶凸出(`SLASH02_BULGE`)旋转,因此它随挥砍倾斜,而不是面向镜头。火花沿弧错开出现。火的退场是剥落的火焰和上升的余烬,物理是短促的金属火花,冰是停顿之后碎裂。+换元素改变的是运动和材质,而不只是颜色。++保留层与层之间弧内的负空间。目标胸口只是放置锚点:弧的视觉中点还取决于纹理的弧顶凸出、旋转和枢轴 —— 用 `vfx texture-info` 实测。+如果尾段仍是一整道月牙,先修扫掠和侵蚀,再考虑加烟化残影。++## 爆炸++参考:示例 `VFX_Fire_Explosion`。Gather 和 Inward fuse 在目标处收紧,短促的 Detonation flash 释放,Fireball 和上升的+Mushroom 接替,方向性的碎片和火花传递冲击,Smoke billow、灰尘和地面痕迹给出重量。++闪光之后火焰必须保持饱和的体积 —— 不能只是一个扩张的环或很多小亮点。次级运动沿射击方向、地面或向上组织;不要所有层都做同样的球形运动。+烟画在火的后面,接替冷却后的形状;如果烟盖住了中心,先检查顺序和密度。地面痕迹说明它落在哪里,上升的体积说明它喷发了;+更大的满屏光晕无法替代其中任何一个。看 f18–42 的交接和 f54–66 的烟,而不只是峰值。++## 飞行体++参考:配对 `fire`、`ice`、`poison` 和 `dark`(`VFX_Projectile_Fire`、`VFX_Projectile_Ice`、`VFX_Projectile_Poison`、+`VFX_Projectile_Dark`)。头部层(Fireball、Hot core)跟随 handle;+Comet tail 给头部方向感;Flame trail、Smoke trail 和 Embers 使用 `inherit=TRAIL`,留在路径上。宽拖尾、细热线和短促的脱落粒子+需要不同的寿命;头部和路径都必须可读。++检查发射、飞行中段、到达、到达之后和清空。飞行时间固定时,拖尾密度由发射间隔和粒子寿命共同决定。改变头部的继承方式会改变空间关系 ——+不要用拉长拖尾来掩盖僵硬的管子。命中是配对效果:分别复查飞行体连拍和命中连拍,在 Lab 中看完整的交锋。预算 ≤ 100。++## 蓄力与释放++参考:示例 `charge`(`VFX_Magic_Charge`):约一秒的向内蓄积(f0–64),一次释放 f64–70,释放火花持续到约 f86。+`travel` 为负的 `motes` 和 `radial_sparks` 向内汇聚,两个位于不同倾斜平面的 `orbit_band` 环建立体积,核心和光环逐渐积累,+释放闪光、`shell` 和火花给出一次清晰的释放。镜头和舞台反馈可以加强释放,但汇聚本身必须可读。++只在 Z 轴旋转、内部没有流动的环会变成一个旋转图标;用 UV 流动(`alpha_scroll`)、倾斜平面和向内的 travel。+如果释放很大而预兆很弱,先建立一条可见的汇聚路径,而不是把所有亮度都调高。++## 护盾与持续状态++参考:示例 `shield`(`VFX_Shield_Dome`)以及 [cases](cases.md) 中的护盾案例。一个短促的升起闪光,一个 `mesh` 球体 `shell` 加边缘提供持续体积,表面流动、扫描带和闪光让保持段保持生动。结束时整个壳交接给带真实间隙的+`shell_fragments`;碎片运动和颜色衰减构成退场。++稳定不等于每帧闪烁,也不等于一个整球一下子关掉。先检查壳内的角色是否可读,再看表面流动和退场。六片球面碎片是这里已验证的方案;+其他材质能否真正溶解,必须单独测试。++## 治疗与增益++参考:示例 `heal`(`VFX_Heal`)。地面 `decal` 法阵说明归属,`column` 建立缓慢上升的体积,上升的环、符号和生命 `motes` 承载含义,光晕和闪烁星点收尾。+不要把治疗做成带剧烈白闪和爆裂碎片的攻击。它可以柔和或脉动,但必须保持轮廓,并在标准镜头中可见。+白色峰值不是这一类别的合格标准;使用评分表中按用途的例外。++## 使用示例代码++`vfx examples show <name|ID>` 打印带绝对帧号和职责的完整层计划;`vfx examples add <name>` 把源码、简报和手绘纹理复制到项目中。+想保留示例作为基线时,用新 ID 改编一份副本,而不是直接修改示例。示例的历史分数描述的是本技能自己的渲染,不是你的构建:+任何修改之后都要重新构建、复查并再次取得独立评分。有两个示例被判为 `iterate`(见 `vfx examples`,`historical_review.worst`);+它们仍能教会各自的模式,而它们最弱的地方正好是不错的第一个练习。diff --git a/docs/zh/references/textures.md b/docs/zh/references/textures.mdnew file mode 100644index 0000000..4dd1402--- /dev/null+++ b/docs/zh/references/textures.md@@ -0,0 +1,70 @@+# 纹理职责、生成与验收++先选职责,再写提示词,然后生成。**复杂的手绘形状** —— 烟、斩击弧、火焰主体、裂纹、冰、符号 —— 来自**图像生成模型**。+**数学形状** —— 光晕、环、噪声、渐变、拖尾带、RG 扰动图 —— 是程序化纹理(`vfx procedural` 重新生成它们;名称见+[primitives](primitives.md))。`vfx init` 还会安装一套基元默认使用的入门手绘纹理,共七张 —— `T_SmokeSheet01`、+`T_ExplosionSheet01`(4×4 图集)、`T_WispTrail01`、`T_Smoke02`、`T_Explosion01`、`T_Crack01`、`T_IceShard01` —— 并附带它们的提示词。`vfx examples add` 会随使用它们的示例再安装四张(`T_Impact01`、`T_Slash02`、`T_Rune02`、`T_Vortex01`)。+本技能的 `assets/examples/texture_prompts.json` 还收录了一些它不随附的常见手绘形状的提示词模板(斩击月牙、火舌、闪电、符文法阵、+冰刺、火焰图集……;它们的 `source` 字段会注明):把其中一条复制到 `vfx/texture_prompts.json`,改写后生成并处理。+绝不用 Python 画图来模仿手绘形状。++## 生成++- 如果宿主提供图像生成工具,就用你写的提示词调用它。把未经修改的输出保存到 `vfx/textures/generated/<T_Name>.png`。+- 如果没有,**不要用任何东西替代**:把提示词加进 `vfx/texture_prompts.json`,告诉用户要生成哪张图(名称、尺寸、提示词)+ 以及保存到哪里,然后继续做不依赖它的部分。+- 在 `vfx/texture_prompts.json` 中把每条提示词记录为 `{"id": "T_Name", "size": 256, "prompt": "..."}`(图集加上+ `"grid": [4, 4]`,任何非默认的处理加上 `"post"`)。lint 会拒绝没有记录提示词的手绘纹理。+- 处理成游戏纹理,绝不覆盖原图:+ `vfx process-texture vfx/textures/generated/T_Name.png vfx/textures/processed/T_Name.png --size 256`+ (`--color` 以 straight RGBA 保留颜色;序列帧图集用 `--grid 4 4 --size 1024`,各格保持原位)。+- 实测:`vfx texture-info T_Name` 测角度、弧顶凸出和裁切;`vfx texture-audit T_Name --role shape`(或+ `flipbook --grid 4 4`、`trail`、`symbol`、`light`、`uv_distortion`、`screen_distortion`)检查边缘、alpha、+ 小尺寸下是否还能看见以及帧间变化。打开 audit 返回的 `preview` 图片。++尺寸:普通粒子 128–256,主形状和法阵 512;已验证的 4×4 序列是 1024²。++## 提示词内容++写明视觉职责、轮廓和内部结构、所需的留边、背景或透明模式、排除项(不要环境、角色、文字或 UI)以及目标尺寸。+遮罩:纯黑底上的白色形状。序列要写明网格、从生长到破碎的变化、恒定的中心和缩放、每格都留边;循环序列要写明首帧和末帧相接。++实体形状需要可读的轮廓和有变化的粗细,可以不对称并带负空间。光需要从核心平滑衰减,可以对称。法阵和符号可以使用精确几何和密集装饰。+烟雾遵循目标风格 —— 清晰的外沿、内部明暗或柔和的体积 —— 但不是每种烟都要变成卡通棉花球。不要把"打破规则"用在光学星芒或法阵本身上。++| 类型 | 要具体说明 | 避免 |+|---|---|---|+| 斩击与爪痕 | 一个主方向、根部粗尾部细、断口与不均匀的粗细、弧内留空 | 等宽的月牙图标;等距的爪痕线 |+| 爆点与实体闪光 | 有分量的核心和有方向的外缘;核心要么完整,要么明确是一个环 | 中间一个随机的小洞,看起来像眼睛或脸 |+| 烟与尘 | 明确的风格、轮廓和内部明暗,大小不一的团块,逐渐破碎 | 一模一样的棉花球;没有轮廓的灰色渐变 |+| 光与星芒 | 平滑的热核心、直的衰减,按职责选择对称性 | 硬把光做成弯曲的断笔触,再用巨大的光晕补救 |+| 法阵与符号 | 清晰的密度、结构层次和精细的符号带 | 几个巨大的字母,缩小后变成一个空环 |+| 地面裂纹 | 从冲击点分叉、根粗端细、局部不规则 | 均匀的网格或平铺的格子,看起来像地砖 |++一个可填写的请求示例,例如烟尾序列:++> 用途:火焰飞行体之后留下的灰色残烟。连续的 4×4 序列,1024²。烟团开始时密集,向上翻滚,逐渐破碎成不均匀的碎块。+> 中心和缩放恒定,每格都留边。保留内部明暗;外轮廓有层次;避免规则的圆形烟团和均匀的径向扩散。不要角色、环境、文字或 UI。+> 一个独立的素材,会在游戏中着色。++这是一个模板,不是某个生成素材的来源记录:生成之后,记录真实的提示词、原图和处理设置。法阵、斩击弧和火焰主体需要各自写明职责,+而不只是换个颜色。`assets/examples/texture_prompts.json` 保存了示例纹理的提示词。++## 验收++硬性错误:文件缺失、网格无效、尺寸不能被网格整除。首格或末格为空、帧保持不变可能是有意的;中间格为空、跳帧和重复只是提示 —— 要看图。+细纹理在原尺寸下很漂亮,在标准镜头里却可能消失:检查 64 px 和 32 px 预览以及真实渲染。++本机实测:序列帧上的 UV 扰动会采样到相邻格(lint 禁止这样做);颜色纹理和 alpha 纹理使用不同的通道;UV 扰动需要不透明的 RG 图,+而屏幕扭曲可以带 alpha 范围。火焰沿用已验证的爆炸序列加侵蚀,而不是剪贴画式的火焰 sprite。++## 序列必须变形++逐格查看:形状是否从一个关键姿态变到另一个 —— 张开、翻滚、撕裂、侵蚀?把同一个轮廓放大同时降低不透明度不是变形。+从密集到破碎的变化可以很快,但主体不能一达到可见尺寸就已经是碎屑。++当一个序列承担多种职责时,选择不同的起始格和播放速度,并说明原因:热的头部可能只播放密集的短片段;烟尾可能变化缓慢,颜色先冷却。+`frame_length × cell count` 是播放时间,life 是实例寿命;两者不同时,要说明是提前退出、保持还是截断。++小预览只是一道筛查。如果纹理在 32 px 时消失,先加宽有用的可见线条、去掉无用的细节,或者改变实际的层尺寸;+不要盲目把 512 的原图放大到 2048 —— 在同一个镜头里,分辨率不会改变画面占比。diff --git a/docs/zh/references/timing.md b/docs/zh/references/timing.mdnew file mode 100644index 0000000..dcea466--- /dev/null+++ b/docs/zh/references/timing.md@@ -0,0 +1,62 @@+# 强度、体积与退场节奏++先写关键画面,再填 delay 和 life。把亮度和体积描述成两条独立的曲线:亮度在释放时尖峰,而爆炸的火焰和烟雾体积可能稍后才到峰值;+护盾保持一个稳定的轮廓,只在到期时破裂。复查的像素 `energy` 混合了面积和明暗,不等于其中任何一条曲线。++## 每个阶段都有接替者++| 阶段 | 要回答的问题 | 常见失败 |+|---|---|---|+| 预兆 | 观众知道哪里、何时会发生什么吗? | 大到已经像最终爆炸;命中连拍混入前导飞行体 |+| 接触或释放 | 这一瞬间比前后都更清晰吗? | 一大团白色持续不退;接触与 Lab 反馈不同步 |+| 主体 | 闪光消失后,还能读出动作和元素吗? | 主体过早消失,只剩火花;从头到尾同一个轮廓 |+| 次级 | 碎片、烟雾和火花有原因和方向吗? | 同时向所有方向喷洒,像装饰性的噪点 |+| 消散 | 留下的东西是否仍在变化,并按时结束? | 尾段空白;静止的脏残影;到 `duration` 时仍有大块主体 |++主体和次级可以重叠;它们不必是五个机械分开的区间。错开的是读点:闪光先离开,形体接替,碎片继续运动,烟最后变薄。+后出现的层如果更亮,必须解释为第二击、回击或破盾。++## 随附示例的参考时间++示例配方中的绝对帧范围(从第一次出生到最后一个实例的最大寿命;飞行体在 `flight` 时释放)。可见时长以图像为准。+这些不是适用于所有效果的常量。++| 示例 | 接触或释放 | 主要形体 | 之后 |+|---|---|---|---|+| Hit Heavy (0.5 s) | Anticipation f0–3、Contact flash f2–7 | Impact burst f2–12,空气泡和波到 f14 | 重火花到 f28,余烬和灰尘到 f30 |+| Fire Slash (0.6 s) | 刀刃和热边从 f1 开始,赛璐璐月牙 f2–10 | 刀刃主体到 f17,父级挥砍平面到 f22 | 火舌到 f35;烟和余烬在 f34 结束 |+| Magic Charge (1.5 s) | Charged flash f64–70(唯一的闪光) | 汇聚和核心 f0–64 | 释放的绽放和火花到 f82–86 |+| Shield Dome (1.8 s) | 升起闪光 f0–5 | 完整的壳到 f84 | 球面碎片 f80–104,碎屑到 f106;f108 前清空 |+| Heal (1.7 s) | ——(没有接触;缓慢淡入) | 法阵 f0–88,光柱 f8–82 | 加号和光点上升到 f90–98 |+| Fire Explosion (1.3 s) | Detonation flash f9–12 | Fireball f6–40、Mushroom f12–51 | Smoke billow f14–76;在 f54、60、66 检查尾段 |+| Ice Spikes (1.35 s) | Eruption glint f8–13 | 晶体在 f6–15 带过冲地喷出,保持到约 f47 | Crack glint f47–50,然后碎片 f50–78 碎裂 |+| Poison Cloud (1.75 s) | Splash flash f1–4 | Burst puff f1–25、酸液池 f3–104 | 毒气和雾持续到约 f99 |+| Projectile Fire (flight 0.45 s) | ——(没有接触) | 头部层持续发射到 f27 释放 | 释放后烟雾拖尾存活到 f69 |+| Projectile Ice (flight 0.35 s) | 枪口环 f0–16 | 冰枪头部到 f25 | 脱落的碎片和碎屑下落到约 f41 |+| Projectile Dark (flight 0.6 s) | ——(没有接触) | 头部层持续发射到 f36 释放 | 尾迹和路径闪光存活到 f54 |+| Dark Vortex (1.65 s) | 冲击帧 f62–64,释放 f62–70 | 视界和吸积盘在 f0–62 向内吞噬 | 释放弧衰减成烟到 f98;地面螺旋到 f88 |++先匹配用途和形状,再借用"谁接替谁"。不要给频繁的轻击配上爆炸那样的长烟尾,也不要强迫蓄力从第一帧起就只会变暗。++## 曲线必须落在真实的帧上++配方的 delay 和 life 是 60 FPS 帧数;F-Curve 的关键点是生命周期的百分比。对于在 d 出生、寿命为 L 的固定寿命层,+要在真实帧 t 发生的变化,关键点放在 `100 × (t − d) / L`。随机寿命会让每个实例在不同的绝对时刻变化;+要与接触对齐,就用一个固定寿命的关键层。++子层的 delay 从其父实例的出生开始计时。反复出生的父层会给每个子层各自的时钟;阅读 `vfx brief-validate` 展开的最早和最晚出生时刻。+"这一层活 20 帧"并不意味着它在第 20 帧就消失了 —— 最后出生的实例仍然活着。++飞行体在 `flight` 时停止发射,它的拖尾随每个实例的寿命结束。要延长烟尾,用更长的序列帧片段、颜色衰减和合适的寿命,+并重新检查 `duration` 和存活实例预算。只调大 `duration` 会造成空白尾段;只调大寿命可能让序列提前播完。++## 不要赌最后一帧++简报标出退场开始、退场中段和清空时刻;复查至少采样这三帧,外加 `duration` 之后的一个检查帧。长效果可以额外加上 80 % 和 90 %+的关键帧,免得峰值占满缩略图,而尾段只分到一个空格子。++当壳、柱或环看不出破碎时,先检查渲染器是否支持这种组合,再考虑真实的几何碎片、分段的弧,或者在形状之间按时交接。+编译回读正确并不意味着"溶解有效"—— 见 [护盾案例](cases.md#护盾始终不露出间隙的破碎)。++每一轮先决定你修的是接触、主体交接还是退场,然后只改那些层。在标准连拍中判断顺序和画面占比,在细节拼图中判断侵蚀和拖尾,+在 Lab 中以全速判断节奏。diff --git a/skills/effekseer-vfx/LICENSE b/skills/effekseer-vfx/LICENSEnew file mode 100644index 0000000..2549e5f--- /dev/null+++ b/skills/effekseer-vfx/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 KanaWorks_AI (https://x.com/KanaWorks_AI)++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/skills/effekseer-vfx/SKILL.md b/skills/effekseer-vfx/SKILL.mdnew file mode 100644index 0000000..e66f3ae--- /dev/null+++ b/skills/effekseer-vfx/SKILL.md@@ -0,0 +1,91 @@+---+name: effekseer-vfx+description: Author real-time game VFX as code for the Effekseer engine and verify them in a real Godot render. Use when asked to create, edit, review or iterate on Effekseer effects (.efkefc/.efk), game hit, slash, projectile, explosion, magic, buff or shield VFX, or a VFX library for a Godot game. Covers design briefs, texture generation prompts, Python recipe code, EffekseerCore compilation, filmstrip review, independent scoring and export.+license: MIT+compatibility: Build and render need macOS on Apple silicon, Godot 4.x and network access for the first setup (Effekseer Core, .NET runtime, Effekseer Godot plugin). Authoring, lint and texture processing run on macOS or Linux with Python 3.11+ (on Windows, use WSL).+metadata:+ version: "0.1.0"+---++# Effekseer VFX++Make game effects the way a VFX artist iterates, but in code: **brief → textures → recipe → EffekseerCore build → real Godot filmstrip → look → fix one thing → repeat → independent review**.++`<skill>` below is the directory that contains this file. Every command is+`sh <skill>/scripts/vfx [--project <game project>] <command> ...` and prints one JSON object+(progress goes to stderr). The project defaults to the current directory; its effect workspace is `<project>/vfx/`.+Run `sh <skill>/scripts/vfx --help` for all commands; [references/cli.md](references/cli.md) documents them.++## First run in a project++1. `vfx doctor` — reports `modes` (`authoring`, `build`, `render`), the workspace and the exact `next` steps. If it says a `vfx/` folder exists that `vfx init` did not create, confirm with the user that this is the game project (or pass `--project`) before initializing.+2. If setup is needed, **ask the user first** (full mode downloads about 250 MB into `~/.cache/effekseer-vfx`):+ `sh <skill>/scripts/setup.sh` on macOS ARM64, `sh <skill>/scripts/setup.sh --authoring-only` elsewhere.+ Setup needs Python 3.11+ or uv (macOS's built-in Python 3.9 is too old); if `doctor` reports neither, ask the user to install one. Godot 4 (Forward+) must be installed by the user; set `GODOT` if it is not on `PATH`.+3. `vfx init` creates `vfx/` (Godot Lab, materials, math textures, official Effekseer plugin). It never overwrites existing files unless `--update-templates`.+4. Optional: `vfx examples add <name>` copies a finished, independently reviewed example to learn from: pairs `fire`, `ice`, `poison`, `dark` (projectile + impact) and singles `hit`, `slash`, `charge`, `shield`, `heal`, or `all`. See [references/examples.md](references/examples.md).++`vfx review`, `preview` and `showcase` open a Godot window on the user's desktop. If you run inside a sandbox (Codex's+workspace sandbox, for example), run those commands outside it with the user's approval, or give the user the exact+command to run in a terminal on their desktop if you cannot leave the sandbox; a review that stops with "rendered no+frame" most likely could not open its window (check the Godot output it includes). `render: true` from `doctor` only means Godot was found.++Without `build`/`render` mode you can still write briefs, recipes and textures and run `lint`, but you cannot judge the+look. Say so plainly: report the work as **not compiled and not render-verified**; never claim an effect improved.++## Making or changing one effect++1. **Read before writing.** Always read [craft](references/craft.md), [design](references/design.md), [layering](references/layering.md), [timing](references/timing.md) and [skeletons](references/skeletons.md); then the topic files from the routing table below, and `vfx examples show <name>` for the matching example's layer plan (names: `hit`, `slash`, `charge`, `shield`, `heal`, or the pairs `fire`, `ice`, `poison`, `dark` for projectiles and impacts such as explosions; an effect ID also works). For an existing effect run `vfx effect-context <ID>` and read its history so you do not repeat a failed change.+2. **Brief.** Write `vfx/briefs/<ID>.json` (three key frames, palette roles, beats, layer plan, acceptance, avoid). Format in [design.md](references/design.md).+3. **Textures.** Math shapes (glows, rings, noise, trails, distortion maps) and a starter set of painted smoke, explosion, wisp, crack and ice textures already exist after `init`. Complex painted shapes (flame, slash, smoke, crack, ice, rune) come from an image generation model — follow [textures.md](references/textures.md). Measure every texture with `vfx texture-info` before using its angle.+4. **Recipe.** Write `vfx/src/<ID>.py` defining `recipe()` with the primitives in [primitives.md](references/primitives.md). Follow the verified engine rules in [engine-conventions.md](references/engine-conventions.md) instead of guessing axes, units or blend behaviour.+5. `vfx brief-validate <ID>` and `vfx lint --ids <ID>`. Lint errors must be fixed; warnings are craft hints the render decides.+6. `vfx build --ids <ID>`, then `vfx review --ids <ID> --note "<what this round changed>"`.+7. **Look at the images.** Open every path the review returns (`sheets`, `compare`, `details.*.sheet`) with your image-viewing tool. Flags only point at likely problems; never judge from flags alone. Procedure and flag meanings: [review.md](references/review.md).+8. Fix **one class of problem per round**, 3–5 rounds per effect.+9. **Independent review.** The author never scores its own effect. Run `vfx review-handoff <ID>`: it writes a complete reviewer brief (images, captured frames, manifest context, rubric, where to save the report, and the path of the `vfx-review` skill installed next to this one) and returns `prompt_file`, `report_file` and the exact submit command. Give that brief, unchanged, to a separate agent that has not seen the recipe: start a subagent with it if your host can, telling it nothing else about the effect; otherwise ask the user to open a new session and paste it. When `report_file` exists, run the returned `vfx review-submit <evidence_id> <report_file> --reviewer <that agent's identifier>` (its subagent ID or name, or the session ID; never `author` or `self`; frames default to the report's `observed_frames`). Never write the report yourself.+10. `vfx overview` (no `--ids`: the library baseline), then `vfx effect-verify <ID>`. Only `verified: true` may be reported as done; otherwise list what is missing. If the round limit is reached without a ship verdict, report the unresolved items.++## Hard rules++- Every effect has a time structure (anticipation → contact → body → secondary → dissipation) and value layering (white-hot core, saturated body, darker rim or residue). Heals, shields and charges have their own documented exceptions.+- The body changes shape (dissolve, sweep, UV distortion, flipbook, re-struck shapes); it never only scales and fades. Particles ease out (fast, then slow).+- Elements differ in at least three of shape, motion, rhythm, material and secondary motion — never a recolour.+- Do not draw complex painted shapes with Python. If no image generation tool is available, write the prompt into `vfx/texture_prompts.json` and ask the user for the image.+- Keep generated originals in `vfx/textures/generated/` and write processed copies to `vfx/textures/processed/`; record every prompt.+- Units: recipe timing in 60 FPS frames, F-curves in percent of life, manifest duration/peak in seconds, Godot API rotation in radians.+- Every effect declares `delivery`; a projectile needs a paired impact effect that points back to it.+- Use only layer fields the compiler knows (`vfx layer-schema`); extend the compiler instead of writing raw property paths into recipes.+- A full `vfx build` (no `--ids`) prunes the outputs of effects this skill built whose source left `vfx/src/`; it never deletes effects it did not build and refuses to run on an empty library. Use `--ids` for partial work (a broken source elsewhere is reported in `unloaded` instead of blocking it).+- Never claim export, playback, device performance or recording success without actually running and checking it.++## Routing table++| Task | Also read |+|---|---|+| new painted texture, flipbook, texture problem | [textures.md](references/textures.md) |+| slash, projectile, charge, aura, anything that travels | [motion.md](references/motion.md) |+| shield, pillar, boss, status, volumes, occlusion | [shapes.md](references/shapes.md) |+| matching a reference video | [reference.md](references/reference.md) |+| a specific visual failure (white blob, empty tail, no break-up) | [cases.md](references/cases.md) |+| adding an engine feature to the compiler | [engine-conventions.md](references/engine-conventions.md#extending-the-compiler), `vfx discover`, `vfx core property-list/get/set` |+| using the effects in a game | [godot.md](references/godot.md) |++## Recipe skeleton++```python+# vfx/src/VFX_Hit_Spark.py+from vfxkit.primitives import *++def recipe():+ hot = (255, 240, 200, 255)+ return effect('Hit_Spark', 'Spark Hit', 'hit', 'physical', .4, [+ flash('Contact flash', WHITE, 2.2, life=4, delay=1),+ glow('Bloom', (255, 170, 70, 170), 1.6, life=9, delay=1),+ radial_sparks('Sparks', 10, hot, color_end=(255, 120, 30, 255), distance=(.8, 1.7), life=(12, 16), delay=1, gravity=.0018),+ smoke('Dust', (185, 160, 135, 200), count=2, size=(.5, .7), life=(13, 14), delay=4),+ ], peak=.03, impact=.3, delivery=MELEE, design='One-line description of what the player sees.')+```++`effect('Hit_Spark', ...)` produces the ID `VFX_Hit_Spark`, which must match the file name. Files starting with `_` in+`vfx/src/` are shared helpers that recipes may import.diff --git a/skills/effekseer-vfx/THIRD_PARTY_NOTICES.md b/skills/effekseer-vfx/THIRD_PARTY_NOTICES.mdnew file mode 100644index 0000000..2227eb4--- /dev/null+++ b/skills/effekseer-vfx/THIRD_PARTY_NOTICES.md@@ -0,0 +1,21 @@+# Third-party notices++## Included in this repository++| Component | Where | License | Notes |+|---|---|---|---|+| effekseer-ai (laodeng000/effekseer-ai, commit `208922ef192220322c2a79e1243ed51ff7d2b7af`) | `skills/effekseer-vfx/scripts/effekseer_ai/` | MIT, see `scripts/effekseer_ai/LICENSE` | Vendored and extended: structured layer compiler, procedural models, texture processing, Godot preview. Its agent server entry point was removed; the skill uses a command line instead. |+| Example textures | `skills/effekseer-vfx/assets/examples/textures/` | this repository's MIT license | Made with an image generation model from the prompts in `assets/examples/texture_prompts.json`, then post-processed; originals are not included. |++## Downloaded on first use (not redistributed)++| Component | Downloaded by | License |+|---|---|---|+| Effekseer 1.80.7 for Windows (only its managed Core assemblies are loaded) — https://github.com/effekseer/Effekseer/releases/tag/1807 | `scripts/setup.sh`, SHA-256 pinned | MIT (Effekseer Project); the archive's `LICENSE_TOOL` lists its bundled components |+| EffekseerForGodot4 1.80.5.1 — https://github.com/effekseer/EffekseerForGodot4/releases/tag/1.80.5.1 | `vfx init`, SHA-256 pinned | MIT; its LICENSE is copied into `vfx/godot/addons/effekseer/`. `init` changes one line of `plugin.gd` so the editor icon loads before the first import; the renderer is unchanged. |+| .NET 9 runtime (9.0.20) — official Microsoft archive `dotnet-runtime-9.0.20-osx-arm64.tar.gz` | `scripts/setup.sh`, SHA-256 pinned | MIT |+| Python packages in `scripts/requirements.lock.txt` (numpy, Pillow, jsonschema, pythonnet, ...) | `scripts/setup.sh`, pinned by version (not by hash) | their own permissive licenses |++Godot and ffmpeg are not downloaded; install them yourself under their licenses.++This project is not affiliated with or endorsed by the Effekseer project or the Godot Foundation.diff --git a/skills/effekseer-vfx/agents/openai.yaml b/skills/effekseer-vfx/agents/openai.yamlnew file mode 100644index 0000000..efc63ef--- /dev/null+++ b/skills/effekseer-vfx/agents/openai.yaml@@ -0,0 +1,6 @@+# Codex skill metadata (optional; other agents ignore this file).+interface:+ display_name: "Effekseer VFX"+ short_description: "Game VFX as code with Effekseer, checked in real Godot renders"+policy:+ allow_implicit_invocation: truediff --git a/skills/effekseer-vfx/assets/brief.schema.json b/skills/effekseer-vfx/assets/brief.schema.jsonnew file mode 100644index 0000000..c2039dc--- /dev/null+++ b/skills/effekseer-vfx/assets/brief.schema.json@@ -0,0 +1,25 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "title": "VFX design brief",+ "type": "object",+ "additionalProperties": false,+ "required": ["schema_version", "effect_id", "role", "style", "dominant_shape", "palette", "delivery", "anchor", "beats", "layer_plan", "acceptance", "avoid"],+ "properties": {+ "schema_version": {"const": 1},+ "effect_id": {"type": "string", "pattern": "^VFX_[A-Za-z0-9_]+$"},+ "role": {"type": "string", "minLength": 1},+ "style": {"type": "string", "minLength": 1},+ "dominant_shape": {"type": "string", "minLength": 1},+ "palette": {+ "type": "object", "required": ["core", "body", "dark", "matter"],+ "additionalProperties": {"type": "array", "minItems": 3, "maxItems": 4, "items": {"type": "integer", "minimum": 0, "maximum": 255}}+ },+ "delivery": {"type": "object", "required": ["kind"], "properties": {"kind": {"enum": ["self", "melee", "projectile", "targeted", "area"]}, "projectile": {"type": "string"}}, "additionalProperties": false},+ "anchor": {"type": "string"},+ "reference": {"type": ["object", "null"], "properties": {"id": {"type": "string"}}, "required": ["id"]},+ "beats": {"type": "array", "minItems": 1, "items": {"type": "object", "required": ["frame", "name", "expect"], "additionalProperties": false, "properties": {"frame": {"type": "integer", "minimum": 0}, "name": {"type": "string", "minLength": 1}, "expect": {"type": "string", "minLength": 1}}}},+ "layer_plan": {"type": "array", "minItems": 1, "items": {"type": "object", "required": ["name", "role", "primitive", "exit"], "additionalProperties": false, "properties": {"name": {"type": "string", "minLength": 1}, "role": {"type": "string", "minLength": 1}, "primitive": {"type": "string", "minLength": 1}, "exit": {"type": "string", "minLength": 1}}}},+ "acceptance": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},+ "avoid": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}+ }+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Dark_Vortex.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Dark_Vortex.jsonnew file mode 100644index 0000000..0997394--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Dark_Vortex.json@@ -0,0 +1,287 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Dark_Vortex",+ "role": "paired ranged impact",+ "style": "stylized anime combat",+ "dominant_shape": "dense torn dark head; inward accretion, a delayed collapse",+ "palette": {+ "core": [+ 245,+ 225,+ 255+ ],+ "body": [+ 190,+ 95,+ 245+ ],+ "dark": [+ 12,+ 4,+ 25+ ],+ "matter": [+ 125,+ 110,+ 140+ ]+ },+ "delivery": {+ "kind": "projectile",+ "projectile": "VFX_Projectile_Dark"+ },+ "anchor": "body",+ "beats": [+ {+ "frame": 6,+ "name": "open",+ "expect": "Dark horizon within tilted torn accretion disk"+ },+ {+ "frame": 30,+ "name": "feeding",+ "expect": "Matter spirals in rather than radiating out"+ },+ {+ "frame": 60,+ "name": "tightening",+ "expect": "Mass contracts before release"+ },+ {+ "frame": 63,+ "name": "collapse",+ "expect": "Brief white release over dark frame"+ },+ {+ "frame": 72,+ "name": "body exit",+ "expect": "Broken disk-plane arcs cool"+ },+ {+ "frame": 87,+ "name": "tail",+ "expect": "Thin contracting residue"+ },+ {+ "frame": 99,+ "name": "clear",+ "expect": "All residue clears"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Back glow",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f62"+ },+ {+ "name": "1:Inflow dust",+ "role": "secondary material and motion",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f80"+ },+ {+ "name": "2:Disk far 0",+ "role": "distant accretion plane",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f74"+ },+ {+ "name": "3:Disk far 1",+ "role": "distant accretion plane",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f76"+ },+ {+ "name": "4:Swirl back",+ "role": "broken supporting shape: Swirl back",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f67"+ },+ {+ "name": "5:Event horizon",+ "role": "absorptive central silhouette",+ "primitive": "Sprite T_Dot01",+ "exit": "authored movement and fade; gone by absolute f62"+ },+ {+ "name": "6:Hot singularity",+ "role": "broken supporting shape: Hot singularity",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f60"+ },+ {+ "name": "7:Photon wisps",+ "role": "broken supporting shape: Photon wisps",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f66"+ },+ {+ "name": "8:Disk near 0",+ "role": "foreground accretion plane",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f74"+ },+ {+ "name": "9:Disk near 1",+ "role": "foreground accretion plane",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f76"+ },+ {+ "name": "10:Swirl front",+ "role": "broken supporting shape: Swirl front",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f71"+ },+ {+ "name": "11:Gravitational lensing",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_DistortRing01",+ "exit": "authored movement and fade; gone by absolute f62"+ },+ {+ "name": "12:Rubble infall",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Shard01",+ "exit": "authored movement and fade; gone by absolute f74"+ },+ {+ "name": "13:Infall pivot",+ "role": "rotating inward coordinate system",+ "primitive": "None ",+ "exit": "authored movement and fade; gone by absolute f62"+ },+ {+ "name": "13:Infall pivot/0:Disk matter",+ "role": "broken supporting shape: Disk matter",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f76"+ },+ {+ "name": "13:Infall pivot/1:Disk streaks",+ "role": "broken supporting shape: Disk streaks",+ "primitive": "Sprite T_Spark01",+ "exit": "authored movement and fade; gone by absolute f61"+ },+ {+ "name": "14:Impact frame",+ "role": "broken supporting shape: Impact frame",+ "primitive": "Sprite T_SoftCircle",+ "exit": "authored movement and fade; gone by absolute f64"+ },+ {+ "name": "15:Collapse rim",+ "role": "broken supporting shape: Collapse rim",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f67"+ },+ {+ "name": "16:Collapse core",+ "role": "broken supporting shape: Collapse core",+ "primitive": "Sprite T_Smoke02",+ "exit": "flow/erosion and color fade; gone by absolute f69"+ },+ {+ "name": "17:Release bloom",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f80"+ },+ {+ "name": "18:Slice line",+ "role": "broken supporting shape: Slice line",+ "primitive": "Sprite T_Streak01",+ "exit": "authored movement and fade; gone by absolute f76"+ },+ {+ "name": "19:Cross line",+ "role": "broken supporting shape: Cross line",+ "primitive": "Sprite T_Streak01",+ "exit": "authored movement and fade; gone by absolute f74"+ },+ {+ "name": "20:Release arc A",+ "role": "broken supporting shape: Release arc A",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f80"+ },+ {+ "name": "21:Release arc B",+ "role": "broken supporting shape: Release arc B",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f79"+ },+ {+ "name": "22:Release arc A smoke",+ "role": "broken supporting shape: Release arc A smoke",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f98"+ },+ {+ "name": "23:Release arc B smoke",+ "role": "broken supporting shape: Release arc B smoke",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f95"+ },+ {+ "name": "24:Ground spiral",+ "role": "ground footprint",+ "primitive": "Sprite T_Vortex01",+ "exit": "flow/erosion and color fade; gone by absolute f88"+ },+ {+ "name": "25:Spiral brand",+ "role": "ground footprint",+ "primitive": "Sprite T_Vortex01",+ "exit": "flow/erosion and color fade; gone by absolute f98"+ },+ {+ "name": "26:Ember rim",+ "role": "broken supporting shape: Ember rim",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f78"+ },+ {+ "name": "27:Release refraction",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_DistortRing01",+ "exit": "authored movement and fade; gone by absolute f76"+ },+ {+ "name": "28:Release needles",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Spark01",+ "exit": "authored movement and fade; gone by absolute f90"+ },+ {+ "name": "29:Ground pivot",+ "role": "floor-space coordinate system",+ "primitive": "None ",+ "exit": "authored movement and fade; gone by absolute f99"+ },+ {+ "name": "29:Ground pivot/0:Residue",+ "role": "post-collapse floor matter",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f96"+ },+ {+ "name": "30:Afterglints",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Star01",+ "exit": "authored movement and fade; gone by absolute f98"+ }+ ],+ "acceptance": [+ "Head/body silhouette reads at standard camera after the brightest accent",+ "Material moves with its element and stays attached to the correct space",+ "Final third shows deliberate dissipation, with clear end frame"+ ],+ "avoid": [+ "Large persistent white blob erasing the body",+ "Same round silhouette and radial motion recolored for each element",+ "Full rigid shape disappearing while separate debris appears"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Fire_Explosion.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Fire_Explosion.jsonnew file mode 100644index 0000000..8a73328--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Fire_Explosion.json@@ -0,0 +1,222 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Fire_Explosion",+ "role": "paired ranged impact",+ "style": "stylized anime combat",+ "dominant_shape": "turbulent comet and ascending cooling smoke",+ "palette": {+ "core": [+ 255,+ 250,+ 220+ ],+ "body": [+ 255,+ 120,+ 30+ ],+ "dark": [+ 60,+ 30,+ 20+ ],+ "matter": [+ 125,+ 110,+ 100+ ]+ },+ "delivery": {+ "kind": "projectile",+ "projectile": "VFX_Projectile_Fire"+ },+ "anchor": "body",+ "beats": [+ {+ "frame": 4,+ "name": "gather",+ "expect": "Inward gathering at target"+ },+ {+ "frame": 10,+ "name": "contact",+ "expect": "White-hot detonation lasts only a few frames"+ },+ {+ "frame": 18,+ "name": "body",+ "expect": "Orange fire survives white flash"+ },+ {+ "frame": 30,+ "name": "rise",+ "expect": "Asymmetric rolling fire rises"+ },+ {+ "frame": 54,+ "name": "tail",+ "expect": "Grey smoke thins while ascending"+ },+ {+ "frame": 78,+ "name": "clear",+ "expect": "All fire and smoke clear"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Scorch",+ "role": "ground footprint",+ "primitive": "Sprite T_Crack01",+ "exit": "authored movement and fade; gone by absolute f55"+ },+ {+ "name": "1:Glowing cracks",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_Crack01",+ "exit": "authored movement and fade; gone by absolute f41"+ },+ {+ "name": "2:Dark backing",+ "role": "broken supporting shape: Dark backing",+ "primitive": "Sprite T_SoftCircle",+ "exit": "authored movement and fade; gone by absolute f29"+ },+ {+ "name": "3:Gather",+ "role": "anticipation",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f6"+ },+ {+ "name": "4:Inward fuse",+ "role": "anticipation",+ "primitive": "Sprite T_Spark01",+ "exit": "authored movement and fade; gone by absolute f7"+ },+ {+ "name": "5:Detonation flash",+ "role": "broken supporting shape: Detonation flash",+ "primitive": "Sprite T_Flare01",+ "exit": "authored movement and fade; gone by absolute f12"+ },+ {+ "name": "6:Fire core",+ "role": "broken supporting shape: Fire core",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f14"+ },+ {+ "name": "7:Smoke billow",+ "role": "ascending cooling mass",+ "primitive": "Sprite T_ExplosionSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f76"+ },+ {+ "name": "8:Fireball",+ "role": "rolling fire body",+ "primitive": "Sprite T_ExplosionSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f40"+ },+ {+ "name": "9:Mushroom",+ "role": "ascending lobe",+ "primitive": "Sprite T_ExplosionSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f51"+ },+ {+ "name": "10:Ground lick A",+ "role": "ground footprint",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f21"+ },+ {+ "name": "11:Ground lick B",+ "role": "ground footprint",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f27"+ },+ {+ "name": "12:Ground lick A smoke",+ "role": "ground footprint",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f40"+ },+ {+ "name": "13:Ground lick B smoke",+ "role": "ground footprint",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f50"+ },+ {+ "name": "14:Refraction wave",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_DistortRing01",+ "exit": "authored movement and fade; gone by absolute f22"+ },+ {+ "name": "15:Heat haze",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_DistortHaze01",+ "exit": "flow/erosion and color fade; gone by absolute f58"+ },+ {+ "name": "16:Ground licks",+ "role": "ground footprint",+ "primitive": "Sprite T_ExplosionSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f50"+ },+ {+ "name": "17:Shrapnel sparks streaks",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Spark01",+ "exit": "authored movement and fade; gone by absolute f16"+ },+ {+ "name": "18:Shrapnel sparks",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Spark01",+ "exit": "authored movement and fade; gone by absolute f42"+ },+ {+ "name": "19:Shrapnel sparks heavy",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Spark01",+ "exit": "authored movement and fade; gone by absolute f50"+ },+ {+ "name": "20:Blow-through streaks",+ "role": "broken supporting shape: Blow-through streaks",+ "primitive": "Sprite T_Spark01",+ "exit": "authored movement and fade; gone by absolute f22"+ },+ {+ "name": "21:Char debris",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Shard01",+ "exit": "authored movement and fade; gone by absolute f52"+ },+ {+ "name": "22:Ground dust",+ "role": "secondary material and motion",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f36"+ },+ {+ "name": "23:Rising embers",+ "role": "broken supporting shape: Rising embers",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f57"+ }+ ],+ "acceptance": [+ "Head/body silhouette reads at standard camera after the brightest accent",+ "Material moves with its element and stays attached to the correct space",+ "Final third shows deliberate dissipation, with clear end frame"+ ],+ "avoid": [+ "Large persistent white blob erasing the body",+ "Same round silhouette and radial motion recolored for each element",+ "Full rigid shape disappearing while separate debris appears"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Heal.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Heal.jsonnew file mode 100644index 0000000..7d3ac45--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Heal.json@@ -0,0 +1,120 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Heal",+ "role": "self heal",+ "style": "stylized anime combat",+ "dominant_shape": "No impact frame at all: slow seal, soft scrolling column, rings and plus signs drifting upward, a gentle bloom on the body.",+ "palette": {+ "core": [+ 225,+ 255,+ 235+ ],+ "body": [+ 110,+ 255,+ 170+ ],+ "dark": [+ 20,+ 90,+ 70+ ],+ "matter": [+ 40,+ 220,+ 160+ ]+ },+ "delivery": {+ "kind": "self"+ },+ "anchor": "ground",+ "beats": [+ {+ "frame": 8,+ "name": "seal",+ "expect": "A green seal unfolds on the floor with a soft floor glow; no white flash"+ },+ {+ "frame": 24,+ "name": "column",+ "expect": "A soft scrolling column rises; the first ring travels up"+ },+ {+ "frame": 40,+ "name": "rise",+ "expect": "Plus signs and motes drift upward; a gentle bloom on the body"+ },+ {+ "frame": 64,+ "name": "thin",+ "expect": "Column and rings thin out from the top down"+ },+ {+ "frame": 90,+ "name": "exit",+ "expect": "The seal fades last; only a few motes remain"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Blessing seal",+ "role": "ground identity",+ "primitive": "Sprite T_Rune02 decal, slow spin",+ "exit": "fades out by absolute frame 88"+ },+ {+ "name": "1:Floor glow",+ "role": "light",+ "primitive": "Sprite T_Glow01 decal",+ "exit": "fades out by absolute frame 88"+ },+ {+ "name": "2:Soft column",+ "role": "body",+ "primitive": "Model column, scrolling T_NoiseStreak02",+ "exit": "fades out by absolute frame 82"+ },+ {+ "name": "3:Rising rings",+ "role": "upward motion",+ "primitive": "Ring shock_ring travelling up",+ "exit": "last ring ends by absolute frame 74"+ },+ {+ "name": "4:Plus signs",+ "role": "identity",+ "primitive": "Sprite T_Cross01 travelling up",+ "exit": "last instances end by absolute frame 90"+ },+ {+ "name": "5:Life motes",+ "role": "upward motion",+ "primitive": "Sprite T_Glow01 motes travelling up",+ "exit": "last instances end by absolute frame 98"+ },+ {+ "name": "6:Twinkles",+ "role": "secondary",+ "primitive": "Sprite T_Star01",+ "exit": "gone by absolute frame 77"+ },+ {+ "name": "7:Body bloom",+ "role": "light",+ "primitive": "Sprite T_Glow01 on the body",+ "exit": "fades out by absolute frame 54"+ }+ ],+ "acceptance": [+ "No attack-style white flash anywhere",+ "Everything travels upward and eases out",+ "The seal is readable on the floor under the target"+ ],+ "avoid": [+ "A contact flash or an outward burst",+ "Particles falling or moving sideways",+ "A solid green column that hides the body"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Hit_Heavy.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Hit_Heavy.jsonnew file mode 100644index 0000000..1dbaeb2--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Hit_Heavy.json@@ -0,0 +1,161 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Hit_Heavy",+ "role": "heavy melee hit",+ "style": "stylized anime combat",+ "dominant_shape": "Two-frame anticipation, white flash, dissolving jagged burst, eased sparks that hang and droop, dust.",+ "palette": {+ "core": [+ 255,+ 245,+ 220+ ],+ "body": [+ 255,+ 140,+ 40+ ],+ "dark": [+ 30,+ 14,+ 8+ ],+ "matter": [+ 185,+ 160,+ 135+ ]+ },+ "delivery": {+ "kind": "melee"+ },+ "anchor": "impact",+ "beats": [+ {+ "frame": 1,+ "name": "anticipation",+ "expect": "A small warm glow gathers at the contact point"+ },+ {+ "frame": 3,+ "name": "contact",+ "expect": "White flash and speed lines; the brightest frame of the effect"+ },+ {+ "frame": 6,+ "name": "burst",+ "expect": "Jagged orange burst already larger than the flash and starting to dissolve"+ },+ {+ "frame": 12,+ "name": "air wave",+ "expect": "Air bubble and tilted wave expand while sparks fly out fast"+ },+ {+ "frame": 20,+ "name": "hang",+ "expect": "Heavy sparks slow down and droop; dust spreads low"+ },+ {+ "frame": 30,+ "name": "exit",+ "expect": "Only thin dust and a few embers remain, then nothing"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Dark backing",+ "role": "contrast",+ "primitive": "Sprite T_SoftCircle (Blend)",+ "exit": "fades out by absolute frame 17"+ },+ {+ "name": "1:Anticipation",+ "role": "anticipation",+ "primitive": "Sprite T_Glow01",+ "exit": "gone by absolute frame 3"+ },+ {+ "name": "2:Contact flash",+ "role": "contact",+ "primitive": "Sprite T_Flare01",+ "exit": "fades out by absolute frame 7"+ },+ {+ "name": "3:Impact burst",+ "role": "body",+ "primitive": "Sprite T_Impact01 with dissolve cutoff",+ "exit": "erodes through T_NoiseTile01 by absolute frame 12"+ },+ {+ "name": "4:Speed lines",+ "role": "contact",+ "primitive": "Sprite T_SpeedLines01",+ "exit": "fades out by absolute frame 9"+ },+ {+ "name": "5:Heat bloom",+ "role": "light",+ "primitive": "Sprite T_Glow01",+ "exit": "fades out by absolute frame 16"+ },+ {+ "name": "6:Air bubble",+ "role": "body",+ "primitive": "Model shell",+ "exit": "fades out by absolute frame 14"+ },+ {+ "name": "7:Air wave",+ "role": "body",+ "primitive": "Ring tilted_ring",+ "exit": "fades out by absolute frame 14"+ },+ {+ "name": "8:Refraction wave",+ "role": "body",+ "primitive": "Sprite distortion ring",+ "exit": "fades out by absolute frame 14"+ },+ {+ "name": "9:Sparks streaks",+ "role": "secondary",+ "primitive": "Sprite T_Spark01 (spark_burst fast tier)",+ "exit": "gone by absolute frame 12"+ },+ {+ "name": "10:Sparks",+ "role": "secondary",+ "primitive": "Sprite T_Spark01 (spark_burst main tier)",+ "exit": "gone by absolute frame 20"+ },+ {+ "name": "11:Sparks heavy",+ "role": "secondary",+ "primitive": "Sprite T_Spark01 (spark_burst heavy tier, gravity)",+ "exit": "gone by absolute frame 28"+ },+ {+ "name": "12:Embers",+ "role": "residue",+ "primitive": "Sprite T_Glow01 motes",+ "exit": "cool to red and fade by absolute frame 30"+ },+ {+ "name": "13:Dust",+ "role": "residue",+ "primitive": "Sprite T_SmokeSheet01 smoke",+ "exit": "thins out by absolute frame 30"+ }+ ],+ "acceptance": [+ "The contact is the brightest moment and lasts at most 5 frames",+ "The burst changes shape (dissolves) instead of only scaling",+ "Sparks burst fast, then hang and droop"+ ],+ "avoid": [+ "A white blob that stays white after the contact",+ "Uniform-speed sparks",+ "An empty tail before frame 20"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Ice_Spikes.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Ice_Spikes.jsonnew file mode 100644index 0000000..37343f5--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Ice_Spikes.json@@ -0,0 +1,222 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Ice_Spikes",+ "role": "paired ranged impact",+ "style": "stylized anime combat",+ "dominant_shape": "narrow faceted lance, then grounded unequal crystalline spikes",+ "palette": {+ "core": [+ 240,+ 252,+ 255+ ],+ "body": [+ 90,+ 180,+ 255+ ],+ "dark": [+ 20,+ 40,+ 110+ ],+ "matter": [+ 150,+ 185,+ 215+ ]+ },+ "delivery": {+ "kind": "projectile",+ "projectile": "VFX_Projectile_Ice"+ },+ "anchor": "ground",+ "beats": [+ {+ "frame": 4,+ "name": "ground cue",+ "expect": "Torn frost outlines eruption"+ },+ {+ "frame": 12,+ "name": "contact",+ "expect": "Short glint and unequal crystal silhouette"+ },+ {+ "frame": 30,+ "name": "hold",+ "expect": "Facets remain blue while halo climbs"+ },+ {+ "frame": 48,+ "name": "fracture cue",+ "expect": "Brief glint announces break"+ },+ {+ "frame": 54,+ "name": "break",+ "expect": "Solid cluster yields to separated chips"+ },+ {+ "frame": 66,+ "name": "tail",+ "expect": "Only falling pieces and low mist"+ },+ {+ "frame": 81,+ "name": "clear",+ "expect": "Ground and shards clear"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Frost creep",+ "role": "ground footprint",+ "primitive": "Sprite T_Smoke02",+ "exit": "flow/erosion and color fade; gone by absolute f60"+ },+ {+ "name": "1:Frost cracks",+ "role": "ground footprint",+ "primitive": "Sprite T_Crack01",+ "exit": "authored movement and fade; gone by absolute f61"+ },+ {+ "name": "2:Frost glow",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f57"+ },+ {+ "name": "3:Core crystals",+ "role": "dominant ground silhouette",+ "primitive": "Model T_NoiseTile02",+ "exit": "flow/erosion and color fade; gone by absolute f47"+ },+ {+ "name": "4:Outer crystals",+ "role": "asymmetric crystal mass",+ "primitive": "Model T_NoiseTile02",+ "exit": "flow/erosion and color fade; gone by absolute f50"+ },+ {+ "name": "5:Outer shards",+ "role": "small peripheral silhouette",+ "primitive": "Model T_NoiseTile02",+ "exit": "fragment separation and RGB fade; gone by absolute f53"+ },+ {+ "name": "6:Ripple crystals",+ "role": "shot-direction eruption",+ "primitive": "Model T_NoiseTile02",+ "exit": "flow/erosion and color fade; gone by absolute f55"+ },+ {+ "name": "7:Crystal glow",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f46"+ },+ {+ "name": "8:Eruption glint",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Star01",+ "exit": "authored movement and fade; gone by absolute f13"+ },+ {+ "name": "9:Cold wave R",+ "role": "broken supporting shape: Cold wave R",+ "primitive": "Ring T_Trail02",+ "exit": "flow/erosion and color fade; gone by absolute f22"+ },+ {+ "name": "10:Cold wave G",+ "role": "broken supporting shape: Cold wave G",+ "primitive": "Ring T_Trail02",+ "exit": "flow/erosion and color fade; gone by absolute f22"+ },+ {+ "name": "11:Cold wave B",+ "role": "broken supporting shape: Cold wave B",+ "primitive": "Ring T_Trail02",+ "exit": "flow/erosion and color fade; gone by absolute f23"+ },+ {+ "name": "12:Cold refraction",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_DistortRing01",+ "exit": "authored movement and fade; gone by absolute f22"+ },+ {+ "name": "13:Halo 0",+ "role": "broken supporting shape: Halo 0",+ "primitive": "Ring ",+ "exit": "authored movement and fade; gone by absolute f34"+ },+ {+ "name": "14:Halo 1",+ "role": "broken supporting shape: Halo 1",+ "primitive": "Ring ",+ "exit": "authored movement and fade; gone by absolute f45"+ },+ {+ "name": "15:Facet glints",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Star01",+ "exit": "authored movement and fade; gone by absolute f59"+ },+ {+ "name": "16:Frost mist",+ "role": "sinking world residue",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f78"+ },+ {+ "name": "17:Kicked dust",+ "role": "secondary material and motion",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f44"+ },+ {+ "name": "18:Frozen rubble",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Shard01",+ "exit": "authored movement and fade; gone by absolute f48"+ },+ {+ "name": "19:Ice dust",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f58"+ },+ {+ "name": "20:Crack glint",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Flare01",+ "exit": "authored movement and fade; gone by absolute f50"+ },+ {+ "name": "21:Shatter shards",+ "role": "separated breaking solids",+ "primitive": "Model T_NoiseTile02",+ "exit": "fragment separation and RGB fade; gone by absolute f78"+ },+ {+ "name": "22:Shard chips",+ "role": "fine shatter residue",+ "primitive": "Sprite T_IceShard01",+ "exit": "fragment separation and RGB fade; gone by absolute f74"+ }+ ],+ "acceptance": [+ "Head/body silhouette reads at standard camera after the brightest accent",+ "Material moves with its element and stays attached to the correct space",+ "Final third shows deliberate dissipation, with clear end frame",+ "At f54-66 the large cluster gives way to independently moving fragments"+ ],+ "avoid": [+ "Large persistent white blob erasing the body",+ "Same round silhouette and radial motion recolored for each element",+ "Full rigid shape disappearing while separate debris appears"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Magic_Charge.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Magic_Charge.jsonnew file mode 100644index 0000000..f892b7e--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Magic_Charge.json@@ -0,0 +1,143 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Magic_Charge",+ "role": "self charge",+ "style": "stylized anime combat",+ "dominant_shape": "Motes and streaks accelerate inward while two tilted rune bands orbit the core like a gyroscope and tighten onto it, then a single flash confirms the charge.",+ "palette": {+ "core": [+ 235,+ 250,+ 255+ ],+ "body": [+ 120,+ 220,+ 255+ ],+ "dark": [+ 20,+ 40,+ 110+ ],+ "matter": [+ 60,+ 120,+ 255+ ]+ },+ "delivery": {+ "kind": "self"+ },+ "anchor": "caster",+ "beats": [+ {+ "frame": 4,+ "name": "gather",+ "expect": "Motes and streaks appear far out and start moving inward"+ },+ {+ "frame": 24,+ "name": "build",+ "expect": "Two tilted bands orbit; shells implode onto a growing core"+ },+ {+ "frame": 56,+ "name": "tighten",+ "expect": "Bands and shells have shrunk close to a bright core"+ },+ {+ "frame": 65,+ "name": "release",+ "expect": "One white flash with a bloom and an outward shell: the only flash of the effect"+ },+ {+ "frame": 78,+ "name": "sparks",+ "expect": "Release sparks slow down and cool to blue"+ },+ {+ "frame": 88,+ "name": "exit",+ "expect": "Only a faint glow, then nothing"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Gathering motes",+ "role": "inward motion",+ "primitive": "Sprite T_Glow01 motes, eased travel inward",+ "exit": "last instances end by absolute frame 80"+ },+ {+ "name": "1:Gathering streaks",+ "role": "inward motion",+ "primitive": "Sprite T_Spark01 radial_sparks, EaseInCubic travel",+ "exit": "last instances end by absolute frame 70"+ },+ {+ "name": "2:Orbit ring A",+ "role": "volume",+ "primitive": "Ring orbit_band",+ "exit": "shrinks and fades by absolute frame 64"+ },+ {+ "name": "3:Orbit ring B",+ "role": "volume",+ "primitive": "Ring orbit_band",+ "exit": "shrinks and fades by absolute frame 64"+ },+ {+ "name": "4:Converging shell",+ "role": "inward volume",+ "primitive": "Model shell, scale 1 to 0.1",+ "exit": "last shell ends by absolute frame 62"+ },+ {+ "name": "5:Core",+ "role": "body",+ "primitive": "Sprite T_Glow01",+ "exit": "grows until the release, gone by absolute frame 64"+ },+ {+ "name": "6:Aura",+ "role": "light",+ "primitive": "Sprite T_Glow01",+ "exit": "gone by absolute frame 64"+ },+ {+ "name": "7:Charged flash",+ "role": "release",+ "primitive": "Sprite T_Flare01",+ "exit": "fades out by absolute frame 70"+ },+ {+ "name": "8:Charged bloom",+ "role": "release",+ "primitive": "Sprite T_Glow01",+ "exit": "fades out by absolute frame 82"+ },+ {+ "name": "9:Charged shell",+ "role": "release",+ "primitive": "Model shell",+ "exit": "fades out by absolute frame 77"+ },+ {+ "name": "10:Charged sparks",+ "role": "secondary",+ "primitive": "Sprite T_Spark01 radial_sparks",+ "exit": "cool and fade by absolute frame 86"+ }+ ],+ "acceptance": [+ "The build moves inward for about a second before anything flashes",+ "Exactly one release flash, after the build",+ "Bands read as tilted 3D rings, not flat screen hoops"+ ],+ "avoid": [+ "A flash at the start of the charge",+ "Particles drifting outward during the build",+ "A static glowing ball"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Poison_Cloud.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Poison_Cloud.jsonnew file mode 100644index 0000000..6386a82--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Poison_Cloud.json@@ -0,0 +1,186 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Poison_Cloud",+ "role": "paired ranged impact",+ "style": "stylized anime combat",+ "dominant_shape": "heavy glossy lob; directional splatter, wet pool and low fumes",+ "palette": {+ "core": [+ 235,+ 255,+ 200+ ],+ "body": [+ 140,+ 215,+ 60+ ],+ "dark": [+ 70,+ 30,+ 85+ ],+ "matter": [+ 115,+ 105,+ 125+ ]+ },+ "delivery": {+ "kind": "projectile",+ "projectile": "VFX_Projectile_Poison"+ },+ "anchor": "body",+ "beats": [+ {+ "frame": 3,+ "name": "contact",+ "expect": "Short acid splatter"+ },+ {+ "frame": 12,+ "name": "body",+ "expect": "Uneven wet pool forms beneath target"+ },+ {+ "frame": 30,+ "name": "hold",+ "expect": "Low fumes and droplets have distinct weights"+ },+ {+ "frame": 54,+ "name": "cooling",+ "expect": "Fumes turn murky purple-grey"+ },+ {+ "frame": 78,+ "name": "tail",+ "expect": "Wet pool thins with low moving haze"+ },+ {+ "frame": 105,+ "name": "clear",+ "expect": "No lingering pool or smoke"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Acid pool",+ "role": "persistent wet ground footprint",+ "primitive": "Sprite T_Smoke02",+ "exit": "flow/erosion and color fade; gone by absolute f104"+ },+ {+ "name": "1:Pool sheen",+ "role": "small wet reflected highlight",+ "primitive": "Sprite T_Smoke02",+ "exit": "flow/erosion and color fade; gone by absolute f84"+ },+ {+ "name": "2:Acid glints",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Star01",+ "exit": "authored movement and fade; gone by absolute f90"+ },+ {+ "name": "3:Splash shadow",+ "role": "broken supporting shape: Splash shadow",+ "primitive": "Sprite T_Explosion01",+ "exit": "flow/erosion and color fade; gone by absolute f10"+ },+ {+ "name": "4:Splash core",+ "role": "broken supporting shape: Splash core",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f4"+ },+ {+ "name": "5:Splash flash",+ "role": "brief contact",+ "primitive": "Sprite T_Explosion01",+ "exit": "authored movement and fade; gone by absolute f4"+ },+ {+ "name": "6:Splash strokes",+ "role": "broken supporting shape: Splash strokes",+ "primitive": "Ring T_WispTrail01",+ "exit": "flow/erosion and color fade; gone by absolute f11"+ },+ {+ "name": "7:Burst puff",+ "role": "liquid impact body",+ "primitive": "Sprite T_Explosion01",+ "exit": "flow/erosion and color fade; gone by absolute f25"+ },+ {+ "name": "8:Sick glow",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f50"+ },+ {+ "name": "9:Bruise smoke",+ "role": "bruised low underside",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f88"+ },+ {+ "name": "10:Lingering fumes",+ "role": "cooling low poison mass",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f92"+ },+ {+ "name": "11:Ground pivot",+ "role": "floor-space coordinate system",+ "primitive": "None ",+ "exit": "authored movement and fade; gone by absolute f105"+ },+ {+ "name": "11:Ground pivot/0:Low fog",+ "role": "rolling floor matter",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "flow/erosion and color fade; gone by absolute f99"+ },+ {+ "name": "11:Ground pivot/1:Pool bubbles",+ "role": "ground footprint",+ "primitive": "Sprite T_Bubble01",+ "exit": "authored movement and fade; gone by absolute f99"+ },+ {+ "name": "12:Acid drops",+ "role": "broken supporting shape: Acid drops",+ "primitive": "Sprite T_Dot01",+ "exit": "authored movement and fade; gone by absolute f33"+ },+ {+ "name": "13:Acid spatter",+ "role": "broken supporting shape: Acid spatter",+ "primitive": "Sprite T_Spark01",+ "exit": "authored movement and fade; gone by absolute f21"+ },+ {+ "name": "14:Spores",+ "role": "slow drifting residue",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f97"+ },+ {+ "name": "15:Purple spores",+ "role": "secondary material and motion",+ "primitive": "Sprite T_Glow01",+ "exit": "authored movement and fade; gone by absolute f90"+ }+ ],+ "acceptance": [+ "Head/body silhouette reads at standard camera after the brightest accent",+ "Material moves with its element and stays attached to the correct space",+ "Final third shows deliberate dissipation, with clear end frame"+ ],+ "avoid": [+ "Large persistent white blob erasing the body",+ "Same round silhouette and radial motion recolored for each element",+ "Full rigid shape disappearing while separate debris appears"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Dark.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Dark.jsonnew file mode 100644index 0000000..3083049--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Dark.json@@ -0,0 +1,150 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Projectile_Dark",+ "role": "single ranged projectile",+ "style": "stylized anime combat",+ "dominant_shape": "dense torn dark head; inward accretion, a delayed collapse",+ "palette": {+ "core": [+ 245,+ 225,+ 255+ ],+ "body": [+ 190,+ 95,+ 245+ ],+ "dark": [+ 12,+ 4,+ 25+ ],+ "matter": [+ 125,+ 110,+ 140+ ]+ },+ "delivery": {+ "kind": "projectile"+ },+ "anchor": "projectile",+ "beats": [+ {+ "frame": 3,+ "name": "launch",+ "expect": "Readable dark head within a broken violet rim"+ },+ {+ "frame": 18,+ "name": "midflight",+ "expect": "Dust and needles converge on the moving head"+ },+ {+ "frame": 36,+ "name": "arrival",+ "expect": "Head reaches target; broken wake remains"+ },+ {+ "frame": 45,+ "name": "tail",+ "expect": "Grey-violet wake contracts and erodes"+ },+ {+ "frame": 54,+ "name": "clear",+ "expect": "Wake clears"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Shadow wake",+ "role": "contracting world residue",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f54"+ },+ {+ "name": "1:Wake arcs",+ "role": "broken world trail",+ "primitive": "Ring T_WispTrail01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f54"+ },+ {+ "name": "2:Violet halo",+ "role": "subordinate head halo",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f45"+ },+ {+ "name": "3:Wisp arcs",+ "role": "turning head rim",+ "primitive": "Ring T_WispTrail01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f46"+ },+ {+ "name": "4:Inward needles",+ "role": "inward speed carrier",+ "primitive": "Sprite T_Spark01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f50"+ },+ {+ "name": "5:Lens",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_DistortRing01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f42"+ },+ {+ "name": "6:Seed core",+ "role": "broken supporting shape: Seed core",+ "primitive": "Sprite T_Smoke02",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f43"+ },+ {+ "name": "7:Churn core",+ "role": "torn absorptive head",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f45"+ },+ {+ "name": "8:Drawn dust",+ "role": "inward matter",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f52"+ },+ {+ "name": "9:Hot center",+ "role": "small core accent",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f41"+ },+ {+ "name": "10:Hot wisps",+ "role": "broken hot edge",+ "primitive": "Ring T_WispTrail01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f44"+ },+ {+ "name": "11:Ember underside",+ "role": "local second-color accent",+ "primitive": "Ring T_WispTrail01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f44"+ },+ {+ "name": "12:Path glints",+ "role": "world residue",+ "primitive": "Sprite T_Star01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f54"+ }+ ],+ "acceptance": [+ "Head/body silhouette reads at standard camera after the brightest accent",+ "Material moves with its element and stays attached to the correct space",+ "Final third shows deliberate dissipation, with clear end frame"+ ],+ "avoid": [+ "Large persistent white blob erasing the body",+ "Same round silhouette and radial motion recolored for each element",+ "Full rigid shape disappearing while separate debris appears"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Fire.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Fire.jsonnew file mode 100644index 0000000..5c3dee1--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Fire.json@@ -0,0 +1,137 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Projectile_Fire",+ "role": "single ranged projectile",+ "style": "stylized anime combat",+ "dominant_shape": "turbulent comet and ascending cooling smoke",+ "palette": {+ "core": [+ 255,+ 250,+ 220+ ],+ "body": [+ 255,+ 120,+ 30+ ],+ "dark": [+ 60,+ 30,+ 20+ ],+ "matter": [+ 125,+ 110,+ 100+ ]+ },+ "delivery": {+ "kind": "projectile"+ },+ "anchor": "projectile",+ "beats": [+ {+ "frame": 3,+ "name": "launch",+ "expect": "Small white core inside orange head"+ },+ {+ "frame": 15,+ "name": "midflight",+ "expect": "Broken comet tongue and upward peeling fire"+ },+ {+ "frame": 27,+ "name": "arrival",+ "expect": "Head reaches target; trail stays in world"+ },+ {+ "frame": 42,+ "name": "cooling",+ "expect": "Smoke moves up while hot material thins"+ },+ {+ "frame": 54,+ "name": "tail",+ "expect": "Thin grey smoke still changing"+ },+ {+ "frame": 72,+ "name": "clear",+ "expect": "No persistent head or path"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Smoke trail",+ "role": "world-space cooling smoke",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f69"+ },+ {+ "name": "1:Flame trail",+ "role": "ascending shed fire",+ "primitive": "Sprite T_ExplosionSheet01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f53"+ },+ {+ "name": "2:Flame wisps",+ "role": "head churn",+ "primitive": "Ring T_WispTrail01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f35"+ },+ {+ "name": "3:Embers",+ "role": "ascending residue",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f55"+ },+ {+ "name": "4:Flung sparks",+ "role": "backward speed carrier",+ "primitive": "Sprite T_Spark01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f37"+ },+ {+ "name": "5:Heat bloom",+ "role": "subordinate head halo",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f35"+ },+ {+ "name": "6:Heat wake",+ "role": "subordinate refraction",+ "primitive": "Sprite T_DistortHaze01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f45"+ },+ {+ "name": "7:Comet tail",+ "role": "backward head silhouette",+ "primitive": "Sprite T_ExplosionSheet01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f33"+ },+ {+ "name": "8:Fireball",+ "role": "rolling fire body",+ "primitive": "Sprite T_ExplosionSheet01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f34"+ },+ {+ "name": "9:Hot core",+ "role": "narrow thermal core",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f33"+ }+ ],+ "acceptance": [+ "Head/body silhouette reads at standard camera after the brightest accent",+ "Material moves with its element and stays attached to the correct space",+ "Final third shows deliberate dissipation, with clear end frame"+ ],+ "avoid": [+ "Large persistent white blob erasing the body",+ "Same round silhouette and radial motion recolored for each element",+ "Full rigid shape disappearing while separate debris appears"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Ice.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Ice.jsonnew file mode 100644index 0000000..ae30f99--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Ice.json@@ -0,0 +1,156 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Projectile_Ice",+ "role": "single ranged projectile",+ "style": "stylized anime combat",+ "dominant_shape": "narrow faceted lance, then grounded unequal crystalline spikes",+ "palette": {+ "core": [+ 240,+ 252,+ 255+ ],+ "body": [+ 90,+ 180,+ 255+ ],+ "dark": [+ 20,+ 40,+ 110+ ],+ "matter": [+ 150,+ 185,+ 215+ ]+ },+ "delivery": {+ "kind": "projectile"+ },+ "anchor": "projectile",+ "beats": [+ {+ "frame": 3,+ "name": "launch",+ "expect": "Blue faceted solid with thin hot tip"+ },+ {+ "frame": 11,+ "name": "midflight",+ "expect": "Fast narrow head with separated chips"+ },+ {+ "frame": 21,+ "name": "arrival",+ "expect": "Head reaches target"+ },+ {+ "frame": 30,+ "name": "tail",+ "expect": "Falling shards and sinking mist"+ },+ {+ "frame": 42,+ "name": "clear",+ "expect": "Path clears"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Frost mist",+ "role": "sinking world residue",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f40"+ },+ {+ "name": "1:Muzzle rings",+ "role": "broken supporting shape: Muzzle rings",+ "primitive": "Ring ",+ "exit": "authored movement and fade; gone by absolute f16"+ },+ {+ "name": "2:Lance trail",+ "role": "thin direction carrier",+ "primitive": "Track T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f33"+ },+ {+ "name": "3:Prism warm",+ "role": "broken supporting shape: Prism warm",+ "primitive": "Track T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f33"+ },+ {+ "name": "4:Prism gold",+ "role": "broken supporting shape: Prism gold",+ "primitive": "Track T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f33"+ },+ {+ "name": "5:Frost rings",+ "role": "ground footprint",+ "primitive": "Ring ",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f31"+ },+ {+ "name": "6:Shed shards",+ "role": "falling solid chips",+ "primitive": "Model T_NoiseTile02",+ "exit": "release at arrival, then fragment separation and RGB fade; gone by absolute f41"+ },+ {+ "name": "7:Ice chips",+ "role": "fine falling chips",+ "primitive": "Sprite T_IceShard01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f39"+ },+ {+ "name": "8:Navy chips",+ "role": "dark falling chips",+ "primitive": "Sprite T_Shard01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f40"+ },+ {+ "name": "9:Twinkles",+ "role": "broken supporting shape: Twinkles",+ "primitive": "Sprite T_Star01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f33"+ },+ {+ "name": "10:Cold bloom",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f27"+ },+ {+ "name": "11:Navy back",+ "role": "head contrast",+ "primitive": "Model T_NoiseTile02",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f25"+ },+ {+ "name": "12:Lance",+ "role": "faceted head silhouette",+ "primitive": "Model T_NoiseTile02",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f25"+ },+ {+ "name": "13:Tip star",+ "role": "small head accent",+ "primitive": "Sprite T_Star01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f25"+ }+ ],+ "acceptance": [+ "Head/body silhouette reads at standard camera after the brightest accent",+ "Material moves with its element and stays attached to the correct space",+ "Final third shows deliberate dissipation, with clear end frame"+ ],+ "avoid": [+ "Large persistent white blob erasing the body",+ "Same round silhouette and radial motion recolored for each element",+ "Full rigid shape disappearing while separate debris appears"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Poison.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Poison.jsonnew file mode 100644index 0000000..f0f7d0d--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Projectile_Poison.json@@ -0,0 +1,149 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Projectile_Poison",+ "role": "single ranged projectile",+ "style": "stylized anime combat",+ "dominant_shape": "heavy glossy lob; directional splatter, wet pool and low fumes",+ "palette": {+ "core": [+ 235,+ 255,+ 200+ ],+ "body": [+ 140,+ 215,+ 60+ ],+ "dark": [+ 70,+ 30,+ 85+ ],+ "matter": [+ 115,+ 105,+ 125+ ]+ },+ "delivery": {+ "kind": "projectile"+ },+ "anchor": "projectile",+ "beats": [+ {+ "frame": 3,+ "name": "launch",+ "expect": "Glossy green liquid lobe with bruised shadow"+ },+ {+ "frame": 21,+ "name": "apex",+ "expect": "Heavy droplets fall below the lob"+ },+ {+ "frame": 42,+ "name": "arrival",+ "expect": "Head reaches target along an arc"+ },+ {+ "frame": 54,+ "name": "tail",+ "expect": "Detached drops fall; fume loses saturation"+ },+ {+ "frame": 66,+ "name": "late tail",+ "expect": "Thin low murky residue"+ },+ {+ "frame": 72,+ "name": "clear",+ "expect": "No hanging liquid head"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Fume trail",+ "role": "cooling world residue",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f72"+ },+ {+ "name": "1:Acid thread",+ "role": "thin arc direction carrier",+ "primitive": "Track T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f52"+ },+ {+ "name": "2:Drips",+ "role": "falling liquid strands",+ "primitive": "Sprite T_Spark01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f68"+ },+ {+ "name": "3:Heavy drops",+ "role": "falling liquid weight",+ "primitive": "Sprite T_Dot01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f72"+ },+ {+ "name": "4:Bubbles",+ "role": "wet particle identity",+ "primitive": "Sprite T_Bubble01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f62"+ },+ {+ "name": "5:Spores",+ "role": "slow drifting residue",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f70"+ },+ {+ "name": "6:Acid glow",+ "role": "subordinate head halo",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f50"+ },+ {+ "name": "7:Dark core",+ "role": "bruised head contrast",+ "primitive": "Sprite T_SoftCircle",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f47"+ },+ {+ "name": "8:Glob",+ "role": "heavy liquid head",+ "primitive": "Model ",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f47"+ },+ {+ "name": "9:Goo strands",+ "role": "head deformation",+ "primitive": "Ring T_WispTrail01",+ "exit": "release at arrival, then flow/erosion and color fade; gone by absolute f50"+ },+ {+ "name": "10:Hot center",+ "role": "small core accent",+ "primitive": "Sprite T_Glow01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f47"+ },+ {+ "name": "11:Highlight",+ "role": "wet surface accent",+ "primitive": "Sprite T_Dot01",+ "exit": "release at arrival, then authored movement and fade; gone by absolute f46"+ }+ ],+ "acceptance": [+ "Head/body silhouette reads at standard camera after the brightest accent",+ "Material moves with its element and stays attached to the correct space",+ "Final third shows deliberate dissipation, with clear end frame"+ ],+ "avoid": [+ "Large persistent white blob erasing the body",+ "Same round silhouette and radial motion recolored for each element",+ "Full rigid shape disappearing while separate debris appears"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Shield_Dome.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Shield_Dome.jsonnew file mode 100644index 0000000..443e43f--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Shield_Dome.json@@ -0,0 +1,169 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Shield_Dome",+ "role": "self defense",+ "style": "stylized anime combat",+ "dominant_shape": "Fresnel shell pops with overshoot, scan bands sweep up; at expiry six partial spherical sheets separate and tumble outward, with fine shards between their gaps.",+ "palette": {+ "core": [+ 255,+ 245,+ 225+ ],+ "body": [+ 100,+ 170,+ 255+ ],+ "dark": [+ 35,+ 55,+ 110+ ],+ "matter": [+ 125,+ 110,+ 100+ ]+ },+ "delivery": {+ "kind": "self"+ },+ "anchor": "body",+ "beats": [+ {+ "frame": 3,+ "name": "raise",+ "expect": "Short glint at onset"+ },+ {+ "frame": 18,+ "name": "hold",+ "expect": "Character inside stable shell"+ },+ {+ "frame": 70,+ "name": "flow",+ "expect": "Scan bands and surface motion"+ },+ {+ "frame": 80,+ "name": "fracture",+ "expect": "Surface sheets begin separating"+ },+ {+ "frame": 86,+ "name": "gaps",+ "expect": "Open gaps in shell"+ },+ {+ "frame": 94,+ "name": "break",+ "expect": "Fragments move outward"+ },+ {+ "frame": 104,+ "name": "residue",+ "expect": "Last pieces fade"+ },+ {+ "frame": 108,+ "name": "exit",+ "expect": "No shell remains"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Raise glint",+ "role": "contact or hot accent",+ "primitive": "Sprite T_Flare01",+ "exit": "authored erosion/fade; gone by absolute frame 5"+ },+ {+ "name": "1:Shell",+ "role": "main shape or supporting structure",+ "primitive": "Model ",+ "exit": "authored erosion/fade; gone by absolute frame 84"+ },+ {+ "name": "2:Rim",+ "role": "main shape or supporting structure",+ "primitive": "Model ",+ "exit": "authored erosion/fade; gone by absolute frame 84"+ },+ {+ "name": "3:Surface flow",+ "role": "main shape or supporting structure",+ "primitive": "Model ",+ "exit": "authored erosion/fade; gone by absolute frame 84"+ },+ {+ "name": "4:Equator pulse",+ "role": "main shape or supporting structure",+ "primitive": "Ring ",+ "exit": "authored erosion/fade; gone by absolute frame 17"+ },+ {+ "name": "5:Scan bands",+ "role": "main shape or supporting structure",+ "primitive": "Ring ",+ "exit": "authored erosion/fade; gone by absolute frame 88"+ },+ {+ "name": "6:Surface glints",+ "role": "contact or hot accent",+ "primitive": "Sprite T_Glow01",+ "exit": "authored erosion/fade; gone by absolute frame 106"+ },+ {+ "name": "7:Break shards",+ "role": "secondary or residue",+ "primitive": "Sprite T_Spark01",+ "exit": "authored erosion/fade; gone by absolute frame 106"+ },+ {+ "role": "separating shell surface",+ "primitive": "shell_fragments",+ "name": "8:Shell fragment 1",+ "exit": "authored erosion/fade; gone by absolute frame 104"+ },+ {+ "role": "separating shell surface",+ "primitive": "shell_fragments",+ "name": "9:Shell fragment 2",+ "exit": "authored erosion/fade; gone by absolute frame 104"+ },+ {+ "role": "separating shell surface",+ "primitive": "shell_fragments",+ "name": "10:Shell fragment 3",+ "exit": "authored erosion/fade; gone by absolute frame 104"+ },+ {+ "role": "separating shell surface",+ "primitive": "shell_fragments",+ "name": "11:Shell fragment 4",+ "exit": "authored erosion/fade; gone by absolute frame 104"+ },+ {+ "role": "separating shell surface",+ "primitive": "shell_fragments",+ "name": "12:Shell fragment 5",+ "exit": "authored erosion/fade; gone by absolute frame 104"+ },+ {+ "role": "separating shell surface",+ "primitive": "shell_fragments",+ "name": "13:Shell fragment 6",+ "exit": "authored erosion/fade; gone by absolute frame 104"+ }+ ],+ "acceptance": [+ "Character remains legible inside the rim-lit dome",+ "Surface moves during hold and breaks at expiry"+ ],+ "avoid": [+ "A tinted solid sphere",+ "A large glow covering the character"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/briefs/VFX_Slash_Fire.json b/skills/effekseer-vfx/assets/examples/briefs/VFX_Slash_Fire.jsonnew file mode 100644index 0000000..7528c73--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/briefs/VFX_Slash_Fire.json@@ -0,0 +1,143 @@+{+ "schema_version": 1,+ "effect_id": "VFX_Slash_Fire",+ "role": "basic melee",+ "style": "stylized anime combat",+ "dominant_shape": "Red-orange-white swept blade, then distorted flame tongues peel upward off the arc with embers and thin smoke.",+ "palette": {+ "core": [+ 255,+ 245,+ 225+ ],+ "body": [+ 255,+ 110,+ 30+ ],+ "dark": [+ 70,+ 35,+ 25+ ],+ "matter": [+ 125,+ 110,+ 100+ ]+ },+ "delivery": {+ "kind": "melee"+ },+ "anchor": "impact",+ "beats": [+ {+ "frame": 1,+ "name": "sweep",+ "expect": "Inclined blade begins cutting"+ },+ {+ "frame": 5,+ "name": "contact",+ "expect": "Short hot blade edge"+ },+ {+ "frame": 18,+ "name": "body",+ "expect": "Flame peels away from the blade"+ },+ {+ "frame": 32,+ "name": "exit",+ "expect": "Smoke and embers fade upward"+ }+ ],+ "layer_plan": [+ {+ "name": "0:Swing plane",+ "role": "main shape or supporting structure",+ "primitive": "None ",+ "exit": "authored erosion/fade; gone by absolute frame 22"+ },+ {+ "name": "0:Swing plane/0:Afterimage",+ "role": "main shape or supporting structure",+ "primitive": "Ring T_Trail01",+ "exit": "authored erosion/fade; gone by absolute frame 22"+ },+ {+ "name": "0:Swing plane/1:Blade body",+ "role": "main shape or supporting structure",+ "primitive": "Ring T_Trail01",+ "exit": "authored erosion/fade; gone by absolute frame 17"+ },+ {+ "name": "0:Swing plane/2:Hot edge",+ "role": "contact or hot accent",+ "primitive": "Ring T_Trail02",+ "exit": "authored erosion/fade; gone by absolute frame 13"+ },+ {+ "name": "0:Swing plane/3:Refraction arc",+ "role": "subordinate light or refraction",+ "primitive": "Ring T_DistortHaze01",+ "exit": "authored erosion/fade; gone by absolute frame 17"+ },+ {+ "name": "0:Swing plane/4:Cel crescent",+ "role": "contact or hot accent",+ "primitive": "Sprite T_Slash02",+ "exit": "authored erosion/fade; gone by absolute frame 10"+ },+ {+ "name": "1:Heat bloom",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_Glow01",+ "exit": "authored erosion/fade; gone by absolute frame 18"+ },+ {+ "name": "2:Flame tongues",+ "role": "main shape or supporting structure",+ "primitive": "Sprite T_ExplosionSheet01",+ "exit": "authored erosion/fade; gone by absolute frame 35"+ },+ {+ "name": "3:Heat haze",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "authored erosion/fade; gone by absolute frame 34"+ },+ {+ "name": "4:Sparks",+ "role": "secondary or residue",+ "primitive": "Sprite T_Spark01",+ "exit": "authored erosion/fade; gone by absolute frame 29"+ },+ {+ "name": "5:Cut smoke",+ "role": "secondary or residue",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "authored erosion/fade; gone by absolute frame 34"+ },+ {+ "name": "6:Rising embers",+ "role": "secondary or residue",+ "primitive": "Sprite T_Glow01",+ "exit": "authored erosion/fade; gone by absolute frame 34"+ },+ {+ "name": "7:Heat haze",+ "role": "subordinate light or refraction",+ "primitive": "Sprite T_SmokeSheet01",+ "exit": "authored erosion/fade; gone by absolute frame 30"+ }+ ],+ "acceptance": [+ "Blade crosses the target in an inclined plane",+ "Flame becomes the exit after the blade fades"+ ],+ "avoid": [+ "A stationary crescent sticker",+ "A white blob hiding the blade"+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/catalog.json b/skills/effekseer-vfx/assets/examples/catalog.jsonnew file mode 100644index 0000000..f4c7ebc--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/catalog.json@@ -0,0 +1,311 @@+{+ "note": "Four ranged pairs (a projectile and the impact played where it arrives) and five single effects, one per common category. Scores and verdicts are an independent review (0-3 per rubric criterion) of renders in the skill's default capsule Lab, kept as a reference, not as verification of your build.",+ "pairs": [+ {+ "name": "fire",+ "projectile": "VFX_Projectile_Fire",+ "impact": "VFX_Fire_Explosion",+ "teaches": [+ "boiling flipbook head with a stretched comet tail",+ "world-space trails that cool into smoke",+ "lopsided fireball thrown along the shot",+ "dark scorch under glowing cracks",+ "emissive strokes decaying into grey smoke (decay())"+ ]+ },+ {+ "name": "ice",+ "projectile": "VFX_Projectile_Ice",+ "impact": "VFX_Ice_Spikes",+ "teaches": [+ "crystal meshes with fresnel edges instead of painted spikes",+ "navy alpha backing for value contrast on a bright core",+ "prism fringe as a complementary accent",+ "overshoot scale curve on eruption, then a timed shatter"+ ]+ },+ {+ "name": "poison",+ "projectile": "VFX_Projectile_Poison",+ "impact": "VFX_Poison_Cloud",+ "teaches": [+ "lobbed flight (arc) with a Track thread drawing the path",+ "deformed procedural mesh as a glossy liquid body",+ "complementary purple dark core and bruise smoke",+ "colour ramps that cool acid green to murky grey",+ "drops that collide with the floor"+ ]+ },+ {+ "name": "dark",+ "projectile": "VFX_Projectile_Dark",+ "impact": "VFX_Dark_Vortex",+ "teaches": [+ "an alpha-black body (Blend) that reads against a bright stage instead of another glow",+ "inward motion: needles, dust and rubble eased into the centre (EaseInCubic travel)",+ "a tilted accretion disk drawn in two halves so the horizon occludes its far side",+ "a black impact frame before the white release",+ "an orange complementary accent at 5-10% of the frame"+ ]+ }+ ],+ "historical_scores": {+ "VFX_Projectile_Fire": {+ "read": 3,+ "timing": 2,+ "layering": 3,+ "shape_change": 2,+ "motion": 2,+ "placement": 3,+ "tail": 2,+ "identity": 3+ },+ "VFX_Fire_Explosion": {+ "read": 2,+ "timing": 3,+ "layering": 3,+ "shape_change": 3,+ "motion": 3,+ "placement": 3,+ "tail": 3,+ "identity": 3+ },+ "VFX_Projectile_Ice": {+ "read": 2,+ "timing": 2,+ "layering": 1,+ "shape_change": 1,+ "motion": 2,+ "placement": 2,+ "tail": 2,+ "identity": 2+ },+ "VFX_Ice_Spikes": {+ "read": 2,+ "timing": 3,+ "layering": 2,+ "shape_change": 2,+ "motion": 2,+ "placement": 3,+ "tail": 2,+ "identity": 3+ },+ "VFX_Projectile_Poison": {+ "read": 2,+ "timing": 2,+ "layering": 2,+ "shape_change": 2,+ "motion": 2,+ "placement": 2,+ "tail": 2,+ "identity": 2+ },+ "VFX_Poison_Cloud": {+ "read": 3,+ "timing": 3,+ "layering": 3,+ "shape_change": 2,+ "motion": 2,+ "placement": 2,+ "tail": 2,+ "identity": 2+ },+ "VFX_Projectile_Dark": {+ "read": 2,+ "timing": 2,+ "layering": 2,+ "shape_change": 2,+ "motion": 2,+ "placement": 2,+ "tail": 1,+ "identity": 2+ },+ "VFX_Dark_Vortex": {+ "read": 2,+ "timing": 3,+ "layering": 3,+ "shape_change": 2,+ "motion": 2,+ "placement": 2,+ "tail": 2,+ "identity": 3+ },+ "VFX_Hit_Heavy": {+ "read": 3,+ "timing": 2,+ "layering": 2,+ "shape_change": 2,+ "motion": 2,+ "placement": 3,+ "tail": 2,+ "identity": 2+ },+ "VFX_Slash_Fire": {+ "read": 2,+ "timing": 2,+ "layering": 2,+ "shape_change": 2,+ "motion": 2,+ "placement": 2,+ "tail": 2,+ "identity": 2+ },+ "VFX_Magic_Charge": {+ "read": 2,+ "timing": 3,+ "layering": 2,+ "shape_change": 2,+ "motion": 2,+ "placement": 3,+ "tail": 2,+ "identity": 2+ },+ "VFX_Shield_Dome": {+ "read": 2,+ "timing": 2,+ "layering": 2,+ "shape_change": 2,+ "motion": 2,+ "placement": 2,+ "tail": 3,+ "identity": 3+ },+ "VFX_Heal": {+ "read": 2,+ "timing": 2,+ "layering": 2,+ "shape_change": 2,+ "motion": 2,+ "placement": 3,+ "tail": 2,+ "identity": 2+ }+ },+ "singles": [+ {+ "name": "hit",+ "effect": "VFX_Hit_Heavy",+ "teaches": [+ "two-frame anticipation before a 5-frame white contact",+ "jagged burst dissolving through a noise mask (DISSOLVE)",+ "three spark tiers (spark_burst) that burst fast, then hang and droop",+ "refraction wave and air bubble instead of a flat shock ring"+ ]+ },+ {+ "name": "slash",+ "effect": "VFX_Slash_Fire",+ "teaches": [+ "slash_set: one blade read at three widths (afterimage, body, hot edge) plus a cel crescent",+ "swing(): the arc lies in a yawed 3D swing plane, not painted on the screen",+ "flame tongues peeling off the arc, hidden behind the body by depth test",+ "embers and thin cut smoke as the exit"+ ]+ },+ {+ "name": "charge",+ "effect": "VFX_Magic_Charge",+ "teaches": [+ "a long inward build (about one second) before exactly one release",+ "orbit_band gyroscope rings on two tilted planes that tighten",+ "imploding shells: the gather reads as a collapsing volume",+ "release flash, bloom and sparks only at the end"+ ]+ },+ {+ "name": "shield",+ "effect": "VFX_Shield_Dome",+ "teaches": [+ "fresnel shell and rim (falloff pow < 1 for a thin rim)",+ "overshoot pop, a hold with scan bands, then a timed break",+ "shell_fragments: real spherical sheets that separate when cutoff alone opens no visible holes",+ "every fragment cleared before the duration ends"+ ]+ },+ {+ "name": "heal",+ "effect": "VFX_Heal",+ "teaches": [+ "no impact frame: slow fade-in instead of a white contact",+ "floor seal decal as the identity",+ "rings, plus signs and motes that all travel upward and ease out",+ "a gentle body bloom instead of a burst"+ ]+ }+ ],+ "historical_review": {+ "date": "2026-10-10",+ "stage": "the skill's default Lab (capsule stand-ins, standard view, default profile)",+ "reviewers": "two independent subagents that saw only the strips, key-frame sheets, manifest entries and flags",+ "verdicts": {+ "VFX_Projectile_Fire": "ship",+ "VFX_Fire_Explosion": "ship",+ "VFX_Projectile_Ice": "iterate",+ "VFX_Ice_Spikes": "ship",+ "VFX_Projectile_Poison": "ship",+ "VFX_Poison_Cloud": "ship",+ "VFX_Projectile_Dark": "iterate",+ "VFX_Dark_Vortex": "ship",+ "VFX_Hit_Heavy": "ship",+ "VFX_Slash_Fire": "ship",+ "VFX_Magic_Charge": "ship",+ "VFX_Shield_Dome": "ship",+ "VFX_Heal": "ship"+ },+ "worst": {+ "VFX_Projectile_Fire": {+ "criterion": "motion",+ "fix": "The trail smoke advects along the shot with the fireball (f27 near caster -> f42/f47 piled on the target) instead of lingering on the path; spawn the smoke layer in world space with no inherited projectile velocity and a slow eased upward drift so f42-f54 show a graded smoke line along the path that rises and thins."+ },+ "VFX_Fire_Explosion": {+ "criterion": "read",+ "fix": "The inward gather at f1-f4 is only a faint orange glow on the target and does not read; make the pre-detonation layer at f1-f7 a visible bright ember core with streaks converging on the target so the first lit tile already says fire."+ },+ "VFX_Projectile_Ice": {+ "criterion": "layering",+ "fix": "The lance (f1-f21) renders as one flat saturated blue wedge with only point sparkles on it; replace its texture/colour curve with a white-hot spine down the centre, a cyan-blue body and a navy rim (and add a thin additive white ribbon core inside the wedge) so the peak tiles f4-f13 show three brightness bands instead of a flat plastic colour."+ },+ "VFX_Ice_Spikes": {+ "criterion": "shape_change",+ "fix": "The crystal cluster fades/sinks away between f30 and f48 and only small chips appear at f53; instead, at the glint f48 swap the main crystals for 5-8 large shard pieces of the same crystals that split off and fall over f50-f66, so the cluster visibly cracks apart rather than dissolving."+ },+ "VFX_Projectile_Poison": {+ "criterion": "layering",+ "fix": "The glob body f3-f42 is mostly a flat olive fill with a lime rim and one white dot; darken the centre of the glob layer toward a visible purple core (radial colour gradient or a second smaller dark alpha-blend sprite inside) and widen the white wet highlight into a short crescent so the strongest tiles read as highlight / acid body / dark core."+ },+ "VFX_Poison_Cloud": {+ "criterion": "shape_change",+ "fix": "After the splash, the fume body f30-f68 is a thin translucent haze that only fades uniformly; make the fume layer denser and drive an alpha-threshold dissolve (noise erosion) from f40 to f80 so it breaks into separate low clumps that pile downwind rather than just lowering opacity."+ },+ "VFX_Projectile_Dark": {+ "criterion": "tail",+ "fix": "Nothing is left on the path behind the orb (f16-f36 path is empty; f45 only faint wisps on the target, f54-f60 empty); emit the broken wisp strokes and grey smoke wake in world space along the path from f6 to f30 with a 25-35 frame life that cools magenta to grey, plus a few hanging glints, so f40-f54 show a deliberate fading streak along the line of flight."+ },+ "VFX_Dark_Vortex": {+ "criterion": "shape_change",+ "fix": "The black-horizon sphere f6-f56 is a clean round disc that only scales up and then shrinks; apply UV distortion/noise erosion to its rim and a tilted, torn accretion-disk ring that rotates with it from f6 to f56 so the outline wobbles and tears before the collapse at f60-f61."+ },+ "VFX_Hit_Heavy": {+ "criterion": "timing",+ "fix": "The two-frame anticipation is effectively invisible: f1-f2 show only a faint glint on the target's chest. Make the pre-flash layer at f1-f2 a readable inward pinch (small bright core plus 4-6 short streaks converging on the contact point) so the white flash at f3-f5 lands after a visible wind-up."+ },+ "VFX_Slash_Fire": {+ "criterion": "layering",+ "fix": "The blade arc at f3-f8 is a flat pale cream; tint the arc body to saturated orange-red with a dark red trailing rim, keeping white only along the leading edge and the contact flash at f4-f5, so the slash itself reads as fire before the flame puffs appear at f11."+ },+ "VFX_Magic_Charge": {+ "criterion": "layering",+ "fix": "At the release f65-f68 and the tightened core f56-f63 everything is white plus pale blue; add a deep violet/navy rim layer behind the core and on the outer edge of the release shell (f68-f76) so there is a dark outer band under the white core and blue body."+ },+ "VFX_Shield_Dome": {+ "criterion": "shape_change",+ "fix": "During the hold f18-f80 the dome is a static flat blue sphere with only a faint scan band; drive a scrolling hex/noise UV distortion or a brighter scan band that clearly sweeps bottom-to-top every ~20 frames so the shell surface visibly moves between f18, f32, f70 and f80."+ },+ "VFX_Heal": {+ "criterion": "layering",+ "fix": "At the plateau f31-f40 the column is one flat mint green; add a white-hot inner core streak rising through the caster's body and a deeper teal/darker green outer fringe on the column edges so the peak tile shows core, body and rim."+ }+ },+ "note": "VFX_Projectile_Ice and VFX_Projectile_Dark were judged iterate: they are complete, buildable examples with a known weakest point, not finished baselines."+ }+}diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Dark_Vortex.py b/skills/effekseer-vfx/assets/examples/src/VFX_Dark_Vortex.pynew file mode 100644index 0000000..e80c4d9--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Dark_Vortex.py@@ -0,0 +1,72 @@+"""VFX_Dark_Vortex: Dark impact played where VFX_Projectile_Dark arrives: a black hole that feeds, then releases.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ violet=(150,60,255,255); magenta=(225,120,255,255); pale=(245,225,255,255); ash=(118,108,126,170); ember=(255,125,45,230)+ # A volume, not a screen sticker: a black horizon inside a torn accretion disk lying in a tilted 3D plane (far half+ # drawn behind the horizon, near half across it; the Godot plugin ignores effect depth writes, so draw order does the+ # occlusion), broken wisp strokes swirling round it at random tilts, ground dust and rocks dragged in, then one release.+ DISK=[-72,0,0] # nearly flat, tipped 18 degrees toward the camera: an ellipse in perspective+ GROUND=-.93 # floor height below the body anchor (Lab: body sits 0.95 m up)+ grow=[[0,.6],[20,1],[85,.9],[100,.05]] # opens fast, then only contracts: dark draws inward+ def disk(tag,sweeps,colors=((200,105,255,230),(250,175,255,255))):+ # Accretion disk half as broken strands in the disk plane: each sweep is redrawn every 16 frames at two radii and+ # tightens toward the horizon over its life, so the disk churns and feeds instead of sitting there as a clean dish.+ return [wisps(f'{tag} {i}',colors[i%2],(1.9,1.35)[i%2],count=4,interval=16,width=(.55,.3)[i%2],sweep=sweep,life=(22,26),delay=2*i,tilt=DISK,size=1,+ size_curve=[[0,1.2],[100,.7]],flow=-.07,broken=.12,emissive=(1.4,1.9)[i%2]) for i,sweep in enumerate(sweeps)]+ def swirl(tag,color,radius,width,delay,**kw):+ # Six partial strokes per layer, redrawn every 9 frames at a new tilt near the disk plane: the charge swirls and crosses.+ return wisps(tag,color,radius,count=6,interval=9,width=width,sweep=(0,170),life=(16,22),delay=delay,tilt=((-80,40),(0,360),(-45,45)),size=1,+ size_curve=[[0,1.15],[100,.35]],flow=-.06,**kw)+ release_wave=[wisps('Release arc A',(215,150,255,220),3.0,count=1,width=.55,sweep=(0,200),life=18,delay=62,tilt=DISK,size=1,broken=.15),+ wisps('Release arc B',pale,1.3,count=1,width=.3,sweep=(360,170),life=16,delay=63,tilt=[DISK[0],0,40],size=1,broken=.15)]+ return effect('Dark_Vortex','Dark Vortex','element','dark',1.65,[+ glow('Back glow',(120,40,255,110),3.0,life=62,size_curve=[[0,1.15],[80,.8],[100,.2]],fade_in=4,fade_out=5), # behind the horizon; contracts while feeding+ # Ground: grey dust and dark rocks are dragged in along the floor toward the hole while it feeds.+ smoke('Inflow dust',(150,140,155,165),count=7,size=(.6,.95),grow=.6,life=(30,38),interval=7,spawn=dict(shape='Sphere',radius=[0,.01],rotate=False),rise=0,+ travel=dict(start=[[-2.4,2.4],GROUND,[-1.6,1.6]],end=[0,GROUND+.15,0],easing='EaseInCubic')),+ *disk('Disk far',[(-85,10),(-20,80)]),+ swirl('Swirl back',(170,80,255,230),1.7,.45,0),+ sprite('Event horizon','T_Dot01',(0,0,0,215),life=62,size=1.5,size_curve=grow,billboard='Billboard',blend='Blend',fade_in=4,fade_out=3),+ glow('Hot singularity',pale,.45,life=60,size_curve=[[0,.2],[60,.8],[90,1.3],[100,.4]],fade_in=6,fade_out=4,emissive=1.8),+ wisps('Photon wisps',pale,.95,count=3,interval=20,width=.09,sweep=(0,120),life=(22,26),tilt=((-12,12),(-12,12),(0,360)),size=(.85,1.0),flow=-.1,emissive=1.6),+ *disk('Disk near',[(95,200),(170,265)]),+ swirl('Swirl front',(245,170,255,255),1.3,.32,4,emissive=2.4),+ distortion_ring('Gravitational lensing',2.6,life=62,strength=1.4,size_curve=grow,fade_in=6,fade_out=4),+ sprite('Rubble infall','T_Shard01',(120,108,112,255),count=6,interval=6,life=[34,44],blend='Blend',rotation=[0,0,[-180,180]],spin=[0,0,[-14,14]],size=[.14,.28],size_end=.05,+ travel=dict(start=[[-2.6,2.6],[GROUND,GROUND+.3],[-1.4,1.4]],end=[0,0,0],easing='EaseInCubic'),fade_in=2,fade_out=4),+ # Infall: a spinning pivot in the disk plane carries particles that ease from the outer disk into the hole -> spirals.+ dict(name='Infall pivot',renderer='None',life=62,rotation=[DISK[0]+90,0,0],spin=[0,-7,0],children=[+ motes('Disk matter',26,pale,color_end=violet,life=(18,26),interval=2,size=(.12,.24),spawn=None,+ travel=dict(start=[[-2.4,2.4],[-.12,.12],[-2.4,2.4]],end=[0,0,0],easing='EaseInQuadratic'),turbulence=.0004),+ radial_sparks('Disk streaks',16,pale,color_end=magenta,life=(12,16),interval=3,length=(.7,1.2),width=.08,emissive=2.0,spawn=None,+ travel=dict(start=[[-2.2,2.2],[-.1,.1],[-2.2,2.2]],end=[0,0,0],easing='EaseInCubic'))]),+ # Impact frame: the stage drops to near-black on the release frames and the white burst fires over it (drawn after),+ # the anime "black frame + white flash" beat.+ sprite('Impact frame','T_SoftCircle',(4,0,10,215),life=2,delay=62,size=26,billboard='Billboard',blend='Blend',fade_in=0,fade_out=1),+ # Contact: a narrow hot disk rim preserves the absorptive centre; the slice carries the brightest accent.+ wisps('Collapse rim',pale,.8,count=1,width=.095,sweep=(0,285),life=5,delay=62,tilt=DISK,size=1,broken=.1,emissive=2.0),+ sprite('Collapse core','T_Smoke02',(8,2,18,245),life=8,delay=61,size=1.2,size_curve=[[0,1],[35,.85],[100,.12]],billboard='Billboard',blend='Blend',cutoff=[[0,0],[100,.7]],fade_in=0,fade_out=4),+ glow('Release bloom',(150,60,255,140),4.0,life=18,delay=62),+ slice_line('Slice line',pale,10,width=.07,angle=-14,life=14,delay=62),+ slice_line('Cross line',(225,150,255,255),5.5,width=.045,angle=68,life=10,delay=64),+ # The release lies down on the disk plane as two torn strokes sweeping opposite ways, then goes out as grey smoke arcs.+ *release_wave,*[decay(arc,ash,lag=6,stretch=1.65) for arc in release_wave],+ decal('Ground spiral','T_Vortex01',magenta,4.2,life=26,delay=62,spin=4,color_end=fade((110,90,120,255)),position=[.35,GROUND,.2],alpha_texture='T_NoiseTile01',cutoff=[[0,.2],[100,.65]],fade_in=0,fade_out=16,emissive=1.4),+ decal('Spiral brand','T_Vortex01',(70,62,78,190),4.4,life=30,delay=68,spin=1.2,blend='Blend',position=[.35,GROUND+.01,.2],alpha_texture='T_NoiseTile01',cutoff=[[0,.15],[100,.6]],fade_in=4,fade_out=18),+ # Complementary accent: a hot orange rim under the near side of the release, 5-10% of the frame.+ wisps('Ember rim',ember,2.1,count=1,width=.22,sweep=(100,265),life=16,delay=62,tilt=(-90,0,0),size=1,position=[0,GROUND+.05,0],broken=.12,emissive=1.6),+ distortion_ring('Release refraction',4.4,life=14,delay=62,strength=1.1),+ radial_sparks('Release needles',14,pale,color_end=violet,distance=(1.4,3.6),life=(14,28),length=(.6,1.3),delay=62),+ # Ground pivot: eased travel ends are local positions, so floor-level rolls live under a node sitting on the floor.+ dict(name='Ground pivot',renderer='None',life=99,position=[0,GROUND+.25,0],children=[+ smoke('Residue',ash,count=7,size=(.7,1.1),life=(26,32),delay=64,spawn=dict(shape='Circle',radius=[.3,.8],rotate=True,division=7),+ travel=dict(end=[[1.0,1.9],0,0],easing='EaseOutCubic'),rise=.0003)]),+ motes('Afterglints',10,(255,215,255,255),color_end=violet,life=(26,32),delay=66,distance=(.6,2.2),size=(.08,.16),texture='T_Star01',turbulence=.002),+ ],attach='body',peak=1.05,impact=.9,light=(.7,.35,1),delivery=dict(kind='projectile',projectile='VFX_Projectile_Dark'),+ design='A black horizon inside a torn tilted accretion disk; broken wisp strokes swirl round it at shifting tilts while ground dust and rocks are dragged in. Two dark impact frames, then a long slice line, two torn disk-plane arcs with an orange under-rim and a branded ground spiral; the light goes out as grey smoke arcs and glints.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Fire_Explosion.py b/skills/effekseer-vfx/assets/examples/src/VFX_Fire_Explosion.pynew file mode 100644index 0000000..4ff9b33--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Fire_Explosion.py@@ -0,0 +1,48 @@+"""VFX_Fire_Explosion: Fire impact played where VFX_Projectile_Fire arrives.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ white=(255,250,225,255); yellow=(255,205,90,255); orange=(255,120,25,255); red=(200,40,10,255)+ GROUND=-.93 # floor below the body anchor (Lab: body sits 0.95 m up); the blast centres on the torso, not the head+ THROUGH=[[.4,3.2],[.4,2.6],[-1.3,1.3]] # the shot travels +X: debris and sparks follow it through the target+ ground_arcs=[wisps('Ground lick A',(255,150,50,220),1.5,count=1,width=.5,sweep=(200,330),life=14,delay=7,tilt=(-90,0,0),size=1,position=[0,GROUND+.06,0],flow=-.05),+ wisps('Ground lick B',(255,190,90,200),2.1,count=1,width=.35,sweep=(20,150),life=18,delay=9,tilt=(-90,0,0),size=1,position=[0,GROUND+.06,0],flow=.05)]+ return effect('Fire_Explosion','Fire Explosion','element','fire',1.3,[+ decal('Scorch','T_Crack01',(36,24,18,180),3.4,life=48,delay=7,blend='Blend',position=[0,GROUND+.03,0],size_curve=[[0,.5],[8,1],[100,1.02]],fade_in=0,fade_out=26,angle=40),+ decal('Glowing cracks','T_Crack01',(255,100,25,255),3.4,life=34,delay=7,position=[0,GROUND+.04,0],size_curve=[[0,.5],[8,1],[100,1.02]],color_end=fade(red),fade_in=0,fade_out=24,emissive=1.6,angle=40),+ shadow('Dark backing',(40,18,10,150),5.0,life=22,delay=7),+ glow('Gather',(255,150,60,200),1.6,life=6,size_curve=[[0,1],[100,.15]],fade_in=2,fade_out=1),+ radial_sparks('Inward fuse',6,(255,170,75,255),color_end=(255,220,140,255),life=(7,7),width=.055,length=(.3,.5),+ spawn=dict(shape='Sphere',radius=[.7,1.0]),travel=dict(end=[0,[-1.0,-.7],0],easing='EaseInCubic'),fade_in=1,fade_out=2),+ flash('Detonation flash',white,6,life=3,delay=9),+ glow('Fire core',(255,205,90,200),3.0,life=5,delay=9,emissive=1.3),+ # The same billow, alpha-blended and dark, takes over as the fire burns out, so smoke grows out of the fireball.+ # Listed before the fire so the fire draws on top of it instead of being blotted out.+ billow('Smoke billow',[(0,(110,92,80,0)),(20,(140,125,112,240)),(60,(110,104,98,210)),(100,(75,75,80,0))],size=[2.0,3.8],life=[48,56],count=4,delay=14,interval=2,blend='Blend',+ flipbook=dict(x=4,y=4,frame_length=5,loop='Once'),spawn=dict(shape='Sphere',radius=[.2,.9]),velocity=[[.004,.01],[.018,.032],0],spin=[0,0,[-.4,.4]],fade_out=8,position=[.3,.1,0]),+ # Painted flipbook billows that cool as they roll, thrown off-centre along the shot so the ball is lopsided.+ billow('Fireball',[(0,(255,210,150,255)),(12,orange),(45,(235,65,10,240)),(75,(170,35,10,200)),(100,(60,10,5,0))],size=[1.6,3.4],life=[24,32],count=3,delay=6,interval=1,+ spawn=dict(shape='Sphere',radius=[.2,1.0]),position=[.35,0,0],velocity=[0,[.006,.02],0],spin=[0,0,[-.8,.8]],emissive=.85,+ alpha_texture='T_NoiseTile01',cutoff=[[0,0],[30,.12],[60,.42],[100,.8]],alpha_scroll=[.018,-.01],edge=dict(color=[255,80,15,255],threshold=.05,scaling=2)),+ # A mushroom head that keeps climbing after the blast.+ billow('Mushroom',[(0,orange),(25,(235,80,20,240)),(70,(150,35,10,180)),(100,(50,15,8,0))],size=[1.6,2.2],life=[30,36],count=2,delay=12,interval=3,+ spawn=dict(shape='Sphere',radius=[0,.3],rotate=False),travel=dict(end=[[.3,.75],[1.6,2.1],[-.2,.2]],easing='EaseOutCubic'),emissive=.85,+ alpha_texture='T_NoiseTile01',cutoff=[[0,0],[40,.08],[100,.6]],edge=dict(color=[255,80,15,255],threshold=.05,scaling=2)),+ *ground_arcs,*[decay(arc,(90,78,70,170),lag=5,stretch=2.0) for arc in ground_arcs],+ distortion_ring('Refraction wave',3.8,life=16,delay=6,strength=1.0),+ heat_haze('Heat haze',4.2,life=50,delay=8,strength=.5),+ flame('Ground licks',orange,fade(red),size=[.8,1.3],size_end=[.4,.6],count=5,delay=10,interval=2,life=[24,32],+ spawn=dict(shape='Circle',radius=[.6,1.5],division=5,order='Random',rotate=False),position=[0,GROUND,0],fade_in=1,fade_out=12),+ *spark_burst('Shrapnel sparks',20,white,(255,80,0,255),distance=(1.6,3.8),life=(18,36),length=(.5,1.2),delay=6,gravity=.0012,floor=.02),+ radial_sparks('Blow-through streaks',10,white,color_end=orange,life=(10,16),length=(.8,1.5),width=.07,delay=6,**spray([[2.2,4.6],[.2,2.0],[-1.2,1.2]])),+ debris('Char debris',8,THROUGH,color=(112,96,88,255),size=(.14,.3),life=(32,46),delay=6,floor=.02),+ smoke('Ground dust',(150,138,126,170),count=8,size=(.6,.9),grow=1.8,life=(22,28),delay=8,spawn=dict(shape='Circle',radius=[.8,1.3],rotate=True,division=8),+ travel=dict(end=[[1.2,2.0],0,0],easing='EaseOutCubic'),rise=.0001,position=[0,GROUND+.2,0]),+ motes('Rising embers',18,orange,color_end=(255,30,0,255),life=(30,48),distance=(.6,2.0),delay=9,rise=.0006,radius=(.2,.9)),+ ],attach='body',peak=.17,impact=1,light=(1,.6,.25),delivery=dict(kind='projectile',projectile='VFX_Projectile_Fire'),+ design='Inward gather, white detonation, a lopsided flipbook fireball thrown along the shot that rolls, cools white to red and burns open, a climbing mushroom head, two broken ground licks that go out as grey smoke, blow-through streaks, char debris that lands, a dust roll, glowing cracks over a dark scorch, ground flames, then the same billow as smoke.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Heal.py b/skills/effekseer-vfx/assets/examples/src/VFX_Heal.pynew file mode 100644index 0000000..224be77--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Heal.py@@ -0,0 +1,21 @@+"""VFX_Heal: Heal on the caster: no impact frame, a slow upward rise.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ green=(110,255,170,255); pale=(225,255,235,255); teal=(40,220,160,255)+ return effect('Heal','Heal','status','holy',1.7,[+ decal('Blessing seal','T_Rune02',green,3.4,life=88,spin=.6,size_curve=[[0,.2],[14,1.05],[24,1],[100,1.05]],color_end=teal,fade_in=4,fade_out=34,emissive=1.3),+ decal('Floor glow','T_Glow01',(60,230,140,150),4.4,life=88,fade_in=10,fade_out=30),+ column('Soft column',(90,255,170,200),.95,3.6,life=74,delay=8,scroll=(.003,-.012),fade_in=12,fade_out=28),+ shock_ring('Rising rings',green,1.25,life=40,delay=8,ground=True,count=3,interval=13,travel=dict(start=[0,.15,0],end=[0,2.5,0],easing='EaseOutCubic'),thickness=.1,size_curve=[[0,.5],[30,1],[100,.8]]),+ sprite('Plus signs','T_Cross01',pale,color_end=green,count=9,delay=10,interval=5,life=[30,40],size=[.22,.36],size_end=[.1,.16],+ spawn=dict(shape='Circle',radius=[.3,.9],rotate=False),position=[0,.3,0],travel=dict(start=[0,0,0],end=[0,[1.5,2.4],0],easing='EaseOutQuadratic'),billboard='Billboard',fade_in=5,fade_out=10,emissive=1.4),+ motes('Life motes',30,pale,color_end=green,life=(30,46),delay=6,interval=1.6,size=(.08,.18),spawn=dict(shape='Circle',radius=[.2,1.1],rotate=False),travel=dict(end=[0,[1.4,3.0],0],easing='EaseOutQuadratic')),+ sprite('Twinkles','T_Star01',pale,count=10,delay=14,interval=5,life=[12,18],size=[.3,.6],size_end=0,position=[[-.8,.8],[.4,2.4],[-.3,.6]],rotation=[0,0,[0,90]],fade_in=2,fade_out=5),+ glow('Body bloom',(120,255,180,150),3.2,life=40,delay=14,position=[0,1.1,0],size_curve=[[0,.5],[40,1],[100,1.1]],fade_in=12,fade_out=24),+ ],attach='ground',peak=.6,light=(.5,1,.7),delivery=SELF,design='No impact frame at all: slow seal, soft scrolling column, rings and plus signs drifting upward, a gentle bloom on the body.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Hit_Heavy.py b/skills/effekseer-vfx/assets/examples/src/VFX_Hit_Heavy.pynew file mode 100644index 0000000..5a23d44--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Hit_Heavy.py@@ -0,0 +1,24 @@+"""VFX_Hit_Heavy: Heavy melee hit: the blow lands on the target in place.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ hot=(255,236,170,255); orange=(255,140,40,255)+ return effect('Hit_Heavy','Heavy Hit','hit','physical',.5,[+ shadow('Dark backing',(30,14,8,150),3.6,life=14,delay=3),+ glow('Anticipation',(255,200,120,160),.5,life=3),+ flash('Contact flash',WHITE,4.2,life=5,delay=2,angle=18),+ sprite('Impact burst','T_Impact01',hot,color_end=orange,delay=2,life=10,size=2.6,size_curve=[[0,.45],[20,1],[100,1.12]],rotation=[0,0,[-30,30]],alpha_texture='T_NoiseTile01',cutoff=DISSOLVE,fade_in=0,fade_out=4,emissive=1.5),+ sprite('Speed lines','T_SpeedLines01',hot,delay=2,life=7,size=4.4,size_curve=[[0,.4],[40,1],[100,1.2]],rotation=[0,0,[0,360]],fade_in=0,fade_out=5),+ glow('Heat bloom',(255,120,30,200),3.4,life=14,delay=2),+ shell('Air bubble',(255,220,170,200),1.6,life=11,delay=3),+ tilted_ring('Air wave',(255,220,170,170),2.0,life=11,delay=3,thickness=.22,tilt=(0,58,0)),+ distortion_ring('Refraction wave',2.4,life=12,delay=2,strength=.8),+ *spark_burst('Sparks',20,hot,(255,70,10,255),distance=(1.0,2.6),life=(10,18),length=(.5,1.1),delay=2),+ motes('Embers',12,orange,color_end=(255,40,0,255),life=(22,27),distance=(.5,1.6),delay=3,rise=-.0006),+ smoke('Dust',(185,160,135,230),color_end=(150,125,105,140),count=5,size=(.7,1.1),life=(22,26),delay=4),+ ],peak=.05,impact=.9,delivery=MELEE,design='Two-frame anticipation, white flash, dissolving jagged burst, eased sparks that hang and droop, dust.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Ice_Spikes.py b/skills/effekseer-vfx/assets/examples/src/VFX_Ice_Spikes.pynew file mode 100644index 0000000..dac87f5--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Ice_Spikes.py@@ -0,0 +1,61 @@+"""VFX_Ice_Spikes: Ground ice eruption played where VFX_Projectile_Ice arrives.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ white=(240,252,255,255); cyan=(130,215,255,255); deep=(50,120,255,255)+ grow=[[0,0],[10,1.12],[18,.97],[26,1],[70,1],[88,.85],[100,.1]]+ # Faceted crystal meshes that punch up through the frost: real silhouettes from any angle, not painted cards.+ def spikes(tag,height,radius,delay,**kw):+ return crystal(tag,(125,210,255,245),height,radius,40,edge=(190,235,255,230),delay=delay,scale_start=[1,1,1],scale_curve=grow,+ alpha_texture='T_NoiseTile02',cutoff=[[0,0],[78,0],[100,.95]],fade_in=0,fade_out=4,emissive=.85) | dict(falloff=dict(begin=[155,215,255,235],end=[205,240,255,245],pow=.35,blend='Mul'),culling='Front') | kw+ # Prism fringe on the cold wave: the same broken stroke in three hues, a few centimetres apart (ice's complementary accent).+ prism=[wisps(f'Cold wave {tag}',color,2.6,count=1,width=.25,sweep=(-30,230),life=14,delay=delay,tilt=(-90,0,0),size=1,position=[dx,.08,0],broken=.08,flow=-.06,texture='T_Trail02')+ for tag,color,dx,delay in [('R',(255,140,190,150),-.06,8),('G',(150,255,220,150),0,8),('B',(130,170,255,190),.06,9)]]+ return effect('Ice_Spikes','Ice Spikes','element','ice',1.35,[+ # Frost: a torn, uneven patch with bright cracks running through it, not a clean disc.+ decal('Frost creep','T_Smoke02',cyan,4.2,life=60,size_curve=[[0,.1],[12,.8],[30,1],[100,1.03]],color_end=fade(deep),cutoff=[[0,.05],[100,.5]],fade_in=0,fade_out=30,angle=60),+ decal('Frost cracks','T_Crack01',(200,240,255,220),4.0,life=58,delay=3,size_curve=[[0,.3],[14,1],[100,1.02]],color_end=fade(deep),fade_in=0,fade_out=26,emissive=1.3,angle=25),+ decal('Frost glow','T_Glow01',(60,150,255,130),4.6,life=55,delay=2),+ # A tight core cluster leaning apart, a scatter of uneven crystals round it, and a ripple of crystals erupting in+ # sequence along the shot (+X), shrinking as they go.+ spikes('Core crystals',3.0,.42,6,count=3,interval=.5,rotation=[[-16,16],[0,360],[-16,16]],position=[[-.25,.25],0,[-.25,.25]]),+ # Scale curves need a fixed start scale, so size variety comes from two layers instead of a random scale.+ spikes('Outer crystals',1.9,.3,8,count=3,interval=.6,spawn=dict(shape='Circle',radius=[.6,1.3],division=3,order='Random',rotate=True,angle_noise=40),+ rotation=[[10,34],0,[-15,15]]),+ spikes('Outer shards',1.0,.2,9,count=5,interval=.8,spawn=dict(shape='Circle',radius=[.9,1.45],division=5,order='Random',rotate=True,angle_noise=40),+ rotation=[[22,48],0,[-18,18]]),+ spikes('Ripple crystals',1.1,.24,9,count=3,interval=3,spawn=dict(shape='Line',start=[.7,0,-.2],end=[1.6,0,.5],division=5,order='Random',rotate=False,noise=.4),+ rotation=[[-24,20],[0,360],[-50,-8]]),+ glow('Crystal glow',(80,170,255,80),2.4,life=40,delay=6,position=[0,1.2,0],size_curve=[[0,.3],[15,1],[100,.55]],color_curve=ramp((0,(80,170,255,80)),(25,(50,120,220,55)),(100,(25,65,150,0)))['color_curve'],fade_in=2,fade_out=16),+ # Contact: a sharp thin ice star tilted off-axis, distinct from the other elements' contacts.+ sprite('Eruption glint','T_Star01',WHITE,life=5,delay=8,size=3.4,size_curve=[[0,.5],[25,1],[100,.2]],rotation=[0,0,17],position=[0,1.3,.4],fade_in=0,fade_out=3,emissive=2.2),+ *prism,+ distortion_ring('Cold refraction',3.6,life=14,delay=8,strength=.8,ground=True,position=[0,.1,0]),+ # The hold is alive: thin halo rings climb the cluster and glints wink on the facets.+ *[shock_ring(f'Halo {i}',(210,240,255,200),r,life=20,delay=d,ground=True,thickness=.06,rotation=[-90+tilt,0,0],+ travel=dict(start=[0,.3,0],end=[0,h,0],easing='EaseOutCubic')) for i,(r,d,h,tilt) in enumerate([(1.1,14,2.4,8),(1.6,25,3.0,-6)])],+ sprite('Facet glints','T_Star01',WHITE,count=8,interval=5,delay=12,life=[8,12],size=.35,size_curve=[[0,.2],[30,1],[100,0]],rotation=[0,0,[0,90]],+ position=[[-.9,.9],[.6,2.6],[-.5,.5]],fade_in=0,fade_out=3,emissive=2.0),+ # Cold mist sinks and rolls outward along the floor.+ smoke('Frost mist',(165,212,255,160),count=8,size=(.8,1.2),grow=1.7,life=(30,40),delay=10,interval=4,spawn=dict(shape='Circle',radius=[.8,1.4],rotate=True,division=8),+ travel=dict(end=[[1.0,1.6],0,0],easing='EaseOutCubic'),rise=-.0002,position=[0,.25,0]),+ smoke('Kicked dust',(170,185,200,150),count=6,size=(.5,.8),grow=1.6,life=(26,36),delay=8,spawn=dict(shape='Circle',radius=[.6,1.0],rotate=True,division=6),+ travel=dict(end=[[.8,1.4],0,0],easing='EaseOutCubic'),rise=.0001,position=[0,.2,0]),+ debris('Frozen rubble',6,[[-.6,2.6],[.8,2.2],[-1.2,1.2]],color=(70,86,112,255),size=(.12,.24),life=(28,40),delay=8,floor=.02),+ motes('Ice dust',16,white,color_end=cyan,life=(26,50),distance=(.5,1.8),delay=8,hemisphere=True,size=(.07,.15),rise=.0002),+ # Pre-shatter tell: a two-frame glint over the cluster, then it breaks two frames later.+ flash('Crack glint',(220,245,255,255),3.2,life=3,delay=47,position=[0,1.5,.3],angle=30),+ crystal('Shatter shards',(80,170,255,170),1,.22,[16,28],edge=(180,230,255,200),count=5,delay=50,+ spawn=dict(shape='Sphere',radius=[.3,.9],rot_x=[5,90]),travel=dict(end=[0,[.8,2.0],0],easing='EaseOutCubic'),forces=[dict(type='Gravity',gravity=[0,-.002,0])],+ spin=[[-9,9],[-9,9],[-9,9]],scale_start=[[.4,.55],[.5,.8],[.4,.55]],scale_end=[.12,.2,.12],easing='EaseInCubic',fade_in=0,fade_out=5,emissive=1.0,+ collide=dict(height=.02,bounce=[.2,.35],friction=.5,reduction=.3)),+ sprite('Shard chips','T_IceShard01',(200,235,255,255),count=12,delay=50,life=[14,24],size=[.12,.24],rotation=[0,0,[-180,180]],spin=[0,0,[-12,12]],+ spawn=dict(shape='Sphere',radius=[.3,1.0],rot_x=[5,90]),travel=dict(end=[0,[1.0,2.4],0],easing='EaseOutCubic'),forces=[dict(type='Gravity',gravity=[0,-.003,0])],+ fade_in=0,fade_out=4,emissive=1.4),+ ],attach='ground',peak=.2,impact=.7,light=(.6,.85,1),delivery=dict(kind='projectile',projectile='VFX_Projectile_Ice'),+ design='Torn frost with bright cracks spreads on the ground; a leaning core cluster, an uneven scatter of crystals and a ripple of crystals erupting along the shot punch up with overshoot; a prism-fringed broken cold wave, rubble and dust; during the hold halo rings climb, glints wink and mist rolls out; a glint, then it cracks apart into large shards and chips.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Magic_Charge.py b/skills/effekseer-vfx/assets/examples/src/VFX_Magic_Charge.pynew file mode 100644index 0000000..be3d3cb--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Magic_Charge.py@@ -0,0 +1,25 @@+"""VFX_Magic_Charge: Arcane charge on the caster: a long inward build, then one release.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ cyan=(120,220,255,255); pale=(235,250,255,255); blue=(60,120,255,255)+ return effect('Magic_Charge','Magic Charge','magic','arcane',1.5,[+ motes('Gathering motes',46,pale,color_end=cyan,life=(16,26),interval=1.2,size=(.09,.2),spawn=dict(shape='Sphere',radius=[1.6,2.6]),travel=dict(end=[0,[-2.6,-1.6],0],easing='EaseInQuadratic'),turbulence=.0005),+ radial_sparks('Gathering streaks',24,cyan,color_end=pale,life=(9,14),interval=2.4,length=(.5,.9),width=.07,spawn=dict(shape='Sphere',radius=[1.8,2.4]),travel=dict(end=[0,[-2.4,-1.8],0],easing='EaseInCubic')),+ # Two rune bands on different tilted planes orbit the core like a gyroscope and tighten as the charge builds.+ orbit_band('Orbit ring A',cyan,pale,(60,120,255,0),1.5,.22,64,tilt=(-62,0,28),flow=-.05,size=1,size_curve=[[0,1.3],[85,.55],[100,.2]],fade_in=12,fade_out=4,emissive=1.5),+ orbit_band('Orbit ring B',cyan,pale,(60,120,255,0),1.25,.18,60,tilt=(-10,62,0),flow=.07,delay=4,size=1,size_curve=[[0,1.3],[85,.5],[100,.2]],fade_in=12,fade_out=4,emissive=1.5),+ # Shells that implode onto the core: the gather reads as a volume collapsing, not a hoop shrinking on screen.+ shell('Converging shell',(120,220,255,170),2.0,life=20,delay=6,count=3,interval=18,scale_curve=[[0,1],[100,.1]],pow=.25,fade_in=6,fade_out=3),+ glow('Core',pale,1.7,life=64,size_curve=[[0,.1],[85,1],[100,1.25]],fade_in=6,fade_out=3,emissive=1.6),+ glow('Aura',(60,130,255,170),3.6,life=64,size_curve=[[0,.2],[85,1],[100,1.2]],fade_in=10,fade_out=3),+ flash('Charged flash',WHITE,5.6,life=6,delay=64,angle=20),+ glow('Charged bloom',(110,190,255,230),4.6,life=18,delay=64),+ shell('Charged shell',pale,2.6,life=12,delay=65),+ radial_sparks('Charged sparks',20,pale,color_end=blue,distance=(.9,2.4),life=(12,22),length=(.5,1.0),delay=64),+ ],attach='caster',peak=1.08,impact=.5,light=(.6,.8,1),delivery=SELF,design='Motes and streaks accelerate inward while two tilted rune bands orbit the core like a gyroscope and tighten onto it, then a single flash confirms the charge.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Poison_Cloud.py b/skills/effekseer-vfx/assets/examples/src/VFX_Poison_Cloud.pynew file mode 100644index 0000000..4cde1f2--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Poison_Cloud.py@@ -0,0 +1,48 @@+"""VFX_Poison_Cloud: Poison splash and lingering cloud played where VFX_Projectile_Poison arrives.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ green=(120,220,60,255); dark=(40,90,25,200); acid=(210,255,90,255); hot=(240,255,205,255); bruise=(52,26,62,170)+ GROUND=-.93 # floor below the body anchor (Lab: body sits 0.95 m up)+ return effect('Poison_Cloud','Poison Cloud','status','poison',1.75,[+ # Ground: an uneven acid pool spreads under the target, rim glowing, and bubbles keep breaking out of it.+ # An irregular painted puff laid flat is a ragged puddle; a soft circle reads as a clean disc however it is eroded.+ decal('Acid pool','T_Smoke02',(55,120,28,210),4.6,life=101,delay=3,blend='Blend',position=[.1,GROUND+.02,0],size_curve=[[0,.2],[12,.85],[100,1.05]],+ cutoff=[[0,.05],[100,.5]],fade_in=0,fade_out=34,angle=20),+ decal('Pool sheen','T_Smoke02',(160,255,70,120),3.6,life=80,delay=4,position=[.2,GROUND+.03,.1],size_curve=[[0,.2],[12,.85],[100,1.05]],+ cutoff=[[0,.25],[100,.8]],fade_in=0,fade_out=30,emissive=1.3,angle=140),+ sprite('Acid glints','T_Star01',(245,255,220,255),count=10,interval=8,delay=6,life=[8,12],size=.3,size_curve=[[0,.2],[30,1],[100,0]],rotation=[0,0,[0,90]],+ position=[[-.9,1.5],[GROUND+.1,GROUND+.5],[-.8,.8]],fade_in=0,fade_out=3,emissive=2.0),+ # Splash: a white-hot acid flash and three broken strokes thrown at random tilts.+ # Contact is a ragged acid splat, not the shared four-point flare.+ sprite('Splash shadow','T_Explosion01',(65,22,78,240),life=10,delay=0,size=1.65,size_curve=[[0,1],[30,1.05],[100,1.15]],position=[0,-.12,0],rotation=[0,0,25],blend='Blend',cutoff=[[0,0],[100,.75]],fade_in=0,fade_out=5),+ glow('Splash core',(245,255,225,255),.32,life=3,delay=1,fade_out=2,emissive=1.8),+ sprite('Splash flash','T_Explosion01',(215,255,130,255),life=3,delay=1,size=.9,size_curve=[[0,.5],[30,1],[100,1.15]],rotation=[0,0,25],fade_in=0,fade_out=2,emissive=2.0),+ wisps('Splash strokes',acid,1.0,count=3,width=.3,sweep=(0,120),life=10,delay=1,size=(.8,1.2),emissive=1.6),+ sprite('Burst puff','T_Explosion01',(105,190,45,255),color_end=dark,count=2,delay=1,life=[18,24],size=[.65,.9],size_end=[1.0,1.3],easing='EaseOutQuartic',blend='Blend',+ spawn=dict(shape='Sphere',radius=[.1,.3]),rotation=[0,0,[-180,180]],alpha_texture='T_NoiseTile01',cutoff=[[0,0],[30,.1],[100,.9]],fade_in=0,fade_out=5),+ glow('Sick glow',(140,255,60,45),1.8,life=50,size_curve=[[0,.3],[10,1],[100,1.1]],fade_in=2,fade_out=30),+ # Value structure: a bruised purple underside first, then fumes that cool from acid yellow-green to murky green+ # to purple-grey, piled low and downwind (+X) instead of a round ball.+ smoke('Bruise smoke',(84,42,100,215),count=6,size=(.9,1.3),grow=1.5,life=(44,58),delay=5,interval=5,spawn=dict(shape='Sphere',radius=[.2,1.0],rot_x=[-80,0]),speed=(0,0),rise=-.0003,position=[.4,-.55,0]),+ smoke('Lingering fumes',(150,230,70,150),count=9,size=(.4,.9),grow=1.4,life=(42,54),delay=6,interval=4,spawn=dict(shape='Sphere',radius=[.3,1.3],rot_x=[-70,10]),speed=(0,0),rise=-.0005,position=[.5,-.35,0],+ color_curve=ramp((0,(185,245,95,190)),(25,(110,160,50,180)),(45,(100,92,110,170)),(100,(72,62,82,0)))['color_curve']),+ # Heavy fog rolls out along the floor from under the pool.+ dict(name='Ground pivot',renderer='None',life=105,position=[0,GROUND+.2,0],children=[+ smoke('Low fog',(80,105,70,210),count=8,size=(1.2,1.8),grow=1.6,life=(46,60),delay=4,interval=5,spawn=dict(shape='Circle',radius=[.5,1.0],rotate=True,division=8),+ travel=dict(end=[[1.5,2.4],0,0],easing='EaseOutCubic'),rise=0),+ sprite('Pool bubbles','T_Bubble01',acid,count=24,delay=8,interval=3,life=[14,22],size=[.06,.14],size_end=[.1,.2],spawn=dict(shape='Circle',radius=[.2,1.3],rotate=False),+ travel=dict(end=[[-.05,.05],[.15,.5],[-.05,.05]],easing='EaseOutCubic'),billboard='Billboard',fade_in=3,fade_out=2,emissive=1.4)]),+ # Droplets: heavy acid drops thrown through the target along the shot, which land and splat.+ sprite('Acid drops','T_Dot01',acid,color_end=green,count=14,delay=1,life=[22,32],size=[.07,.14],forces=[dict(type='Gravity',gravity=[0,-.004,0])],+ collide=dict(height=.02,bounce=[.05,.15],friction=.8,reduction=.5),fade_in=0,fade_out=4,emissive=1.4,**spray([[.3,2.4],[.4,1.8],[-1.0,1.0]])),+ radial_sparks('Acid spatter',8,acid,color_end=green,distance=(.6,1.4),life=(12,20),length=(.25,.5),width=.09,delay=1,gravity=.0022),+ motes('Spores',14,acid,color_end=green,life=(34,48),distance=(.3,1.0),delay=10,interval=3,size=(.06,.12),radius=(.3,1.1),turbulence=.004),+ motes('Purple spores',6,(185,110,255,255),color_end=(90,40,130,255),life=(30,44),distance=(.3,1.0),delay=16,interval=6,size=(.05,.1),radius=(.3,1.2),turbulence=.004),+ ],attach='body',peak=.05,impact=.2,light=(.6,1,.3),delivery=dict(kind='projectile',projectile='VFX_Projectile_Poison'),+ design='A white-hot acid splash with broken strokes and heavy drops thrown through the target that land; an uneven pool spreads underneath with a glowing rim and bubbles breaking out of it; fumes cool from acid green to murky purple-grey over a bruised underside, piled low and downwind, while heavy fog rolls out along the floor and spores drift.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Dark.py b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Dark.pynew file mode 100644index 0000000..04567ce--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Dark.py@@ -0,0 +1,35 @@+"""VFX_Projectile_Dark: Shadow orb projectile; paired with VFX_Dark_Vortex on arrival.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ violet=(170,90,255,255); magenta=(225,120,255,255); pale=(235,215,255,255)+ return effect('Projectile_Dark','Shadow Orb','projectile','dark',.9,[+ # Wake: the light decays along the path into a visible grey smoke line that slowly closes in on itself.+ sustain(smoke('Shadow wake',(118,106,130,185),size=(.5,.75),grow=.45,life=(14,18),speed=(0,.002),rise=0,radius=(0,.1),inherit=TRAIL),2),+ # Wake: broken strokes left behind on the path, cooling from magenta to grey, instead of one ruled line.+ sustain(wisps('Wake arcs',magenta,.5,count=1,width=.16,sweep=(0,140),life=18,flow=-.04,inherit=TRAIL,emissive=1.6,+ color_curve=ramp((0,(235,150,255,255)),(30,(170,90,230,230)),(65,(115,100,128,170)),(100,(80,72,90,0)))['color_curve']),2),+ sustain(glow('Violet halo',(140,60,255,65),1.35,life=9),3),+ # Broken wisp strokes at a new random tilt every emission: about four cross at once, never one clean disk.+ sustain(wisps('Wisp arcs',magenta,.65,count=1,width=.3,sweep=(0,160),life=10,flow=-.08,emissive=2.2),2),+ sustain(radial_sparks('Inward needles',1,pale,color_end=violet,life=(10,14),width=.06,length=(.35,.6),spawn=dict(shape='Sphere',radius=[.95,1.2]),+ travel=dict(end=[0,[-1.15,-.9],0],easing='EaseInCubic'),fade_in=2,fade_out=2,emissive=2.2),1),+ sustain(distortion_ring('Lens',.8,life=6,strength=1.4,fade_in=1,fade_out=3),3),+ # The orb's body is churning black smoke rather than a clean disc: its silhouette tears and boils every frame.+ sustain(sprite('Seed core','T_Smoke02',(6,1,16,245),life=7,size=.85,size_end=.5,blend='Blend',billboard='Billboard',cutoff=[[0,0],[100,.65]],fade_in=0,fade_out=3),3),+ sustain(smoke('Churn core',(4,0,10,250),size=(.85,1.05),grow=.85,life=(7,9),speed=(0,0),rise=0,radius=(0,.07),fade_in=0,fade_out=4),1),+ # Grey-violet dust visibly dragged into the orb from all sides.+ sustain(motes('Drawn dust',1,(190,170,210,255),color_end=(120,60,200,255),size=(.06,.11),life=(12,16),spawn=dict(shape='Sphere',radius=[1.1,1.5]),+ travel=dict(end=[0,[-1.45,-1.05],0],easing='EaseInCubic'),turbulence=0,fade_in=3,fade_out=2),1),+ sustain(glow('Hot center',pale,.15,life=5,position=[-.09,.08,.1],emissive=1.8),2), # off-centre glint, not a bullseye+ sustain(wisps('Hot wisps',pale,.52,count=1,width=.075,sweep=(0,130),life=8,flow=-.1,emissive=2.4),2),+ # Complementary accent: a short orange stroke that only ever sweeps the lower edge.+ sustain(wisps('Ember underside',(255,140,55,255),.8,count=1,width=.22,sweep=(140,225),life=8,tilt=((-20,20),(-20,20),(-15,15)),size=1,emissive=1.5),3),+ sustain(motes('Path glints',1,(255,210,255,255),color_end=violet,size=(.06,.12),life=(14,18),distance=(.05,.3),radius=(0,.2),turbulence=.003,texture='T_Star01',inherit=TRAIL),3),+ ],attach='projectile',peak=.05,flight=.6,delivery=dict(kind='projectile'),+ design='An alpha-black orb with a refraction lens and an off-centre glint inside broken magenta wisp strokes that cross at shifting tilts; needles and grey-violet dust are dragged in, an orange underside accent; it leaves broken strokes on the path that cool from magenta to grey over a grey smoke wake, and glints hang after it has passed.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Fire.py b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Fire.pynew file mode 100644index 0000000..ab5cb34--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Fire.py@@ -0,0 +1,40 @@+"""VFX_Projectile_Fire: Fireball projectile; paired with VFX_Fire_Explosion on arrival.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ white=(255,250,220,255); yellow=(255,200,80,255); orange=(255,120,30,255); red=(200,40,10,255)+ return effect('Projectile_Fire','Fireball','projectile','fire',1.2,[+ # Trails only play the dense first ~10 frames of the smoke sheet; its torn last frames vanish against the dark stage.+ sustain(smoke('Smoke trail',(125,110,100,235),size=(.35,1.0),grow=2.4,life=(38,42),flipbook=dict(x=4,y=4,frame_length=4,loop='Once'),speed=(0,.002),rise=0,radius=(0,.1),+ travel=dict(end=[0,[.5,.9],0],easing='EaseOutCubic'),inherit=TRAIL,delay=3,color_curve=ramp((0,(125,110,100,235)),(60,(118,104,95,200)),(100,(65,60,56,0)))['color_curve']),3),+ # Fire peeling off the path: small turbulent billows that rise, cool and burn through with a hot rim.+ sustain(sprite('Flame trail','T_ExplosionSheet01',**ramp((0,(255,220,140,255)),(25,orange),(60,(200,55,15,200)),(100,(90,28,12,0))),life=[18,26],size=[.45,.95],size_end=[.15,.3],+ easing='EaseInQuadratic',rotation=[0,0,[-180,180]],flipbook=dict(x=4,y=4,frame_length=2,loop='Once',start=[3,7]),+ spawn=dict(shape='Sphere',radius=[0,.12],rotate=False),travel=dict(end=[0,[.45,.8],0],easing='EaseOutCubic'),inherit=TRAIL,+ alpha_texture='T_NoiseTile01',cutoff=[[0,0],[30,.08],[100,.8]],edge=dict(color=[255,90,20,255],threshold=.06,scaling=2),fade_in=0,fade_out=6),1.5),+ # Broken flame strokes wrapping the ball at a new tilt every emission: it churns instead of reading as a disc.+ sustain(wisps('Flame wisps',(255,130,40,255),.6,count=1,width=.22,sweep=(0,150),life=8,flow=-.1,emissive=1.1),2),+ sustain(motes('Embers',1,orange,color_end=red,size=(.05,.11),life=(18,28),distance=(.1,.45),radius=(0,.15),rise=.0006,turbulence=.001,inherit=TRAIL,spawn=dict(shape='Sphere',radius=[0,.08],rotate=False),travel=dict(end=[[-.7,-.3],[.35,.65],[-.2,.2]],easing='EaseOutCubic')),2.5),+ # Flung sparks: a few long thin streaks thrown back and up off the head.+ sustain(radial_sparks('Flung sparks',1,white,color_end=orange,life=(7,10),length=(.4,.8),width=.05,inherit=TRAIL,emissive=2.2,+ **spray([[-1.4,-.5],[.1,.7],[-.4,.4]])),3),+ sustain(glow('Heat bloom',(255,90,20,65),.85,life=8),3),+ sustain(heat_haze('Heat wake',1.4,life=18,strength=.35,inherit=TRAIL,fade_in=2,fade_out=12),3),+ # Comet: a looping flame flipbook laid along the flight, tongues streaming back behind the boiling ball.+ # Comet tail: the same turbulent flipbook stretched back along the flight, so the head reads as a teardrop.+ sustain(sprite('Comet tail','T_ExplosionSheet01',(255,150,50,255),color_end=(255,80,20,255),life=6,scale_start=[[1.5,1.8],[.6,.75],1],rotation=[0,0,[-10,10]],position=[-.75,0,0],+ flipbook=dict(x=4,y=4,frame_length=1,loop='Once',start=[3,8]),alpha_texture='T_NoiseTile01',cutoff=[[0,.05],[100,.4]],+ fade_in=1,fade_out=3,emissive=.85),2),+ # Each head sprite plays a few dense frames of the explosion sheet from a random start, so the ball boils.+ sustain(sprite('Fireball','T_ExplosionSheet01',(255,170,60,255),color_end=(255,90,20,255),life=[5,7],scale_start=[[1.15,1.35],[.75,.9],1],rotation=[0,0,[-25,25]],spin=[0,0,[-3,3]],+ flipbook=dict(x=4,y=4,frame_length=1,loop='Once',start=[2,6]),+ fade_in=0,fade_out=3,emissive=.8),1),+ # White-hot core stretched along the flight line: a streak, not a dot.+ sustain(sprite('Hot core','T_Glow01',white,life=6,scale_start=[.55,.17,1],billboard='Billboard',fade_in=0,fade_out=4,emissive=1.25),2),+ ],attach='projectile',peak=.05,flight=.45,delivery=dict(kind='projectile'),+ design='A boiling fireball with a stretched turbulent comet tail, a stretched white core and broken flame strokes churning round it; sparks are flung back, flame tongues peel off and rise, embers drift, and graded smoke lingers on the path.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Ice.py b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Ice.pynew file mode 100644index 0000000..8fa9d05--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Ice.py@@ -0,0 +1,36 @@+"""VFX_Projectile_Ice: Ice lance projectile; paired with VFX_Ice_Spikes on arrival.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ white=(240,252,255,255); cyan=(130,215,255,255); deep=(60,130,255,255)+ lane=lambda tag,color,dy,size:sustain(sprite(tag,'T_Glow01',color,color_end=fade(deep),renderer='Track',track_size=size,life=12,inherit=TRAIL,position=[0,dy,0],fade_in=0,fade_out=4,emissive=.85),1)+ return effect('Projectile_Ice','Ice Lance','projectile','ice',.7,[+ sustain(smoke('Frost mist',(150,200,255,210),size=(.35,.7),grow=1.7,life=(16,19),color_curve=ramp((0,(170,215,255,210)),(50,(130,150,175,170)),(100,(100,110,125,0)))['color_curve'],speed=(0,.002),rise=-.0009,radius=(0,.06),inherit=TRAIL,delay=2),3),+ # Muzzle: three stacked shock rings left where the lance was loosed, across the line of flight.+ tilted_ring('Muzzle rings',(210,240,255,210),.5,life=12,tilt=(0,90,0),thickness=.1,count=3,interval=2,inherit=TRAIL),+ lane('Lance trail',cyan,0,[.18,.12,.02]),+ # Prism fringe: two faint coloured lanes either side of the white ribbon (ice's complementary accent).+ lane('Prism warm',(255,120,200,90),.045,[.12,.08,0]),+ lane('Prism gold',(255,230,120,90),-.045,[.12,.08,0]),+ # Frost rings frozen in the air along the path, one every few frames: cold, crisp punctuation.+ sustain(tilted_ring('Frost rings',(200,240,255,200),.45,life=10,tilt=(0,90,0),thickness=.08,inherit=TRAIL),5),+ sustain(crystal('Shed shards',(110,200,255,200),1,.22,[14,20],edge=(235,250,255,255),scale_start=[[.1,.3],[.15,.5],[.1,.3]],rotation=[[-180,180],[-180,180],[-180,180]],+ position=[[-.35,.35],[-.25,.2],[-.3,.3]],spin=[[-10,10],[-10,10],[-10,10]],velocity=[[-.02,.012],[-.014,.008],[-.014,.014]],forces=[dict(type='Gravity',gravity=[0,-.0035,0])],inherit=TRAIL,fade_in=0,fade_out=6,emissive=1.3),2),+ sustain(sprite('Ice chips','T_IceShard01',(210,240,255,255),life=[10,18],size=[.04,.18],rotation=[0,0,[-180,180]],spin=[0,0,[-14,14]],+ velocity=[[-.01,.004],[-.004,.006],[-.006,.006]],forces=[dict(type='Gravity',gravity=[0,-.005,0])],inherit=TRAIL,fade_in=0,fade_out=3,emissive=1.4),2),+ sustain(sprite('Navy chips','T_Shard01',(36,56,118,255),blend='Blend',life=[14,19],size=[.1,.22],position=[[-.3,.3],[-.2,.2],[-.25,.25]],rotation=[0,0,[-180,180]],spin=[0,0,[-12,12]],+ velocity=[[-.01,.004],[-.006,.004],[-.006,.006]],forces=[dict(type='Gravity',gravity=[0,-.004,0])],inherit=TRAIL,fade_in=0,fade_out=4),3),+ sustain(sprite('Twinkles','T_Star01',white,life=[8,12],size=[.15,.3],size_end=0,easing='EaseInCubic',position=[[-.12,.12],[-.12,.12],[-.12,.12]],rotation=[0,0,[0,90]],inherit=TRAIL,fade_in=1,fade_out=3),2),+ sustain(glow('Cold bloom',(80,170,255,45),.42,life=6),2),+ # Faceted navy backing follows the lance and exposes a narrow lower edge.+ sustain(crystal('Navy back',(40,85,185,230),1.7,.25,4,edge=(50,105,195,230),rotation=[0,0,-90],position=[-.93,-.055,0],blend='Blend',fade_in=0,fade_out=1) | dict(falloff=dict(begin=[45,70,150,230],end=[100,150,225,230],pow=.5,blend='Mul'),culling='Front'),2),+ # The lance is a faceted crystal lying along the flight line (+Y turned to +X), tip forward.+ sustain(crystal('Lance',(95,190,255,240),1.6,.22,4,edge=(190,235,255,220),rotation=[0,0,-90],position=[-.9,0,0],fade_in=0,fade_out=1,emissive=.9) | dict(falloff=dict(begin=[55,125,225,220],end=[190,235,255,230],pow=.5,blend='Mul'),culling='Front'),2),+ sustain(sprite('Tip star','T_Star01',WHITE,life=4,size=.28,rotation=[0,0,[0,90]],spin=[0,0,12],fade_in=0,fade_out=2,emissive=1.4),2),+ ],attach='projectile',peak=.05,flight=.35,delivery=dict(kind='projectile'),+ design='A fast, crisp crystal lance with a navy backing on a thin white ribbon fringed with faint prism colours; stacked rings at the muzzle and frost rings frozen along the path, shards and chips break off and fall, twinkles hang on the line, cold mist sinks behind it.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Poison.py b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Poison.pynew file mode 100644index 0000000..c4c0fc7--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Projectile_Poison.py@@ -0,0 +1,39 @@+"""VFX_Projectile_Poison: Lobbed venom glob; paired with VFX_Poison_Cloud on arrival.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ green=(120,210,50,255); acid=(200,255,90,255); hot=(235,255,200,255)+ return effect('Projectile_Poison','Venom Glob','projectile','poison',1.2,[+ sustain(smoke('Fume trail',(130,200,70,195),size=(.35,.6),grow=2.0,life=(24,30),speed=(0,.002),rise=-.0003,radius=(0,.08),inherit=TRAIL,+ color_curve=ramp((0,(160,225,75,200)),(30,(105,135,60,190)),(60,(100,80,112,180)),(100,(80,68,90,0)))['color_curve']),2),+ # A thin acid thread draws the lob's arc clearly through the fumes.+ sustain(sprite('Acid thread','T_Glow01',acid,color_end=fade(green),renderer='Track',track_size=[.1,.06,0],life=10,inherit=TRAIL,fade_in=0,fade_out=4,emissive=1.4),1),+ sustain(sprite('Drips','T_Spark01',acid,color_end=green,billboard='DirectionalBillboard',life=[18,26],scale_start=[.07,.22,1],+ velocity=[[-.004,.004],0,[-.004,.004]],forces=[dict(type='Gravity',gravity=[0,-.003,0])],inherit=TRAIL,fade_in=0,fade_out=4,emissive=1.3),2),+ # Heavy drops that fall off the glob and land.+ sustain(sprite('Heavy drops','T_Dot01',acid,color_end=green,life=[24,30],size=[.07,.14],velocity=[[-.004,.004],0,[-.004,.004]],forces=[dict(type='Gravity',gravity=[0,-.004,0])],+ collide=dict(height=.02,bounce=[.05,.15],friction=.8,reduction=.5),inherit=TRAIL,fade_in=0,fade_out=4,emissive=1.3),3),+ sustain(sprite('Bubbles','T_Bubble01',acid,life=[14,20],size=[.06,.11],size_end=[.12,.18],easing='EaseInQuadratic',position=[[-.12,.12],[-.12,.12],[-.12,.12]],+ velocity=[0,[.002,.006],0],billboard='Billboard',inherit=TRAIL,fade_in=2,fade_out=2,emissive=1.2),4),+ sustain(motes('Spores',1,(195,120,255,255),color_end=(110,50,150,255),size=(.07,.12),life=(20,28),distance=(.1,.5),radius=(0,.2),turbulence=.004,inherit=TRAIL),3),+ sustain(glow('Acid glow',(140,255,60,130),1.1,life=8),3),+ # Purple dark core behind the goo: the complementary shadow that makes the green read as toxic, not lime.+ sustain(sprite('Dark core','T_SoftCircle',(60,20,70,170),blend='Blend',life=5,size=.5,billboard='Billboard',fade_in=0,fade_out=2),2),+ # One readable liquid volume: a colored, deformed mesh changes aspect ratio instead of stacking dark noisy shells.+ sustain(mesh('Glob','Sphere',(155,215,85,255),5,radius=1,sides=32,rings=16,texture=None,blend='Blend',culling='Front',+ model={'ShapeNoise/WaveNoisePower/X':.28,'ShapeNoise/WaveNoisePower/Y':.24,'ShapeNoise/WaveNoisePower/Z':.2,+ 'ShapeNoise/WaveNoiseFrequency/X':2.4,'ShapeNoise/WaveNoiseFrequency/Y':2.4,'ShapeNoise/WaveNoiseFrequency/Z':2.4},+ scale_start=[.44,.23,.32],scale_end=[.28,.42,.31],easing='EaseOutCubic',rotation=[[-180,180],[-180,180],[-180,180]],spin=[[-9,9],[-9,9],[-9,9]],+ falloff=dict(begin=[105,75,125,255],end=[235,255,150,255],pow=.55,blend='Mul'),fade_in=0,fade_out=2),4),+ # Goo strands: short broken strokes flicking off the glob at random tilts.+ sustain(wisps('Goo strands',(190,255,90,230),.34,count=1,width=.12,sweep=(0,120),life=8,flow=-.1,emissive=1.6),3),+ sustain(glow('Hot center',hot,.22,life=5,emissive=1.5),2),+ # Wet specular highlight, up and to the left of centre: a white-hot point that sells a glossy liquid.+ sustain(sprite('Highlight','T_Dot01',WHITE,life=4,size=.09,position=[-.1,.12,.2],billboard='Billboard',fade_in=0,fade_out=2,emissive=2.0),2),+ ],attach='projectile',peak=.05,flight=.7,arc=1.3,delivery=dict(kind='projectile'),+ design='A small glossy goo glob lobbed on an arc: a wobbling body with a white wet highlight over a purple dark core, a thin acid thread drawing the arc, drips and heavy drops falling and landing, bubbles and purple spores, fumes that cool from green to murky purple-grey and sink.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Shield_Dome.py b/skills/effekseer-vfx/assets/examples/src/VFX_Shield_Dome.pynew file mode 100644index 0000000..7ac2caf--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Shield_Dome.py@@ -0,0 +1,32 @@+"""VFX_Shield_Dome: Shield dome on the caster: raise, hold, then break into fragments.++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ blue=(90,170,255,255); pale=(215,240,255,255)+ pop=[[0,.2],[9,1.1],[16,.97],[24,1],[85,1],[100,1.08]]+ return effect('Shield_Dome','Shield Dome','status','arcane',1.8,[+ flash('Raise glint',WHITE,3.6,life=5,position=[0,.4,1.2]),+ # Clean fresnel force field (a colour texture or a held dissolve edge rendered as grey blotches in the plugin);+ # On expiry the full shell hands off to partial spherical geometry; cutoff alone did not open visible holes.+ mesh('Shell','Sphere',(50,120,255,170),life=84,radius=1,sides=48,rings=24,scale_start=[1.45]*3,scale_curve=pop,culling='Front',z_test=True,+ falloff=dict(begin=[60,120,255,90],end=[150,210,255,255],pow=.6,blend='Mul'),alpha_texture='T_NoiseTile02',alpha_scroll=[.002,.003],+ cutoff=[[0,0],[84,0],[90,.25],[96,.6],[100,.98]],fade_in=2,fade_out=4),+ # Falloff: begin covers the part facing the camera and a higher pow shrinks it, so a thin rim needs pow < 1.+ mesh('Rim','Sphere',(150,200,255,200),life=84,radius=1,sides=48,rings=24,scale_start=[1.47]*3,scale_curve=pop,culling='Front',z_test=True,+ falloff=dict(begin=[0,0,0,0],end=[255,255,255,255],pow=.4,blend='Mul'),alpha_texture='T_NoiseTile02',+ cutoff=[[0,0],[84,0],[90,.25],[96,.6],[100,.98]],fade_in=2,fade_out=4),+ # Energy streaks crawling over the surface: a streak mask flowing round the sphere (multiplied, no cutoff edge).+ mesh('Surface flow','Sphere',(110,190,255,170),life=80,radius=1,sides=48,rings=24,scale_start=[1.46]*3,scale_curve=pop,culling='Front',z_test=True,delay=4,+ alpha_texture='T_NoiseStreak01',alpha_scroll=[.012,.004],cutoff=[[0,0],[82,0],[90,.3],[100,.98]],+ falloff=dict(begin=[0,0,0,0],end=[255,255,255,255],pow=.8,blend='Mul'),fade_in=8,fade_out=4,emissive=1.4),+ shock_ring('Equator pulse',pale,1.9,life=14,delay=3,ground=True,thickness=.18),+ shock_ring('Scan bands',blue,1.5,life=30,delay=14,ground=True,count=3,interval=22,travel=dict(start=[0,-1.1,0],end=[0,1.2,0],easing='Linear'),thickness=.08,size_curve=[[0,.65],[50,1],[100,.6]]),+ motes('Surface glints',18,pale,color_end=blue,life=(18,30),delay=8,interval=4,size=(.07,.14),spawn=dict(shape='Sphere',radius=[1.4,1.5]),travel=dict(end=[0,[.1,.3],0],easing='EaseOutQuadratic')),+ radial_sparks('Break shards',16,pale,color_end=blue,distance=(.4,1.2),life=(10,18),length=(.3,.6),width=.07,delay=88,spawn=dict(shape='Sphere',radius=[1.3,1.5])),+ *shell_fragments('Shell fragment',(90,165,255,230),1.47,delay=80,life=24),+ ],attach='body',peak=.15,impact=.3,light=(.6,.8,1),delivery=SELF,design='Fresnel shell pops with overshoot, scan bands sweep up; at expiry six partial spherical sheets separate and tumble outward, with fine shards between their gaps.')diff --git a/skills/effekseer-vfx/assets/examples/src/VFX_Slash_Fire.py b/skills/effekseer-vfx/assets/examples/src/VFX_Slash_Fire.pynew file mode 100644index 0000000..b3db4f7--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/src/VFX_Slash_Fire.py@@ -0,0 +1,21 @@+"""VFX_Slash_Fire: Fire sword slash played on the target (melee).++Example from the effekseer-vfx skill. Copy it with `vfx examples add`, then edit, build and review it+like any other effect; its historical review does not carry over to your edits.+"""+from vfxkit.primitives import *+++def recipe():+ red=(255,70,15,200); orange=(255,150,40,255); white=(255,245,200,255)+ return effect('Slash_Fire','Fire Slash','slash','fire',.6,[+ *swing(slash_set((red,orange,white),roll=30,radius=1.6,life=16),yaw=-32),+ glow('Heat bloom',(255,110,20,170),3.6,life=16,delay=2),+ flame('Flame tongues',orange,(200,30,5,0),size=[1.3,2.0],size_end=[.5,.8],count=9,delay=3,interval=1,life=[18,24],+ position=[[-1.2,1.2],[-.7,.2],[-.7,.7]],velocity=[[-.008,.008],[.012,.03],0],z_test=True,fade_in=1,fade_out=12), # tongues behind the body are hidden by it+ heat_haze('Heat haze',3.0,life=30,delay=4,strength=.4),+ radial_sparks('Sparks',16,white,color_end=(255,90,10,255),distance=(.8,2.2),life=(14,26),length=(.4,.8),delay=3,gravity=.0008),+ smoke('Cut smoke',(90,70,62,200),count=5,size=(.5,.8),grow=2.0,life=(18,20),delay=10,interval=1,radius=(.3,1.0),speed=(.01,.02),rise=.0005),+ motes('Rising embers',18,orange,color_end=(255,40,0,255),life=(22,30),distance=(.4,1.6),delay=4,rise=.0007,radius=(.3,1.2)),+ smoke('Heat haze',(110,80,65,130),count=4,size=(.6,.9),life=(16,22),delay=8,radius=(.3,1.0)),+ ],peak=.08,impact=.6,light=(1,.55,.2),delivery=MELEE,design='Red-orange-white swept blade, then distorted flame tongues peel upward off the arc with embers and thin smoke.')diff --git a/skills/effekseer-vfx/assets/examples/texture_prompts.json b/skills/effekseer-vfx/assets/examples/texture_prompts.jsonnew file mode 100644index 0000000..18341ef--- /dev/null+++ b/skills/effekseer-vfx/assets/examples/texture_prompts.json@@ -0,0 +1,139 @@+{+ "background": "black; white/grayscale effect mask",+ "note": "Prompts for the painted example textures, plus templates for common painted shapes that are not shipped (source says which). Regenerate them with any image generation model and process them with `vfx process-texture`; outputs differ between models.",+ "prompts": [+ {+ "id": "T_IceShard01",+ "size": 256,+ "prompt": "Use case: stylized-concept. Asset type: real-time game VFX ice fragment particle texture. ONE isolated long pointed ICE CRYSTAL SHARD, centered on pure BLACK square background with 20% empty margin. Monochrome white and pale gray only; narrow asymmetric triangular crystal with 3 crisp faceted planes, sharp jagged break at base and a razor point at top. Flat hand-painted stylized sprite with clear high-contrast silhouette at 256 pixels, clean broad plane highlights without realistic background reflection. No group of crystals, no scene, no floor, no shadow, no character, no text, no logo, no UI, no frost cloud, no ambient glow. Suitable for tumbling particle fragments.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_Crack01",+ "size": 512,+ "prompt": "Use case: stylized-concept. Asset type: game VFX ground crack particle MASK. ONE isolated radial branching fracture pattern WHITE on pure BLACK square background, viewed exactly from above. 7 irregular main cracks branching outward from an empty dark center, narrow sharp lightning-like fractured stone fissures with few angular fragments and discontinuous edges, sparse striking silhouette; grayscale only. Centered with 15% empty margin. No stone surface fill, no surrounding ground, no scene, no perspective, no shadows, no text, no logo, no UI, no outer frame. Suitable for additive or dark tinted alpha-blended ground-plane sprite at 512px.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_Explosion01",+ "size": 256,+ "prompt": "Use case: stylized-concept. Asset type: real-time game VFX sprite MASK. One isolated stylized anime EXPLOSION CLOUD puff, monochrome WHITE to gray on pure BLACK square background, centered with 15% empty black margin. Roughly round compact fireball made of 7-9 overlapping rounded bulbous lobes of different sizes, cel-shaded with hard-edged shading: bright white lit tops, mid gray undersides, and several dark crescent creases between lobes. Chunky readable silhouette with a few small detached round puffs near the edge. Hand-painted fantasy action RPG style. No color, no soft blurry glow, no rays, no text, no frame, no ground, no characters.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_Smoke02",+ "size": 256,+ "prompt": "Use case: stylized-concept. Asset type: real-time game VFX particle sprite MASK. One isolated hand-painted stylized SMOKE WISP, monochrome WHITE to dark gray on pure BLACK square background, centered with 15% empty black margin. Soft elongated curling plume that swirls in an S-shape with one curled hook at the top, thick rounded body, feathered semi-transparent edges, gentle internal swirl strokes, darker gray at the tail. Painterly fantasy game style, soft but with a clearly readable silhouette. No color, no flame, no hard outline, no text, no frame, no ground, no characters.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_ExplosionSheet01",+ "size": 1024,+ "grid": [+ 4,+ 4+ ],+ "prompt": "Use case: real-time game VFX FLIPBOOK sprite sheet. Square 1024x1024 image divided into an exact, invisible 4x4 grid of sixteen equal square cells (256x256 each), read left-to-right, top-to-bottom. Each cell is one animation frame of the SAME fiery EXPLOSION billow, monochrome WHITE/gray on pure BLACK. Frame 1: small hot compact burst. Frames 2-6: rapidly expanding rolling billowy fireball with cauliflower lobes, bright white dense core with gray self-shadowed folds. Frames 7-12: the cloud keeps growing slowly, becomes thinner and darker gray, holes open inside it. Frames 13-16: wispy breaking-up tatters dissipating to almost nothing. Every frame is centered in its own cell with black margin so nothing touches cell borders; scale grows smoothly frame to frame; consistent lighting from top. Grayscale only, hand-painted stylized AAA fantasy action game VFX style, soft but readable shapes. No grid lines, no numbers, no text, no frame borders, no scene, no ground, no character, no color.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_SmokeSheet01",+ "size": 1024,+ "grid": [+ 4,+ 4+ ],+ "prompt": "Use case: real-time game VFX FLIPBOOK sprite sheet. Square 1024x1024 image divided into an exact, invisible 4x4 grid of sixteen equal square cells (256x256 each), read left-to-right, top-to-bottom. Each cell is one animation frame of the SAME SMOKE PUFF, monochrome WHITE/gray on pure BLACK. Frame 1: small dense round puff. Frames 2-8: the puff billows outward and curls, soft rounded lobes with gentle internal shading and wispy edges. Frames 9-16: it grows slowly, thins, edges break up into curling wisps and holes until only faint tatters remain. Every frame is centered in its own cell with black margin so nothing touches cell borders; size grows smoothly frame to frame; consistent soft lighting from top. Grayscale only, stylized hand-painted AAA action game VFX smoke, soft and volumetric. No grid lines, no numbers, no text, no borders, no scene, no ground, no character, no color.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_WispTrail01",+ "size": "512x256",+ "post": "rows 355-905 of the 1254px original cropped at full width (keeps horizontal tiling), resized to 512x256, alpha = luminance, RGB white; not the default centred processing",+ "prompt": "Use case: stylized-concept. Asset type: reusable real-time game VFX texture mask, square 1024x1024, to be wrapped around a ring/arc mesh (U = along the arc, horizontal; V = across the band, vertical). Draw a HORIZONTAL band of 6 to 8 thin energy wisp strands flowing left to right across the full width, pure WHITE to light gray on pure BLACK. Strands have varying thickness (one bright thick strand near the upper third, several hairline strands), they taper, split, overlap and drift slightly up and down, with several broken gaps and feathered ends, like anime energy swirl brush strokes / wind streaks. The band occupies the middle 60% of the height; top and bottom 20% stay pure black. Seamless and tileable horizontally: strands must continue across the left and right edges at the same heights. Grayscale only, crisp hand-painted anime VFX style, high contrast, no blur glow outside the strokes. No text, no frame, no scene, no character, no sparkles, no circles.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_Slash01",+ "size": 512,+ "prompt": "Use case: stylized-concept. Asset type: real-time game VFX particle texture mask, square single sprite. Create one WHITE sword-energy slash arc on a pure BLACK background. Isolated crescent sweeping from lower-left toward upper-right, razor sharp tapered tips, bright solid core, sparse fine streaks within the crescent, high silhouette clarity, energetic hand-painted fantasy combat style. Occupy 75% of canvas, centered with empty black padding on all sides. Grayscale only, clean thin shape, suitable for additive blending at 512x512. No character, no weapon, no scene, no floor, no shadows, no text, no logo, no frame, no UI, no surrounding sparks, no bloom outside silhouette. This is a reusable VFX texture, not an illustration.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ },+ {+ "id": "T_Flame01",+ "size": 256,+ "prompt": "Use case: stylized-concept. Asset type: reusable real-time game VFX sprite mask. One isolated stylized FLAME tongue, monochrome WHITE to gray on pure BLACK, centered square canvas, 15% empty margin. Sharp curling upward flame prongs, asymmetric flowing wisps, hot white broad core with a few dark cutouts, tapering elegant sharp tips. Hand-painted fantasy action game VFX particle, readable at 256 pixels. Flat sprite with no 3D shading, no scene, no floor, no smoke cloud, no surrounding embers, no character, no text, no logo, no UI, no illustration background. Suitable for additive blending and particle rotation.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ },+ {+ "id": "T_Lightning01",+ "size": 256,+ "prompt": "Use case: stylized-concept. Asset type: real-time fantasy game VFX particle mask. One isolated sharply angular branching LIGHTNING BOLT, WHITE on pure BLACK, grayscale only. Bolt runs diagonally from upper-left to lower-right, 3 fine secondary branches, irregular aggressive zigzags, intensely white slim core, no fuzzy large glow. Centered composition with 12% black padding. Clean readable silhouette suitable at 256x256, suitable additive particle sprite. No scene, no ground, no clouds, no character, no text, no logo, no frame, no UI, no illustration background.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ },+ {+ "id": "T_Rune01",+ "size": 512,+ "prompt": "Use case: stylized-concept. Asset type: game VFX magical glyph sprite mask. Create one isolated top-down fantasy MAGIC CIRCLE in WHITE thin light strokes on a pure BLACK square canvas. Two concentric broken circles, six long radial triangular geometric sigils with abstract angular nonlinguistic rune strokes, inner six-point geometry and empty center. Energetic irregular light-line gaps, slight varying line weight; mystical summoning glyph used as a rotating world-space particle, NOT a UI icon, NOT text. High-contrast grayscale, centered with 12% black padding, clear silhouette at 512px. No scene, no floor, no shadows, no character, no readable alphabet, no words, no logo, no frame, no UI. Do not add a filled background or broad bloom.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ },+ {+ "id": "T_Smoke01",+ "size": 256,+ "prompt": "Use case: stylized-concept. Asset type: game VFX particle sprite mask. One isolated hand-painted SMOKE PUFF, monochrome WHITE to gray on pure BLACK background. Centered square canvas with 15% empty black margin. Asymmetric billowing organic puff with 4 overlapping broad soft lobes, transparent-looking wispy fringes and several dark interior voids, no outline. Flat grayscale opacity texture with no directional lighting or realistic 3D shadows, no scene, no ground, no fire, no character, no text, no logo, no border, no UI. Readable broad structure when reduced to 256px. Suitable alpha-blended dust, poison cloud or mist particle sprite.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ },+ {+ "id": "T_Impact01",+ "size": 256,+ "prompt": "Use case: stylized-concept. Asset type: real-time action RPG VFX impact sprite MASK. One isolated sharp stylized impact burst, monochrome WHITE on pure BLACK square background, centered with 15% margin. Strong asymmetrical six pointed starburst, razor tapered diagonal spikes, bright compact jagged central energy silhouette, three broken crescent cuts within the shape, very sparse narrow secondary strokes. Hand-painted anime combat impact, readable at 256px, solid energetic graphic shape rather than blurry light. No circular outline, no clouds, no scene, no floor, no character, no text, no logo, no UI, no illustration. Suitable for additive particle blending.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_Flame02",+ "size": 256,+ "prompt": "Use case: stylized-concept. Asset type: reusable real-time game VFX sprite MASK. One isolated stylized anime FLAME, monochrome WHITE to gray on pure BLACK square background, centered with 15% empty black margin on every side. Tall teardrop fire body leaning slightly right, with three separated curling licks at the top, two small detached ember flecks above, a rounded bright solid base, and a few dark teardrop cutouts inside. Hand-painted cel-shaded fantasy action RPG style with crisp hard edges and only two or three gray tones. No color, no glow halo, no smoke, no text, no frame, no ground, no characters.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ },+ {+ "id": "T_Lightning02",+ "size": 512,+ "prompt": "Use case: stylized-concept. Asset type: real-time fantasy game VFX sprite MASK. One isolated LIGHTNING STRIKE bolt running straight VERTICALLY from the top center to the bottom center of the square canvas, WHITE on pure BLACK, grayscale only. Thick intensely white jagged main trunk with sharp angular zigzags, tapering slightly toward the bottom, with 4-5 thin forked side branches that split off downward at acute angles and end in fine points. Crisp hard edges, stylized anime action look, only a very thin faint gray glow hugging the trunk. 8% empty black margin at left and right; the bolt touches near the top and bottom. No color, no clouds, no ground, no text, no frame.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ },+ {+ "id": "T_Rune02",+ "size": 512,+ "prompt": "Use case: stylized-concept. Asset type: game VFX magical glyph sprite MASK. One isolated top-down fantasy HOLY MAGIC CIRCLE drawn in WHITE light strokes on a pure BLACK square canvas, perfectly centered and perfectly circular, with 6% empty black margin. Design: a bold thick outer ring, a thin second ring just inside it, a band of small evenly spaced abstract angular nonlinguistic glyph marks between two rings, an eight-pointed star built from two overlapping squares, a small inner circle with a four-petal flower motif, and an empty dark center. Clean crisp vector-like lines of two different weights, elegant and symmetric. No color, no glow blur, no real letters or text, no frame, no perspective tilt.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_IceSpikes01",+ "size": 512,+ "prompt": "Use case: stylized-concept. Asset type: real-time game VFX sprite MASK. One isolated cluster of stylized ICE CRYSTAL SPIKES erupting upward, monochrome WHITE and pale gray on pure BLACK square background, centered with 10% empty black margin. Five sharp faceted prismatic spikes of different heights fanning out from a shared narrow base at the bottom center: one tall central spike, two medium spikes leaning left and right, two short outer spikes. Each spike has 2-3 flat cel-shaded facet planes in distinct gray values with thin bright white edge highlights and razor points. Hand-painted fantasy action RPG style, crisp hard edges. No color, no glow blur, no snow, no ground, no text, no frame.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ },+ {+ "id": "T_Vortex01",+ "size": 512,+ "prompt": "Use case: stylized-concept. Asset type: real-time game VFX sprite MASK. One isolated top-down SWIRLING VORTEX / spiral energy whirlpool, monochrome WHITE to gray on pure BLACK square background, perfectly centered and circular with 8% empty black margin. Five tapered curved brush-stroke arms spiraling clockwise into the center like a galaxy or hurricane, each arm thick near the middle radius and thinning to a sharp wispy tail at the outside, with fine streak lines following the rotation, and a small empty dark hole in the exact center. Hand-painted anime action style with crisp edges and a few detached streak fragments between arms. No color, no blur glow, no text, no frame.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_Slash02",+ "size": 512,+ "prompt": "Use case: stylized-concept. Asset type: real-time game VFX sprite MASK. One isolated wide sword SLASH crescent, WHITE on pure BLACK square background, grayscale only, centered with 8% empty black margin. A broad bold crescent moon arc opening downward-left, sweeping from the lower-left tip over the top to the right tip: razor-sharp solid white leading outer edge, the inner side breaking up into long ragged brush-stroke streaks and torn speed lines that fade to gray, both tips tapering to needle points, and a few thin detached streak slivers trailing inside the curve. Hand-painted anime action game style, high contrast, very crisp. No color, no blur glow, no sword, no character, no text, no frame.",+ "source": "image generation model; processed copy only (the original is not shipped)"+ },+ {+ "id": "T_FlameSheet01",+ "size": 1024,+ "grid": [+ 4,+ 4+ ],+ "prompt": "Use case: real-time game VFX FLIPBOOK sprite sheet. Square 1024x1024 image divided into an exact, invisible 4x4 grid of sixteen equal square cells (256x256 each), read left-to-right, top-to-bottom. Each cell is one frame of the SAME seamlessly LOOPING FLAME tongue, monochrome WHITE/gray on pure BLACK. A single stylized fire flame rising from a rounded base at the bottom-center of each cell, licking upward with 2-3 sharp curling prongs; across the 16 frames the prongs flicker, sway left and right, split off a small detached wisp that rises and vanishes, and the cycle returns to frame 1 shape so it loops. Bright white hot core near the base, grayer thinner tips. Same size and same base position in every cell, with black margin so nothing touches cell borders. Grayscale only, hand-painted stylized AAA fantasy game VFX. No grid lines, no numbers, no text, no borders, no scene, no logs, no ground, no character, no color.",+ "source": "prompt template only: this texture is not shipped; generate it, then vfx process-texture"+ }+ ]+}diff --git a/skills/effekseer-vfx/assets/examples/textures/T_Crack01.png b/skills/effekseer-vfx/assets/examples/textures/T_Crack01.pngnew file mode 100644index 0000000..2545217Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_Crack01.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_Explosion01.png b/skills/effekseer-vfx/assets/examples/textures/T_Explosion01.pngnew file mode 100644index 0000000..98d610aBinary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_Explosion01.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_ExplosionSheet01.png b/skills/effekseer-vfx/assets/examples/textures/T_ExplosionSheet01.pngnew file mode 100644index 0000000..296df5bBinary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_ExplosionSheet01.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_IceShard01.png b/skills/effekseer-vfx/assets/examples/textures/T_IceShard01.pngnew file mode 100644index 0000000..d513ea6Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_IceShard01.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_Impact01.png b/skills/effekseer-vfx/assets/examples/textures/T_Impact01.pngnew file mode 100644index 0000000..2c262b9Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_Impact01.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_Rune02.png b/skills/effekseer-vfx/assets/examples/textures/T_Rune02.pngnew file mode 100644index 0000000..4c070e7Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_Rune02.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_Slash02.png b/skills/effekseer-vfx/assets/examples/textures/T_Slash02.pngnew file mode 100644index 0000000..4c8a2d0Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_Slash02.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_Smoke02.png b/skills/effekseer-vfx/assets/examples/textures/T_Smoke02.pngnew file mode 100644index 0000000..2f8096dBinary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_Smoke02.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_SmokeSheet01.png b/skills/effekseer-vfx/assets/examples/textures/T_SmokeSheet01.pngnew file mode 100644index 0000000..2bd0220Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_SmokeSheet01.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_Vortex01.png b/skills/effekseer-vfx/assets/examples/textures/T_Vortex01.pngnew file mode 100644index 0000000..0a46fc0Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_Vortex01.png differdiff --git a/skills/effekseer-vfx/assets/examples/textures/T_WispTrail01.png b/skills/effekseer-vfx/assets/examples/textures/T_WispTrail01.pngnew file mode 100644index 0000000..c523580Binary files /dev/null and b/skills/effekseer-vfx/assets/examples/textures/T_WispTrail01.png differdiff --git a/skills/effekseer-vfx/assets/godot-lab/VfxLab.tscn b/skills/effekseer-vfx/assets/godot-lab/VfxLab.tscnnew file mode 100644index 0000000..7f69014--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/VfxLab.tscn@@ -0,0 +1,6 @@+[gd_scene load_steps=2 format=3]++[ext_resource type="Script" path="res://scripts/VfxLab.gd" id="1"]++[node name="VfxLab" type="Node3D"]+script = ExtResource("1")diff --git a/skills/effekseer-vfx/assets/godot-lab/project.godot b/skills/effekseer-vfx/assets/godot-lab/project.godotnew file mode 100644index 0000000..11bf21b--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/project.godot@@ -0,0 +1,29 @@+config_version=5++[application]+config/name="Combat VFX · Effekseer Lab"+run/main_scene="res://VfxLab.tscn"++[autoload]+Vfx="*res://scripts/Vfx.gd"++[display]+window/size/viewport_width=1280+window/size/viewport_height=800+window/size/window_width_override=1280+window/size/window_height_override=800+window/stretch/mode="canvas_items"++[rendering]+renderer/rendering_method="forward_plus"+renderer/rendering_method.mobile="mobile"+environment/defaults/default_clear_color=Color(0.015,0.02,0.035,1)+textures/default_filters/use_nearest_mipmap_filter=false++[editor_plugins]+enabled=PackedStringArray("res://addons/effekseer/plugin.cfg")++[effekseer]+instance_max_count=2000+square_max_count=8000+draw_max_count=256diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/ExportRuntime.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/ExportRuntime.gdnew file mode 100644index 0000000..4309932--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/ExportRuntime.gd@@ -0,0 +1,18 @@+extends SceneTree++func _initialize() -> void:+ call_deferred("_export")++func _export() -> void:+ var entries: Array = JSON.parse_string(FileAccess.get_file_as_string("res://vfx_manifest.json"))+ DirAccess.make_dir_recursive_absolute("res://runtime")+ var failures: Array = []+ for entry in entries:+ var effect: EffekseerEffect = load(entry.file)+ if effect == null:+ failures.append(entry.id)+ continue+ var error := ResourceSaver.save(effect,"res://runtime/"+entry.id+".res")+ if error != OK: failures.append(entry.id)+ print(JSON.stringify({"exported":entries.size()-failures.size(),"failures":failures}))+ quit(0 if failures.is_empty() else 1)diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/TestApi.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/TestApi.gdnew file mode 100644index 0000000..c028846--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/TestApi.gd@@ -0,0 +1,62 @@+extends SceneTree+var failures: Array[String] = []+var manager: Node+var checks: int = 0+func _initialize() -> void:+ call_deferred("_run")+func check(value: bool, message: String) -> void:+ checks += 1+ if not value: failures.append(message)+func _run() -> void:+ var scene := Node3D.new()+ root.add_child(scene)+ current_scene = scene+ var camera := Camera3D.new()+ scene.add_child(camera)+ camera.position = Vector3(0,2,8)+ camera.look_at(Vector3(0,1,0))+ manager = root.get_node("Vfx")+ check(manager.manifest.size()>0,"manifest has effects")+ var first: String = manager.manifest[0].id+ var handle: CombatVfxHandle = manager.play(first,Vector3(1,1,0),Vector3(0,.3,0),Vector3(.8,.8,.8))+ check(is_instance_valid(handle),"play returns live handle")+ check(handle.global_position.is_equal_approx(Vector3(1,1,0)),"world position")+ check(handle.scale.is_equal_approx(Vector3(.8,.8,.8)),"scale")+ manager.set_speed(.5)+ check(is_equal_approx(handle.emitter.speed,.5),"speed propagation")+ manager.set_paused(true)+ check(handle.emitter.paused,"pause propagation")+ var time_before := handle.elapsed+ await create_timer(.2).timeout+ check(is_equal_approx(handle.elapsed,time_before),"paused simulation clock")+ manager.set_paused(false)+ manager.set_speed(1.0)+ await create_timer(float(manager.manifest[0].duration)+0.6).timeout+ check(not is_instance_valid(handle),"finite effect cleanup")+ check(manager.active.is_empty(),"active list cleanup")+ # The loop option replays any finite recipe until stop(); no dedicated looping asset is required.+ var loop_handle: CombatVfxHandle = manager.play(first,Vector3(0,1,0),Vector3.ZERO,Vector3.ONE,{"loop":true})+ await create_timer(float(manager.manifest[0].duration)*2.2).timeout+ check(is_instance_valid(loop_handle),"loop remains active across cycles")+ check(loop_handle.emitter.is_playing(),"native emitter restarted")+ manager.stop_all()+ await process_frame+ await process_frame+ check(not is_instance_valid(loop_handle),"stop loop cleanup")+ # Projectiles fly to the target, announce arrival there, then release their trail and free themselves.+ var projectile_id := ""+ for item in manager.manifest:+ if item.category == "projectile": projectile_id = item.id+ if projectile_id != "":+ var arrivals: Array[Vector3] = []+ var shot: CombatVfxHandle = manager.launch(projectile_id,Vector3(-2,1,0),Vector3(2,1,0),{"flight":0.3})+ shot.arrived.connect(func(p: Vector3): arrivals.append(p))+ await create_timer(0.15).timeout+ check(shot.global_position.x > -2.0 and shot.global_position.x < 2.0,"projectile moves along its path")+ await create_timer(0.3).timeout+ check(arrivals.size() == 1 and arrivals[0].is_equal_approx(Vector3(2,1,0)),"arrived fires once at the target")+ check(not is_instance_valid(shot) or shot.released,"projectile releases on arrival")+ await create_timer(float(manager.effects[projectile_id].duration)+0.5).timeout+ check(not is_instance_valid(shot),"released projectile frees after its trail dies")+ print(JSON.stringify({"api_checks":checks,"failures":failures}))+ quit(0 if failures.is_empty() else 1)diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gdnew file mode 100644index 0000000..01cfa0b--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd@@ -0,0 +1,60 @@+extends Node+## Game-facing Effekseer API. All effect internals stay behind this autoload.+var manifest: Array = []+var effects: Dictionary = {}+var active: Array[CombatVfxHandle] = []+var speed: float = 1.0+var paused: bool = false++func _ready() -> void:+ manifest = JSON.parse_string(FileAccess.get_file_as_string("res://vfx_manifest.json"))+ for item in manifest:+ effects[item.id] = item++func play(id: String, position: Vector3, rotation: Vector3 = Vector3.ZERO, effect_scale: Vector3 = Vector3.ONE, options: Dictionary = {}) -> CombatVfxHandle:+ if not effects.has(id):+ push_error("Unknown VFX: " + id)+ return null+ var resource: EffekseerEffect = load(effects[id].file)+ if resource == null:+ push_error("VFX resource failed to load: " + id)+ return null+ var handle := CombatVfxHandle.new()+ get_tree().current_scene.add_child(handle)+ handle.global_position = position+ handle.global_rotation = rotation+ handle.scale = effect_scale+ handle.speed = speed+ handle.paused = paused+ active.append(handle)+ handle.tree_exiting.connect(func(): active.erase(handle))+ handle.start(resource,bool(options.get("loop",effects[id].loop)),float(effects[id].duration))+ return handle++## Fire a projectile effect from `from` to `to`. Flight time is the manifest `flight` unless+## options.speed (m/s) or options.flight (s) is given; options.arc lifts the path (lobbed shots).+## Connect to the handle's `arrived` signal to play the impact; the trail releases itself on arrival.+func launch(id: String, from: Vector3, to: Vector3, options: Dictionary = {}) -> CombatVfxHandle:+ var handle := play(id, from, Vector3.ZERO, Vector3.ONE, {"loop": false})+ if handle == null: return null+ var item: Dictionary = effects[id]+ var seconds := float(options.get("flight", item.get("flight", 0.5)))+ if options.has("speed"): seconds = from.distance_to(to) / maxf(float(options.speed), 0.01)+ handle.fly(from, to, seconds, float(options.get("arc", item.get("arc", 0.0))))+ return handle++func stop_all() -> void:+ for emitter in active.duplicate():+ if is_instance_valid(emitter):+ emitter.stop()+ active.clear()++func set_speed(value: float) -> void:+ speed = clampf(value, 0.05, 4.0)+ for emitter in active:+ if is_instance_valid(emitter): emitter.speed = speed++func set_paused(value: bool) -> void:+ paused = value+ for emitter in active:+ if is_instance_valid(emitter): emitter.paused = pauseddiff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gdnew file mode 100644index 0000000..0c1d9c3--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd@@ -0,0 +1,83 @@+class_name CombatVfxHandle+extends Node3D+## One controllable game VFX instance. Finite effects clean themselves up;+## looping effects replay their complete recipe until stop() is called.+## Projectiles fly() to a point, emit `arrived` there and release() their trail.+signal arrived(position: Vector3)+var emitter: EffekseerEmitter3D+var loop_enabled: bool = false+var duration: float = 1.0+var elapsed: float = 0.0+var released: bool = false+var flight_from := Vector3.ZERO+var flight_to := Vector3.ZERO+var flight_time: float = 0.0+var flight_arc: float = 0.0+var flight_elapsed: float = -1.0+var speed: float = 1.0:+ set(value):+ speed = value+ if is_instance_valid(emitter): emitter.speed = value+var paused: bool = false:+ set(value):+ paused = value+ if is_instance_valid(emitter): emitter.paused = value++func start(resource: EffekseerEffect, loop_value: bool, duration_value: float) -> void:+ loop_enabled = loop_value+ duration = duration_value+ emitter = EffekseerEmitter3D.new()+ emitter.autoplay = false+ emitter.autofree = false+ emitter.effect = resource+ add_child(emitter)+ emitter.speed = speed+ emitter.paused = paused+ emitter.finished.connect(_finished)+ emitter.play()++## Move from `from` to `to` in `seconds` of effect time, lifted by `arc` metres at the midpoint.+## Trail layers spawn in world space, so the path stays behind the head.+func fly(from: Vector3, to: Vector3, seconds: float, arc: float = 0.0) -> void:+ flight_from = from+ flight_to = to+ flight_time = maxf(seconds, 0.01)+ flight_arc = arc+ flight_elapsed = 0.0+ global_position = from++func _process(delta: float) -> void:+ if paused: return+ elapsed += delta * speed+ if flight_elapsed >= 0.0:+ flight_elapsed += delta * speed+ var p := minf(flight_elapsed / flight_time, 1.0)+ global_position = flight_from.lerp(flight_to, p) + Vector3.UP * flight_arc * 4.0 * p * (1.0 - p)+ if p >= 1.0:+ flight_elapsed = -1.0+ arrived.emit(flight_to)+ release()+ if loop_enabled and elapsed >= duration:+ elapsed = fmod(elapsed,duration)+ emitter.stop()+ emitter.play()++func _finished() -> void:+ if not loop_enabled: queue_free()++## Stop emitting but let live particles finish (trails, embers); frees itself when they are gone.+func release() -> void:+ loop_enabled = false+ released = true+ if is_instance_valid(emitter): emitter.stop_root()++func stop() -> void:+ loop_enabled = false+ if is_instance_valid(emitter): emitter.stop()+ queue_free()++func set_dynamic_input(index: int, value: float) -> void:+ if is_instance_valid(emitter): emitter.set_dynamic_input(index,value)++func send_trigger(index: int) -> void:+ if is_instance_valid(emitter): emitter.send_trigger(index)diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gdnew file mode 100644index 0000000..51ef28a--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd@@ -0,0 +1,893 @@+extends Node3D++var index: int = 0+var elapsed: float = 0.0+var looped: bool = true+var showcase: bool = false+var bright: bool = false+var environment: Environment+var floor_material: StandardMaterial3D+var title: Label+var subtitle: Label+var fps_label: Label+var info: Label+var status: Label+var timeline: ProgressBar+var library_list: ItemList+var loop_button: CheckButton+var pause_button: CheckButton+var showcase_button: CheckButton+var capture_mode: bool = false+var capture_dir: String = ""+var capture_frame: int = 0+var capture_started: bool = false+var capture_end: int = 0+var capture_samples: Array[int] = []+var capture_ids: Array[String] = []+var captured: int = 0+var movie_mode: bool = false+var hide_dummies: bool = false+var target_position := Vector3(0, 1.35, 0)+# Combat staging: the effect is performed by one dummy on itself or on the other, the way a game+# would trigger it (manifest `delivery`). Captures and review strips use the same staging; --isolated is the+# legacy single-target stage.+const ISOLATED_PLAYER := Vector3(-1.7, 0, 0)+const ISOLATED_ENEMY := Vector3(0, 0, -0.12)+# Combat: the two dummies stand at opposite ends of the platform, the camera looks at the middle.+const COMBAT_PLAYER := Vector3(-2.55, 0, 0)+const COMBAT_ENEMY := Vector3(2.55, 0, 0)+# Where each attach point sits relative to its dummy; equals the isolated stage's fixed anchors.+const ATTACH_OFFSET := {"ground": Vector3(0, 0, 0.12), "body": Vector3(0, 0.95, 0.12), "impact": Vector3(0, 1.35, 0.12), "caster": Vector3(0, 1.2, 0), "caster_ground": Vector3.ZERO}+# Optional rigged stand-ins (Mixamo bone names, e.g. from an auto-rigging service) replace the capsule dummies+# when present: copy them to vfx/characters/ and run `vfx init`. The clips keep their root motion in the hips+# track, so the body travels with the steps and planted feet stay put.+# The GLBs are expected 1 unit tall; 1.75 puts the hips at the "body" anchor.+const CHARACTERS := {"PlayerDummy": "res://characters/player.glb", "EnemyDummy": "res://characters/target.glb"}+const CHARACTER_SCALE := 1.75+# Each faces the other, turned 25° toward the camera so the action reads in three-quarter view.+const CHARACTER_YAW := {"PlayerDummy": 65.0, "EnemyDummy": -65.0}+# Clip times measured from the bone data (hand speed, hips height): the moment each clip is synced to.+const CAST_RELEASE := 1.45 # cast_a_spell: arm thrust toward the target+const CAST_END := 2.0 # ...before its second, punch-like push at 2.4 s; the clip is cut here+const PUNCH_STRIKE := 0.7 # box_03: the stepping jab reaches full extension (planted feet hold within 5 cm)+const JUMP_CROUCH := 0.5 # jump (a run of hops): the first crouch...+const JUMP_LAND := 1.0 # ...and the landing that follows it+const CLIP_BLEND := 0.15+const IDLE_BLEND := 0.35 # settling back to idle (e.g. landing from the cast's float) is slower+# Clip roles → animation name prefixes, first match wins (an export may suffix them, e.g. "box_03_001").+const CLIP_ROLES := {+ "idle": ["idle"],+ "cast": ["cast_a_spell"],+ "punch": ["box_03"],+ "hit_heavy": ["hit_to_head"],+ "hit_light": ["hit_to_body_01"],+ "jump": ["jump"],+}+# The cast floats up off the ground; it may rise but must not drift toward the target.+const IN_PLACE_ROLES := ["cast"]+var combat: bool = true+var combat_button: CheckButton+var player: Node3D+var enemy: Node3D+var isolated_camera: Transform3D+var combat_camera: Transform3D+var events: Array = [] # [{t, do}] fired once elapsed reaches t+var moves: Dictionary = {} # dummy name -> [{kind, t, ...}] pose keys, evaluated every frame+var sequence_end: float = 1.0+# When the reviewed effect itself starts inside the staged exchange (after a punch's windup, a cast or a projectile's+# flight); captures number their frames from here so they line up with the manifest timing.+var effect_start: float = 0.0+var capture_offset: int = 0+var sequence_id: int = 0+var delivery_text: String = ""+var strip_mode: bool = false+var strip_step: int = 4+var strip_plan: Dictionary = {}+var review_view: String = "standard"+var stage_feedback: bool = true+var ui_layer: CanvasLayer+var camera: Camera3D+var camera_home: Transform3D+var flash_light: OmniLight3D+var impact_fired: bool = false+var shake: float = 0.0++func _ready() -> void:+ _build_stage()+ _build_ui()+ var args := OS.get_cmdline_user_args()+ for arg in args:+ if arg.begins_with("--capture="):+ capture_mode = true+ capture_dir = arg.trim_prefix("--capture=")+ DirAccess.make_dir_recursive_absolute(capture_dir)+ if arg.begins_with("--ids="):+ capture_ids.assign(arg.trim_prefix("--ids=").split(","))+ if arg.begins_with("--strip="):+ # Clean, UI-free frame sequence for motion review (see tools/review.py).+ capture_mode = true+ strip_mode = true+ capture_dir = arg.trim_prefix("--strip=")+ DirAccess.make_dir_recursive_absolute(capture_dir)+ ui_layer.hide()+ camera.h_offset = 0+ if arg.begins_with("--step="): strip_step = maxi(1, int(arg.trim_prefix("--step=")))+ if arg.begins_with("--sample-plan="):+ var parsed = JSON.parse_string(FileAccess.get_file_as_string(arg.trim_prefix("--sample-plan=")))+ if parsed is Dictionary:+ # JSON numbers are floats; Array.has uses typed equality, so normalize to frame integers.+ for id in parsed:+ var samples: Array[int] = []+ for frame_number in parsed[id]: samples.append(int(frame_number))+ strip_plan[id] = samples+ if arg.begins_with("--review-view="): review_view = arg.trim_prefix("--review-view=")+ if arg == "--bare":+ environment.glow_enabled = false+ stage_feedback = false+ if arg == "--bright": _set_background(true)+ if arg == "--no-glow": environment.glow_enabled = false+ if arg == "--movie": movie_mode = true+ if arg == "--showcase": showcase = true+ if arg == "--no-dummies": hide_dummies = true+ if arg == "--isolated": combat = false+ combat_button.set_pressed_no_signal(combat)+ # Automated captures pop a window that stray focus or Cmd+W/Q can close mid-run (exit 0, strip cut short);+ # they finish on their own, so log and ignore close requests instead of quitting.+ if capture_mode:+ get_tree().auto_accept_quit = false+ _park_capture_window()+ _layout()+ # Settle the characters into idle before the first frame: a capture's empty reference must match the replay.+ _pose(player, [], 0.0)+ _pose(enemy, [], 0.0)+ if hide_dummies:+ $PlayerDummy.hide()+ $EnemyDummy.hide()+ if capture_ids.size() > 0:+ index = _find_id(capture_ids[0])+ looped = not capture_mode+ loop_button.button_pressed = looped+ showcase_button.button_pressed = showcase+ if Vfx.manifest.is_empty():+ title.text = "No effects loaded"+ subtitle.text = "Build an effect library to begin"+ else:+ # Captures start each effect themselves, after the empty reference frame.+ _select(index, not capture_mode)++func _find_id(id: String) -> int:+ for i in range(Vfx.manifest.size()):+ if Vfx.manifest[i].id == id: return i+ return 0++func _mesh(mesh: Mesh, color: Color, position: Vector3, parent: Node = self) -> MeshInstance3D:+ var m := MeshInstance3D.new()+ m.mesh = mesh+ var mat := StandardMaterial3D.new()+ mat.albedo_color = color+ mat.roughness = 0.72+ m.material_override = mat+ parent.add_child(m)+ m.position = position+ return m++func _build_stage() -> void:+ var world := WorldEnvironment.new()+ environment = Environment.new()+ environment.background_mode = Environment.BG_COLOR+ environment.background_color = DARK_BACKGROUND+ environment.ambient_light_source = Environment.AMBIENT_SOURCE_COLOR+ environment.ambient_light_color = Color("8ca7c9")+ environment.ambient_light_energy = 0.75+ # Forward+ keeps additive/emissive VFX above 1.0 until glow and tonemapping (cores measure 8x and more).+ # Glow ramps in by smoothstep(threshold, threshold + hdr_scale): on the lit stage the toon-shaded characters+ # peak near 3.4x (measured with a linear tonemap at 1/8 exposure), so the knee starts just below that and is+ # fully on by 6x; the characters pick up almost no glow while every VFX core blooms at full strength.+ # Additive blend feeds the halo into the HDR buffer before Filmic, and a low Filmic white burns cores to white+ # while the halo keeps the element's hue.+ environment.tonemap_mode = Environment.TONE_MAPPER_FILMIC+ environment.tonemap_white = 4.0+ environment.glow_enabled = true+ environment.glow_intensity = 1.5+ environment.glow_strength = 1.1+ environment.glow_bloom = 0.0+ environment.glow_hdr_threshold = 2.8+ environment.glow_hdr_scale = 3.2+ environment.glow_hdr_luminance_cap = 24.0+ # Tight halo through a wide soft bloom; the widest level stays lowest so a bolt does not haze the whole frame.+ for level in range(7): environment.set_glow_level(level, 0.0)+ environment.set_glow_level(1, 1.0)+ environment.set_glow_level(2, 1.0)+ environment.set_glow_level(3, 0.85)+ environment.set_glow_level(4, 0.6)+ environment.set_glow_level(5, 0.35)+ environment.glow_blend_mode = Environment.GLOW_BLEND_MODE_ADDITIVE+ world.environment = environment+ flash_light = OmniLight3D.new()+ flash_light.position = target_position + Vector3(0.4, 0.3, 1.2)+ flash_light.omni_range = 9+ flash_light.light_energy = 0+ add_child(flash_light)+ add_child(world)+ var sun := DirectionalLight3D.new()+ sun.rotation_degrees = Vector3(-48, -25, 0)+ sun.light_energy = 1.5+ sun.shadow_enabled = true+ add_child(sun)+ var fill := OmniLight3D.new()+ fill.position = Vector3(1, 3, 3)+ fill.light_color = Color("70cbdc")+ fill.light_energy = 1.0+ fill.omni_range = 10+ add_child(fill)+ var plane := PlaneMesh.new()+ plane.size = Vector2(100, 100)+ var floor_mesh := _mesh(plane, DARK_FLOOR, Vector3(0, -0.12, 0))+ floor_material = floor_mesh.material_override+ var platform := CylinderMesh.new()+ platform.top_radius = 3.0+ platform.bottom_radius = 3.0+ platform.height = 0.12+ platform.radial_segments = 96+ _mesh(platform, Color("2a3848"), Vector3(0, -0.045, 0))+ # Thin concentric stage markings give a scale reference.+ for radius in [1.0, 2.0, 2.95]:+ var torus := TorusMesh.new()+ torus.inner_radius = radius - 0.012+ torus.outer_radius = radius + 0.012+ torus.rings = 64+ torus.ring_segments = 6+ _mesh(torus, Color("5f86a6"), Vector3(0, 0.018, 0))+ player = _dummy("PlayerDummy", ISOLATED_PLAYER, Color("5cbbca"), "PLAYER")+ enemy = _dummy("EnemyDummy", ISOLATED_ENEMY, Color("d47f66"), "TARGET")+ camera = Camera3D.new()+ camera.position = Vector3(3.2, 4.9, 8.3)+ add_child(camera)+ camera.look_at(Vector3(-0.55, 1.0, 0))+ camera.fov = 38+ camera.h_offset = -0.75+ camera.current = true+ isolated_camera = camera.transform+ # Front-on, centred on the midpoint between the dummies so caster, flight path and target read at once.+ camera.position = Vector3(0, 3.5, 10.6)+ camera.look_at(Vector3(0, 1.25, 0))+ combat_camera = camera.transform+ camera.transform = isolated_camera+ camera_home = camera.transform++func _layout() -> void:+ player.position = COMBAT_PLAYER if combat else ISOLATED_PLAYER+ enemy.position = COMBAT_ENEMY if combat else ISOLATED_ENEMY+ camera_home = combat_camera if combat else isolated_camera+ camera.transform = camera_home+ # The offset only re-centres the view in the space the side panel leaves free.+ camera.h_offset = 0.0 if strip_mode else -1.25 if combat else -0.75+ camera.v_offset = 0.25 if combat else 0.0++func _dummy(node_name: String, pos: Vector3, color: Color, label_text: String) -> Node3D:+ var dummy := Node3D.new()+ dummy.name = node_name+ add_child(dummy)+ dummy.position = pos+ # Meshes hang off a pivot at the feet: poses lean and squash it without moving the label.+ var pivot := Node3D.new()+ pivot.name = "Pivot"+ dummy.add_child(pivot)+ var label := Label3D.new()+ label.text = label_text+ label.position = Vector3(0, 2.02, 0)+ label.font_size = 32+ label.pixel_size = 0.003+ label.modulate = color.lightened(0.3)+ label.billboard = BaseMaterial3D.BILLBOARD_ENABLED+ dummy.add_child(label)+ var scene_path: String = CHARACTERS.get(node_name, "")+ if scene_path != "" and ResourceLoader.exists(scene_path):+ _character(dummy, pivot, scene_path)+ return dummy+ var body := CapsuleMesh.new()+ body.radius = 0.24+ body.height = 1.25+ var torso := _mesh(body, color.darkened(0.35), Vector3(0, 0.82, 0), pivot)+ var head := SphereMesh.new()+ head.radius = 0.22+ head.height = 0.44+ var skull := _mesh(head, color, Vector3(0, 1.62, 0), pivot)+ dummy.set_meta("materials", [torso.material_override, skull.material_override])+ return dummy++func _character(dummy: Node3D, pivot: Node3D, scene_path: String) -> void:+ var model: Node3D = load(scene_path).instantiate()+ pivot.add_child(model)+ model.scale = Vector3.ONE * CHARACTER_SCALE+ model.rotation.y = deg_to_rad(CHARACTER_YAW[dummy.name])+ var player_node: AnimationPlayer = model.find_children("*", "AnimationPlayer", true, false)[0]+ var clips := {}+ for role: String in CLIP_ROLES:+ for prefix: String in CLIP_ROLES[role]:+ for anim_name in player_node.get_animation_list():+ if not clips.has(role) and String(anim_name).begins_with(prefix): clips[role] = String(anim_name)+ dummy.set_meta("clips", clips)+ if clips.has("idle"): player_node.get_animation(clips.idle).loop_mode = Animation.LOOP_LINEAR+ # Pin the horizontal root motion of in-place roles; the vertical float stays.+ for role in IN_PLACE_ROLES:+ if not clips.has(role): continue+ var clip := player_node.get_animation(clips[role])+ for track in clip.get_track_count():+ if clip.track_get_type(track) != Animation.TYPE_POSITION_3D or not String(clip.track_get_path(track)).ends_with(":mixamorig_Hips"): continue+ var rest: Vector3 = clip.track_get_key_value(track, 0)+ for k in clip.track_get_key_count(track):+ var p: Vector3 = clip.track_get_key_value(track, k)+ clip.track_set_key_value(track, k, Vector3(rest.x, p.y, rest.z))+ # The hit flash rides on an additive overlay so the textured materials stay untouched.+ var flash := StandardMaterial3D.new()+ flash.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED+ flash.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA+ flash.blend_mode = BaseMaterial3D.BLEND_MODE_ADD+ flash.albedo_color = Color(1, 0.95, 0.85, 0)+ var roles := _material_roles(scene_path)+ for mesh: MeshInstance3D in model.find_children("*", "MeshInstance3D", true, false):+ _toon(mesh, roles.get("parts", {}).get(String(mesh.name), roles.get("default", "cloth")))+ mesh.material_overlay = flash+ dummy.set_meta("anim", player_node)+ dummy.set_meta("model", model)+ dummy.set_meta("flash", flash)+ # Different idle phases so the two characters never breathe in lockstep.+ dummy.set_meta("idle_phase", 0.0 if dummy.name == "PlayerDummy" else 6.0)+ dummy.set_meta("clip", "")++# Cel-shading presets per material role. Skin keeps a soft warm terminator, hair a crisp cool shadow with a+# highlight band, cloth a crisp shadow plus colour-based skin detection for parts that mix skin and fabric.+const TOON_ROLES := {+ "skin": {"shade_threshold": 0.0, "shade_softness": 0.12, "shadow_color": Color(0.96, 0.74, 0.72), "rim_strength": 0.15},+ "hair": {"shade_threshold": 0.1, "shade_softness": 0.03, "shadow_color": Color(0.62, 0.66, 0.86), "rim_strength": 0.15, "highlight_strength": 0.12, "highlight_size": 0.02, "light_scale": 0.42},+ # Hair and face in one part: hair shading, with skin pixels picked out by colour (no highlight on them).+ "head": {"shade_threshold": 0.1, "shade_softness": 0.03, "shadow_color": Color(0.62, 0.66, 0.86), "rim_strength": 0.15, "highlight_strength": 0.12, "highlight_size": 0.02, "light_scale": 0.42, "skin_from_color": true},+ "cloth": {"shade_threshold": 0.05, "shade_softness": 0.03, "shadow_color": Color(0.66, 0.66, 0.82), "rim_strength": 0.25, "skin_from_color": true},+}+# Default stage: deep slate blue, bright enough that characters and floor read, dark enough that VFX dominate.+const DARK_BACKGROUND := Color("1a2433")+const DARK_FLOOR := Color("1d2733")+const TOON_SHADER := preload("res://shaders/character_toon.gdshader")+const OUTLINE_SHADER := preload("res://shaders/character_outline.gdshader")++func _material_roles(scene_path: String) -> Dictionary:+ # <model>.materials.json beside the GLB maps part meshes to toon roles: {"default": "cloth", "parts": {"part_2": "hair"}}.+ var path := scene_path.get_basename() + ".materials.json"+ if not FileAccess.file_exists(path): return {}+ var parsed: Variant = JSON.parse_string(FileAccess.get_file_as_string(path))+ return parsed if parsed is Dictionary else {}++func _toon(mesh: MeshInstance3D, role: String) -> void:+ for surface in mesh.mesh.get_surface_count():+ var source := mesh.get_active_material(surface) as BaseMaterial3D+ var albedo: Texture2D = source.albedo_texture if source else null+ var toon := ShaderMaterial.new()+ toon.shader = TOON_SHADER+ toon.set_shader_parameter("albedo_texture", albedo)+ for key: String in TOON_ROLES.get(role, TOON_ROLES.cloth):+ toon.set_shader_parameter(key, TOON_ROLES.get(role, TOON_ROLES.cloth)[key])+ var outline := ShaderMaterial.new()+ outline.shader = OUTLINE_SHADER+ outline.set_shader_parameter("albedo_texture", albedo)+ toon.next_pass = outline+ mesh.set_surface_override_material(surface, toon)++func _label(text: String, size: int = 16, color: Color = Color("d7e3f0")) -> Label:+ var l := Label.new()+ l.text = text+ l.add_theme_font_size_override("font_size", size)+ l.add_theme_color_override("font_color", color)+ return l++func _button(text: String, callback: Callable) -> Button:+ var b := Button.new()+ b.text = text+ b.custom_minimum_size = Vector2(82, 38)+ b.pressed.connect(callback)+ return b++func _panel(rect: Rect2, color: Color) -> Panel:+ var p := Panel.new()+ p.position = rect.position+ p.size = rect.size+ var box := StyleBoxFlat.new()+ box.bg_color = color+ box.corner_radius_top_left = 10+ box.corner_radius_top_right = 10+ box.corner_radius_bottom_left = 10+ box.corner_radius_bottom_right = 10+ p.add_theme_stylebox_override("panel", box)+ return p++func _build_ui() -> void:+ var canvas := CanvasLayer.new()+ ui_layer = canvas+ add_child(canvas)+ var ui := Control.new()+ canvas.add_child(ui)+ ui.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)+ var theme := Theme.new()+ theme.default_font_size = 15+ ui.theme = theme+ var side := _panel(Rect2(20,20,250,760), Color("0c1422"))+ ui.add_child(side)+ var brand := _label("COMBAT / VFX", 25, Color("edf7ff"))+ brand.position = Vector2(18,18)+ side.add_child(brand)+ var desc := _label("EFFEKSEER • ASSET LIBRARY", 11, Color("6aa8b7"))+ desc.position = Vector2(18,55)+ side.add_child(desc)+ var filter := OptionButton.new()+ filter.position = Vector2(18,94)+ filter.size = Vector2(214,36)+ var categories: Array[String] = []+ for item in Vfx.manifest:+ if not categories.has(item.category): categories.append(item.category)+ filter.add_item("All categories")+ for cat in categories: filter.add_item(cat.capitalize())+ filter.item_selected.connect(func(i: int): _filter_category(filter.get_item_text(i).to_lower() if i > 0 else ""))+ side.add_child(filter)+ library_list = ItemList.new()+ library_list.position = Vector2(14,144)+ library_list.size = Vector2(222,536)+ library_list.add_theme_constant_override("v_separation", 9)+ library_list.item_selected.connect(func(i: int): _select(int(library_list.get_item_metadata(i))))+ side.add_child(library_list)+ _filter_category("")+ var count_label := _label("%02d effects / %d categories" % [Vfx.manifest.size(),categories.size()], 13, Color("8194ac"))+ count_label.position = Vector2(18,703)+ side.add_child(count_label)+ var top := _panel(Rect2(290,20,970,100), Color(0.045,0.075,0.12,0.92))+ ui.add_child(top)+ title = _label("", 31, Color("eff8ff"))+ title.position = Vector2(24,16)+ top.add_child(title)+ subtitle = _label("", 13, Color("83bdc9"))+ subtitle.position = Vector2(26,60)+ top.add_child(subtitle)+ fps_label = _label("", 14, Color("8ae2b9"))+ fps_label.position = Vector2(842,24)+ top.add_child(fps_label)+ var controls := _panel(Rect2(290,656,970,124), Color("0c1422"))+ ui.add_child(controls)+ var row := HBoxContainer.new()+ row.position = Vector2(18,16)+ row.add_theme_constant_override("separation", 10)+ controls.add_child(row)+ row.add_child(_button("← Previous",func(): _select(index-1)))+ row.add_child(_button("Replay",_replay))+ row.add_child(_button("Next →",func(): _select(index+1)))+ loop_button = CheckButton.new()+ loop_button.text = "Loop"+ loop_button.button_pressed = looped+ loop_button.toggled.connect(func(b: bool): looped = b)+ row.add_child(loop_button)+ pause_button = CheckButton.new()+ pause_button.text = "Pause"+ pause_button.toggled.connect(func(b: bool): Vfx.set_paused(b))+ row.add_child(pause_button)+ var speed_select := OptionButton.new()+ for s in ["0.25×", "0.5×", "1×", "2×"]: speed_select.add_item(s)+ speed_select.select(2)+ speed_select.item_selected.connect(func(i: int): Vfx.set_speed([0.25,0.5,1.0,2.0][i]))+ row.add_child(speed_select)+ row.add_child(_button("Dark / Bright",func(): _set_background(not bright)))+ showcase_button = CheckButton.new()+ showcase_button.text = "Showcase"+ showcase_button.toggled.connect(func(b: bool): showcase = b; elapsed = 0)+ row.add_child(showcase_button)+ combat_button = CheckButton.new()+ combat_button.text = "Combat"+ combat_button.button_pressed = combat+ combat_button.toggled.connect(func(b: bool): combat = b; _layout(); _replay())+ row.add_child(combat_button)+ status = _label("", 12, Color("8c9eb4"))+ status.position = Vector2(20,71)+ controls.add_child(status)+ timeline = ProgressBar.new()+ timeline.position = Vector2(20,100)+ timeline.size = Vector2(930,5)+ timeline.show_percentage = false+ controls.add_child(timeline)+ info = _label("", 13, Color("99acbf"))+ info.position = Vector2(316,605)+ ui.add_child(info)++func _filter_category(category: String) -> void:+ library_list.clear()+ for i in range(Vfx.manifest.size()):+ var item: Dictionary = Vfx.manifest[i]+ if category != "" and item.category != category: continue+ var j := library_list.add_item("%02d %s" % [i+1,item.name])+ library_list.set_item_metadata(j,i)++func _select(i: int, start: bool = true) -> void:+ if Vfx.manifest.is_empty(): return+ index = posmod(i,Vfx.manifest.size())+ var item: Dictionary = Vfx.manifest[index]+ if capture_mode and review_view == "close":+ var self_cast := str(item.get("delivery", {}).get("kind", "")) == "self"+ var focus := (COMBAT_PLAYER if self_cast else COMBAT_ENEMY) + Vector3(0, 1.0, 0)+ camera.position = focus + Vector3(1.4, 2.2, 5.8)+ camera.look_at(focus)+ camera_home = camera.transform+ if showcase: print(JSON.stringify({"showcase_index":index+1,"id":item.id}))+ title.text = "%02d / %s" % [index+1,item.name]+ subtitle.text = "%s / %s / %s" % [item.category.to_upper(),item.element.to_upper(),item.id]+ info.text = "%.2f s duration • %d layers • ≤ %d particles • %s" % [item.duration,item.layers,item.particle_budget,item.attach.to_upper()]+ for j in range(library_list.item_count):+ if int(library_list.get_item_metadata(j)) == index:+ library_list.select(j)+ library_list.ensure_current_is_visible()+ if start: _replay()++func _replay() -> void:+ if Vfx.manifest.is_empty(): return+ if capture_mode: seed(int(Vfx.manifest[index].get("seed", 1729)))+ Vfx.stop_all()+ elapsed = 0+ sequence_id += 1+ events.clear()+ moves.clear()+ _pose(player, [], 0.0)+ _pose(enemy, [], 0.0)+ var item: Dictionary = Vfx.manifest[index]+ impact_fired = false+ flash_light.light_energy = 0+ shake = 0+ camera.transform = camera_home+ effect_start = 0.0+ if combat:+ _stage(item)+ return+ # Isolated review stage: the effect alone at its fixed anchor, kick at the manifest peak.+ delivery_text = "ISOLATED"+ sequence_end = float(item.duration)+ if item.category == "projectile":+ var to := _anchor(item, enemy)+ Vfx.launch(item.id, to + Vector3(-3.2, -0.15, 0), to)+ return+ var at := _anchor(item, player if item.attach.begins_with("caster") else enemy)+ Vfx.play(item.id,at,Vector3.ZERO,Vector3.ONE,{"loop":false})+ _at(float(item.get("peak", 0.1)), func(): _kick(item, at))++func _anchor(item: Dictionary, actor: Node3D) -> Vector3:+ return actor.position + ATTACH_OFFSET.get(item.attach, ATTACH_OFFSET.impact)++func _paired_impact(projectile_id: String) -> Dictionary:+ for entry in Vfx.manifest:+ if entry.get("delivery", {}).get("projectile", "") == projectile_id: return entry+ return {}++func _stage(item: Dictionary) -> void:+ # Build one exchange as timed events: who acts, where the effect lands, when the other one reacts.+ var delivery: Dictionary = item.get("delivery", {"kind": "targeted"})+ var kind: String = delivery.get("kind", "targeted")+ var impact_item := item+ if item.category == "projectile":+ kind = "projectile"+ impact_item = _paired_impact(item.id)+ match kind:+ "self":+ delivery_text = "SELF · player casts on itself"+ _move(player, {"kind": "cast", "t": 0.0})+ effect_start = 0.12+ _at(0.12, func(): _play(item, _anchor(item, player)))+ _at(0.12 + float(item.peak), func(): _kick(item, _anchor(item, player)))+ sequence_end = 0.12 + float(item.duration)+ "melee":+ delivery_text = "MELEE · player strikes in place; the blow lands on the target"+ var strike := 0.34+ var start := maxf(0.0, strike - float(item.peak))+ _move(player, {"kind": "punch", "t": 0.0, "strike": strike})+ effect_start = start+ _at(start, func(): _play(item, _anchor(item, enemy)))+ _hit_at(start + float(item.peak), item, player)+ sequence_end = start + float(item.duration)+ "projectile":+ var projectile_id: String = item.id if item.category == "projectile" else delivery.get("projectile", "")+ delivery_text = "RANGED · %s flies to the target%s" % [projectile_id, (" → " + impact_item.id) if not impact_item.is_empty() else ""]+ _move(player, {"kind": "cast", "t": 0.0})+ var to := _anchor(impact_item if not impact_item.is_empty() else item, enemy)+ # Every projectile flies at the target; a ground impact (Ice Spikes) still erupts at the feet on arrival.+ if not impact_item.is_empty() and impact_item.attach == "ground": to = enemy.position + ATTACH_OFFSET.body+ var flight := float(Vfx.effects.get(projectile_id, {}).get("flight", 0.5))+ var launch_at := 0.2+ effect_start = launch_at if item.category == "projectile" else launch_at + flight+ sequence_end = launch_at + flight + (float(impact_item.duration) if not impact_item.is_empty() else 0.6)+ var current := sequence_id+ if capture_mode and item.category != "projectile":+ # Review one resource at its own start: incoming projectile tails would contaminate first frames and metrics.+ # Keep the same combat positions and arrival time; normal Lab playback still shows the complete pair.+ _at(effect_start, func():+ _play(impact_item, _anchor(impact_item, enemy))+ _hit_at(elapsed + float(impact_item.peak), impact_item, player))+ return+ _at(launch_at, func():+ var handle := Vfx.launch(projectile_id, player.position + Vector3(0.45, 1.3, 0.12), to)+ # A projectile's own capture stops at arrival: the paired impact has its own strip and metrics.+ if handle == null or impact_item.is_empty() or (capture_mode and item.category == "projectile"): return+ handle.arrived.connect(func(_p):+ if current != sequence_id: return+ # Impact begins on the arrival frame; the target reacts at the impact's own peak.+ _play(impact_item, _anchor(impact_item, enemy))+ _hit_at(elapsed + float(impact_item.peak), impact_item, player)))+ "area":+ delivery_text = "AREA · the boss slams the ground; the shock wave reaches the player"+ var peak := float(item.peak)+ _move(enemy, {"kind": "jump", "t": 0.0, "land": peak})+ _at(0.0, func(): _play(item, _anchor(item, enemy)))+ _at(peak, func(): _kick(item, _anchor(item, enemy)))+ _hit_at(peak + 0.08, item, enemy, player, false)+ sequence_end = float(item.duration)+ _:+ delivery_text = "TARGETED · player calls the spell down on the target"+ _move(player, {"kind": "cast", "t": 0.0})+ effect_start = 0.18+ _at(0.18, func(): _play(item, _anchor(item, enemy)))+ _hit_at(0.18 + float(item.peak), item, player)+ sequence_end = 0.18 + float(item.duration)++func _play(item: Dictionary, at: Vector3) -> void:+ Vfx.play(item.id, at, Vector3.ZERO, Vector3.ONE, {"loop": false})++func _hit_at(t: float, item: Dictionary, source: Node3D, victim: Node3D = enemy, kick: bool = true) -> void:+ var power := float(item.get("impact", 0.0))+ if kick: _at(t, func(): _kick(item, _anchor(item, victim)))+ if power <= 0.0: return+ _move(victim, {"kind": "hit", "t": t, "power": power, "dir": signf(victim.position.x - source.position.x)})++func _at(t: float, action: Callable) -> void:+ events.append({"t": t, "do": action})++func _move(actor: Node3D, key: Dictionary) -> void:+ if not moves.has(actor.name): moves[actor.name] = []+ moves[actor.name].append(key)++func _run_events() -> void:+ var due := events.filter(func(e): return elapsed >= e.t)+ for e in due:+ events.erase(e)+ e.do.call()++static func _ease_out(x: float) -> float: return 1.0 - pow(1.0 - clampf(x, 0, 1), 3)+static func _ease_in(x: float) -> float: return pow(clampf(x, 0, 1), 2)+static func _smooth(x: float) -> float: return smoothstep(0.0, 1.0, x)++func _pose(actor: Node3D, keys: Array, t: float) -> void:+ # Procedural poses from timed keys: offset of the whole dummy, lean and squash of its pivot, hit flash.+ var offset := Vector3.ZERO+ var lean := 0.0 # degrees, positive tips the head toward +x+ var squash := 0.0+ var glow := 0.0+ var square := 0.0 # 0..1: how far a character turns from three-quarter view to face the opponent+ for key in keys:+ var u: float = t - float(key.t)+ if u < 0.0: continue+ match key.kind:+ "cast":+ # Dip, then rise onto the toes and lean back as the spell leaves the hand.+ squash += 0.1 * (_ease_out(u / 0.1) - _smooth((u - 0.1) / 0.15))+ offset.y += 0.12 * (_ease_out((u - 0.1) / 0.12) - _smooth((u - 0.35) / 0.35))+ lean -= 9.0 * (_ease_out((u - 0.1) / 0.12) - _smooth((u - 0.35) / 0.35))+ "punch":+ # In place: rock back on the windup, then drive the shoulder toward the target on the strike.+ var strike: float = key.strike+ # The jab lands straight ahead of the body: square up during the windup so it reads side-on.+ square = maxf(square, _smooth(u / strike) - _smooth((u - strike - 0.35) / 0.4))+ lean += -6.0 * _ease_out(u / strike) * (1.0 - _ease_out((u - strike + 0.08) / 0.08)) + 14.0 * (_ease_out((u - strike + 0.08) / 0.08) - _smooth((u - strike - 0.15) / 0.3))+ "hit":+ var power: float = key.power+ var dir: float = key.dir+ var kick := _ease_out(u / 0.09) - _smooth((u - 0.25) / 0.45)+ offset.x += dir * (0.12 + 0.38 * power) * kick+ lean += dir * (5.0 + 14.0 * power) * kick+ squash += 0.12 * power * maxf(0.0, 1.0 - u / 0.18)+ glow = maxf(glow, maxf(0.0, 1.0 - u / 0.12))+ "jump":+ # Boss: crouch, leap, slam down on the effect's peak frame, absorb the landing.+ var land: float = key.land+ var up := land * 0.65+ var y := 0.0+ if u < up: y = 0.95 * _ease_out(u / up)+ elif u < land: y = 0.95 * (1.0 - _ease_in((u - up) / (land - up)))+ offset.y += y+ squash += 0.2 * (1.0 - _smooth(u / 0.08)) * float(u < up) + 0.25 * maxf(0.0, 1.0 - (u - land) / 0.25) * float(u >= land)+ actor.position = (COMBAT_PLAYER if actor == player else COMBAT_ENEMY) + offset if combat else (ISOLATED_PLAYER if actor == player else ISOLATED_ENEMY)+ if actor.has_meta("anim"):+ # A rigged character performs the lean and squash through its clips; only the flash stays procedural.+ var flash: StandardMaterial3D = actor.get_meta("flash")+ flash.albedo_color.a = glow * 0.45+ var facing := 90.0 * signf(CHARACTER_YAW[actor.name])+ actor.get_meta("model").rotation.y = deg_to_rad(lerpf(CHARACTER_YAW[actor.name], facing, square))+ _animate(actor, _clip_for(actor, keys, t), t)+ return+ var pivot: Node3D = actor.get_node("Pivot")+ pivot.rotation.z = -deg_to_rad(lean)+ pivot.scale = Vector3(1.0 + squash * 0.5, 1.0 - squash, 1.0 + squash * 0.5)+ for mat: StandardMaterial3D in actor.get_meta("materials"):+ mat.emission_enabled = glow > 0.0+ mat.emission = Color(1, 0.95, 0.85) * glow * 0.45++func _clip_for(actor: Node3D, keys: Array, t: float) -> Dictionary:+ # The same pose keys pick a clip and the clip time that lines its key moment up with the staged event.+ var want := {"id": "idle", "clip": "idle", "from": float(actor.get_meta("idle_phase")), "start": t, "speed": 1.0}+ for key in keys:+ var u: float = t - float(key.t)+ if u < 0.0: continue+ # The sequence number restarts a clip when a new exchange repeats the same key (replay, next melee effect).+ var id := "%d:%s@%.3f" % [sequence_id, key.kind, key.t]+ match key.kind:+ "cast":+ # The arm thrust lands as the spell leaves the hand, 0.2 s into the cast.+ if u < CAST_END - (CAST_RELEASE - 0.2): want = {"id": id, "clip": "cast", "from": CAST_RELEASE - 0.2, "start": key.t, "speed": 1.0}+ "punch":+ # Bare hands: a stepping jab whose arm reaches full extension on the strike.+ if u < float(key.strike) + 0.9: want = {"id": id, "clip": "punch", "from": PUNCH_STRIKE - float(key.strike), "start": key.t, "speed": 1.0}+ "hit":+ var heavy: bool = float(key.power) >= 0.5+ if u < (1.4 if heavy else 1.0): want = {"id": id, "clip": "hit_heavy" if heavy else "hit_light", "from": 0.05, "start": key.t, "speed": 1.0}+ "jump":+ # One hop of the clip, stretched so the landing frame meets the slam, then held.+ var land: float = key.land+ if u < land + 0.5: want = {"id": id, "clip": "jump", "from": JUMP_CROUCH, "start": key.t, "speed": (JUMP_LAND - JUMP_CROUCH) / maxf(land, 0.05), "until": JUMP_LAND}+ return want++func _animate(actor: Node3D, want: Dictionary, t: float) -> void:+ var anim: AnimationPlayer = actor.get_meta("anim")+ # Only the player carries the punch clips; any role a model lacks falls back to idle.+ var clips: Dictionary = actor.get_meta("clips")+ if not clips.has(want.clip): want = {"id": "idle", "clip": "idle", "from": float(actor.get_meta("idle_phase")), "start": t, "speed": 1.0}+ if want.id != actor.get_meta("clip"):+ actor.set_meta("clip", want.id)+ anim.play(clips[want.clip], IDLE_BLEND if want.clip == "idle" else CLIP_BLEND)+ var position := float(want.from) if want.id == "idle" else float(want.from) + (t - float(want.start)) * float(want.speed)+ anim.seek(position, true)+ # Clips follow the Lab clock (pause and 0.25–2× speed); captures hold the characters still.+ var rate := 0.0 if Vfx.paused or capture_mode else Vfx.speed * float(want.speed)+ if want.has("until") and anim.current_animation_position >= float(want.until): rate = 0.0+ anim.speed_scale = rate++func _kick(item: Dictionary, at: Vector3) -> void:+ # Manifest "impact" (0..1) drives a light flash and camera kick when the effect lands,+ # so effects are judged the way a game would present them.+ if not stage_feedback: return+ var power := float(item.get("impact", 0.0))+ if power <= 0.0: return+ impact_fired = true+ var tint: Array = item.get("light", [1.0, 0.85, 0.6])+ flash_light.light_color = Color(tint[0], tint[1], tint[2])+ flash_light.light_energy = 5.0 * power+ flash_light.position = at + Vector3(0.4, 0.5, 1.2)+ shake = 0.16 * power++func _game_feel(delta: float) -> void:+ flash_light.light_energy = move_toward(flash_light.light_energy, 0.0, delta * 22.0)+ shake = move_toward(shake, 0.0, delta * 0.7)+ camera.transform = camera_home+ if shake > 0.0:+ camera.position += Vector3(randf_range(-shake, shake), randf_range(-shake, shake), 0)++func _set_background(value: bool) -> void:+ bright = value+ environment.background_color = Color("5c6873") if bright else DARK_BACKGROUND+ floor_material.albedo_color = Color("8c9da9") if bright else DARK_FLOOR++func _process(delta: float) -> void:+ fps_label.text = "%d FPS" % Engine.get_frames_per_second()+ if Vfx.manifest.is_empty(): return+ if not Vfx.paused: elapsed += delta * Vfx.speed+ var item: Dictionary = Vfx.manifest[index]+ timeline.value = minf(elapsed / sequence_end * 100,100)+ status.text = "← → Switch • Space Replay • C Combat • L Loop • P Pause • 1–4 Speed | %.2f s · %.2f× · %s | %s" % [elapsed,Vfx.speed,"BRIGHT" if bright else "DARK",delivery_text]+ # While a capture waits for its empty reference frame, no flash or shake may leak into it.+ if not Vfx.paused and (not capture_mode or capture_started):+ _run_events()+ _game_feel(delta)+ # Captures keep the dummies where they stand: a lunge or recoil would count as effect motion in the metrics.+ if combat and not capture_mode:+ _pose(player, moves.get(player.name, []), elapsed)+ _pose(enemy, moves.get(enemy.name, []), elapsed)+ if strip_mode:+ _strip_tick(item)+ elif capture_mode:+ _capture_tick(item)+ elif showcase and elapsed > maxf(sequence_end+.55,1.5):+ if movie_mode and index == Vfx.manifest.size()-1: get_tree().quit()+ else: _select(index+1)+ elif looped and not showcase and elapsed > sequence_end+.55: _replay()++func _notification(what: int) -> void:+ if what == NOTIFICATION_WM_CLOSE_REQUEST and capture_mode:+ print(JSON.stringify({"ignored_close_request":capture_frame}))++func _capture_tick(item: Dictionary) -> void:+ capture_frame += 1+ if capture_frame == 20 and not capture_started:+ _capture_image(item.id+"_baseline")+ _replay()+ capture_started = true+ var peak := maxi(2,int(float(item.get("peak",.15))*60))+ capture_samples.assign([peak,maxi(peak+1,int(float(item.duration)*60*.5)),maxi(peak+2,int(float(item.duration)*60*.85))])+ capture_offset = roundi(effect_start * 60)+ capture_end = 20 + capture_offset + maxi(peak+4,int(float(item.duration)*60)+8)+ if capture_started and capture_samples.has(capture_frame-20-capture_offset):+ var sample := capture_samples.find(capture_frame-20-capture_offset)+ _capture_image(item.id if sample == 0 else item.id+"_phase%d" % sample)+ if capture_started and capture_frame >= capture_end:+ captured += 1+ if capture_ids.size() > 0:+ if captured >= capture_ids.size(): get_tree().quit(); return+ _select(_find_id(capture_ids[captured]), false)+ else:+ if index >= Vfx.manifest.size()-1: get_tree().quit(); return+ _select(index+1, false)+ # Starting the next effect here and stopping it in the same frame let it play into the empty reference.+ Vfx.stop_all()+ capture_frame = 0+ capture_started = false++func _strip_tick(item: Dictionary) -> void:+ capture_frame += 1+ if capture_frame == 11 and not capture_started:+ _capture_image("%s_f000" % item.id) # empty stage: the reference for visibility metrics+ if capture_frame == 12 and not capture_started:+ _replay()+ capture_started = true+ capture_offset = roundi(effect_start * 60)+ capture_end = 12 + capture_offset + int(float(item.duration) * 60) + strip_step+ if strip_plan.has(item.id):+ var wanted: Array = strip_plan[item.id]+ capture_end = 12 + capture_offset + int(wanted.max()) + 1+ if not capture_started: return+ var local := capture_frame - 12 - capture_offset+ var planned: bool = strip_plan.has(item.id) and strip_plan[item.id].has(local)+ if local > 0 and (planned or (not strip_plan.has(item.id) and local % strip_step == 0)):+ _capture_image("%s_f%03d" % [item.id, local])+ if capture_frame >= capture_end:+ captured += 1+ if capture_ids.size() > 0:+ if captured >= capture_ids.size(): get_tree().quit(); return+ _select(_find_id(capture_ids[captured]), false)+ else:+ if index >= Vfx.manifest.size()-1: get_tree().quit(); return+ _select(index+1, false)+ # Starting the next effect here and stopping it in the same frame let it play into the empty reference.+ Vfx.stop_all()+ capture_frame = 0+ capture_started = false++func _capture_image(file_name: String) -> void:+ await RenderingServer.frame_post_draw+ var image := get_viewport().get_texture().get_image()+ var err := image.save_png(capture_dir.path_join(file_name+".png"))+ print(JSON.stringify({"capture":file_name,"error":err,"frame":capture_frame,"effect":Vfx.manifest[index].id}))++# Captures run while the user keeps working: macOS stops drawing a fully covered window (frames come out identical+# to the empty stage), and a centred window gets in the way. Park it always-on-top with only a sliver on screen in+# the bottom-right corner; the viewport still renders at full size, and review.py hands focus back to the user's app.+func _park_capture_window() -> void:+ var window := get_window()+ var screen := DisplayServer.screen_get_usable_rect(window.current_screen)+ window.always_on_top = true+ window.position = screen.end - Vector2i(48, 32)+ print(JSON.stringify({"capture_window":{"position":[window.position.x,window.position.y],"size":[window.size.x,window.size.y],"screen":[screen.position.x,screen.position.y,screen.size.x,screen.size.y]}}))++func _unhandled_key_input(event: InputEvent) -> void:+ # Keystrokes meant for another app can land here for a moment while a capture starts; they must not replay+ # the effect or toggle the stage mid-strip.+ if capture_mode or not event.is_pressed() or event.is_echo(): return+ match event.keycode:+ KEY_LEFT: _select(index-1)+ KEY_RIGHT: _select(index+1)+ KEY_SPACE: _replay()+ KEY_L: loop_button.button_pressed = not looped+ KEY_P: pause_button.button_pressed = not Vfx.paused+ KEY_1: Vfx.set_speed(.25)+ KEY_2: Vfx.set_speed(.5)+ KEY_3: Vfx.set_speed(1.0)+ KEY_4: Vfx.set_speed(2.0)+ KEY_B: _set_background(not bright)+ KEY_S: showcase_button.button_pressed = not showcase+ KEY_C: combat_button.button_pressed = not combatdiff --git a/skills/effekseer-vfx/assets/godot-lab/shaders/character_outline.gdshader b/skills/effekseer-vfx/assets/godot-lab/shaders/character_outline.gdshadernew file mode 100644index 0000000..fe09610--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/shaders/character_outline.gdshader@@ -0,0 +1,17 @@+// Inverted-hull outline for the demo characters (next pass of character_toon): back faces pushed out along+// the normal, drawn as a darkened version of the surface colour so lines read as ink, not as a black border.+shader_type spatial;+render_mode unshaded, cull_front, depth_draw_opaque;++uniform sampler2D albedo_texture : source_color, filter_linear_mipmap;+// In model units; the characters are 1 unit tall before the Lab's 1.75 scale.+uniform float width : hint_range(0.0, 0.02) = 0.0022;+uniform float darken : hint_range(0.0, 1.0) = 0.35;++void vertex() {+ VERTEX += NORMAL * width;+}++void fragment() {+ ALBEDO = texture(albedo_texture, UV).rgb * darken;+}diff --git a/skills/effekseer-vfx/assets/godot-lab/shaders/character_toon.gdshader b/skills/effekseer-vfx/assets/godot-lab/shaders/character_toon.gdshadernew file mode 100644index 0000000..473b17b--- /dev/null+++ b/skills/effekseer-vfx/assets/godot-lab/shaders/character_toon.gdshader@@ -0,0 +1,62 @@+// Cel shading for optional rigged stand-in characters. One shader, three roles (skin / hair / cloth) set by uniforms:+// a two-tone light ramp with a tinted shadow instead of PBR, a lit-side rim, and an optional hair highlight band.+shader_type spatial;+render_mode diffuse_lambert, specular_disabled, cull_back;++uniform sampler2D albedo_texture : source_color, filter_linear_mipmap_anisotropic;+uniform vec4 albedo_tint : source_color = vec4(1.0);+// Ramp: where the shadow edge sits on N·L (−1..1) and how soft it is.+uniform float shade_threshold : hint_range(-1.0, 1.0) = 0.05;+uniform float shade_softness : hint_range(0.001, 0.5) = 0.04;+// Shadow colour multiplies the albedo: skin goes warm, cloth and hair go cool.+uniform vec4 shadow_color : source_color = vec4(0.72, 0.68, 0.82, 1.0);+// The ramp does not fall off with angle, so stacked lights add up fast: the key (directional) light gets full+// weight, point lights (fill, hit flash) a fraction, and the whole result is scaled to stay under the glow threshold.+uniform float light_scale : hint_range(0.0, 2.0) = 0.5;+uniform float point_light_weight : hint_range(0.0, 1.0) = 0.4;+uniform float rim_strength : hint_range(0.0, 2.0) = 0.25;+uniform float rim_power : hint_range(0.5, 8.0) = 3.0;+// Hair: a hard-edged highlight band around the half vector.+uniform float highlight_strength : hint_range(0.0, 2.0) = 0.0;+uniform float highlight_size : hint_range(0.0, 0.5) = 0.06;+// Mixed parts (arm + glove, leg + stocking): pixels whose colour reads as skin take the skin shadow instead.+uniform bool skin_from_color = false;+uniform vec4 skin_shadow_color : source_color = vec4(0.96, 0.74, 0.72, 1.0);+uniform float skin_softness : hint_range(0.001, 0.5) = 0.12;++varying float skin;++float skin_likelihood(vec3 c) {+ // Light skin tones: warm hue (red > green > blue), low-mid saturation, bright.+ float mx = max(c.r, max(c.g, c.b));+ float mn = min(c.r, min(c.g, c.b));+ float sat = (mx - mn) / max(mx, 1e-4);+ float warm = step(c.b, c.g) * step(c.g, c.r);+ return warm * smoothstep(0.55, 0.7, mx) * smoothstep(0.06, 0.14, sat) * (1.0 - smoothstep(0.45, 0.6, sat));+}++void fragment() {+ vec4 c = texture(albedo_texture, UV) * albedo_tint;+ ALBEDO = c.rgb;+ ROUGHNESS = 1.0;+ METALLIC = 0.0;+ skin = skin_from_color ? skin_likelihood(c.rgb) : 0.0;+}++void light() {+ float ndl = dot(NORMAL, LIGHT);+ float softness = mix(shade_softness, skin_softness, skin);+ float lit = smoothstep(shade_threshold - softness, shade_threshold + softness, ndl) * ATTENUATION;+ vec3 ramp = mix(mix(shadow_color.rgb, skin_shadow_color.rgb, skin), vec3(1.0), lit);+ float weight = light_scale * (LIGHT_IS_DIRECTIONAL ? 1.0 : point_light_weight);+ DIFFUSE_LIGHT += LIGHT_COLOR * ramp * weight / PI;+ if (LIGHT_IS_DIRECTIONAL) {+ float rim = pow(1.0 - clamp(dot(NORMAL, VIEW), 0.0, 1.0), rim_power) * rim_strength * lit;+ DIFFUSE_LIGHT += LIGHT_COLOR * rim * light_scale / PI;+ }+ if (highlight_strength > 0.0) {+ vec3 h = normalize(VIEW + LIGHT);+ float band = smoothstep(1.0 - highlight_size, 1.0 - highlight_size * 0.6, dot(NORMAL, h));+ SPECULAR_LIGHT += LIGHT_COLOR * band * highlight_strength * lit * weight * (1.0 - skin) / PI;+ }+}diff --git a/skills/effekseer-vfx/assets/materials/M_Additive.vfxmat.json b/skills/effekseer-vfx/assets/materials/M_Additive.vfxmat.jsonnew file mode 100644index 0000000..fade1dc--- /dev/null+++ b/skills/effekseer-vfx/assets/materials/M_Additive.vfxmat.json@@ -0,0 +1 @@+{"material":"Default","blend":"Add","emissive":1.0,"z_test":false}diff --git a/skills/effekseer-vfx/assets/materials/M_Alpha.vfxmat.json b/skills/effekseer-vfx/assets/materials/M_Alpha.vfxmat.jsonnew file mode 100644index 0000000..e57c5a6--- /dev/null+++ b/skills/effekseer-vfx/assets/materials/M_Alpha.vfxmat.json@@ -0,0 +1 @@+{"material":"Default","blend":"Blend","emissive":1.0,"z_test":false}diff --git a/skills/effekseer-vfx/assets/materials/M_Subtractive.vfxmat.json b/skills/effekseer-vfx/assets/materials/M_Subtractive.vfxmat.jsonnew file mode 100644index 0000000..94c9e52--- /dev/null+++ b/skills/effekseer-vfx/assets/materials/M_Subtractive.vfxmat.json@@ -0,0 +1 @@+{"material":"Default","blend":"Sub","emissive":1.0,"z_test":false}diff --git a/skills/effekseer-vfx/assets/review_rubric.json b/skills/effekseer-vfx/assets/review_rubric.jsonnew file mode 100644index 0000000..ba91e6b--- /dev/null+++ b/skills/effekseer-vfx/assets/review_rubric.json@@ -0,0 +1,20 @@+{+ "purpose": "Independent review of one effect's filmstrip. The reviewer is not the author: it gets the strip image(s), the manifest entry (id, category, element, duration, peak, impact, design) and this rubric, but not the recipe code, so it judges what is on screen rather than what was intended.",+ "inputs": ["vfx/previews/strips/<ID>.png", "optional vfx/previews/strips/<ID>_bright.png", "optional vfx/previews/strips/<ID>_compare.png", "the effect's manifest entry", "the effect's flags from metrics.json"],+ "scale": {"0": "missing or wrong", "1": "present but weak; a player would not notice it", "2": "clearly works", "3": "reads instantly and has a distinct identity"},+ "criteria": [+ {"id": "read", "question": "From the first lit tile alone, can you tell what the effect is (hit, slash, element, buff...)?", "look_at": "first 2-3 lit tiles"},+ {"id": "timing", "question": "Is there anticipation -> contact -> body -> secondary -> dissipation (or the slow fade-in / inward build for heals, buffs and charges)? Is the contact the brightest moment and only 2-5 frames long?", "look_at": "tile frame labels against manifest peak"},+ {"id": "layering", "question": "At the strongest tile, is there a white-hot core, a saturated body and a darker rim or residue, rather than one flat colour?", "look_at": "peak tile; bright-background strip if provided"},+ {"id": "shape_change", "question": "Does the main shape erode, sweep, or distort over time, or does it only scale and fade like a sticker?", "look_at": "the main shape across consecutive tiles"},+ {"id": "motion", "question": "Do secondary particles burst fast and then slow down, and move the way the element should (fire up, ice falls, dark draws in, holy descends or rises)?", "look_at": "secondary particles across tiles"},+ {"id": "placement", "question": "Do arcs, columns and ground decals sit on or under the dummy rather than beside it or floating?", "look_at": "all tiles"},+ {"id": "tail", "question": "Does the last third still show deliberate dissipation, or is it empty or cut off?", "look_at": "last third of the strip"},+ {"id": "identity", "question": "Would this be distinguishable from other effects of the same category if it were recoloured grey?", "look_at": "whole strip; overview pages for siblings"}+ ],+ "output": {+ "format": "JSON",+ "schema": {"id": "effect id", "scores": {"<criterion id>": "0-3"}, "worst": "criterion id with the lowest score", "fix": "one concrete change for the worst criterion, in recipe terms (layer, timing, texture, motion)", "verdict": "ship | iterate"},+ "rules": ["Score only what is visible; do not trust the design note.", "verdict is iterate when any score is below 2.", "Name one fix only: each iteration round changes one class of problem."]+ }+}diff --git a/skills/effekseer-vfx/references/case_images/cases.json b/skills/effekseer-vfx/references/case_images/cases.jsonnew file mode 100644index 0000000..c83484b--- /dev/null+++ b/skills/effekseer-vfx/references/case_images/cases.json@@ -0,0 +1,121 @@+{+ "schema_version": 1,+ "date": "2026-10-10",+ "method": "Reconstructed one-class A/B: the shipped example with one class of problem reintroduced (BEFORE) and the shipped example (AFTER), each built and captured by `vfx review` in the default capsule Lab (standard view, default profile, seed 1729). Frames are cropped, scaled and laid out only.",+ "cases": [+ {+ "id": "fire_contact_residue",+ "image": "case_images/fire_contact_residue.png",+ "effect_id": "VFX_Fire_Explosion",+ "moments": [+ 1,+ 9,+ 18,+ 42,+ 60,+ 78+ ],+ "before": {+ "evidence_id": "176cb0f3652941b4bb4cd2d9217fdcba",+ "change": "contact held 14+ frames, fireball white-hot to 55%",+ "frame_sha256": [+ "cd3fe8459a3d4e0d109ff51cb3df808db0c59427d30cc4122542084176f13350",+ "ca2b380c2fe36cbe24eb8fb2b20656f5d35b1d2a4a1447ce3bbc344e913974c9",+ "9cba5bbab0e30def9b5b7f6a6a0e6c46206bfa4073ed1694a75eecb3742490ab",+ "d7b58c40a2d6d23568ff601824fa958e1eb47b3b8ff85a1db64966dfaf0d4ca0",+ "03f0114390ef629b25ae4da7d11dbbfaa940ff6d391066f42f9e02f50f807868",+ "5787277c2a6fe3ac87215dd6bbd1e0925bdf43b0b601fbfc8f3830029ba6064f"+ ]+ },+ "after": {+ "evidence_id": "dc3c6304a673457d9e53717f73f39a9a",+ "change": "shipped example: 3-frame flash, fireball cools from frame 12",+ "frame_sha256": [+ "cd3fe8459a3d4e0d109ff51cb3df808db0c59427d30cc4122542084176f13350",+ "8d028957e774cd2aaa8f8215e4fc75e394241ebd46f3d3a4f65009ff976116b7",+ "f8f3848f8ad622c9ed861a4b03cc1b41ed3df9a7098e263e9d3e5778c14ee8a9",+ "d7b58c40a2d6d23568ff601824fa958e1eb47b3b8ff85a1db64966dfaf0d4ca0",+ "03f0114390ef629b25ae4da7d11dbbfaa940ff6d391066f42f9e02f50f807868",+ "5787277c2a6fe3ac87215dd6bbd1e0925bdf43b0b601fbfc8f3830029ba6064f"+ ]+ },+ "image_sha256": "08e00a9d6b6dd436a5201a02222cb8f2c5d38f455b1acbfa5c1fc1c5af0b56e3"+ },+ {+ "id": "projectile_tail",+ "image": "case_images/projectile_tail.png",+ "effect_id": "VFX_Projectile_Fire",+ "moments": [+ 6,+ 15,+ 27,+ 39,+ 54,+ 60+ ],+ "before": {+ "evidence_id": "39b78f690efb4093af054a7a3c9229e8",+ "change": "trail smoke life 14-18, sheet played at 2 frames/cell, 1.0 s",+ "frame_sha256": [+ "57a32b28d586fa3958ffd6442d314fe751d519f3faa1696b1348ffe3c72ecd0b",+ "3791b7e8af25b7ac37f2a15457ace1e0037eb1ef642076827631a72596805db4",+ "ec22b9bdf64407ca9be432cc1274f113bfb4c961c2d763c34610ddb4dadcea42",+ "50851982dbdbbeb6de6308c28ba8e1682ec5bd7ab1603d8b50fa8f1f386b4921",+ "5787277c2a6fe3ac87215dd6bbd1e0925bdf43b0b601fbfc8f3830029ba6064f",+ "5787277c2a6fe3ac87215dd6bbd1e0925bdf43b0b601fbfc8f3830029ba6064f"+ ]+ },+ "after": {+ "evidence_id": "a097de6ccb1d4ec98a0a309764c14280",+ "change": "shipped example: trail smoke life 38-42, 4 frames/cell, 1.2 s",+ "frame_sha256": [+ "637a689b761b3e52061ab64180adf640a6f48ad17847b0e156da79b7fe4a4d65",+ "438ac530fed287bac4cb64f0108c1a99b3f70be4df14a80b0620d1e3283b7187",+ "a94ec4e6355a4893f1120be7fea366b04fcae7eac09783282fc1d2afcf6a5b10",+ "bf316546ba19bc2bef3a086258ec8fc4d333d9658fde2ef138134d27b4e1f928",+ "a94c56752d67ece4dde0fabf1bfd8bec0e5a997940f7642ccfb55629e62f4187",+ "7b7ad71bdeb21885a36cea1ec41c2381d38de45e449a002aeaae6a0bbb78c025"+ ]+ },+ "image_sha256": "f6e83a17f9806c0231ed3547d954407d2311c05ade56fecee5ac280936498d22"+ },+ {+ "id": "shield_breakup",+ "image": "case_images/shield_breakup.png",+ "effect_id": "VFX_Shield_Dome",+ "moments": [+ 18,+ 81,+ 90,+ 96,+ 99,+ 108+ ],+ "before": {+ "evidence_id": "6fb210d99f9b4367a6e695454583866c",+ "change": "break by the shell cutoff curve alone",+ "frame_sha256": [+ "80c0b840c75cdaeff35e90ec6ee113016858adcf90606b1394c40ec6789a3aba",+ "705a810976d233112cb8886fe8ea9c1fc34b6624f00700700191aed5ea2bd24f",+ "69283083fc8d2677e7814278b9fd1b3347a85bc8857e3dbf430dd12fed015b03",+ "42dcca7274291319f0732f5d4b5ca7d2daab4d6f06d5bd2deef6dbaf6bd93e6a",+ "49270d2f2fa3581fe9c85619a6f560c7c21bba1c2c169633e4289bb33c13b50a",+ "5787277c2a6fe3ac87215dd6bbd1e0925bdf43b0b601fbfc8f3830029ba6064f"+ ]+ },+ "after": {+ "evidence_id": "7e68edeabf7342edb3c1a6ceb032d9d8",+ "change": "shipped example: cutoff plus six separating spherical sheets",+ "frame_sha256": [+ "80c0b840c75cdaeff35e90ec6ee113016858adcf90606b1394c40ec6789a3aba",+ "705a810976d233112cb8886fe8ea9c1fc34b6624f00700700191aed5ea2bd24f",+ "1f99a5d140c651ec9b35be7c3aa72764e540a7752ba1559bf29a2cd06e0f9e59",+ "09f12785af3bb763b1dadc93d9b7f7d46471093003fab3d06cad3f622ce8f090",+ "a8fa6089dc3ea1ca1345db573e7d2794bcaf19c10c14e9213d66583bd05d77f0",+ "5787277c2a6fe3ac87215dd6bbd1e0925bdf43b0b601fbfc8f3830029ba6064f"+ ]+ },+ "image_sha256": "43a0a56060ae8991bb4b64d888e1435ac1fc0704ffcb078145171ec710af8c1a"+ }+ ]+}diff --git a/skills/effekseer-vfx/references/case_images/fire_contact_residue.png b/skills/effekseer-vfx/references/case_images/fire_contact_residue.pngnew file mode 100644index 0000000..30b0612Binary files /dev/null and b/skills/effekseer-vfx/references/case_images/fire_contact_residue.png differdiff --git a/skills/effekseer-vfx/references/case_images/projectile_tail.png b/skills/effekseer-vfx/references/case_images/projectile_tail.pngnew file mode 100644index 0000000..b5a07d9Binary files /dev/null and b/skills/effekseer-vfx/references/case_images/projectile_tail.png differdiff --git a/skills/effekseer-vfx/references/case_images/shield_breakup.png b/skills/effekseer-vfx/references/case_images/shield_breakup.pngnew file mode 100644index 0000000..106c206Binary files /dev/null and b/skills/effekseer-vfx/references/case_images/shield_breakup.png differdiff --git a/skills/effekseer-vfx/references/cases.md b/skills/effekseer-vfx/references/cases.mdnew file mode 100644index 0000000..0c31b55--- /dev/null+++ b/skills/effekseer-vfx/references/cases.md@@ -0,0 +1,79 @@+# Diagnosed cases++Three before/after lessons, each a **reconstructed one-class A/B**: the shipped example was changed back to a known+failure in one class of problem, both versions were rendered in the skill's default capsule Lab with the same seed,+camera and absolute frames, and the real frames were only cropped, scaled and laid out. Provenance (evidence IDs and+frame hashes of both captures) is in [case_images/cases.json](case_images/cases.json). The failures themselves come+from earlier iterations of these effects; the images are new renders, not the historical ones.++Cases never replace `vfx effect-verify` for your build. Name the visible problem first, then pick one class of fix;+do not copy the final parameters into every effect. Pick the case that matches the current worst criterion: white+blob → explosion; trail exit → projectile; parameters written but the shape does not change → shield. To reproduce+one, `vfx examples add` the example, make the BEFORE change, `vfx review`, undo it and review again: the second round+writes the same comparison as `<ID>_compare.png`.++## Fire explosion: a contact that stays white++++**BEFORE:** the Detonation flash lives 14 frames instead of 3, the Fire core 22 instead of 5, and the Fireball's ramp+holds white until 55 % of its life instead of turning orange at 12 %. **Look at f18.** BEFORE is still one white+disc that hides the fireball's shape and the target; AFTER has already cooled to an orange-red body with a hot centre,+so the saturated shape, the debris and the lopsided throw read. f42–78 are nearly identical: the fault is only in the+contact. Lint warns about the 14-frame flash (`contact should be 2-5`); the strip shows why.++| Visible problem | Check first | First class of fix | Look again at |+|---|---|---|---|+| still a white mass after the flash | flash and core life, body colour ramp, emissive, overlapping Add | shorten the contact; hand the body's bright stretch to orange-red sooner | whether the body outline survives the contact (f12–18) |+| only small bright dots once the fire exits | the body's real life, fire → smoke hand-off | let one voluminous fire or smoke layer carry the middle | f18–42 shape change |+| empty tail, or grey smoke that seems not drawn | sequence played out early, grey value vs background | align playback segment, ramp and life to keep visible smoke | f54, 60, 66 frame by frame, and clear after the end |++Change one class per round. Do not multiply every size and every emissive by one factor.++## Projectile: trail smoke that dies with the head++++**BEFORE:** the Smoke trail lives 14–18 frames instead of 38–42, plays its smoke sheet at 2 frames per cell instead+of 4, and the duration is 1.0 s instead of 1.2 s. Flight is 0.45 s in both, so the head arrives at the same frame.+**Look at f27, f39 and f54.** At f27 the start of BEFORE's path has no smoke left, while AFTER still has grey smoke+near the caster; at f39, after arrival, BEFORE shows only a few red wisps at the target while AFTER keeps a broken+grey smoke line along the path that drifts and thins until f54.+Frames are compared at absolute times, not squeezed to the same percentage of a different duration.++| What you see | Likely cause | First class of fix |+|---|---|---|+| the head arrives and the whole trail vanishes on that frame | follow inheritance, an immediate stop or very short instances | check `inherit=TRAIL` (`WhenCreating`) and the release before lives |+| particles are alive but the texture is already blank | the sheet plays out before life ends | adjust `frame_length` and the used frame range |+| white and orange are there, the smoke still is not | Blend grey too close to the background | raise a suitable mid-tone on the default stage, keep the cooling |+| the trail is as thick as a pipe | emission too dense, same width and life on every layer | split a main tail, a thin tail and shed particles; then remove excess emission |++"Trail instances are still alive" and "the player can still see smoke" are different claims. Judge from pattern+change, material and motion, not from particle counts; a longer `duration` alone only adds an empty tail.++## Shield: a break that never shows a gap++++**BEFORE:** the six `shell_fragments` are removed, so the break relies on the shell's alpha cutoff curve, which is+written and reads back correctly. **Look at f81, f90 and f96.** In BEFORE the sphere is whole at f84 and gone at f86:+no frame shows a gap, only a few shards fly; it switches off. AFTER hands the shell over to six real spherical+sheets at f80 that separate with visible gaps, tumble outward, decay in colour and are gone by f108.++| What you see | First check | Feasible direction |+|---|---|---|+| the curve read-back is correct but no hole appears | the real picture of this Model + material + plugin combination | if the combination does not erode, hand over to segmented arcs or real sphere pieces |+| fragments appear suddenly bigger and brighter | fragment emissive, colour and birth overlap | let the whole shell exit into the pieces; limit their bright time |+| large fragments still visible at `duration` | last birth, life and colour curves | start the RGB decay earlier and leave margin to clear |+| pieces look glued to the surface | travel, spin and real spatial direction | separate first, then slow; a little tumbling, no uniform tidy radial spread |++In the original iterations the geometric gaps worked first, but large fragments remained at f108 and the+independent review still said iterate; a further round adjusted fragment life and RGB decay to finish the exit.+Adding a new shape does not excuse the last frame. This failure shows only that this shell material combination+does not erode visibly — not that Model layers never support alpha cutoff — and the fix kept the official renderer.++## Using a case++Write the case's check questions into the brief's acceptance lines, then verify with your own standard strips and+assets. The basic direction comes from [layering](layering.md), [timing](timing.md) and [skeletons](skeletons.md);+cases only add evidence-backed diagnosis.diff --git a/skills/effekseer-vfx/references/cli.md b/skills/effekseer-vfx/references/cli.mdnew file mode 100644index 0000000..ef99ce3--- /dev/null+++ b/skills/effekseer-vfx/references/cli.md@@ -0,0 +1,120 @@+# Command reference++`sh <skill>/scripts/vfx [--project DIR] <command> [options]`. Output: one JSON object on stdout; progress and lint+warnings during a build go to stderr. Exit codes: 0 ok, 1 failed check or error (`{"ok": false, "error": {...}}`),+2 setup required: the toolchain is missing (`SetupRequired`) or there is no workspace here (`WorkspaceMissing`).+Image results are file paths — open them.++Every command except `doctor`, `init`, `examples`, `rubric`, `layer-schema` and `process-texture` needs a workspace+made by `vfx init` (`vfx/src/` and `vfx/vfx_manifest.json`). Run from the game project or pass `--project`; a command+run in the wrong folder fails with `WorkspaceMissing` instead of creating a stray `vfx/`. The current directory is+kept off Python's import path, and `vfx/src` helpers resolve only as `_name` files, so project files never shadow+the standard library.++Environment: `VFX_PROJECT` (project, default current directory), `EFFEKSEER_VFX_HOME` (toolchain, default+`~/.cache/effekseer-vfx`), `GODOT` (Godot 4 executable, default `godot` on PATH, then `/Applications/Godot.app`).++| Command | Needs | What it does |+|---|---|---|+| `doctor` | — | platform, toolchain, workspace; `modes` and `next` steps |+| `init [--update-templates] [--no-plugin]` | Python | create/refresh `vfx/` (Lab, materials, math textures, starter painted textures); download the official Effekseer Godot plugin (checksum pinned) |+| `examples [list]` | — | shipped pairs and single effects with historical scores, verdicts and weakest points |+| `examples show <name\|ID>` | Python | layer plan with absolute frames and roles (a pair shows both effects) |+| `examples add <name\|ID\|all> [--force]` | Python | copy example source, brief, painted textures and prompts into the project; names: `fire`, `ice`, `poison`, `dark`, `hit`, `slash`, `charge`, `shield`, `heal` |+| `procedural` | Python | regenerate the math-primitive textures |+| `list` | Python | effects in `vfx/src` with category, timing, delivery, design and build state; sources that fail to load are listed in `unloaded` |+| `lint [--ids ...] [--timeline]` | Python | static rules (errors) and craft heuristics (warnings), see below |+| `layer-schema` | Python | every layer field the compiler accepts |+| `brief-validate <ID>` | Python | brief vs recipe, with the expanded absolute layer timeline |+| `effect-context <ID>` | Python | brief, build issues, latest evidence and the last 10 rounds |+| `texture-info [names...]` | Python | coverage, bbox, border contact, orientation, bulge, seam ratio |+| `texture-audit <name> [--role R] [--grid C R] [--loop] [--allow-empty i...]` | Python | role checks + preview image |+| `process-texture <src> <dst> [--size N] [--color] [--grid C R]` | Python | crop, alpha, padding, power-of-two resize |+| `build [--ids ...]` | Core | lint, compile, save/open read-back, manifest, build receipt; without `--ids` also prunes effects this skill built whose source left `vfx/src` (see below) |+| `compile <recipe.json> [--source] [--runtime]` | Core | compile one recipe JSON |+| `export [--output DIR]` | Core | re-export all built effects to `.efk` with `resources/` |+| `discover` | Core | dump Core property paths, types and enums to `vfx/work/property_schema.json` |+| `core <command> ...` | Core | the vendored bridge's low-level commands on explicit `.efkefc` files: `property-list`, `property-get`, `property-set`, `node-list`, `curve-list`, `curve-set`, `settings-list`, `settings-set`, ... (`vfx core --help`); see [engine conventions](engine-conventions.md#extending-the-compiler) |+| `review [--ids] [--step N] [--note] [--key-frames ...] [--view standard\|close] [--profile default\|bare] [--bright]` | Core + Godot | strips, key-frame sheet, flags, changes, evidence ID |+| `overview [--ids]` | review done | library overview pages of the latest standard captures (the baseline `effect-verify` checks); never-captured effects are skipped and listed in `missing`. With `--ids`, a scratch page `overview_select_*.png` that does not replace the baseline |+| `strip <ID> [--compare] [--bright]` | review done | strip path and stored metrics |+| `frames <evidence_id> <frame...>` | review done | full-size frame paths and freshness issues |+| `history <ID> [--limit N]` | — | review rounds, newest last |+| `rubric` | — | the independent review rubric |+| `review-handoff <ID>` | review done | write the independent reviewer's complete brief for the latest fresh capture (`prompt_file`), with `report_file` and the submit command |+| `review-submit <evidence_id> <report.json> --reviewer ID [--frames f...]` | review done | bind an independent report; frames default to its `observed_frames` |+| `effect-verify <ID> [--no-overview]` | — | exit 1 unless current build, capture, review and overview agree; `--no-overview` is a partial check that reports `passed_without_overview` and never `verified: true` |+| `preview [--ids] [--bright] [--output]` | Godot | UI screenshots at baseline, peak, 50 %, 85 % |+| `showcase [--movie]` | Godot (+ ffmpeg) | open the Lab auto-playing the library; `--movie` records it |+| `package [--preview-dir]` | Godot | zip the Godot project with a texture inventory; does not claim device tests |+| `reference-import`, `reference-frames`, `reference-compare` | ffmpeg | see [reference](reference.md) |++## `--ids` and broken sources++With `--ids`, `lint` and `build` only require the named sources to load; any other `vfx/src/VFX_*.py` that fails+(a half-written effect) is reported in `unloaded` and left out of the cross-effect checks, instead of blocking the+work. Without `--ids` every source must load.++## What a full build may delete++A full `vfx build` refuses to run when `vfx/src` has no recipes. Otherwise it removes only effects **this skill+built** whose `vfx/src/<ID>.py` is gone: manifest entries tagged `built_by: "effekseer-vfx"` with `source` equal to+their own `vfx/src/<ID>.py`, or, in a workspace built before that tag, an effect whose build receipt in+`vfx/work/builds/` still matches the `.efkefc` on disk. Malformed IDs are never owned, and every path is checked to+stay inside `vfx/` before anything is deleted. Effects in the manifest or in `vfx/effects/` that another tool or a+person made are kept; `vfx doctor` counts them as `unmanaged`.++A full build also prunes resource copies no recipe uses: only a file identical to a texture in+`vfx/textures/processed/` (and that PNG's own `.import`), never other files with the same prefix, and never a name an+unmanaged effect may use (its `.efkefc` names the file, or its file is missing). Core copies every texture and model+into `resources/` by base name, so a build stops with `Resource name conflict` when two different files share a name:+within the build, against an owned effect that uses it and is not rebuilt in the same call (rebuild them together),+or against an unmanaged effect that may use it (rename the file). A build refuses to run when any output folder+resolves outside `vfx/` (a symlink elsewhere). Each build receipt binds all of its resource copies, so a later build+that changes one makes the earlier capture stale.++## What lint checks++Errors (the build refuses while any exist):++- unknown or mistyped layer fields (with a suggestion), and invalid field values;+- `peak` outside the duration; an `infinite` layer without `flight` or without an `interval`;+- a layer alive past the duration (non-looping effects), counting births and the projectile release;+- particle budget above the category's limit: `hit` 60, `projectile` 100, `boss` 250, every other category 150;+- a texture that is neither a math primitive nor recorded in `vfx/texture_prompts.json`, or missing from+ `vfx/textures/processed/`;+- `size_curve`/`scale_curve` combined with a random size or scale range (the compiler cannot multiply them);+- UV distortion on a flipbook (it samples neighbouring cells and renders hard square edges);+- gravity above 0.01 (it is per frame squared).++Warnings (craft hints; the strip decides):++- `fade_in + fade_out` longer than the shortest life (the layer never reaches full opacity);+- an effect with `impact >= 0.3` but no contact: no `flash()` layer and no single white-hot additive layer that+ lives at most 10 frames;+- the contact starts more than 6 frames from the manifest `peak`, where the Lab kicks;+- a `flash()` that lives more than 6 frames (a contact should be 2–5);+- no layer changes shape: no dissolve cutoff, ring sweep, UV distortion or scroll, flipbook, or painted shape+ re-struck on later frames;+- no white-hot additive colour (luma ≥ 0.85 and every channel ≥ 180);+- two effects of one category but different elements that differ in fewer than 3 of shape, motion, rhythm,+ material and secondary (likely a recolour).++## Workspace layout++```+<project>/vfx/+ src/VFX_*.py recipe sources (yours) ┐+ briefs/VFX_*.json design briefs │+ texture_prompts.json prompts of painted textures │ the effect library:+ textures/generated/ image-model originals (never edited)│ keep under version control+ textures/processed/ game textures (incl. procedural) │+ recipes/*.json compiled recipe snapshots │+ effects/*.efkefc Effekseer sources + resources/ │+ exports/*.efk runtime exports + resources/ │+ vfx_manifest.json ids, timing, delivery, design │+ previews/strips/overview_*.png, metrics.json ┘+ characters/ optional rigged stand-ins (player.glb, target.glb)+ godot/ generated Godot Lab (ignored)+ work/ receipts, locks, reference frames, audits, property schema (ignored)+```diff --git a/skills/effekseer-vfx/references/craft.md b/skills/effekseer-vfx/references/craft.mdnew file mode 100644index 0000000..2ea7a58--- /dev/null+++ b/skills/effekseer-vfx/references/craft.md@@ -0,0 +1,98 @@+# VFX craft rules++The rules every recipe is built on. Read them before writing or changing an effect, together with+[layering](layering.md), [timing](timing.md) and [skeletons](skeletons.md). The craft starting points here may be+adjusted to the user's style; the measured engine behaviour in [engine-conventions](engine-conventions.md) may not.++Contents: 1. Why "sticker" effects fail · 2. Time structure · 3. Element differences · 4. Projectiles ·+5. Irregular, multi-role effects · 6. Budgets++## 1. Why "sticker" effects fail++A static billboard that is recoloured, scaled up and faded out reads as a sticker. Five things make an effect read+as an effect; missing any one of them visibly lowers quality:++1. **Time structure**: anticipation → contact flash → body → secondary motion → dissipation. Contact takes 2–5+ frames; dissipation takes most of the duration.+2. **Value layering**: a white-hot core, a saturated body and a darker rim or residue — not one flat colour.+3. **Shape change**: the body erodes (alpha cutoff dissolve), wobbles (UV distortion) or sweeps open; scale and+ opacity alone are not enough.+4. **Varied speed**: particles burst out, then hang and droop (eased travel), never at constant speed in a line.+5. **Screen feedback**: bloom, an environment flash and camera kick on impact. The Lab derives them from the+ manifest `impact`, `light` and `peak`; the effect must still work with them switched off (`--profile bare`).++## 2. Time structure++| Phase | Frames (60 FPS) | How |+|---|---|---|+| Anticipation | 2–14 | Shrinking small glow, ground warning ring, thin guide lines. Heavier hits anticipate longer |+| Contact | 2–5 | `flash` white star, 1.5–2× the body size, gone immediately |+| Body | 8–20 | Painted shape pops in with `POP`, then erodes with `DISSOLVE`; `shock_ring` expands |+| Secondary | 10–40 | `radial_sparks`, `motes`, debris, flame tongues, with gravity / rise / turbulence |+| Dissipation | 20–60 | Smoke, embers and ground-crack glow cooling down slowly |++Heals, shields and buffs drop the contact frame and use a slow fade-in, rising motion and slight overshoot instead.+Charges invert the structure: a long inward build, then one flash at release.++## 3. Element differences++A recolour is not a new element. Two elements of the same category must differ in at least three of+**shape, motion, rhythm, material and secondary** (`vfx lint` warns when they do not):++| Element | Shape | Motion | Rhythm | Secondary |+|---|---|---|---|---|+| Physical | jagged burst, speed lines | radial burst, then droop | shortest, 0.3–0.65 s | sparks, dust |+| Fire | billowing fireball, flame tongues | rises, UV distortion | medium, long tail | rising embers, dark smoke |+| Ice | prisms, shards | overshoot, hold still, then shatter | has a hold | shards under gravity, sinking cold mist |+| Lightning | jagged polyline | does not travel; frame-swapped or mirrored strikes | main strike, return stroke, after-flicker on different frames | ground cracks, crawling arcs |+| Dark | vortex, black core | draws inward | long draw-in plus one release | alpha-blended black body, inward motes |+| Holy | seal, pillar of light | falls or rises vertically | eases in, sustains | rising halos, twinkles |+| Poison | cloud, bubbles | slow drift, sinking fog | slowest, about 2 s | rising bubbles, spores |++## 4. Projectiles (category `projectile`)++A projectile has no contact frame. Its impact is a separate effect, triggered by the `arrived` signal of+`Vfx.launch`. The projectile recipe declares `flight` (seconds of the reference flight) and, for a lob, `arc`+(metres of lift at mid-flight). The impact points back with `delivery=dict(kind='projectile', projectile='VFX_...')`.++- **Head** layers follow the handle (default inheritance). **Trail** layers use `inherit=TRAIL` (position, rotation+ and scale `WhenCreating`) and stay where they were born, so the path draws itself. Both are emitted with+ `sustain(layer, interval)` (`infinite`); the game calls `stop_root()` on arrival, after which only the trail's+ dissipation remains. Lint computes lifetimes as if released at `flight`; the budget counts life/interval+ instances alive at once.+- Make elements differ in flight rhythm and secondary motion too: fire flickers, rises and turns to dark smoke;+ ice is fast and straight, sheds shards that fall and leaves sinking mist; dark is an alpha-black core that drags+ needles inward with a contracting wake; poison lobs on an arc, drips, bubbles and leaves hanging fumes.+- Review strips fly the projectile from the caster to the target and end on arrival. Its centroid and radius+ follow the flight path rather than the element's motion, so the `sinks` and `expands while charging` flags are+ not checked for projectiles.++## 5. Irregular, multi-role effects++Techniques that make ranged and impact effects read as professional work (the shipped example pairs use them):++1. **Broken arcs, not full rings.** Build the body from several incomplete strokes, each sweeping 60–200° with its+ own radius, tilt and width, crossing each other. Use `wisps` (painted wisp strands with a standing erosion), not+ a clean `shock_ring`, `shell` or round billboard as the main shape.+2. **Several roles, each with a job.** A complex ranged skill may combine arcs, a white-hot core, a dark core, two+ spark tiers, motes, dust, debris and ground marks. State what each role is for; do not treat a layer count as a+ pass mark. Light hits and simple skills need far fewer.+3. **Dark elements must be visible.** On a dark stage, grey smoke and debris need values of about 90–150; a colour+ like `(40,10,70)` might as well not be drawn.+4. **Small accents with a purpose**: an orange underside on dark, a prism fringe on ice, a dark core under poison.+ 5–10 % of the area is only a first try; decide the main and accent roles in the brief first.+5. **Glow decays into smoke.** `decay()` gives an additive stroke an alpha-blended grey copy that starts a few+ frames later and lives 1.6–2.2× as long: the light goes out first and the shape lingers as smoke.+6. **One long thin line.** At release, a `slice_line` across half the screen, aspect ratio above 40:1, for 8–15 frames.+7. **Direction.** Debris, sparks and droplets spray along the line of the shot (+X) and slightly up (`spray`,+ `debris`), not as a symmetric sphere.+8. **Ground feedback.** Rolling dust, debris that lands and bounces, scorch marks, cracks, pools and seals pin the+ effect to the floor.+9. **Impact frame.** A near-black full-screen card and the white flash go on the **same frame** (the black card listed+ before the flash). Putting the black card earlier makes the dark "expands while charging" check read it as growth.++## 6. Budgets++Particle instances (`particle_budget`, parent × children): normal hit ≤ 60, projectile ≤ 100, element skill ≤ 150,+boss skill ≤ 250. At most three screen-sized additive layers alive at once. Textures 128–256 px; painted main shapes+and seals 512 px; 4×4 flipbook sheets 1024 px.diff --git a/skills/effekseer-vfx/references/design.md b/skills/effekseer-vfx/references/design.mdnew file mode 100644index 0000000..eb06e94--- /dev/null+++ b/skills/effekseer-vfx/references/design.md@@ -0,0 +1,96 @@+# Design briefs++Every new effect starts with a brief: write `vfx/briefs/<ID>.json` before the recipe. `vfx brief-validate <ID>`+checks the brief against the recipe (layer paths, beats inside the duration), so run it once the first recipe draft+exists, and again after every change to either. For a small fix, read the existing brief and adjust the affected goals. Brief times are absolute+60 FPS frames from the start of the effect; the manifest keeps seconds.++## What the brief decides++State the **purpose** (frequent hit, single skill, finisher, sustained status, showcase piece), the **shape the+player reads first**, its **size relative to a character** in the standard camera, the **release or contact+moment**, and **what remains at the end**. Acceptance lines describe visible behaviour — "the fire keeps rolling+upward after the flash is gone" — never "more layers" or "premium feel".++Start with three key frames: **earliest readable**, **body takes over from the contact**, **last intentional+residue**. For each, say what shape is where and how it is changing, then pick primitives. "A tilted arc across+the target's chest, fire peeling off its lower edge and rising, ending in embers only" guides code far better than+"cool fire slash".++| Purpose | Shape read first | Volume and scale decision | Space to keep clear |+|---|---|---|---|+| Frequent hit | small burst and short directional lines | centred on the hit point; never covers the whole character every time | the player's body and surrounding combat information |+| Directional slash | arc and hot edge in a tilted plane | the swing plane passes through the target; width and negative space both visible | the character silhouette inside and behind the arc |+| One explosion | a volume erupting from the contact point | the body visibly grows, lifts and leaves residue in the standard camera | lanes outside the body for secondary motion |+| Sustained status | a stable outline around its owner | does not hold the highest brightness; the hold has surface motion | the character inside the shell and the main view |++Do not compose from texture names. The same smoke sequence can carry weight after a fireball or residue along a+flight path, but birth position, size, direction, density and played frame range must differ. When important+layers share a centre, state which is in front, which behind and which exits first.++## Palette roles++`palette` assigns **core**, **body**, **dark** and **matter** (accent optional). A short hot core; a saturated body+with an outline; a dark that gives contrast to the outline or residue; smoke and debris that give the effect+material weight. Declare accents in the brief rather than adding a colour per layer. The effect should still read+in greyscale. See [layering](layering.md).++## Time structure by purpose++A normal hit is a short contact, then decay. A charge may build gradually. Lightning may have an explicit return+stroke. A shield may hold a stable stretch. A multi-hit skill states each peak separately. An explosion's brightness+may fall while its body still grows and rises. A swarm of small sparks never replaces a body that disappeared.+See [timing](timing.md).++## Exceptions to the style rules++"Irregular" suits matter, breakage and brush strokes; it does not automatically apply to seals, aiming cues or+optical stars. "Many roles" suits complex skills, not light hits. A "white core" helps an attack contact; it does not+mean a heal must flash. The reference techniques in [craft](craft.md) are candidate tools; the user and the brief+decide style and purpose. Do not give every skill the same glow, shock ring and sparks after reading one table.++## Brief format++All fields except `reference` are required (`assets/brief.schema.json`). Abbreviated from the shipped+`VFX_Fire_Explosion` brief, which plans all 24 layers:++```json+{+ "schema_version": 1,+ "effect_id": "VFX_Fire_Explosion",+ "role": "paired ranged impact",+ "style": "stylized anime combat",+ "dominant_shape": "turbulent comet and ascending cooling smoke",+ "palette": {"core": [255, 250, 220], "body": [255, 120, 30], "dark": [60, 30, 20], "matter": [125, 110, 100]},+ "delivery": {"kind": "projectile", "projectile": "VFX_Projectile_Fire"},+ "anchor": "body",+ "beats": [+ {"frame": 4, "name": "gather", "expect": "Inward gathering at target"},+ {"frame": 10, "name": "contact", "expect": "White-hot detonation lasts only a few frames"},+ {"frame": 18, "name": "body", "expect": "Orange fire survives white flash"},+ {"frame": 54, "name": "tail", "expect": "Grey smoke thins while ascending"}+ ],+ "layer_plan": [+ {"name": "0:Scorch", "role": "ground footprint", "primitive": "Sprite T_Crack01", "exit": "gone by absolute f55"},+ {"name": "5:Detonation flash", "role": "contact", "primitive": "flash", "exit": "gone by absolute f12"}+ ],+ "acceptance": ["Head/body silhouette reads at standard camera after the brightest accent"],+ "avoid": ["Large persistent white blob erasing the body"]+}+```++- `effect_id`, `delivery` and `anchor` must equal the recipe's `id`, `delivery` and `attach`.+- `beats` are ordered absolute frames (0 … duration + 12); review always captures them as key frames.+- `layer_plan[].name` is the layer's **full indexed path** — sibling index and name, children joined by `/`+ (`0:Swing plane/1:Blade body`) — so duplicate names stay distinguishable. Update it when layers move. Every layer+ should be planned (unplanned ones are warned about). Never put brief metadata into a layer dict.+- `brief-validate` expands parent birth times: a child's delay is not the effect's start.++The shipped examples (`vfx examples add <pair>`) each come with a complete brief to copy from.++## Before you start++Colour, emissive, Add/Blend and the Lab's HDR bloom together decide the picture; know the stage settings in+[engine conventions](engine-conventions.md). Use the existing library and the dummy's size as the first scale, then+check the standard camera. Strong reference work is a target for rhythm and silhouette; its size and brightness+numbers are not this engine's defaults.diff --git a/skills/effekseer-vfx/references/engine-conventions.md b/skills/effekseer-vfx/references/engine-conventions.mdnew file mode 100644index 0000000..5cc01d3--- /dev/null+++ b/skills/effekseer-vfx/references/engine-conventions.md@@ -0,0 +1,147 @@+# Verified engine conventions (Effekseer Core 1.80.7 + EffekseerForGodot4 1.80.5.1)++Each item below was confirmed in real renders. Use them as they are; do not re-guess axes, units or blend+behaviour. When you confirm a new convention, add it here with how it was measured.++Contents: angles and axes · forces and motion · meshes and fresnel · textures and flipbooks · inheritance and+lifetime · rendering, HDR and the Lab · anchors and placement · extending the compiler++## Angles and axes++- **Ring angles**: 0° points up, 90° points left, increasing counter-clockwise. A swept arc is centred on the anchor+ by offsetting the ring centre against the middle of its sweep.+- **Sprite Z rotation** is counter-clockwise. Never eyeball a painted shape's orientation: `vfx texture-info <name>`+ reports coverage, bounding box, border contact, principal orientation and the bulge direction of a crescent in the+ same convention (+x is 0°, counter-clockwise). Use the measured angle in the recipe. Example: `T_Slash02` measures+ a 108° bulge and `slash_set()` uses `SLASH02_BULGE = 105`; re-measure and update the constant if you replace it.+- **`billboard='Billboard'` ignores Z rotation** (a sprite with `rotation=[0,0,90]` stays upright). Sprites that need+ a roll use the default `RotatedBillboard`.+- **Sphere emission with `rotate=True`**: the particle's local +Y points outward, so `travel.end=[0,d,0]` flies out+ and a negative value draws in.+- **Circle emission (default Y axis) with `rotate=True` is different**: Core builds `Translation(r,0,0)*RotationY(angle)`,+ so local **+X** points outward and +Y stays up. Smoke rolling out along the floor needs `travel.end=[[d0,d1],0,0]`;+ `[0,d,0]` turns it into a column rising straight up. With `rotate=False` the displacement is in world directions+ (use that for rising particles).+- **`travel.end` is an absolute local position**, not an offset from `position`, and `rotate=True` emission rotates+ that local frame too. Put floor-rolling smoke under a `renderer='None'` pivot whose `position` is at floor height;+ for world-direction displacement use `spawn rotate=False` (`spray`).++## Forces and motion++- **Drag only damps velocity accumulated by force fields, not PVA velocity.** "Burst, then hang" must be `travel` with+ an EaseOut, not velocity + drag.+- **Gravity is in units per frame².** Falling sparks 0.001–0.002, rocks 0.004, rising smoke 0.0003–0.0006. One order+ of magnitude more and particles leave the screen (lint rejects above 0.01).+- **Floor collision `collide`**: world coordinate system; `height` is a world height (the Lab floor is 0.02). From an+ impact point 1.35 m up with gravity 0.0015 nothing reaches the floor within 20 frames, so bouncing only matters for+ explosions, boss slams and things that land.+- **Track + Circle `Order` emission does not make a spiral**: it advances one segment per frame, so at flight speed+ the pitch stretches into a flat zigzag. Use `wisps` strokes at random tilts around the head instead.++## Meshes and fresnel++- **Procedural cylinders and cones** span `DepthMin` to `DepthMax` along their axis; `mesh()` stands them on the+ origin. **Spheres** use a normalised depth of -1..1: size them with `scale_start`, never with Depth.+- **A Cone points down** (its base is at the +Y end). For a crystal pointing up use a `Cylinder` with `radius2≈0`+ (`crystal()` does). `Mesh/Divisions/X=6` makes a hexagonal prism. `ShapeNoise/WaveNoisePower` turns a sphere into+ a lumpy liquid glob. Large spheres need `rings ≥ 24` or the silhouette is faceted.+- **Procedural model V runs top to bottom.** A scrolling colour texture must tile (`T_NoiseStreak02`); keep gradients+ in a non-scrolling alpha texture (`T_GradientV01`) or a hard seam appears.+- **Falloff**: `begin` is the centre facing the camera, `end` is the edge, and a larger `pow` makes the `begin` area+ **smaller** (red/green test: at pow 8 almost the whole sphere shows `end`). A thin bright rim (fresnel, shock+ shell) uses `pow` 0.25–0.5. Draw spheres front faces only with `culling='Front'` (Effekseer naming: `Front` shows+ the front; `Double` lights the inner back faces as edge too and the sphere turns solid). Shields light the edge;+ pillars make the edge transparent.+- **Model layers with a colour texture or a standing cutoff + edge** render as grey blotches in the Godot plugin on+ shell spheres. Use a flat colour + fresnel and dissolve only at expiry; for a visible break-up use+ `shell_fragments` (real geometry) rather than a cutoff on the whole shell.+- **No camera-facing "vortex sticker"** for black holes, dark orbs or charges: put rings in tilted planes with+ `orbit_band` and stack them in draw order — far half ring → core (Blend black disc or bright core) → photon ring →+ near half ring — so the near half passes in front of the core. The plugin **ignores ZWrite between effect layers**+ (a depth-writing sphere plus depth-tested rings had no effect); occlusion comes only from list order. Spin a ring+ surface with `alpha_scroll` so streaks flow round it, not with Z spin.++## Textures and flipbooks++- **UV distortion textures must be opaque RG offset maps** (`T_Distort01/02`). A white-on-alpha mask used as a+ distortion map distorts nothing.+- **Alpha textures read the alpha channel**; every `T_Noise*` mask works directly for a `cutoff` dissolve.+- **Flipbook integers**: `flipbook.frame_length`, `x` and `y` are integer Core properties and must be positive integers+ (4.5 is rejected natively; the field validator catches it first). Lengthen playback with integer frame lengths+ and life together.+- **No UV distortion on a flipbook**: `distortion_intensity` is measured in whole-texture UV, so 0.12 on a 4×4 sheet+ shifts half a cell and samples the neighbouring frames — fire gets cut into hard-edged blocks. Lint rejects it;+ use a single-frame texture when you need distortion.+- **Flipbook sheets**: an image model can produce a whole 4×4 sequence (1024², 256² cells) with usable continuity.+ Process it with `vfx process-texture <original> <output> --size 1024 --grid 4 4`: cells keep their position (no+ crop, no re-centring, which would make the animation jitter) and each cell edge is feathered against bleeding.+ `frame_length` ≈ life / 16; one-shot with `loop='Once'`, looping fire with `Loop` and a random start frame.+- **One explosion sheet, two layers**: additive fire (ramp white → yellow → orange → dark red → out) plus a Blend dark+ smoke layer delayed by about 8 frames. The smoke must be **listed before** the fire (drawn behind it), otherwise it+ punches a black hole through the fireball.+- **Erosion edge colour** is added over the cooled red; a yellowish edge turns olive. Fire uses `(255,80,15)` with+ `scaling≈2`.+- **Wisp strand texture**: the painted strand band is cropped by rows at full width (so it tiles horizontally),+ resized to 512×256 with alpha = luminance. The default centred processing adds side margins and breaks the tiling.++## Inheritance and lifetime++- **Inheritance**: Core's default `LocationEffectType` is `Already` (follows the parent every frame). `WhenCreating`+ takes the parent transform only at birth, so particles stay put while the handle moves — projectile trails rely+ on it. `renderer='Track'` joins successive instances of one layer into a ribbon; with `WhenCreating` it is a+ continuous trail.+- **`EffekseerEmitter3D.stop_root()`** stops new emission; existing particles finish their own lives before+ `finished` fires.+- **Child timing**: a child's generation is timed from its parent instance's creation, not its death. A+ `renderer='None'` parent can spin its children, and children easing to the centre with `travel` make a spiral+ infall.+- **Random size cannot take a curve**: a random `size` / `scale_start` range combined with `size_curve` / `scale_curve`+ fails to compile (the compiler multiplies the curve by a fixed start scale; lint rejects it). Vary size with a+ second layer.++## Rendering, HDR and the Lab++- **Screen distortion `material='BackDistortion'`** works in the Godot plugin (`hint_screen_texture`); `distortion` is+ the strength (0.4–1.2). It refracts only opaque objects (floor, dummies), not other effect layers. On a dark plain+ stage it shows only on the floor ring and dummy edges — zoom into frames to see it. The effect must still work+ with distortion off.+- **Lab stage and HDR bloom**: the default stage is a lit deep slate blue (background `1a2433`, floor `1d2733`,+ ambient 0.75, key 1.5, fill 1.0). In Forward+ the plugin's additive / emissive output lands in the HDR buffer.+ Measured with lit stand-in characters, dummy highlights peaked near 3.4× while effect cores exceeded 8×, so Glow+ ramps by `smoothstep(threshold, threshold + hdr_scale)` from 2.8 to fully on at 6.0, intensity 1.5, strength 1.1,+ additive before tonemapping, five blur levels 1.0/1.0/0.85/0.6/0.35, Filmic white 4 so cores burn white earlier,+ `glow_bloom=0`. These numbers were measured with lit, toon-shaded character stand-ins; the default Lab's capsule+ dummies have not been re-measured against them, so treat the threshold as a starting point and re-measure the dummy+ peak (linear tonemap, read back at exposure 1/8) after changing stage brightness, dummy lighting or the stand-ins+ before moving the threshold. `godot --path vfx/godot -- --no-glow` disables the post-process for comparison. The recipe primitive+ `glow()` is a texture layer, not this HDR post-process. Re-render the whole overview after stage changes.+- With strong bloom, effects whose contact is legitimately white-hot report `washed out` on their peak frame; that+ lasts 1–3 frames — judge from the strip and do not weaken the contact just to silence the flag.+- **Soft particles `soft`** were unusable in an earlier Compatibility-renderer Lab (no depth texture; sprites turned+ almost fully transparent). The Lab now uses Forward+, but `soft` has not been re-verified: do not use it and do not+ claim it works.++## Anchors and placement++- Lab anchors: `body` is 0.95 m above the floor, `impact` 1.35 m, `ground` 0. Floor layers in a `body`-anchored+ effect sit at about `y = -0.93`, in an `impact`-anchored one at about `y = -1.3`; written lower, a depth-tested+ decal disappears under the floor.+- Melee shock rings across the line of the blow use `tilt=(0,58,0)`: perpendicular to a left-to-right attack, seen+ in perspective as a vertical ellipse.++## Extending the compiler++The recipe fields are a curated subset of Effekseer. When an effect needs an engine feature the compiler lacks:++1. Make a reference node with the feature (or open an effect that has it) and find the property paths:+ `vfx discover` dumps every path of a fresh node with its type and enum values to `vfx/work/property_schema.json`;+ `vfx core property-list <file.efkefc> node/root/0` lists the paths of a real node.+2. **Read before writing**: `vfx core property-get <file> <path>` for the current value, then+ `vfx core property-set <file> <path> <json>` and `property-get` again to see what Core actually stored. Curves go+ through `vfx core curve-list` / `curve-set`, renderer panels through `settings-list` / `settings-set`.+3. Use only properties the current Core saves; do not rely on legacy fields that are only read on import.+4. Add the feature as a layer field in `scripts/effekseer_ai/authoring.py` (it must appear in `vfx layer-schema`),+ with a test that compiles a layer, saves, re-opens and reads the value back. Never write raw property paths into a+ recipe.+5. Render it and add the convention to this file with how it was measured.+diff --git a/skills/effekseer-vfx/references/examples.md b/skills/effekseer-vfx/references/examples.mdnew file mode 100644index 0000000..3e61436--- /dev/null+++ b/skills/effekseer-vfx/references/examples.md@@ -0,0 +1,41 @@+# Shipped examples++Four ranged pairs (a projectile plus the impact played where it arrives) and five single effects, one per common+category. They are complete production recipes with design briefs, painted textures (processed copies) and the+prompts that made them. Their layer roles are the category skeletons in [skeletons](skeletons.md).++| Pair | Projectile | Impact | What it teaches |+|---|---|---|---|+| `fire` | `VFX_Projectile_Fire` — boiling flipbook fireball, stretched comet tail, world-space flame and smoke trails | `VFX_Fire_Explosion` — lopsided fireball thrown along the shot, climbing mushroom, ground licks decaying into smoke, scorch and cracks | flipbook billows, colour ramps, `decay()`, directional `spray`/`debris` |+| `ice` | `VFX_Projectile_Ice` — crystal lance with a navy backing, prism-fringed ribbon, frost rings frozen on the path | `VFX_Ice_Spikes` — crystals erupting with overshoot, a hold with climbing halos, a timed shatter | `crystal` meshes, fresnel edges, value backing, hold-then-break rhythm |+| `poison` | `VFX_Projectile_Poison` — lobbed glossy glob (deformed mesh) with a wet highlight, acid thread, drips that land | `VFX_Poison_Cloud` — acid splash, spreading pool with bubbles, fumes cooling to murky purple-grey, rolling fog | `arc`, Track trails, `ShapeNoise` liquid, complementary dark core, floor collision |+| `dark` | `VFX_Projectile_Dark` — alpha-black churning orb inside crossing magenta wisps, needles and dust dragged in | `VFX_Dark_Vortex` — black horizon in a tilted accretion disk that feeds, a black impact frame, then torn release arcs and a ground spiral | absorptive Blend body, inward `travel`, two-half disk occlusion, impact frame |++| Single | Effect | What it teaches |+|---|---|---|+| `hit` | `VFX_Hit_Heavy` | two-frame anticipation, 5-frame contact, dissolving jagged burst, three `spark_burst` tiers, air bubble and refraction wave |+| `slash` | `VFX_Slash_Fire` | `slash_set()` (afterimage, body, hot edge, refraction, cel crescent) inside a yawed `swing()` plane; flame tongues peeling off |+| `charge` | `VFX_Magic_Charge` | a one-second inward build with tilted `orbit_band` rings and imploding shells, then exactly one release |+| `shield` | `VFX_Shield_Dome` | fresnel shell and thin rim, overshoot pop, hold with scan bands, `shell_fragments` break that clears on time |+| `heal` | `VFX_Heal` | no impact frame: floor seal, scrolling column, rings, plus signs and motes that all rise and ease out |++```sh+vfx examples # list with historical scores and verdicts+vfx examples show slash # layer plan, absolute frames, roles, budget (a pair shows both effects)+vfx examples add fire # copy into vfx/src, vfx/briefs, vfx/textures/processed, vfx/texture_prompts.json+vfx lint --ids VFX_Projectile_Fire VFX_Fire_Explosion+vfx build --ids VFX_Projectile_Fire VFX_Fire_Explosion+vfx review --ids VFX_Projectile_Fire VFX_Fire_Explosion --note "baseline"+```++The historical scores (0–3 per rubric criterion) come from an independent review of renders in the skill's default+capsule Lab: two reviewers that saw only the strips, key-frame sheets, manifest entries and flags. Eleven were judged+`ship`; `VFX_Projectile_Ice` (flat lance without a white core or dark rim, no shape change in flight) and+`VFX_Projectile_Dark` (nothing stays on the path after arrival) were judged `iterate`. `vfx examples` lists every+example's weakest criterion and the reviewer's one fix (`historical_review.worst`). The scores are a reference,+**not** verification of your build: re-build, review and score again. Adding an example never overwrites existing+files unless `--force`.++To make a new effect from an example, copy the source to a new ID (rename the file and the `effect('...')` name, and+its brief's `effect_id`), then change shape, motion and rhythm — not only colour (see [craft](craft.md)). Keep the+projectile/impact pairing consistent: the impact's `delivery.projectile` must name the projectile's ID.diff --git a/skills/effekseer-vfx/references/godot.md b/skills/effekseer-vfx/references/godot.mdnew file mode 100644index 0000000..06d13bd--- /dev/null+++ b/skills/effekseer-vfx/references/godot.md@@ -0,0 +1,47 @@+# Using the effects in Godot++`vfx init` generates `vfx/godot/`, a Godot 4 project with the official Effekseer plugin, the `Vfx` autoload, a+`CombatVfxHandle` per instance and the VfxLab scene. Edit runtime logic in the skill's `assets/godot-lab/` copy only+when you maintain the skill; in a game project, copy `scripts/Vfx.gd`, `scripts/VfxHandle.gd`, the `effects/` folder+(with `resources/`) and `vfx_manifest.json` into the game at the same `res://` paths (`Vfx.gd` reads+`res://vfx_manifest.json`), enable the Effekseer plugin there, and register the autoload: Project Settings → Globals →+Autoload, or `Vfx="*res://scripts/Vfx.gd"` under `[autoload]` in `project.godot`. Without it `Vfx.play()` does not+exist.++## API++```gdscript+var handle = Vfx.play("VFX_Fire_Explosion", position, rotation, effect_scale) # rotation in radians+Vfx.set_speed(0.5) # all active effects, 0.05–4+Vfx.set_paused(true)+handle.stop() # immediately+handle.release() # stop emitting; live particles finish, then it frees itself++# Projectiles: flight time from the manifest unless options.speed (m/s) or options.flight (s); options.arc lifts it.+var shot = Vfx.launch("VFX_Projectile_Fire", from, to)+shot.arrived.connect(func(at): Vfx.play("VFX_Fire_Explosion", at))+```++Finite effects clean themselves up after `duration`; looping effects replay until `stop()`. The manifest+(`vfx_manifest.json`) carries `id`, `duration`, `peak`, `impact`, `light`, `delivery`, `flight`, `arc`, `attach` and+`design`; the Lab uses `impact`/`light`/`peak` for its stage flash and camera kick, which your game implements itself.++## The Lab++`vfx showcase` (or `godot --path vfx/godot`) opens the Lab: two dummies, PLAYER and TARGET, face each other and every+effect is performed according to its `delivery` — `self` on the caster, `melee` on the target at the strike,+`projectile` flying from caster to target with its impact on arrival, `targeted` called down on the target, `area`+centred on a boss slam. Keys: ←/→ switch, Space replay, C combat/isolated stage, L loop, P pause, 1–4 speed,+B background, S auto showcase. `-- --no-glow` disables the HDR bloom for comparison.++The dummies are capsules. Optional rigged stand-ins replace them: put `player.glb` and `target.glb` (about 1 unit+tall, Mixamo-style bone names, clips named `idle`, `cast_a_spell`, `box_03`, `hit_to_head`, `hit_to_body_01`, `jump`)+and optional `<name>.materials.json` part-to-role maps in `vfx/characters/` and run `vfx init`. Changing the dummies+changes the stage: re-render baselines and re-measure the bloom threshold (see+[engine conventions](engine-conventions.md)).++## Checks++`godot --path vfx/godot --fixed-fps 60 --script res://scripts/TestApi.gd` exercises play, launch, pause, speed, loop+and auto-recycling against the current manifest. `godot --headless --path vfx/godot --script res://scripts/ExportRuntime.gd`+exports Godot runtime resources. Report these as passing only after running them.diff --git a/skills/effekseer-vfx/references/layering.md b/skills/effekseer-vfx/references/layering.mdnew file mode 100644index 0000000..d2f1a7d--- /dev/null+++ b/skills/effekseer-vfx/references/layering.md@@ -0,0 +1,94 @@+# Value, colour and layer pairing++Plan three things a viewer can read in the standard camera: a short bright point, a body with a shape, and a dark+side or material that sets the body off. Every added layer must name the visible problem it fixes; a layer count is+not a quality measure.++## Palette roles first++| Role | What should be visible | First adjustment |+|---|---|---|+| core | a small hottest area or a thin hot edge, clear at contact | control size and duration before adding emissive |+| body | a saturated outline that names the element and the action | keep the form after the white flash leaves; cool its colour instead of removing it |+| dark | backing, concavity, cracks or real shadow | use Blend and check bright and dark backgrounds; black Add cannot do this job |+| matter | smoke, dust, shards, drops — weight | lower saturation, keep internal value and a visible exit |+| accent | a small second-colour cue | give it one place or phase, then check it does not steal the main colour |++The main colour can be single or a family of neighbours. A second colour needs a job (ice's prism fringe, poison's+dark core); never pick a colour per layer, and complementary colours are not mandatory. Smoke next to fire may pass+through a warm tone before turning grey, but do not repaint all the smoke saturated orange.++Read values in greyscale before hue. If core, body and background are all near white, adding orange particles will+not restore structure. Find which layer pushes the picture white first: the contact, a glow, the body, or several+overlapping Add layers.++## Three kinds of copies do different work++| Technique | Geometry and timing | Purpose | Typical mistake |+|---|---|---|---|+| Dark backing (`shadow()`) | its own shape, may be slightly larger, roughly the body's phase | sets bright colour off; readability on bright backgrounds | a black mass swallowing the body (reads as a black hole); invisible on a dark stage |+| Value pair (`contrast_pair()`) | identical outline, fixed angle, same motion and birth time | adds light-and-dark structure inside one shape | two random outlines drifting apart into two unrelated strokes |+| Smoke afterimage (`decay()`) | may be delayed, slower, longer, with different colour and blend | leaves matter after the light goes out | a dark blade arc hanging for a long time, reading as a dirty smear |++`decay()` is not a geometry-identical value pair.++A deterministic pair fixes `count=1`, life, size, rotation, position, spin, travel and flipbook start. Separate+particle nodes draw their own random values: equal ranges and one global seed do **not** give the same angle. When+many directions are needed, have an outer layer pick one fixed angle and use that fixed value for both nodes; never+give each layer its own `[0,360]`.++An exact pair keeps the same life and normalised curves. Lengthening the life also moves the real frame at which+50 % of life is reached, so scale and sweep drift apart. To let the dark layer exit later, recompute its curves+explicitly or make it an independent afterimage and stop calling it a matched outline.++Measured here: later layers draw in front, and Model ZWrite cannot provide this occlusion — use draw order. A Blend+dark copy drawn before an Add bright body is a starting point; a dark cut in front and a dark backing behind are+different designs, so decide from the render.++```python+from vfxkit.primitives import *++body = sprite('Matched burst', 'T_Explosion01', (255, 120, 30, 255),+ life=16, delay=3, size=2.0, rotation=[0, 0, 30],+ size_curve=[[0, .8], [30, 1], [100, 1.1]],+ color_curve=ramp((0, (255, 120, 30, 255)), (100, (180, 35, 10, 0)))['color_curve'],+ alpha_texture='T_NoiseTile01', cutoff=[[0, 0], [100, .8]],+ fade_in=0, fade_out=4, emissive=1.2)+layers = contrast_pair(body) # [Blend dark underlay, the bright body]; splice into effect(..., [*layers, ...])+```++The two layers share geometry and clock and differ in colour and material. Alpha, blend and cutoff still change the+real edge, so check the render; pixel-exact overlap is not promised. 30° is a demonstration angle, not this+texture's orientation: run `vfx texture-info` and use the measured angle for the direction of action. The helper+handles one Sprite only; design Ring and Model pairs explicitly.++## Size and life starting points++Measure against the body's **visible width B** and **life L**, not the sprite card size: a texture holding one thin+line does not weigh the same as a filled card of the same size.++| Layer | Starting point | How to confirm |+|---|---|---|+| hot core | about 0.2–0.5 B wide, or one thin edge of the body | the core is findable at peak and the body is still findable afterwards |+| dark pair | same size and life as the body | if the size changes, decide again whether it is a cut or a backing |+| independent backing | slightly larger, about 1.1–1.4 B | no clean black circle forms outside the body |+| dim afterimage | about 1.1–1.2 L | after the bright layer dies, a short intentional layer remains |+| smoke afterimage | the longer life `decay()` gives | the exit keeps deforming; not a static dark arc |++These are tuning starts, not statistics and not lint rules. Slashes and sustained pillars may use long thin hot+edges; heals and shields need no attack-style white flash. Matching curves, negative space and the standard camera+matter more than the ratios.++## Fix order for white blobs and dark blobs++When the body fills with white: switch off glow, contact and duplicate Add layers one at a time to locate the cause;+then shorten the contact; then cut the body's long high-brightness stretch; add darks last. Do not change texture,+curves, smoke and camera shake at once — you will not know what worked.++When a dark layer reads as a separate black stroke: check angle and size alignment first, then birth time and life,+and only then grey value. Do not hide wrong geometry by lowering opacity. If it works on a bright background but not+on the default stage, give the material layer a suitable grey or a locally lit colour while keeping the dark and+matter roles distinct.++A finished round can name its improvement in one sentence with the frames you looked at, e.g. "after f12 the white+flash is gone and the orange-red fireball keeps its outline". See the [fire explosion case](cases.md#fire-explosion-a-contact-that-stays-white).diff --git a/skills/effekseer-vfx/references/motion.md b/skills/effekseer-vfx/references/motion.mdnew file mode 100644index 0000000..9607cd7--- /dev/null+++ b/skills/effekseer-vfx/references/motion.md@@ -0,0 +1,39 @@+# Motion and paths++A projectile plans three roles: a **head** that follows the handle, a **trail** left in world space, and **shed+particles** that fall off the path. Emit with `sustain()` and keep trails with `inherit=TRAIL`; on arrival the game+calls `stop_root()` and they dissipate naturally. The head needs a clear outline; trails differ in length and value;+a launch-moment speed line or short ring helps the viewer read the speed.++A slash shows its path with a real plane and a sweep (`swing()` + `slash_arc`), then staggers secondary emission+along the arc. Secondary particles go from fast to slow with eased `travel`; Drag does not damp PVA velocity (see+[engine conventions](engine-conventions.md)). Work out the rotated local axis before writing `travel`: sphere and+circle emission have different radial axes.++Diagnose volume and path separately: a thin trail can be fine, but the head must not become a volumeless dot. The+projectile's own strip ends at arrival and does not include its impact; the Lab's normal play shows the full pair.++Motion is not just scale. Change the main shape with sweeps, erosion, UV flow, rotating pivots and deformation;+organise debris, smoke and motes by element direction: ice holds then shatters, dark draws in, fire rises, poison+sinks slowly — each supported by consecutive frames.++The runtime provides straight and parabolic (`arc`) paths. Curved paths, volleys or sustained beams need a brief and+a runtime extension first; never tell the user a tool or API exists that this skill does not have.++## Put speed into shape and rhythm++| Visible problem | First check | First change |+|---|---|---|+| projectile looks like a floating ball | is there a direction change and a speed carrier at launch? | short swept-back wind lines, directional sparks or tails of different lengths |+| trail looks like a plastic tube | is it uniform width, flat colour, all layers the same life? | give the texture negative space; separate a short hot tail from a long soft one |+| sparks float at constant speed | does `travel` go fast then slow? | EaseOut, then gravity or light motion takes over |+| slash looks like a sticker in front of the camera | is there a real tilted plane, a sweep and emission following it? | fix the plane and sweep first, then stagger details along the arc |+| debris looks like regular fireworks | same size, same birth frame, spherical symmetry? | tier sizes and rhythm; organise the main motion along the direction of action |++A speed carrier exists so the viewer reads direction; it does not have to be a new particle group. If the trail or+shape already does the job, keep it simple. An element may pause, but the pause must lead to a clear action: ice+crystals stop growing and then shatter; dark energy gathers and then releases.++Equal angle ranges do not make light and dark particles match. Geometry pairs use fixed parameters; diagnose motion+misalignment with the steps in [layering](layering.md). A smoke afterimage may deliberately move on a different+rhythm, but say so in the brief.diff --git a/skills/effekseer-vfx/references/primitives.md b/skills/effekseer-vfx/references/primitives.mdnew file mode 100644index 0000000..633b2de--- /dev/null+++ b/skills/effekseer-vfx/references/primitives.md@@ -0,0 +1,91 @@+# Recipe code and primitives++Contents: recipe files · `effect()` fields · primitives · helpers · layer fields · units++## Recipe files++One effect per file: `vfx/src/VFX_<Name>.py` defines `recipe()` returning `effect('<Name>', ...)`. The ID+`VFX_<Name>` must equal the file name. Files starting with `_` are shared helpers (`from _palette import *`).+Sources are reloaded on every command. `from vfxkit.primitives import *` brings in every primitive, the helpers+below, `WHITE`, `fade`, `ramp`, `walk` and `math`.++Every primitive returns a plain layer dict; override or add any field with `| dict(...)`. Textures are named by+stem (`'T_Glow01'`) and resolved in `vfx/textures/processed/`. Layers are drawn in list order: **later layers draw+on top** (the Godot plugin ignores ZWrite between effect layers).++## `effect()` fields++`effect(id, name, category, element, duration, layers, attach='impact', peak=.1, impact=0, light=(1,.85,.6), loop=False, design='', delivery=None, flight=None, arc=None)`++| Field | Meaning |+|---|---|+| `category` | `hit`, `slash`, `projectile`, `element`, `status`, `boss`, ... (sets the lint budget) |+| `element` | `physical`, `fire`, `ice`, `lightning`, `dark`, `holy`, `poison`, ... (element-difference and motion checks) |+| `duration`, `peak` | seconds; `peak` is the contact/release moment the Lab flash, kick and target reaction use |+| `attach` | anchor: `ground`, `body`, `impact`, `caster`, `caster_ground`, `projectile` |+| `impact`, `light` | 0–1 strength and RGB of the Lab's stage flash and camera kick (demo staging only) |+| `delivery` | how a game performs it: `SELF`, `MELEE`, `TARGETED`, `dict(kind='area')`, `dict(kind='projectile')` for the projectile itself, `dict(kind='projectile', projectile='VFX_X')` for its impact |+| `flight`, `arc` | projectile only: reference flight seconds and lob height in metres |+| `design` | one sentence of what the player sees; shown in the Lab and given to reviewers |++## Primitives++**Think volume first, texture second.** Bodies, shock waves, crystals and pillars should be meshes or rings in a+tilted 3D plane rather than camera-facing cards. Keep camera-facing sprites for things that are screen-space by+nature: contact stars, glows, sparks and smoke puffs (stacked into volume).++| Primitive | Use | Key native feature |+|---|---|---|+| `flash` / `glow` | contact star, soft bloom under a shape | single-value F-curve scale |+| `shadow` | dark backing behind an additive core | Blend soft disc peaking 1–2 frames after the flash |+| `radial_sparks` | sparks, needles, rising streaks | sphere/circle emission + eased `travel` + DirectionalBillboard |+| `spark_burst` | hit/explosion sparks in three tiers | long fast streaks (6–10 frames), main body, ~20 % heavy sparks that bounce given `floor` |+| `motes` | embers, frost dust, magic motes, inward gathering | as above + turbulence force |+| `shock_ring` / `tilted_ring` | shock wave, rising halo, shrinking ring; ring in a 3D plane | Ring renderer with eased inner radius; melee tilt `(0,58,0)` crosses a left-to-right blow |+| `slash_arc` | blade arc | Crescent Ring with eased start/end angle sweep + dissolve |+| `wisps` | broken energy strokes, vortex strands, ground licks | Crescent Ring + `T_WispTrail01`, random tilt and size per emission, erosion starts above 0 so it is never a full ring |+| `orbit_band` | accretion disk, orbiting rune ring | Ring in a tilted plane, noise flowing round it; `arc=(-90,90)` far half, `(90,270)` near half |+| `smoke` | smoke, fog, dust, dark residue | painted smoke flipbook `T_SmokeSheet01` + light erosion; `texture='T_Smoke02'` for a single still puff — ice mist keeps the still puff so it differs from fire's rolling smoke |+| `billow` | fireball, the same billow as smoke | painted 4×4 flipbook `T_ExplosionSheet01` played once + `ramp` colour stops |+| `flame` | flame tongues, fire walls, ground fire | the explosion flipbook growing from its base, cooling white → colour → dark, eaten by noise with a hot rim (no clip-art flame silhouette) |+| `decal` | seals, cracks, scorch marks | ground-plane sprite, depth tested |+| `standing` | spikes, bolts, beams | YAxisFixed sprite pivoting at its base |+| `column` | light pillar, aura | procedural cylinder + scrolling streaks + static alpha gradient + fresnel |+| `mesh` | spheres, cones, cylinders | procedural model + falloff; `model={...}` for extra procedural fields |+| `crystal` | ice spikes, shards, lances | six-sided cylinder tapering to a point + cellular texture + fresnel edges |+| `shell` | shock bubble, implosion, release | front faces only, fresnel `pow<1` lights only the rim, eased expansion |+| `shell_fragments` | real geometric break-up of a shell | six partial sphere sheets (AngleBeginEnd) that separate and tumble |+| `heat_haze` / `distortion_ring` | heat shimmer, refractive shock wave | `BackDistortion` screen refraction |+| `slice_line` | long thin line at release | `T_Streak01` shooting from 35 % to full length while thinning; `width` is the visible thickness |+| `spray(end)` / `debris` | directional spray along the shot, dark tumbling chunks | non-rotating emission + world-direction `travel` box; Blend `T_Shard01` with gravity, can land |+| `decay(layer, color)` | glow → grey smoke afterimage | copy as Blend grey, `lag` frames later, life × `stretch`, no emissive, slower flow |++## Helpers++| Helper | Meaning |+|---|---|+| `ramp((0,c0),(30,c1),(100,c2))` | colour over life as 3–5 stops → `color_curve` (a two-colour lerp reads as a tint) |+| `fade(color, alpha=0)` | same RGB, new alpha |+| `POP`, `DISSOLVE` | scale curve that snaps then drifts; cutoff curve that holds then erodes |+| `sustain(layer, interval)` | projectile emitter: one instance every `interval` frames until release |+| `TRAIL` | inherit position/rotation/scale only when created: the layer stays on the path |+| `slash_set(colors, roll, sweep=(110,260), radius=1.5, offset=(0,0,.5), lean=-18, delay=1, life=14)` | one blade at three widths: a wide dim afterimage two frames late, a saturated body, a thin white-hot edge (`slash_arc`), a refraction arc, and a painted cel crescent (`T_Slash02`, `billboard='Fixed'` in the blade's plane, rotated by the measured `SLASH02_BULGE`); `colors` = (afterimage, body, edge) |+| `swing(layers, yaw, pitch=0)` | wrap blade layers in a `renderer='None'` pivot so the arc cuts through 3D space; yaw about ±30–40° reads as an ellipse rather than a screen crescent |+| `contrast_pair(layer)` | one fixed sprite plus a geometry-identical Blend underlay (see [layering](layering.md)) |+| `lifetime(layer)`, `budget(layer)` | last frame a layer or its children can be alive; instance count |++## Layer fields++Beyond PVA, scale and colour the compiler supports: `collide` (floor bounce), `soft` (see engine conventions),+`size` / `size_end` / `size_curve` (uniform scale), `color_end`, `color_curve`, `travel` (eased displacement), `spawn`+(sphere, circle, line emitters), `forces` (gravity, turbulence, vortex), `alpha_texture` + `cutoff` + `edge`+(dissolve with a hot rim), `distortion_texture`, `blend_texture`, `falloff` (fresnel), `flipbook`, `pivot`,+`ring{...}`, `inherit`, `track_size`, `material` (`BackDistortion`), `children`. `vfx layer-schema` lists every+accepted key; unknown keys fail with a spelling suggestion. Anything else must be added to the compiler with a+save/open read-back test, not written as raw property paths in a recipe (procedure: [engine conventions](engine-conventions.md#extending-the-compiler)).++## Units++Layer `life`, `delay`, `interval`: 60 FPS frames. Velocity and acceleration: units per frame; gravity: units per frame².+Angles: degrees. Colours: RGBA 0–255. Curves (`size_curve`, `cutoff`, `color_curve`...): `[[percent_of_life, value], ...]`.+Manifest `duration` and `peak`: seconds. Random ranges are `[min, max]`.diff --git a/skills/effekseer-vfx/references/reference.md b/skills/effekseer-vfx/references/reference.mdnew file mode 100644index 0000000..5587997--- /dev/null+++ b/skills/effekseer-vfx/references/reference.md@@ -0,0 +1,20 @@+# Comparing against a reference clip++Requires `ffmpeg` and `ffprobe`. Only use clips the user provides or is allowed to use; record where they came from.++1. `vfx reference-import <clip.mp4> --start 0 --end 2 --slow 2 [--roi x y w h] [--source-url <url>]` decodes at most+ 30 media seconds into the ignored `vfx/work/references/`. `--slow 2` means the clip plays at half speed, so effect+ time = clip time relative to `--start` ÷ 2. Open the returned `overview` image. Put the reference ID and times in+ the brief's `reference` field.+2. Read the labelled frames in order and write anticipation, contact, body, secondary and exit into the brief's+ beats. For detail use `vfx reference-frames <reference_id> <start> <end> --count 8` on one short span instead of+ reloading the whole clip. If the clip's speed is unknown and the rhythm depends on it, ask.+3. After a review, `vfx reference-compare <reference_id> <evidence_id> --times 0.1 0.3` pairs reference moments with+ the exact captured Godot frames (capture missing ones with `vfx review --key-frames`). Compare rhythm, outline,+ screen share, saturated body, dark layers and residue. Each view keeps its own aspect ratio and time label; never+ make them "the same size" with an unstated crop or scale.++The analysis is approximate: compression, background and bloom change pixels; camera moves or cuts pollute changed+area. For moving cameras use manual key frames and an explicit ROI. Do not infer world size, emissive values,+particle counts or invisible textures from video; mark approximations in the brief. Reference observations guide+shape and rhythm; they never override the measured units, UV, HDR and inheritance rules of this engine.diff --git a/skills/effekseer-vfx/references/review.md b/skills/effekseer-vfx/references/review.mdnew file mode 100644index 0000000..c200a48--- /dev/null+++ b/skills/effekseer-vfx/references/review.md@@ -0,0 +1,113 @@+# Review loop, evidence and delivery++A still frame cannot show rhythm. After every change: `vfx lint`, `vfx build --ids <ID>`, `vfx review --ids <ID>+--note "<one problem, one change>"`, then **open the images**.++Contents: what review produces · flags · reading the strip · rounds and history · independent review ·+verification · variants · capture behaviour++## What `vfx review` produces++The Godot Lab renders the effect in a real viewport with the UI hidden, using the combat staging (two dummies at+opposite ends of the platform; the effect is performed according to its `delivery`). Frame numbers count from the+effect's own start (punch, cast, projectile arrival); dummies hold an idle pose. A projectile strip ends at arrival+and excludes its impact; an impact strip keeps the same landing point and arrival time without the incoming+projectile's residue. The command returns:++- `sheets` — the whole-timeline strip `vfx/previews/strips/<ID>.png` (at most 18 tiles; key frames are never dropped);+- `compare` — `<ID>_compare.png`, previous round above the current one, when a previous strip exists;+- `details.<ID>.sheet` — a key-frame sheet (contact neighbourhood, brief beats, body, exit and a post-duration check)+ and `details.<ID>.frames` — the full-size frames;+- `flags`, `changes` (flag kinds added or resolved since the last round, moved key timings), `metrics`,+ `history` and the `evidence` ID of this capture.++`vfx strip <ID> [--compare]`, `vfx frames <evidence_id> <frames...>` and `vfx history <ID>` re-read them later.+Look at the comparison first when one exists.++## Flags++Pixel metrics are "change energy" against the empty stage, so a large faint smoke and a small white flash are+comparable. They are a reading aid, **not** a GPU or overdraw measurement.++| Flag | Meaning | First fix |+|---|---|---|+| `barely visible` | under 0.25 % of the stage changes at the strongest frame | the body is too small or too dark |+| `dead tail` | the last 35 % has no frame above 5 % of peak energy or 0.25 % changed stage | shorten `duration` and trailing lives, or make the dissipation visible |+| `blown out` | over 10 % pure white for more than two sampled frames | smaller glow, less emissive |+| `cut off` | still clearly visible on the last frame | the duration is too short |+| `off-peak contact` | the whitest frame is more than 6 frames from manifest `peak` | move the contact or `peak`; the Lab flash and kick land elsewhere |+| `lingering flash` | near-peak white lasts over 12 frames around contact | contact should be 2–5 frames; sustained hot bodies (beam cores, spikes) do not count |+| `no white-hot core` / `washed out` | almost no pixel above 85 % brightness / almost no saturated mid-tone body at peak | add a hot core / restore the body's saturation |+| `sinks` (fire only) | the mass moves down after contact | fire should rise |+| `expands while charging` (dark only) | the radius grows before the release | dark should draw inward |++Thresholds were calibrated tile by tile on real library renders; the reasoning is at the top of+`scripts/vfxkit/review.py`. Change a threshold only after checking real strips, and add a line of reasoning there.++## Reading the strip++Flags alone are not a review. In the strip and the key-frame sheet ask:++1. Can you tell what the effect is from the first lit tile? Is the contact the brightest moment and only a few frames?+2. Is the main shape eroding or sweeping, or only scaling and fading?+3. Do secondary particles go fast then slow, in the element's direction (fire up, ice down, dark inward)?+4. Do arcs, pillars and ground decals sit on or under the dummy, not beside it or floating?+5. On a bright background (`--bright`), do the alpha-blended layers still work?++For tails, look at the middle of the last third, not just the last two tiles; fetch actual frames with+`vfx frames` or capture extra moments with `--key-frames`. One isolated smoke puff does not prove a whole exit.++## Rounds and history++Each round fixes **one class of problem** and states it in `--note`; notes, flags and key timings append to+`vfx/previews/strips/history/<ID>.jsonl`. Read the history (`vfx effect-context <ID>`) before a new round and do not+repeat a change the evidence already rejected. Iterate 3–5 rounds per effect; at the limit without a pass, report the+unresolved items instead of calling it done.++## Independent review++The author never scores its own effect. `vfx review-handoff <ID>` writes the reviewer's whole brief for the latest+fresh capture to `vfx/work/handoff/<evidence_id>.md`: the strip and key-frame images, the captured frame numbers, the+manifest entry and flags, a copy of the rubric, the path of the **vfx-review** skill when it is installed beside this+skill, and where to write the report. Give that brief, and nothing else, to a separate agent: a subagent (tell it no+more than the brief) or a new session the user opens when the host has no subagents. Not the recipe code. It writes+JSON to the `report_file`:++```json+{"id": "VFX_X", "scores": {"read": 2, "timing": 3, "layering": 2, "shape_change": 2, "motion": 2, "placement": 3, "tail": 2, "identity": 3},+ "worst": "shape_change", "fix": "one concrete change in recipe terms", "verdict": "ship"}+```++`verdict` is `iterate` when any score is below 2; `worst` must be a lowest-scoring criterion. Save it to a file and+bind it with the command `review-handoff` returned: `vfx review-submit <evidence_id> <report_file> --reviewer <reviewer id>`+(`--frames` defaults to the report's `observed_frames`).+The tool validates structure, freshness and observed frames; it cannot prove the reviewer's independence — the host+(you) must actually isolate it. If the verdict is `iterate`, apply its one fix next round.++## Verification++`vfx overview` tiles the latest standard captures into `vfx/previews/strips/overview_*.png`.+`vfx effect-verify <ID>` checks that the expanded current recipe, input textures, Core read-back, built resources,+Lab stage and images are all the ones the passing review saw, and that the overview includes this capture. Only+`verified: true` is done. A screenshot existing, no flags, or exit code 0 are not quality passes. Any change to a+recipe, texture, brief or the Lab invalidates older evidence; after updating the Lab template run+`vfx init --update-templates` first. Runtime behaviour needs its own API checks (`TestApi.gd`, see [godot](godot.md));+device performance needs device evidence.++After finishing, keep the effect library (`vfx/src`, `vfx/briefs`, textures, recipes JSON, `.efkefc`, `.efk`,+manifest, overview pages and `metrics.json`) together under version control. Per-frame captures, logs, receipts and+single-effect strips stay local (`vfx/.gitignore` written by `init` handles this).++## Variants++`--view close` changes only the inspection camera; `--profile bare` turns off the Lab bloom, impact light and+camera kick to judge the effect on its own; `--bright` uses a bright background. Each is stored separately and never+overwrites the standard/default baseline or its metrics; the baseline for verification is standard/default.++## Capture behaviour (macOS)++The user may be using the machine during a review: macOS stops drawing fully covered windows, and Godot steals focus+on launch. In capture mode the Lab keeps its window on top, parked in the bottom-right corner with only a small part+showing (the viewport still renders at 1280×800), ignores keyboard input and close requests, and the review hands+focus back to the previous app (about a 0.2 s flicker per launch). Effects that exit early or never play are+re-captured (up to 3 times).diff --git a/skills/effekseer-vfx/references/shapes.md b/skills/effekseer-vfx/references/shapes.mdnew file mode 100644index 0000000..2f767fd--- /dev/null+++ b/skills/effekseer-vfx/references/shapes.md@@ -0,0 +1,38 @@+# Volume and occlusion++Decide the body's volume first: ice spikes are crystals, a pillar is a procedural cylinder, a shock wave is a tilted+ring or thin shell, an accretion disk is far half ring + core + near half ring. Keep camera-facing sprites for+flashes, smoke and shapes that should face the camera. Look in the standard camera and the optional close view+(`vfx review --view close`), but the library baseline stays the standard combat staging.++Measured here: sphere depth works differently from cylinders (size spheres with scale); the Cone tip direction must+not be guessed (crystals use a Cylinder with an end radius); Model layers cannot rely on ZWrite, so occlusion follows+list order. Fresnel `begin`/`end` and `pow` behave as documented in [engine conventions](engine-conventions.md), not+as their names suggest.++Large shells and columns must not become translucent solid domes. Check outline, inner transparency and character+visibility first, then brightness; a full-screen glow does not hide a shape problem. A dark core must read on the+default stage, and check a bright background too (`--bright`).++Prefer the existing Ring, Model, UV scroll and dissolve features. Custom meshes are a later asset path: first show+that no primitive can express the shape, then verify export, UVs and that resources travel with the package. Never+patch the official renderer to work around an unverified assumption.++## Choose the volume from the standard camera++| Main shape | Construction available here | Spatial relation to check |+|---|---|---|+| slash | pivot with a tilted Ring or a fixed-plane arc | the arc passes through the point of action with space inside it |+| explosion | `billow`, a rising body, tilted waves and ground matter | it has a landing point and height; near and far layers separate |+| dark core | far half ring, core, near half ring in that order | the front half passes in front of the core, the back half is hidden by it |+| ice crystal | six-sided prism with a point, shards and cold mist | tip direction and facet light differ; the shatter is more than bright dots |+| sustained shell | fresnel outline, surface motion, fragment exit | character inside, shell surface and background each readable |+| light pillar | cylinder, static alpha gradient and scrolling streaks | top and bottom fade naturally; no UV seam through the body |++In the standard camera a low ground ring may read as a thin line, and lovely close-up detail may vanish at combat+distance. Build sideways or upward volume before adding more surface texture. The close view helps find problems; it+does not replace the standard camera for scale.++When layers overlap front to back, arrange draw order first, then verify in the image. A full shell outline drawn in+front of every fragment re-closes the gaps that should appear; dark smoke drawn in front of the fire hides the+saturated body that should remain. Correct geometry can still read wrong because of order.diff --git a/skills/effekseer-vfx/references/skeletons.md b/skills/effekseer-vfx/references/skeletons.mdnew file mode 100644index 0000000..d5288e2--- /dev/null+++ b/skills/effekseer-vfx/references/skeletons.md@@ -0,0 +1,101 @@+# Category skeletons++Skeletons give layer roles and timing relationships; trim them to the game's style. Pick one main shape, then only+the supporting layers it needs. A light hit can be very simple; a finisher may have several stages. Every category+below has a complete, independently reviewed example (`vfx examples show <name>` prints its layer plan with absolute+frames and roles; `vfx examples add <name>` copies it into the project): `hit`, `slash`, `charge`, `shield`, `heal`+and the projectile + impact pairs `fire`, `ice`, `poison`, `dark`.++## Hit++Reference: example `hit` (`VFX_Hit_Heavy`). A short anticipation concentrated on the contact point, a brief flash and a jagged burst first, then directional+speed lines and tiered sparks, ending with dust or a little smoke. The white flash makes the contact felt; the body+conveys force. Not every hit needs a big ring and dark smoke.++| Role | Primitive | Alternatives |+|---|---|---|+| anticipation | shrinking `glow` | a few inward lines |+| contact | `flash` | a short hot shape with an outline |+| body | painted burst `sprite` with `POP` + `DISSOLVE`, `tilted_ring(..., tilt=(0,58,0))` | `shell` air bubble |+| secondary | `spark_burst` (two or three tiers, one spray direction) | `radial_sparks` with `spray` |+| exit | `smoke` dust, `motes` embers | quick falling dust; never seconds for one hit |++If only thin needles remain after the peak, lengthen or strengthen the body. If it looks like fireworks, narrow the+emission and `travel` directions before adding particles. Budget ≤ 60.++## Slash++Reference: example `slash` (`VFX_Slash_Fire`). A `swing()` pivot defines a tilted swing plane, yawed about ±30–40°+so the arc reads as an ellipse cutting through space; `slash_set()` puts afterimage, body and hot edge inside it+(`slash_arc` at three widths: wide dim afterimage lagging two frames, saturated body, thin white edge), a refraction+arc behind the blade, and a painted cel crescent held for a few frames. The crescent is `billboard='Fixed'` and lies+in the blade's own plane (same lean), rotated by the texture's measured bulge (`SLASH02_BULGE`), so it tilts with the+swing instead of facing the camera. Sparks stagger along the arc. Fire exits with+peeling flame and rising embers, physical with short metal sparks, ice with a hold and a shatter. Changing element+changes motion and material, not just colour.++Keep the arc's negative space between layers. The target's chest is only the placement anchor: the arc's visual+midpoint also depends on the texture's bulge, the rotation and the pivot — measure with `vfx texture-info`. If the+tail is still a whole crescent, fix the sweep and erosion before adding a smoke afterimage.++## Explosion++Reference: example `VFX_Fire_Explosion`. A Gather and Inward fuse tighten at the target, a short Detonation flash+releases, the Fireball and rising Mushroom take over, directional debris and sparks carry the impact, and the Smoke+billow, dust and ground marks give weight.++The fire must keep saturated volume after the flash — not just an expanding ring or many small bright dots.+Organise secondary motion along the shot, the ground or upward; not every layer doing the same spherical motion.+Smoke draws behind the fire and takes over the cooled shape; if smoke covers the centre, check order and density+first. Ground marks say where it landed, rising volume says it erupted; a bigger full-screen glow cannot replace+either. Look at f18–42 for the hand-off and f54–66 for the smoke, not only the peak.++## Projectile++Reference: pairs `fire`, `ice`, `poison` and `dark` (`VFX_Projectile_Fire`, `VFX_Projectile_Ice`,+`VFX_Projectile_Poison`, `VFX_Projectile_Dark`). Head layers (Fireball,+Hot core) follow the handle; a Comet tail gives the head direction; Flame trail, Smoke trail and Embers use+`inherit=TRAIL` and stay on the path. A wide tail, a thin hot line and short shed particles need different lives;+head and path must both read.++Check launch, mid-flight, arrival, after arrival and clear. With a fixed flight time, trail density comes from the+emission interval and particle life together. Changing head inheritance changes spatial relationships — do not+cover a rigid tube by lengthening the trail. The impact is a paired effect: review the projectile strip and the+impact strip separately, and the full exchange in the Lab. Budget ≤ 100.++## Charge and release++Reference: example `charge` (`VFX_Magic_Charge`): about one second of inward build (f0–64), one release f64–70,+release sparks to about f86. `motes` and `radial_sparks` with negative `travel` gather inward, two `orbit_band` rings in different tilted planes+build volume, a core and aura accumulate, and a release flash, `shell` and sparks give one clear release. Camera and+stage feedback may strengthen the release, but the gathering itself must be readable.++A ring that only spins in Z without internal flow becomes a rotating icon; use UV flow (`alpha_scroll`), tilted+planes and inward travel. If the release is huge and the anticipation weak, build a visible gathering path first+instead of raising all brightness.++## Shield and sustained status++Reference: example `shield` (`VFX_Shield_Dome`) and the shield case in [cases](cases.md). A short raise glint, a `mesh` sphere `shell` and rim for sustained volume, surface flow, scan bands and glints to keep+the hold alive. At the end the whole shell hands over to `shell_fragments` with real gaps; fragment motion and colour+decay make the exit.++Stable does not mean flashing every frame, nor a full sphere that switches off at once. Check first that the+character reads inside the shell, then the surface flow and the exit. The six sphere fragments are the verified+solution here; whether other materials can really dissolve must be tested separately.++## Heal and buff++Reference: example `heal` (`VFX_Heal`). A ground `decal` seal states ownership, a `column` builds slow rising volume, rising rings, symbols and life `motes`+carry the meaning, and a glow and twinkles close it. Do not make a heal an attack with a violent white flash and+bursting debris. It can be soft or pulse, but it must keep an outline and stay visible in the standard camera. A+white peak is not this category's pass criterion; use the rubric's purpose exceptions.++## Using the example code++`vfx examples show <name|ID>` prints the full layer plan with absolute frames and roles; `vfx examples add <name>`+copies the source, brief and painted textures into the project. Adapt a copy under a new ID rather than editing an example+in place when you want to keep it as a baseline. The examples' historical scores describe the skill's own renders,+not your build: build, review and get an independent score again after any change. Two examples were judged+`iterate` (see `vfx examples`, `historical_review.worst`); they still teach their pattern, and their weakest point is+a good first exercise.diff --git a/skills/effekseer-vfx/references/textures.md b/skills/effekseer-vfx/references/textures.mdnew file mode 100644index 0000000..78ee450--- /dev/null+++ b/skills/effekseer-vfx/references/textures.md@@ -0,0 +1,88 @@+# Texture roles, generation and acceptance++Choose the role, then write the prompt, then generate. **Complex painted shapes** — smoke, slash arcs, fire bodies,+cracks, ice, symbols — come from an **image generation model**. **Math shapes** — glows, rings, noise, gradients,+trail bands, RG distortion maps — are the procedural textures (`vfx procedural` regenerates them; names in+[primitives](primitives.md)). `vfx init` also installs a starter set of seven painted textures that the primitives+default to — `T_SmokeSheet01`, `T_ExplosionSheet01` (4×4 sheets), `T_WispTrail01`, `T_Smoke02`, `T_Explosion01`,+`T_Crack01`, `T_IceShard01` — with their prompts. `vfx examples add` installs four more with the examples that use+them (`T_Impact01`, `T_Slash02`, `T_Rune02`, `T_Vortex01`). The skill's `assets/examples/texture_prompts.json` also+holds prompt templates for common painted shapes it does not ship (slash crescent, flame tongues, lightning bolts,+rune circle, ice spikes, flame sheet...; their `source` says so): copy one into `vfx/texture_prompts.json`, adapt it,+generate and process. Never imitate a painted shape by drawing it with Python.++## Generating++- If your host offers an image generation tool, use it with the prompt you wrote. Save the untouched output to+ `vfx/textures/generated/<T_Name>.png`.+- If it does not, **do not substitute anything**: add the prompt to `vfx/texture_prompts.json`, tell the user which+ image to generate (name, size, prompt) and where to save it, and continue with the parts that do not need it.+- Record every prompt in `vfx/texture_prompts.json` as `{"id": "T_Name", "size": 256, "prompt": "..."}` (add+ `"grid": [4, 4]` for sheets and `"post"` for any non-default processing). Lint rejects painted textures without a+ recorded prompt.+- Process into the game texture, never overwriting the original:+ `vfx process-texture vfx/textures/generated/T_Name.png vfx/textures/processed/T_Name.png --size 256`+ (`--color` keeps colour as straight RGBA; `--grid 4 4 --size 1024` for flipbook sheets keeps cells in place).+- Measure: `vfx texture-info T_Name` for angles, bulge and clipping; `vfx texture-audit T_Name --role shape` (or+ `flipbook --grid 4 4`, `trail`, `symbol`, `light`, `uv_distortion`, `screen_distortion`) for borders, alpha,+ small-size survival and frame changes. Open the audit's `preview` image.++Sizes: ordinary particles 128–256, main shapes and seals 512; the verified 4×4 sequence is 1024².++## Prompt contents++State the visual role, outline and internal structure, required margin, background or transparency mode, the+exclusions (no environment, characters, text or UI) and the target size. For masks: white shape on pure black.+Sequences state the grid, the change from growth to break-up, a constant centre and scale, a margin in every cell;+loops state that first and last frames connect.++Solid shapes need a readable outline and varied thickness and may be asymmetric with negative space. Light needs a+smooth falloff from the core and may be symmetric. Seals and symbols may use exact geometry and dense ornament.+Smoke follows the target style — crisp outer edge, internal value or soft volume — but not every smoke should become+a cartoon cotton ball. Do not apply "break the rules" to optical stars or the seal itself.++| Type | Be specific about | Avoid |+|---|---|---|+| slash and claw marks | one main direction, thick root to thin tail, breaks and uneven thickness, space inside the arc | a uniform-width crescent icon; evenly spaced claw lines |+| bursts and solid flashes | a weighty core and a directional rim; the core either whole or clearly a ring | a random small hole in the middle that reads as an eye or a face |+| smoke and dust | a clear style, outline and internal value, lobes of different sizes, gradual break-up | identical cotton balls; a grey gradient with no outline |+| light and stars | a smooth hot core, straight falloff, symmetry chosen by role | forcing light into curved broken strokes and rescuing it with a huge glow |+| seals and symbols | clear density, structural hierarchy and fine symbol bands | a few giant letters that shrink into an empty ring |+| ground cracks | branching from the impact, thick roots to thin ends, local irregularity | an even grid or tiled cells that read as floor tiles |++A fillable request, e.g. for a smoke tail sequence:++> Purpose: grey smoke residue left after a fire projectile. A continuous 4×4 sequence, 1024². The mass starts dense,+> rolls upward and gradually breaks into uneven fragments. Constant centre and scale, a margin in every cell. Keep+> internal value; layered outer outline; avoid regular round puffs and uniform radial spread. No characters,+> environment, text or UI. An isolated asset to be tinted in the game.++This is a template, not the provenance of a generated asset: after generating, record the real prompt, original and+processing settings. Seals, slash arcs and fire bodies need their own role written, not just a different colour.+`assets/examples/texture_prompts.json` holds the prompts of the example textures.++## Acceptance++Hard errors: missing files, an invalid grid, dimensions not divisible by the grid. Empty first or last cells and held+frames may be intentional; empty middle cells, jumps and repeats are only hints — look at the image. A thin texture+that is beautiful at full size can vanish in the standard camera: check the 64 px and 32 px previews and the real+render.++Measured here: UV distortion on a flipbook samples neighbouring cells (lint forbids it); colour textures and alpha+textures use different channels; UV distortion needs an opaque RG map, while screen distortion may carry an alpha+extent. Fire keeps the verified explosion sequence with erosion rather than a clip-art flame sprite.++## Sequences must deform++Step through the cells: does the shape move from one key pose to another — opening, rolling, tearing, eroding?+Scaling the same outline while lowering opacity is not deformation. The change from dense to broken may be quick,+but the body must not be crumbs the moment it reaches visible size.++When one sequence serves several roles, choose different start cells and playback speeds and say why: a hot head may+play only the dense short segment; a smoke tail may change slowly with its colour cooling first.+`frame_length × cell count` is the playback time and life is the instance lifetime; when they differ, explain the+early exit, hold or cut.++Small previews are only a screen. If the texture disappears at 32 px, first widen the useful visible lines, remove+useless detail or change the real layer size; do not blindly raise a 512 original to 2048 — resolution does not+change screen share in the same camera.diff --git a/skills/effekseer-vfx/references/timing.md b/skills/effekseer-vfx/references/timing.mdnew file mode 100644index 0000000..11108cf--- /dev/null+++ b/skills/effekseer-vfx/references/timing.md@@ -0,0 +1,70 @@+# Intensity, volume and exit rhythm++Write the key frames first, then fill in delay and life. Describe brightness and volume as two separate curves:+brightness spikes at release, while an explosion's fire and smoke volume may peak later; a shield holds a stable+outline and only breaks at expiry. The review's pixel `energy` mixes area and value and equals neither curve.++## Every phase has a successor++| Phase | Question to answer | Common failure |+|---|---|---|+| Anticipation | does the viewer know where and when something will happen? | so big it already looks like the final blast; an impact strip polluted by the leading projectile |+| Contact or release | is this instant clearer than its neighbours? | a big white blob that lasts; contact out of step with the Lab feedback |+| Body | once the flash is gone, can you still read the action and element? | the body dies early and only sparks remain; one unchanging outline throughout |+| Secondary | do debris, smoke and sparks have cause and direction? | sprayed in every direction at once like decorative noise |+| Dissipation | is what remains still changing, and does it end on time? | an empty tail; a static dirty afterimage; a large body still visible at `duration` |++Body and secondary may overlap; they need not be five mechanically separate intervals. What is staggered are the+read points: the flash leaves first, the form takes over, debris keeps moving, smoke thins last. A later layer that+is brighter must be explained as a second hit, a return stroke or a shield break.++## Reference timings from the shipped examples++Absolute frame ranges from the example recipes (first birth to last instance's maximum life; projectiles released at+`flight`). Visible duration is decided by the image. These are not constants for every effect.++| Example | Contact or release | Main form | Afterwards |+|---|---|---|---|+| Hit Heavy (0.5 s) | Anticipation f0–3, Contact flash f2–7 | Impact burst f2–12, air bubble and wave to f14 | heavy sparks to f28, embers and dust to f30 |+| Fire Slash (0.6 s) | blade and hot edge from f1, cel crescent f2–10 | Blade body to f17, the parent swing plane to f22 | flame tongues to f35; smoke and embers end f34 |+| Magic Charge (1.5 s) | Charged flash f64–70 (the only flash) | gathering and core f0–64 | release bloom and sparks to f82–86 |+| Shield Dome (1.8 s) | raise glint f0–5 | whole shell to f84 | sphere fragments f80–104, shards to f106; clear by f108 |+| Heal (1.7 s) | — (no contact; slow fade-in) | seal f0–88, column f8–82 | plus signs and motes rise until f90–98 |+| Fire Explosion (1.3 s) | Detonation flash f9–12 | Fireball f6–40, Mushroom f12–51 | Smoke billow f14–76; check the tail at f54, 60, 66 |+| Ice Spikes (1.35 s) | Eruption glint f8–13 | crystals erupt f6–15 with overshoot, hold to about f47 | Crack glint f47–50, then shatter shards f50–78 |+| Poison Cloud (1.75 s) | Splash flash f1–4 | Burst puff f1–25, acid pool f3–104 | fumes and fog to about f99 |+| Projectile Fire (flight 0.45 s) | — (no contact) | head layers emit until release at f27 | smoke trail lives to f69 after release |+| Projectile Ice (flight 0.35 s) | muzzle rings f0–16 | lance head to f25 | shed shards and chips fall until about f41 |+| Projectile Dark (flight 0.6 s) | — (no contact) | head layers emit until release at f36 | wake and path glints live to f54 |+| Dark Vortex (1.65 s) | impact frame f62–64, release f62–70 | horizon and disk feed inward f0–62 | release arcs decay into smoke to f98; ground spiral to f88 |++Match purpose and shape before borrowing "who takes over from whom". Do not give a frequent light hit an+explosion's long smoke tail, and do not force a charge to only dim from its first frame.++## Curves must land on real frames++Recipe delay and life are 60 FPS frames; F-curve keys are percent of life. For a fixed-life layer born at d with life+L, a change at real frame t goes at key `100 × (t − d) / L`. Random life makes each instance change at a different+absolute time; use a fixed-life key layer to align with the contact.++A child's delay counts from its parent instance's birth. A parent that is born repeatedly gives every child its own+clock; read the earliest and latest births that `vfx brief-validate` expands. "This layer lives 20 frames" does not+mean it is gone at frame 20 — the last-born instance is still alive.++A projectile stops emitting at `flight` and its trail ends with each instance's life. Lengthen a smoke tail with a+longer flipbook segment, colour decay and suitable life, and re-check `duration` and the live-instance budget. Only+raising `duration` creates an empty tail; only raising life can make the sequence play out early.++## Do not gamble on the last frame++The brief marks the exit start, the middle of the exit and the clear time; review samples at least those three plus+a check frame after `duration`. Long effects may add explicit 80 % and 90 % key frames so the peak does not fill the+thumbnails while the tail gets a single empty tile.++When a shell, column or ring shows no visible break-up, first check whether the renderer supports that combination,+then consider real geometry pieces, segmented arcs or a timed hand-off between shapes. A correct compile read-back+does not mean "the dissolve works" — see the [shield case](cases.md#shield-a-break-that-never-shows-a-gap).++Each round, decide first whether you are fixing the contact, the body hand-off or the exit, and change only those+layers. Judge order and screen share in the standard strip, erosion and trails in the detail sheet, and rhythm at+full speed in the Lab.diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/LICENSE b/skills/effekseer-vfx/scripts/effekseer_ai/LICENSEnew file mode 100644index 0000000..88e55b4--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 laodeng000++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/__init__.py b/skills/effekseer-vfx/scripts/effekseer_ai/__init__.pynew file mode 100644index 0000000..177052f--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/__init__.py@@ -0,0 +1,5 @@+"""Python access to the official Effekseer Core API (vendored from effekseer-ai, MIT; see LICENSE)."""++from .session import EffectSession++__all__ = ["EffectSession"]diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py b/skills/effekseer-vfx/scripts/effekseer_ai/authoring.pynew file mode 100644index 0000000..46f60ea--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/authoring.py@@ -0,0 +1,334 @@+"""Reusable, discovered-property layer authoring. No GUI state is required."""+from pathlib import Path+import difflib, math+from .session import EffectSession+from .runtime import load_core++# Every key LayerBuilder reads. Anything else used to be ignored silently, so a misspelt 'fade_ot'+# compiled into a different effect without any error; validate_layer() now rejects it.+LAYER_FIELDS={+ 'name','material_profile','material','count','life','interval','delay','blend','z_test','emissive','fade_in','fade_out',+ 'renderer','color','color_curve','color_end','billboard','pivot','procedural_model','model','culling',+ 'ring','ring_outer','ring_inner','track_size','texture','uv_scroll','distortion',+ 'travel','position','velocity','acceleration','rotation','spin','scale_start','scale_end','scale_curve','size','size_end','size_curve','easing',+ 'wrap','flipbook','alpha_texture','alpha_scroll','alpha_wrap','distortion_texture','distortion_scroll','distortion_intensity',+ 'blend_texture','blend_scroll','blend_type','cutoff','edge','falloff','soft','collide','spawn','forces','inherit',+ 'infinite','remove_with_parent','z_sort','priority','properties','curves','children'}+NESTED_FIELDS={+ 'ring':{'vertices','outer','inner','center_ratio','outer_color','center_color','inner_color','angle_start','angle_end','angle_easing','angle_fade'},+ 'travel':{'start','end','easing'},+ 'spawn':{'shape','rotate','radius','rot_x','rot_y','axis','division','order','angle_start','angle_end','angle_noise','start','end','noise'},+ 'edge':{'color','threshold','scaling'},+ 'falloff':{'begin','end','pow','blend'},+ 'flipbook':{'x','y','frame_length','loop','start','lerp'},+ 'inherit':{'location','rotation','scale','color'},+ 'collide':{'height','bounce','friction','reduction','world'},+}+FORCE_FIELDS={'type','power','gravity','scale','octave','kind','control','min_range','max_range','position','rotation'}++def _unknown(keys,allowed,where):+ errors=[]+ for key in keys:+ if key in allowed:continue+ close=difflib.get_close_matches(key,allowed,1)+ errors.append(f"{where}: unknown field {key!r}"+(f"; did you mean {close[0]!r}?" if close else ''))+ return errors++def validate_layer(spec,where='',recursive=True):+ """List problems the compiler would otherwise swallow: unknown or misspelt keys at any nesting level."""+ here=f"{where}/{spec.get('name','?')}" if where else str(spec.get('name','?'))+ errors=[] if spec.get('name') else [f'{here}: layer needs a name']+ errors+=_unknown(spec,LAYER_FIELDS,here)+ for key,allowed in NESTED_FIELDS.items():+ if isinstance(spec.get(key),dict):errors+=_unknown(spec[key],allowed,f'{here}.{key}')+ if isinstance(spec.get('flipbook'),dict):+ for key in ('x','y','frame_length'):+ if key in spec['flipbook'] and (type(spec['flipbook'][key]) is not int or spec['flipbook'][key]<1):+ errors.append(f'{here}.flipbook.{key}: must be a positive integer (native Core Int field)')+ for key in ['outer','inner']:+ value=spec.get('ring',{}).get(key) if isinstance(spec.get('ring'),dict) else None+ if isinstance(value,dict):errors+=_unknown(value,{'start','end'},f'{here}.ring.{key}')+ for i,force in enumerate(spec.get('forces') or []):+ if 'type' not in force:errors.append(f'{here}.forces[{i}]: force needs a type')+ errors+=_unknown(force,FORCE_FIELDS,f'{here}.forces[{i}]')+ if recursive:+ for child in spec.get('children') or []:errors+=validate_layer(child,here)+ return errors++def layer_schema():+ """Field names accepted by layer specs, for agents that want to check a recipe before compiling."""+ return {'layer':sorted(LAYER_FIELDS),**{k:sorted(v) for k,v in NESTED_FIELDS.items()},'forces':sorted(FORCE_FIELDS)}++class LayerBuilder:+ def __init__(self, session):+ self.session=session+ self.schema=None+ self.writes=[]+ def set(self,node,field,value):+ if self.schema is None:+ self.schema={p.removeprefix(node+'/') for p in self.session.property_list(node,12)}+ if field not in self.schema:+ raise ValueError(f'Unknown Core property: {field}. Discover with property-list first.')+ p=f'{node}/{field}'+ before=self.session.property_get(p)+ self.session.property_set(p,value)+ self.writes.append({'property':p,'before':before,'after':self.session.property_get(p)})+ def scalar(self,n,p,v): self.set(n,p+'/Value',v)+ def rand(self,n,p,v):+ if isinstance(v,(tuple,list)):+ lo,hi=v+ else: lo=hi=v+ self.set(n,p+'/Max',hi); self.set(n,p+'/Min',lo)+ def vector(self,n,p,v,random=False):+ for axis,val in zip('XYZ',v):+ if random:self.rand(n,p+'/'+axis,val)+ else:self.scalar(n,p+'/'+axis,val)+ def color(self,n,p,rgba,random=False):+ for ch,val in zip('RGBA',rgba):+ if random:self.rand(n,p+'/'+ch,val)+ else:self.scalar(n,p+'/'+ch,val)+ def curve(self,n,p,keys):+ # p is a scalar FCurve object, already discovered as p/Keys.+ if p+'/Keys' not in self.schema: raise ValueError(f'Unknown FCurve {p}')+ self.session.curve_set_keys(n+'/'+p,[{'frame':int(f),'value':v,'interpolation':1} for f,v in keys])+ self.scalar(n,p+'/Sampling',1)+ def uv(self,n,base,texture,scroll=None,wrap=None):+ """Bind a texture slot and optionally scroll it; speeds are UV units per frame."""+ self.session.import_image(texture,n+'/'+base+'/Texture' if 'Advanced' in base else n+'/'+base)+ if wrap:self.scalar(n,(base if 'Advanced' in base else 'RendererCommonValues')+'/Wrap',wrap)+ if scroll:+ from PIL import Image+ size=Image.open(texture).size+ root=base if 'Advanced' in base else 'RendererCommonValues'+ self.scalar(n,root+'/UV','Scroll')+ for axis,dim,speed in zip('XY',size,scroll):+ self.rand(n,root+'/UVScroll/Size/'+axis,dim); self.rand(n,root+'/UVScroll/Speed/'+axis,speed*dim)+ def advanced(self,n,spec):+ """Optional native features: dissolve, UV distortion, blend texture, fresnel, flipbook, spawn shapes, forces."""+ s=self.scalar; r=self.rand; A='AdvancedRendererCommonValuesValues/'+ if spec.get('wrap'):s(n,'RendererCommonValues/Wrap',spec['wrap'])+ if spec.get('flipbook'):+ from PIL import Image+ f=spec['flipbook']; w,h=Image.open(spec['texture']).size; P='RendererCommonValues/UVAnimation/AnimationParams/'+ s(n,'RendererCommonValues/UV','Animation')+ s(n,P+'Size/X',w//f['x']); s(n,P+'Size/Y',h//f['y']); s(n,P+'FrameCountX',f['x']); s(n,P+'FrameCountY',f['y'])+ s(n,P+'FrameLength/Value',f.get('frame_length',2)); s(n,P+'LoopType',f.get('loop','Once')); r(n,P+'StartSheet',f.get('start',0))+ s(n,'RendererCommonValues/UVAnimation/FlipbookInterpolationType','Lerp' if f.get('lerp',True) else 'None')+ if spec.get('alpha_texture'):+ s(n,A+'AlphaTextureParam/Enabled',True); self.uv(n,A+'AlphaTextureParam',spec['alpha_texture'],spec.get('alpha_scroll'),spec.get('alpha_wrap'))+ if spec.get('distortion_texture'):+ s(n,A+'UVDistortionTextureParam/Enabled',True); self.uv(n,A+'UVDistortionTextureParam',spec['distortion_texture'],spec.get('distortion_scroll'))+ s(n,A+'UVDistortionTextureParam/UVDistortionIntensity',spec.get('distortion_intensity',.05))+ if spec.get('blend_texture'):+ B=A+'BlendTextureParams/'+ s(n,B+'Enabled',True); self.uv(n,B+'BlendTextureParam',spec['blend_texture'],spec.get('blend_scroll'))+ s(n,B+'BlendTextureParam/BlendType',spec.get('blend_type','Mul'))+ cutoff=spec.get('cutoff')+ if cutoff is not None:+ # Dissolve: pixels whose (texture alpha x alpha texture) fall below the threshold disappear.+ C=A+'AlphaCutoffParam/'; s(n,C+'Enabled',True)+ if isinstance(cutoff,(int,float)):s(n,C+'Type','Fixed'); s(n,C+'Fixed/Threshold',cutoff)+ else:+ s(n,C+'Type','FCurve'); s(n,C+'FCurve/Timeline','Percent'); self.curve(n,C+'FCurve/S',cutoff)+ edge=spec.get('edge')+ if edge:+ self.color(n,C+'EdgeParam/EdgeColor',edge['color']); s(n,C+'EdgeParam/EdgeThreshold',edge.get('threshold',.1)); s(n,C+'EdgeParam/EdgeColorScaling',edge.get('scaling',2))+ falloff=spec.get('falloff')+ if falloff:+ F=A+'FalloffParam/'; s(n,F+'Enabled',True); s(n,F+'ColorBlendType',falloff.get('blend','Add')); s(n,F+'Pow',falloff.get('pow',2))+ self.color(n,F+'BeginColor',falloff['begin']); self.color(n,F+'EndColor',falloff['end'])+ if spec.get('soft'):+ # Soft particle: fade where the quad meets opaque geometry (depth buffer) instead of a hard intersection line.+ P=A+'SoftParticleParams/'; s(n,P+'Enabled',True); s(n,P+'Distance',spec['soft'])+ collide=spec.get('collide')+ if collide:+ # Ground plane collision: sparks and debris bounce and skid instead of sinking through the floor.+ C='CollisionsValues/'; s(n,C+'IsGroundCollisionEnabled',True); s(n,C+'Height',collide.get('height',0))+ s(n,C+'WorldCoordinateSyatem','World' if collide.get('world',True) else 'Local')+ r(n,C+'Bounce',collide.get('bounce',.4)); r(n,C+'Friction',collide.get('friction',.3)); r(n,C+'LifetimeReductionPerCollision',collide.get('reduction',.3))+ spawn=spec.get('spawn')+ if spawn:+ # With rotate=True particle velocity is expressed in the spawn direction: +Y points away from the centre.+ G='GenerationLocationValues/'; s(n,G+'Type',spawn['shape']); s(n,G+'EffectsRotation',spawn.get('rotate',True))+ if spawn['shape']=='Sphere':+ r(n,G+'Sphere/Radius',spawn.get('radius',0)); r(n,G+'Sphere/RotationX',spawn.get('rot_x',[-90,90])); r(n,G+'Sphere/RotationY',spawn.get('rot_y',[0,360]))+ elif spawn['shape']=='Circle':+ r(n,G+'Circle/Radius',spawn.get('radius',1)); s(n,G+'Circle/AxisDirection',spawn.get('axis','YAxis'))+ s(n,G+'Circle/Division',spawn.get('division',8)); s(n,G+'Circle/Type',spawn.get('order','Random'))+ r(n,G+'Circle/AngleStart',spawn.get('angle_start',0)); r(n,G+'Circle/AngleEnd',spawn.get('angle_end',360)); r(n,G+'Circle/AngleNoize',spawn.get('angle_noise',0))+ elif spawn['shape']=='Line':+ self.vector(n,G+'Line/PositionStart',spawn['start'],True); self.vector(n,G+'Line/PositionEnd',spawn['end'],True)+ s(n,G+'Line/Division',spawn.get('division',8)); s(n,G+'Line/Type',spawn.get('order','Random')); r(n,G+'Line/PositionNoize',spawn.get('noise',0))+ for slot,force in enumerate(spec.get('forces',[]),1):+ if slot>4:raise ValueError('Effekseer supports four local force fields per node')+ L=f'LocationAbsValues/LocalForceField{slot}/'; s(n,L+'Type',force['type']); s(n,L+'Power',force.get('power',1))+ if force['type']=='Gravity':self.vector(n,L+'Gravity/Gravity',force['gravity'])+ if force['type']=='Turbulence':+ s(n,L+'Turbulence/FieldScale',force.get('scale',4)); s(n,L+'Turbulence/Octave',force.get('octave',1)); s(n,L+'Turbulence/TurbulenceType',force.get('kind','Simple'))+ if force['type']=='Vortex':s(n,L+'Vortex/VortexType',force.get('kind','ConstantAngle'))+ if force['type']=='AttractiveForce':+ s(n,L+'AttractiveForce/Control',force.get('control',1)); s(n,L+'AttractiveForce/MinRange',force.get('min_range',0)); s(n,L+'AttractiveForce/MaxRange',force.get('max_range',0))+ if 'position' in force:self.vector(n,L+'Position',force['position'])+ if 'rotation' in force:self.vector(n,L+'Rotation',force['rotation'])+ inherit=spec.get('inherit')+ if inherit:+ # Children default to following the parent every frame; 'WhenCreating' leaves a trail of independent particles.+ for key,field in [('location','CommonValues/LocationEffectType'),('rotation','CommonValues/RotationEffectType'),('scale','CommonValues/ScaleEffectType'),('color','RendererCommonValues/ColorInheritType')]:+ if key in inherit:s(n,field,inherit[key])+ if spec.get('infinite'):s(n,'CommonValues/MaxGeneration/Infinite',True)+ if spec.get('remove_with_parent'):s(n,'CommonValues/Removal/WhenParentIsRemoved',True)+ if spec.get('z_sort'):s(n,'DepthValues/ZSort',spec['z_sort'])+ if spec.get('priority') is not None:s(n,'DepthValues/DrawingPriority',spec['priority'])+ def layer(self,spec,parent='node/root'):+ if spec.get('material_profile'):+ import json+ profile=json.loads(Path(spec['material_profile']).read_text())+ spec={**profile,**spec}+ errors=validate_layer(spec,recursive=False)+ if errors:raise ValueError('; '.join(errors))+ n=self.session.add_node(parent,spec['name'])+ s=self.scalar; r=self.rand; v=self.vector; c=self.color+ life=spec.get('life',24)+ s(n,'CommonValues/MaxGeneration/Value',spec.get('count',1))+ r(n,'CommonValues/Life',life)+ generation='CommonValues/Generation' if 'CommonValues/Generation/GenerationTime/Max' in self.schema else 'CommonValues'+ r(n,generation+'/GenerationTime',max(.00001,spec.get('interval',0)))+ r(n,generation+'/GenerationTimeOffset',spec.get('delay',0))+ s(n,'RendererCommonValues/AlphaBlend',spec.get('blend','Add'))+ s(n,'RendererCommonValues/ZTest',spec.get('z_test',False))+ s(n,'RendererCommonValues/ZWrite',False)+ s(n,'RendererCommonValues/EmissiveScaling',spec.get('emissive',1.0))+ s(n,'RendererCommonValues/FadeInType','Use' if spec.get('fade_in',1)>0 else 'None')+ s(n,'RendererCommonValues/FadeIn/Frame',spec.get('fade_in',1))+ s(n,'RendererCommonValues/FadeOutType','WithinLifetime')+ s(n,'RendererCommonValues/FadeOut/Frame',spec.get('fade_out',max(2,(min(life) if isinstance(life,(list,tuple)) else life)*.65)))+ renderer=spec.get('renderer','Sprite'); s(n,'DrawingValues/Type',renderer)+ color=spec.get('color',[255,255,255,255])+ if renderer in ['Sprite','Model']:+ if spec.get('color_curve'):+ s(n,'DrawingValues/ColorAll/Type','FCurve')+ for ch,val in zip('RGBA',color):+ keys=spec['color_curve'].get(ch,[[0,val],[100,val]])+ self.curve(n,'DrawingValues/ColorAll/FCurve/FCurve/'+ch,keys)+ elif spec.get('color_end'):+ s(n,'DrawingValues/ColorAll/Type','Easing')+ c(n,'DrawingValues/ColorAll/Easing/Start',color,True); c(n,'DrawingValues/ColorAll/Easing/End',spec['color_end'],True)+ else: c(n,'DrawingValues/ColorAll/Fixed',color)+ if renderer=='Sprite': s(n,'DrawingValues/Sprite/Billboard',spec.get('billboard','RotatedBillboard'))+ if renderer=='Sprite' and spec.get('pivot')=='bottom':+ # Quad spans y 0..1 instead of -0.5..0.5, so scaling grows it up from its base (spikes, bolts, pillars).+ s(n,'DrawingValues/Sprite/Position','Fixed')+ for corner,(x,y) in zip(['LL','LR','UL','UR'],[(-.5,0),(.5,0),(-.5,1),(.5,1)]):+ s(n,f'DrawingValues/Sprite/Position_Fixed_{corner}/X',x); s(n,f'DrawingValues/Sprite/Position_Fixed_{corner}/Y',y)+ if renderer=='Model':+ s(n,'DrawingValues/Model/Billboard',spec.get('billboard','Fixed'))+ s(n,'DrawingValues/Model/Culling',spec.get('culling','Double'))+ if spec.get('procedural_model'):+ from .models import assign_procedural_model+ assign_procedural_model(self.session,n,spec['procedural_model'])+ elif spec.get('model'):+ self.session.import_model(spec['model'],n+'/DrawingValues/Model/Model')+ if renderer=='Ring':+ ring=spec.get('ring',{})+ s(n,'DrawingValues/Ring/VertexCount',ring.get('vertices',64))+ s(n,'DrawingValues/Ring/Billboard',spec.get('billboard','Billboard'))+ # outer/inner are [radius,height]; {'start':..,'end':..} animates them over the particle life.+ for part,default in [('Outer',spec.get('ring_outer',[.5,0])),('Inner',spec.get('ring_inner',[.43,0]))]:+ value=ring.get(part.lower(),default)+ if isinstance(value,dict):+ s(n,f'DrawingValues/Ring/{part}',"Easing")+ for axis,a,b in zip('XY',value['start'],value['end']):+ r(n,f'DrawingValues/Ring/{part}_Easing/Start/{axis}',a); r(n,f'DrawingValues/Ring/{part}_Easing/End/{axis}',b)+ else:+ for axis,a in zip('XY',value):s(n,f'DrawingValues/Ring/{part}_Fixed/Location/{axis}',a)+ s(n,'DrawingValues/Ring/CenterRatio_Fixed',ring.get('center_ratio',.5))+ for part,key in [('OuterColor','outer_color'),('CenterColor','center_color'),('InnerColor','inner_color')]:+ c(n,f'DrawingValues/Ring/{part}_Fixed',ring.get(key,color if part=='CenterColor' else [*color[:3],0]))+ # A crescent whose start/end angles ease over life gives a swept arc (slash, sweep, opening seal).+ if 'angle_start' in ring or 'angle_end' in ring:+ s(n,'DrawingValues/Ring/RingShape/Type','Crescent')+ for part,key,default in [('StartingAngle','angle_start',0),('EndingAngle','angle_end',360)]:+ value=ring.get(key,default)+ if isinstance(value,(list,tuple)):+ s(n,f'DrawingValues/Ring/RingShape/Crescent/{part}','Easing')+ r(n,f'DrawingValues/Ring/RingShape/Crescent/{part}_Easing/Start',value[0]); r(n,f'DrawingValues/Ring/RingShape/Crescent/{part}_Easing/End',value[1])+ s(n,f'DrawingValues/Ring/RingShape/Crescent/{part}_Easing/Type',ring.get('angle_easing','EaseOutCubic'))+ else:s(n,f'DrawingValues/Ring/RingShape/Crescent/{part}_Fixed',value)+ fade=ring.get('angle_fade',[0,0])+ s(n,'DrawingValues/Ring/RingShape/Crescent/StartingFade',fade[0]); s(n,'DrawingValues/Ring/RingShape/Crescent/EndingFade',fade[1])+ if renderer=='Ribbon':+ s(n,'DrawingValues/Ribbon/ViewpointDependent',True)+ c(n,'DrawingValues/Ribbon/ColorAll_Fixed',color)+ if renderer=='Track':+ for part in ['TrailColorLeft','TrailColorLeftMiddle','TrailColorCenter','TrailColorCenterMiddle','TrailColorRight','TrailColorRightMiddle']:+ c(n,'DrawingValues/'+part+'/Fixed',color)+ for part,size in zip(['For','Middle','Back'],spec.get('track_size',[])):s(n,f'DrawingValues/Track/TrackSize{part}_Fixed',size)+ if spec.get('texture'):self.uv(n,'RendererCommonValues/ColorTexture',spec['texture'],spec.get('uv_scroll'))+ if spec.get('material'):+ s(n,'RendererCommonValues/Material',spec['material'])+ if spec.get('distortion') is not None:+ s(n,'RendererCommonValues/DistortionIntensity',spec['distortion'])+ self.advanced(n,spec)+ travel=spec.get('travel')+ if travel:+ # Eased displacement: with an ease-out type particles burst fast and then hang, which PVA cannot do+ # (Effekseer drag only damps force-field velocity, not PVA velocity).+ s(n,'LocationValues/Type','Easing')+ v(n,'LocationValues/Easing/Start',travel.get('start',spec.get('position',[0,0,0])),True); v(n,'LocationValues/Easing/End',travel['end'],True)+ s(n,'LocationValues/Easing/Type',travel.get('easing','EaseOutQuartic'))+ else:+ s(n,'LocationValues/Type','PVA')+ v(n,'LocationValues/PVA/Location',spec.get('position',[0,0,0]),True)+ v(n,'LocationValues/PVA/Velocity',spec.get('velocity',[0,0,0]),True)+ v(n,'LocationValues/PVA/Acceleration',spec.get('acceleration',[0,0,0]),True)+ s(n,'RotationValues/Type','PVA')+ v(n,'RotationValues/PVA/Rotation',spec.get('rotation',[0,0,0]),True)+ v(n,'RotationValues/PVA/Velocity',spec.get('spin',[0,0,0]),True)+ start=spec.get('scale_start',[1,1,1]); end=spec.get('scale_end',start)+ if isinstance(start,(int,float)):start=[start]*3+ if isinstance(end,(int,float)):end=[end]*3+ if 'size' in spec:+ # Uniform size keeps randomised particles undistorted; size_curve is absolute scale over 0-100% life.+ if spec.get('size_curve'):+ s(n,'ScalingValues/Type','SingleFCurve'); self.curve(n,'ScalingValues/SingleFCurve/S',[[f,x*spec['size']] for f,x in spec['size_curve']])+ else:+ s(n,'ScalingValues/Type','SingleEasing'); r(n,'ScalingValues/SingleEasing/Start',spec['size']); r(n,'ScalingValues/SingleEasing/End',spec.get('size_end',spec['size']))+ s(n,'ScalingValues/SingleEasing/Type',spec.get('easing','EaseOutCubic'))+ elif spec.get('scale_curve'):+ s(n,'ScalingValues/Type','FCurve')+ for axis,factor in zip('XYZ',start):+ self.curve(n,'ScalingValues/FCurve/FCurve/'+axis,[[f,x*factor] for f,x in spec['scale_curve']])+ else:+ s(n,'ScalingValues/Type','Easing')+ v(n,'ScalingValues/Easing/Start',start,True); v(n,'ScalingValues/Easing/End',end,True)+ s(n,'ScalingValues/Easing/Type',spec.get('easing','EaseOutCubic'))+ for field,value in spec.get('properties',{}).items(): self.set(n,field,value)+ for field,keys in spec.get('curves',{}).items(): self.curve(n,field,keys)+ for child in spec.get('children',[]):self.layer(child,n)+ return n++def compile_effect(recipe,source_path,runtime_path=None):+ """Build a fresh document from a JSON recipe; repeat calls replace only that output."""+ if not recipe.get('layers'):raise ValueError('Recipe needs at least one layer')+ errors=[e for layer in recipe['layers'] for e in validate_layer(layer)]+ if errors:raise ValueError('Invalid recipe layers: '+'; '.join(errors))+ source=Path(source_path).resolve()+ if source.suffix!='.efkefc':raise ValueError('Source must end in .efkefc')+ session=EffectSession.new()+ for node in reversed(session.node_list()):session.remove_node(node['path'])+ session.save(source)+ builder=LayerBuilder(session)+ for layer in recipe['layers']:builder.layer(layer)+ core=load_core(); core.EndFrame=int(recipe.get('duration',1)*60); core.IsLoop=bool(recipe.get('loop',False))+ core.Global.RandomSeed.SetValue(int(recipe.get('seed',1729)))+ session.save()+ # Round-trip through the official reader before runtime export.+ session=EffectSession.open(source)+ # Reject silent writes to legacy/import-only fields that disappear on save.+ expected={write['property']:write['after'] for write in builder.writes}+ for path,value in expected.items():+ actual=session.property_get(path)+ equal=math.isclose(actual,value,rel_tol=1e-5,abs_tol=1e-6) if isinstance(value,(int,float)) and not isinstance(value,bool) else actual==value+ if not equal:raise RuntimeError(f'Property did not survive Core save/open: {path}: {value!r} -> {actual!r}')+ if runtime_path:session.export(runtime_path)+ return {'source':str(source),'runtime':str(runtime_path) if runtime_path else None,'nodes':session.node_list(),'writes':len(builder.writes)}diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/cli.py b/skills/effekseer-vfx/scripts/effekseer_ai/cli.pynew file mode 100644index 0000000..cbbd909--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/cli.py@@ -0,0 +1,221 @@+"""Command-line operations for the portable EffekseerCore bridge."""++from __future__ import annotations++import argparse+import json+from pathlib import Path+from collections.abc import Callable+from typing import Any++from .session import EffectSession+++def _emit(value: Any) -> None:+ print(json.dumps(value, ensure_ascii=False, default=str))+++def _open(path: str) -> EffectSession:+ return EffectSession.open(path)+++def _new(args: argparse.Namespace) -> dict[str, Any]:+ session = EffectSession.new()+ session.save(args.path)+ return session.summary()+++def _show(args: argparse.Namespace) -> dict[str, Any]:+ return _open(args.path).summary()+++def _save(args: argparse.Namespace) -> dict[str, Any]:+ session = _open(args.source)+ session.save(args.destination)+ return session.summary()+++def _node_list(args: argparse.Namespace) -> list[dict[str, Any]]:+ return _open(args.effect).node_list()+++def _node_add(args: argparse.Namespace) -> dict[str, str]:+ session = _open(args.effect)+ path = session.add_node(args.parent, args.name)+ session.save()+ return {"path": path}+++def _node_rename(args: argparse.Namespace) -> dict[str, str]:+ session = _open(args.effect)+ session.rename_node(args.node_path, args.name)+ session.save()+ return {"path": args.node_path}+++def _node_remove(args: argparse.Namespace) -> dict[str, str]:+ session = _open(args.effect)+ session.remove_node(args.node_path)+ session.save()+ return {"removed": args.node_path}+++def _node_move(args: argparse.Namespace) -> dict[str, str]:+ session = _open(args.effect)+ path = session.move_node(args.node_path, args.parent_path)+ session.save()+ return {"path": path}+++def _property_list(args: argparse.Namespace) -> list[str]:+ return _open(args.effect).property_list(args.node_path)+++def _property_get(args: argparse.Namespace) -> Any:+ return _open(args.effect).property_get(args.property_path)+++def _property_set(args: argparse.Namespace) -> dict[str, Any]:+ session = _open(args.effect)+ session.property_set(args.property_path, json.loads(args.value))+ session.save()+ return {"value": session.property_get(args.property_path)}+++def _image_import(args: argparse.Namespace) -> dict[str, str]:+ session = _open(args.effect)+ path = session.import_image(args.source, args.property_path)+ session.save()+ return {"path": path}+++def _export(args: argparse.Namespace) -> dict[str, str]:+ return {"path": str(_open(args.effect).export(args.path, args.magnification))}+++def _settings_list(args: argparse.Namespace) -> dict[str, Any]:+ return _open(args.effect).settings_list(args.node_path)+++def _settings_set(args: argparse.Namespace) -> dict[str, str]:+ session = _open(args.effect)+ session.settings_set(args.node_path, args.panel, json.loads(args.values))+ session.save()+ return {"panel": args.panel}+++def _curve_list(args: argparse.Namespace) -> list[dict[str, float | int]]:+ return _open(args.effect).curve_keys(args.curve_path)+++def _curve_set(args: argparse.Namespace) -> dict[str, str]:+ session = _open(args.effect)+ session.curve_set_keys(args.curve_path, json.loads(args.keys))+ session.save()+ return {"curve": args.curve_path}+++def _compile(args: argparse.Namespace) -> dict[str, Any]:+ from .authoring import compile_effect+ recipe = json.loads(Path(args.recipe).read_text(encoding="utf-8"))+ return {"ok": True, **compile_effect(recipe, args.source, args.runtime)}+++def _texture_process(args: argparse.Namespace) -> dict[str, Any]:+ from .resources import process_texture+ return {"ok": True, **process_texture(args.source, args.output, args.size, mask=not args.color)}+++def build_parser() -> argparse.ArgumentParser:+ """Build the CLI parser without accessing an Effekseer installation."""+ parser = argparse.ArgumentParser(prog="effekseer-ai")+ commands = parser.add_subparsers(dest="command", required=True)++ def command(name: str, handler: Callable[[argparse.Namespace], Any]) -> argparse.ArgumentParser:+ subparser = commands.add_parser(name)+ subparser.set_defaults(handler=handler)+ return subparser++ command("new", _new).add_argument("path")+ command("open", _show).add_argument("path")+ save = command("save", _save)+ save.add_argument("source")+ save.add_argument("destination", nargs="?")++ node_list = command("node-list", _node_list)+ node_list.add_argument("effect")+ node_add = command("node-add", _node_add)+ node_add.add_argument("effect")+ node_add.add_argument("--parent", default="node/root")+ node_add.add_argument("--name")+ node_rename = command("node-rename", _node_rename)+ node_rename.add_argument("effect")+ node_rename.add_argument("node_path")+ node_rename.add_argument("name")+ node_remove = command("node-remove", _node_remove)+ node_remove.add_argument("effect")+ node_remove.add_argument("node_path")+ node_move = command("node-move", _node_move)+ node_move.add_argument("effect")+ node_move.add_argument("node_path")+ node_move.add_argument("parent_path")++ property_list = command("property-list", _property_list)+ property_list.add_argument("effect")+ property_list.add_argument("node_path")+ property_get = command("property-get", _property_get)+ property_get.add_argument("effect")+ property_get.add_argument("property_path")+ property_set = command("property-set", _property_set)+ property_set.add_argument("effect")+ property_set.add_argument("property_path")+ property_set.add_argument("value", help="A JSON value")++ image_import = command("image-import", _image_import)+ image_import.add_argument("effect")+ image_import.add_argument("source")+ image_import.add_argument("--property-path")+ export = command("export", _export)+ export.add_argument("effect")+ export.add_argument("path")+ export.add_argument("--magnification", type=float, default=1.0)++ settings_list = command("settings-list", _settings_list)+ settings_list.add_argument("effect")+ settings_list.add_argument("node_path")+ settings_set = command("settings-set", _settings_set)+ settings_set.add_argument("effect")+ settings_set.add_argument("node_path")+ settings_set.add_argument("panel")+ settings_set.add_argument("values", help="A JSON object")+ curve_list = command("curve-list", _curve_list)+ curve_list.add_argument("effect")+ curve_list.add_argument("curve_path")+ curve_set = command("curve-set", _curve_set)+ curve_set.add_argument("effect")+ curve_set.add_argument("curve_path")+ curve_set.add_argument("keys", help="A JSON keyframe list")+ compile_command = command("compile", _compile)+ compile_command.add_argument("recipe", help="JSON recipe; texture paths are relative to the current directory or absolute")+ compile_command.add_argument("source")+ compile_command.add_argument("--runtime")+ texture_command = command("texture-process", _texture_process)+ texture_command.add_argument("source")+ texture_command.add_argument("output")+ texture_command.add_argument("--size", type=int, default=256)+ texture_command.add_argument("--color", action="store_true")+ return parser+++def main(argv: list[str] | None = None) -> int:+ args = build_parser().parse_args(argv)+ try:+ _emit(args.handler(args))+ return 0+ except Exception as error:+ _emit({"ok": False, "error": {"type": type(error).__name__, "message": str(error)}})+ return 1+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/models.py b/skills/effekseer-vfx/scripts/effekseer_ai/models.pynew file mode 100644index 0000000..30a2f20--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/models.py@@ -0,0 +1,34 @@+"""Create Core procedural meshes with validated reflective settings."""+from .runtime import load_core++def model_schema():+ load_core()+ from Effekseer.Data import ProceduralModelParameter+ model=ProceduralModelParameter(); result={}+ def walk(obj,path='',depth=7):+ if not hasattr(obj,'GetType') or depth==0:return+ for member in obj.GetType().GetProperties():+ if not member.CanRead or member.GetIndexParameters().Length or member.Name in {'DefaultValue','Link','IsValueChangedFromDefault'}:continue+ val=getattr(obj,member.Name); p=path+'/'+member.Name if path else member.Name+ if hasattr(val,'GetEnumType'):+ from System import Enum+ result[p]={'value':str(val.Value),'enum':[str(x) for x in Enum.GetNames(val.GetEnumType())]}+ elif hasattr(val,'SetValue') and hasattr(val,'Value'):result[p]={'value':str(val.Value)}+ elif hasattr(val,'GetType') and str(val.GetType().Namespace).startswith('Effekseer'):walk(val,p,depth-1)+ walk(model)+ return result++def assign_procedural_model(session,node_path,properties):+ from Effekseer.Data import ProceduralModelParameter+ model=ProceduralModelParameter(); schema=model_schema()+ for path,value in properties.items():+ if path not in schema:raise ValueError(f'Unknown procedural model property: {path}')+ obj=model+ for member in path.split('/'):obj=getattr(obj,member)+ session._assign_value(obj,value)+ collection=load_core().ProceduralModel.ProceduralModels+ if not collection.Add(model):raise RuntimeError('Procedural model limit reached')+ node=session._node(node_path)+ session._assign_value(node.DrawingValues.Model.ModelReference,'ProceduralModel')+ node.DrawingValues.Model.Reference.SetValue(model)+ return {'node':node_path,'model_index':collection.GetIndex(model),'name':str(model.Name.Value)}diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/preview.py b/skills/effekseer-vfx/scripts/effekseer_ai/preview.pynew file mode 100644index 0000000..015a86f--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/preview.py@@ -0,0 +1,37 @@+"""Render through the official Godot plugin and VfxLab capture harness."""+from pathlib import Path+import subprocess, json++def preview_effects(project_path: str, output_dir: str, ids: list[str] | None=None, bright: bool=False, godot: str='godot', timeout: int=300) -> dict:+ project=Path(project_path).resolve(); output=Path(output_dir).resolve()+ if not (project/'project.godot').is_file():raise ValueError(f'Godot project not found: {project}')+ if not (project/'scripts/VfxLab.gd').is_file():raise ValueError('Project needs the VfxLab capture harness')+ entries=json.loads((project/'vfx_manifest.json').read_text())+ if not entries:raise ValueError('No effects in the manifest; compile/build effects before previewing')+ known={entry['id'] for entry in entries}+ if ids and not set(ids)<=known:raise ValueError(f'Unknown preview IDs: {sorted(set(ids)-known)}')+ output.mkdir(parents=True,exist_ok=True)+ command=[godot,'--headless','--editor','--path',str(project),'--import']+ imported=subprocess.run(command,capture_output=True,text=True,timeout=timeout)+ if imported.returncode or 'SCRIPT ERROR:' in imported.stderr or 'ERROR:' in imported.stderr:+ raise RuntimeError(f'Godot import failed: {imported.stderr[-4000:]}')+ command=[godot,'--path',str(project),'--fixed-fps','60','--','--capture='+str(output)]+ if ids:command.append('--ids='+','.join(ids))+ if bright:command.append('--bright')+ run=subprocess.run(command,capture_output=True,text=True,timeout=timeout)+ captures=[]+ for line in run.stdout.splitlines():+ try:+ data=json.loads(line)+ if 'capture' in data:captures.append(data)+ except ValueError:pass+ (output/'capture.log').write_text(run.stdout+run.stderr)+ if run.returncode or 'SCRIPT ERROR:' in run.stderr or 'ERROR:' in run.stderr:+ raise RuntimeError(f'Godot preview failed ({run.returncode}): {run.stderr[-4000:]}')+ expected_ids=ids or [entry['id'] for entry in json.loads((project/'vfx_manifest.json').read_text())]+ expected={id+suffix for id in expected_ids for suffix in ['', '_baseline', '_phase1', '_phase2']}+ observed={capture['capture'] for capture in captures}+ missing=sorted(expected-observed)+ if missing:raise RuntimeError(f'Incomplete capture: {len(missing)} screenshots missing; process may have been closed before completion. First missing: {missing[:4]}')+ if not captures or any(c['error'] for c in captures):raise RuntimeError('Godot did not produce valid screenshots')+ return {'ok':True,'output':str(output),'captures':captures,'count':len(captures)}diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/resources.py b/skills/effekseer-vfx/scripts/effekseer_ai/resources.pynew file mode 100644index 0000000..2b78f2d--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/resources.py@@ -0,0 +1,36 @@+"""Preserve original generated masks and produce straight-alpha power-of-two sprites."""+from pathlib import Path+from PIL import Image, ImageOps++def process_texture(source: str, output: str, size: int=256, threshold: int=8, padding: float=.08, mask: bool=True, grid: tuple|None=None) -> dict:+ src,dst=Path(source).resolve(),Path(output).resolve()+ if src==dst: raise ValueError('Output cannot overwrite the original image')+ if not src.is_file(): raise FileNotFoundError(src)+ if size<64 or size>2048 or size & (size-1): raise ValueError('Size must be a power of two between 64 and 2048')+ if not 0<=threshold<255 or not 0<=padding<.45: raise ValueError('Invalid threshold or padding')+ im=Image.open(src).convert('RGBA')+ if mask:+ alpha=ImageOps.grayscale(im).point(lambda x:round(max(0,x-threshold)*255/(255-threshold)))+ from PIL import ImageChops+ alpha=ImageChops.multiply(alpha,im.getchannel('A'))+ im=Image.new('RGBA',im.size,(255,255,255,0)); im.putalpha(alpha)+ if grid:+ # Flipbook sheet: keep every cell where it is (re-centring frames would make the animation jitter) and+ # feather each cell's border so neighbouring frames never bleed in under bilinear filtering.+ import numpy as np+ cols,rows=grid; im=im.resize((size,size),Image.Resampling.LANCZOS)+ cw,ch=size//cols,size//rows; edge=max(2,cw//32)+ wx=np.clip(np.minimum(np.arange(cw),cw-1-np.arange(cw))/edge,0,1); wy=np.clip(np.minimum(np.arange(ch),ch-1-np.arange(ch))/edge,0,1)+ window=np.tile(np.outer(wy,wx),(rows,cols))+ alpha=np.asarray(im.getchannel('A')).astype(float)*window+ im.putalpha(Image.fromarray(alpha.round().astype(np.uint8)))+ dst.parent.mkdir(parents=True,exist_ok=True); im.save(dst)+ return {'source':str(src),'output':str(dst),'size':size,'grid':list(grid),'alpha':'straight','visible_pixels':sum(im.getchannel('A').histogram()[9:])}+ bbox=im.getchannel('A').point(lambda v:255 if v>12 else 0).getbbox()+ if not bbox: raise ValueError('Source has no visible effect pixels')+ im=im.crop(bbox); usable=round(size*(1-2*padding))+ im.thumbnail((usable,usable),Image.Resampling.LANCZOS)+ result=Image.new('RGBA',(size,size),(255,255,255,0))+ result.alpha_composite(im,((size-im.width)//2,(size-im.height)//2))+ dst.parent.mkdir(parents=True,exist_ok=True);result.save(dst)+ return {'source':str(src),'output':str(dst),'size':size,'crop':list(bbox),'alpha':'straight','visible_pixels':sum(result.getchannel('A').histogram()[9:])}diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/runtime.py b/skills/effekseer-vfx/scripts/effekseer_ai/runtime.pynew file mode 100644index 0000000..e796c56--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/runtime.py@@ -0,0 +1,73 @@+"""Load the official Effekseer Core assembly through Python.NET."""++from __future__ import annotations++import os+import sys+from importlib import resources+from pathlib import Path+from typing import Any++_core: Any | None = None+++def editor_bin_directory() -> Path:+ """Return the configured directory containing ``EffekseerCore.dll``.++ A release build deliberately does not search local drives. This keeps host+ layout private and makes the selected Effekseer installation explicit.+ """+ configured = os.environ.get("EFFEKSEER_AI_BIN_DIR")+ if configured:+ directory = Path(configured).expanduser().resolve()+ if (directory / "EffekseerCore.dll").is_file():+ return directory+ raise RuntimeError(+ "EFFEKSEER_AI_BIN_DIR must point to a directory containing "+ "EffekseerCore.dll"+ )+ raise RuntimeError(+ "EffekseerCore.dll was not found. Set EFFEKSEER_AI_BIN_DIR to "+ "the official Effekseer Tool/bin directory."+ )+++def runtime_config_path() -> Path:+ """Return the bundled .NET runtime configuration file."""+ resource = resources.files("effekseer_ai").joinpath(+ "runtime", "ea.runtimeconfig.json"+ )+ return Path(resource)+++def load_core() -> Any:+ """Load and return the official static ``Effekseer.Core`` type."""+ global _core+ if _core is not None:+ return _core++ bin_directory = editor_bin_directory()+ os.environ.setdefault("PYTHONNET_RUNTIME", "coreclr")+ os.environ.setdefault(+ "PYTHONNET_CORECLR_RUNTIME_CONFIG", str(runtime_config_path())+ )+ if str(bin_directory) not in sys.path:+ sys.path.insert(0, str(bin_directory))++ import clr++ clr.AddReference(str(bin_directory / "EffekseerCore.dll"))+ from Effekseer import Core++ _core = Core+ return Core+++def export_binary(path: Path, magnification: float = 1.0) -> None:+ """Export the current Core document as an Effekseer runtime ``.efk`` file."""+ core = load_core()+ from Effekseer.Binary import Exporter+ from System.IO import File++ path.parent.mkdir(parents=True, exist_ok=True)+ File.WriteAllBytes(str(path), Exporter().Export(core.Root, magnification))diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/runtime/ea.runtimeconfig.json b/skills/effekseer-vfx/scripts/effekseer_ai/runtime/ea.runtimeconfig.jsonnew file mode 100644index 0000000..1c42750--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/runtime/ea.runtimeconfig.json@@ -0,0 +1,10 @@+{+ "runtimeOptions": {+ "tfm": "net9.0",+ "framework": {+ "name": "Microsoft.NETCore.App",+ "version": "9.0.0",+ "rollForward": "LatestPatch"+ }+ }+}diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/session.py b/skills/effekseer-vfx/scripts/effekseer_ai/session.pynew file mode 100644index 0000000..b02ea73--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/session.py@@ -0,0 +1,381 @@+"""The minimal effect-document lifecycle backed by Effekseer Core."""++from __future__ import annotations++from dataclasses import dataclass+from pathlib import Path+from shutil import copy2+from typing import Any++from .runtime import export_binary, load_core+from .settings import PANEL_LABELS, PANEL_ROOTS+++@dataclass+class EffectSession:+ """A handle to the single Core document hosted by this Python process."""++ path: Path | None = None++ def __post_init__(self) -> None:+ self._nodes: dict[str, object] = {}+ self._index_existing_nodes()++ @classmethod+ def new(cls) -> "EffectSession":+ load_core().New()+ return cls()++ @classmethod+ def open(cls, path: str | Path) -> "EffectSession":+ effect_path = Path(path).resolve()+ if not effect_path.is_file():+ raise FileNotFoundError(effect_path)+ if not load_core().LoadFrom(str(effect_path)):+ raise ValueError(f"Effekseer cannot open: {effect_path}")+ return cls(effect_path)++ def save(self, path: str | Path | None = None) -> Path:+ effect_path = Path(path or self.path or "").resolve()+ if not str(effect_path):+ raise ValueError("A path is required for the first save")+ if effect_path.suffix.lower() != ".efkefc":+ raise ValueError("Effect files must use the .efkefc extension")+ effect_path.parent.mkdir(parents=True, exist_ok=True)+ load_core().SaveTo(str(effect_path))+ self.path = effect_path+ return effect_path++ def summary(self) -> dict[str, int | str | None]:+ root = load_core().Root+ return {+ "path": str(self.path) if self.path else None,+ "root_children": int(root.Children.Count),+ }++ def add_node(self, parent_path: str = "node/root", name: str | None = None) -> str:+ """Add a Core node and return its AI-facing path."""+ parent = self._node(parent_path)+ node = parent.AddChild()+ if name is not None:+ node.Name.SetValue(name)+ node_path = f"{parent_path}/{int(parent.Children.Count) - 1}"+ self._nodes[node_path] = node+ return node_path++ def node_list(self) -> list[dict[str, int | str]]:+ """List every non-root node currently known to the session."""+ return [+ {+ "path": path,+ "name": str(node.Name.Value),+ "children": int(node.Children.Count),+ }+ for path, node in self._nodes.items()+ if path != "node/root"+ ]++ def rename_node(self, node_path: str, name: str) -> None:+ """Rename a node through its Core string value."""+ if node_path == "node/root":+ raise ValueError("The root node cannot be renamed")+ self._node(node_path).Name.SetValue(name)++ def remove_node(self, node_path: str) -> None:+ """Remove a node and its descendants from the current document."""+ if node_path == "node/root":+ raise ValueError("The root node cannot be removed")+ node = self._node(node_path)+ if not node.Parent.RemoveChild(node):+ raise ValueError(f"Node is not attached: {node_path}")+ self._index_existing_nodes()++ def move_node(self, node_path: str, parent_path: str) -> str:+ """Move a node and return its new structural path."""+ if node_path == "node/root":+ raise ValueError("The root node cannot be moved")+ node = self._node(node_path)+ parent = self._node(parent_path)+ if node == parent or node.HasNode(parent, True):+ raise ValueError("A node cannot be moved into itself or its descendant")+ if not node.Parent.RemoveChild(node):+ raise ValueError(f"Node is not attached: {node_path}")+ parent.AddChild(node)+ self._index_existing_nodes()+ return f"{parent_path}/{int(parent.Children.Count) - 1}"++ def property_get(self, property_path: str) -> Any:+ """Read a public Core member without invoking arbitrary methods."""+ target, member = self._property_parent(property_path)+ return self._as_python(getattr(target, member))++ def property_set(self, property_path: str, value: Any) -> None:+ """Write an editable Core value or a public writable property."""+ node_path = next((path for path in sorted(self._nodes, key=len, reverse=True) if property_path.startswith(path + "/")), None)+ if node_path is not None:+ current = self._node(node_path)+ for member_name in property_path[len(node_path) + 1:].split("/"):+ member_info = current.GetType().GetProperty(member_name) if hasattr(current, "GetType") else None+ if member_info is not None and not self._is_exported_property(member_info):+ raise ValueError(f"Import-only legacy property is not saved by this Core version: {property_path}. Use property-list to discover active fields.")+ current = getattr(current, member_name)+ target, member = self._property_parent(property_path)+ if member == "Value":+ self._assign_value(target, value)+ return++ property_info = target.GetType().GetProperty(member)+ if property_info is None or not property_info.CanWrite:+ raise ValueError(f"Property is not writable: {property_path}")+ setattr(target, member, value)++ def property_list(self, node_path: str, max_depth: int = 10) -> list[str]:+ """Discover editable leaf paths without walking parent/tree references."""+ leaves: list[str] = []+ skipped = {"Children", "Parent", "EditorNodeId", "Link", "DefaultValue", "IsValueChangedFromDefault", "IsValueAssigned", "DynamicEquation", "DynamicEquationMin", "DynamicEquationMax"}++ def walk(value: Any, path: str, depth: int) -> None:+ if value is None or isinstance(value, (bool, int, float, str)):+ leaves.append(path)+ return+ if depth == 0 or not hasattr(value, "GetType"):+ leaves.append(path)+ return+ value_type = value.GetType()+ if value_type.IsEnum:+ leaves.append(path)+ return+ if not (value_type.Namespace or "").startswith("Effekseer"):+ leaves.append(path)+ return+ for property_info in value_type.GetProperties():+ if (+ not property_info.CanRead+ or not self._is_exported_property(property_info)+ or property_info.Name in skipped+ or property_info.GetIndexParameters().Length != 0+ ):+ continue+ try:+ walk(getattr(value, property_info.Name), f"{path}/{property_info.Name}", depth - 1)+ except Exception:+ continue+ for field_info in value_type.GetFields():+ if field_info.IsStatic or field_info.Name in skipped or field_info.Name.startswith("_"):+ continue+ try:+ walk(getattr(value, field_info.Name), f"{path}/{field_info.Name}", depth - 1)+ except Exception:+ continue++ walk(self._node(node_path), node_path, max_depth)+ return sorted(set(leaves))++ @staticmethod+ def _is_exported_property(property_info: Any) -> bool:+ for attribute in property_info.GetCustomAttributes(False):+ if attribute.GetType().Name == "IOAttribute" and not attribute.Export:+ return False+ return True++ def settings_list(self, node_path: str) -> dict[str, dict[str, object]]:+ """Discover parameters grouped as they are in the editor's setting panels."""+ paths = self.property_list(node_path)+ return {+ panel: {+ "label": PANEL_LABELS[panel],+ "fields": [+ path.removeprefix(f"{node_path}/{root}/")+ for path in paths+ if path.startswith(f"{node_path}/{root}/")+ ],+ }+ for panel, root in PANEL_ROOTS.items()+ }++ def settings_set(self, node_path: str, panel: str, values: dict[str, Any]) -> None:+ """Set a batch of panel-relative editable fields."""+ try:+ root = PANEL_ROOTS[panel]+ except KeyError as error:+ raise KeyError(f"Unknown settings panel: {panel}") from error+ for field, value in values.items():+ if field.startswith("/") or ".." in field.split("/"):+ raise ValueError(f"Invalid setting field: {field}")+ self.property_set(f"{node_path}/{root}/{field}", value)++ def curve_keys(self, curve_path: str) -> list[dict[str, float | int]]:+ """Read a scalar curve as JSON-friendly keyframe data."""+ curve = self._object_at_path(curve_path)+ return [+ {+ "frame": int(key.Frame), "value": float(key.Value),+ "left": [float(key.LeftX), float(key.LeftY)],+ "right": [float(key.RightX), float(key.RightY)],+ "interpolation": int(key.InterpolationType),+ }+ for key in curve.Keys+ ]++ def curve_set_keys(self, curve_path: str, keys: list[dict[str, Any]]) -> None:+ """Replace scalar FCurve keys using Core's add/remove commands."""+ import math+ frames = set()+ for data in keys:+ if "frame" not in data or "value" not in data:+ raise ValueError("Every curve key needs frame and value")+ frame = data["frame"]+ if isinstance(frame, bool) or int(frame) != frame or frame in frames:+ raise ValueError(f"Curve frames must be unique integers: {frame}")+ frames.add(frame)+ if not math.isfinite(float(data["value"])):+ raise ValueError("Curve values must be finite")+ if data.get("interpolation", 0) not in (0, 1):+ raise ValueError("Interpolation must be 0 (Bezier) or 1 (Linear)")+ for side in ("left", "right"):+ if side in data and (len(data[side]) != 2 or not all(math.isfinite(float(x)) for x in data[side])):+ raise ValueError(f"Curve {side} handle must contain two finite coordinates")+ curve = self._object_at_path(curve_path)+ prepared = [self._new_curve_key(curve, data) for data in sorted(keys, key=lambda item: int(item["frame"]))]+ for key in list(curve.Keys):+ curve.RemoveKey(key)+ for key in prepared:+ curve.AddKey(key)++ def _new_curve_key(self, curve: object, data: dict[str, float | int]) -> object:+ from System import Activator, Array, Enum, Int32, Object, Single++ value_type = curve.GetType().GetGenericArguments()[0]+ value = Single(float(data["value"])) if value_type.Name == "Single" else Int32(int(data["value"]))+ key_type = curve.GetType().Assembly.GetType("Effekseer.Data.Value.FCurveKey`1")+ key_type = key_type.MakeGenericType(value_type)+ key = Activator.CreateInstance(key_type, Array[Object]([Int32(int(data["frame"])), value]))+ if "left" in data:+ key.SetLeft(Single(float(data["left"][0])), Single(float(data["left"][1])))+ if "right" in data:+ key.SetRight(Single(float(data["right"][0])), Single(float(data["right"][1])))+ if "interpolation" in data:+ enum_type = key.GetType().Assembly.GetType("Effekseer.Data.Value.FCurveInterpolation")+ key.SetInterpolationType(Enum.ToObject(enum_type, int(data["interpolation"])))+ key.Commit()+ return key++ def import_image(self, source: str | Path, property_path: str | None = None) -> str:+ """Copy an image beside the effect and optionally bind its Core path."""+ relative_path = self._copy_resource(+ source, {".png", ".jpg", ".jpeg", ".tga", ".dds", ".bmp"}+ )+ if property_path:+ image_path = self._object_at_path(property_path)+ if hasattr(image_path, "SetAbsolutePath"):+ image_path.SetAbsolutePath(str(self.path.parent / relative_path))+ else:+ self.property_set(property_path, relative_path)+ return relative_path++ def import_model(self, source: str | Path, property_path: str) -> str:+ """Copy a model into ``resources/`` and bind it through Core's path API."""+ relative_path = self._copy_resource(source, {".fbx", ".efkmodel"})+ absolute_path = self.path.parent / Path(relative_path)+ model_path = self._object_at_path(property_path)+ if not hasattr(model_path, "SetAbsolutePath"):+ raise ValueError(f"Property is not an Effekseer model path: {property_path}")+ model_path.SetAbsolutePath(str(absolute_path))+ return relative_path++ def export(self, path: str | Path, magnification: float = 1.0) -> Path:+ """Export the current document as a runtime `.efk` file."""+ output = Path(path).resolve()+ if output.suffix.lower() != ".efk":+ raise ValueError("Runtime exports must use the .efk extension")+ export_binary(output, magnification)+ return output++ def _index_existing_nodes(self) -> None:+ root = load_core().Root+ self._nodes.clear()+ self._nodes["node/root"] = root++ def visit(parent: object, parent_path: str) -> None:+ for index in range(parent.Children.Count):+ child = parent.Children[index]+ child_path = f"{parent_path}/{index}"+ self._nodes[child_path] = child+ visit(child, child_path)++ visit(root, "node/root")++ def _copy_resource(self, source: str | Path, extensions: set[str]) -> str:+ """Copy an approved asset to this effect's resource directory."""+ if self.path is None:+ raise ValueError("Save the effect before importing project resources")+ source_path = Path(source).resolve()+ if not source_path.is_file():+ raise FileNotFoundError(source_path)+ if source_path.suffix.lower() not in extensions:+ raise ValueError(f"Unsupported resource type: {source_path.suffix}")+ resources = self.path.parent / "resources"+ resources.mkdir(exist_ok=True)+ destination = resources / source_path.name+ copy2(source_path, destination)+ return destination.relative_to(self.path.parent).as_posix()++ def _node(self, node_path: str) -> object:+ try:+ return self._nodes[node_path]+ except KeyError as error:+ raise KeyError(f"Unknown node path: {node_path}") from error++ def _property_parent(self, property_path: str) -> tuple[object, str]:+ if not property_path.startswith("node/"):+ raise ValueError(f"Invalid property path: {property_path}")+ node_path = next(+ (path for path in sorted(self._nodes, key=len, reverse=True)+ if property_path.startswith(f"{path}/")),+ None,+ )+ if node_path is None:+ raise KeyError(f"Unknown node in property path: {property_path}")+ members = property_path[len(node_path) + 1 :].split("/")+ if any(not member or member.startswith("_") for member in members):+ raise ValueError(f"Invalid property path: {property_path}")++ target = self._node(node_path)+ for member in members[:-1]:+ target = getattr(target, member)+ return target, members[-1]++ def _object_at_path(self, property_path: str) -> object:+ target, member = self._property_parent(property_path)+ return getattr(target, member)++ def _assign_value(self, target: object, value: Any) -> None:+ """Write scalar values through nested Core editable-value wrappers."""+ if hasattr(target, "GetEnumType"):+ from System import Enum, Int32+ enum_type = target.GetEnumType()+ enum_value = Enum.Parse(enum_type, value) if isinstance(value, str) else Enum.ToObject(enum_type, Int32(value))+ if not Enum.IsDefined(enum_type, enum_value):+ raise ValueError(f"Invalid {enum_type.Name} value: {value}")+ target.SetValue(enum_value)+ return+ if hasattr(target, "SetValue"):+ target.SetValue(value)+ return+ property_info = target.GetType().GetProperty("Value")+ if property_info is None or not property_info.CanWrite:+ raise ValueError(f"Value is not writable on {target.GetType().FullName}")+ try:+ target.Value = value+ except TypeError:+ self._assign_value(target.Value, value)++ def _as_python(self, value: Any) -> Any:+ if value is None or isinstance(value, (bool, int, float, str)):+ return value+ if value.GetType().IsEnum:+ return str(value)+ property_info = value.GetType().GetProperty("Value")+ if property_info is not None and property_info.CanRead:+ return self._as_python(value.Value)+ return str(value)diff --git a/skills/effekseer-vfx/scripts/effekseer_ai/settings.py b/skills/effekseer-vfx/scripts/effekseer_ai/settings.pynew file mode 100644index 0000000..803cc33--- /dev/null+++ b/skills/effekseer-vfx/scripts/effekseer_ai/settings.py@@ -0,0 +1,35 @@+"""Names of node setting panels exposed by the Effekseer editor."""++PANEL_ROOTS = {+ "basic": "CommonValues",+ "location": "LocationValues",+ "rotation": "RotationValues",+ "scale": "ScalingValues",+ "attraction": "LocationAbsValues",+ "generation": "GenerationLocationValues",+ "depth": "DepthValues",+ "renderer_common": "RendererCommonValues",+ "renderer": "DrawingValues",+ "sound": "SoundValues",+ "advanced_renderer": "AdvancedRendererCommonValuesValues",+ "kill_rules": "KillRulesValues",+ "collisions": "CollisionsValues",+ "gpu_particles": "GpuParticles",+}++PANEL_LABELS = {+ "basic": "基础设置",+ "location": "位置",+ "rotation": "旋转",+ "scale": "缩放",+ "attraction": "吸引力",+ "generation": "生成位置",+ "depth": "深度",+ "renderer_common": "渲染通用设置",+ "renderer": "渲染器设置",+ "sound": "声音",+ "advanced_renderer": "高级渲染",+ "kill_rules": "销毁规则",+ "collisions": "碰撞",+ "gpu_particles": "GPU 粒子",+}diff --git a/skills/effekseer-vfx/scripts/requirements.lock.txt b/skills/effekseer-vfx/scripts/requirements.lock.txtnew file mode 100644index 0000000..d3fdfa3--- /dev/null+++ b/skills/effekseer-vfx/scripts/requirements.lock.txt@@ -0,0 +1,13 @@+# Python packages of the effekseer-vfx toolchain (installed by setup.sh into EFFEKSEER_VFX_HOME/venv).+attrs==26.1.0+cffi==2.1.1+clr-loader==0.3.1+jsonschema==4.26.0+jsonschema-specifications==2025.9.1+numpy==2.5.3+pillow==12.3.0+pycparser==3.0+pythonnet==3.2.0+referencing==0.37.0+rpds-py==2026.6.3+typing-extensions==4.16.0diff --git a/skills/effekseer-vfx/scripts/setup.sh b/skills/effekseer-vfx/scripts/setup.shnew file mode 100755index 0000000..57c7fd3--- /dev/null+++ b/skills/effekseer-vfx/scripts/setup.sh@@ -0,0 +1,119 @@+#!/bin/sh+# Install the effekseer-vfx toolchain into EFFEKSEER_VFX_HOME (default ~/.cache/effekseer-vfx). Safe to re-run.+#+# sh setup.sh full mode: Python packages, Effekseer Core 1.80.7 and the .NET 9 runtime (macOS ARM64)+# sh setup.sh --authoring-only Python packages only: write recipes, lint, process textures (macOS or Linux; WSL on Windows)+#+# Needs Python 3.11+ (found automatically) or uv. Exit codes: 0 ok, 1 a download or install failed, 3 full mode on an+# unsupported system, 4 no suitable Python.+#+# The Effekseer and .NET archives (~250 MB in full mode) come from the official Effekseer and Microsoft releases and+# are checked against pinned SHA-256 sums; Python packages are pinned by version (requirements.lock.txt), not by hash.+# Nothing is installed outside EFFEKSEER_VFX_HOME. Godot 4 is not installed here. Concurrent runs that share one+# EFFEKSEER_VFX_HOME wait for each other (kernel file lock); every download and extraction goes to a private+# temporary path first.+set -eu+MODE=full+[ "${1:-}" = "--authoring-only" ] && MODE=authoring+SCRIPTS=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)+TOOLCHAIN=${EFFEKSEER_VFX_HOME:-$HOME/.cache/effekseer-vfx}+CORE_URL=https://github.com/effekseer/Effekseer/releases/download/1807/Effekseer1.80.7Win.zip+CORE_SHA256=6f059b9cce3a79c5bfe3df9c970cfe62fd72acf130083c7b81832d90f8d1335f+DOTNET_VERSION=9.0.20+# Microsoft's published SHA-512 for this archive (releases.json) is+# 5bb676b5bac2656eb7e8c847532505007b2154df0f6682e31b1681e35d1b757ca201559677c7e2bb197a6b7563bc584d7fcefb26344a9f8f2a390b41136a2702+DOTNET_URL=https://builds.dotnet.microsoft.com/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-osx-arm64.tar.gz+DOTNET_SHA256=452dc0b41e7918873b46b922187691581846a179579c0284d56a50bff5e6f1e6+mkdir -p "$TOOLCHAIN/downloads"++# One setup at a time per toolchain: re-run this script while holding an exclusive kernel lock on a lock file. The+# kernel releases it when the process exits, so a crashed run never leaves a lock behind and nothing is deleted to+# take one over. flock(1) where it exists (Linux), else Python's fcntl (macOS ships no flock(1)).+LOCKFILE="$TOOLCHAIN/.setup.lock"+if [ -z "${EFFEKSEER_VFX_SETUP_LOCKED:-}" ]; then+ export EFFEKSEER_VFX_SETUP_LOCKED=1+ if command -v flock >/dev/null 2>&1; then+ exec flock "$LOCKFILE" sh "$0" "$@"+ elif command -v python3 >/dev/null 2>&1; then+ exec python3 -c 'import fcntl, os, sys+lock = open(sys.argv[1], "a"); fcntl.flock(lock, fcntl.LOCK_EX); os.set_inheritable(lock.fileno(), True)+os.execvp("sh", ["sh"] + sys.argv[2:])' "$LOCKFILE" "$0" "$@"+ else+ echo "Neither flock nor python3 is available to lock $LOCKFILE; do not run two setups at once." >&2+ fi+fi+WORKDIR=$(mktemp -d "$TOOLCHAIN/downloads/.setup.XXXXXX")+trap 'rm -rf "$WORKDIR"' EXIT INT TERM++sha256() { if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1; else sha256sum "$1" | cut -d' ' -f1; fi; }+# fetch URL SHA256 TARGET: reuse a verified copy, else download privately, verify, then move into place.+fetch() {+ if [ -f "$3" ] && [ "$(sha256 "$3")" = "$2" ]; then return 0; fi+ curl -L --fail -o "$WORKDIR/download" "$1"+ [ "$(sha256 "$WORKDIR/download")" = "$2" ] || { echo "Checksum mismatch for $1" >&2; exit 1; }+ mv "$WORKDIR/download" "$3"+}++if [ "$MODE" = full ] && { [ "$(uname -s)" != Darwin ] || [ "$(uname -m)" != arm64 ]; }; then+ echo "Full mode (EffekseerCore build + Godot review) is verified on macOS ARM64 only." >&2+ echo "On this system run: sh $0 --authoring-only" >&2+ exit 3+fi++# Python 3.11+ is required (the pinned numpy, Pillow and pythonnet need it). uv provides one by itself; otherwise use+# the newest python3.x on PATH or in the usual Homebrew locations. macOS's own /usr/bin/python3 is 3.9 and too old.+modern() { "$1" -c 'import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)' >/dev/null 2>&1; }+find_python() {+ for candidate in python3.13 python3.12 python3.11 /opt/homebrew/bin/python3 /usr/local/bin/python3 python3; do+ found=$(command -v "$candidate" 2>/dev/null) || continue+ if modern "$found"; then echo "$found"; return 0; fi+ done+ return 1+}++echo "== Python packages -> $TOOLCHAIN/venv" >&2+# An environment from an older Python (or a broken earlier attempt) is replaced, never reused.+if [ -e "$TOOLCHAIN/venv" ] && ! modern "$TOOLCHAIN/venv/bin/python"; then+ echo "Replacing $TOOLCHAIN/venv: it is missing, broken or older than Python 3.11" >&2+ rm -rf "$TOOLCHAIN/venv"+fi+if [ ! -x "$TOOLCHAIN/venv/bin/python" ]; then+ if command -v uv >/dev/null 2>&1; then+ uv venv --python 3.12 "$TOOLCHAIN/venv" >&2+ elif PYTHON=$(find_python); then+ "$PYTHON" -m venv "$TOOLCHAIN/venv"+ else+ echo "Python 3.11 or newer is required and none was found (macOS's built-in python3 is 3.9)." >&2+ echo "Install one of them, then run this script again:" >&2+ echo " uv (manages its own Python): https://docs.astral.sh/uv/getting-started/installation/" >&2+ echo " or Homebrew Python: brew install [email protected]" >&2+ exit 4+ fi+fi+if ! { if command -v uv >/dev/null 2>&1; then uv pip install --python "$TOOLCHAIN/venv/bin/python" -r "$SCRIPTS/requirements.lock.txt" >&2+ else "$TOOLCHAIN/venv/bin/python" -m pip install --quiet -r "$SCRIPTS/requirements.lock.txt" >&2; fi; }; then+ echo "Installing the Python packages failed; fix the error above and run this script again (it resumes)." >&2+ exit 1+fi++if [ "$MODE" = full ]; then+ if [ ! -f "$TOOLCHAIN/effekseer/Effekseer1.80.7Win/Tool/bin/EffekseerCore.dll" ]; then+ echo "== Effekseer 1.80.7 (official release; only its managed Core assemblies are used)" >&2+ ARCHIVE="$TOOLCHAIN/downloads/Effekseer1.80.7Win.zip"+ fetch "$CORE_URL" "$CORE_SHA256" "$ARCHIVE"+ mkdir "$WORKDIR/effekseer"+ unzip -q "$ARCHIVE" -d "$WORKDIR/effekseer"+ rm -rf "$TOOLCHAIN/effekseer"+ mv "$WORKDIR/effekseer" "$TOOLCHAIN/effekseer"+ fi+ if [ ! -x "$TOOLCHAIN/dotnet/dotnet" ]; then+ echo "== .NET $DOTNET_VERSION runtime (official Microsoft archive)" >&2+ ARCHIVE="$TOOLCHAIN/downloads/dotnet-runtime-$DOTNET_VERSION-osx-arm64.tar.gz"+ fetch "$DOTNET_URL" "$DOTNET_SHA256" "$ARCHIVE"+ mkdir "$WORKDIR/dotnet"+ tar -xzf "$ARCHIVE" -C "$WORKDIR/dotnet"+ rm -rf "$TOOLCHAIN/dotnet"+ mv "$WORKDIR/dotnet" "$TOOLCHAIN/dotnet"+ fi+fi+sh "$SCRIPTS/vfx" doctordiff --git a/skills/effekseer-vfx/scripts/vfx b/skills/effekseer-vfx/scripts/vfxnew file mode 100755index 0000000..c77b84f--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfx@@ -0,0 +1,22 @@+#!/bin/sh+# effekseer-vfx command line. Run as `sh <skill>/scripts/vfx <command>`; `vfx --help` lists the commands.+# Uses the toolchain installed by setup.sh in EFFEKSEER_VFX_HOME (default ~/.cache/effekseer-vfx).+set -eu+SCRIPTS=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)+TOOLCHAIN=${EFFEKSEER_VFX_HOME:-$HOME/.cache/effekseer-vfx}+PYTHON="$TOOLCHAIN/venv/bin/python"+if [ ! -x "$PYTHON" ]; then+ # doctor and --help run on the system Python so an agent can find out what to install.+ PYTHON=$(command -v python3 || true)+ if [ -z "$PYTHON" ]; then+ echo '{"ok": false, "error": {"type": "SetupRequired", "message": "python3 is not installed"}}'+ exit 2+ fi+fi+export DOTNET_ROOT="$TOOLCHAIN/dotnet"+export EFFEKSEER_AI_BIN_DIR="$TOOLCHAIN/effekseer/Effekseer1.80.7Win/Tool/bin"+export PYTHONPATH="$SCRIPTS${PYTHONPATH:+:$PYTHONPATH}"+export PYTHONDONTWRITEBYTECODE=1+# Keep the current directory (the game project) off sys.path: a project file named like a module must not shadow it.+export PYTHONSAFEPATH=1+exec "$PYTHON" -m vfxkit "$@"diff --git a/skills/effekseer-vfx/scripts/vfxkit/__init__.py b/skills/effekseer-vfx/scripts/vfxkit/__init__.pynew file mode 100644index 0000000..ff2ad07--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/__init__.py@@ -0,0 +1,2 @@+"""effekseer-vfx toolchain: recipe primitives, lint, Core build, Godot review and evidence for one game project."""+__version__ = '0.1.0'diff --git a/skills/effekseer-vfx/scripts/vfxkit/__main__.py b/skills/effekseer-vfx/scripts/vfxkit/__main__.pynew file mode 100644index 0000000..56dada6--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/__main__.py@@ -0,0 +1,4 @@+import sys+from .cli import main++sys.exit(main())diff --git a/skills/effekseer-vfx/scripts/vfxkit/briefs.py b/skills/effekseer-vfx/scripts/vfxkit/briefs.pynew file mode 100644index 0000000..1589c28--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/briefs.py@@ -0,0 +1,121 @@+"""Design briefs (vfx/briefs/<ID>.json) live outside the strict Effekseer layer schema."""+import json+import math+from collections import Counter+from . import workflow+from .paths import ASSETS++FIELDS = {'schema_version', 'effect_id', 'role', 'style', 'dominant_shape', 'palette', 'delivery',+ 'anchor', 'reference', 'beats', 'layer_plan', 'acceptance', 'avoid'}+++def read(rid):+ path = workflow.ROOT / f'vfx/briefs/{workflow.effect_id(rid)}.json'+ return json.loads(path.read_text()) if path.is_file() else None+++def timeline(layers, parent_start=0, parent_end=0, prefix='', release=0):+ """Absolute first/last births, including parent emission intervals and random life."""+ rows = []+ for index, layer in enumerate(layers):+ name = layer['name']+ start = parent_start + layer.get('delay', 0)+ end = parent_end + layer.get('delay', 0) + (layer.get('count', 1) - 1) * layer.get('interval', 0)+ if layer.get('infinite'):+ end = parent_end + max(release, layer.get('delay', 0))+ life = layer.get('life', 24)+ life = max(life) if isinstance(life, (list, tuple)) else life+ path = prefix + str(index) + ':' + name+ rows.append({'name': name, 'path': path, 'start_frame': start,+ 'last_birth_frame': end, 'end_frame': end + life,+ 'sustained': bool(layer.get('infinite'))})+ rows.extend(timeline(layer.get('children', []), start, end, path + '/', release))+ return rows+++def validate(brief, recipe):+ errors, warnings = [], []+ if not isinstance(brief, dict):+ return {'ok': False, 'errors': ['Design brief is missing: write vfx/briefs/<ID>.json first (see references/design.md)'], 'warnings': []}+ from jsonschema import Draft202012Validator+ schema_path = ASSETS / 'brief.schema.json'+ if not schema_path.is_file():+ return {'ok': False, 'errors': ['Design brief schema is missing'], 'warnings': []}+ schema = json.loads(schema_path.read_text())+ schema_errors = list(Draft202012Validator(schema).iter_errors(brief))+ if schema_errors:+ return {'ok': False, 'errors': [f'{"/".join(map(str,e.absolute_path))}: {e.message}' for e in schema_errors], 'warnings': []}+ errors += [f'Missing field: {k}' for k in sorted(FIELDS - {'reference'} - set(brief))]+ errors += [f'Unknown field: {k}' for k in sorted(set(brief) - FIELDS)]+ if brief.get('schema_version') != 1:+ errors.append('schema_version must be 1')+ if brief.get('effect_id') != recipe['id']:+ errors.append('effect_id differs from recipe')+ if brief.get('delivery') != recipe.get('delivery'):+ errors.append('delivery differs from recipe')+ if brief.get('anchor') != recipe.get('attach'):+ errors.append('anchor differs from recipe')+ for key in ('role', 'style', 'dominant_shape'):+ if not isinstance(brief.get(key), str) or not brief[key].strip():+ errors.append(f'{key} needs a nonempty description')+ for key in ('acceptance', 'avoid'):+ value = brief.get(key)+ if not isinstance(value, list) or not value or any(not isinstance(v, str) or not v.strip() for v in value):+ errors.append(f'{key} needs observable descriptions')+ palette = brief.get('palette')+ if not isinstance(palette, dict) or not {'core', 'body', 'dark', 'matter'} <= set(palette):+ errors.append('palette needs core, body, dark and matter roles')+ elif any(not isinstance(c, list) or len(c) not in (3, 4) or+ any(type(v) is not int or not 0 <= v <= 255 for v in c) for c in palette.values()):+ errors.append('palette colors must be RGB or RGBA integer values 0..255')+ beats = brief.get('beats')+ if not isinstance(beats, list) or not beats:+ errors.append('beats needs at least one key moment')+ else:+ previous = -1+ for beat in beats:+ frame = beat.get('frame') if isinstance(beat, dict) else None+ if type(frame) is not int or not 0 <= frame <= math.ceil(recipe['duration'] * 60) + 12:+ errors.append('beat frame must be an absolute 60 FPS integer within effect + 12 frames')+ elif frame < previous:+ errors.append('beats must be ordered by frame')+ else:+ previous = frame+ if not isinstance(beat, dict) or not beat.get('name') or not beat.get('expect'):+ errors.append('each beat needs name and expect')+ rows = timeline(recipe['layers'], release=recipe.get('flight', 0)*60)+ duplicates = [n for n, c in Counter(r['path'] for r in rows).items() if c > 1]+ if duplicates:+ errors.append(f'Layer paths must be unique for brief association: {duplicates}')+ plans = brief.get('layer_plan')+ if not isinstance(plans, list) or not plans:+ errors.append('layer_plan needs at least one named layer')+ else:+ seen = set()+ for item in plans:+ if not isinstance(item, dict) or not {'name', 'role', 'primitive', 'exit'} <= set(item):+ errors.append('layer_plan entries need name, role, primitive and exit')+ continue+ if item['name'] in seen:+ errors.append(f'Duplicate layer_plan name: {item["name"]}')+ seen.add(item['name'])+ if item['name'] not in {r['path'] for r in rows}:+ errors.append(f'Unknown planned layer: {item["name"]}')+ unplanned = {r['path'] for r in rows} - seen+ if unplanned:+ warnings.append(f'Unplanned layers: {sorted(unplanned)}')+ reference = brief.get('reference')+ if reference is not None:+ if not isinstance(reference, dict) or not isinstance(reference.get('id'), str):+ errors.append('reference needs a reference id')+ return {'ok': not errors, 'errors': errors, 'warnings': warnings, 'timeline': rows}+++def keyframes(recipe, brief=None):+ end = math.ceil(recipe['duration'] * 60)+ peak = round(recipe.get('peak', 0) * 60)+ frames = {1, max(1, round(end * .3)), max(1, round(end * .65)), end, end + 6}+ frames.update(range(max(1, peak - 2), peak + 4))+ if brief:+ frames.update(b['frame'] for b in brief.get('beats', []) if type(b.get('frame')) is int and b['frame'] > 0)+ return sorted(f for f in frames if 0 < f <= end + 12)diff --git a/skills/effekseer-vfx/scripts/vfxkit/build.py b/skills/effekseer-vfx/scripts/vfxkit/build.pynew file mode 100644index 0000000..59af762--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/build.py@@ -0,0 +1,173 @@+"""Compile recipes through EffekseerCore into .efkefc sources, .efk runtime exports and the manifest."""+from pathlib import Path+import json, shutil, sys+from .workflow import locked+from .paths import ROOT, WORK+from .primitives import walk, tex, budget, TEXTURE_KEYS+from . import ownership+from .ownership import MARKER, valid_id, digest++RESOURCE_KEYS=TEXTURE_KEYS+['model'] # layer fields whose files Core copies into resources/ by base name+RESOURCE_DIRS=['effects/resources','exports/resources','godot/effects/resources']+# Every folder init or a build writes into or deletes from.+OUTPUT_DIRS=['src','briefs','work','materials','textures/procedural','textures/processed','previews','godot','effects','exports','recipes','godot/effects',*RESOURCE_DIRS]++def owned(entry):return ownership.owned(entry,ROOT,WORK)++def eid(entry):return entry.get('id') if isinstance(entry,dict) else None++def check_output_dirs():+ """Every folder init or a build writes into or deletes from must really be inside vfx/, also when it does not exist+ yet (its parent may be a symlink elsewhere)."""+ vfx=ROOT/'vfx'+ for folder in OUTPUT_DIRS:+ path=vfx/folder+ if not ownership.inside(path,vfx):raise ValueError(f'{path} resolves outside {vfx}; refusing to write or delete there')++def check_targets(paths):+ """No file a build is about to write may be a link that leads outside vfx/ (writes follow file symlinks)."""+ vfx=ROOT/'vfx'+ for path in paths:+ if (path.exists() or path.is_symlink()) and not ownership.inside(path,vfx):+ raise ValueError(f'{path} resolves outside {vfx}; refusing to overwrite it')++def removable(rid):+ """The outputs of one owned effect, refusing anything that resolves outside vfx/ (a symlinked folder, say)."""+ vfx=ROOT/'vfx'+ paths=[ROOT/f'vfx/effects/{rid}.efkefc',ROOT/f'vfx/exports/{rid}.efk',ROOT/f'vfx/recipes/{rid}.json',*(ROOT/'vfx/godot/effects').glob(f'{rid}.efkefc*')]+ safe=[]+ for path in paths:+ if not path.is_file():continue+ if not ownership.inside(path,vfx):raise ValueError(f'Refusing to delete {path}: it resolves outside {vfx}')+ safe.append(path)+ return safe++def resource_inputs(recipes):+ """{resource base name: source file} for every texture and model the recipes import.++ Core copies each into resources/ under its base name, so two different files with one name would silently replace+ each other inside every effect that uses it."""+ found={}+ for recipe in recipes:+ for layer in walk(recipe['layers']):+ for key in RESOURCE_KEYS:+ if layer.get(key):+ path=Path(layer[key]);name=path.name+ # Names that differ only in case are one file on a case-insensitive disk: their content must agree. Every+ # spelling is kept, because Core writes each under its own name and each must be mirrored and checked.+ for other in [n for n in found if ownership.same_name(n,name)]:+ if digest(found[other])!=digest(path):+ raise ValueError(f'Resource name conflict: {found[other]} and {path} are different files named {other} (names ignore case); rename one')+ found.setdefault(name,path)+ return found++def resource_names(rid):+ """Resource names a built effect uses, from its compiled recipe snapshot; None when that is unknown."""+ path=ROOT/f'vfx/recipes/{rid}.json'+ try:recipe=json.loads(path.read_text())+ except (OSError,ValueError):return None+ return {Path(layer[key]).name for layer in walk(recipe.get('layers',[])) for key in RESOURCE_KEYS if layer.get(key)}++def check_resource_conflicts(inputs,previous,rebuilding,removing):+ """Refuse to replace a resources/ file with different content while another effect may still use it: an owned effect+ that is neither rebuilt nor removed (per its recipe snapshot), or any effect this skill did not build."""+ unknown=ownership.unmanaged(ROOT,WORK,previous,ignore=rebuilding|removing)+ for name,source in inputs.items():+ if not any((ROOT/'vfx'/folder/name).is_file() and digest(ROOT/'vfx'/folder/name)!=digest(source) for folder in RESOURCE_DIRS):continue+ for entry in previous:+ rid=eid(entry)+ if not valid_id(rid) or rid in rebuilding or rid in removing or not owned(entry):continue+ names=resource_names(rid)+ if names is None or any(ownership.same_name(n,name) for n in names):+ raise ValueError(f'Resource name conflict: {source} would replace resources/{name}, which {rid} uses with different content; '+ f'rebuild them together (vfx build --ids {" ".join(sorted(rebuilding|{rid}))}) or rename the file')+ users=[f for f in unknown if ownership.may_use(f,name)]+ if users:+ shown=', '.join(str(f.relative_to(ROOT)) if f else 'an unowned manifest entry' for f in users)+ raise ValueError(f'Resource name conflict: {source} would replace resources/{name}, which an effect this skill did not build may use ({shown}); rename the file')++@locked+def build(recipes,prune=False):+ import copy+ from effekseer_ai.authoring import compile_effect+ recipes=copy.deepcopy(recipes)+ from .scaffold import initialize+ check_output_dirs() # before init writes the Lab into vfx/godot+ initialize()+ for recipe in recipes:+ for layer in walk(recipe['layers']):+ for key in TEXTURE_KEYS:+ if layer.get(key) and '/' not in layer[key]:layer[key]=tex(layer[key])+ missing=sorted({layer[key] for recipe in recipes for layer in walk(recipe['layers']) for key in TEXTURE_KEYS if layer.get(key) and not Path(layer[key]).is_file()})+ if missing:raise FileNotFoundError('Missing input textures; generate/process them first: '+', '.join(missing))+ check_output_dirs()+ manifest_path=ROOT/'vfx/vfx_manifest.json'+ previous=json.loads(manifest_path.read_text()) if manifest_path.is_file() else []+ rebuilding={r['id'] for r in recipes}+ # A full build (prune) drops effects this skill built whose source left vfx/src; decided before anything is written,+ # so those effects neither block the build nor survive it. Entries and files it did not build are never touched.+ removed=[eid(e) for e in previous if prune and eid(e) not in rebuilding and owned(e)]+ doomed=[path for rid in removed for path in removable(rid)] # every path checked before anything is deleted+ # Writes follow file symlinks: refuse targets that lead outside vfx/ before anything is written.+ check_targets([ROOT/f'vfx/{folder}/{r["id"]}{ext}' for r in recipes for folder,ext in+ (('recipes','.json'),('effects','.efkefc'),('exports','.efk'),('godot/effects','.efkefc'))]+ +[manifest_path,ROOT/'vfx/godot/vfx_manifest.json'])+ # Same-named resources: within this build, and against what other effects already use from resources/.+ inputs=resource_inputs(recipes)+ check_targets([ROOT/'vfx'/folder/name for name in inputs for folder in RESOURCE_DIRS])+ check_resource_conflicts(inputs,previous,rebuilding,set(removed))+ # Static rules first: unknown fields, lifetimes past duration, budgets, units. Fails before any Core work.+ from .lint import lint_library+ checked=lint_library(recipes)+ if not checked['ok']:raise ValueError('Recipe lint failed: '+json.dumps(checked['errors'],ensure_ascii=False))+ if checked['warnings']:print(json.dumps({'lint_warnings':checked['warnings']},ensure_ascii=False),file=sys.stderr,flush=True)+ target=ROOT/'vfx/godot/effects'; target.mkdir(parents=True,exist_ok=True)+ built={}; compiled={}+ for recipe in recipes:+ for layer in walk(recipe['layers']):+ profile={'Add':'M_Additive','Blend':'M_Alpha','Sub':'M_Subtractive'}.get(layer.get('blend','Add'))+ if profile:layer['material_profile']=str(ROOT/f'vfx/materials/{profile}.vfxmat.json')+ rid=recipe['id']; source=ROOT/f'vfx/effects/{rid}.efkefc'; runtime=ROOT/f'vfx/exports/{rid}.efk'+ (ROOT/'vfx/recipes').mkdir(exist_ok=True)+ # Portable recipes: texture paths relative to workspace, normalized at load time.+ saved=json.loads(json.dumps(recipe).replace(str(ROOT)+'/',''))+ (ROOT/f'vfx/recipes/{rid}.json').write_text(json.dumps(saved,indent=2))+ report=compile_effect(recipe,source,runtime)+ compiled[rid]=report+ shutil.copy2(source,target/source.name)+ entry={k:v for k,v in recipe.items() if k!='layers'}+ # `built_by` + `source` mark the entry as built by this skill: only such entries are ever pruned.+ entry.update(built_by=MARKER,source=f'vfx/src/{rid}.py',file='res://effects/'+source.name,runtime='exports/'+runtime.name,preview='previews/'+rid+'.png',particle_budget=sum(budget(l) for l in recipe['layers']),layers=len(list(walk(recipe['layers']))))+ built[rid]=entry; print(json.dumps({k:v for k,v in report.items() if k!='nodes'}),file=sys.stderr,flush=True)+ # A partial build updates its entries in place; a full build also removes the effects planned above.+ built_ids=set(built)+ manifest=[built.pop(eid(e),e) for e in previous if eid(e) not in removed]+list(built.values())+ for path in doomed:path.unlink()+ # Resource copies no recipe references any more would otherwise ship with every export. Only exact copies of a+ # processed texture (and that PNG's own .import file), and never a name an effect this skill did not build may use.+ if prune:+ unknown=ownership.unmanaged(ROOT,WORK,manifest,ignore=built_ids)+ used={ownership.name_key(Path(layer[key]).name) for recipe in recipes for layer in walk(recipe['layers']) for key in RESOURCE_KEYS if layer.get(key)}+ candidates=[]+ for processed in sorted((ROOT/'vfx/textures/processed').glob('*.png')):+ name=processed.name+ if ownership.name_key(name) in used or any(ownership.may_use(f,name) for f in unknown):continue+ for folder in RESOURCE_DIRS:+ png=ROOT/'vfx'/folder/name; imported=ROOT/'vfx'/folder/(name+'.import')+ if png.is_file():+ if digest(png)!=digest(processed):continue # same name, other content: not our copy+ candidates.append(png)+ # The PNG's own import file goes with it, or alone when the PNG itself is already gone.+ if imported.is_file() and (png in candidates or not png.exists()):candidates.append(imported)+ for path in candidates:+ if not ownership.inside(path,ROOT/'vfx'):raise ValueError(f'Refusing to delete {path}: it resolves outside vfx/')+ for path in candidates:path.unlink()+ # Mirror only the resources this build imported (checked above), never the whole folder: other effects' files stay.+ for name in inputs:+ for folder in ('exports/resources','godot/effects/resources'):+ (ROOT/'vfx'/folder).mkdir(parents=True,exist_ok=True)+ shutil.copy2(ROOT/'vfx/effects/resources'/name,ROOT/'vfx'/folder/name)+ for dst in [manifest_path,ROOT/'vfx/godot/vfx_manifest.json']:dst.write_text(json.dumps(manifest,indent=2))+ from .evidence import write_build+ for recipe in recipes:write_build(recipe,compiled[recipe['id']])+ return manifestdiff --git a/skills/effekseer-vfx/scripts/vfxkit/cli.py b/skills/effekseer-vfx/scripts/vfxkit/cli.pynew file mode 100644index 0000000..8414cd1--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/cli.py@@ -0,0 +1,318 @@+"""effekseer-vfx command line: one JSON object on stdout per command; progress and warnings go to stderr.++Exit codes: 0 ok, 1 failed check or error (the JSON says which), 2 setup required (toolchain or vfx init).+Images (strips, comparisons, key frames, texture previews) are returned as file paths: open them and look.+"""+import argparse+import json+import os+import sys+from pathlib import Path++COMMANDS = """+setup and workspace: doctor, init, examples, procedural+authoring (no Core): list, lint, layer-schema, texture-info, texture-audit, process-texture, brief-validate, effect-context+build (Core, macOS): build, compile, export, discover, core+review (Godot): review, overview, strip, frames, history, rubric, review-handoff, review-submit, effect-verify, preview, showcase, package+reference clips: reference-import, reference-frames, reference-compare+"""+++def parser():+ p = argparse.ArgumentParser(prog='vfx', description=__doc__ + COMMANDS, formatter_class=argparse.RawDescriptionHelpFormatter)+ p.add_argument('--project', help='game project that holds (or will hold) the vfx/ workspace; default: VFX_PROJECT or the current directory')+ sub = p.add_subparsers(dest='command', required=True)+ sub.add_parser('doctor', help='platform, toolchain and workspace status; which modes are available')+ a = sub.add_parser('init', help='create or refresh vfx/ (Lab, materials, math textures, Godot plugin)')+ a.add_argument('--update-templates', action='store_true', help='overwrite the Lab and materials with the skill version')+ a.add_argument('--no-plugin', action='store_true', help='skip downloading the Effekseer Godot plugin')+ a = sub.add_parser('examples', help='list, show or add the shipped example effects')+ a.add_argument('action', nargs='?', choices=['list', 'show', 'add'], default='list')+ a.add_argument('name', nargs='?', help='example name from `vfx examples list` (a pair such as fire, or a single kind such as hit), an effect ID, or all')+ a.add_argument('--force', action='store_true', help='overwrite existing files when adding')+ sub.add_parser('procedural', help='regenerate the math-primitive textures')+ sub.add_parser('list', help='effects in vfx/src with category, timing, design note and build state')+ a = sub.add_parser('lint', help='static recipe checks; build refuses to run while errors exist')+ a.add_argument('--ids', nargs='*'); a.add_argument('--timeline', action='store_true', help='include per-layer start/end frames')+ sub.add_parser('layer-schema', help='every layer field the compiler accepts')+ a = sub.add_parser('texture-info', help='measured coverage, bbox, border contact, orientation and bulge of processed textures')+ a.add_argument('names', nargs='*')+ a = sub.add_parser('texture-audit', help='role-aware texture or flipbook checks plus a preview image')+ a.add_argument('name'); a.add_argument('--role', default='shape'); a.add_argument('--grid', type=int, nargs=2)+ a.add_argument('--loop', action='store_true'); a.add_argument('--allow-empty', type=int, nargs='*')+ a = sub.add_parser('process-texture', help='crop, luminance alpha, padding and power-of-two resize of a generated image')+ a.add_argument('source'); a.add_argument('output'); a.add_argument('--size', type=int, default=256)+ a.add_argument('--color', action='store_true', help='keep colour (straight RGBA) instead of a white mask')+ a.add_argument('--grid', type=int, nargs=2, metavar=('COLS', 'ROWS'), help='flipbook sheet: keep the cell layout instead of cropping')+ for name, text in [('brief-validate', 'check vfx/briefs/<ID>.json against the recipe'), ('effect-context', 'brief, build state, latest evidence and recent rounds of one effect')]:+ a = sub.add_parser(name, help=text); a.add_argument('id')+ a = sub.add_parser('build', help='compile effects through EffekseerCore (runs lint first)')+ a.add_argument('--ids', nargs='*', help='only these; without --ids the whole library is rebuilt and stale outputs pruned')+ a = sub.add_parser('compile', help='compile one recipe JSON file')+ a.add_argument('recipe'); a.add_argument('--source'); a.add_argument('--runtime')+ a = sub.add_parser('export', help='re-export every built effect to .efk with its resources')+ a.add_argument('--output')+ sub.add_parser('discover', help='dump Core property paths, types and enums (for extending the compiler)')+ # Parsed by the vendored bridge itself (see main); listed here for --help.+ sub.add_parser('core', help='low-level Core document commands on an .efkefc: property-list, property-get, property-set, node-list, curve-list, ... (`vfx core --help`)')+ a = sub.add_parser('review', help='render filmstrips in the Godot Lab; returns strips, flags, changes and an evidence ID')+ a.add_argument('--ids', nargs='*'); a.add_argument('--step', type=int, default=4); a.add_argument('--bright', action='store_true')+ a.add_argument('--note', default='', help='what changed this round; stored in the iteration history')+ a.add_argument('--key-frames', type=int, nargs='*'); a.add_argument('--view', choices=['standard', 'close'], default='standard')+ a.add_argument('--profile', choices=['default', 'bare'], default='default'); a.add_argument('--output')+ a = sub.add_parser('overview', help='tile the latest standard captures into overview pages')+ a.add_argument('--ids', nargs='*', help='a scratch page of only these effects; it does not count for effect-verify')+ a = sub.add_parser('strip', help='path of the last strip (or BEFORE/AFTER comparison) plus its stored metrics')+ a.add_argument('id'); a.add_argument('--compare', action='store_true'); a.add_argument('--bright', action='store_true')+ a = sub.add_parser('frames', help='full-size frame paths of one capture, for detail review')+ a.add_argument('evidence_id'); a.add_argument('frames', type=int, nargs='+')+ a = sub.add_parser('history', help='recent review rounds of one effect, newest last')+ a.add_argument('id'); a.add_argument('--limit', type=int, default=10)+ sub.add_parser('rubric', help='the independent reviewer rubric')+ a = sub.add_parser('review-handoff', help='write the complete brief for an independent reviewer of the latest capture')+ a.add_argument('id')+ a = sub.add_parser('review-submit', help='bind an independent reviewer report to a capture')+ a.add_argument('evidence_id'); a.add_argument('report', help='path of the reviewer JSON report')+ a.add_argument('--reviewer', required=True)+ a.add_argument('--frames', type=int, nargs='+', help="frames the reviewer looked at (default: the report's observed_frames)")+ a = sub.add_parser('effect-verify', help='is the current build captured, independently reviewed and in the overview?')+ a.add_argument('id'); a.add_argument('--no-overview', action='store_true')+ a = sub.add_parser('preview', help='UI screenshots (baseline, peak, 50%%, 85%%)')+ a.add_argument('--ids', nargs='*'); a.add_argument('--bright', action='store_true'); a.add_argument('--output')+ a = sub.add_parser('showcase', help='open the Lab and auto-play the library'); a.add_argument('--movie', action='store_true')+ a = sub.add_parser('package', help='zip the Godot project with an inventory; never claims device tests'); a.add_argument('--preview-dir')+ a = sub.add_parser('reference-import', help='decode a local reference clip (at most 30 media seconds)')+ a.add_argument('source'); a.add_argument('--start', type=float, default=0); a.add_argument('--end', type=float)+ a.add_argument('--slow', type=float, default=1, help='slow-motion factor of the clip; 2 means half speed')+ a.add_argument('--roi', type=int, nargs=4); a.add_argument('--source-url', default=''); a.add_argument('--fps', type=int, default=12)+ a = sub.add_parser('reference-frames', help='labelled frames of one span of a stored reference')+ a.add_argument('reference_id'); a.add_argument('start', type=float); a.add_argument('end', type=float); a.add_argument('--count', type=int, default=12)+ a = sub.add_parser('reference-compare', help='pair reference times with captured Godot frames')+ a.add_argument('reference_id'); a.add_argument('evidence_id'); a.add_argument('--times', type=float, nargs='+', required=True)+ a.add_argument('--reference-times', type=float, nargs='+')+ return p+++def recipes_for(ids):+ """(selected, context, unloaded): with --ids only the named sources must load; a full run needs every source."""+ from .library import library, partial+ if ids:+ return partial(ids)+ everything = library()+ if not everything:+ raise ValueError('No recipes in vfx/src; write one or run vfx examples add <pair>. Nothing was built or pruned.')+ return everything, everything, {}+++def run(args):+ c = args.command+ if c == 'doctor':+ from .doctor import doctor+ return doctor()+ from .paths import ROOT, WORKSPACE+ if c == 'init':+ from .scaffold import initialize+ return initialize(install_plugin=not args.no_plugin, update_templates=args.update_templates)+ if c == 'examples':+ from . import examples+ if args.action == 'list':+ return examples.listing()+ if not args.name:+ raise ValueError('Name an example: vfx examples ' + args.action + ' <pair|ID|all>')+ if args.action == 'add':+ return examples.add(args.name, args.force)+ return examples.show_any(args.name)+ if c == 'procedural':+ from .textures import procedural+ return {'ok': True, 'generated': procedural()}+ if c == 'list':+ from .library import partial+ built = {e['id'] for e in json.loads((WORKSPACE / 'vfx_manifest.json').read_text())} if (WORKSPACE / 'vfx_manifest.json').is_file() else set()+ _, loaded, unloaded = partial()+ result = {'ok': True, 'effects': [{k: r.get(k) for k in ['id', 'category', 'element', 'duration', 'peak', 'impact', 'delivery', 'design']} | {'built': r['id'] in built} for r in loaded]}+ if unloaded:+ result['unloaded'] = unloaded+ return result+ if c == 'lint':+ from .lint import lint_library+ selected, everything, unloaded = recipes_for(args.ids)+ result = lint_library(selected, everything)+ if unloaded:+ result['unloaded'] = unloaded+ if not args.timeline:+ result.pop('reports')+ return result+ if c == 'layer-schema':+ from effekseer_ai.authoring import layer_schema+ return {'ok': True, **layer_schema()}+ if c == 'texture-info':+ from .textures import inspect, inspect_all+ if not args.names:+ return inspect_all()+ return {n: inspect(Path(n) if n.endswith('.png') else ROOT / f'vfx/textures/processed/{n}.png') for n in args.names}+ if c == 'texture-audit':+ from .texture_audit import audit+ return audit(args.name, args.role, args.grid, args.loop, args.allow_empty)+ if c == 'process-texture':+ from effekseer_ai.resources import process_texture+ return process_texture(args.source, args.output, args.size, mask=not args.color, grid=tuple(args.grid) if args.grid else None)+ if c in ('brief-validate', 'effect-context', 'effect-verify', 'review-submit'):+ from . import evidence, briefs+ if c == 'brief-validate':+ return briefs.validate(briefs.read(args.id), evidence.current_recipe(args.id))+ if c == 'effect-context':+ return evidence.context(args.id)+ if c == 'effect-verify':+ return evidence.verify(args.id, not args.no_overview)+ report = json.loads(Path(args.report).read_text())+ return evidence.submit(args.evidence_id, args.reviewer, report, args.frames or report.get('observed_frames'))+ if c == 'review-handoff':+ from .handoff import handoff+ return handoff(args.id)+ if c == 'build':+ from .build import build+ selected, _, unloaded = recipes_for(args.ids)+ # A full build prunes effects this skill built whose source left vfx/src; --ids rebuilds only the named ones.+ manifest = build(selected, prune=not args.ids)+ result = {'ok': True, 'effects': len(manifest), 'built': [r['id'] for r in selected]}+ if unloaded:+ result['unloaded'] = unloaded+ return result+ if c == 'compile':+ from effekseer_ai.authoring import compile_effect+ recipe = json.loads(Path(args.recipe).read_text())++ def resolve(layers):+ for layer in layers:+ for field in ['texture', 'alpha_texture', 'distortion_texture', 'blend_texture', 'model', 'material_profile']:+ if layer.get(field):+ layer[field] = str((ROOT / layer[field]).resolve())+ resolve(layer.get('children', []))+ resolve(recipe['layers'])+ rid = recipe.get('id', Path(args.recipe).stem)+ return compile_effect(recipe, Path(args.source or ROOT / f'vfx/effects/{rid}.efkefc'), Path(args.runtime or ROOT / f'vfx/exports/{rid}.efk'))+ if c == 'export':+ from shutil import copytree+ from effekseer_ai.session import EffectSession+ out = Path(args.output or WORKSPACE / 'exports').resolve()+ result = {'ok': True, 'exports': []}+ for entry in json.loads((WORKSPACE / 'vfx_manifest.json').read_text()):+ source = WORKSPACE / f'effects/{entry["id"]}.efkefc'+ target = out / (source.stem + '.efk')+ EffectSession.open(source).export(target)+ result['exports'].append(str(target))+ copytree(WORKSPACE / 'effects/resources', out / 'resources', dirs_exist_ok=True)+ return result+ if c == 'discover':+ from .discover import discover+ return discover()+ if c == 'review':+ from .review import capture+ return capture(args.ids, args.step, args.bright, output=args.output, note=args.note, key_frames=args.key_frames, view=args.view, profile=args.profile)+ if c == 'overview':+ from .review import overview+ return overview(args.ids)+ if c == 'strip':+ strips = WORKSPACE / 'previews/strips'+ name = args.id + ('_bright' if args.bright else '') + ('_compare' if args.compare else '')+ path = strips / f'{name}.png'+ if not path.is_file():+ raise FileNotFoundError(f'No strip named {path.name}; run vfx review --ids {args.id} first')+ stored = strips / ('metrics_bright.json' if args.bright else 'metrics.json')+ entry = json.loads(stored.read_text()).get(args.id, {}) if stored.is_file() else {}+ return {'ok': True, 'image': str(path), 'metrics': {k: v for k, v in entry.items() if k != 'timeline'}}+ if c == 'frames':+ from . import evidence, workflow+ record = evidence.read_capture(args.evidence_id)+ available = {int(Path(p).stem.rsplit('_f', 1)[1]): p for p in record['frames']}+ missing = [f for f in args.frames if f not in available]+ if missing:+ raise ValueError(f'Frames {missing} were not captured; available: {sorted(available)}')+ return {'ok': True, 'evidence_id': args.evidence_id, 'issues': evidence.capture_issues(record),+ 'images': [str(workflow.absolute(available[f])) for f in args.frames]}+ if c == 'history':+ path = WORKSPACE / f'previews/strips/history/{args.id}.jsonl'+ lines = path.read_text().splitlines()[-args.limit:] if path.is_file() else []+ return {'ok': True, 'rounds': [json.loads(line) for line in lines]}+ if c == 'rubric':+ from .paths import ASSETS+ return {'ok': True, **json.loads((ASSETS / 'review_rubric.json').read_text())}+ if c == 'preview':+ from effekseer_ai.preview import preview_effects+ from .paths import godot+ report = preview_effects(str(WORKSPACE / 'godot'), args.output or str(WORKSPACE / 'previews'), args.ids, args.bright, godot=godot())+ return {key: report[key] for key in ['ok', 'output', 'count']}+ if c == 'showcase':+ import subprocess+ from .paths import godot+ movie = WORKSPACE / 'previews/vfx_showcase'+ cmd = [godot(), '--path', str(WORKSPACE / 'godot')]+ if args.movie:+ cmd += ['--write-movie', str(movie.with_suffix('.avi')), '--fixed-fps', '60']+ cmd += ['--', '--showcase'] + (['--movie'] if args.movie else [])+ subprocess.run(cmd, check=True)+ if args.movie:+ # Baseline profile, no B-frames, single thread: the MP4 plays on old phones and in every browser.+ subprocess.run(['ffmpeg', '-y', '-i', str(movie.with_suffix('.avi')), '-c:v', 'libx264', '-preset', 'fast', '-crf', '18',+ '-threads', '1', '-profile:v', 'baseline', '-level:v', '4.2', '-bf', '0', '-pix_fmt', 'yuv420p', '-an',+ str(movie.with_suffix('.mp4'))], check=True)+ return {'ok': True, 'movie': str(movie.with_suffix('.mp4')) if args.movie else None}+ if c == 'package':+ from .finalize import finalize+ return finalize(args.preview_dir)+ from . import reference+ if c == 'reference-import':+ result = reference.import_clip(args.source, args.start, args.end, args.slow, args.roi, args.source_url, args.fps)+ return {k: v for k, v in result.items() if k not in ('frames', 'times')}+ if c == 'reference-frames':+ return reference.frames(args.reference_id, args.start, args.end, args.count)+ if c == 'reference-compare':+ return reference.compare(args.reference_id, args.evidence_id, args.times, args.reference_times)+ raise ValueError(f'Unknown command {c}')+++# Commands that work before `vfx init`: they create the workspace, read only the skill, or take explicit file paths.+WITHOUT_WORKSPACE = {'doctor', 'init', 'examples', 'rubric', 'layer-schema', 'process-texture', 'core'}+++def main(argv=None):+ raw = list(sys.argv[1:] if argv is None else argv)+ rest = raw[2:] if raw[:1] == ['--project'] else raw+ if rest[:1] == ['core']:+ # The vendored bridge's own command line (explicit file paths, its own JSON output and exit codes), passed through+ # untouched so its options such as --help are not taken by this parser.+ try:+ from effekseer_ai.cli import main as core_main+ except ModuleNotFoundError as error:+ print(json.dumps({'ok': False, 'error': {'type': 'SetupRequired', 'message': f'{error}. Run scripts/setup.sh.'}}))+ return 2+ try:+ return core_main(rest[1:] or ['--help'])+ except SystemExit as done: # argparse --help / usage errors+ return done.code if isinstance(done.code, int) else 1+ args = parser().parse_args(raw)+ if args.project:+ os.environ['VFX_PROJECT'] = str(Path(args.project).expanduser().resolve())+ from .paths import ROOT, initialized+ if args.command not in WITHOUT_WORKSPACE and not initialized():+ # Never create vfx/ as a side effect of a read: in the wrong folder that leaves a stray workspace behind.+ print(json.dumps({'ok': False, 'error': {'type': 'WorkspaceMissing', 'message':+ f'No effekseer-vfx workspace in {ROOT} (expected vfx/src and vfx/vfx_manifest.json). '+ 'Run the command from the game project, pass --project <game project>, or run vfx init there first.'}}, ensure_ascii=False))+ return 2+ try:+ if args.command not in ('doctor', 'examples', 'rubric', 'layer-schema', 'process-texture'):+ from .workflow import project_lock+ with project_lock():+ result = run(args)+ else:+ result = run(args)+ except ModuleNotFoundError as error:+ print(json.dumps({'ok': False, 'error': {'type': 'SetupRequired', 'message': f'{error}. Run scripts/setup.sh (add --authoring-only off macOS).'}}))+ return 2+ except Exception as error:+ print(json.dumps({'ok': False, 'error': {'type': type(error).__name__, 'message': str(error)}}, ensure_ascii=False))+ return 1+ print(json.dumps(result, ensure_ascii=False, default=str))+ failed = isinstance(result, dict) and (result.get('ok') is False or (args.command == 'effect-verify' and not result.get('verified')))+ return 1 if failed else 0diff --git a/skills/effekseer-vfx/scripts/vfxkit/discover.py b/skills/effekseer-vfx/scripts/vfxkit/discover.pynew file mode 100644index 0000000..2b45cc2--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/discover.py@@ -0,0 +1,25 @@+"""Dump every Core property path of a fresh node with its type and enum values, for extending the layer compiler."""+import json+from .paths import WORK+++def discover():+ from effekseer_ai.session import EffectSession+ from System import Enum+ s = EffectSession.new()+ p = 'node/root/0'+ result = {}+ for x in s.property_list(p, 12):+ try:+ o = s._object_at_path(x)+ v = s.property_get(x)+ typ = o.GetType() if hasattr(o, 'GetType') else None+ result[x.removeprefix(p + '/')] = {'value': v, 'type': str(typ)}+ if typ and typ.IsEnum:+ result[x.removeprefix(p + '/')]['enum'] = {str(n): int(Enum.Parse(typ, n)) for n in Enum.GetNames(typ)}+ except Exception as e:+ result[x.removeprefix(p + '/')] = {'error': str(e)}+ path = WORK / 'property_schema.json'+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text(json.dumps(result, indent=2, default=str))+ return {'ok': True, 'properties': len(result), 'schema': str(path)}diff --git a/skills/effekseer-vfx/scripts/vfxkit/doctor.py b/skills/effekseer-vfx/scripts/vfxkit/doctor.pynew file mode 100644index 0000000..592c93f--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/doctor.py@@ -0,0 +1,79 @@+"""What this machine can do right now. Standard library only, so it runs before setup."""+import importlib.util+import json+import platform+import shutil+import subprocess+import sys+from .paths import ROOT, WORKSPACE, WORK, HOME, CORE_BIN, SKILL, godot, initialized+from .ownership import owned, unmanaged+++def version(command):+ try:+ return subprocess.run(command, capture_output=True, text=True, timeout=20).stdout.strip().splitlines()[0]+ except (OSError, subprocess.SubprocessError, IndexError):+ return None+++def setup_python():+ """What setup.sh would use for the toolchain: uv, else a Python 3.11+ (same search order as setup.sh)."""+ if shutil.which('uv'):+ return 'uv'+ for candidate in ('python3.13', 'python3.12', 'python3.11', '/opt/homebrew/bin/python3', '/usr/local/bin/python3', 'python3'):+ found = shutil.which(candidate)+ if found:+ try:+ ok = subprocess.run([found, '-c', 'import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)'],+ capture_output=True, timeout=20).returncode == 0+ except (OSError, subprocess.SubprocessError):+ ok = False+ if ok:+ return found+ return None+++def doctor():+ mac_arm = sys.platform == 'darwin' and platform.machine() == 'arm64'+ python_deps = {m: importlib.util.find_spec(m) is not None for m in ('numpy', 'PIL', 'jsonschema', 'clr_loader')}+ dotnet = HOME / 'dotnet/dotnet'+ godot_cmd = godot()+ godot_version = version([godot_cmd, '--version']) if shutil.which(godot_cmd) or godot_cmd.startswith('/') else None+ core = (CORE_BIN / 'EffekseerCore.dll').is_file()+ authoring = all(python_deps[m] for m in ('numpy', 'PIL', 'jsonschema'))+ build = authoring and python_deps['clr_loader'] and core and dotnet.is_file()+ render = build and bool(godot_version)+ manifest = WORKSPACE / 'vfx_manifest.json'+ entries = json.loads(manifest.read_text()) if manifest.is_file() else []+ workspace = {'path': str(WORKSPACE), 'initialized': initialized(),+ 'effects': len(list((WORKSPACE / 'src').glob('VFX_*.py'))) if (WORKSPACE / 'src').is_dir() else 0,+ 'built': sum(1 for e in entries if owned(e, ROOT, WORK)),+ # Effects this skill did not build (unowned manifest entries and stray .efkefc files): left alone.+ 'unmanaged': len(unmanaged(ROOT, WORK, entries)) if WORKSPACE.is_dir() else 0}+ next_steps = []+ installer = setup_python() if not authoring else None+ if not authoring and not installer:+ next_steps.append('setup needs Python 3.11+ or uv, and neither was found (macOS ships Python 3.9): ask the user to '+ 'install uv (https://docs.astral.sh/uv/getting-started/installation/) or `brew install [email protected]`')+ if not authoring:+ next_steps.append(f'sh {SKILL}/scripts/setup.sh' + ('' if mac_arm else ' --authoring-only'))+ elif mac_arm and not build:+ next_steps.append(f'sh {SKILL}/scripts/setup.sh (downloads Effekseer Core and the .NET runtime)')+ if mac_arm and authoring and not godot_version:+ next_steps.append('install Godot 4.x (Forward+) and put it on PATH or set GODOT')+ if WORKSPACE.is_dir() and not workspace['initialized']:+ next_steps.append(f'{WORKSPACE} exists but was not created by vfx init: check this is the game project (or pass --project) '+ 'before running vfx init here; init only adds files, and builds never touch effects they did not build')+ if authoring and not workspace['initialized']:+ next_steps.append('vfx init' + ('' if render else ' --no-plugin'))+ return {'ok': True,+ 'platform': {'system': platform.system(), 'machine': platform.machine(), 'python': platform.python_version(),+ 'full_mode_supported': mac_arm},+ 'modes': {'authoring': authoring, 'build': build, 'render': render},+ 'toolchain': {'home': str(HOME), 'python_packages': python_deps, 'setup_python': installer if not authoring else 'installed', 'effekseer_core': core, 'dotnet': dotnet.is_file(),+ 'godot': godot_version, 'ffmpeg': bool(shutil.which('ffmpeg'))},+ 'project': str(ROOT), 'workspace': workspace,+ 'note': 'authoring = write recipes, lint, textures and briefs; build = compile through EffekseerCore; render = Godot review strips. '+ 'Build and render are verified on macOS ARM64 only. render: true means Godot was found; review still needs a window '+ 'on the logged-in desktop, so a sandboxed agent must run review/preview/showcase outside its sandbox.',+ 'next': next_steps}diff --git a/skills/effekseer-vfx/scripts/vfxkit/evidence.py b/skills/effekseer-vfx/scripts/vfxkit/evidence.pynew file mode 100644index 0000000..97375a3--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/evidence.py@@ -0,0 +1,286 @@+"""Bind builds, real captures and independent reports to the state they describe.++These records attest to checks actually performed by the pipeline, not artistic quality+or reviewer independence. The host must arrange an independent reviewer.+"""+import copy+from datetime import datetime, timezone+import json+from pathlib import Path+import subprocess+import uuid+from . import workflow+from .paths import ASSETS, SCRIPTS, CORE_BIN++RUBRIC = ASSETS / 'review_rubric.json'+LAB = ASSETS / 'godot-lab'+++def now():+ return datetime.now(timezone.utc).isoformat()+++def store():+ return workflow.WORK+++def current_recipe(rid):+ workflow.effect_id(rid)+ from . import library+ return library.get(rid)+++def prepared(recipe):+ from .primitives import walk, TEXTURE_KEYS+ result = copy.deepcopy(recipe)+ for layer in walk(result['layers']):+ for key in TEXTURE_KEYS:+ if layer.get(key) and '/' not in layer[key]:+ layer[key] = str(workflow.ROOT / f'vfx/textures/processed/{layer[key]}.png')+ profile = {'Add': 'M_Additive', 'Blend': 'M_Alpha', 'Sub': 'M_Subtractive'}.get(layer.get('blend', 'Add'))+ if profile:+ layer['material_profile'] = str(workflow.ROOT / f'vfx/materials/{profile}.vfxmat.json')+ return result+++def portable(value):+ if isinstance(value, dict):+ return {k: portable(v) for k, v in value.items()}+ if isinstance(value, (list, tuple)):+ return [portable(v) for v in value]+ if isinstance(value, str) and value.startswith(str(workflow.ROOT) + '/'):+ return value[len(str(workflow.ROOT)) + 1:]+ return value+++def inputs(recipe):+ from .primitives import walk+ result = prepared(recipe)+ paths = []+ for layer in walk(result['layers']):+ for key in ('texture', 'alpha_texture', 'distortion_texture', 'blend_texture', 'model', 'material_profile'):+ if layer.get(key):+ p = Path(layer[key])+ paths.append(p if p.is_absolute() else workflow.ROOT / p)+ paths += list((SCRIPTS / 'effekseer_ai').glob('*.py'))+ paths += [SCRIPTS / 'vfxkit' / n for n in ('primitives.py', 'build.py', 'lint.py')] + [SCRIPTS / 'vfx']+ paths += list(CORE_BIN.glob('Effekseer*.dll'))+ return {'recipe_sha256': workflow.digest(portable(result)), 'files': workflow.snapshot(paths)}+++def outputs(rid):+ root = workflow.ROOT+ return [root / f'vfx/recipes/{rid}.json', root / f'vfx/effects/{rid}.efkefc', root / f'vfx/exports/{rid}.efk',+ root / f'vfx/godot/effects/{rid}.efkefc']+++def write_build(recipe, compile_report):+ rid = workflow.effect_id(recipe['id'])+ if not compile_report.get('source') or compile_report.get('writes', 0) <= 0:+ raise ValueError('A successful Core save/open report is required')+ state = inputs(recipe)+ copies = []+ # Every imported texture and model, wherever it came from, is copied into the three resources/ folders by base+ # name; bind all of those copies, so another build that replaces a same-named resource makes this one stale.+ from .primitives import walk+ from .build import RESOURCE_KEYS+ for layer in walk(recipe['layers']):+ for key in RESOURCE_KEYS:+ if not layer.get(key):+ continue+ source = Path(layer[key]) if Path(layer[key]).is_absolute() else workflow.ROOT / layer[key]+ name = source.name+ for folder in ('effects', 'exports', 'godot/effects'):+ copied = workflow.ROOT / f'vfx/{folder}/resources/{name}'+ if workflow.file_hash(copied) != workflow.file_hash(source):+ raise ValueError(f'Built resource copy differs from input: {folder}/resources/{name}')+ copies.append(copied)+ record = {'schema_version': 1, 'effect_id': rid, 'build_id': uuid.uuid4().hex,+ 'time': now(), 'inputs': state, 'outputs': workflow.snapshot(outputs(rid) + copies),+ 'readback': {'verified': True, 'writes': compile_report['writes']}}+ if not workflow.unchanged(record['outputs']):+ raise ValueError('Build outputs are missing')+ workflow.save_json(store() / f'builds/{rid}.json', record)+ return record+++def read_build(rid):+ path = store() / f'builds/{workflow.effect_id(rid)}.json'+ return json.loads(path.read_text()) if path.is_file() else None+++def build_issues(rid, recipe=None):+ receipt = read_build(rid)+ if not receipt:+ return ['missing_build_receipt']+ issues = []+ if receipt['inputs'] != inputs(recipe or current_recipe(rid)):+ issues.append('build_inputs_changed')+ if not workflow.unchanged(receipt['outputs']):+ issues.append('build_outputs_changed')+ if receipt.get('readback', {}).get('verified') is not True:+ issues.append('missing_core_readback')+ return issues+++def stage_snapshot():+ paths = []+ for folder in (LAB, workflow.ROOT / 'vfx/godot'):+ paths.extend(p for p in folder.rglob('*') if p.is_file()+ and '.godot' not in p.relative_to(folder).parts+ and (p.suffix in ('.gd', '.gdshader', '.godot', '.tscn', '.gde', '.gdextension', '.dylib', '.glb', '.json', '.cfg') or p.name == 'libeffekseer')+ and 'effects' not in p.relative_to(folder).parts+ and p.name != 'vfx_manifest.json')+ paths += [SCRIPTS / 'vfxkit' / n for n in ('review.py', 'briefs.py', 'evidence.py')]+ return workflow.snapshot(paths)+++def template_issues():+ issues = []+ for path in LAB.rglob('*'):+ if path.is_file() and path.suffix in ('.gd', '.gdshader', '.godot', '.tscn'):+ target = workflow.ROOT / 'vfx/godot' / path.relative_to(LAB)+ if workflow.file_hash(path) != workflow.file_hash(target):+ issues.append('templates_not_synced:' + path.relative_to(LAB).as_posix() + ' (run: vfx init --update-templates)')+ return issues+++def read_capture(evidence_id):+ if not isinstance(evidence_id, str) or len(evidence_id) != 32 or any(c not in '0123456789abcdef' for c in evidence_id):+ raise ValueError('Invalid evidence ID')+ return json.loads((store() / f'captures/{evidence_id}.json').read_text())+++def dependencies(entry):+ """A staged impact can show its incoming projectile and tail; bind that actual resource too."""+ dep = entry.get('delivery', {}).get('projectile')+ if not dep:+ return {}+ workflow.effect_id(dep)+ manifest = json.loads((workflow.ROOT/'vfx/godot/vfx_manifest.json').read_text())+ metadata = next((m for m in manifest if m['id'] == dep), None)+ from .primitives import walk, TEXTURE_KEYS+ recipe = json.loads((workflow.ROOT/f'vfx/recipes/{dep}.json').read_text())+ paths = [workflow.ROOT/f'vfx/godot/effects/{dep}.efkefc']+ paths += [workflow.ROOT/f'vfx/godot/effects/resources/{Path(l[k]).name}'+ for l in walk(recipe['layers']) for k in TEXTURE_KEYS if l.get(k)]+ return {dep: {'manifest': metadata, 'files': workflow.snapshot(paths)}}+++def write_capture(rid, images, frames, configuration, capture_state, stage, manifest_entry, note=''):+ receipt = read_build(rid)+ ident = uuid.uuid4().hex+ from . import briefs+ record = {'schema_version': 1, 'evidence_id': ident, 'effect_id': rid, 'time': now(),+ 'build_id': receipt['build_id'] if receipt else None, 'stage': stage,+ 'brief_sha256': workflow.digest(briefs.read(rid)), 'manifest': manifest_entry,+ 'configuration': configuration, 'capture': capture_state, 'note': note,+ 'dependencies': dependencies(manifest_entry),+ 'images': workflow.snapshot(images), 'frames': workflow.snapshot(frames)}+ workflow.save_json(store() / f'captures/{ident}.json', record)+ workflow.save_json(store() / f'latest/{rid}_{configuration["view"]}_{configuration["profile"]}.json', {'evidence_id': ident})+ return record+++def capture_issues(record):+ rid = record['effect_id']+ problems = build_issues(rid)+ build = read_build(rid)+ if not build or record.get('build_id') != build['build_id']:+ problems.append('capture_build_changed')+ if record.get('stage') != stage_snapshot():+ problems.append('capture_stage_changed')+ problems += template_issues()+ from . import briefs+ if record.get('brief_sha256') != workflow.digest(briefs.read(rid)):+ problems.append('capture_brief_changed')+ manifest = json.loads((workflow.ROOT / 'vfx/godot/vfx_manifest.json').read_text())+ if record.get('manifest') != next((m for m in manifest if m['id'] == rid), None):+ problems.append('capture_manifest_changed')+ if record.get('dependencies', {}) != dependencies(record['manifest']):+ problems.append('capture_dependency_changed')+ if record.get('capture', {}).get('status') != 'complete':+ problems.append('capture_inconclusive')+ if not workflow.unchanged(record['images']) or not workflow.unchanged(record['frames']):+ problems.append('capture_files_changed')+ return problems+++def submit(evidence_id, reviewer, report, observed_frames):+ record = read_capture(evidence_id)+ issues = capture_issues(record)+ if issues:+ raise ValueError('Cannot review stale or incomplete evidence: ' + ', '.join(issues))+ rubric = json.loads(RUBRIC.read_text())+ criteria = {c['id'] for c in rubric['criteria']}+ scores = report.get('scores', {})+ if set(scores) != criteria or any(type(v) is not int or not 0 <= v <= 3 for v in scores.values()):+ raise ValueError('Every rubric score must be an integer 0..3')+ if report.get('id') != record['effect_id'] or report.get('worst') not in criteria:+ raise ValueError('Report id or worst criterion is invalid')+ if scores[report['worst']] != min(scores.values()):+ raise ValueError('worst must name a lowest scoring criterion')+ verdict = 'ship' if min(scores.values()) >= 2 else 'iterate'+ if report.get('verdict') != verdict or not isinstance(report.get('fix'), str) or not report['fix'].strip():+ raise ValueError('Report needs one fix and a verdict consistent with scores')+ available = {int(Path(p).stem.rsplit('_f', 1)[1]) for p in record['frames'] if '_f' in Path(p).stem}+ if not observed_frames or any(type(f) is not int or f not in available for f in observed_frames):+ raise ValueError('observed_frames must name frames actually captured')+ if not isinstance(reviewer, str) or not reviewer.strip() or reviewer.lower() in ('author', 'self'):+ raise ValueError('A separately assigned reviewer identifier is required')+ review = {'evidence_id': evidence_id, 'reviewer': reviewer, 'time': now(), 'report': report,+ 'observed_frames': observed_frames, 'rubric_sha256': workflow.file_hash(RUBRIC),+ 'image_hashes': record['images'], 'independence': 'host_attested'}+ workflow.save_json(store() / f'reviews/{evidence_id}.json', review)+ return {'ok': True, 'verdict': verdict, 'evidence_id': evidence_id,+ 'independence': 'host must ensure reviewer isolation; an identifier is not proof'}+++def latest(rid, view='standard', profile='default'):+ path = store() / f'latest/{workflow.effect_id(rid)}_{view}_{profile}.json'+ return read_capture(json.loads(path.read_text())['evidence_id']) if path.is_file() else None+++def verify(rid, require_overview=True):+ recipe = current_recipe(rid)+ from . import briefs+ brief_result = briefs.validate(briefs.read(rid), recipe)+ issues = [] if brief_result['ok'] else ['invalid_or_missing_brief']+ record = latest(rid)+ if not record:+ issues += build_issues(rid, recipe) + ['missing_standard_capture']+ else:+ issues += capture_issues(record)+ path = store() / f'reviews/{record["evidence_id"]}.json'+ review = json.loads(path.read_text()) if path.is_file() else None+ if not review:+ issues.append('missing_independent_review')+ elif review['rubric_sha256'] != workflow.file_hash(RUBRIC) or review['image_hashes'] != record['images']:+ issues.append('review_changed')+ elif review['report']['verdict'] != 'ship':+ issues.append('review_requires_iteration')+ if require_overview:+ path = store() / 'overview.json'+ overview = json.loads(path.read_text()) if path.is_file() else None+ if not overview or not record or overview.get('evidence', {}).get(rid) != record['evidence_id'] or not workflow.unchanged(overview.get('images', {})):+ issues.append('missing_or_stale_overview')+ # Skipping the overview is a partial check: it reports whether everything else passed but never `verified`,+ # which is the delivery condition.+ partial = {} if require_overview else {'partial': True, 'passed_without_overview': not issues}+ if not require_overview:+ issues.append('overview_not_checked')+ return {'ok': True, 'verified': not issues, **partial, 'effect_id': rid, 'issues': sorted(set(issues)),+ 'evidence_id': record['evidence_id'] if record else None, 'brief': brief_result,+ 'scope': 'visual authoring only; runtime behavior and device performance require separate tests'}+++def context(rid):+ from . import briefs+ recipe = current_recipe(rid)+ record = latest(rid)+ history = workflow.ROOT / f'vfx/previews/strips/history/{rid}.jsonl'+ return {'ok': True, 'effect_id': rid, 'brief': briefs.read(rid), 'build_issues': build_issues(rid, recipe),+ 'latest_evidence': record, 'rounds': [json.loads(s) for s in history.read_text().splitlines()[-10:]] if history.is_file() else []}diff --git a/skills/effekseer-vfx/scripts/vfxkit/examples.py b/skills/effekseer-vfx/scripts/vfxkit/examples.pynew file mode 100644index 0000000..ca192b7--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/examples.py@@ -0,0 +1,120 @@+"""Shipped example effects: four ranged pairs (projectile + impact) and five single effects, with briefs and painted textures.++`add` copies an example into the project like any hand-written effect. Its historical review describes the+source renders, not your build: build and review it again before relying on it.+"""+import json+import shutil+from pathlib import Path+from . import workflow+from .paths import ASSETS, ROOT+from .ownership import guard++EXAMPLES = ASSETS / 'examples'+++def catalog():+ return json.loads((EXAMPLES / 'catalog.json').read_text())+++def ids(name):+ data = catalog()+ pairs = {p['name']: p for p in data['pairs']}+ singles = {s['name']: s for s in data.get('singles', [])}+ if name == 'all':+ return [i for p in pairs.values() for i in (p['projectile'], p['impact'])] + [s['effect'] for s in singles.values()]+ if name in pairs:+ return [pairs[name]['projectile'], pairs[name]['impact']]+ if name in singles:+ return [singles[name]['effect']]+ if (EXAMPLES / f'src/{name}.py').is_file():+ return [name]+ raise ValueError(f'Unknown example {name!r}; choose all, a pair ({", ".join(pairs)}), a single ({", ".join(singles)}) or an effect ID')+++def textures(rid):+ from .primitives import walk, TEXTURE_KEYS+ from .library import load+ recipe = load(EXAMPLES / f'src/{rid}.py')+ return sorted({Path(l[k]).stem for l in walk(recipe['layers']) for k in TEXTURE_KEYS if l.get(k)})+++def listing():+ data = catalog()+ return {'ok': True, 'note': data['note'], 'pairs': data['pairs'], 'singles': data.get('singles', []),+ 'historical_scores': data['historical_scores'], 'historical_review': data.get('historical_review'),+ 'usage': 'vfx examples show <name|ID>; vfx examples add <name|ID|all>; then vfx lint, vfx build, vfx review'}+++def add(name, force=False):+ from .scaffold import initialize+ initialize(install_plugin=False)+ chosen = ids(name)+ prompts_path = ROOT / 'vfx/texture_prompts.json'+ prompts = json.loads(prompts_path.read_text())+ shipped = {p['id']: p for p in json.loads((EXAMPLES / 'texture_prompts.json').read_text())['prompts']}+ copied, skipped, present = [], [], []+ for rid in chosen:+ pairs = [(EXAMPLES / f'src/{rid}.py', ROOT / f'vfx/src/{rid}.py'), (EXAMPLES / f'briefs/{rid}.json', ROOT / f'vfx/briefs/{rid}.json')]+ for stem in textures(rid):+ painted = EXAMPLES / f'textures/{stem}.png'+ if painted.is_file():+ pairs.append((painted, ROOT / f'vfx/textures/processed/{stem}.png'))+ for source, target in pairs:+ if target.is_file() and target.read_bytes() == source.read_bytes():+ present.append(workflow.relative(target)) # identical already: a starter texture from init, or shared by a pair+ continue+ if target.exists() and not force:+ skipped.append(workflow.relative(target))+ continue+ guard(target, ROOT / 'vfx').parent.mkdir(parents=True, exist_ok=True)+ shutil.copy2(source, target)+ copied.append(workflow.relative(target))+ known = {p['id'] for p in prompts['prompts']}+ prompts['prompts'] += [shipped[s] for s in textures(rid) if s in shipped and s not in known]+ workflow.save_json(prompts_path, prompts)+ return {'ok': True, 'effects': chosen, 'copied': copied, 'already_present': sorted(set(present)), 'skipped_existing': skipped,+ 'next': 'vfx lint --ids ' + ' '.join(chosen) + ' ; vfx build --ids ' + ' '.join(chosen)}+++def show(rid):+ """Layer plan with absolute frames, so an example can be read as a timeline before it is adapted."""+ from .briefs import timeline+ from .primitives import walk, budget+ from .library import load+ from .lint import lint+ path = EXAMPLES / f'src/{rid}.py'+ if not path.is_file():+ raise ValueError(f'Unknown example effect {rid}')+ recipe = load(path)+ brief = json.loads((EXAMPLES / f'briefs/{rid}.json').read_text())+ roles = {item['name']: item['role'] for item in brief.get('layer_plan', [])}+ plan = []+ for row, layer in zip(timeline(recipe['layers'], release=recipe.get('flight', 0) * 60), walk(recipe['layers'])):+ plan.append({**row, 'role': roles.get(row['path'], 'supporting detail'), 'renderer': layer.get('renderer', 'Sprite'),+ 'texture': Path(layer['texture']).stem if layer.get('texture') else None})+ result = {'ok': True, 'id': rid, 'design': recipe.get('design'), 'delivery': recipe.get('delivery'),+ 'source': workflow.relative(path), 'layer_plan': plan,+ 'particle_budget': sum(budget(l) for l in recipe['layers']),+ 'historical_scores': catalog()['historical_scores'].get(rid),+ 'historical_verdict': (catalog().get('historical_review') or {}).get('verdicts', {}).get(rid),+ 'known_weakest': (catalog().get('historical_review') or {}).get('worst', {}).get(rid)}+ from .paths import initialized+ note = 'run vfx examples add, then vfx lint, inside an initialized project to lint against its textures'+ if not initialized():+ result['lint'] = note+ else:+ try:+ result['lint'] = lint(recipe)+ except FileNotFoundError:+ result['lint'] = note+ return result+++def show_any(name):+ """`show` for one effect, or for every effect of a named example (a pair shows projectile and impact)."""+ chosen = ids(name)+ if len(chosen) == 1:+ return show(chosen[0])+ return {'ok': True, 'example': name, 'effects': [show(rid) for rid in chosen]}diff --git a/skills/effekseer-vfx/scripts/vfxkit/finalize.py b/skills/effekseer-vfx/scripts/vfxkit/finalize.pynew file mode 100644index 0000000..9e1a4d7--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/finalize.py@@ -0,0 +1,37 @@+"""Package current generated assets; never invent test/device verification results."""+from pathlib import Path+import hashlib, json, platform, shutil, subprocess, sys, zipfile+from PIL import Image+from .paths import ROOT, WORK, godot++def finalize(preview_dir=None):+ entries=json.loads((ROOT/'vfx/vfx_manifest.json').read_text())+ if not entries:raise ValueError('Build an effect manifest before packaging')+ previews=Path(preview_dir or ROOT/'vfx/previews')+ missing=[]+ for entry in entries:+ source=previews/(entry['id']+'.png')+ if not source.is_file():missing.append(entry['id']);continue+ destination=ROOT/'vfx/previews'/source.name+ if source.resolve()!=destination.resolve():shutil.copy2(source,destination)+ thumbnails=ROOT/'vfx/godot/previews';thumbnails.mkdir(exist_ok=True)+ image=Image.open(source).crop((400,175,1200,605));image.thumbnail((480,258),Image.Resampling.LANCZOS);image.save(thumbnails/source.name)+ def digest(path):return hashlib.sha256(path.read_bytes()).hexdigest()+ inventory=[]+ for path in sorted((ROOT/'vfx/textures/processed').glob('*.png')):+ image=Image.open(path);raw=ROOT/'vfx/textures/generated'/path.name+ inventory.append({'name':path.stem,'size':image.size,'sha256':digest(path),'source_sha256':digest(raw) if raw.is_file() else None})+ docs=WORK;docs.mkdir(parents=True,exist_ok=True)+ (docs/'texture_inventory.json').write_text(json.dumps(inventory,indent=2))+ environment={'os':platform.platform(),'architecture':platform.machine(),'python':sys.version.split()[0],'godot':subprocess.check_output([godot(),'--version'],text=True).strip(),'project_path':'vfx/godot'}+ (docs/'environment.json').write_text(json.dumps(environment,indent=2))+ project=ROOT/'vfx/godot';package=ROOT/'vfx/exports/Vfx_Godot.zip';package.parent.mkdir(exist_ok=True)+ temporary=package.with_suffix('.zip.partial')+ with zipfile.ZipFile(temporary,'w',zipfile.ZIP_DEFLATED,6) as archive:+ for path in sorted(project.rglob('*')):+ if not path.is_file() or '.godot' in path.parts or path.suffix=='.import' or path.name=='.DS_Store':continue+ archive.write(path,'Vfx_Godot/'+path.relative_to(project).as_posix())+ temporary.replace(package)+ summary={'effects':len(entries),'categories':len({e['category'] for e in entries}),'missing_previews':missing,'processed_textures':len(inventory),'package':str(package),'package_bytes':package.stat().st_size,'package_sha256':digest(package),'verification':'Run and record import/play/device tests separately; packaging does not establish those results.'}+ (docs/'delivery.json').write_text(json.dumps(summary,indent=2));return summary+diff --git a/skills/effekseer-vfx/scripts/vfxkit/handoff.py b/skills/effekseer-vfx/scripts/vfxkit/handoff.pynew file mode 100644index 0000000..b195d58--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/handoff.py@@ -0,0 +1,88 @@+"""Everything an independent reviewer needs for one capture, as a prompt the author passes on unchanged.++The author must not score its own effect. `vfx review-handoff <ID>` writes a self-contained brief (images, frame+numbers, manifest context, rubric, output format and where to save the report) so a separate agent can review it+whether or not that agent has the vfx-review skill loaded, then returns the command that submits its report.+"""+import json+import shutil+from pathlib import Path++from . import evidence, workflow+from .ownership import guard+from .paths import SKILL, ASSETS++MANIFEST_FIELDS = ('id', 'category', 'element', 'duration', 'peak', 'impact', 'delivery', 'design')+++def reviewer_skill():+ """The vfx-review skill installed next to this one (both folders are installed side by side), if present."""+ path = SKILL.parent / 'vfx-review' / 'SKILL.md'+ return path if path.is_file() else None+++def handoff(rid):+ rid = workflow.effect_id(rid)+ record = evidence.latest(rid)+ if not record:+ raise ValueError(f'No standard capture of {rid}; run vfx review --ids {rid} first')+ issues = evidence.capture_issues(record)+ if issues:+ raise ValueError(f'The latest capture of {rid} is stale ({", ".join(issues)}); run vfx review --ids {rid} again')+ eid = record['evidence_id']+ workspace = workflow.ROOT / 'vfx' # read at call time, like evidence's store+ folder = workflow.WORK / 'handoff'+ folder.mkdir(parents=True, exist_ok=True)+ rubric = guard(folder / 'review_rubric.json', workspace)+ shutil.copy2(ASSETS / 'review_rubric.json', rubric)+ images = [str(workflow.absolute(p)) for p in record['images']] # {path: sha256}: the strip and key-frame sheet+ frame_paths = list(record['frames'])+ frames = sorted(int(Path(p).stem.rsplit('_f', 1)[1]) for p in frame_paths if '_f' in Path(p).stem)+ frame_dir = str(workflow.absolute(frame_paths[0]).parent) if frame_paths else None+ metrics = workspace / 'previews/strips/metrics.json'+ flags = (json.loads(metrics.read_text()).get(rid, {}).get('flags') if metrics.is_file() else None) or []+ manifest = {k: record['manifest'].get(k) for k in MANIFEST_FIELDS if k in record['manifest']}+ report = folder / f'{eid}.report.json'+ skill = reviewer_skill()+ lines = [+ f'# Independent review of {rid}',+ '',+ 'You are the reviewer, not the author: you did not make this effect. Judge only what the images show.',+ 'Do not open or ask for the recipe, the brief or the author\'s notes (nothing under vfx/src, vfx/briefs or',+ 'vfx/recipes); the design sentence below is context, not evidence.',+ '',+ (f'Follow the vfx-review skill: read {skill} first and apply it.' if skill else+ 'Procedure: score every rubric criterion 0-3 from the images (0 missing or wrong, 1 present but weak, 2 clearly '+ 'works, 3 reads instantly with its own identity), name the worst criterion and one concrete fix for it.'),+ f'The rubric (authoritative): {rubric}',+ '',+ '## Open these images with your image viewer',+ *[f'- {path}' for path in images],+ f'Full-size single frames, if you need detail: {frame_dir}/{rid}_fNNN.png' if frame_dir else '',+ f'Captured frame numbers (60 FPS from the effect\'s start; only these can be cited): {frames}',+ '',+ '## Context',+ f'Manifest entry: {json.dumps(manifest, ensure_ascii=False)}',+ f'Automatic flags (hints only; never score from them): {json.dumps(flags, ensure_ascii=False)}',+ 'Stage: two stand-in dummies; the caster/player on the left, the target on the right. A projectile strip ends at '+ 'arrival and does not show its impact. Heals, shields and buffs need no attack-style white flash; charges build '+ 'inward before one release.',+ '',+ '## Output',+ f'Write exactly one JSON object to {report}:',+ '{"id": "%s", "scores": {"read": 0, "timing": 0, "layering": 0, "shape_change": 0, "motion": 0, '+ '"placement": 0, "tail": 0, "identity": 0}, "worst": "<a lowest-scoring criterion>", '+ '"fix": "<one concrete change for the worst criterion, naming frames>", "verdict": "ship or iterate", '+ '"observed_frames": [<frame numbers you actually looked at, from the list above>]}' % rid,+ 'verdict is "iterate" if any score is below 2, otherwise "ship". Then reply with your scores, verdict and fix.',+ ]+ prompt = '\n'.join(lines) + '\n'+ brief = guard(folder / f'{eid}.md', workspace)+ brief.write_text(prompt, encoding='utf-8')+ return {'ok': True, 'effect_id': rid, 'evidence_id': eid, 'prompt_file': str(brief), 'report_file': str(report),+ 'reviewer_skill': str(skill) if skill else None, 'captured_frames': frames,+ 'next': ('Give the prompt file (or its text) to a separate agent that has not seen the recipe: a subagent, or '+ 'a new session the user opens if your host has none. Then run: vfx review-submit '+ f'{eid} {report} --reviewer <that agent\'s identifier>'),+ 'prompt': prompt}diff --git a/skills/effekseer-vfx/scripts/vfxkit/library.py b/skills/effekseer-vfx/scripts/vfxkit/library.pynew file mode 100644index 0000000..0458866--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/library.py@@ -0,0 +1,94 @@+"""The project's effect library: one recipe source per effect in vfx/src/<ID>.py.++Each source defines `recipe()` returning one `effect(...)` dict whose id equals the file name. Files whose+name starts with an underscore are shared helpers and can be imported by the others (`from _palette import *`).+Sources are loaded fresh on every call, so edits take effect without restarting anything.+"""+import importlib.abc+import importlib.util+import sys+from pathlib import Path+from .paths import ROOT++SRC = ROOT / 'vfx/src'+++class HelperFinder(importlib.abc.MetaPathFinder):+ """Resolves `_name` helpers in vfx/src. It sits at the end of sys.meta_path and vfx/src is not on sys.path, so+ built-in modules, the standard library and installed packages always win; a helper only fills a name nothing+ else provides (name a helper `_ast.py` and you get the real `_ast`)."""++ def find_spec(self, name, path=None, target=None):+ if path is not None or not name.startswith('_'):+ return None+ source = SRC / f'{name}.py'+ return importlib.util.spec_from_file_location(name, source) if source.is_file() else None+++_finder = HelperFinder()+++def sources():+ return sorted(p for p in SRC.glob('VFX_*.py'))+++def _forget_helpers():+ # A fresh load must see the helpers' current text; match the folder exactly, not a path prefix.+ for name in [n for n, m in sys.modules.items() if getattr(m, '__file__', None) and Path(m.__file__).resolve().parent == SRC.resolve()]:+ del sys.modules[name]+++def load(path):+ path = Path(path)+ if _finder not in sys.meta_path:+ sys.meta_path.append(_finder)+ _forget_helpers()+ spec = importlib.util.spec_from_file_location(f'vfx_src_{path.stem}', path)+ module = importlib.util.module_from_spec(spec)+ spec.loader.exec_module(module)+ if not callable(getattr(module, 'recipe', None)):+ raise ValueError(f'{path.name}: define recipe() returning effect(...)')+ recipe = module.recipe()+ if not isinstance(recipe, dict) or recipe.get('id') != path.stem:+ raise ValueError(f'{path.name}: recipe() must return effect(...) whose id is {path.stem!r}, got {recipe.get("id") if isinstance(recipe, dict) else recipe!r}')+ return recipe+++def describe(error):+ return f'{type(error).__name__}: {error}'+++def library():+ """Every recipe; any source that fails to load fails the call (full builds and full lint need all of them)."""+ return [load(p) for p in sources()]+++def partial(ids=None):+ """Recipes for `ids` must load; the rest are loaded best-effort as context for cross-effect checks.++ Returns (selected, context, unloaded) where `unloaded` maps a file that failed to load to its error, so one+ half-written effect does not block work on the others.+ """+ wanted = set(ids or [])+ selected, context, unloaded = [], [], {}+ for path in sources():+ if path.stem in wanted:+ recipe = load(path)+ selected.append(recipe)+ context.append(recipe)+ continue+ try:+ context.append(load(path))+ except Exception as error:+ unloaded[path.stem] = describe(error)+ unknown = sorted(wanted - {r['id'] for r in selected})+ if unknown:+ raise ValueError(f'Unknown effect IDs: {unknown} (no vfx/src/<ID>.py)')+ return selected, context, unloaded+++def get(rid):+ path = SRC / f'{rid}.py'+ if not path.is_file():+ raise ValueError(f'Unknown effect ID: {rid} (no vfx/src/{rid}.py)')+ return load(path)diff --git a/skills/effekseer-vfx/scripts/vfxkit/lint.py b/skills/effekseer-vfx/scripts/vfxkit/lint.pynew file mode 100644index 0000000..2ea9f4c--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/lint.py@@ -0,0 +1,157 @@+"""Static recipe checks. Needs neither EffekseerCore nor Godot, so it also runs in cloud/Linux sessions.++Errors are hard rules that make a build wrong (unknown fields, budget, lifetime, units, undocumented+textures); `build` refuses to run while any exist. Warnings encode the references/craft.md heuristics:+they point at likely craft problems but the rendered strip decides.+"""+import json+from pathlib import Path+from effekseer_ai.authoring import validate_layer+from .primitives import walk, lifetime, budget, TEXTURE_KEYS+from .paths import ROOT++BUDGET={'hit':60,'boss':250,'projectile':100} # references/craft.md, budgets; every other category is an element skill+DEFAULT_BUDGET=150+MAX_GRAVITY=.01 # per frame squared; sparks use .001-.002 and rocks .004+CONTACT_TEXTURE='T_Flare01' # what flash() draws+CONTACT_MAX_LIFE=6 # contact frames are 2-5; the library uses up to 6+CONTACT_LAYER_LIFE=10 # a single white-hot additive layer this short also reads as the contact (slash_set's cel crescent)+HOT_LUMA=.85 # same bar as review.py, so lint and review agree on what white-hot means+PEAK_TOLERANCE=6 # frames between the contact flash and manifest peak, where the Lab kicks+MIN_DIFFERENCES=3 # of shape, motion, rhythm, material, secondary (section 3)++def documented_textures():+ from .textures import masks,EXTRA_PROCEDURAL+ path=ROOT/'vfx/texture_prompts.json'+ prompts=json.loads(path.read_text())['prompts'] if path.is_file() else []+ return set(masks(8))|EXTRA_PROCEDURAL, {p['id'] for p in prompts}++def stem(value):return Path(value).stem if value else None++def hot(c):+ """White-hot: very bright and nearly unsaturated, so warm whites count and acid greens do not."""+ return (.2126*c[0]+.7152*c[1]+.0722*c[2])/255>=HOT_LUMA and min(c[:3])>=180 and (len(c)<4 or c[3]>0)++def colours(layer):+ found=[layer.get('color'),layer.get('color_end')]+ ring=layer.get('ring') if isinstance(layer.get('ring'),dict) else {}+ found+=[ring.get(k) for k in ['outer_color','center_color','inner_color']]+ return [c for c in found if isinstance(c,(list,tuple)) and len(c)>=3]++def moves(layer):+ """Coarse motion tags for the element-difference check."""+ tags=set(); travel=layer.get('travel') or {}; spawn=layer.get('spawn') or {}+ def high(v):return max(v) if isinstance(v,(list,tuple)) else v+ def low(v):return min(v) if isinstance(v,(list,tuple)) else v+ end=travel.get('end')+ if end:+ y=end[1]+ if spawn.get('shape') in ('Sphere','Circle') and spawn.get('rotate',True):tags.add('outward' if low(y)>=0 else 'inward')+ elif high(y)>0:tags.add('rise')+ elif low(y)<0:tags.add('fall')+ for force in layer.get('forces') or []:+ if force.get('type')=='Gravity':tags.add('rise' if force['gravity'][1]>0 else 'fall')+ if force.get('type') in ('Vortex','Turbulence'):tags.add(force['type'].lower())+ spin=layer.get('spin')+ if spin and max(abs(high(spin[2])),abs(low(spin[2])))>=3:tags.add('swirl')+ if isinstance(layer.get('ring'),dict) and 'angle_end' in layer['ring']:tags.add('sweep')+ if layer.get('scale_curve') and any(v>1.05 for _,v in layer['scale_curve'][1:-1]):tags.add('overshoot')+ return tags++def look(layer):+ """What a layer draws: renderer plus its texture or procedural mesh shape."""+ model=(layer.get('procedural_model') or {}).get('Shape/PrimitiveType')+ return (layer.get('renderer','Sprite'),model or stem(layer.get('texture')))++def features(recipe):+ layers=list(walk(recipe['layers']))+ duration=recipe['duration']; peak=recipe.get('peak',0)/max(duration,1e-6)+ # A projectile's trail (layers left behind in world space) is its secondary motion; its head is the shape.+ def many(l):return l.get('count',1)>1 or bool(l.get('inherit'))+ return {+ 'shape':frozenset(look(l) for l in layers if not many(l) and stem(l.get('texture'))!=CONTACT_TEXTURE),+ 'motion':frozenset(t for l in layers for t in moves(l))|({'lobbed'} if recipe.get('arc') else set()),+ 'rhythm':(min(3,int(duration/.5)),0 if peak<.2 else 1 if peak<.5 else 2,round(recipe.get('flight',0)/.15)),+ 'material':frozenset([l.get('blend','Add') for l in layers]+[k for l in layers for k in ('distortion_texture','falloff','edge','flipbook','procedural_model') if l.get(k)]),+ 'secondary':frozenset(look(l) for l in layers if many(l)),+ }++def lint(recipe,known=None):+ errors=[];warnings=[]+ procedural,painted=known or documented_textures()+ layers=list(walk(recipe['layers'])); rid=recipe['id']; frames=recipe['duration']*60+ for layer in recipe['layers']:errors+=validate_layer(layer)+ if not 0<=recipe.get('peak',0)<recipe['duration']:errors.append(f"peak {recipe.get('peak')} s is outside the {recipe['duration']} s duration")+ release=recipe.get('flight',0)*60+ sustained=[l for l in layers if l.get('infinite')]+ if sustained and not recipe.get('flight'):errors.append(f"{sustained[0]['name']}: infinite layers emit until release, so the recipe needs flight (seconds of the reference flight)")+ for layer in sustained:+ if not layer.get('interval'):errors.append(f"{layer['name']}: infinite layer needs an interval > 0 or it spawns without limit")+ if not recipe.get('loop'):+ for layer in recipe['layers']:+ if lifetime(layer,release=release)>frames:errors.append(f"{layer['name']}: alive until frame {round(lifetime(layer,release=release))} but the effect ends at {round(frames)}; it would be cut off on recycle")+ limit=BUDGET.get(recipe.get('category'),DEFAULT_BUDGET); total=sum(budget(l) for l in recipe['layers'])+ if total>limit:errors.append(f"particle budget {total} exceeds {limit} for category {recipe.get('category')!r}")+ for layer in layers:+ for key in TEXTURE_KEYS:+ name=stem(layer.get(key))+ if name and name not in procedural|painted:errors.append(f"{layer['name']}.{key}: {name} is neither a math primitive nor recorded in vfx/texture_prompts.json")+ if name and not (ROOT/f'vfx/textures/processed/{name}.png').is_file():errors.append(f"{layer['name']}.{key}: vfx/textures/processed/{name}.png is missing")+ # The compiler multiplies a size/scale curve by a fixed start scale; a random size range with a curve crashes the build.+ random_scale=isinstance(layer.get('size'),(list,tuple)) or any(isinstance(v,(list,tuple)) for v in layer.get('scale_start') or [])+ if random_scale and (layer.get('size_curve') or layer.get('scale_curve')):+ errors.append(f"{layer['name']}: size_curve/scale_curve needs a fixed size/scale_start; vary size with a second layer instead of a random range")+ # UV distortion is measured in whole-texture UV; on a flipbook sheet it samples the neighbouring cells and the+ # sprite renders as hard-edged blocks (seen on the fire flipbooks).+ if layer.get('flipbook') and layer.get('distortion_texture'):+ errors.append(f"{layer['name']}: UV distortion on a flipbook samples neighbouring cells (hard square edges); drop distortion_texture or use a single-frame texture")+ for force in layer.get('forces') or []:+ if force.get('type')=='Gravity' and max(abs(g) for g in force.get('gravity',[0,0,0]))>MAX_GRAVITY:+ errors.append(f"{layer['name']}: gravity {force['gravity']} is per frame squared; above {MAX_GRAVITY} particles leave the screen")+ life=layer.get('life',24); shortest=min(life) if isinstance(life,(list,tuple)) else life+ if layer.get('fade_in',1)+layer.get('fade_out',0)>shortest*1.05:warnings.append(f"{layer['name']}: fade_in+fade_out exceed the shortest life {shortest}; it never reaches full opacity")+ # Craft heuristics (warnings).+ flashes=[l for l in layers if stem(l.get('texture'))==CONTACT_TEXTURE]+ def longest(l):life=l.get('life',24);return max(life) if isinstance(life,(list,tuple)) else life+ contacts=flashes+[l for l in layers if l not in flashes and l.get('count',1)==1 and l.get('blend','Add')=='Add' and longest(l)<=CONTACT_LAYER_LIFE and any(hot(c) for c in colours(l))]+ if recipe.get('impact',0)>=.3:+ if not contacts:warnings.append('impact effect without a contact flash: no flash() layer and no short single white-hot additive layer; the Lab kick at peak has no matching bright frame')+ else:+ peak=recipe.get('peak',0)*60; nearest=min(contacts,key=lambda l:abs(l.get('delay',0)-peak))+ if abs(nearest.get('delay',0)-peak)>PEAK_TOLERANCE:warnings.append(f"contact {nearest['name']!r} starts at frame {nearest.get('delay',0)} but manifest peak is frame {peak:.0f}; the Lab flash and camera kick land elsewhere")+ for l in flashes:+ life=l.get('life',5)+ if (max(life) if isinstance(life,(list,tuple)) else life)>CONTACT_MAX_LIFE:warnings.append(f"{l['name']}: contact flash lives {life} frames; contact should be 2-5")+ # Lightning changes shape by swapping frames: the same painted shape on several layers that start at different times.+ starts={}+ for l in layers:+ if l.get('count',1)==1 and stem(l.get('texture')):starts.setdefault(stem(l['texture']),set()).add(l.get('delay',0))+ swapped=any(len(s)>=2 for name,s in starts.items() if name in painted)+ if not swapped and not any(l.get('cutoff') is not None or l.get('distortion_texture') or l.get('uv_scroll') or l.get('alpha_scroll') or l.get('flipbook') or (isinstance(l.get('ring'),dict) and 'angle_end' in l['ring']) for l in layers):+ warnings.append('no layer changes shape (dissolve cutoff, ring sweep, UV distortion/scroll, flipbook or a painted shape re-struck on later frames); the body can only scale and fade')+ if not any(hot(c) for l in layers if l.get('blend','Add')=='Add' for c in colours(l)):+ warnings.append(f'no white-hot additive colour (luma >= {HOT_LUMA}, min channel >= 180); brightness layering needs a hot core above the saturated body')+ timeline=sorted(([l['name'],l.get('delay',0),round(lifetime(l,release=recipe.get("flight",0)*60))] for l in recipe['layers']),key=lambda t:t[1])+ return {'id':rid,'errors':errors,'warnings':warnings,'budget':[total,limit],'timeline':timeline}++def compare_elements(recipes):+ """Pairs in one category whose elements differ in fewer than MIN_DIFFERENCES feature groups: likely recolours."""+ out={}; feats={r['id']:features(r) for r in recipes}+ for i,a in enumerate(recipes):+ for b in recipes[i+1:]:+ if a.get('category')!=b.get('category') or a.get('element')==b.get('element'):continue+ same=[k for k in feats[a['id']] if feats[a['id']][k]==feats[b['id']][k]]+ if 5-len(same)<MIN_DIFFERENCES:+ for x,y in [(a,b),(b,a)]:out.setdefault(x['id'],[]).append(f"differs from {y['id']} ({y.get('element')}) only in {5-len(same)} of shape/motion/rhythm/material/secondary; same {', '.join(same)}")+ return out++def lint_library(recipes,context=None):+ """Lint `recipes`; element differences are judged against `context` (default: the recipes themselves)."""+ known=documented_textures(); reports=[lint(r,known) for r in recipes]+ pairs=compare_elements(context or recipes)+ for report in reports:report['warnings']+=pairs.get(report['id'],[])+ return {'ok':not any(r['errors'] for r in reports),+ 'errors':{r['id']:r['errors'] for r in reports if r['errors']},+ 'warnings':{r['id']:r['warnings'] for r in reports if r['warnings']},+ 'reports':{r['id']:{k:r[k] for k in ('budget','timeline')} for r in reports}}+diff --git a/skills/effekseer-vfx/scripts/vfxkit/ownership.py b/skills/effekseer-vfx/scripts/vfxkit/ownership.pynew file mode 100644index 0000000..d1bf9d0--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/ownership.py@@ -0,0 +1,100 @@+"""Which effects and files in a workspace this skill built, so it only ever deletes or replaces its own.++Standard library only: `vfx doctor` uses it before setup has installed anything.+"""+import hashlib+import json+import re+import unicodedata+from pathlib import Path++MARKER = 'effekseer-vfx' # manifest `built_by` of every entry this skill compiled+++def valid_id(rid):+ return isinstance(rid, str) and re.fullmatch(r'VFX_[A-Za-z0-9_]+', rid) is not None+++def digest(path):+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def owned(entry, root, work):+ """Built by this skill, so a full build may remove it once its source is gone.++ Current builds tag the entry (`built_by` plus `source` = its own vfx/src file). Workspaces built before the tag+ count only through a build receipt whose recorded .efkefc is still the file on disk. Anything else (another+ tool's entry, a hand-made effect, a malformed ID) is never owned and never touched.+ """+ rid = entry.get('id') if isinstance(entry, dict) else None+ if not valid_id(rid):+ return False+ if entry.get('built_by') == MARKER and entry.get('source') == f'vfx/src/{rid}.py':+ return True+ receipt = Path(work) / f'builds/{rid}.json'+ if not receipt.is_file():+ return False+ try:+ recorded = json.loads(receipt.read_text())['outputs'].get(f'vfx/effects/{rid}.efkefc')+ except (ValueError, KeyError, AttributeError, TypeError):+ return False+ return recorded is not None and recorded == digest(Path(root) / f'vfx/effects/{rid}.efkefc')+++def unmanaged(root, work, manifest, ignore=()):+ """Effect files this skill did not build: unowned manifest entries and .efkefc files no entry names."""+ root = Path(root)+ named, files = set(), []+ for entry in manifest:+ rid = entry.get('id') if isinstance(entry, dict) else None+ named.add(rid)+ if rid in ignore or owned(entry, root, work):+ continue+ path = root / f'vfx/effects/{rid}.efkefc' if valid_id(rid) else None+ files.append(path if path and path.is_file() else None)+ files += [p for p in sorted((root / 'vfx/effects').glob('*.efkefc')) if p.stem not in named]+ return files # None stands for an unowned entry whose effect file is missing or unnamed: dependencies unknown+++def name_key(name):+ """Comparison key of a resource name: Unicode NFC, then case folded. The default macOS file system (and Windows)+ treat T_A.png and t_a.png, and the composed and decomposed forms of a name such as T_Ä.png, as one file."""+ return unicodedata.normalize('NFC', name).casefold()+++def same_name(a, b):+ return name_key(a) == name_key(b)+++def may_use(effect_file, name):+ """Whether an effect file (whose dependencies are not recorded) could reference resource `name`.++ .efkefc and .efk store resource paths as UTF-16LE text. The bytes are decoded (UTF-16LE at both alignments, and+ UTF-8) and compared as Unicode with case folded, so any spelling of the name counts; an unknown or unreadable file+ always counts as a user."""+ if effect_file is None:+ return True+ try:+ data = Path(effect_file).read_bytes()+ except OSError:+ return True+ wanted = name_key(name)+ texts = [data.decode('utf-16-le', errors='replace'), data[1:].decode('utf-16-le', errors='replace'),+ data.decode('utf-8', errors='replace')]+ return any(wanted in name_key(text) for text in texts)+++def inside(path, folder):+ """`path` (after resolving symlinks) lies within `folder`."""+ return Path(path).resolve().is_relative_to(Path(folder).resolve())+++def guard(path, folder):+ """Raise unless writing `path` stays inside `folder`: its parent resolves inside, and the file itself (when it exists+ or is a dangling link) resolves inside too. Writes follow symlinks, so this must run before every write."""+ path = Path(path)+ if not inside(path.parent, folder) or ((path.exists() or path.is_symlink()) and not inside(path, folder)):+ raise ValueError(f'{path} resolves outside {Path(folder).resolve()}; refusing to write it')+ return path+diff --git a/skills/effekseer-vfx/scripts/vfxkit/paths.py b/skills/effekseer-vfx/scripts/vfxkit/paths.pynew file mode 100644index 0000000..f25696d--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/paths.py@@ -0,0 +1,41 @@+"""Where the skill's own files live, where the toolchain is installed and which game project is being edited.++The skill folder is read-only at run time (agents may install it into a versioned cache). Everything an+effect produces lives in the project's `vfx/` workspace; downloaded tools live in EFFEKSEER_VFX_HOME.+"""+import os+from pathlib import Path++SKILL = Path(__file__).resolve().parents[2]+SCRIPTS = SKILL / 'scripts'+ASSETS = SKILL / 'assets'+REFERENCES = SKILL / 'references'++# The game project that owns the vfx/ workspace: --project, then VFX_PROJECT, then the current directory.+ROOT = Path(os.environ.get('VFX_PROJECT') or Path.cwd()).expanduser().resolve()+WORKSPACE = ROOT / 'vfx'+# Local receipts, locks and scratch images; ignored by version control.+WORK = WORKSPACE / 'work'+++def initialized():+ """`vfx init` has run here: a vfx/ folder that merely exists (another tool's output) does not count."""+ return (WORKSPACE / 'src').is_dir() and (WORKSPACE / 'vfx_manifest.json').is_file()++HOME = Path(os.environ.get('EFFEKSEER_VFX_HOME') or Path.home() / '.cache/effekseer-vfx').expanduser().resolve()+EFFEKSEER_VERSION = '1.80.7'+CORE_BIN = HOME / 'effekseer/Effekseer1.80.7Win/Tool/bin'+DOWNLOADS = HOME / 'downloads'+++def godot():+ """Godot 4 executable: GODOT, then `godot` on PATH, then the standard macOS application bundle."""+ import shutil+ configured = os.environ.get('GODOT')+ if configured:+ return configured+ found = shutil.which('godot')+ if found:+ return found+ bundle = Path('/Applications/Godot.app/Contents/MacOS/Godot')+ return str(bundle) if bundle.is_file() else 'godot'diff --git a/skills/effekseer-vfx/scripts/vfxkit/primitives.py b/skills/effekseer-vfx/scripts/vfxkit/primitives.pynew file mode 100644index 0000000..d945068--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/primitives.py@@ -0,0 +1,363 @@+"""Composable layer primitives for effect recipes: `from vfxkit.primitives import *`.++Primitives return plain layer dicts for the effekseer_ai layer compiler. Units: life/delay in 60 FPS+frames, velocity in units per frame, angles in degrees, colours RGBA 0-255, curves in percent of life.+Textures are named by stem (`'T_Glow01'`) and resolved in the project's vfx/textures/processed/.+"""+from pathlib import Path+import math+from .paths import ROOT+T=ROOT/'vfx/textures/processed'+TEXTURE_KEYS=['texture','alpha_texture','distortion_texture','blend_texture']+WHITE=(255,255,255,255)++def tex(name):return str(T/f'{name}.png')+def fade(color,alpha=0):return [*color[:3],alpha]+def walk(layers):+ for layer in layers:+ yield layer+ yield from walk(layer.get('children',[]))++def sprite(name,texture='T_Glow01',color=WHITE,**kw):+ for key in TEXTURE_KEYS[1:]:+ if key in kw:kw[key]=tex(kw[key])+ return dict(name=name,texture=tex(texture),color=list(color),**kw)++def glow(name,color,size,life=10,delay=0,**kw):+ """Soft light bloom behind a shape: pops fast, then swells slightly while fading."""+ return sprite(name,'T_Glow01',color,life=life,delay=delay,size=size,size_curve=[[0,.25],[18,1],[100,1.25]],billboard='Billboard',fade_in=0,fade_out=life*.8) | kw++def shadow(name,color,size,life=12,delay=0,**kw):+ """Dark alpha backing behind an additive core: peaks a frame or two after the white flash (white -> dark -> fade),+ so the hot core keeps its value contrast even on a bright background."""+ return sprite(name,'T_SoftCircle',color,life=life,delay=delay,size=size,size_curve=[[0,.6],[20,1],[100,1.15]],billboard='Billboard',blend='Blend',+ fade_in=2,fade_out=life*.7) | kw++def flash(name,color,size,life=5,delay=0,angle=0,**kw):+ """One- to five-frame anamorphic star at the contact frame; sells the hit more than anything else."""+ return sprite(name,'T_Flare01',color,life=life,delay=delay,size=size,size_curve=[[0,.55],[25,1],[100,.15]],rotation=[0,0,angle],fade_in=0,fade_out=life*.6,emissive=1.6) | kw++def radial_sparks(name,count,color,color_end=None,distance=(.8,2.2),life=(12,22),width=.1,length=(.35,.7),delay=0,gravity=0,turbulence=0,hemisphere=False,radius=(0,.08),**kw):+ """Motion-aligned streaks thrown from a sphere; eased travel makes them burst fast, then hang and droop."""+ forces=[]+ if gravity:forces.append(dict(type='Gravity',gravity=[0,-gravity,0]))+ if turbulence:forces.append(dict(type='Turbulence',power=turbulence,scale=6))+ return sprite(name,'T_Spark01',color,color_end=list(color_end or color),count=count,life=list(life),delay=delay,billboard='DirectionalBillboard',+ spawn=dict(shape='Sphere',radius=list(radius),rot_x=[0,90] if hemisphere else [-90,90]),travel=dict(end=[0,list(distance),0],easing='EaseOutQuartic'),+ scale_start=[width,list(length),1],scale_end=[width*.3,length[0]*.2,1],easing='EaseInQuadratic',forces=forces,fade_in=0,fade_out=5,emissive=1.5) | kw++def spark_burst(name,count,hot,cool,distance=(1.0,2.6),life=(12,22),length=(.4,.9),delay=0,gravity=.0015,floor=None,**kw):+ """Three spark tiers instead of one uniform spray (AAA hits read as fast/medium/heavy at once):+ a few long thin streaks that are gone in 6-10 frames, the main body, and ~20% heavy sparks that are larger,+ fall harder and, given `floor` (world height), bounce and skid on the ground."""+ d0,d1=distance+ heavy=dict(collide=dict(height=floor,bounce=[.25,.45],friction=.4,reduction=.35)) if floor is not None else {}+ return [+ radial_sparks(name+' streaks',max(3,count//3),WHITE,color_end=hot,distance=(d0*1.3,d1*1.4),life=(6,10),length=(length[0]*1.5,length[1]*1.6),width=.05,delay=delay,fade_out=3,emissive=2.2,**kw),+ radial_sparks(name,count,hot,color_end=cool,distance=distance,life=life,length=length,delay=delay,gravity=gravity,**kw),+ radial_sparks(name+' heavy',max(2,count//5),hot,color_end=cool,distance=(d0*.7,d1*.9),life=(life[0]+6,life[1]+8),length=(length[0]*.6,length[1]*.7),width=.15,delay=delay,gravity=gravity*2.2,**heavy,**kw),+ ]++def motes(name,count,color,color_end=None,size=(.1,.22),life=(20,40),distance=(.3,1.2),delay=0,interval=0,rise=0,turbulence=.003,radius=(0,.3),hemisphere=False,**kw):+ """Small round glints that drift: embers, frost, magic dust. Uniform random size keeps them round."""+ forces=[dict(type='Turbulence',power=turbulence,scale=5)]+ if rise:forces.append(dict(type='Gravity',gravity=[0,rise,0]))+ return sprite(name,'T_Glow01',color,color_end=list(color_end or color),count=count,life=list(life),delay=delay,interval=interval,billboard='Billboard',+ spawn=dict(shape='Sphere',radius=list(radius),rot_x=[0,90] if hemisphere else [-90,90]),travel=dict(end=[0,list(distance),0],easing='EaseOutCubic'),+ size=list(size),size_end=0,easing='EaseInCubic',forces=forces,fade_in=1,fade_out=6,emissive=1.5) | kw++def shock_ring(name,color,radius,life=14,delay=0,thickness=.35,ground=False,**kw):+ """Expanding wave: the node scale eases out while the band thins from the inside."""+ return dict(name=name,renderer='Ring',color=list(color),life=life,delay=delay,billboard='Fixed' if ground else 'Billboard',rotation=[-90 if ground else 0,0,0],+ ring=dict(outer=[1,0],inner=dict(start=[1-thickness,0],end=[.97,0]),center_ratio=.8,outer_color=fade(color,color[3]//2),center_color=list(color),inner_color=fade(color)),+ size=radius,size_curve=[[0,.12],[35,.72],[100,1]],fade_in=0,fade_out=life*.7) | kw++def slash_arc(name,color,radius=1.5,width=.55,sweep=(-20,200),life=11,delay=0,tilt=(0,0,0),texture='T_Trail01',depth=0,flow=0,**kw):+ """Swept crescent: the head races round the arc, the tail follows, the band thins and dissolves.++ depth lifts the outer edge and drops the inner one so the band is a shallow cone with perspective thickness+ instead of a flat decal; flow slides the erosion noise along the arc so the dissolving tail streams after the head."""+ a0,a1=sweep+ extra=dict(alpha_scroll=[flow,0]) if flow else {}+ return dict(name=name,renderer='Ring',texture=tex(texture),color=list(color),life=life,delay=delay,billboard='Fixed',rotation=list(tilt),+ ring=dict(vertices=96,outer=[radius,depth],inner=dict(start=[radius-width,-depth*.6],end=[radius-width*.25,-depth*.15]),center_ratio=.6,+ outer_color=list(color),center_color=list(color),inner_color=list(color),angle_start=[a0,a0+(a1-a0)*.4],angle_end=[a0+(a1-a0)*.12,a1],angle_easing='EaseOutQuartic',angle_fade=[25,4]),+ alpha_texture=tex('T_NoiseStreak01'),cutoff=[[0,0],[35,.05],[100,.75]],fade_in=0,fade_out=life*.5,wrap='Clamp',**extra) | kw++def wisps(name,color,radius,count=4,width=.3,sweep=(0,150),life=(14,22),delay=0,interval=0,tilt=((-90,90),(0,360),(0,360)),size=(.7,1.3),+ flow=-.05,broken=.1,texture='T_WispTrail01',**kw):+ """Broken energy strokes: `count` partial arcs, each at its own random tilt, radius and length, so several strands+ swirl and cross instead of one clean ring. The erosion starts above zero, so every arc is torn from its first frame."""+ a0,a1=sweep; peak=max(life) if isinstance(life,(list,tuple)) else life+ return dict(name=name,renderer='Ring',texture=tex(texture),color=list(color),count=count,interval=interval,life=list(life) if isinstance(life,(list,tuple)) else life,delay=delay,+ billboard='Fixed',rotation=[list(t) if isinstance(t,(list,tuple)) else t for t in tilt],size=list(size) if isinstance(size,(list,tuple)) else size,+ ring=dict(vertices=72,outer=[radius,0],inner=dict(start=[radius-width,0],end=[radius-width*.3,0]),center_ratio=.45,+ outer_color=fade(color,color[3]//3),center_color=list(color),inner_color=fade(color),angle_start=[a0,a0+(a1-a0)*.5],angle_end=[a0+(a1-a0)*.2,a1],angle_easing='EaseOutCubic',angle_fade=[20,6]),+ alpha_texture=tex('T_NoiseStreak01'),alpha_scroll=[flow,0],cutoff=[[0,broken],[45,broken+.08],[100,.8]],fade_in=1,fade_out=peak*.45,wrap='Clamp',emissive=2.0) | kw++def decay(layer,color,lag=6,stretch=2.2,name=None):+ """Emissive-to-smoke afterimage: the same stroke, alpha-blended grey, a few frames late and much longer lived, so the+ light goes out first and the shape lingers as smoke instead of the whole effect vanishing at once."""+ life=layer.get('life',20); life=[round(l*stretch) for l in life] if isinstance(life,(list,tuple)) else round(life*stretch)+ out={k:v for k,v in layer.items() if k not in('emissive','color_curve','color_end','edge')}+ if 'ring' in out:out['ring']=out['ring']|dict(outer_color=fade(color,color[3]//3),center_color=list(color),inner_color=fade(color))+ scroll=layer.get('alpha_scroll')+ return out|dict(name=name or layer['name']+' smoke',color=list(color),blend='Blend',delay=layer.get('delay',0)+lag,life=life,+ fade_in=3,fade_out=(max(life) if isinstance(life,list) else life)*.6,**({'alpha_scroll':[scroll[0]*.4,scroll[1]*.4]} if scroll else {}))++def slice_line(name,color,length,width=.06,angle=0,life=12,delay=0,**kw):+ """A very long, very thin accent line (aspect > 40:1) that shoots out to full length and thins away: the single+ most expensive-looking stroke in a release. `width` is the visible thickness (T_Streak01's core is 8% of the card)."""+ return sprite(name,'T_Streak01',color,life=life,delay=delay,rotation=[0,0,angle],scale_start=[length*.35,width/.08,1],scale_end=[length*1.15,width/.08*.15,1],+ easing='EaseOutQuartic',fade_in=0,fade_out=life*.7,emissive=2.4) | kw++def spray(end,radius=.1):+ """Directional burst: particles fly to a random point in the world-space box `end` ([[x0,x1],[y0,y1],[z0,z1]]) instead of+ a symmetric sphere, so debris and sparks follow the hit through the target. Use with travel easing on the layer."""+ return dict(spawn=dict(shape='Sphere',radius=[0,radius],rotate=False),travel=dict(end=[list(a) for a in end],easing='EaseOutCubic'))++def debris(name,count,end,color=(118,104,96,255),size=(.12,.3),life=(30,46),gravity=.004,floor=None,delay=0,**kw):+ """Dark tumbling rock chunks thrown along `end` (see spray): value contrast against the light, and they land."""+ hit=dict(collide=dict(height=floor,bounce=[.15,.35],friction=.6,reduction=.2)) if floor is not None else {}+ return sprite(name,'T_Shard01',color,color_end=[int(c*.6) for c in color[:3]]+[255],count=count,life=list(life),delay=delay,blend='Blend',+ rotation=[0,0,[-180,180]],spin=[0,0,[-12,12]],size=list(size),size_end=[size[0]*.8,size[1]*.8],forces=[dict(type='Gravity',gravity=[0,-gravity,0])],+ fade_in=0,fade_out=6,**spray(end),**hit) | kw++def orbit_band(name,color,inner_color,outer_color,radius,width,life,tilt=(-72,0,0),arc=(0,360),flow=-.03,delay=0,**kw):+ """A band lying in a tilted 3D plane (accretion disk, orbiting rune ring): an ellipse in perspective, with noise+ streaming round it. arc=(-90,90) is the far half (0 points up the tilted plane, away from the camera) and (90,270)+ the near half, so a core drawn between the two halves sits inside the band instead of on top of a sticker."""+ return dict(name=name,renderer='Ring',color=list(color),life=life,delay=delay,billboard='Fixed',rotation=list(tilt),+ ring=dict(vertices=96,outer=[radius,0],inner=[radius-width,0],center_ratio=.3,outer_color=list(outer_color),center_color=list(color),inner_color=list(inner_color),+ **({} if tuple(arc)==(0,360) else dict(angle_start=arc[0],angle_end=arc[1]))),+ alpha_texture=tex('T_NoiseStreak01'),alpha_scroll=[flow,0],fade_in=4,fade_out=life*.3) | kw++def smoke(name,color,count=5,size=(.5,.9),grow=1.9,life=(30,48),delay=0,interval=0,speed=(.005,.02),rise=.0004,radius=(0,.25),texture='T_SmokeSheet01',**kw):+ """Alpha-blended puffs that grow and slow down. The default painted flipbook billows, curls and tears itself+ apart over life (a single still puff only scales), so the noise dissolve is light; still textures erode harder."""+ sheet=texture.endswith('Sheet01')+ extra=dict(flipbook=dict(x=4,y=4,frame_length=max(1,round(max(life)/16)),loop='Once'),cutoff=[[0,0],[60,.04],[100,.3]]) if sheet else dict(cutoff=[[0,0],[40,.1],[100,.7]])+ return sprite(name,texture,color,color_end=fade(color),count=count,life=list(life),delay=delay,interval=interval,blend='Blend',billboard='RotatedBillboard',+ spawn=dict(shape='Sphere',radius=list(radius)),velocity=[0,list(speed),0],rotation=[0,0,[-180,180]],spin=[0,0,[-.6,.6]],+ size=list(size),size_end=[size[0]*grow,size[1]*grow],easing='EaseOutCubic',forces=[dict(type='Gravity',gravity=[0,rise,0])],+ alpha_texture='T_NoiseTile01',fade_in=2,fade_out=10,**extra) | kw++def flame(name,color,color_end,size,life,count=1,**kw):+ """Fire tongues without a drawn flame: the painted turbulent explosion flipbook grows up from its base, cools+ white -> colour -> colour_end and is eaten away by noise with a hot rim. A sprite with a+ recognisable flame silhouette (the old T_FlameSheet01 / T_Flame02) reads as clip art and was dropped for that."""+ peak=max(life) if isinstance(life,(list,tuple)) else life+ cool=[(a+b)//2 for a,b in zip(color[:3],color_end[:3])]+[200]+ return sprite(name,'T_ExplosionSheet01',**ramp((0,(255,245,215,255)),(18,color),(55,cool),(100,list(color_end))),count=count,life=life,size=size,+ billboard='YAxisFixed',pivot='bottom',flipbook=dict(x=4,y=4,frame_length=max(1,round(peak/16)),loop='Once'),+ # No UV distortion: on a 4x4 sheet it is measured in whole-texture UV, so .12 shifts half a cell and samples the+ # neighbouring frames, cutting the fire into hard-edged blocks.+ alpha_texture='T_NoiseTile01',cutoff=[[0,.04],[40,.14],[100,.75]],edge=dict(color=[255,90,20,255],threshold=.06,scaling=2),+ fade_in=1,fade_out=8,emissive=1.5) | kw++def ramp(*stops):+ """Colour over life as a gradient: ramp((0,white),(30,orange),(100,red)) -> color_curve; percent of life, RGBA 0-255.++ A two-colour lerp reads as a tint; fire that cools white -> yellow -> orange -> red -> smoke needs 3+ stops."""+ return dict(color=list(stops[0][1]),color_curve={ch:[[p,c[i]] for p,c in stops] for i,ch in enumerate('RGBA')})++def billow(name,stops,size,life,count=1,frames=16,texture='T_ExplosionSheet01',grid=(4,4),**kw):+ """Painted flipbook billow played once over the particle's life: the shape itself rolls, opens and breaks up."""+ kw={'blend':'Add',**kw}+ return sprite(name,texture,**ramp(*stops),count=count,life=life,size=size,flipbook=dict(x=grid[0],y=grid[1],frame_length=max(1,round((max(life) if isinstance(life,(list,tuple)) else life)/frames)),loop='Once'),+ rotation=[0,0,[-180,180]],billboard='RotatedBillboard',fade_in=0,fade_out=4) | kw++def heat_haze(name,size,life=30,delay=0,strength=.6,**kw):+ """Screen-space refraction (BackDistortion): bends whatever is behind it, the cue that sells heat and force."""+ return sprite(name,'T_DistortHaze01',WHITE,material='BackDistortion',distortion=strength,life=life,delay=delay,size=size,size_curve=[[0,.5],[25,1],[100,1.2]],+ billboard='Billboard',uv_scroll=[0,.006],fade_in=3,fade_out=life*.6) | kw++def distortion_ring(name,radius,life=14,delay=0,strength=1.0,ground=False,**kw):+ """Refractive shockwave: an expanding ring that pushes the background outward instead of drawing a line."""+ return sprite(name,'T_DistortRing01',WHITE,material='BackDistortion',distortion=strength,life=life,delay=delay,size=radius*2,size_curve=[[0,.15],[40,.75],[100,1]],+ billboard='Fixed' if ground else 'Billboard',rotation=[-90 if ground else 0,0,0],fade_in=0,fade_out=life*.7) | kw++def decal(name,texture,color,size,life,delay=0,spin=0,**kw):+ """Flat ground-plane sprite (rune, crack, scorch); depth-tested so characters stand on top of it."""+ return sprite(name,texture,color,life=life,delay=delay,billboard='Fixed',rotation=[-90,0,kw.pop('angle',0)],spin=[0,0,spin],position=[0,.05,0],size=size,z_test=True,fade_in=kw.pop('fade_in',4),fade_out=kw.pop('fade_out',life*.4)) | kw++def standing(name,texture,color,size,life,delay=0,**kw):+ """Upright camera-facing sprite that grows from its base."""+ return sprite(name,texture,color,life=life,delay=delay,billboard='YAxisFixed',pivot='bottom',scale_start=[size[0],size[1],1],fade_in=kw.pop('fade_in',0),fade_out=kw.pop('fade_out',life*.4)) | kw++def mesh(name,shape,color,life,radius=1,depth=2,texture=None,sides=40,rings=12,model=None,**kw):+ """Procedural Sphere/Cone/Cylinder shell, usually textured with a scrolling gradient.++ sides=6 gives a hexagonal crystal; model={...} passes extra procedural-model fields (ShapeNoise/*, Radius2...)."""+ spec={'Name':name,'Shape/PrimitiveType':shape,'Shape/Radius':radius,'Mesh/Divisions/X':sides,'Mesh/Divisions/Y':rings}+ # Cylinders/cones span DepthMin..DepthMax along their axis; 0..depth makes them stand on their origin.+ if shape!='Sphere':spec.update({'Shape/Depth':depth,'Shape/DepthMin':0,'Shape/DepthMax':depth})+ if 'radius2' in kw:spec['Shape/Radius2']=kw.pop('radius2')+ spec.update(model or {})+ layer=dict(name=name,renderer='Model',procedural_model=spec,color=list(color),life=life,fade_in=kw.pop('fade_in',3),fade_out=kw.pop('fade_out',life_max(dict(life=life))*.5))+ if texture:layer['texture']=tex(texture)+ for key in TEXTURE_KEYS[1:]:+ if key in kw:kw[key]=tex(kw[key])+ return layer | kw++def crystal(name,color,height,radius,life,edge=WHITE,**kw):+ """Faceted ice/arcane crystal: a six-sided cone mesh with a cellular texture and bright fresnel edges, so it has+ real silhouettes from every angle instead of a painted spike that always faces the camera."""+ # A Cone opens toward +Y (tip at the base), so the crystal is a six-sided Cylinder tapering to a near point instead.+ return mesh(name,'Cylinder',color,life,radius=radius,radius2=radius*.04,depth=height,sides=6,rings=2,texture='T_NoiseTile02',uv_scroll=[.002,.004],culling='Double',+ falloff=dict(begin=[*color[:3],40],end=list(edge),pow=2.2,blend='Add'),**kw)++def shell(name,color,radius,life=14,delay=0,pow=.35,**kw):+ """3D shock bubble: a sphere whose fresnel rim is the only visible part, expanding with ease-out. Reads as a+ volume from any angle where a camera-facing ring reads as a flat hoop."""+ # Front faces only: with both sides drawn, the inner back faces also read as 'edge' and fill the bubble in.+ return mesh(name,'Sphere',color,life,radius=1,sides=48,rings=24,scale_start=[radius]*3,scale_curve=[[0,.15],[35,.75],[100,1]],culling='Front',delay=delay,+ falloff=dict(begin=[0,0,0,0],end=[255,255,255,255],pow=pow,blend='Mul'),alpha_texture='T_NoiseTile01',cutoff=[[0,0],[30,.08],[100,.75]],+ fade_in=0,fade_out=life*.7) | kw # the rim tears open as it expands instead of fading as one balloon++def shell_fragments(name,color,radius,delay=80,life=28):+ """Six partial spherical sheets separate at expiry; geometry supplies gaps without shader assumptions."""+ pieces=[]+ for i in range(6):+ angle=math.radians(i*60+20)+ pieces.append(mesh(f'{name} {i+1}','Sphere',color,life,radius=1,sides=12,rings=16,+ model={'Mesh/AngleBeginEnd/X':0.0,'Mesh/AngleBeginEnd/Y':40.0,'Shape/DepthMin':-.7,'Shape/DepthMax':.85},+ scale_start=[radius]*3,scale_end=[radius*1.06]*3,rotation=[0,i*60,0],delay=delay,+ travel=dict(end=[math.cos(angle)*.65,.2 if i%2 else -.2,math.sin(angle)*.65],easing='EaseOutCubic'),+ spin=[(-1 if i%2 else 1)*.8,(-1 if i%2 else 1)*1.2,0],culling='Double',z_test=True,+ falloff=dict(begin=[20,70,150,30],end=[225,245,255,255],pow=.35,blend='Mul'),+ color_curve=ramp((0,color),(18,(160,215,255,230)),(65,(70,120,215,200)),(100,(0,0,0,0)))['color_curve'],+ fade_in=1,fade_out=10,emissive=2.0))+ return pieces++def tilted_ring(name,color,radius,life=14,delay=0,tilt=(-70,0,0),thickness=.3,**kw):+ """Shockwave ring lying in a 3D plane (ground, or across the line of a hit): an ellipse in perspective."""+ return shock_ring(name,color,radius,life=life,delay=delay,thickness=thickness,billboard='Fixed',rotation=list(tilt)) | kw++def column(name,color,radius,height,life,delay=0,scroll=(.003,-.02),**kw):+ """Volumetric light shaft: streaks scroll up a cylinder, a static gradient fades the top, fresnel softens the sides."""+ return mesh(name,'Cylinder',color,life,radius=radius,depth=height,texture='T_NoiseStreak02',uv_scroll=list(scroll),delay=delay,culling='Double',+ alpha_texture='T_GradientV01',alpha_wrap='Clamp',falloff=dict(begin=[255,255,255,255],end=[255,255,255,0],pow=1.6,blend='Mul')) | kw++def effect(id,name,category,element,duration,layers,attach='impact',peak=.1,impact=0,light=(1,.85,.6),loop=False,design='',delivery=None,flight=None,arc=None):+ """impact (0..1) and light drive the lab's flash and camera kick at peak; they are stage hints, not Effekseer data.++ delivery tells a game (and the Lab) how the effect is performed: {'kind':'self'} on the caster, 'melee' on the+ target at the strike, 'projectile' (with the projectile effect id) on the target when the shot arrives,+ 'targeted' called down on the target, 'area' centred on a caster that hits everything around it.+ Projectiles declare flight (seconds of the reference flight) and optional arc (metres of lift at mid-flight);+ their `infinite` layers emit until the game releases them on arrival.+ """+ entry=dict(id='VFX_'+id,name=name,category=category,element=element,duration=duration,loop=loop,attach=attach,peak=peak,impact=impact,light=list(light),seed=1729,layers=layers,design=design)+ for key,value in [('delivery',delivery),('flight',flight),('arc',arc)]:+ if value is not None:entry[key]=value+ return entry++def life_max(layer):+ life=layer.get('life',24);return max(life) if isinstance(life,(list,tuple)) else life++def lifetime(layer,start=0,release=0):+ """Latest frame at which this layer or any child can still be alive.++ `infinite` layers emit until the projectile is released, `release` frames after the effect starts.+ """+ life=life_max(layer)+ born=start+(max(release,layer.get('delay',0)) if layer.get('infinite') else layer.get('delay',0)+(layer.get('count',1)-1)*layer.get('interval',0))+ # Effekseer times a child's generation from its parent instance's creation, not from its death.+ return max([born+life]+[lifetime(child,born) for child in layer.get('children',[])])++def budget(layer):+ # A sustained emitter holds about life/interval instances at once, whatever its nominal count.+ count=math.ceil(life_max(layer)/max(layer.get('interval',1),1e-6)) if layer.get('infinite') else layer.get('count',1)+ return count*(1+sum(budget(child) for child in layer.get('children',[])))++# ---------------------------------------------------------------- recipe helpers++POP=[[0,.4],[18,1],[100,1.1]] # snap to size, then drift+DISSOLVE=[[0,0],[40,.06],[100,.9]] # hold solid, then erode through the alpha texture+# How a game performs each effect (manifest `delivery`); the Lab stages the exchange from it.+SELF=dict(kind='self'); MELEE=dict(kind='melee'); TARGETED=dict(kind='targeted')+# Trail layers keep the world position they were born at, so a moving projectile leaves them behind.+TRAIL=dict(location='WhenCreating',rotation='WhenCreating',scale='WhenCreating')++# Degrees T_Slash02's painted arc bows toward; `vfx texture-info T_Slash02` measures 108. Re-measure a replacement.+SLASH02_BULGE=105++def slash_set(colors,roll,sweep=(110,260),radius=1.5,offset=(0,0,.5),lean=-18,delay=1,life=14,texture='T_Trail01'):+ """Wide dim afterimage + saturated body + thin white-hot edge: one blade read at three widths.++ The ring faces the camera (leaned back by `lean`) and is rolled by `roll`; its centre is shifted so the+ middle of the swept arc passes through the anchor plus `offset`. Ring angles: 0 is up, 90 is left.+ """+ after,body,edge=colors+ mid=math.radians(sum(sweep)/2); r=math.radians(roll); x,y=-math.sin(mid),math.cos(mid)+ x,y=x*math.cos(r)-y*math.sin(r),x*math.sin(r)+y*math.cos(r)+ position=[offset[0]-radius*x,offset[1]-radius*y*math.cos(math.radians(lean)),offset[2]-radius*y*math.sin(math.radians(lean))]+ common=dict(tilt=(lean,0,roll),sweep=sweep,position=position)+ size=radius*2.3+ return [+ # The afterimage lags two frames and sits slightly inside the blade, so the cut reads as a fast motion smear.+ slash_arc('Afterimage',after,radius=radius*.94,width=radius*.8,life=life+3,delay=delay+2,texture=texture,depth=radius*.06,**common),+ slash_arc('Blade body',body,radius=radius,width=radius*.55,life=life,delay=delay,emissive=1.5,texture=texture,depth=radius*.1,flow=-.04,**common),+ slash_arc('Hot edge',edge,radius=radius*1.01,width=radius*.18,life=life-4,delay=delay,texture='T_Trail02',emissive=2.2,depth=radius*.1,**common),+ # The same sweep bends the background behind the blade.+ slash_arc('Refraction arc',WHITE,radius=radius*1.02,width=radius*.5,life=life,delay=delay,texture='T_DistortHaze01',material='BackDistortion',distortion=.7,cutoff=None,**common),+ # A hand-painted crescent held for a few frames gives the cel-animation "cut" that a swept ring alone lacks.+ # It lies in the blade's own plane (Fixed, same lean), so it tilts with the swing instead of facing the camera.+ sprite('Cel crescent','T_Slash02',edge,color_end=body,delay=delay+1,life=8,size=size,size_curve=[[0,.8],[20,1],[100,1.06]],billboard='Fixed',+ rotation=[lean,0,math.degrees(math.atan2(y,x))-SLASH02_BULGE],+ position=[offset[0]-x*size*.3,offset[1]-y*size*.3*math.cos(math.radians(lean)),offset[2]-y*size*.3*math.sin(math.radians(lean))+.1],+ alpha_texture='T_NoiseStreak01',cutoff=DISSOLVE,fade_in=0,fade_out=3,emissive=1.6),+ ]++def sustain(layer,interval):+ """Projectile emitter: one instance every `interval` frames until the game releases the handle on arrival."""+ return layer | dict(infinite=True,interval=interval,count=1)++def swing(layers,yaw,pitch=0):+ """Turn a blade's layers into a 3D swing plane: a pivot at the anchor yaws (and pitches) the whole set, so the arc is+ an ellipse cutting through space rather than a crescent painted on the screen. Children are timed from the pivot."""+ return [dict(name='Swing plane',renderer='None',life=max(lifetime(l) for l in layers),rotation=[pitch,yaw,0],children=list(layers))]++def contrast_pair(layer, dark_color=(32, 24, 20, 210)):+ """One fixed sprite plus a matching Blend underlay; rejects independently randomized geometry.++ This is a construction starting point, not a claim of independently reviewed quality.+ The renderer and background still decide whether an underlay or a front cut is useful.+ """+ from effekseer_ai.authoring import validate_layer+ import copy+ problems = validate_layer(layer)+ if problems:+ raise ValueError('; '.join(problems))+ if layer.get('renderer', 'Sprite') != 'Sprite':+ raise ValueError('contrast_pair demonstrates Sprite only; design Ring/Model pairing explicitly')+ if type(layer.get('count', 1)) is not int or layer.get('count', 1) != 1 or layer.get('infinite') or layer.get('children') or layer.get('spawn') or layer.get('forces'):+ raise ValueError('Use one deterministic particle without spawn/forces/children')+ if any(layer.get(k) for k in ('properties', 'curves', 'material_profile')):+ raise ValueError('Raw properties/curves or profiles can hide random geometry; use explicit layer fields')+ for field in ('life', 'size', 'size_end', 'delay', 'interval'):+ if field in layer and type(layer[field]) not in (int, float):+ raise ValueError(f'{field} must be fixed for a matched pair')+ for field in ('rotation', 'position', 'spin', 'velocity', 'acceleration', 'scale_start', 'scale_end'):+ if field in layer and any(type(v) not in (int, float) for v in layer[field]):+ raise ValueError(f'{field} must have fixed components')+ for field in ('start', 'end'):+ if field in layer.get('travel', {}) and any(type(v) not in (int, float) for v in layer['travel'][field]):+ raise ValueError('travel must have fixed components')+ if type(layer.get('flipbook', {}).get('start', 0)) is not int:+ raise ValueError('flipbook start must be fixed')+ if len(dark_color) != 4 or any(type(v) is not int or not 0 <= v <= 255 for v in dark_color):+ raise ValueError('dark_color must be integer RGBA 0..255')+ bright = copy.deepcopy(layer)+ dark = copy.deepcopy(layer)+ for key in ('emissive', 'color_curve', 'color_end', 'edge'):+ dark.pop(key, None)+ dark.update(name=layer['name']+' value underlay', blend='Blend', color=list(dark_color))+ if layer.get('color_curve'):+ alpha=layer['color_curve'].get('A', [[0,layer.get('color',[255]*4)[3]], [100,layer.get('color',[255]*4)[3]]])+ dark['color_curve']={ch:[[0,dark_color[i]],[100,dark_color[i]]] for i,ch in enumerate('RGB')}+ dark['color_curve']['A']=[[frame,value*dark_color[3]/255] for frame,value in alpha]+ return [dark, bright]++__all__=[name for name in dir() if not name.startswith('_') and name not in ('Path','math','ROOT','T')]+['math']diff --git a/skills/effekseer-vfx/scripts/vfxkit/reference.py b/skills/effekseer-vfx/scripts/vfxkit/reference.pynew file mode 100644index 0000000..46e408f--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/reference.py@@ -0,0 +1,157 @@+"""Local reference clips, explicit time mapping and honest approximate pixel analysis."""+from pathlib import Path+import json+import math+import shutil+import subprocess+import numpy as np+from PIL import Image, ImageDraw+from . import workflow+from . import evidence+++def checked_id(ident):+ if not isinstance(ident, str) or len(ident) != 24 or any(c not in '0123456789abcdef' for c in ident):+ raise ValueError('Invalid reference ID')+ return ident+++def read(ident):+ record = json.loads((evidence.store() / f'references/{checked_id(ident)}/manifest.json').read_text())+ if record.get('files') and not workflow.unchanged(record['files']):+ raise ValueError('Stored reference images changed; import the source again after removing this reference cache')+ return record+++def effect_time(media_time, start, slow):+ if not all(math.isfinite(v) for v in (media_time, start, slow)) or slow < 1:+ raise ValueError('Times must be finite and slow must be >= 1')+ return (media_time-start)/slow+++def analyse(paths, times):+ arrays = []+ for p in paths:+ with Image.open(p) as image:+ arrays.append(np.asarray(image.convert('RGB').resize((160, 100)), dtype=np.float32))+ frames = np.stack(arrays)+ base = np.median(frames[:min(3, len(frames))], axis=0)+ change = np.max(np.abs(frames-base), axis=-1)+ area = (change > 32).mean(axis=(1, 2))+ energy = change.mean(axis=(1, 2))/255+ camera = bool(np.mean(area > .6) > .4)+ peak = int(energy.argmax())+ active = np.flatnonzero(energy > max(float(energy.max())*.15, .002))+ return {'approximate': True, 'camera_or_full_screen_change': camera,+ 'onset': times[int(active[0])] if len(active) and not camera else None,+ 'peak': times[peak] if len(active) and not camera else None,+ 'end': times[int(active[-1])] if len(active) and not camera else None,+ 'largest_area_share': round(float(area.max()), 4) if not camera else None,+ 'timeline': [{'time': t, 'coverage': round(float(a), 4), 'change': round(float(e), 4)} for t, a, e in zip(times, area, energy)],+ 'limitations': ['compression, bloom and background mix values', 'camera/cuts/full-screen changes invalidate area timing',+ 'no world-size, emissive or particle-count inference']}+++def tiles(paths, labels, target, columns=4, width=400):+ if not paths or len(paths) != len(labels):+ raise ValueError('Each selected image needs a label')+ canvas = Image.new('RGB', (columns*width, math.ceil(len(paths)/columns)*280), '#17202c')+ draw = ImageDraw.Draw(canvas)+ for i, (path, label) in enumerate(zip(paths, labels)):+ with Image.open(path) as source:+ image = source.convert('RGB')+ image.thumbnail((width, 252))+ x, y = i%columns*width, i//columns*280+ canvas.paste(image, (x+(width-image.width)//2, y+28+(252-image.height)//2))+ draw.text((x+8, y+8), label, fill='white')+ target.parent.mkdir(parents=True, exist_ok=True)+ canvas.save(target)+ return workflow.relative(target)+++def import_clip(source, start=0., end=None, slow=1., roi=None, source_url='', fps=12):+ path = Path(source).resolve()+ if not path.is_file():+ raise FileNotFoundError(source)+ if not shutil.which('ffmpeg') or not shutil.which('ffprobe'):+ raise RuntimeError('ffmpeg and ffprobe are required')+ if not math.isfinite(start) or not math.isfinite(slow) or not 1 <= slow <= 32 or not 1 <= fps <= 30:+ raise ValueError('Finite start, slow 1..32 and fps 1..30 are required')+ probe = subprocess.run(['ffprobe', '-v', 'error', '-show_entries', 'format=duration', '-of', 'json', str(path)],+ capture_output=True, text=True, check=True, timeout=30)+ duration = float(json.loads(probe.stdout)['format']['duration'])+ end = duration if end is None else end+ if not math.isfinite(end) or not 0 <= start < end <= duration+.001 or end-start > 30:+ raise ValueError('Selection must be within the clip and at most 30 media seconds')+ if roi is not None and (len(roi) != 4 or any(type(v) is not int or v < 0 for v in roi) or roi[2] == 0 or roi[3] == 0):+ raise ValueError('ROI must be [x,y,width,height] in pixels')+ settings = {'source_sha256': workflow.file_hash(path), 'start': start, 'end': end, 'slow': slow, 'roi': roi, 'fps': fps}+ ident = workflow.digest(settings)[:24]+ folder = evidence.store() / f'references/{ident}'+ folder.mkdir(parents=True, exist_ok=True)+ if (folder/'manifest.json').is_file():+ return read(ident)+ filters = f'fps={fps}'+ if roi is not None:+ filters += f',crop={roi[2]}:{roi[3]}:{roi[0]}:{roi[1]}'+ # Keep a bounded image size and original aspect ratio; cropping is explicitly recorded.+ filters += ",scale=w='min(1280,iw)':h=-2"+ subprocess.run(['ffmpeg', '-v', 'error', '-y', '-ss', str(start), '-i', str(path), '-t', str(end-start),+ '-vf', filters, '-frames:v', '900', str(folder/'f%04d.png')],+ capture_output=True, text=True, check=True, timeout=120)+ paths = sorted(folder.glob('f*.png'))+ if not paths:+ raise RuntimeError('No reference frames decoded')+ times = [i/fps/slow for i in range(len(paths))]+ selected = sorted({round(i*(len(paths)-1)/min(11, len(paths)-1)) for i in range(min(12, len(paths)))}) if len(paths) > 1 else [0]+ overview = tiles([paths[i] for i in selected], [f'R f{i} effect {times[i]:.3f}s' for i in selected], folder/'overview.png')+ record = {'ok': True, 'reference_id': ident, **settings, 'source_url': source_url,+ 'duration_effect': (end-start)/slow, 'frames': [workflow.relative(p) for p in paths],+ 'times': times, 'overview': overview, 'analysis': analyse(paths, times),+ 'files': workflow.snapshot([*paths, workflow.ROOT/overview])}+ workflow.save_json(folder/'manifest.json', record)+ return record+++def frames(ident, start, end, count=12):+ if not 1 <= count <= 16 or not math.isfinite(start) or not math.isfinite(end) or not 0 <= start <= end:+ raise ValueError('Need an ordered nonnegative span and count 1..16')+ record = read(ident)+ candidates = [i for i, t in enumerate(record['times']) if start <= t <= end]+ if not candidates:+ raise ValueError('No stored frames in this span')+ indices = sorted({candidates[round(i*(len(candidates)-1)/max(1, min(count, len(candidates))-1))]+ for i in range(min(count, len(candidates)))})+ target = evidence.store()/f'references/{ident}/span_{workflow.digest([start,end,count])[:12]}.png'+ result = tiles([workflow.ROOT/record['frames'][i] for i in indices],+ [f'R f{i} effect {record["times"][i]:.3f}s' for i in indices], target)+ return {'ok': True, 'image': result, 'times': [record['times'][i] for i in indices]}+++def compare(ident, evidence_id, times, reference_times=None):+ record = read(ident)+ capture = evidence.read_capture(evidence_id)+ problems = evidence.capture_issues(capture)+ if problems:+ raise ValueError('Capture is stale: '+', '.join(problems))+ if not 1 <= len(times) <= 8 or any(not math.isfinite(t) or t < 0 for t in times):+ raise ValueError('Need 1..8 nonnegative effect times')+ rt = times if reference_times is None else reference_times+ if len(rt) != len(times) or any(not math.isfinite(t) or not 0 <= t <= record['duration_effect'] for t in rt):+ raise ValueError('Reference times must match times and stay within the selection')+ rendered = {int(Path(p).stem.rsplit('_f', 1)[1]):p for p in capture['frames'] if '_f' in Path(p).stem}+ paths, labels, pairs = [], [], []+ for t, rtime in zip(times, rt):+ target_frame = max(1, round(t*60))+ if target_frame not in rendered:+ raise ValueError(f'Frame {target_frame} was not captured; review with key_frames including this frame')+ index = min(range(len(record['times'])), key=lambda i:abs(record['times'][i]-rtime))+ paths += [workflow.ROOT/record['frames'][index], workflow.ROOT/rendered[target_frame]]+ labels += [f'R {record["times"][index]:.3f}s', f'S f{target_frame} {target_frame/60:.3f}s']+ pairs.append({'requested': t, 'rendered_frame': target_frame, 'reference_time': record['times'][index]})+ target = evidence.store()/f'references/{ident}/compare_{evidence_id}_{workflow.digest([times,rt])[:8]}.png'+ return {'ok': True, 'image': tiles(paths, labels, target, columns=2, width=640), 'pairs': pairs,+ 'note': 'Compare proportions and rhythm; views retain their own aspect ratio and recorded crop.'}diff --git a/skills/effekseer-vfx/scripts/vfxkit/review.py b/skills/effekseer-vfx/scripts/vfxkit/review.pynew file mode 100644index 0000000..2a32593--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/review.py@@ -0,0 +1,368 @@+"""Motion review: render a clean frame sequence in Godot and tile it into one filmstrip per effect.++Three stills cannot show timing. A strip shows anticipation, peak, follow-through and dissipation+at a glance, so an agent can judge and iterate on motion instead of on a single lucky frame.+"""+import json,subprocess,shutil,sys,re,threading,time+from pathlib import Path+from . import workflow, briefs, evidence+from .paths import ROOT, godot as godot_path+import numpy as np+from PIL import Image,ImageDraw+CROP=(160,60,1200,740) # both dummies, the flight path and boss-sized areas in the 1280x800 combat view, UI hidden++# Flag thresholds, calibrated on a 20-effect library render (--step 3) checked tile by tile.+# - Energy alone undercounts alpha-blended dark smoke on the dark stage (Fire_Explosion read "dead" at f30+# while smoke stayed visible to f54), so a frame also counts as active while 0.4% of the stage changes.+# - Pure white is also the colour of sustained hot bodies (Holy_Pillar's core beam, Ice_Spikes' spikes), so+# the flash is only the contiguous run around the contact frame that stands above the white level the+# effect holds before it (Magic_Charge's growing core read as a 28-frame flash at --step 4) and after it.+# Sampled every 3-4 frames, a 5-frame contact plus its bloom spans up to 3 samples; the longest legitimate+# run was Ice_Spikes' erupting white spikes at 12 frames, so the bar sits there.+# - A projectile's centroid and radius follow the flight path the game chose, not the element's own+# motion, so the rise/inward checks skip category 'projectile' (Projectile_Dark read as "expanding").+# - Strips use the combat staging (dummies at both ends, farther camera, wider crop): effects cover ~0.77x the+# area inside a 1.26x larger crop, so the absolute coverage bars were scaled by ~0.6 (0.4% -> 0.25%, cut off+# 2% -> 1.2%) and re-checked on a full-library render.+# - Only fire must rise: references/craft.md lets holy descend or rise, and ground seals that outlast+# a pillar pull the centroid down at the end without anything sinking.+ACTIVE_FRACTION=.05 # a frame is "active" while its change energy is at least 5% of the peak frame's ...+VISIBLE_COVERAGE=.0025 # ... or at least 0.25% of the stage changes (the same bar as "barely visible")+CUT_OFF_COVERAGE=.012 # last frame still changes this much of the stage+DEAD_TAIL=.35 # flag when the inactive tail exceeds 35% of the duration (and 6 frames)+FLASH_SPAN=12 # contact flash should be gone within ~12 sampled frames+FLASH_SETTLE=30 # frames on each side of contact whose median white is the level the effect sustains+HOT_LUMA=.85 # white-hot pixel+RISING={'fire'}++def front_app():+ """(pid, bundle path) of the frontmost macOS app; (None, None) elsewhere."""+ if sys.platform!='darwin' or not shutil.which('lsappinfo'):return None,None+ asn=subprocess.run(['lsappinfo','front'],capture_output=True,text=True).stdout.strip()+ info=subprocess.run(['lsappinfo','info','-only','pid',asn],capture_output=True,text=True).stdout+subprocess.run(['lsappinfo','info','-only','bundlepath',asn],capture_output=True,text=True).stdout+ pid=re.search(r'pid = (\d+)',info); bundle=re.search(r'bundle path="([^"]+)"',info)+ return (int(pid.group(1)) if pid else None),(bundle.group(1) if bundle else None)++NO_WINDOW=('Godot started but rendered no frame within {seconds} s. Most likely it could not open its window: the review '+ 'needs a real window on the logged-in desktop, which a sandboxed agent (for example Codex in its workspace sandbox) or '+ 'a session without a desktop (SSH, CI) cannot open; check the Godot output below for another cause. Run this command '+ 'outside the sandbox with the user\'s approval, or, if the agent cannot leave its sandbox, give the user the exact '+ 'command to run in a terminal on their desktop. Godot output: {tail}')++def run_windowed(command,timeout,progress=None,startup=90):+ """Run a windowed Godot capture without taking the user's foreground: Godot activates itself on launch (and again+ when the Lab parks its window), so while it runs, focus is handed straight back to the app that was in front.++ `progress()` says whether the capture has produced anything yet; if it has not after `startup` seconds, Godot could+ not open its window, and the run stops with that explanation instead of waiting for the full timeout."""+ _,bundle=front_app()+ proc=subprocess.Popen(command,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True)+ def give_back():+ while proc.poll() is None:+ if front_app()[0]==proc.pid:subprocess.run(['open','-a',bundle],capture_output=True)+ time.sleep(.1)+ if bundle:threading.Thread(target=give_back,daemon=True).start()+ started=time.monotonic()+ while True:+ try:+ out,err=proc.communicate(timeout=2) # retrying communicate after a timeout loses no output+ break+ except subprocess.TimeoutExpired:+ waited=time.monotonic()-started+ if progress and waited>startup and not progress():+ proc.kill(); out,err=proc.communicate()+ raise RuntimeError(NO_WINDOW.format(seconds=startup,tail=(out+err)[-1500:].strip() or '(none)'))+ if waited>timeout:+ proc.kill(); raise+ return subprocess.CompletedProcess(command,proc.returncode,out,err)++def sample_plan(entry,step=4,key_frames=None):+ if type(step) is not int or not 1<=step<=60:raise ValueError('step must be an integer 1..60')+ end=int(entry['duration']*60)+ if step>end:raise ValueError('step must not exceed the effect duration in frames')+ keys=briefs.keyframes(entry,briefs.read(entry['id']))+(key_frames or [])+ if any(type(f) is not int or not 1<=f<=end+12 for f in keys):raise ValueError('key frames must be integer frames within effect + 12')+ return sorted(set(range(step,end+1,step))|set(keys)|{end+6})++def frame_state(frames,rid,expected):+ shots={int(p.stem.rsplit('_f',1)[1]):p for p in frames.glob(rid+'_f*.png')}+ missing=sorted(({0}|set(expected))-set(shots))+ moving=False+ if 0 in shots:+ with Image.open(shots[0]) as image:base=np.asarray(image.convert('RGB'),dtype=np.int16)+ for f in expected:+ if f not in shots:continue+ with Image.open(shots[f]) as image:current=np.asarray(image.convert('RGB'),dtype=np.int16)+ if current.shape!=base.shape:missing.append(f);continue+ if np.abs(current-base).max()>24:moving=True+ status='missing_frames' if missing else 'complete' if moving else 'inconclusive'+ return {'status':status,'expected':expected,'actual':sorted(shots),'missing':missing,+ 'activity_observed':moving,'note':'No pixel activity may mean an unplayed effect or a legitimately faint effect; inspect logs and frames.' if not moving else ''}++def capture(ids=None,step=4,bright=False,output=None,godot=None,timeout=900,note='',key_frames=None,view='standard',profile='default'):+ if view not in ('standard','close'):raise ValueError('view must be standard or close')+ if profile not in ('default','bare'):raise ValueError('profile must be default or bare')+ godot=godot or godot_path()+ project=ROOT/'vfx/godot'; out=Path(output or ROOT/'vfx/previews/strips').resolve()+ if view!='standard' or profile!='default':out=out/'variants'/f'{view}_{profile}'+ if not (project/'vfx_manifest.json').is_file():raise FileNotFoundError('vfx/godot is missing; run vfx init and vfx build first')+ entries={e['id']:e for e in json.loads((project/'vfx_manifest.json').read_text())}+ ids=ids or list(entries)+ unknown=sorted(set(ids)-set(entries))+ if unknown:raise ValueError(f'Unknown effect IDs: {unknown}')+ for rid in ids:workflow.effect_id(rid)+ plans={rid:sample_plan(entries[rid],step,key_frames) for rid in ids}+ for rid in ids:+ if evidence.read_build(rid):+ problems=evidence.build_issues(rid)+ if problems:raise RuntimeError(f'{rid}: build again before review: {problems}')+ sync=evidence.template_issues()+ if sync:raise RuntimeError('Sync the Lab before review: '+', '.join(sync))+ dependency_state={rid:evidence.dependencies(entries[rid]) for rid in ids}+ out.mkdir(parents=True,exist_ok=True); suffix='_bright' if bright else ''+ # Distinct run directories retain previous evidence and prevent partial review erasing sibling frames.+ import uuid+ run_id=uuid.uuid4().hex+ frames=out/'runs'/run_id/'frames';frames.mkdir(parents=True)+ plan_path=out/'runs'/run_id/'plan.json';workflow.save_json(plan_path,plans)+ metrics_path=out/('metrics_bright.json' if bright else 'metrics.json')+ previous=json.loads(metrics_path.read_text()) if metrics_path.is_file() else {}+ for rid in ids:+ if (out/f'{rid}{suffix}.png').is_file():shutil.copy2(out/f'{rid}{suffix}.png',out/f'{rid}{suffix}.prev.png')+ stage=evidence.stage_snapshot()+ imported=subprocess.run([godot,'--headless','--editor','--path',str(project),'--import'],capture_output=True,text=True,timeout=timeout)+ if imported.returncode or 'SCRIPT ERROR:' in imported.stdout+imported.stderr:raise RuntimeError(f'Godot import failed: {imported.stderr[-3000:]}')+ pending=list(ids);logs=[];states={}+ for attempt in range(3):+ for rid in pending:+ for shot in frames.glob(rid+'_f*.png'):shot.unlink()+ command=[godot,'--path',str(project),'--fixed-fps','60','--','--strip='+str(frames),f'--step={step}',+ '--ids='+','.join(pending),'--sample-plan='+str(plan_path),'--review-view='+view]+ if bright:command.append('--bright')+ if profile=='bare':command.append('--bare')+ run=run_windowed(command,timeout,progress=lambda:any(frames.glob('*.png')))+ logs.append(run.stdout+run.stderr); (frames.parent/'strip.log').write_text('\n'.join(logs))+ if run.returncode or 'SCRIPT ERROR:' in run.stdout+run.stderr:raise RuntimeError(f'Godot strip capture failed ({run.returncode}): {(run.stdout+run.stderr)[-3000:]}')+ for rid in pending:states[rid]=frame_state(frames,rid,plans[rid])+ pending=[rid for rid in pending if states[rid]['status']!='complete']+ if not pending:break+ if any(s['missing'] for s in states.values()):raise RuntimeError('Incomplete capture: '+json.dumps(states))+ if stage!=evidence.stage_snapshot():raise RuntimeError('Stage changed while capturing; discard this run')+ if dependency_state!={rid:evidence.dependencies(entries[rid]) for rid in ids}:raise RuntimeError('Staged dependencies changed while capturing; discard this run')+ sheets=[];compares=[];details={};proofs={};report={}+ legacy_frames=out/('frames_bright' if bright else 'frames');legacy_frames.mkdir(exist_ok=True)+ for rid in ids:+ shots=sorted(frames.glob(rid+'_f*.png'))[1:]+ target=out/f'{rid}{suffix}.png';sheets.append(str(sheet(rid,shots,target,entries[rid],key_frames=briefs.keyframes(entries[rid],briefs.read(rid)))))+ before=out/f'{rid}{suffix}.prev.png'+ if before.is_file():compares.append(str(compare_sheet(before,target,out/f'{rid}{suffix}_compare.png')))+ keys=sorted(set(briefs.keyframes(entries[rid],briefs.read(rid))+(key_frames or [])))+ detail_paths=[frames/f'{rid}_f{f:03d}.png' for f in keys if (frames/f'{rid}_f{f:03d}.png').is_file()]+ detail_target=out/'runs'/run_id/f'{rid}_keyframes.png'+ sheet(rid,detail_paths,detail_target,entries[rid],columns=3,width=600,key_frames=keys,max_tiles=len(keys))+ details[rid]={'sheet':str(detail_target),'frames':[str(p) for p in detail_paths]}+ # Metrics keep uniform sampling: irregular keyframes do not inherit old step-based thresholds.+ metric_frames=frames.parent/'metrics';metric_frames.mkdir(exist_ok=True)+ for p in frames.glob(rid+'_f*.png'):+ f=int(p.stem.rsplit('_f',1)[1])+ if f==0 or (f%step==0 and f<=int(entries[rid]['duration']*60)):shutil.copy2(p,metric_frames/p.name)+ report[rid]=metrics(rid,metric_frames,entries[rid],step)+ for p in legacy_frames.glob(rid+'_f*.png'):p.unlink()+ for p in frames.glob(rid+'_f*.png'):shutil.copy2(p,legacy_frames/p.name)+ # Immutable image copies, so a new review cannot mutate an older report's evidence.+ immutable=frames.parent/target.name;shutil.copy2(target,immutable)+ with Image.open(shots[0]) as image:resolution=list(image.size)+ states[rid]['log']={'path':workflow.relative(frames.parent/'strip.log'),'sha256':workflow.file_hash(frames.parent/'strip.log')}+ config={'view':view,'profile':profile,'bright':bright,'step':step,'key_frames':keys,'seed':entries[rid].get('seed',1729),+ 'fps':60,'resolution':resolution,+ 'engine_log':run.stdout.splitlines()[:4]}+ config['profile']=profile+('_bright' if bright else '')+ proof=evidence.write_capture(rid,[immutable,detail_target],list(frames.glob(rid+'_f*.png')),config,states[rid],stage,entries[rid],note)+ proofs[rid]=proof['evidence_id']+ metrics_path.write_text(dump_metrics(previous|report))+ changes={rid:diff(previous.get(rid),report[rid]) for rid in ids if rid in previous}+ history=[str(record(out,rid+suffix,report[rid],note,proofs[rid])) for rid in ids]+ return {'ok':not pending,'sheets':sheets,'compare':compares,'metrics':str(metrics_path),+ 'flags':{rid:m['flags'] for rid,m in report.items() if m['flags']},'changes':{rid:c for rid,c in changes.items() if c},+ 'history':history,'details':details,'evidence':proofs,'capture':states,'view':view,'profile':profile}++def metrics(rid,frames,entry,step=4):+ """Per-frame change energy, brightness layering and motion from viewport pixel differences.++ A reading aid for the strips, not a GPU or overdraw measurement. energy is the stage-wide mean change+ magnitude (0-1), so a large faint smoke and a small white flash are comparable; coverage is the share of+ changed pixels; white the share of changed pixels at pure white.+ """+ shots=sorted(frames.glob(rid+'_f*.png'))+ base=np.asarray(Image.open(shots[0]).convert('RGB').crop(CROP),dtype=np.int16); timeline=[]+ h,w=base.shape[:2]; yy,xx=np.mgrid[0:h,0:w]; scale=float(h)+ for shot in shots[1:]:+ image=np.asarray(Image.open(shot).convert('RGB').crop(CROP),dtype=np.int16)+ delta=np.abs(image-base).max(axis=2); changed=delta>18; weight=delta*changed; total=float(weight.sum())+ luma=(.2126*image[...,0]+.7152*image[...,1]+.0722*image[...,2])/255+ t={'frame':int(shot.stem.rsplit('_f',1)[1]),'coverage':round(float(changed.mean()),4),'white':round(float((np.all(image>250,axis=2)&changed).mean()),4),+ 'energy':round(total/(255*h*w),5)}+ if changed.any():+ top=image.max(axis=2); saturation=(top-image.min(axis=2))/np.maximum(top,1); lit=luma[changed]+ t['layers']=[round(float((lit>HOT_LUMA).mean()),3),round(float(((saturation[changed]>.4)&(lit>=.2)&(lit<=HOT_LUMA)).mean()),3),round(float((lit<.2).mean()),3)]+ cx=float((weight*xx).sum()/total); cy=float((weight*yy).sum()/total)+ t['centre']=[round(cx/scale,3),round(1-cy/scale,3)] # stage units of its height, y up+ t['radius']=round(float((weight*np.hypot(xx-cx,yy-cy)).sum()/total/scale),3)+ timeline.append(t)+ visible=[t['frame'] for t in timeline if t['coverage']>.0004] # a handful of embers still counts as visible+ last=max(visible) if visible else 0; total=entry['duration']*60+ peak=max(timeline,key=lambda t:t['energy']); widest=max(timeline,key=lambda t:t['coverage'])+ active=[t for t in timeline if (peak['energy']>0 and t['energy']>=peak['energy']*ACTIVE_FRACTION) or t['coverage']>=VISIBLE_COVERAGE]+ last_active=active[-1]['frame'] if active else 0+ whitest=max(timeline,key=lambda t:t['white'])+ contact=whitest if whitest['white']>=.001 else peak+ flash_span=0+ if whitest['white']>=.001:+ # Contiguous samples around contact that stay above halfway between its white and the level the effect+ # holds on that side: a charge's growing core before the release and a beam after it are not the flash.+ whites=[t['white'] for t in timeline]; i=j=timeline.index(whitest); window=max(3,FLASH_SETTLE//step)+ def bar(side):return (float(np.median(side)) if side else 0.)*.5+whites[i]*.5+ before=bar(whites[max(0,i-window):i]); after=bar(whites[i+1:i+1+window])+ while i>0 and whites[i-1]>=before:i-=1+ while j<len(whites)-1 and whites[j+1]>=after:j+=1+ flash_span=timeline[j]['frame']-timeline[i]['frame']+step+ by_frame={t['frame']:t for t in timeline}+ def at(frame):return by_frame.get(frame,{})+ motion={}+ end=at(last_active)+ if 'centre' in contact and 'centre' in end and last_active>contact['frame']:+ motion['drift_up']=round(end['centre'][1]-contact['centre'][1],3); motion['spread']=round(end['radius']/max(contact['radius'],1e-3),2)+ first=active[0] if active else {}+ before_contact=[t for t in active if t['frame']<contact['frame'] and 'radius' in t]+ if first and len(before_contact)>=3 and contact['frame']-first['frame']>=12:+ motion['charge_spread']=round(before_contact[-1]['radius']/max(before_contact[0]['radius'],1e-3),2)+ flags=[]+ if widest['coverage']<VISIBLE_COVERAGE:flags.append(f'barely visible: under {VISIBLE_COVERAGE:.2%} of the stage changes at its strongest frame')+ if total-last_active>max(6,total*DEAD_TAIL):flags.append(f'dead tail: under {ACTIVE_FRACTION:.0%} of peak energy and {VISIBLE_COVERAGE:.2%} of the stage after frame {last_active} of {round(total)}; shorten duration or keep the dissipation visible')+ if sum(t['white']>.1 for t in timeline)>2:flags.append('blown out: over 10% pure white for more than two sampled frames')+ if not entry.get('loop') and visible and timeline[-1]['coverage']>CUT_OFF_COVERAGE:flags.append('cut off: still clearly visible on the last frame')+ if entry.get('impact',0)>=.3:+ expected=entry.get('peak',0)*60+ if abs(contact['frame']-expected)>max(6,2*step):flags.append(f"off-peak contact: brightest at frame {contact['frame']} but manifest peak is frame {expected:.0f}; the Lab flash and camera kick land elsewhere")+ if flash_span>FLASH_SPAN:flags.append(f'lingering flash: near-peak white lasts {flash_span} frames; contact should be 2-5')+ layering=peak.get('layers')+ if layering and widest['coverage']>=VISIBLE_COVERAGE:+ if layering[0]<.005:flags.append('no white-hot core: almost no pixel above 85% brightness at the peak frame')+ if layering[1]<.03:flags.append('washed out: almost no saturated mid-tone body at the peak frame')+ travelling=entry.get('category')=='projectile'+ if not travelling and entry.get('element') in RISING and motion.get('drift_up',0)<-.04:flags.append(f"sinks: {entry['element']} mass moves down {-motion['drift_up']:.2f} stage heights after contact; it should rise")+ if not travelling and entry.get('element')=='dark' and motion.get('charge_spread',1)>1.1:flags.append(f"expands while charging: radius grows {motion['charge_spread']}x before the release; dark should draw inward")+ return {'peak_frame':peak['frame'],'peak_coverage':widest['coverage'],'peak_energy':peak['energy'],'contact_frame':contact['frame'],'flash_span':flash_span,+ 'last_visible_frame':last,'last_active_frame':last_active,'duration_frames':round(total),'layering':layering,'motion':motion,'flags':flags,'timeline':timeline}++def dump_metrics(report):+ """Tracked baseline: one line per field and per timeline frame, so it stays small and diffs by frame."""+ line=lambda value:json.dumps(value,separators=(',',':'))+ effects=[]+ for rid,entry in report.items():+ fields=[f' {json.dumps(k)}: {line(v)}' for k,v in entry.items() if k!='timeline']+ if 'timeline' in entry:fields.append(' "timeline": [\n'+',\n'.join(' '+line(t) for t in entry['timeline'])+'\n ]')+ effects.append(f' {json.dumps(rid)}: {{\n'+',\n'.join(fields)+'\n }')+ return '{\n'+',\n'.join(effects)+'\n}\n'++def diff(old,new):+ """What this round changed, by flag kind (text before the colon) and key timings."""+ if not old:return {}+ kind=lambda flags:{f.split(':')[0] for f in flags}+ out={}+ added=sorted(kind(new['flags'])-kind(old.get('flags',[]))); resolved=sorted(kind(old.get('flags',[]))-kind(new['flags']))+ if added:out['flags_added']=added+ if resolved:out['flags_resolved']=resolved+ for key in ['peak_frame','contact_frame','last_active_frame','duration_frames']:+ if key in old and old[key]!=new[key]:out[key]=[old[key],new[key]]+ return out++def record(out,name,report,note='',evidence_id=None):+ """Append one line per review to history/<ID>.jsonl so later rounds (and agents) can see what was tried."""+ import datetime,hashlib+ recipe=ROOT/f"vfx/recipes/{name.removesuffix('_bright')}.json"+ def git(*args):+ try:return subprocess.run(['git',*args],cwd=ROOT,capture_output=True,text=True,timeout=10).stdout.strip()+ except (OSError,subprocess.SubprocessError):return ''+ line={'evidence_id':evidence_id,'time':datetime.datetime.now().isoformat(timespec='seconds'),'note':note,'commit':git('rev-parse','--short','HEAD'),+ 'uncommitted':bool(git('status','--porcelain','vfx/src','vfx/briefs')),+ 'recipe_sha':hashlib.sha256(recipe.read_bytes()).hexdigest()[:12] if recipe.is_file() else None,+ **{k:report[k] for k in ['flags','peak_frame','contact_frame','last_active_frame','duration_frames','layering','motion']}}+ path=out/'history'/f'{name}.jsonl'; path.parent.mkdir(parents=True,exist_ok=True)+ with path.open('a') as f:f.write(json.dumps(line)+'\n')+ return path++def compare_sheet(before,after,target):+ """Previous strip above the new one, labelled, so one image shows whether the round helped."""+ a=Image.open(before).convert('RGB'); b=Image.open(after).convert('RGB'); width=max(a.width,b.width)+ canvas=Image.new('RGB',(width,a.height+b.height+48),(8,10,16)); draw=ImageDraw.Draw(canvas)+ draw.text((8,4),'BEFORE',fill=(255,140,120)); canvas.paste(a,(0,24))+ draw.text((8,a.height+28),'AFTER',fill=(140,255,160)); canvas.paste(b,(0,a.height+48))+ canvas.save(target); return target++def sheet(rid,shots,target,entry,columns=6,width=300,key_frames=None,max_tiles=18):+ # Long effects are thinned to at most 18 tiles so one image stays readable.+ if len(shots)>max_tiles:+ by_frame={int(p.stem.rsplit('_f',1)[1]):p for p in shots}+ picked={f for f in (key_frames or []) if f in by_frame}+ # Key moments are never dropped to meet a cosmetic tile cap.+ room=max(2,max_tiles-len(picked))+ picked.update(int(shots[round(i*(len(shots)-1)/(room-1))].stem.rsplit('_f',1)[1]) for i in range(room))+ shots=[by_frame[f] for f in sorted(picked)]+ scale=width/(CROP[2]-CROP[0]); height=round((CROP[3]-CROP[1])*scale)+ rows=(len(shots)+columns-1)//columns+ canvas=Image.new('RGB',(columns*width,rows*height+26),(8,10,16)); draw=ImageDraw.Draw(canvas)+ draw.text((8,6),f"{rid} {entry['duration']:.2f}s peak {entry.get('peak',0):.2f}s frames @60fps",fill=(200,215,230))+ for i,shot in enumerate(shots):+ tile=Image.open(shot).convert('RGB').crop(CROP).resize((width,height),Image.Resampling.LANCZOS)+ x,y=(i%columns)*width,26+(i//columns)*height+ canvas.paste(tile,(x,y)); draw.text((x+6,y+4),'f'+shot.stem.rsplit('_f',1)[1].lstrip('0'),fill=(255,230,120))+ canvas.save(target)+ return target++def overview(ids=None,columns=6,width=300,per_page=10,output=None):+ """Library pages from the last capture: one row per effect, frames spread over its duration.++ Without `ids` this is the library baseline that effect-verify checks: effects that were never captured are left+ out and listed in `missing`. With `ids` it is a scratch page (overview_select_*.png) that never replaces the baseline.+ """+ out=Path(output or ROOT/'vfx/previews/strips').resolve(); frames=out/'frames'+ manifest=json.loads((ROOT/'vfx/vfx_manifest.json').read_text())+ unknown=sorted(set(ids or [])-{e['id'] for e in manifest})+ if unknown:raise ValueError(f'Not in the built manifest: {unknown}')+ entries=[e for e in manifest if not ids or e['id'] in ids]+ def captured(entry):+ proof=evidence.latest(entry['id'])+ return bool(proof and proof['frames']) or any(frames.glob(entry['id']+'_f*.png'))+ missing=[e['id'] for e in entries if not captured(e)]+ if ids and missing:raise RuntimeError(f"{missing}: no captured frames; run vfx review --ids {' '.join(missing)} first")+ entries=[e for e in entries if e['id'] not in missing]+ if not entries:raise RuntimeError('No effect has been captured yet; run vfx review first')+ prefix='overview_select_' if ids else 'overview_'+ scale=width/(CROP[2]-CROP[0]); height=round((CROP[3]-CROP[1])*scale); pages=[]+ for start in range(0,len(entries),per_page):+ rows=entries[start:start+per_page]+ canvas=Image.new('RGB',(columns*width,len(rows)*(height+20)),(8,10,16)); draw=ImageDraw.Draw(canvas)+ for r,entry in enumerate(rows):+ proof=evidence.latest(entry['id'])+ shots=sorted((ROOT/p for p in proof['frames'] if not p.endswith('_f000.png'))) if proof else sorted(frames.glob(entry['id']+'_f*.png'))[1:]+ if not shots:raise RuntimeError(f"{entry['id']}: no captured frames; run the strip capture first")+ # Skip the empty tail: sample the first 85% of the timeline, where the effect actually lives.+ picks=[shots[min(len(shots)-1,round(i*(len(shots)*.85-1)/(columns-1)))] for i in range(columns)]+ y=r*(height+20); draw.text((6,y+4),f"{entry['id']} {entry['duration']:.2f}s",fill=(200,215,230))+ for i,shot in enumerate(picks):+ canvas.paste(Image.open(shot).convert('RGB').crop(CROP).resize((width,height),Image.Resampling.LANCZOS),(i*width,y+20))+ draw.text((i*width+6,y+24),'f'+shot.stem.rsplit('_f',1)[1].lstrip('0'),fill=(255,230,120))+ page=out/f'{prefix}{start//per_page+1}.png'; canvas.save(page); pages.append(str(page))+ if ids:+ return {'ok':True,'pages':pages,'note':'scratch page of the named effects only; run vfx overview without --ids for the baseline effect-verify checks'}+ # Pages left over from a larger library would otherwise look current.+ for stale in out.glob('overview_*.png'):+ if not stale.name.startswith('overview_select_') and str(stale) not in pages:stale.unlink()+ proofs={e['id']:evidence.latest(e['id']) for e in entries}+ workflow.save_json(evidence.store()/'overview.json',{'images':workflow.snapshot(map(Path,pages)),+ 'evidence':{rid:r['evidence_id'] for rid,r in proofs.items() if r and not evidence.capture_issues(r)}})+ return {'ok':True,'pages':pages,'missing':missing}+diff --git a/skills/effekseer-vfx/scripts/vfxkit/scaffold.py b/skills/effekseer-vfx/scripts/vfxkit/scaffold.pynew file mode 100644index 0000000..c7eff3e--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/scaffold.py@@ -0,0 +1,162 @@+"""Create or refresh the project's vfx/ workspace from the skill's Lab template and material profiles."""+from contextlib import contextmanager+from pathlib import Path+import fcntl+import hashlib+import json+import os+import shutil+import tempfile+import urllib.request+import zipfile+from .paths import ROOT, ASSETS, DOWNLOADS+from .ownership import guard++PLUGIN_URL = 'https://github.com/effekseer/EffekseerForGodot4/releases/download/1.80.5.1/EffekseerForGodot4-180_5_1.zip'+PLUGIN_SHA256 = '1a4987f748156b4707659e9b96b9e28dad42614e2862dc63ec0da8408e089cb6'+FOLDERS = ['src', 'briefs', 'textures/generated', 'textures/procedural', 'textures/processed', 'materials', 'effects', 'exports',+ 'previews', 'recipes', 'work', 'godot', 'characters']+GITIGNORE = '''# Local working files of the effekseer-vfx skill; the rest of vfx/ is the effect library.+/godot/+/work/+/previews/*+!/previews/strips/+/previews/strips/*+!/previews/strips/overview_*.png+/previews/strips/overview_select_*.png+!/previews/strips/metrics.json+'''+++@contextmanager+def toolchain_lock():+ """Serialise downloads into the shared EFFEKSEER_VFX_HOME across projects and processes."""+ DOWNLOADS.mkdir(parents=True, exist_ok=True)+ with (DOWNLOADS / '.lock').open('a') as stream:+ fcntl.flock(stream, fcntl.LOCK_EX)+ try:+ yield+ finally:+ fcntl.flock(stream, fcntl.LOCK_UN)+++def download(url, sha256, target):+ """A verified copy of `url` at `target`: downloaded to a private temporary file, checked, then moved in."""+ if target.is_file() and hashlib.sha256(target.read_bytes()).hexdigest() == sha256:+ return target+ target.parent.mkdir(parents=True, exist_ok=True)+ handle, name = tempfile.mkstemp(prefix='.download.', dir=target.parent)+ os.close(handle)+ temporary = Path(name)+ try:+ urllib.request.urlretrieve(url, temporary)+ actual = hashlib.sha256(temporary.read_bytes()).hexdigest()+ if actual != sha256:+ raise ValueError(f'Checksum mismatch for {url}: {actual}')+ temporary.replace(target)+ finally:+ temporary.unlink(missing_ok=True)+ return target+++def initialize(root=ROOT, install_plugin=True, update_templates=False):+ root = Path(root).resolve()+ vfx = root / 'vfx'++ def safe(path): # every write below goes through this first: no link may lead it outside vfx/+ return guard(path, vfx)+ for folder in FOLDERS:+ safe(vfx / folder / 'x')+ (vfx / folder).mkdir(parents=True, exist_ok=True)+ if not (vfx / '.gitignore').exists():+ safe(vfx / '.gitignore').write_text(GITIGNORE)+ for template, target in [(ASSETS / 'godot-lab', vfx / 'godot'), (ASSETS / 'materials', vfx / 'materials')]:+ for src in template.rglob('*'):+ if not src.is_file():+ continue+ dst = target / src.relative_to(template)+ if dst.exists() and not update_templates:+ continue+ safe(dst).parent.mkdir(parents=True, exist_ok=True)+ shutil.copy2(src, safe(dst))+ for dst in [vfx / 'vfx_manifest.json', vfx / 'godot/vfx_manifest.json']:+ if not dst.exists():+ safe(dst).write_text('[]\n')+ if not (vfx / 'texture_prompts.json').exists():+ safe(vfx / 'texture_prompts.json').write_text(json.dumps({'prompts': []}, indent=2) + '\n')+ # Starter painted textures: the primitives' defaults (smoke, wisps, billow, flame) must work in a fresh project.+ # Never overwrite a project's own texture; record the matching prompts so lint knows where they came from.+ starters = ASSETS / 'examples/textures'+ installed = []+ for source in sorted(starters.glob('*.png')):+ dst = vfx / 'textures/processed' / source.name+ if not dst.exists():+ shutil.copy2(source, safe(dst))+ installed.append(source.stem)+ prompts_path = vfx / 'texture_prompts.json'+ prompts = json.loads(prompts_path.read_text())+ known = {p['id'] for p in prompts['prompts']}+ shipped = json.loads((ASSETS / 'examples/texture_prompts.json').read_text())['prompts']+ missing = [p for p in shipped if p['id'] in installed and p['id'] not in known]+ if missing:+ prompts['prompts'] += missing+ safe(prompts_path).write_text(json.dumps(prompts, ensure_ascii=False, indent=2) + '\n')+ # Math primitives are regenerated, never versioned by hand.+ from .textures import masks, EXTRA_PROCEDURAL, procedural+ names = set(masks(8)) | EXTRA_PROCEDURAL+ if any(not (vfx / f'textures/{folder}/{n}.png').is_file() for n in names for folder in ('processed', 'procedural')):+ procedural(root=root, missing_only=True)+ # An already built library (fresh clone): make the Lab playable without a Core rebuild.+ tracked = json.loads((vfx / 'vfx_manifest.json').read_text())+ demo = vfx / 'godot/vfx_manifest.json'+ if tracked and not json.loads(demo.read_text()):+ for entry in tracked:+ source = vfx / f"effects/{entry['id']}.efkefc"+ if source.is_file():+ (vfx / 'godot/effects').mkdir(exist_ok=True)+ shutil.copy2(source, safe(vfx / 'godot/effects' / source.name))+ for resource in sorted((vfx / 'effects/resources').glob('*')) if (vfx / 'effects/resources').is_dir() else []:+ if resource.is_file():+ safe(vfx / 'godot/effects/resources' / resource.name).parent.mkdir(parents=True, exist_ok=True)+ shutil.copy2(resource, vfx / 'godot/effects/resources' / resource.name)+ shutil.copy2(vfx / 'vfx_manifest.json', safe(demo))+ # Optional rigged stand-ins: vfx/characters/player.glb and target.glb replace the Lab's capsule dummies.+ for source in sorted([*(vfx / 'characters').glob('*.glb'), *(vfx / 'characters').glob('*.materials.json')]):+ dst = vfx / 'godot/characters' / source.name+ if not dst.is_file() or dst.read_bytes() != source.read_bytes():+ safe(dst).parent.mkdir(parents=True, exist_ok=True)+ shutil.copy2(source, dst)+ addon = vfx / 'godot/addons/effekseer'+ if install_plugin and not (addon / 'plugin.cfg').is_file():+ with toolchain_lock():+ archive = download(PLUGIN_URL, PLUGIN_SHA256, DOWNLOADS / 'EffekseerForGodot4-180_5_1.zip')+ # Extract into a private folder (never a shared one another init could be rewriting), then copy the addon in.+ with tempfile.TemporaryDirectory(prefix='.plugin.', dir=vfx / 'work') as scratch:+ extracted = Path(scratch)+ with zipfile.ZipFile(archive) as z:+ for name in z.namelist():+ if not (extracted / name).resolve().is_relative_to(extracted.resolve()):+ raise ValueError('Unsafe plugin archive path')+ z.extractall(extracted)+ matches = list(extracted.glob('*/addons/effekseer/plugin.cfg'))+ if len(matches) != 1:+ raise ValueError('Expected one official Effekseer Godot addon')+ staged = vfx / 'work' / '.addon'+ shutil.rmtree(staged, ignore_errors=True)+ shutil.copytree(matches[0].parent, staged)+ license_file = matches[0].parents[2] / 'LICENSE'+ if license_file.is_file():+ shutil.copy2(license_file, staged / 'LICENSE')+ safe(addon / 'plugin.cfg')+ addon.parent.mkdir(parents=True, exist_ok=True)+ if addon.exists(): # an incomplete earlier install (no plugin.cfg); the addon folder is generated+ shutil.rmtree(addon)+ staged.replace(addon)+ if (addon / 'plugin.gd').is_file():+ # The editor plugin loads its icon through the import cache; read the PNG directly so a first import works.+ path = safe(addon / 'plugin.gd')+ text = path.read_text()+ text = text.replace('var icon = load(plugin_path + "/icon16.png") as Texture2D',+ 'var icon_image := Image.load_from_file(plugin_path + "/icon16.png")\n\tvar icon := ImageTexture.create_from_image(icon_image)')+ path.write_text(text)+ return {'ok': True, 'workspace': str(vfx), 'plugin_installed': (addon / 'plugin.cfg').is_file()}diff --git a/skills/effekseer-vfx/scripts/vfxkit/texture_audit.py b/skills/effekseer-vfx/scripts/vfxkit/texture_audit.pynew file mode 100644index 0000000..b52b202--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/texture_audit.py@@ -0,0 +1,102 @@+"""Pixel observations grouped by texture role; stylistic warnings are not build failures."""+from pathlib import Path+import io+import math+import numpy as np+from PIL import Image, ImageDraw+from . import workflow++ROLES = ('shape', 'light', 'symbol', 'trail', 'flipbook', 'uv_distortion', 'screen_distortion')+++def content(image):+ rgba = np.asarray(image.convert('RGBA'))+ return rgba[..., 3] / 255 if rgba[..., 3].min() < 255 else rgba[..., :3].mean(axis=2) / 255+++def cell_report(image):+ a = content(image)+ mask = a > 8/255+ y, x = np.where(mask)+ weight = a.sum()+ return {'coverage': round(float(mask.mean()), 4),+ 'bbox': [int(x.min()), int(y.min()), int(x.max())+1, int(y.max())+1] if len(x) else None,+ 'centroid': [round(float((a*np.indices(a.shape)[1]).sum()/weight/image.width), 4),+ round(float((a*np.indices(a.shape)[0]).sum()/weight/image.height), 4)] if weight else None,+ 'touches_border': bool(mask[0].any() or mask[-1].any() or mask[:, 0].any() or mask[:, -1].any()),+ 'small_coverage': {str(n): round(float((content(image.resize((n, n), Image.Resampling.LANCZOS)) > .1).mean()), 4) for n in (64, 32)}}+++def audit(name, role='shape', grid=None, loop=False, allow_empty=None):+ if role not in ROLES:+ raise ValueError(f'role must be one of {ROLES}')+ if not isinstance(name, str) or not name or any(c not in 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_' for c in name):+ raise ValueError('name must be a texture stem')+ path = workflow.ROOT / f'vfx/textures/processed/{name}.png'+ if not path.is_file():+ raise FileNotFoundError(f'vfx/textures/processed/{name}.png is missing')+ errors, warnings = [], []+ with Image.open(path) as original:+ image = original.convert('RGBA')+ result = {'name': name, 'role': role, 'size': list(image.size), 'sha256': workflow.file_hash(path)}+ if grid is not None or role == 'flipbook':+ grid = grid or [4, 4]+ if len(grid) != 2 or any(type(n) is not int or not 1 <= n <= 16 for n in grid):+ raise ValueError('grid must contain two integers 1..16')+ x, y = grid+ if image.width % x or image.height % y:+ errors.append('image dimensions are not divisible by grid')+ else:+ allow_empty = allow_empty or []+ if any(type(i) is not int or not 0 <= i < x*y for i in allow_empty):+ raise ValueError('allow_empty indices must be within the grid')+ cells = [image.crop((i % x * image.width//x, i//x * image.height//y,+ (i % x+1)*image.width//x, (i//x+1)*image.height//y)) for i in range(x*y)]+ reports = [cell_report(c) for c in cells]+ empty = [i for i, r in enumerate(reports) if r['coverage'] == 0]+ unexpected = sorted(set(empty)-set(allow_empty))+ if unexpected:+ warnings.append(f'Empty cells (may be intentional anticipation/exit): {unexpected}')+ clipped = [i for i, r in enumerate(reports) if r['touches_border']]+ if clipped:+ warnings.append(f'Cells touching a boundary: {clipped}')+ deltas = [round(float(np.abs(content(a)-content(b)).mean()), 4) for a, b in zip(cells, cells[1:])]+ held = [i+1 for i, d in enumerate(deltas) if d < .002]+ if held:+ warnings.append(f'Possible hold/repeated cells: {held}; confirm timing intent')+ if loop and float(np.abs(content(cells[0])-content(cells[-1])).mean()) > .15:+ warnings.append('Loop end differs substantially from start')+ result.update(grid=grid, cells=reports, empty_cells=empty, frame_change=deltas)+ else:+ result.update(cell_report(image))+ if result['touches_border'] and role not in ('trail', 'uv_distortion', 'screen_distortion'):+ warnings.append('Content touches image border; inspect clipping or intended crop')+ if role in ('shape', 'symbol') and result['coverage'] > 0 and result['small_coverage']['32'] < .005:+ warnings.append('Very little content survives at 32px; inspect game distance')+ if role == 'uv_distortion':+ rgba = np.asarray(image)+ if rgba[..., 3].min() != 255:+ errors.append('UV distortion requires opaque RG offsets')+ result['rg_mean'] = [round(float(rgba[..., i].mean()/255), 4) for i in (0, 1)]+ # A labelled preview at original scale plus checkerboard and small-size inspections.+ display = image.copy()+ if max(display.size) > 1024:+ display.thumbnail((1024, 1024))+ canvas = Image.new('RGB', (display.width+180, max(display.height, 432)+32), '#17202c')+ draw = ImageDraw.Draw(canvas)+ for y in range(32, canvas.height, 16):+ for x in range(display.width):+ if x % 16 == 0:+ draw.rectangle((x, y, x+15, y+15), fill='#4a5360' if ((x//16+y//16)%2) else '#303944')+ canvas.paste(display, (0, 32), display)+ draw.text((8, 8), name+' '+role, fill='white')+ for i, n in enumerate((128, 64, 32)):+ small = image.resize((n, n), Image.Resampling.LANCZOS)+ canvas.paste(small, (display.width+12, 32+i*144), small)+ draw.text((display.width+12, 16+i*144), f'{n}px', fill='white')+ preview = workflow.WORK / f'textures/{name}_{role}.png'+ preview.parent.mkdir(parents=True, exist_ok=True)+ canvas.save(preview)+ return {'ok': not errors, 'errors': errors, 'warnings': warnings, 'measurements': result,+ 'preview': workflow.relative(preview), 'manual_checks': ['silhouette', 'distance', 'role/style fit', 'temporal intent']}diff --git a/skills/effekseer-vfx/scripts/vfxkit/textures.py b/skills/effekseer-vfx/scripts/vfxkit/textures.pynew file mode 100644index 0000000..21be5d0--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/textures.py@@ -0,0 +1,137 @@+"""Deterministic math primitives: glows, rings, tileable noise, trails, distortion maps.++Complex hand-painted shapes (flame, slash, rune, smoke...) come from an image generation model and+are only post-processed; nothing here imitates them. Originals are never overwritten.+"""+from pathlib import Path+import numpy as np+from PIL import Image, ImageDraw+from .paths import ROOT+from .ownership import guard+# Procedural textures saved by procedural() outside masks(): the noise sprite, the cross, and the distortion maps.+EXTRA_PROCEDURAL={'T_Noise01','T_Cross01','T_Distort01','T_Distort02','T_DistortRing01','T_DistortHaze01'}++def spectral(n,beta=2.0,stretch=(1,1),seed=0):+ """Seamlessly tileable 1/f noise in 0..1; stretch>1 smears along that axis (y,x)."""+ rng=np.random.default_rng(seed)+ fy=np.fft.fftfreq(n)[:,None]*stretch[0]; fx=np.fft.fftfreq(n)[None,:]*stretch[1]+ f=np.sqrt(fx*fx+fy*fy); f[0,0]=1+ field=np.fft.ifft2(np.fft.fft2(rng.standard_normal((n,n)))/f**beta).real+ lo,hi=np.percentile(field,[1,99])+ return np.clip((field-lo)/(hi-lo),0,1)++def worley(n,cells=6,seed=0):+ """Tileable cellular noise: 0 at feature points, 1 on cell borders."""+ rng=np.random.default_rng(seed); pts=rng.random((cells*cells,2))+ y,x=np.mgrid[0:1:complex(n),0:1:complex(n)]; best=np.full((n,n),9.0)+ for py,px in pts:+ dy=np.abs(y-py); dx=np.abs(x-px)+ best=np.minimum(best,np.hypot(np.minimum(dy,1-dy),np.minimum(dx,1-dx)))+ return np.clip(best*cells*1.1,0,1)++def masks(n=256):+ y,x=np.mgrid[-1:1:complex(n),-1:1:complex(n)]; r=np.sqrt(x*x+y*y); angle=np.arctan2(y,x)+ v=(y+1)/2; u=(x+1)/2 # v: 0 top .. 1 bottom+ out={+ 'T_SoftCircle':np.clip(1-r,0,1)**2,+ 'T_Glow01':np.exp(-(r/.33)**2)*np.clip(1-r,0,1)**.5,+ 'T_Dot01':np.clip((.62-r)/.08,0,1),+ 'T_Ring01':np.exp(-((r-.72)/.035)**2)*(r<.95),+ 'T_RingSoft01':np.clip((r-.35)/.45,0,1)**2.2*np.clip((.92-r)/.06,0,1),+ 'T_Streak01':np.clip(1-np.abs(x),0,1)**1.7*np.exp(-(y/.045)**2),+ 'T_Star01':np.maximum(np.exp(-(x/.035)**2)*np.exp(-(y/.55)**2),np.exp(-(y/.035)**2)*np.exp(-(x/.55)**2)),+ 'T_Flare01':np.clip(np.exp(-(y/.02)**2)*np.exp(-(x/.6)**2)+np.exp(-(x/.03)**2)*np.exp(-(y/.25)**2)+np.exp(-(r/.12)**2),0,1),+ 'T_Spark01':np.clip(1-np.abs(x)/.35-np.abs(y)/.85,0,1)**.7,+ 'T_Shard01':np.clip(np.minimum((y+.85)/.25,(.9-np.abs(x)*3.2-y*.55)/.12),0,1),+ 'T_Bubble01':np.exp(-((r-.62)/.04)**2)*.8+np.exp(-(((x+.25)**2+(y+.3)**2)/.009)),+ # Tileable alpha masks for dissolve (alpha texture) and scrolling detail.+ 'T_NoiseTile01':spectral(n,1.7,seed=11),+ 'T_NoiseTile02':1-worley(n,5,seed=5)**1.4,+ 'T_NoiseStreak01':spectral(n,1.5,stretch=(1,9),seed=23),+ 'T_NoiseStreak02':np.clip(spectral(n,1.5,stretch=(9,1),seed=29)*1.3-.1,0,1), # vertical streaks for columns+ }+ # Trail band for Ring/Track/Model UVs: U runs along the motion, V=0 is the sharp leading edge.+ streak=spectral(n,1.4,stretch=(1,7),seed=31)+ out['T_Trail01']=np.clip(.25+streak*1.1,0,1)*np.clip(v/.06,0,1)*(1-v)**1.15*np.clip(1-u,0,1)**.35*np.clip(u/.04,0,1)+ out['T_Trail02']=(1-v)**3*np.clip(v/.03,0,1) # clean gradient band without streaks+ # Static alpha gradient for columns; the scrolling streaks come from T_NoiseStreak02.+ out['T_GradientV01']=v**1.6*np.clip((1-v)/.03,0,1) # procedural mesh V runs top->base: solid at the base, gone at the top+ # Polar patterns: ground shockwave with radial streaks, and thin speed lines for impacts.+ polar=np.random.default_rng(71).random(96)**2+ spokes=np.interp((angle+np.pi)/(2*np.pi)*96,np.arange(97),np.append(polar,polar[0]))+ out['T_Shockwave01']=np.clip((r-.3)/.5,0,1)**2*np.clip((.94-r)/.05,0,1)*(.35+.65*spokes)+ lines=np.random.default_rng(83).random(180); thin=(lines>.8)*lines+ rays=np.interp((angle+np.pi)/(2*np.pi)*180,np.arange(181),np.append(thin,thin[0]))+ reach=.45+.5*np.interp((angle+np.pi)/(2*np.pi)*180,np.arange(181),np.append(lines,lines[0])[::-1])+ out['T_SpeedLines01']=np.clip(rays*np.clip((r-.16)/.1,0,1)*np.clip((reach-r)/.3,0,1)*1.6,0,1)+ return out++def procedural(n=256,root=None,missing_only=False):+ """Write the math textures to textures/procedural and textures/processed. `missing_only` (what init uses) never+ replaces a file that exists, so a project's edited copy survives; the `procedural` command regenerates all."""+ base=Path(root) if root else ROOT # the workspace being initialised, which need not be the process's project+ for folder in ['procedural','processed']:(base/f'vfx/textures/{folder}').mkdir(parents=True,exist_ok=True)+ def save(name,image):+ for folder in ['procedural','processed']:+ target=base/f'vfx/textures/{folder}/{name}.png'+ if missing_only and (target.exists() or target.is_symlink()):continue+ image.save(guard(target,base/'vfx'))+ names=[]+ for name,a in masks(n).items():+ im=Image.new('RGBA',(n,n),(255,255,255,0)); im.putalpha(Image.fromarray((np.clip(a,0,1)*255).astype(np.uint8)))+ save(name,im); names.append(name)+ # Legacy soft-edged noise sprite.+ soft=spectral(n,1.6,seed=3)*np.clip(1-np.hypot(*np.mgrid[-1:1:complex(n),-1:1:complex(n)]),0,1)+ im=Image.new('RGBA',(n,n),(255,255,255,0)); im.putalpha(Image.fromarray((soft*255).astype(np.uint8))); save('T_Noise01',im); names.append('T_Noise01')+ # UV distortion maps are opaque: R/G hold two independent offset fields centred on 0.5.+ for name,beta,seeds in [('T_Distort01',1.8,(101,102)),('T_Distort02',1.2,(103,104))]:+ rgb=np.stack([spectral(n,beta,seed=seeds[0]),spectral(n,beta,seed=seeds[1]),np.full((n,n),.5)],-1)+ save(name,Image.fromarray((rgb*255).astype(np.uint8),'RGB').convert('RGBA')); names.append(name)+ # Screen-space (BackDistortion) maps: RG is the refraction offset around 0.5, alpha masks where it applies.+ y,x=np.mgrid[-1:1:complex(n),-1:1:complex(n)]; r=np.sqrt(x*x+y*y)+1e-6+ band=np.exp(-((r-.7)/.13)**2)*(r<.98) # shockwave: radial push concentrated in a ring+ ring=np.stack([.5+.5*x/r*band,.5+.5*y/r*band,np.full((n,n),.5),np.clip(band*1.4,0,1)],-1)+ save('T_DistortRing01',Image.fromarray((ring*255).astype(np.uint8),'RGBA')); names.append('T_DistortRing01')+ soft=np.clip(1-r,0,1)**1.2 # heat haze: turbulent offsets in a soft disc+ haze=np.stack([spectral(n,1.6,seed=107),spectral(n,1.6,seed=108),np.full((n,n),.5),soft],-1)+ save('T_DistortHaze01',Image.fromarray((haze*255).astype(np.uint8),'RGBA')); names.append('T_DistortHaze01')+ cross=Image.new('RGBA',(128,128),(255,255,255,0)); draw=ImageDraw.Draw(cross)+ draw.rounded_rectangle((54,20,74,108),radius=3,fill='white'); draw.rounded_rectangle((20,54,108,74),radius=3,fill='white')+ save('T_Cross01',cross); names.append('T_Cross01')+ return names+def inspect(path,threshold=8):+ """Measure a texture so recipes can use numbers instead of eyeballed magic constants.++ Angles are degrees counter-clockwise from +x with y up, the same convention as sprite Z rotation.+ bulge_deg points from the bounding-box centre toward the alpha-weighted centroid: for a crescent that is+ the side the arc bows out to. touches_border means the shape is probably clipped by the canvas.+ """+ image=Image.open(path); size=image.size+ a=np.asarray(image.convert('RGBA'),dtype=np.float64)+ alpha=a[...,3]/255 if a[...,3].min()<255 else a[...,:3].mean(axis=2)/255 # opaque maps: read luminance+ mask=alpha>threshold/255; h,w=alpha.shape+ info={'name':Path(path).stem,'size':list(size),'coverage':round(float(mask.mean()),4),'opaque':bool(a[...,3].min()==255)}+ # Seam ratio <= ~1.5 means the opposite edges continue each other, i.e. the map tiles.+ inner=(np.abs(np.diff(alpha,axis=1)).mean()+np.abs(np.diff(alpha,axis=0)).mean())/2+ seam=(np.abs(alpha[:,0]-alpha[:,-1]).mean()+np.abs(alpha[0]-alpha[-1]).mean())/2+ info['seam_ratio']=round(float(seam/inner),2) if inner>0 else None+ if not mask.any():return info|{'empty':True}+ ys,xs=np.nonzero(mask)+ info['bbox']=[round(xs.min()/w,3),round(ys.min()/h,3),round((xs.max()+1)/w,3),round((ys.max()+1)/h,3)]+ edge=max(1,round(min(h,w)*.01))+ info['touches_border']=bool(mask[:edge].any() or mask[-edge:].any() or mask[:,:edge].any() or mask[:,-edge:].any())+ weight=alpha*mask; total=weight.sum(); yy,xx=np.mgrid[0:h,0:w]+ cx=(weight*xx).sum()/total; cy=(weight*yy).sum()/total+ info['centroid']=[round(cx/w,3),round(1-cy/h,3)] # y up+ dx=xx-cx; dy=-(yy-cy)+ cov=np.array([[(weight*dx*dx).sum(),(weight*dx*dy).sum()],[(weight*dx*dy).sum(),(weight*dy*dy).sum()]])/total+ values,vectors=np.linalg.eigh(cov); major=vectors[:,1]+ info['orientation_deg']=round(float(np.degrees(np.arctan2(major[1],major[0]))%180),1)+ info['elongation']=round(float(np.sqrt(values[1]/max(values[0],1e-9))),2)+ bx=(xs.min()+xs.max()+1)/2; by=(ys.min()+ys.max()+1)/2; ox,oy=cx-bx,-(cy-by)+ info['bulge_deg']=round(float(np.degrees(np.arctan2(oy,ox))%360),1) if np.hypot(ox,oy)>min(h,w)*.01 else None+ return info++def inspect_all(folder=None):+ return {path.stem:inspect(path) for path in sorted(Path(folder or ROOT/'vfx/textures/processed').glob('*.png'))}+diff --git a/skills/effekseer-vfx/scripts/vfxkit/workflow.py b/skills/effekseer-vfx/scripts/vfxkit/workflow.pynew file mode 100644index 0000000..7eb195d--- /dev/null+++ b/skills/effekseer-vfx/scripts/vfxkit/workflow.py@@ -0,0 +1,109 @@+"""Shared portable storage and a reentrant, cross-process workspace lock."""+from contextlib import contextmanager+from pathlib import Path+try:+ import fcntl+except ImportError as error: # native Windows: the workspace lock needs POSIX file locks+ raise ImportError('effekseer-vfx needs macOS or Linux; on Windows run it inside WSL') from error+import functools+import hashlib+import json+import os+import re+import tempfile+import threading++from .paths import ROOT, SKILL, HOME, WORK++_mutex = threading.RLock()+_local = threading.local()+# Snapshot keys: project files are project-relative; skill and toolchain files carry a prefix.+PREFIXES = (('skill:', SKILL), ('toolchain:', HOME))+++def effect_id(value):+ if not isinstance(value, str) or not re.fullmatch(r'VFX_[A-Za-z0-9_]+', value):+ raise ValueError('Expected an effect ID such as VFX_Fire_Explosion')+ return value+++def digest(value):+ return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(',', ':'), ensure_ascii=False).encode()).hexdigest()+++def file_hash(path):+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def relative(path):+ # Normalise without following symlinks first: a venv's python links outside the toolchain.+ for candidate in (Path(os.path.abspath(path)), Path(path).resolve()):+ if candidate.is_relative_to(ROOT):+ return candidate.relative_to(ROOT).as_posix()+ for prefix, base in PREFIXES:+ if candidate.is_relative_to(base):+ return prefix + candidate.relative_to(base).as_posix()+ raise ValueError(f'{path} is outside the project, the skill and the toolchain')+++def absolute(name):+ for prefix, base in PREFIXES:+ if name.startswith(prefix):+ return base / name[len(prefix):]+ return ROOT / name+++def snapshot(paths):+ return {relative(p): file_hash(p) for p in sorted(set(map(Path, paths)))}+++def unchanged(files):+ return all(file_hash(absolute(name)) == sha and sha is not None for name, sha in files.items())+++def save_json(path, value):+ from .ownership import guard+ path = guard(Path(path), ROOT / 'vfx') # every store is inside the workspace; never follow a link out of it+ path.parent.mkdir(parents=True, exist_ok=True)+ # A fresh, unpredictable temporary file (created exclusively, so no pre-placed link can redirect the write),+ # then an atomic rename over the final path.+ handle, name = tempfile.mkstemp(prefix=path.name + '.', suffix='.tmp', dir=path.parent)+ temporary = Path(name)+ try:+ with os.fdopen(handle, 'w', encoding='utf-8') as stream:+ stream.write(json.dumps(value, ensure_ascii=False, indent=2) + '\n')+ temporary.replace(path)+ finally:+ temporary.unlink(missing_ok=True)+ return path+++@contextmanager+def project_lock():+ with _mutex:+ if getattr(_local, 'depth', 0):+ _local.depth += 1+ try:+ yield+ finally:+ _local.depth -= 1+ return+ path = WORK / 'project.lock'+ path.parent.mkdir(parents=True, exist_ok=True)+ with path.open('a') as stream:+ fcntl.flock(stream, fcntl.LOCK_EX)+ _local.depth = 1+ try:+ yield+ finally:+ _local.depth = 0+ fcntl.flock(stream, fcntl.LOCK_UN)+++def locked(function):+ @functools.wraps(function)+ def run(*args, **kwargs):+ with project_lock():+ return function(*args, **kwargs)+ return rundiff --git a/skills/vfx-review/LICENSE b/skills/vfx-review/LICENSEnew file mode 100644index 0000000..2549e5f--- /dev/null+++ b/skills/vfx-review/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 KanaWorks_AI (https://x.com/KanaWorks_AI)++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/skills/vfx-review/SKILL.md b/skills/vfx-review/SKILL.mdnew file mode 100644index 0000000..2f5e606--- /dev/null+++ b/skills/vfx-review/SKILL.md@@ -0,0 +1,75 @@+---+name: vfx-review+description: Independently score one rendered game VFX filmstrip against a fixed rubric and return a JSON verdict. Use when asked to review, score or judge an effect's strip images (for example from the effekseer-vfx skill's `vfx review`) as a reviewer who did not author it.+license: MIT+metadata:+ version: "0.1.0"+---++# Independent VFX review++You are the reviewer, not the author. Judge only what is visible in the images you are given. Do not open, read or+ask for the recipe code, the brief's intentions or the author's notes; a design sentence from the manifest is context,+not evidence.++## Inputs you should receive++Usually one brief file written by `vfx review-handoff` (`vfx/work/handoff/<evidence_id>.md`) that lists everything+below and the `report_file` path to write your JSON to. Otherwise:++- the whole-timeline strip `vfx/previews/strips/<ID>.png` and the key-frame sheet (paths from `vfx review`);+ optionally `<ID>_compare.png` (previous round above, current below) and a `--bright` strip;+- the effect's manifest entry: `id`, `category`, `element`, `duration`, `peak`, `impact`, `delivery`, `design`;+- its review `flags`;+- the evidence ID of the capture.++Open every image with your image-viewing tool. Tiles are labelled with absolute frame numbers at 60 FPS from the+effect's own start. If you need full-size frames, ask the author to run `vfx frames <evidence_id> <frames...>` and+give you the paths (or run it yourself if you have the skill installed). If an image is missing, say so — do not score+from flags.++## Rubric++Score each criterion 0–3: **0** missing or wrong · **1** present but weak, a player would not notice it · **2** clearly+works · **3** reads instantly and has a distinct identity.++| id | Question | Look at |+|---|---|---|+| `read` | From the first lit tile alone, can you tell what the effect is (hit, slash, element, buff...)? | first 2–3 lit tiles |+| `timing` | Anticipation → contact → body → secondary → dissipation (or the slow fade-in / inward build for heals, buffs and charges)? Is the contact the brightest moment and only 2–5 frames? | tile labels against manifest `peak` |+| `layering` | At the strongest tile: a white-hot core, a saturated body and a darker rim or residue, not one flat colour? | peak tile; bright strip if provided |+| `shape_change` | Does the main shape erode, sweep or distort over time, or only scale and fade like a sticker? | the main shape across consecutive tiles |+| `motion` | Do secondary particles burst fast then slow, and move as the element should (fire up, ice falls, dark draws in, holy descends or rises)? | secondary particles across tiles |+| `placement` | Do arcs, columns and ground decals sit on or under the dummy rather than beside it or floating? | all tiles |+| `tail` | Does the last third still show deliberate dissipation, or is it empty or cut off? | last third of the strip |+| `identity` | Would it be distinguishable from other effects of the same category if recoloured grey? | whole strip |++The authoritative copy is `vfx rubric` (from `assets/review_rubric.json` of the effekseer-vfx skill); if it differs+from this table, follow it.++Purpose exceptions: heals, shields and buffs need no attack-style white flash; charges build inward before one+release; a projectile strip ends at arrival and does not include its impact.++## Output++Return exactly one JSON object and save it where the author asks (for example `report.json`):++```json+{"id": "VFX_Fire_Explosion",+ "scores": {"read": 2, "timing": 3, "layering": 3, "shape_change": 2, "motion": 3, "placement": 3, "tail": 2, "identity": 3},+ "worst": "shape_change",+ "fix": "From f18 to f30 let the main fire layer burn a large gap open on one side so the round outline breaks up.",+ "verdict": "ship",+ "observed_frames": [1, 4, 9, 10, 12, 18, 30, 42, 54, 72]}+```++Rules:+- Every criterion gets an integer 0–3. `worst` names a lowest-scoring criterion.+- `verdict` is `iterate` if any score is below 2, otherwise `ship`.+- `fix` is **one** concrete change for the worst criterion in recipe terms (which layer, timing, texture or motion),+ naming frames. One fix only: each iteration round changes one class of problem.+- `observed_frames` lists the frame labels you actually looked at.++Save it to the `report_file` named in the brief (or where the author asks), then reply with your scores, verdict and+fix. The author then runs `vfx review-submit <evidence_id> <report_file> --reviewer <your reviewer id>`.+Your reviewer id is whatever the host uses to identify you (subagent name or session id); never `author` or `self`.diff --git a/skills/vfx-review/agents/openai.yaml b/skills/vfx-review/agents/openai.yamlnew file mode 100644index 0000000..cd2a856--- /dev/null+++ b/skills/vfx-review/agents/openai.yaml@@ -0,0 +1,6 @@+# Codex skill metadata (optional; other agents ignore this file).+interface:+ display_name: "VFX Review"+ short_description: "Score a rendered VFX filmstrip against a fixed rubric"+policy:+ allow_implicit_invocation: truediff --git a/tests/conftest.py b/tests/conftest.pynew file mode 100644index 0000000..a240495--- /dev/null+++ b/tests/conftest.py@@ -0,0 +1,64 @@+"""Shared test setup for the effekseer-vfx skill.++vfxkit.paths computes the project ROOT when it is first imported, so this file points VFX_PROJECT at a fresh+temporary game project *before* anything imports vfxkit, initialises its vfx/ workspace without the Godot plugin+and adds the thirteen shipped example effects. Those examples are the library every library-wide test checks.++Tests that need an isolated workspace either monkeypatch the module-level ROOT/WORK attributes (as the original+pipeline tests did) or run the CLI in a subprocess with --project.+"""+import atexit+import os+import shutil+import sys+import tempfile+from pathlib import Path++import pytest++sys.dont_write_bytecode = True # never leave __pycache__ inside the (read-only at run time) skill folder++TESTS = Path(__file__).resolve().parent+PACKAGE = TESTS.parent+SKILL = PACKAGE / 'skills/effekseer-vfx'+SCRIPTS = SKILL / 'scripts'+ASSETS = SKILL / 'assets'++PROJECT = Path(tempfile.mkdtemp(prefix='vfx-skill-tests-')).resolve()+os.environ['VFX_PROJECT'] = str(PROJECT)+os.environ['PYTHONDONTWRITEBYTECODE'] = '1'+atexit.register(shutil.rmtree, PROJECT, True)+if str(SCRIPTS) not in sys.path:+ sys.path.insert(0, str(SCRIPTS))++from vfxkit import paths # noqa: E402 (must follow VFX_PROJECT)++assert paths.ROOT == PROJECT, 'vfxkit was imported before conftest set VFX_PROJECT'++# The vfx wrapper exports EFFEKSEER_AI_BIN_DIR from the toolchain; do the same when a full toolchain is installed.+if not os.environ.get('EFFEKSEER_AI_BIN_DIR') and (paths.CORE_BIN / 'EffekseerCore.dll').is_file():+ os.environ['EFFEKSEER_AI_BIN_DIR'] = str(paths.CORE_BIN)+ os.environ.setdefault('DOTNET_ROOT', str(paths.HOME / 'dotnet'))++from vfxkit import scaffold, examples # noqa: E402++scaffold.initialize(install_plugin=False)+examples.add('all')++CORE_READY = bool(os.environ.get('EFFEKSEER_AI_BIN_DIR') and (Path(os.environ['EFFEKSEER_AI_BIN_DIR']) / 'EffekseerCore.dll').is_file())+requires_core = pytest.mark.skipif(not CORE_READY, reason='Initialize the local EffekseerCore runtime first (sh scripts/setup.sh)')+++def cli_env(**extra):+ """Environment for running `python -m vfxkit` in a subprocess with the scripts folder importable."""+ env = dict(os.environ)+ env['PYTHONPATH'] = str(SCRIPTS) + (os.pathsep + env['PYTHONPATH'] if env.get('PYTHONPATH') else '')+ env['PYTHONDONTWRITEBYTECODE'] = '1'+ env.update(extra)+ return env+++def project():+ """The shared temporary game project whose vfx/src holds the thirteen examples."""+ return PROJECTdiff --git a/tests/test_agent_loop.py b/tests/test_agent_loop.pynew file mode 100644index 0000000..e7a1888--- /dev/null+++ b/tests/test_agent_loop.py@@ -0,0 +1,259 @@+"""Agent feedback loop: field validation, static lint, review metrics, iteration history and texture+measurement. None of these need EffekseerCore or Godot."""+import copy+import json+from pathlib import Path++import pytest+from PIL import Image, ImageDraw++from conftest import ASSETS++DARK = (10, 12, 18)+++def test_misspelt_and_nested_unknown_fields_are_rejected_with_suggestions(tmp_path):+ from effekseer_ai.authoring import validate_layer, compile_effect+ layer = {'name': 'Sparks', 'fade_ot': 4, 'ring': {'angle_ends': [0, 90], 'outer': {'start': [1, 0], 'ending': [2, 0]}},+ 'travel': {'end': [0, 1, 0], 'ease': 'Linear'},+ 'forces': [{'type': 'Gravity', 'gravty': [0, -.001, 0]}, {'power': 1}],+ 'children': [{'name': 'Child', 'lifee': 10}, {'life': 3}]}+ errors = ' | '.join(validate_layer(layer))+ assert "'fade_ot'; did you mean 'fade_out'" in errors+ assert "Sparks.ring: unknown field 'angle_ends'; did you mean 'angle_end'" in errors+ assert "Sparks.ring.outer: unknown field 'ending'" in errors+ assert "Sparks.travel: unknown field 'ease'" in errors+ assert "forces[0]: unknown field 'gravty'" in errors and 'forces[1]: force needs a type' in errors+ assert "Sparks/Child: unknown field 'lifee'" in errors and 'layer needs a name' in errors+ # Validation runs before any Core call, so a bad recipe fails the same way with or without Core.+ with pytest.raises(ValueError, match='fade_ot'):+ compile_effect({'layers': [layer]}, tmp_path / 'bad.efkefc')+++def test_library_recipes_use_only_known_fields():+ from effekseer_ai.authoring import validate_layer+ from vfxkit.library import library+ recipes = library()+ assert recipes+ assert [e for r in recipes for layer in r['layers'] for e in validate_layer(layer)] == []+++def recipe(**changes):+ from vfxkit.primitives import effect, flash, radial_sparks, slash_arc+ layers = [flash('Contact', (255, 255, 255, 255), 3, life=4, delay=2), slash_arc('Arc', (255, 120, 40, 255), life=12, delay=2),+ radial_sparks('Sparks', 10, (255, 200, 120, 255), delay=2, gravity=.001)]+ base = effect('Test', 'Test', 'slash', 'fire', .4, layers, peak=.04, impact=.6)+ return base | changes+++def test_lint_passes_the_library_and_reports_each_hard_rule():+ from vfxkit.lint import lint_library, lint+ from vfxkit.library import library+ assert lint_library(library())['ok']+ assert lint(recipe())['errors'] == []+ bad = recipe(category='hit')+ bad['layers'][2] |= {'count': 80, 'forces': [{'type': 'Gravity', 'gravity': [0, -.05, 0]}], 'life': (12, 40), 'fade_ot': 3}+ bad['layers'].append({'name': 'Fake', 'texture': 'vfx/textures/processed/T_Unrecorded.png'})+ errors = ' | '.join(lint(bad)['errors'])+ assert 'particle budget 83 exceeds 60' in errors+ assert 'gravity [0, -0.05, 0] is per frame squared' in errors+ assert 'alive until frame' in errors+ assert "unknown field 'fade_ot'" in errors+ assert 'T_Unrecorded is neither a math primitive nor recorded' in errors and 'T_Unrecorded.png is missing' in errors+++def test_lint_accepts_a_cel_contact_and_a_restruck_painted_shape():+ # A short single white-hot additive layer counts as the contact even without flash().+ from vfxkit.lint import lint+ cel = recipe()+ cel['layers'][0] = {'name': 'Cel crescent', 'texture': 'vfx/textures/processed/T_WispTrail01.png', 'color': [240, 215, 255, 255], 'life': 8, 'delay': 2}+ assert not any('contact' in w for w in lint(cel)['warnings']), lint(cel)['warnings']+ # A painted shape (recorded in texture_prompts.json by `examples add`) re-struck on later frames changes shape.+ shard = {'texture': 'vfx/textures/processed/T_IceShard01.png', 'color': [245, 248, 255, 255], 'life': 5}+ strike = recipe()+ strike['layers'] = [strike['layers'][0], shard | {'name': 'Main shard', 'delay': 2}, shard | {'name': 'Restrike', 'delay': 8}]+ assert not any('changes shape' in w for w in lint(strike)['warnings'])+++def test_lint_warns_about_craft_problems():+ from vfxkit.lint import lint, lint_library+ no_flash = recipe()+ no_flash['layers'] = no_flash['layers'][1:]+ assert any('without a contact flash' in w for w in lint(no_flash)['warnings'])+ late = recipe(peak=.3)+ assert any('manifest peak is frame 18' in w for w in lint(late)['warnings'])+ static = recipe()+ static['layers'][1] = {'name': 'Sticker', 'texture': 'vfx/textures/processed/T_Glow01.png', 'color': [120, 60, 255, 255], 'life': 12}+ static['layers'][0]['color'] = [120, 60, 255, 255]+ static['layers'][2]['color'] = [120, 60, 255, 255]+ static['layers'][2]['color_end'] = [60, 20, 200, 255]+ warnings = ' | '.join(lint(static)['warnings'])+ assert 'no layer changes shape' in warnings and 'no white-hot additive colour' in warnings+ # A copy that only swaps colours and element is a recolour, not a new element.+ original = recipe()+ recolour = copy.deepcopy(original) | {'id': 'VFX_Recolour', 'element': 'ice'}+ for layer in recolour['layers']:+ layer['color'] = [90, 180, 255, 255]+ result = lint_library([original, recolour])+ assert any('only in 0 of shape/motion/rhythm/material/secondary' in w for w in result['warnings']['VFX_Test'])+++def frames(folder, rid, plan, size=(1280, 800)):+ """plan: {frame: [(box, colour), ...]} with boxes relative to the review crop."""+ from vfxkit.review import CROP+ for frame in range(0, max(plan) + 1, 3):+ image = Image.new('RGB', size, DARK)+ draw = ImageDraw.Draw(image)+ for (x0, y0, x1, y1), colour in plan.get(frame, []):+ draw.ellipse((CROP[0] + x0, CROP[1] + y0, CROP[0] + x1, CROP[1] + y1), fill=colour)+ image.save(folder / f'{rid}_f{frame:03d}.png')+++def test_review_metrics_accept_a_well_formed_effect(tmp_path):+ from vfxkit.review import metrics+ plan = {0: []}+ for f in range(3, 31, 3):+ y = 400 - f * 6+ r = 60 if f > 3 else 30+ if f >= 24:+ plan[f] = [((375, y - 25, 425, y + 25), (255, 150, 60))] # rising embers carry the dissipation to the end+ continue+ plan[f] = [((300, y - r, 500, y + r), (255, 110, 30))] + (+ [((370, y - 20, 430, y + 20), (255, 255, 255))] if f <= 6 else [((380, y - 12, 420, y + 12), (255, 240, 220))])+ frames(tmp_path, 'VFX_Good', plan)+ m = metrics('VFX_Good', tmp_path, {'duration': .5, 'peak': .05, 'impact': .8, 'element': 'fire'}, step=3)+ assert m['flags'] == [], m['flags']+ assert m['contact_frame'] == 3 and m['motion']['drift_up'] > 0 and m['layering'][0] > 0 and m['layering'][1] > .3+++def test_review_metrics_flag_off_peak_flash_flat_colour_and_wrong_direction(tmp_path):+ from vfxkit.review import metrics+ late = {0: [], **{f: [((300, 300, 500, 500), (255, 120, 40))] for f in range(3, 31, 3)}, 12: [((300, 300, 500, 500), (255, 255, 255))]}+ frames(tmp_path, 'VFX_Late', late)+ m = metrics('VFX_Late', tmp_path, {'duration': .5, 'peak': .05, 'impact': .8}, step=3)+ assert m['contact_frame'] == 12 and any(f.startswith('off-peak contact') for f in m['flags'])+ flat = {0: [], **{f: [((300, 300, 500, 500), (70, 80, 95))] for f in range(3, 31, 3)}}+ frames(tmp_path, 'VFX_Flat', flat)+ flags = ' | '.join(metrics('VFX_Flat', tmp_path, {'duration': .5})['flags'])+ assert 'no white-hot core' in flags and 'washed out' in flags+ sinking = {0: [], **{f: [((300, 200 + f * 8, 500, 300 + f * 8), (255, 120, 40)), ((380, 230 + f * 8, 420, 270 + f * 8), (255, 255, 255))] for f in range(3, 31, 3)}}+ frames(tmp_path, 'VFX_Sink', sinking)+ assert any(f.startswith('sinks') for f in metrics('VFX_Sink', tmp_path, {'duration': .5, 'element': 'fire'})['flags'])+ spreading = {0: [], **{f: [((400 - f * 6, 350 - f * 6, 400 + f * 6, 350 + f * 6), (170, 80, 255))] for f in range(3, 40, 3)},+ 42: [((300, 250, 500, 450), (255, 255, 255))], 45: [((350, 300, 450, 400), (200, 120, 255))]}+ frames(tmp_path, 'VFX_Dark', spreading)+ assert any(f.startswith('expands while charging') for f in metrics('VFX_Dark', tmp_path, {'duration': .8, 'element': 'dark'})['flags'])+++def test_short_effect_with_an_empty_second_half_is_a_dead_tail(tmp_path):+ # A short hit that is empty after its first third must flag even though a few ember pixels remain.+ from vfxkit.review import metrics+ plan = {0: [], 3: [((300, 300, 500, 500), (255, 200, 120))], 6: [((330, 330, 470, 470), (255, 160, 80))],+ 9: [((390, 390, 410, 410), (255, 120, 40))], 18: []}+ frames(tmp_path, 'VFX_Short', plan)+ m = metrics('VFX_Short', tmp_path, {'duration': .3})+ assert m['last_visible_frame'] == 9 and m['last_active_frame'] == 6+ assert any(f.startswith('dead tail') for f in m['flags'])+++def test_review_metrics_do_not_flag_known_false_positives(tmp_path):+ # Each case reproduces a false flag first seen on real frames.+ from vfxkit.review import metrics+ # A short contact flash followed by a long, steady white-hot body (a beam, erupting spikes) is not a lingering flash.+ beam = {0: [], 3: [((340, 290, 460, 410), (255, 255, 255))],+ **{f: [((300, 100, 500, 600), (255, 170, 60)), ((390, 200, 410, 500), (255, 255, 255))] for f in range(6, 31, 3)}}+ frames(tmp_path, 'VFX_Beam', beam)+ m = metrics('VFX_Beam', tmp_path, {'duration': .5, 'peak': .05, 'impact': .8, 'element': 'holy'}, step=3)+ assert m['flash_span'] == 3 and not any(f.startswith('lingering flash') for f in m['flags']), m['flags']+ # A white core that grows during a charge is not part of the release flash.+ charge = {0: [], **{f: [((400 - min(55, 3 * f), 350 - min(55, 3 * f), 400 + min(55, 3 * f), 350 + min(55, 3 * f)), (255, 255, 255))] for f in range(3, 28, 3)},+ 30: [((330, 280, 470, 420), (255, 255, 255))], 33: [((390, 340, 410, 360), (120, 220, 255))]}+ frames(tmp_path, 'VFX_Charge', charge)+ m = metrics('VFX_Charge', tmp_path, {'duration': .6, 'peak': .5, 'impact': .5, 'element': 'arcane'}, step=3)+ assert m['contact_frame'] == 30 and m['flash_span'] == 3, m['flash_span']+ # Dark alpha-blended smoke after a bright blast has little change energy but is still visible.+ smoke = {0: [], 3: [((250, 200, 550, 500), (255, 255, 255))], **{f: [((350, 300, 450, 400), (45, 45, 55))] for f in range(6, 28, 3)}, 30: []}+ frames(tmp_path, 'VFX_Smoke', smoke)+ m = metrics('VFX_Smoke', tmp_path, {'duration': .5}, step=3)+ assert m['last_active_frame'] == 27 and not any(f.startswith('dead tail') for f in m['flags']), m['flags']+ # Holy may descend; only fire has to rise.+ falling = {0: [], **{f: [((300, 200 + f * 8, 500, 300 + f * 8), (255, 200, 90)), ((380, 230 + f * 8, 420, 270 + f * 8), (255, 255, 255))] for f in range(3, 31, 3)}}+ frames(tmp_path, 'VFX_Fall', falling)+ assert not any(f.startswith('sinks') for f in metrics('VFX_Fall', tmp_path, {'duration': .5, 'element': 'holy'})['flags'])+++def test_review_metrics_flag_dead_tail_and_invisible_effects(tmp_path):+ from vfxkit.review import metrics, CROP+ size = (1280, 800)+ box = (CROP[0] + 100, CROP[1] + 100, CROP[0] + 500, CROP[1] + 500)+ for frame, lit in [(0, False), (3, True), (6, True), *((f, False) for f in range(9, 31, 3))]:+ image = Image.new('RGB', size, DARK)+ if lit:+ image.paste((255, 180, 60), box)+ image.save(tmp_path / f'VFX_A_f{frame:03d}.png')+ Image.new('RGB', size, DARK).save(tmp_path / f'VFX_B_f{frame:03d}.png')+ a = metrics('VFX_A', tmp_path, {'duration': .5})+ b = metrics('VFX_B', tmp_path, {'duration': .5})+ assert a['last_visible_frame'] == 6 and any('dead tail' in f for f in a['flags'])+ assert any('barely visible' in f for f in b['flags'])+++def test_round_diff_history_and_comparison_sheet(tmp_path):+ from vfxkit.review import diff, record, compare_sheet+ old = {'flags': ['dead tail: after frame 6 of 18', 'no white-hot core: ...'], 'peak_frame': 3, 'contact_frame': 3, 'last_active_frame': 6, 'duration_frames': 18}+ new = {'flags': ['dead tail: after frame 9 of 18', 'washed out: ...'], 'peak_frame': 3, 'contact_frame': 3, 'last_active_frame': 9, 'duration_frames': 18}+ assert diff(old, new) == {'flags_added': ['washed out'], 'flags_resolved': ['no white-hot core'], 'last_active_frame': [6, 9]}+ assert diff(None, new) == {}+ report = new | {'layering': [.1, .5, .2], 'motion': {}}+ path = record(tmp_path, 'VFX_Test', report, 'shortened tail')+ record(tmp_path, 'VFX_Test', report, 'second round', 'e' * 32)+ lines = [json.loads(line) for line in path.read_text().splitlines()]+ assert [l['note'] for l in lines] == ['shortened tail', 'second round'] and lines[0]['last_active_frame'] == 9+ assert lines[1]['evidence_id'] == 'e' * 32+ Image.new('RGB', (300, 100), 'red').save(tmp_path / 'a.png')+ Image.new('RGB', (300, 120), 'blue').save(tmp_path / 'b.png')+ sheet = Image.open(compare_sheet(tmp_path / 'a.png', tmp_path / 'b.png', tmp_path / 'c.png'))+ assert sheet.size == (300, 268) and sheet.getpixel((10, 60)) == (255, 0, 0) and sheet.getpixel((10, 200)) == (0, 0, 255)+++def test_metrics_baseline_is_compact_and_round_trips():+ from vfxkit.review import dump_metrics+ report = {'VFX_A': {'flags': ['dead tail: x'], 'motion': {'drift_up': .1},+ 'timeline': [{'frame': 4, 'coverage': .1, 'centre': [.5, .4]}, {'frame': 8, 'coverage': 0.}]}, 'VFX_B': {'flags': []}}+ text = dump_metrics(report)+ assert json.loads(text) == report+ # One line per timeline frame keeps the tracked file small and its diffs aligned to frames.+ assert ' {"frame":4,"coverage":0.1,"centre":[0.5,0.4]},' in text.splitlines()+++def test_texture_measurement_finds_crescent_bulge_and_clipping(tmp_path):+ from vfxkit.textures import inspect+ image = Image.new('RGBA', (256, 256), (255, 255, 255, 0))+ draw = ImageDraw.Draw(image)+ draw.arc((40, 40, 216, 216), 120, 240, fill=(255, 255, 255, 255), width=18) # "(" bowing toward -x+ image.save(tmp_path / 'arc.png')+ info = inspect(tmp_path / 'arc.png')+ assert abs(info['bulge_deg'] - 180) < 10 and not info['touches_border'] and info['elongation'] > 1.5+ clipped = Image.new('RGBA', (64, 64), (255, 255, 255, 0))+ ImageDraw.Draw(clipped).rectangle((0, 20, 30, 40), fill=(255, 255, 255, 255))+ clipped.save(tmp_path / 'clip.png')+ assert inspect(tmp_path / 'clip.png')['touches_border']+++def test_shipped_painted_textures_are_measurable_game_textures():+ # Replaces the original slash-angle check: every painted example texture is a processed RGBA game texture with+ # real content, and `examples add` installs it byte-identical into the project.+ from vfxkit.textures import inspect+ from vfxkit.paths import ROOT+ shipped = sorted((ASSETS / 'examples/textures').glob('*.png'))+ assert shipped+ prompts = {p['id'] for p in json.loads((ASSETS / 'examples/texture_prompts.json').read_text())['prompts']}+ for path in shipped:+ info = inspect(path)+ assert not info.get('empty') and info['coverage'] > 0, path.name+ assert all(n & (n - 1) == 0 and 128 <= n <= 1024 for n in info['size']), (path.name, info['size'])+ with Image.open(path) as image:+ assert image.mode == 'RGBA', path.name+ assert path.stem in prompts, f'{path.stem} has no recorded generation prompt'+ installed = ROOT / f'vfx/textures/processed/{path.name}'+ assert installed.read_bytes() == path.read_bytes(), path.namediff --git a/tests/test_effekseer_ai.py b/tests/test_effekseer_ai.pynew file mode 100644index 0000000..2b059a3--- /dev/null+++ b/tests/test_effekseer_ai.py@@ -0,0 +1,57 @@+"""The vendored effekseer_ai bridge: portable CLI surface and an explicit, never-guessed Core location."""+from pathlib import Path++import pytest++from conftest import SCRIPTS+++def test_cli_exposes_only_the_portable_effect_bridge_commands():+ from effekseer_ai.cli import build_parser+ parser = build_parser()+ command_parser = next(action for action in parser._actions if action.dest == 'command')+ commands = set(command_parser.choices)+ assert {'new', 'open', 'save', 'export', 'node-list', 'node-add', 'compile', 'texture-process'} <= commands+ assert not {'generate', 'model-convert', 'model-import', 'experience-record', 'experience-search', 'experience-brief'} & commands+++def test_cli_rejects_removed_recipe_commands():+ from effekseer_ai.cli import build_parser+ with pytest.raises(SystemExit):+ build_parser().parse_args(['generate', 'black-hole', 'effect.efkefc'])+++def test_vendored_package_has_no_protocol_server_and_keeps_its_license():+ folder = SCRIPTS / 'effekseer_ai'+ assert (folder / 'LICENSE').is_file() and 'MIT' in (folder / 'LICENSE').read_text()+ assert not list(folder.glob('*server*.py'))+++def test_editor_bin_directory_requires_an_explicit_configuration(monkeypatch):+ """A public release must never probe a contributor's local disks."""+ monkeypatch.delenv('EFFEKSEER_AI_BIN_DIR', raising=False)+ from effekseer_ai.runtime import editor_bin_directory+ with pytest.raises(RuntimeError, match='EFFEKSEER_AI_BIN_DIR'):+ editor_bin_directory()+++def test_editor_bin_directory_rejects_a_directory_without_core(tmp_path, monkeypatch):+ monkeypatch.setenv('EFFEKSEER_AI_BIN_DIR', str(tmp_path))+ from effekseer_ai.runtime import editor_bin_directory+ with pytest.raises(RuntimeError, match='EffekseerCore.dll'):+ editor_bin_directory()+++def test_editor_bin_directory_uses_a_configured_core_directory(tmp_path, monkeypatch):+ core_directory = tmp_path / 'Tool' / 'bin'+ core_directory.mkdir(parents=True)+ (core_directory / 'EffekseerCore.dll').touch()+ monkeypatch.setenv('EFFEKSEER_AI_BIN_DIR', str(core_directory))+ from effekseer_ai.runtime import editor_bin_directory+ assert editor_bin_directory() == core_directory+++def test_runtime_config_is_bundled():+ from effekseer_ai.runtime import runtime_config_path+ path = runtime_config_path()+ assert Path(path).is_file() and Path(path).is_relative_to(SCRIPTS / 'effekseer_ai')diff --git a/tests/test_examples.py b/tests/test_examples.pynew file mode 100644index 0000000..f13f311--- /dev/null+++ b/tests/test_examples.py@@ -0,0 +1,125 @@+"""Shipped example effects: complete, valid, self-consistent with their briefs and safe to add to a project."""+import copy+import json++import pytest++from conftest import ASSETS++EXAMPLES = ASSETS / 'examples'+++def example_ids():+ return sorted(p.stem for p in (EXAMPLES / 'src').glob('VFX_*.py'))+++def test_catalog_lists_every_shipped_example_as_pairs_and_singles():+ from vfxkit import examples+ catalog = examples.catalog()+ ids = examples.ids('all')+ assert sorted(ids) == example_ids() and len(ids) == len(set(ids)) == 13+ assert [p['name'] for p in catalog['pairs']] == ['fire', 'ice', 'poison', 'dark']+ assert [s['name'] for s in catalog['singles']] == ['hit', 'slash', 'charge', 'shield', 'heal']+ for pair in catalog['pairs']:+ assert examples.ids(pair['name']) == [pair['projectile'], pair['impact']]+ assert pair['teaches']+ for single in catalog['singles']:+ assert examples.ids(single['name']) == [single['effect']] and single['teaches']+ # Every example carries an independent review: all eight criteria scored, a verdict consistent with the scores,+ # and its weakest criterion with the reviewer's one fix.+ review = catalog['historical_review']+ assert set(catalog['historical_scores']) == set(review['verdicts']) == set(review['worst']) == set(ids)+ for rid, scores in catalog['historical_scores'].items():+ assert len(scores) == 8 and all(score in (0, 1, 2, 3) for score in scores.values())+ assert review['verdicts'][rid] == ('iterate' if min(scores.values()) < 2 else 'ship')+ assert scores[review['worst'][rid]['criterion']] == min(scores.values()) and review['worst'][rid]['fix']+ assert examples.ids('VFX_Ice_Spikes') == ['VFX_Ice_Spikes']+ with pytest.raises(ValueError, match='Unknown example'):+ examples.ids('invented')+++def test_example_show_accepts_pair_and_single_names():+ from vfxkit import examples+ pair = examples.show_any('fire')+ assert [e['id'] for e in pair['effects']] == ['VFX_Projectile_Fire', 'VFX_Fire_Explosion']+ single = examples.show_any('slash')+ assert single['id'] == 'VFX_Slash_Fire' and single['historical_verdict'] in ('ship', 'iterate')++[email protected]('rid', example_ids())+def test_each_example_source_loads_and_matches_its_brief(rid):+ from vfxkit import briefs+ from vfxkit.library import load+ recipe = load(EXAMPLES / f'src/{rid}.py')+ brief = json.loads((EXAMPLES / f'briefs/{rid}.json').read_text())+ assert recipe['id'] == brief['effect_id'] == rid+ assert recipe.get('delivery') == brief['delivery']+ assert recipe.get('attach') == brief['anchor']+ result = briefs.validate(brief, recipe)+ assert result['ok'], result['errors']+ assert not result['warnings'], result['warnings'] # every layer has a planned role+++def test_lint_of_all_examples_has_no_errors():+ from effekseer_ai.authoring import validate_layer+ from vfxkit.lint import lint_library+ from vfxkit.library import library+ recipes = library()+ assert sorted(r['id'] for r in recipes) == example_ids()+ result = lint_library(recipes)+ assert result['ok'] and result['errors'] == {}, result['errors']+ assert not [e for r in recipes for layer in r['layers'] for e in validate_layer(layer)]+++def test_example_show_gives_a_timeline_with_layer_roles_and_paired_projectiles():+ from vfxkit import examples+ ids = set(examples.ids('all'))+ for rid in ids:+ details = examples.show(rid)+ assert details['ok'] and details['id'] == rid and details['design']+ assert len(details['layer_plan']) >= 4+ assert all(row['role'] and row['path'] and row['end_frame'] >= row['start_frame'] for row in details['layer_plan'])+ assert details['source'].startswith('skill:assets/examples/src/')+ assert isinstance(details['lint'], dict) and details['lint']['errors'] == []+ projectile = (details['delivery'] or {}).get('projectile')+ if projectile:+ assert projectile in ids+ with pytest.raises(ValueError, match='Unknown example'):+ examples.show('VFX_Invented')+++def test_loaded_examples_are_detached_copies():+ # Editing a loaded recipe never changes the next load (sources are re-executed on every call).+ from vfxkit.library import get+ first = get('VFX_Fire_Explosion')+ first['layers'][0]['name'] = 'edited copy'+ assert get('VFX_Fire_Explosion')['layers'][0]['name'] != 'edited copy'+++def test_example_textures_are_installed_and_their_prompts_recorded(project):+ from vfxkit import examples+ prompts = {p['id'] for p in json.loads((project / 'vfx/texture_prompts.json').read_text())['prompts']}+ for rid in examples.ids('all'):+ for stem in examples.textures(rid):+ assert (project / f'vfx/textures/processed/{stem}.png').is_file(), (rid, stem)+ if (EXAMPLES / f'textures/{stem}.png').is_file():+ assert stem in prompts, (rid, stem)+++def test_value_pair_preserves_geometry_and_rejects_unsynchronized_randomness():+ from vfxkit.primitives import sprite, ramp, contrast_pair+ source = sprite('Blade', 'T_IceShard01', (255, 120, 30, 255), life=16, delay=3, size=2., rotation=[0, 0, 30],+ size_curve=[[0, .8], [100, 1.1]], color_curve=ramp((0, (255, 120, 30, 255)), (100, (180, 35, 10, 0)))['color_curve'])+ before = copy.deepcopy(source)+ dark, bright = contrast_pair(source)+ assert source == before and bright == source and dark['blend'] == 'Blend'+ for key in ('life', 'delay', 'size', 'rotation', 'size_curve', 'texture'):+ assert dark[key] == bright[key]+ assert dark['color_curve']['A'][-1][1] == 0+ assert dark['color_curve']['A'][0][1] == pytest.approx(210)+ for changes in ({'rotation': [0, 0, [0, 360]]}, {'size': [1, 2]}, {'life': [12, 16]},+ {'spawn': {'shape': 'Sphere', 'radius': [0, 1]}}, {'count': 2},+ {'flipbook': {'x': 4, 'y': 4, 'start': [0, 3]}},+ {'properties': {'any/path': 1}}):+ with pytest.raises(ValueError):+ contrast_pair(source | changes)diff --git a/tests/test_package.py b/tests/test_package.pynew file mode 100644index 0000000..df911ac--- /dev/null+++ b/tests/test_package.py@@ -0,0 +1,255 @@+"""Contracts specific to the self-contained skill package: CLI, workspace layout, recipe loading and paths."""+import json+import os+import shutil+import subprocess+import sys+from pathlib import Path++import pytest++from conftest import SCRIPTS, SKILL, cli_env+++def vfx(*args, cwd=None, env=None):+ """Run the CLI with the test interpreter; returns (exit code, parsed JSON stdout)."""+ run = subprocess.run([sys.executable, '-m', 'vfxkit', *args], capture_output=True, text=True, cwd=cwd, env=env or cli_env(), timeout=300)+ lines = run.stdout.strip().splitlines()+ assert len(lines) == 1, (run.stdout, run.stderr) # exactly one JSON object on stdout+ return run.returncode, json.loads(lines[0])+++def system_python():+ for candidate in ('/usr/bin/python3', '/usr/local/bin/python3', shutil.which('python3')):+ if candidate and Path(candidate).is_file() and Path(candidate).resolve() != Path(sys.executable).resolve():+ return candidate+ return None+++def test_doctor_runs_through_the_wrapper_on_a_bare_system_python(tmp_path):+ python = system_python()+ if not python:+ pytest.skip('no system python3 separate from the test interpreter')+ # An empty toolchain home: the wrapper falls back to the system python3 and doctor needs only the standard library.+ bin_dir = tmp_path / 'bin'+ bin_dir.mkdir()+ (bin_dir / 'python3').symlink_to(python)+ env = {'PATH': f'{bin_dir}:/usr/bin:/bin', 'HOME': str(tmp_path / 'home'), 'EFFEKSEER_VFX_HOME': str(tmp_path / 'toolchain'),+ 'VFX_PROJECT': str(tmp_path / 'game')}+ run = subprocess.run(['sh', str(SCRIPTS / 'vfx'), 'doctor'], capture_output=True, text=True, env=env, cwd=tmp_path, timeout=120)+ assert run.returncode == 0, run.stderr+ result = json.loads(run.stdout)+ assert result['ok'] is True and set(result['modes']) == {'authoring', 'build', 'render'}+ assert result['project'] == str((tmp_path / 'game').resolve())+ assert not result['workspace']['initialized'] and result['workspace']['effects'] == 0+ assert result['toolchain']['home'] == str((tmp_path / 'toolchain').resolve())+ assert not result['toolchain']['effekseer_core'] and not result['modes']['build']+ assert result['next'], 'doctor must say what to do next on an empty machine'+++def test_doctor_reports_an_initialised_workspace(project):+ code, result = vfx('--project', str(project), 'doctor')+ assert code == 0 and result['modes']['authoring']+ assert result['workspace']['initialized'] and result['workspace']['effects'] == 13+++def test_help_lists_commands_without_dependencies(tmp_path):+ run = subprocess.run([sys.executable, '-m', 'vfxkit', '--help'], capture_output=True, text=True, env=cli_env(), timeout=60)+ assert run.returncode == 0 and 'examples' in run.stdout and 'doctor' in run.stdout+++def test_cli_init_examples_and_lint_in_a_fresh_project(tmp_path):+ game = tmp_path / 'game'+ code, result = vfx('--project', str(game), 'init', '--no-plugin', cwd=tmp_path)+ assert code == 0 and result['ok'] and result['workspace'] == str(game.resolve() / 'vfx')+ assert (game / 'vfx/textures/processed/T_Glow01.png').is_file()+ code, result = vfx('--project', str(game), 'lint', cwd=tmp_path)+ assert code == 1 and 'No recipes' in result['error']['message']+ code, result = vfx('--project', str(game), 'examples', 'add', 'ice', cwd=tmp_path)+ assert code == 0 and result['effects'] == ['VFX_Projectile_Ice', 'VFX_Ice_Spikes']+ assert 'vfx/src/VFX_Ice_Spikes.py' in result['copied'] and 'vfx/briefs/VFX_Ice_Spikes.json' in result['copied']+ code, result = vfx('--project', str(game), 'lint', '--ids', 'VFX_Ice_Spikes', cwd=tmp_path)+ assert code == 0 and result['ok'] and result['errors'] == {}+ code, result = vfx('--project', str(game), 'lint', '--ids', 'VFX_Nope', cwd=tmp_path)+ assert code == 1 and 'Unknown effect IDs' in result['error']['message']+ code, result = vfx('--project', str(game), 'brief-validate', 'VFX_Ice_Spikes', cwd=tmp_path)+ assert code == 0 and result['ok']+ code, result = vfx('--project', str(game), 'list', cwd=tmp_path)+ assert code == 0 and [e['id'] for e in result['effects']] == ['VFX_Ice_Spikes', 'VFX_Projectile_Ice']+ assert not any(e['built'] for e in result['effects'])+ # Nothing was written outside the chosen project.+ assert not (tmp_path / 'vfx').exists()+++def test_examples_add_does_not_overwrite_without_force(tmp_path):+ game = tmp_path / 'game'+ code, first = vfx('--project', str(game), 'examples', 'add', 'fire')+ assert code == 0 and not first['skipped_existing']+ source = game / 'vfx/src/VFX_Projectile_Fire.py'+ brief = game / 'vfx/briefs/VFX_Projectile_Fire.json'+ source.write_text(source.read_text() + '\n# my edit\n')+ brief_text = brief.read_text()+ code, again = vfx('--project', str(game), 'examples', 'add', 'fire')+ assert code == 0 and 'vfx/src/VFX_Projectile_Fire.py' in again['skipped_existing']+ assert 'vfx/src/VFX_Projectile_Fire.py' not in again['copied']+ assert source.read_text().endswith('# my edit\n') and brief.read_text() == brief_text+ prompts = json.loads((game / 'vfx/texture_prompts.json').read_text())['prompts']+ assert len({p['id'] for p in prompts}) == len(prompts), 'adding twice must not duplicate texture prompts'+ code, forced = vfx('--project', str(game), 'examples', 'add', 'fire', '--force')+ assert code == 0 and 'vfx/src/VFX_Projectile_Fire.py' in forced['copied']+ assert source.read_bytes() == (SKILL / 'assets/examples/src/VFX_Projectile_Fire.py').read_bytes()+++def test_examples_list_and_show_without_a_workspace(tmp_path):+ code, result = vfx('--project', str(tmp_path / 'none'), 'examples', cwd=tmp_path)+ assert code == 0 and [p['name'] for p in result['pairs']] == ['fire', 'ice', 'poison', 'dark']+ assert [s['name'] for s in result['singles']] == ['hit', 'slash', 'charge', 'shield', 'heal']+ code, result = vfx('--project', str(tmp_path / 'none'), 'examples', 'show', 'slash', cwd=tmp_path)+ assert code == 0 and result['id'] == 'VFX_Slash_Fire' and isinstance(result['lint'], str) # no workspace: no texture lint+ code, result = vfx('--project', str(tmp_path / 'none'), 'examples', 'add', cwd=tmp_path)+ assert code == 1 and 'Name an example' in result['error']['message']+ assert not (tmp_path / 'none').exists()+++def test_rubric_and_layer_schema_commands(project):+ code, rubric = vfx('--project', str(project), 'rubric')+ assert code == 0 and [c['id'] for c in rubric['criteria']] == ['read', 'timing', 'layering', 'shape_change', 'motion', 'placement', 'tail', 'identity']+ code, schema = vfx('--project', str(project), 'layer-schema')+ assert code == 0 and schema['ok'] and 'fade_out' in json.dumps(schema)+++def test_effect_verify_reports_missing_evidence_and_fails(project, tmp_path):+ game = tmp_path / 'game'+ vfx('--project', str(game), 'examples', 'add', 'VFX_Ice_Spikes')+ code, result = vfx('--project', str(game), 'effect-verify', 'VFX_Ice_Spikes')+ assert code == 1 and result['ok'] and not result['verified']+ assert {'missing_build_receipt', 'missing_standard_capture'} <= set(result['issues'])+ code, result = vfx('--project', str(game), 'brief-validate', 'not-an-id')+ assert code == 1 and 'effect ID' in result['error']['message']+++def test_library_load_rejects_id_file_mismatch_and_missing_recipe(tmp_path):+ from vfxkit.library import load+ mismatch = tmp_path / 'VFX_Foo.py'+ mismatch.write_text("from vfxkit.primitives import *\n\ndef recipe():\n return effect('Bar','Bar','hit','fire',.5,[flash('c',WHITE,1)])\n")+ with pytest.raises(ValueError, match="id is 'VFX_Foo', got 'VFX_Bar'"):+ load(mismatch)+ missing = tmp_path / 'VFX_None.py'+ missing.write_text('VALUE = 1\n')+ with pytest.raises(ValueError, match=r'define recipe\(\)'):+ load(missing)+ not_dict = tmp_path / 'VFX_List.py'+ not_dict.write_text('def recipe():\n return []\n')+ with pytest.raises(ValueError, match='must return effect'):+ load(not_dict)+ good = tmp_path / 'VFX_Foo2.py'+ good.write_text("from vfxkit.primitives import *\n\ndef recipe():\n return effect('Foo2','Foo','hit','fire',.5,[flash('c',WHITE,1)])\n")+ assert load(good)['id'] == 'VFX_Foo2'+++def test_library_get_rejects_unknown_ids_and_reloads_helpers(tmp_path, monkeypatch):+ from vfxkit import library+ src = tmp_path / 'vfx/src'+ src.mkdir(parents=True)+ monkeypatch.setattr(library, 'SRC', src)+ with pytest.raises(ValueError, match='Unknown effect ID'):+ library.get('VFX_Missing')+ (src / '_shared.py').write_text('LIFE = 10\n')+ (src / 'VFX_Uses.py').write_text("from vfxkit.primitives import *\nimport _shared\n\n"+ "def recipe():\n return effect('Uses','Uses','hit','fire',.5,[flash('c',WHITE,1,life=_shared.LIFE)])\n")+ try:+ assert library.get('VFX_Uses')['layers'][0]['life'] == 10+ (src / '_shared.py').write_text('LIFE = 4\n')+ # A helper edit is picked up without restarting: sources and helpers load fresh on every call.+ assert library.get('VFX_Uses')['layers'][0]['life'] == 4+ assert [r['id'] for r in library.library()] == ['VFX_Uses']+ finally:+ if str(src) in sys.path:+ sys.path.remove(str(src))+ sys.modules.pop('_shared', None)+++def test_workflow_relative_absolute_round_trip_for_project_skill_and_toolchain_paths():+ from vfxkit import workflow+ from vfxkit.paths import ROOT, SKILL as PKG_SKILL, HOME+ assert PKG_SKILL == SKILL+ cases = {ROOT / 'vfx/src/VFX_Fire_Explosion.py': 'vfx/src/VFX_Fire_Explosion.py',+ SKILL / 'assets/brief.schema.json': 'skill:assets/brief.schema.json',+ SKILL / 'scripts/vfxkit/lint.py': 'skill:scripts/vfxkit/lint.py',+ HOME / 'venv/bin/python': 'toolchain:venv/bin/python',+ HOME / 'effekseer/Effekseer1.80.7Win/Tool/bin/EffekseerCore.dll': 'toolchain:effekseer/Effekseer1.80.7Win/Tool/bin/EffekseerCore.dll'}+ for path, name in cases.items():+ assert workflow.relative(path) == name+ assert workflow.absolute(name) == Path(os.path.abspath(path))+ assert workflow.relative(workflow.absolute(name)) == name+ with pytest.raises(ValueError, match='outside the project'):+ workflow.relative(Path('/') / 'definitely-not-a-vfx-location' / 'x.png')+ # A snapshot keys files the same way, so receipts never carry absolute machine paths.+ snapshot = workflow.snapshot([SKILL / 'assets/brief.schema.json', ROOT / 'vfx/missing.png'])+ assert snapshot['skill:assets/brief.schema.json'] and snapshot['vfx/missing.png'] is None+ assert not workflow.unchanged(snapshot)+ assert workflow.unchanged({'skill:assets/brief.schema.json': snapshot['skill:assets/brief.schema.json']})+++def test_paths_follow_vfx_project_and_toolchain_environment(tmp_path):+ code = ('import json,vfxkit.paths as p;print(json.dumps([str(p.ROOT),str(p.WORKSPACE),str(p.WORK),str(p.HOME),str(p.CORE_BIN)]))')+ env = cli_env(VFX_PROJECT=str(tmp_path / 'game'), EFFEKSEER_VFX_HOME=str(tmp_path / 'tools'))+ run = subprocess.run([sys.executable, '-c', code], capture_output=True, text=True, env=env, cwd=tmp_path, check=True)+ root, workspace, work, home, core = map(Path, json.loads(run.stdout))+ assert root == (tmp_path / 'game').resolve() and workspace == root / 'vfx' and work == root / 'vfx/work'+ assert home == (tmp_path / 'tools').resolve() and core == home / 'effekseer/Effekseer1.80.7Win/Tool/bin'+ env.pop('VFX_PROJECT')+ run = subprocess.run([sys.executable, '-c', code], capture_output=True, text=True, env=env, cwd=tmp_path, check=True)+ assert Path(json.loads(run.stdout)[0]) == tmp_path.resolve() # default: the current directory+++def test_effect_ids_are_validated_before_touching_files():+ from vfxkit import workflow+ assert workflow.effect_id('VFX_Fire_Explosion') == 'VFX_Fire_Explosion'+ for bad in ('../VFX_X', 'VFX_', 'Fire', 'VFX_a/b', None, 3):+ with pytest.raises(ValueError):+ workflow.effect_id(bad)+++HIT_SPARK = '''from vfxkit.primitives import *+def recipe():+ hot = (255, 240, 200, 255)+ return effect('Hit_Spark', 'Spark Hit', 'hit', 'physical', .4, [+ flash('Contact flash', WHITE, 2.2, life=4, delay=1),+ glow('Bloom', (255, 170, 70, 170), 1.6, life=9, delay=1),+ radial_sparks('Sparks', 10, hot, color_end=(255, 120, 30, 255), distance=(.8, 1.7), life=(12, 16), delay=1, gravity=.0018),+ smoke('Dust', (185, 160, 135, 200), count=2, size=(.5, .7), life=(13, 14), delay=4),+ ], peak=.03, impact=.3, delivery=MELEE, design='One-line description of what the player sees.')+'''+++def test_a_fresh_project_lints_a_recipe_that_uses_primitive_default_textures(tmp_path):+ # smoke() defaults to the painted T_SmokeSheet01: init must install the starter textures and their prompts.+ game = tmp_path / 'game'+ code, result = vfx('--project', str(game), 'init', '--no-plugin', cwd=tmp_path)+ assert code == 0 and result['ok']+ (game / 'vfx/src/VFX_Hit_Spark.py').write_text(HIT_SPARK)+ code, result = vfx('--project', str(game), 'lint', cwd=tmp_path)+ assert code == 0 and result['ok'] and result['errors'] == {}, result+++def test_init_installs_starter_textures_without_overwriting_or_duplicating_prompts(tmp_path):+ from vfxkit.scaffold import initialize+ starters = sorted((SKILL / 'assets/examples/textures').glob('*.png'))+ assert {p.stem for p in starters} >= {'T_SmokeSheet01', 'T_WispTrail01', 'T_ExplosionSheet01'}+ processed = tmp_path / 'vfx/textures/processed'+ processed.mkdir(parents=True)+ (processed / 'T_SmokeSheet01.png').write_bytes(b'my own sheet')+ initialize(tmp_path, install_plugin=False)+ assert (processed / 'T_SmokeSheet01.png').read_bytes() == b'my own sheet'+ for path in starters:+ if path.stem != 'T_SmokeSheet01':+ assert (processed / path.name).read_bytes() == path.read_bytes(), path.name+ prompts_path = tmp_path / 'vfx/texture_prompts.json'+ prompts = json.loads(prompts_path.read_text())['prompts']+ assert {p.stem for p in starters} <= {p['id'] for p in prompts}+ custom = [{'id': 'T_Mine01', 'prompt': 'mine'}] + prompts+ prompts_path.write_text(json.dumps({'prompts': custom}))+ initialize(tmp_path, install_plugin=False)+ again = json.loads(prompts_path.read_text())['prompts']+ assert again == custom # nothing added twice, project entries keptdiff --git a/tests/test_pipeline.py b/tests/test_pipeline.pynew file mode 100644index 0000000..8538ab6--- /dev/null+++ b/tests/test_pipeline.py@@ -0,0 +1,362 @@+"""Layer compiler, Core round trips, texture processing, recipe primitives and the workspace scaffold.++Tests marked requires_core skip cleanly where EffekseerCore is not installed (authoring-only toolchains)."""+import json+import math+from pathlib import Path++import pytest+from PIL import Image++from conftest import ASSETS, requires_core+++@requires_core+def test_core_roundtrip_preserves_timing_curves_seed_and_model(tmp_path):+ from effekseer_ai.authoring import compile_effect+ from effekseer_ai.session import EffectSession+ tex = tmp_path / 'raw.png'+ Image.new('RGB', (128, 128), 'white').save(tex)+ source = tmp_path / 'test.efkefc'+ runtime = tmp_path / 'test.efk'+ compile_effect({'duration': 1.2, 'seed': 12345, 'layers': [+ {'name': 'curve', 'delay': 9, 'life': 25, 'interval': 3, 'count': 4, 'texture': str(tex), 'scale_start': 2,+ 'scale_curve': [[0, 0], [15, 1], [70, .6], [100, 0]], 'color_curve': {'A': [[0, 0], [20, 255], [100, 0]]}},+ {'name': 'mesh', 'renderer': 'Model', 'life': 35, 'procedural_model': {'Name': 'Test Sphere', 'Shape/PrimitiveType': 'Sphere', 'Shape/Radius': .6}}]},+ source, runtime)+ assert source.read_bytes()[:4] == b'EFKE'+ assert runtime.read_bytes()[:4] == b'SKFE'+ s = EffectSession.open(source)+ n = 'node/root/0'+ assert s.property_get(n + '/CommonValues/Generation/GenerationTimeOffset/Center') == 9+ assert s.property_get(n + '/CommonValues/Generation/GenerationTime/Center') == 3+ assert s.property_get(n + '/RendererCommonValues/AlphaBlend/Value') == 'Add'+ assert len(s.curve_keys(n + '/ScalingValues/FCurve/FCurve/X')) == 4+ assert len(s.curve_keys(n + '/DrawingValues/ColorAll/FCurve/FCurve/A')) == 3+ from effekseer_ai.runtime import load_core+ assert load_core().Global.RandomSeed.Value == 12345+ assert load_core().ProceduralModel.ProceduralModels.Values.Count == 1+ assert s.property_get('node/root/1/DrawingValues/Model/ModelReference/Value') == 'ProceduralModel'+++@requires_core+def test_discovery_excludes_import_only_legacy_fields_and_enums_are_validated(tmp_path):+ from effekseer_ai.session import EffectSession+ s = EffectSession.new()+ s.save(tmp_path / 'test.efkefc')+ p = 'node/root/0'+ paths = s.property_list(p)+ assert p + '/DrawingValues/Type/Value' in paths+ assert p + '/CommonValues/Generation/GenerationTimeOffset/Max' in paths+ assert p + '/CommonValues/GenerationTimeOffset/Max' not in paths+ with pytest.raises(ValueError, match='Import-only'):+ s.property_set(p + '/CommonValues/GenerationTimeOffset/Max', 7)+ with pytest.raises(Exception):+ s.property_set(p + '/DrawingValues/Type/Value', 123456)+++@requires_core+def test_repeated_compile_is_idempotent_and_changes_do_not_accumulate(tmp_path):+ from effekseer_ai.authoring import compile_effect+ from effekseer_ai.session import EffectSession+ recipe = {'layers': [{'name': 'A', 'count': 6, 'life': 17}, {'name': 'B', 'renderer': 'Ring', 'life': 20}]}+ source = tmp_path / 'test.efkefc'+ runtime = tmp_path / 'test.efk'+ compile_effect(recipe, source, runtime)+ first = runtime.read_bytes()+ compile_effect(recipe, source, runtime)+ assert runtime.read_bytes() == first+ assert len(EffectSession.open(source).node_list()) == 2+++@requires_core+def test_shell_fragment_surface_limits_survive_core_save_open(tmp_path):+ from effekseer_ai.authoring import compile_effect+ from effekseer_ai.session import EffectSession+ from vfxkit.primitives import shell_fragments+ pieces = shell_fragments('Fragment', (90, 165, 255, 230), 1.47)+ source = tmp_path / 'fragments.efkefc'+ compile_effect({'duration': 1.8, 'layers': pieces}, source, tmp_path / 'fragments.efk')+ session = EffectSession.open(source)+ nodes = session.node_list()+ assert len(nodes) == 6+ for node in nodes:+ model = session._node(node['path']).DrawingValues.Model.Reference.Value+ assert float(model.Mesh.AngleBeginEnd.X.Value) == pytest.approx(0)+ assert float(model.Mesh.AngleBeginEnd.Y.Value) == pytest.approx(40)+ assert float(model.Shape.DepthMin.Value) == pytest.approx(-.7)+ assert float(model.Shape.DepthMax.Value) == pytest.approx(.85)+++@requires_core+def test_value_pair_fixed_geometry_and_alpha_curve_survive_core_roundtrip(tmp_path):+ from effekseer_ai.authoring import compile_effect+ from effekseer_ai.session import EffectSession+ from vfxkit.primitives import sprite, ramp, contrast_pair+ body = sprite('Matched shard', 'T_IceShard01', (255, 120, 30, 255), life=16, delay=3, size=2.0, rotation=[0, 0, 30],+ color_curve=ramp((0, (255, 120, 30, 255)), (100, (180, 35, 10, 0)))['color_curve'])+ source = tmp_path / 'pair.efkefc'+ compile_effect({'duration': .5, 'layers': contrast_pair(body)}, source, tmp_path / 'pair.efk')+ session = EffectSession.open(source)+ nodes = session.node_list()+ assert len(nodes) == 2+ for node in nodes:+ n = node['path']+ assert session.property_get(n + '/CommonValues/Life/Max') == 16+ assert session.property_get(n + '/CommonValues/Generation/GenerationTimeOffset/Max') == 3+ assert session.property_get(n + '/RotationValues/PVA/Rotation/Z/Max') == 30+ keys = session.curve_keys(n + '/DrawingValues/ColorAll/FCurve/FCurve/A')+ assert keys[-1]['value'] == 0+++@requires_core+def test_advanced_layer_features_survive_core_roundtrip(tmp_path):+ from effekseer_ai.authoring import compile_effect+ from effekseer_ai.session import EffectSession+ tex = tmp_path / 'mask.png'+ Image.new('RGBA', (64, 64), (255, 255, 255, 200)).save(tex)+ recipe = {'duration': 1, 'layers': [+ {'name': 'arc', 'renderer': 'Ring', 'billboard': 'Fixed', 'texture': str(tex), 'life': 12,+ 'ring': {'outer': [1.5, 0], 'inner': {'start': [1, 0], 'end': [1.4, 0]}, 'angle_start': [0, 120], 'angle_end': [20, 200]},+ 'alpha_texture': str(tex), 'cutoff': [[0, 0], [100, .8]], 'edge': {'color': [255, 120, 0, 255], 'threshold': .1, 'scaling': 3}},+ {'name': 'sparks', 'texture': str(tex), 'count': 12, 'life': [10, 20], 'billboard': 'DirectionalBillboard',+ 'spawn': {'shape': 'Sphere', 'radius': [0, .2]}, 'travel': {'end': [0, [1, 2], 0]},+ 'forces': [{'type': 'Gravity', 'gravity': [0, -.002, 0]}, {'type': 'Turbulence', 'power': .01}],+ 'size': [.2, .4], 'size_end': 0, 'color_end': [255, 0, 0, 0], 'collide': {'bounce': [.3, .5]}},+ {'name': 'shell', 'renderer': 'Model', 'life': 30, 'procedural_model': {'Name': 'Shell', 'Shape/PrimitiveType': 'Sphere'},+ 'distortion_texture': str(tex), 'distortion_scroll': [0, .02], 'falloff': {'begin': [0, 0, 0, 0], 'end': [255, 255, 255, 255], 'pow': 3, 'blend': 'Mul'}},+ {'name': 'spike', 'texture': str(tex), 'pivot': 'bottom', 'billboard': 'YAxisFixed', 'life': 20},+ {'name': 'haze', 'texture': str(tex), 'material': 'BackDistortion', 'distortion': .6, 'soft': .8, 'flipbook': {'x': 4, 'y': 4, 'frame_length': 3}}]}+ compile_effect(recipe, tmp_path / 'adv.efkefc', tmp_path / 'adv.efk')+ s = EffectSession.open(tmp_path / 'adv.efkefc')+ arc, sparks, shell, spike, haze = [f'node/root/{i}' for i in range(5)]+ assert s.property_get(arc + '/DrawingValues/Ring/RingShape/Type/Value') == 'Crescent'+ assert s.property_get(arc + '/DrawingValues/Ring/RingShape/Crescent/EndingAngle_Easing/End/Max') == 200+ assert s.property_get(arc + '/AdvancedRendererCommonValuesValues/AlphaCutoffParam/Type/Value') == 'FCurve'+ assert len(s.curve_keys(arc + '/AdvancedRendererCommonValuesValues/AlphaCutoffParam/FCurve/S')) == 2+ assert s.property_get(sparks + '/GenerationLocationValues/Type/Value') == 'Sphere'+ assert s.property_get(sparks + '/LocationValues/Type/Value') == 'Easing'+ assert s.property_get(sparks + '/LocationValues/Easing/End/Y/Max') == 2+ assert s.property_get(sparks + '/LocationAbsValues/LocalForceField2/Type/Value') == 'Turbulence'+ assert s.property_get(sparks + '/ScalingValues/Type/Value') == 'SingleEasing'+ assert s.property_get(sparks + '/CollisionsValues/IsGroundCollisionEnabled/Value') is True+ assert s.property_get(sparks + '/CollisionsValues/Bounce/Max') == .5+ assert s.property_get(shell + '/AdvancedRendererCommonValuesValues/UVDistortionTextureParam/Enabled/Value') is True+ assert s.property_get(shell + '/AdvancedRendererCommonValuesValues/FalloffParam/ColorBlendType/Value') == 'Mul'+ assert s.property_get(spike + '/DrawingValues/Sprite/Position_Fixed_LL/Y/Value') == 0+ assert s.property_get(haze + '/RendererCommonValues/Material/Value') == 'BackDistortion'+ assert s.property_get(haze + '/AdvancedRendererCommonValuesValues/SoftParticleParams/Enabled/Value') is True+ assert s.property_get(haze + '/RendererCommonValues/UVAnimation/AnimationParams/FrameCountX/Value') == 4+ with pytest.raises(ValueError, match='four local force fields'):+ compile_effect({'layers': [{'name': 'x', 'forces': [{'type': 'Gravity', 'gravity': [0, 0, 0]}] * 5}]}, tmp_path / 'bad.efkefc')+++@requires_core+def test_curve_tangent_data_roundtrips_and_invalid_edit_preserves_keys(tmp_path):+ from effekseer_ai.session import EffectSession+ s = EffectSession.new()+ s.save(tmp_path / 'curve.efkefc')+ p = 'node/root/0/ScalingValues/SingleFCurve/S'+ s.curve_set_keys(p, [{'frame': 0, 'value': 0, 'right': [10, .2], 'interpolation': 0}, {'frame': 100, 'value': 1, 'left': [90, .8], 'interpolation': 0}])+ before = s.curve_keys(p)+ with pytest.raises(ValueError, match='unique integers'):+ s.curve_set_keys(p, [{'frame': 0, 'value': 1}, {'frame': 0, 'value': 2}])+ assert s.curve_keys(p) == before+ s.save()+ after = EffectSession.open(tmp_path / 'curve.efkefc').curve_keys(p)+ assert after[0]['right'][0] == 10+ assert math.isclose(after[0]['right'][1], .2, abs_tol=1e-5)+ assert after[1]['left'][0] == 90+++def test_texture_processing_preserves_original_and_straight_alpha(tmp_path):+ from effekseer_ai.resources import process_texture+ raw = tmp_path / 'raw.png'+ im = Image.new('RGB', (256, 256), 'black')+ im.paste('white', (50, 60, 190, 170))+ im.save(raw)+ original = raw.read_bytes()+ output = tmp_path / 'processed.png'+ process_texture(str(raw), str(output), 128)+ assert raw.read_bytes() == original+ result = Image.open(output)+ assert result.size == (128, 128) and result.mode == 'RGBA'+ assert result.getpixel((0, 0)) == (255, 255, 255, 0)+ assert result.getpixel((64, 64)) == (255, 255, 255, 255)+ with pytest.raises(ValueError):+ process_texture(str(raw), str(raw), 128)+++def test_flipbook_sheet_keeps_cells_in_place_and_feathers_their_borders(tmp_path):+ from effekseer_ai.resources import process_texture+ raw = tmp_path / 'sheet.png'+ im = Image.new('RGB', (512, 512), 'white')+ im.paste('black', (0, 0, 256, 256))+ im.save(raw)+ r = process_texture(str(raw), str(tmp_path / 'out.png'), 256, grid=(2, 2))+ result = Image.open(tmp_path / 'out.png')+ assert r['grid'] == [2, 2] and result.size == (256, 256)+ # No crop/re-centre: the empty top-left cell stays empty and the bottom-right cell stays solid in its middle.+ assert result.getpixel((64, 64))[3] == 0 and result.getpixel((192, 192))[3] == 255+ # Cell borders are feathered so neighbouring frames cannot bleed into each other.+ assert result.getpixel((128, 192))[3] == 0 and result.getpixel((255, 192))[3] == 0+++def test_manifest_matches_assets_and_particle_lifetimes():+ from vfxkit.primitives import lifetime+ from vfxkit.paths import ROOT+ manifest = ROOT / 'vfx/vfx_manifest.json'+ if not manifest.is_file():+ pytest.skip('VFX outputs are local only; build them before asset integration tests')+ entries = json.loads(manifest.read_text())+ if not entries:+ pytest.skip('No built effect library (vfx build needs EffekseerCore)')+ assert len({e['id'] for e in entries}) == len(entries)+ for entry in entries:+ recipe = json.loads((ROOT / f'vfx/recipes/{entry["id"]}.json').read_text())+ for layer in recipe['layers']:+ life = lifetime(layer, release=entry.get('flight', 0) * 60)+ assert entry['loop'] or entry['duration'] * 60 >= life, (entry['id'], layer['name'], life)+ assert 0 <= entry['peak'] < entry['duration']+ assert (ROOT / f'vfx/effects/{entry["id"]}.efkefc').is_file()+ assert (ROOT / f'vfx/exports/{entry["id"]}.efk').is_file()+++def test_library_recipes_are_valid_without_core_or_assets():+ from vfxkit.primitives import lifetime, budget, walk, TEXTURE_KEYS+ from vfxkit.library import library+ from vfxkit.textures import masks, EXTRA_PROCEDURAL+ from vfxkit.paths import ROOT+ available = set(masks(16)) | EXTRA_PROCEDURAL | {p['id'] for p in json.loads((ROOT / 'vfx/texture_prompts.json').read_text())['prompts']}+ recipes = library()+ ids = [r['id'] for r in recipes]+ assert len(set(ids)) == len(ids) == 13+ for recipe in recipes:+ layers = list(walk(recipe['layers']))+ assert recipe['design'] and len(layers) >= 4, recipe['id']+ assert max(lifetime(layer, release=recipe.get('flight', 0) * 60) for layer in recipe['layers']) <= recipe['duration'] * 60, recipe['id']+ assert sum(budget(layer) for layer in recipe['layers']) <= 250, recipe['id']+ for layer in layers:+ for key in TEXTURE_KEYS:+ # Every input is either a math primitive or has a recorded image prompt; nothing is undocumented.+ if layer.get(key):+ assert Path(layer[key]).stem in available, (recipe['id'], layer[key])+ resolved = Path(layer[key]) if '/' in layer[key] else ROOT / f'vfx/textures/processed/{layer[key]}.png'+ assert resolved.is_file(), (recipe['id'], layer[key])+++def test_every_effect_declares_how_a_game_delivers_it():+ # The Lab stages each exchange from `delivery`; projectile impacts must name a projectile that exists.+ from vfxkit.library import library+ recipes = library()+ by_id = {r['id']: r for r in recipes}+ kinds = {'self', 'melee', 'projectile', 'targeted', 'area'}+ for recipe in recipes:+ delivery = recipe.get('delivery') or {}+ assert delivery.get('kind') in kinds, recipe['id']+ if recipe['category'] == 'projectile':+ assert recipe.get('flight') and recipe['attach'] == 'projectile', recipe['id']+ assert any((r.get('delivery') or {}).get('projectile') == recipe['id'] for r in recipes), f"{recipe['id']} has no impact effect"+ elif delivery['kind'] == 'projectile':+ assert by_id[delivery['projectile']]['category'] == 'projectile', recipe['id']+++def test_sustained_layers_live_until_release_and_budget_by_overlap():+ from vfxkit.primitives import lifetime, budget+ from vfxkit.lint import lint+ trail = {'name': 'trail', 'infinite': True, 'interval': 2, 'life': [10, 14], 'count': 1, 'delay': 3}+ assert lifetime(trail, release=30) == 30 + 14+ assert budget(trail) == 7+ recipe = {'id': 'VFX_T', 'category': 'projectile', 'element': 'fire', 'duration': .5, 'peak': .05, 'layers': [trail | {'texture': 'T_Glow01'}]}+ assert any('needs flight' in e for e in lint(recipe, (set(), {'T_Glow01'}))['errors'])+ recipe['flight'] = .5+ assert any('alive until frame' in e for e in lint(recipe, (set(), {'T_Glow01'}))['errors'])+++def test_reference_primitives_break_shapes_and_decay_to_smoke():+ from vfxkit.primitives import wisps, decay, slice_line, spray, debris+ from vfxkit.lint import lint+ arcs = wisps('w', (200, 100, 255, 255), 1.2, count=4, life=(14, 22), tilt=((-90, 90), (0, 360), (0, 360)))+ # Each stroke takes its own tilt and size, and the erosion starts above zero so no arc is ever a clean ring.+ assert arcs['renderer'] == 'Ring' and isinstance(arcs['rotation'][0], list) and isinstance(arcs['size'], list)+ assert arcs['cutoff'][0][1] > 0 and arcs['ring']['angle_start'] != arcs['ring']['angle_end']+ smoke = decay(arcs | {'delay': 5, 'emissive': 2}, (110, 100, 120, 170), lag=6, stretch=2)+ assert smoke['blend'] == 'Blend' and smoke['delay'] == 11 and smoke['life'] == [28, 44] and 'emissive' not in smoke+ assert smoke['ring']['center_color'] == [110, 100, 120, 170] and smoke['alpha_scroll'][0] == arcs['alpha_scroll'][0] * .4+ line = slice_line('l', (255, 255, 255, 255), 10, width=.08)+ assert line['scale_end'][0] / line['scale_end'][1] > 40+ thrown = spray([[1, 3], [0, 2], [-1, 1]])+ assert thrown['spawn']['rotate'] is False and thrown['travel']['end'][0] == [1, 3]+ rocks = debris('d', 6, [[1, 3], [0, 2], [-1, 1]], floor=.02)+ assert rocks['blend'] == 'Blend' and rocks['collide']['height'] == .02+ # A random size with a size curve crashes the compiler, so lint stops it first.+ bad = {'id': 'VFX_T', 'category': 'element', 'element': 'fire', 'duration': 1, 'peak': .1,+ 'layers': [{'name': 'g', 'texture': 'T_Glow01', 'size': [.5, 1], 'size_curve': [[0, 1], [100, 0]]}]}+ assert any('fixed size' in e for e in lint(bad, (set(), {'T_Glow01'}))['errors'])+ bad['layers'] = [{'name': 'f', 'texture': 'T_Glow01', 'flipbook': {'x': 4, 'y': 4}, 'distortion_texture': 'T_Glow01'}]+ assert any('neighbouring cells' in e for e in lint(bad, (set(), {'T_Glow01'}))['errors'])+++def test_lifetime_and_budget_follow_children_and_random_life():+ from vfxkit.primitives import lifetime, budget+ layer = {'delay': 5, 'count': 4, 'interval': 2, 'life': [10, 20], 'children': [{'count': 3, 'life': 8, 'delay': 1}]}+ # The last parent is born at 11 and lives 20; its child starts 1 frame after the parent is created and lives 8.+ assert lifetime(layer) == 5 + 3 * 2 + 20+ assert lifetime({'life': 10, 'children': [{'delay': 6, 'life': 12}]}) == 18+ assert budget(layer) == 4 * (1 + 3)+++def test_procedural_noise_is_tileable_and_distortion_maps_are_opaque(tmp_path):+ import numpy as np+ from vfxkit.textures import spectral, masks, procedural+ field = spectral(64, 1.7, seed=1)+ assert field.min() >= 0 and field.max() <= 1+ # Seamless: the wrap-around step is no larger than the steps inside the image.+ assert np.abs(field[:, 0] - field[:, -1]).mean() <= np.abs(np.diff(field, axis=1)).mean() * 1.5+ generated = masks(64)+ assert all(m.shape == (64, 64) for m in generated.values())+ assert generated['T_GradientV01'][-8].mean() > generated['T_GradientV01'][8].mean()+ names = procedural(32, root=tmp_path)+ for name in ('T_Distort01', 'T_Distort02'):+ with Image.open(tmp_path / f'vfx/textures/processed/{name}.png') as image:+ assert np.asarray(image.convert('RGBA'))[..., 3].min() == 255, name+ assert {p.stem for p in (tmp_path / 'vfx/textures/procedural').glob('*.png')} == set(names)+++def test_scaffold_creates_workspace_and_preserves_existing_data(tmp_path):+ from vfxkit.scaffold import initialize+ from vfxkit.paths import ROOT+ result = initialize(tmp_path, install_plugin=False)+ assert result['ok'] and not result['plugin_installed']+ manifest = tmp_path / 'vfx/vfx_manifest.json'+ assert json.loads(manifest.read_text()) == []+ assert (tmp_path / 'vfx/godot/scripts/Vfx.gd').is_file()+ assert (tmp_path / 'vfx/materials/M_Additive.vfxmat.json').is_file()+ assert (tmp_path / 'vfx/.gitignore').is_file() and (tmp_path / 'vfx/src').is_dir() and (tmp_path / 'vfx/briefs').is_dir()+ # Math primitives land in the workspace being initialised, not in whichever project the process started in.+ assert (tmp_path / 'vfx/textures/processed/T_Glow01.png').is_file()+ assert tmp_path.resolve() != ROOT+ manifest.write_text('[{"id":"preserved"}]')+ script = tmp_path / 'vfx/godot/scripts/Vfx.gd'+ script.write_text('preserve custom source')+ initialize(tmp_path, install_plugin=False)+ assert json.loads(manifest.read_text())[0]['id'] == 'preserved'+ assert script.read_text() == 'preserve custom source'+ initialize(tmp_path, install_plugin=False, update_templates=True)+ assert script.read_bytes() == (ASSETS / 'godot-lab/scripts/Vfx.gd').read_bytes()+++def test_scaffold_syncs_character_models(tmp_path):+ from vfxkit.scaffold import initialize+ models = tmp_path / 'vfx/characters'+ models.mkdir(parents=True)+ (models / 'player.glb').write_bytes(b'glTF v1')+ (models / 'player.materials.json').write_text('{"default": "cloth"}')+ initialize(tmp_path, install_plugin=False)+ copy = tmp_path / 'vfx/godot/characters/player.glb'+ assert copy.read_bytes() == b'glTF v1'+ assert (tmp_path / 'vfx/godot/characters/player.materials.json').is_file()+ # A re-exported model replaces the Godot copy even without --update-templates.+ (models / 'player.glb').write_bytes(b'glTF v2')+ initialize(tmp_path, install_plugin=False)+ assert copy.read_bytes() == b'glTF v2'diff --git a/tests/test_privacy.py b/tests/test_privacy.pynew file mode 100644index 0000000..c64900d--- /dev/null+++ b/tests/test_privacy.py@@ -0,0 +1,148 @@+"""The published package carries no personal, machine-specific or secret data, in text or in image metadata.++Generic rules only, so this file itself discloses nothing: e-mail addresses, home and temporary paths, credential+formats, and PNG metadata chunks. Binary files of any other kind fail until they are reviewed and allowed here.+The publisher's brand may appear only in the LICENSE files, the plugin manifests and the top-level README files, and+the vendored bridge's upstream author only in its LICENSE, THIRD_PARTY_NOTICES.md and the README files.++A maintainer can add terms that must never ship (names, handles, private project names) in a file kept outside the+package and point EFFEKSEER_VFX_PRIVATE_TERMS at it (one term per line, case-insensitive); without it that check skips.+"""+import os+import re+import struct+from pathlib import Path++import pytest++from conftest import PACKAGE++PUBLISHER = 'kanaworks'+ATTRIBUTION = 'laodeng000'+SKIPPED_FOLDERS = {'__pycache__', '.pytest_cache', '.git'}+SKIPPED_FILES = {'.DS_Store'} # Finder metadata; ignored by .gitignore, never published+THIS = Path(__file__).resolve()++EMAIL = re.compile(r'[\w.+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}\b') # [email protected] is not one+ALLOWED_EMAIL = re.compile(r'@(?:example\.(?:com|org|invalid)|users\.noreply\.github\.com)$', re.I)+LOCAL_PATH = re.compile(r'(?<![\w.])(?:/Users/[^/\s"\'`<>]+|/home/[^/\s"\'`<>]+|/root/|/private/(?:tmp|var)/|'+ r'/var/folders/|[A-Za-z]:\\Users\\)', re.I)+CREDENTIAL = re.compile(r'(?:sk-[A-Za-z0-9_-]{20,}|sk-ant-[A-Za-z0-9_-]{10,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_\w{20,}|'+ r'AKIA[0-9A-Z]{16}|xox[abposr]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z_-]{30,}|'+ r'-----BEGIN [A-Z ]*PRIVATE KEY-----|'+ r'(?:api[_-]?key|secret|token|password|passwd)["\']?\s*[:=]\s*["\']?[A-Za-z0-9_\-/+=]{16,})', re.I)+# PNG chunks that carry pixels only; text, EXIF, XMP and ICC profiles (which can name a person or a machine) do not.+PNG_SIGNATURE = b'\x89PNG\r\n\x1a\n'+PNG_PIXEL_CHUNKS = {b'IHDR', b'PLTE', b'tRNS', b'IDAT', b'IEND', b'gAMA', b'cHRM', b'sRGB', b'sBIT', b'pHYs'}+REVIEWED_BINARY_SUFFIXES = {'.png'}+++def files():+ for path in sorted(PACKAGE.rglob('*')):+ if path.is_file() and not SKIPPED_FOLDERS & set(path.relative_to(PACKAGE).parts) and path.name not in SKIPPED_FILES:+ yield path+++def publisher_allowed(path):+ relative = path.relative_to(PACKAGE).as_posix()+ return relative in ('LICENSE', 'skills/effekseer-vfx/LICENSE', 'skills/vfx-review/LICENSE',+ '.claude-plugin/plugin.json', '.claude-plugin/marketplace.json') or (+ '/' not in relative and path.name.upper().startswith('README'))+++def attribution_allowed(path):+ relative = path.relative_to(PACKAGE).as_posix()+ return (relative.endswith('scripts/effekseer_ai/LICENSE') or path.name == 'THIRD_PARTY_NOTICES.md'+ or path.name.upper().startswith('README'))+++def private_terms():+ source = os.environ.get('EFFEKSEER_VFX_PRIVATE_TERMS')+ if not source:+ return None+ lines = Path(source).expanduser().read_text(encoding='utf-8').splitlines()+ return [t.strip().lower() for t in lines if t.strip() and not t.lstrip().startswith('#')]+++def text_hits(path, text, terms=()):+ lowered = text.lower()+ found = [m.group(0) for m in EMAIL.finditer(text) if not ALLOWED_EMAIL.search(m.group(0))]+ found += [m.group(0) for m in LOCAL_PATH.finditer(text)]+ found += [m.group(0)[:12] + '...' for m in CREDENTIAL.finditer(text)]+ if PUBLISHER in lowered and not publisher_allowed(path):+ found.append(PUBLISHER)+ if ATTRIBUTION in lowered and not attribution_allowed(path):+ found.append(ATTRIBUTION)+ found += [f'private term #{i + 1}' for i, term in enumerate(terms) if term in lowered]+ return found+++def png_metadata(data):+ """Names of PNG chunks beyond pixel data (or a problem with the file's structure)."""+ if not data.startswith(PNG_SIGNATURE):+ return ['not a PNG']+ extra, offset, ended = [], len(PNG_SIGNATURE), False+ while offset + 8 <= len(data):+ length, kind = struct.unpack('>I4s', data[offset:offset + 8])+ if offset + 12 + length > len(data):+ return extra + [f'{kind.decode("latin-1")} chunk runs past the end of the file']+ if kind not in PNG_PIXEL_CHUNKS:+ extra.append(kind.decode('latin-1'))+ offset += 12 + length+ if kind == b'IEND':+ ended = length == 0+ break+ if not ended:+ extra.append('no valid IEND chunk')+ elif offset < len(data):+ extra.append(f'{len(data) - offset} bytes after IEND')+ return extra+++def file_hits(path, terms=()):+ data = path.read_bytes()+ if path.suffix.lower() == '.png':+ return png_metadata(data)+ try:+ text = data.decode('utf-8')+ except UnicodeDecodeError:+ return [f'unreviewed binary file ({path.suffix or "no suffix"}); review it and allow its type here']+ if '\0' in text:+ return ['unreviewed binary file (NUL bytes)']+ return text_hits(path, text, terms)+++def test_scanner_catches_each_kind_of_leak_and_respects_the_allowlists():+ md = PACKAGE / 'notes.md'+ for leak in ('mail me at [email protected]', 'see /Users/someone/project', 'cd /home/someone/game',+ 'C:\\Users\\someone\\game', 'log in /private/tmp/session', 'API_KEY = "abcdefghijklmnop1234"',+ '{"api_key": "abcdefghijklmnop1234"}', "{'password': 'abcdefghijklmnop1234'}",+ 'token: ghp_abcdefghijklmnopqrstuvwxyz0123', '-----BEGIN OPENSSH PRIVATE KEY-----'):+ assert text_hits(md, leak), leak+ for fine in ("p = 'node/root/0'", '[email protected]', 'the ~/.cache/effekseer-vfx toolchain',+ 'res://scripts/Vfx.gd', 'git clone https://github.com/<owner>/effekseer-vfx-skill', 'brew install [email protected]'):+ assert not text_hits(md, fine), fine+ assert text_hits(md, 'made by ' + PUBLISHER) and not text_hits(PACKAGE / 'LICENSE', 'Copyright ' + PUBLISHER)+ assert text_hits(md, 'by ' + ATTRIBUTION) and not text_hits(PACKAGE / 'THIRD_PARTY_NOTICES.md', 'by ' + ATTRIBUTION)+ assert text_hits(md, 'Private Name here', ['private name']) == ['private term #1']+ clean = PNG_SIGNATURE + struct.pack('>I4s', 0, b'IEND') + b'\0' * 4+ tagged = PNG_SIGNATURE + struct.pack('>I4s', 4, b'tEXt') + b'Name' + b'\0' * 4 + struct.pack('>I4s', 0, b'IEND') + b'\0' * 4+ assert png_metadata(clean) == [] and png_metadata(tagged) == ['tEXt'] and png_metadata(clean + b'x')+ assert png_metadata(PNG_SIGNATURE) # signature only: no IEND+ assert png_metadata(PNG_SIGNATURE + struct.pack('>I4s', 9999, b'IDAT') + b'short') # truncated chunk+++def test_no_file_in_the_package_leaks_personal_machine_or_secret_data():+ # This file holds the patterns and synthetic samples themselves (reviewed by hand: no real data).+ checked = [p for p in files() if p.resolve() != THIS]+ assert any(p.name == 'SKILL.md' for p in checked) and any(p.suffix == '.png' for p in checked)+ terms = private_terms() or []+ leaks = {p.relative_to(PACKAGE).as_posix(): found for p in checked if (found := file_hits(p, terms))}+ assert not leaks, f'private or unreviewed content: {leaks}'+++def test_maintainer_private_terms_when_configured():+ terms = private_terms()+ if terms is None:+ pytest.skip('set EFFEKSEER_VFX_PRIVATE_TERMS to a term list kept outside the package')+ assert terms, 'the private term list is empty'diff --git a/tests/test_safety.py b/tests/test_safety.pynew file mode 100644index 0000000..6267d1d--- /dev/null+++ b/tests/test_safety.py@@ -0,0 +1,446 @@+"""The skill never damages a project it was pointed at by mistake: no workspace side effects, no deleting effects it+did not build, no single broken source blocking the rest, and no project file shadowing a module."""+import json+import subprocess+import sys++import pytest++from conftest import SCRIPTS, SKILL, cli_env, requires_core+from test_package import vfx+++def game(tmp_path, *examples):+ root = tmp_path / 'game'+ code, result = vfx('--project', str(root), 'init', '--no-plugin')+ assert code == 0, result+ for name in examples:+ code, result = vfx('--project', str(root), 'examples', 'add', name)+ assert code == 0, result+ return root++[email protected]('command', [['list'], ['lint'], ['history', 'VFX_Heal'], ['overview'], ['build'], ['effect-verify', 'VFX_Heal']])+def test_commands_need_a_workspace_and_never_create_one(tmp_path, command):+ code, result = vfx(*command, cwd=tmp_path, env=cli_env(VFX_PROJECT=str(tmp_path)))+ assert code == 2 and result['error']['type'] == 'WorkspaceMissing'+ assert not (tmp_path / 'vfx').exists()+++def test_a_vfx_folder_from_another_tool_is_not_a_workspace(tmp_path):+ (tmp_path / 'vfx/effects').mkdir(parents=True)+ (tmp_path / 'vfx/effects/VFX_Theirs.efkefc').write_bytes(b'not ours')+ (tmp_path / 'vfx/vfx_manifest.json').write_text(json.dumps([{'id': 'VFX_Theirs', 'duration': 1.0}]))+ code, result = vfx('--project', str(tmp_path), 'build')+ assert code == 2 and result['error']['type'] == 'WorkspaceMissing'+ code, result = vfx('--project', str(tmp_path), 'doctor')+ assert not result['workspace']['initialized'] and result['workspace']['unmanaged'] == 1+ assert any('not created by vfx init' in step for step in result['next'])+ assert (tmp_path / 'vfx/effects/VFX_Theirs.efkefc').read_bytes() == b'not ours'+++def test_a_full_build_of_an_empty_library_refuses_before_touching_anything(tmp_path):+ root = game(tmp_path)+ (root / 'vfx/effects/VFX_Theirs.efkefc').write_bytes(b'not ours')+ code, result = vfx('--project', str(root), 'build')+ assert code == 1 and 'No recipes' in result['error']['message'] and 'Nothing was built or pruned' in result['error']['message']+ assert (root / 'vfx/effects/VFX_Theirs.efkefc').read_bytes() == b'not ours'+++def test_a_broken_source_only_blocks_itself(tmp_path):+ root = game(tmp_path, 'hit', 'heal')+ (root / 'vfx/src/VFX_Broken.py').write_text('def recipe(:\n')+ code, result = vfx('--project', str(root), 'lint', '--ids', 'VFX_Heal')+ assert code == 0 and result['ok'] and 'SyntaxError' in result['unloaded']['VFX_Broken']+ code, result = vfx('--project', str(root), 'list')+ assert code == 0 and {e['id'] for e in result['effects']} == {'VFX_Hit_Heavy', 'VFX_Heal'} and 'VFX_Broken' in result['unloaded']+ code, result = vfx('--project', str(root), 'lint') # a full lint (and a full build) needs every source+ assert code == 1 and result['error']['type'] == 'SyntaxError'+ code, result = vfx('--project', str(root), 'lint', '--ids', 'VFX_Broken')+ assert code == 1 and result['error']['type'] == 'SyntaxError'+++def test_project_files_never_shadow_modules(tmp_path):+ root = game(tmp_path, 'heal')+ src = root / 'vfx/src'+ (src / '_palette.py').write_text('PALE = (225, 255, 235, 255)\n')+ (src / 'random.py').write_text('raise RuntimeError("vfx/src/random.py shadowed the standard library")\n')+ (root / 'json.py').write_text('raise RuntimeError("the project directory shadowed the standard library")\n')+ recipe = src / 'VFX_Heal.py'+ text = recipe.read_text().replace('from vfxkit.primitives import *\n', 'from vfxkit.primitives import *\nfrom _palette import PALE\nimport random\n', 1)+ recipe.write_text(text.replace('pale=(225,255,235,255)', 'pale=PALE', 1))+ # The wrapper keeps the current directory off sys.path (PYTHONSAFEPATH); helpers resolve only as vfx/src/_name.py.+ assert 'export PYTHONSAFEPATH=1' in (SCRIPTS / 'vfx').read_text()+ code, result = vfx('lint', '--ids', 'VFX_Heal', cwd=root, env=cli_env(VFX_PROJECT=str(root), PYTHONSAFEPATH='1'))+ assert code == 0 and result['ok'], result+++def test_core_passthrough_needs_no_workspace(tmp_path):+ run = subprocess.run([sys.executable, '-m', 'vfxkit', 'core', '--help'], capture_output=True, text=True, cwd=tmp_path,+ env=cli_env(VFX_PROJECT=str(tmp_path)), timeout=120)+ assert run.returncode == 0 and 'property-get' in run.stdout and 'property-set' in run.stdout+ assert not (tmp_path / 'vfx').exists()+++def test_slash_set_bulge_matches_the_shipped_crescent(project):+ from vfxkit.primitives import SLASH02_BULGE+ from vfxkit.textures import inspect+ # slash_set rotates the painted crescent by the bulge angle it assumes; a repainted texture must match it.+ assert abs(inspect(project / 'vfx/textures/processed/T_Slash02.png')['bulge_deg'] - SLASH02_BULGE) < 10+++@requires_core+def test_a_full_build_prunes_only_effects_it_built(tmp_path):+ root = game(tmp_path, 'hit', 'heal')+ code, result = vfx('--project', str(root), 'build')+ assert code == 0, result+ manifest = json.loads((root / 'vfx/vfx_manifest.json').read_text())+ assert all(e['source'] == f"vfx/src/{e['id']}.py" for e in manifest)+ # Another tool's effect: an entry without the marker, its file (which references T_Rune02, as .efkefc does, in+ # UTF-16) and a resource of its own.+ (root / 'vfx/effects/VFX_Theirs.efkefc').write_bytes(b'not ours ' + 'resources/T_Rune02.png'.encode('utf-16-le'))+ (root / 'vfx/effects/resources/T_Theirs.png').write_bytes(b'not ours')+ (root / 'vfx/vfx_manifest.json').write_text(json.dumps(manifest + [{'id': 'VFX_Theirs', 'duration': 1.0}]))+ (root / 'vfx/src/VFX_Heal.py').unlink()+ code, result = vfx('--project', str(root), 'build')+ assert code == 0, result+ ids = [e['id'] for e in json.loads((root / 'vfx/vfx_manifest.json').read_text())]+ assert ids == ['VFX_Hit_Heavy', 'VFX_Theirs']+ assert not (root / 'vfx/effects/VFX_Heal.efkefc').exists() and not (root / 'vfx/exports/VFX_Heal.efk').exists()+ assert (root / 'vfx/effects/VFX_Theirs.efkefc').read_bytes().startswith(b'not ours')+ assert (root / 'vfx/effects/resources/T_Theirs.png').read_bytes() == b'not ours'+ # The unmanaged effect may use T_Rune02, so that copy is kept even though no recipe uses it any more.+ assert (root / 'vfx/effects/resources/T_Rune02.png').is_file()+ code, result = vfx('--project', str(root), 'doctor')+ assert result['workspace']['built'] == 1 and result['workspace']['unmanaged'] == 1+ # Once nothing else may use it, the copy and its .import go; other files with that prefix stay.+ backup = root / 'vfx/effects/resources/T_Rune02.png.bak'+ backup.write_bytes(b'a backup of something else')+ (root / 'vfx/effects/VFX_Theirs.efkefc').unlink()+ (root / 'vfx/vfx_manifest.json').write_text(json.dumps([e for e in json.loads((root / 'vfx/vfx_manifest.json').read_text()) if e['id'] != 'VFX_Theirs']))+ code, result = vfx('--project', str(root), 'build')+ assert code == 0, result+ assert not (root / 'vfx/effects/resources/T_Rune02.png').exists()+ assert backup.read_bytes() == b'a backup of something else'+ assert (root / 'vfx/effects/resources/T_Theirs.png').read_bytes() == b'not ours'+++def owned_workspace(tmp_path, monkeypatch):+ from vfxkit import build+ monkeypatch.setattr(build, 'ROOT', tmp_path)+ monkeypatch.setattr(build, 'WORK', tmp_path / 'vfx/work')+ (tmp_path / 'vfx/effects').mkdir(parents=True)+ (tmp_path / 'vfx/work/builds').mkdir(parents=True)+ return tmp_path+++def test_ownership_needs_the_marker_or_a_matching_receipt(owned_workspace):+ from vfxkit.build import owned, MARKER, digest+ root = owned_workspace+ assert owned({'id': 'VFX_A', 'built_by': MARKER, 'source': 'vfx/src/VFX_A.py'})+ assert not owned({'id': 'VFX_A', 'source': 'handmade/source.efkefc'}) # another tool's `source`+ assert not owned({'id': 'VFX_A', 'built_by': MARKER, 'source': 'vfx/src/VFX_B.py'})+ assert not owned({'id': '../../backup', 'built_by': MARKER, 'source': 'vfx/src/../../backup.py'})+ assert not owned({'id': None}) and not owned('VFX_A')+ # Pre-marker workspaces: a receipt counts only while it still describes the file on disk.+ effect = root / 'vfx/effects/VFX_Old.efkefc'+ effect.write_bytes(b'built by the skill')+ receipt = root / 'vfx/work/builds/VFX_Old.json'+ receipt.write_text(json.dumps({'outputs': {'vfx/effects/VFX_Old.efkefc': digest(effect)}}))+ assert owned({'id': 'VFX_Old'})+ effect.write_bytes(b'replaced by hand')+ assert not owned({'id': 'VFX_Old'})+ receipt.write_text('not json')+ assert not owned({'id': 'VFX_Old'})+++def test_removal_refuses_paths_that_resolve_outside_the_workspace(owned_workspace, tmp_path_factory):+ from vfxkit.build import removable+ root = owned_workspace+ outside = tmp_path_factory.mktemp('outside')+ (outside / 'VFX_A.efk').write_bytes(b'keep')+ (root / 'vfx/exports').symlink_to(outside, target_is_directory=True)+ (root / 'vfx/effects/VFX_A.efkefc').write_bytes(b'ours')+ with pytest.raises(ValueError, match='outside'):+ removable('VFX_A')+ assert (outside / 'VFX_A.efk').read_bytes() == b'keep'+++def test_same_named_resources_with_different_content_are_rejected(tmp_path):+ from vfxkit.build import resource_inputs+ a = tmp_path / 'a/T_Shared.png'; b = tmp_path / 'b/T_Shared.png'; c = tmp_path / 'c/T_Shared.png'+ for path, data in ((a, b'one'), (b, b'two'), (c, b'one')):+ path.parent.mkdir(parents=True); path.write_bytes(data)+ def recipe(*paths):+ return {'id': 'VFX_X', 'layers': [{'name': f'L{i}', 'texture': str(p)} for i, p in enumerate(paths)]}+ assert set(resource_inputs([recipe(a, c)])) == {'T_Shared.png'} # identical copies are fine+ with pytest.raises(ValueError, match='Resource name conflict'):+ resource_inputs([recipe(a), {'id': 'VFX_Y', 'layers': [{'name': 'M', 'model': str(b)}]}])+++def test_init_fills_missing_math_textures_without_replacing_edited_ones(tmp_path):+ root = game(tmp_path)+ processed = root / 'vfx/textures/processed'+ edited = processed / 'T_Glow01.png'+ edited.write_bytes(b'edited by the project')+ (processed / 'T_Dot01.png').unlink()+ code, result = vfx('--project', str(root), 'init', '--no-plugin')+ assert code == 0, result+ assert edited.read_bytes() == b'edited by the project' and (processed / 'T_Dot01.png').is_file()+++def test_helpers_never_shadow_built_in_modules(tmp_path):+ root = game(tmp_path, 'heal')+ # `_lsprof` is a built-in extension that nothing has imported yet in a fresh CLI process.+ (root / 'vfx/src/_lsprof.py').write_text('raise RuntimeError("a project helper shadowed a built-in module")\n')+ recipe = root / 'vfx/src/VFX_Heal.py'+ recipe.write_text(recipe.read_text().replace('from vfxkit.primitives import *\n', 'from vfxkit.primitives import *\nimport _lsprof\n', 1))+ code, result = vfx('--project', str(root), 'lint', '--ids', 'VFX_Heal')+ assert code == 0 and result['ok'], result+++def test_each_skill_folder_carries_its_license_texts():+ from conftest import PACKAGE+ root_license = (PACKAGE / 'LICENSE').read_bytes()+ assert (SKILL / 'LICENSE').read_bytes() == root_license+ assert (PACKAGE / 'skills/vfx-review/LICENSE').read_bytes() == root_license+ assert (SKILL / 'THIRD_PARTY_NOTICES.md').read_bytes() == (PACKAGE / 'THIRD_PARTY_NOTICES.md').read_bytes()+++def test_setup_pins_every_archive_it_downloads():+ setup = (SCRIPTS / 'setup.sh').read_text()+ assert 'dotnet-install' not in setup # an unpinned installer script would run unchecked code+ for name in ('CORE', 'DOTNET'):+ assert f'{name}_URL=' in setup and f'fetch "${name}_URL" "${name}_SHA256"' in setup+++@requires_core+def test_a_build_never_replaces_a_resource_another_built_effect_uses(tmp_path):+ root = game(tmp_path, 'hit')+ code, result = vfx('--project', str(root), 'build')+ assert code == 0, result+ # A second effect brings a different file with the same base name as the hit's burst texture.+ other = root / 'vfx/textures/alt/T_Impact01.png'+ other.parent.mkdir(parents=True)+ other.write_bytes((root / 'vfx/textures/processed/T_Glow01.png').read_bytes())+ source = (root / 'vfx/src/VFX_Hit_Heavy.py').read_text().replace("'Hit_Heavy','Heavy Hit'", "'Hit_Alt','Alt Hit'")+ (root / 'vfx/src/VFX_Hit_Alt.py').write_text(source.replace("'T_Impact01'", repr(str(other.with_suffix('')))))+ before = (root / 'vfx/effects/resources/T_Impact01.png').read_bytes()+ code, result = vfx('--project', str(root), 'build', '--ids', 'VFX_Hit_Alt')+ assert code == 1 and 'Resource name conflict' in result['error']['message']+ assert (root / 'vfx/effects/resources/T_Impact01.png').read_bytes() == before+++def test_output_folders_that_resolve_outside_the_workspace_are_refused(owned_workspace, tmp_path_factory):+ from vfxkit.build import check_output_dirs+ root = owned_workspace+ check_output_dirs()+ outside = tmp_path_factory.mktemp('outside')+ (root / 'vfx/effects/resources').symlink_to(outside, target_is_directory=True)+ with pytest.raises(ValueError, match='outside'):+ check_output_dirs()+++def conflict_setup(root, owner_entry=None, handmade=None):+ from vfxkit.ownership import MARKER+ resources = root / 'vfx/effects/resources'+ resources.mkdir(parents=True, exist_ok=True)+ (resources / 'T_Shared.png').write_bytes(b'current')+ new = root / 'new/T_Shared.png'+ new.parent.mkdir(parents=True, exist_ok=True)+ new.write_bytes(b'different')+ previous = []+ if owner_entry:+ (root / 'vfx/recipes').mkdir(parents=True, exist_ok=True)+ (root / 'vfx/recipes/VFX_B.json').write_text(json.dumps({'layers': [{'name': 'L', 'texture': 'vfx/effects/resources/T_Shared.png'}]}))+ previous.append({'id': 'VFX_B', 'built_by': MARKER, 'source': 'vfx/src/VFX_B.py'})+ if handmade is not None:+ (root / 'vfx/effects/VFX_Hand.efkefc').write_bytes(handmade)+ return {'T_Shared.png': new}, previous+++def test_conflicts_protect_owned_effects_unless_they_are_rebuilt_or_removed(owned_workspace):+ from vfxkit.build import check_resource_conflicts+ inputs, previous = conflict_setup(owned_workspace, owner_entry=True)+ with pytest.raises(ValueError, match='VFX_B uses'):+ check_resource_conflicts(inputs, previous, {'VFX_A'}, set())+ check_resource_conflicts(inputs, previous, {'VFX_A', 'VFX_B'}, set()) # rebuilt together+ check_resource_conflicts(inputs, previous, {'VFX_A'}, {'VFX_B'}) # a full build is removing it+++def test_conflicts_protect_hand_made_effects_without_a_recipe(owned_workspace):+ from vfxkit.build import check_resource_conflicts+ inputs, previous = conflict_setup(owned_workspace, handmade=b'x' + 'resources/T_Shared.png'.encode('utf-16-le'))+ with pytest.raises(ValueError, match='did not build'):+ check_resource_conflicts(inputs, previous, {'VFX_A'}, set())+ (owned_workspace / 'vfx/effects/VFX_Hand.efkefc').write_bytes(b'uses other textures only')+ check_resource_conflicts(inputs, previous, {'VFX_A'}, set())+ with pytest.raises(ValueError, match='unowned manifest entry'): # an entry whose file is missing: unknown users+ check_resource_conflicts(inputs, [{'id': 'VFX_Gone', 'duration': 1}], {'VFX_A'}, set())+++def test_doctor_uses_the_same_ownership_rules(tmp_path):+ root = game(tmp_path)+ (root / 'vfx/effects/VFX_Theirs.efkefc').write_bytes(b'not ours')+ (root / 'vfx/vfx_manifest.json').write_text(json.dumps([{'id': 'VFX_Theirs', 'source': 'handmade/theirs.efkefc'}]))+ (root / 'vfx/effects/VFX_Stray.efkefc').write_bytes(b'in no manifest')+ code, result = vfx('--project', str(root), 'doctor')+ assert result['workspace']['built'] == 0 and result['workspace']['unmanaged'] == 2+++def test_setup_locks_with_the_kernel_not_a_lock_directory():+ setup = (SCRIPTS / 'setup.sh').read_text()+ assert 'exec flock' in setup and 'fcntl.flock' in setup+ assert 'mkdir "$LOCK"' not in setup and 'rm -rf "$LOCK"' not in setup+++def test_missing_output_folders_under_an_outside_link_are_refused(owned_workspace, tmp_path_factory):+ from vfxkit.build import check_output_dirs+ root = owned_workspace+ outside = tmp_path_factory.mktemp('outside')+ (root / 'vfx/godot').symlink_to(outside, target_is_directory=True) # vfx/godot/effects does not exist yet+ with pytest.raises(ValueError, match='outside'):+ check_output_dirs()+++def test_file_links_that_lead_outside_are_never_written(owned_workspace, tmp_path_factory):+ from vfxkit.build import check_targets+ root = owned_workspace+ outside = tmp_path_factory.mktemp('outside') / 'precious.json'+ outside.write_text('keep')+ (root / 'vfx/recipes').mkdir()+ link = root / 'vfx/recipes/VFX_A.json'+ link.symlink_to(outside)+ with pytest.raises(ValueError, match='outside'):+ check_targets([link])+ check_targets([root / 'vfx/recipes/VFX_B.json']) # not there yet: fine+ assert outside.read_text() == 'keep'+++def test_resource_names_ignore_case(tmp_path):+ from vfxkit.build import resource_inputs+ from vfxkit.ownership import may_use+ effect = tmp_path / 'VFX_Hand.efkefc'+ effect.write_bytes(b'x' + 'resources/t_rune02.png'.encode('utf-16-le'))+ assert may_use(effect, 'T_Rune02.png') and not may_use(effect, 'T_Rune03.png')+ a = tmp_path / 'a/T_Glow.png'; b = tmp_path / 'b/t_glow.png'+ for path, data in ((a, b'one'), (b, b'two')):+ path.parent.mkdir(parents=True); path.write_bytes(data)+ with pytest.raises(ValueError, match='ignore case'):+ resource_inputs([{'id': 'VFX_X', 'layers': [{'name': 'A', 'texture': str(a)}, {'name': 'B', 'texture': str(b)}]}])+++@requires_core+def test_a_build_mirrors_only_its_own_resources(tmp_path):+ root = game(tmp_path, 'hit', 'heal')+ code, result = vfx('--project', str(root), 'build')+ assert code == 0, result+ # Another effect's resource whose copies differ between folders (hand-made, say): an unrelated build leaves it.+ (root / 'vfx/effects/resources/T_Hand.png').write_bytes(b'effects copy')+ (root / 'vfx/exports/resources/T_Hand.png').write_bytes(b'exports copy')+ code, result = vfx('--project', str(root), 'build', '--ids', 'VFX_Heal')+ assert code == 0, result+ assert (root / 'vfx/exports/resources/T_Hand.png').read_bytes() == b'exports copy'+ assert not (root / 'vfx/godot/effects/resources/T_Hand.png').exists()+ rune = root / 'vfx/textures/processed/T_Rune02.png'+ for folder in ('effects/resources', 'exports/resources', 'godot/effects/resources'):+ assert (root / 'vfx' / folder / 'T_Rune02.png').read_bytes() == rune.read_bytes()+++def test_references_match_non_ascii_names_in_any_case(tmp_path):+ from vfxkit.ownership import may_use+ effect = tmp_path / 'VFX_Hand.efkefc'+ for name in ('T_冰.png', 'T_Ä.png'):+ for prefix in (b'', b'\x00'): # either UTF-16 alignment+ effect.write_bytes(prefix + ('resources/' + name).encode('utf-16-le'))+ assert may_use(effect, name) and may_use(effect, name.lower()) and may_use(effect, name.upper())+ assert not may_use(effect, 'T_Other.png')+++def test_case_aliases_with_the_same_content_keep_every_spelling(tmp_path):+ from vfxkit.build import resource_inputs+ a = tmp_path / 'a/T_Glow.png'; b = tmp_path / 'b/t_glow.png'+ for path in (a, b):+ path.parent.mkdir(parents=True); path.write_bytes(b'same')+ found = resource_inputs([{'id': 'VFX_X', 'layers': [{'name': 'A', 'texture': str(a)}, {'name': 'B', 'texture': str(b)}]}])+ assert set(found) == {'T_Glow.png', 't_glow.png'}++[email protected]('linked', ['godot/vfx_manifest.json', 'texture_prompts.json'])+def test_init_never_writes_through_a_link_that_leads_outside(tmp_path, tmp_path_factory, linked):+ root = game(tmp_path)+ outside = tmp_path_factory.mktemp('outside') / 'target.json'+ outside.write_text('[]\n' if linked.endswith('manifest.json') else '{"prompts": []}\n')+ before = outside.read_text()+ # A non-empty library makes init sync the Lab manifest; a missing starter prompt makes it rewrite the prompts.+ (root / 'vfx/vfx_manifest.json').write_text(json.dumps([{'id': 'VFX_Kept', 'duration': 1.0}]))+ (root / 'vfx' / linked).unlink()+ (root / 'vfx' / linked).symlink_to(outside)+ code, result = vfx('--project', str(root), 'init', '--no-plugin')+ assert code == 1 and 'outside' in result['error']['message']+ assert outside.read_text() == before+++def test_resource_names_compare_in_unicode_normal_form(tmp_path):+ import unicodedata+ from vfxkit.ownership import may_use, same_name+ composed, decomposed = unicodedata.normalize('NFC', 'T_Ä.png'), unicodedata.normalize('NFD', 'T_Ä.png')+ assert composed != decomposed and same_name(composed, decomposed) and same_name(composed, decomposed.lower())+ effect = tmp_path / 'VFX_Hand.efkefc'+ effect.write_bytes(('resources/' + decomposed).encode('utf-16-le'))+ assert may_use(effect, composed)+++def test_json_stores_never_write_through_a_pre_placed_temporary_link(tmp_path, tmp_path_factory, monkeypatch):+ import os+ from vfxkit import workflow+ monkeypatch.setattr(workflow, 'ROOT', tmp_path)+ (tmp_path / 'vfx/work').mkdir(parents=True)+ outside = tmp_path_factory.mktemp('outside') / 'precious'+ outside.write_text('keep')+ target = tmp_path / 'vfx/work/receipt.json'+ (tmp_path / f'vfx/work/receipt.json.{os.getpid()}.tmp').symlink_to(outside) # the old predictable name+ workflow.save_json(target, {'ok': True})+ assert json.loads(target.read_text()) == {'ok': True} and outside.read_text() == 'keep'+ assert not [p for p in (tmp_path / 'vfx/work').iterdir() if p.name.endswith('.tmp') and not p.is_symlink()]+++def test_setup_without_a_new_enough_python_stops_clearly_and_drops_a_stale_env(tmp_path):+ import os+ import shutil as sh+ for fixed in ('/opt/homebrew/bin/python3', '/usr/local/bin/python3'):+ if os.path.exists(fixed) and subprocess.run([fixed, '-c', 'import sys; sys.exit(sys.version_info < (3, 11))']).returncode == 0:+ pytest.skip(f'{fixed} is a usable Python, so setup would succeed here')+ # A PATH with the basic tools setup.sh needs but no uv, flock or python at all.+ tools = tmp_path / 'bin'+ tools.mkdir()+ for name in ('dirname', 'mkdir', 'mktemp', 'rm', 'uname', 'cat'):+ found = sh.which(name)+ if found:+ (tools / name).symlink_to(found)+ home = tmp_path / 'toolchain'+ stale = home / 'venv/bin'+ stale.mkdir(parents=True)+ (stale / 'python').write_text('#!/bin/sh\nexit 1\n') # an old or broken environment from an earlier attempt+ (stale / 'python').chmod(0o755)+ run = subprocess.run(['/bin/sh', str(SCRIPTS / 'setup.sh'), '--authoring-only'], capture_output=True, text=True,+ env={'PATH': str(tools), 'HOME': str(tmp_path), 'EFFEKSEER_VFX_HOME': str(home)}, timeout=120)+ assert run.returncode == 4, run.stderr+ assert 'Python 3.11 or newer is required' in run.stderr and 'Replacing' in run.stderr+ assert not (home / 'venv').exists()+++def test_a_capture_that_never_draws_stops_early_with_the_reason(tmp_path):+ import time+ from vfxkit.review import run_windowed+ started = time.monotonic()+ # Stands in for a Godot that cannot open a window: it prints, then hangs without ever writing a frame.+ command = [sys.executable, '-c', 'import time; print("Connection invalid", flush=True); time.sleep(60)']+ with pytest.raises(RuntimeError, match='rendered no frame') as failure:+ run_windowed(command, timeout=60, progress=lambda: False, startup=2)+ assert time.monotonic() - started < 20 and 'Connection invalid' in str(failure.value)+ assert 'outside the sandbox' in str(failure.value)+ # A capture that writes frames runs to completion.+ done = run_windowed([sys.executable, '-c', 'print("ok")'], timeout=60, progress=lambda: True, startup=0)+ assert done.returncode == 0 and 'ok' in done.stdoutdiff --git a/tests/test_workflow.py b/tests/test_workflow.pynew file mode 100644index 0000000..c82062b--- /dev/null+++ b/tests/test_workflow.py@@ -0,0 +1,316 @@+"""Workflow contracts: no stale evidence, dropped key moments or unlabelled reference clocks."""+import copy+import json+from pathlib import Path+import shutil+import subprocess+import sys++import pytest+from PIL import Image, ImageDraw++from conftest import ASSETS, SCRIPTS+++def test_briefs_expand_child_births_and_validate_the_shipped_examples():+ from vfxkit import briefs+ from vfxkit.library import library+ rows = briefs.timeline([{'name': 'parent', 'delay': 3, 'count': 2, 'interval': 4, 'life': 10,+ 'children': [{'name': 'child', 'delay': 2, 'life': [4, 8]}]}])+ assert rows[1]['start_frame'] == 5 and rows[1]['last_birth_frame'] == 9 and rows[1]['end_frame'] == 17+ checked = 0+ for recipe in library():+ brief = briefs.read(recipe['id'])+ assert brief is not None, f'{recipe["id"]} ships without a brief'+ assert briefs.validate(brief, recipe)['ok']+ assert not briefs.validate(brief | {'anchor': 'wrong'}, recipe)['ok']+ bad = copy.deepcopy(brief)+ bad['beats'][0]['frame'] = .3+ assert not briefs.validate(bad, recipe)['ok']+ checked += 1+ assert checked == 13+ duplicate = briefs.timeline([{'name': 'same'}, {'name': 'same'}])+ assert duplicate[0]['path'] != duplicate[1]['path']+ assert not briefs.validate(None, library()[0])['ok']+++def test_flipbook_integer_fields_are_rejected_before_native_compilation():+ from effekseer_ai.authoring import validate_layer+ assert any('positive integer' in e for e in validate_layer({'name': 'sheet', 'flipbook': {'x': 4, 'y': 4, 'frame_length': 4.5}}))+ assert not validate_layer({'name': 'sheet', 'flipbook': {'x': 4, 'y': 4, 'frame_length': 4}})+++def isolated(tmp_path, monkeypatch):+ """Point the workspace-relative modules at an empty project (ROOT) and its work/ store (WORK)."""+ from vfxkit import workflow+ monkeypatch.setattr(workflow, 'ROOT', tmp_path)+ monkeypatch.setattr(workflow, 'WORK', tmp_path / 'vfx/work')+ return tmp_path+++def lab(isolated, monkeypatch):+ from vfxkit import workflow, evidence+ root = isolated+ texture = root / 'vfx/textures/processed/T.png'+ texture.parent.mkdir(parents=True)+ Image.new('RGBA', (32, 32), 'white').save(texture)+ recipe = {'id': 'VFX_Test', 'duration': .5, 'peak': .1, 'category': 'hit', 'element': 'fire',+ 'attach': 'body', 'delivery': {'kind': 'self'}, 'layers': [{'name': 'body', 'texture': str(texture), 'life': 20}]}+ for path in evidence.outputs(recipe['id']):+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text('compiled')+ for folder in ('effects', 'exports', 'godot/effects'):+ target = root / f'vfx/{folder}/resources/T.png'+ target.parent.mkdir(parents=True, exist_ok=True)+ target.write_bytes(texture.read_bytes())+ material = root / 'vfx/materials/M_Additive.vfxmat.json'+ material.parent.mkdir(parents=True)+ material.write_text('{}')+ # The Lab template ships read-only inside the skill; a private copy stands in for it so a test can "update" it.+ template = root / 'skill-lab'+ shutil.copytree(ASSETS / 'godot-lab', template)+ monkeypatch.setattr(evidence, 'LAB', template)+ shutil.copytree(ASSETS / 'godot-lab', root / 'vfx/godot', dirs_exist_ok=True)+ (root / 'vfx/godot/vfx_manifest.json').write_text(json.dumps([recipe]))+ monkeypatch.setattr(evidence, 'current_recipe', lambda rid: copy.deepcopy(recipe))+ return root, recipe+++def captured(lab):+ from vfxkit import evidence+ root, recipe = lab+ evidence.write_build(recipe, {'source': 'source.efkefc', 'writes': 12})+ paths = []+ for f in (0, 3, 6, 15, 30, 36):+ p = root / f'vfx/previews/strips/runs/one/frames/VFX_Test_f{f:03d}.png'+ p.parent.mkdir(parents=True, exist_ok=True)+ Image.new('RGB', (64, 32), 'red' if f else 'black').save(p)+ paths.append(p)+ return evidence.write_capture(recipe['id'], [paths[1]], paths,+ {'view': 'standard', 'profile': 'default'}, {'status': 'complete'},+ evidence.stage_snapshot(), recipe)+++def report():+ return {'id': 'VFX_Test', 'scores': {k: 2 for k in ('read', 'timing', 'layering', 'shape_change', 'motion', 'placement', 'tail', 'identity')},+ 'worst': 'read', 'fix': 'Keep the main silhouette legible.', 'verdict': 'ship'}+++def test_evidence_is_stored_in_the_workspace_work_folder(lab):+ from vfxkit import evidence+ root, _ = lab+ capture = captured(lab)+ assert evidence.store() == root / 'vfx/work'+ assert (root / f'vfx/work/captures/{capture["evidence_id"]}.json').is_file()+ assert (root / 'vfx/work/builds/VFX_Test.json').is_file()+ # Skill sources are bound with a skill: prefix, never as machine-specific absolute paths.+ build = evidence.read_build('VFX_Test')+ assert any(k.startswith('skill:scripts/vfxkit/') for k in build['inputs']['files'])+ assert not any(k.startswith('/') for k in [*build['inputs']['files'], *capture['images'], *capture['frames']])+++def test_build_and_render_reject_changed_sources_assets_outputs_and_templates(lab):+ from vfxkit import evidence+ root, recipe = lab+ capture = captured(lab)+ assert not evidence.capture_issues(capture)+ recipe['layers'][0]['life'] = 21+ assert 'build_inputs_changed' in evidence.capture_issues(capture)+ recipe['layers'][0]['life'] = 20+ source = root / 'vfx/textures/processed/T.png'+ source.write_bytes(source.read_bytes() + b'changed')+ assert 'build_inputs_changed' in evidence.capture_issues(capture)+ source.write_bytes((root / 'vfx/effects/resources/T.png').read_bytes())+ evidence.outputs(recipe['id'])[1].write_text('tampered')+ assert 'build_outputs_changed' in evidence.capture_issues(capture)+ evidence.outputs(recipe['id'])[1].write_text('compiled')+ assert not evidence.capture_issues(capture)+ (root / 'skill-lab/project.godot').write_text('updated template')+ issues = evidence.capture_issues(capture)+ assert 'capture_stage_changed' in issues and any(i.startswith('templates_not_synced') for i in issues)+++def test_independent_report_binds_images_scores_and_observed_frames(lab):+ from vfxkit import evidence+ capture = captured(lab)+ assert evidence.submit(capture['evidence_id'], 'reviewer-123', report(), [3, 15])['verdict'] == 'ship'+ with pytest.raises(ValueError, match='actually captured'):+ evidence.submit(capture['evidence_id'], 'reviewer-123', report(), [5])+ with pytest.raises(ValueError, match='reviewer'):+ evidence.submit(capture['evidence_id'], 'author', report(), [3])+ wrong = report()+ wrong['scores']['tail'] = 1+ with pytest.raises(ValueError):+ evidence.submit(capture['evidence_id'], 'reviewer-123', wrong, [3])+ p = lab[0] / next(iter(capture['images']))+ p.write_text('replaced image')+ with pytest.raises(ValueError, match='stale'):+ evidence.submit(capture['evidence_id'], 'reviewer-123', report(), [3])+++def test_completion_requires_brief_review_and_overview_instead_of_no_flags(lab):+ from vfxkit import evidence, workflow+ root, recipe = lab+ capture = captured(lab)+ result = evidence.verify(recipe['id'], False)+ assert not result['verified'] and 'missing_independent_review' in result['issues'] and 'invalid_or_missing_brief' in result['issues']+ brief = {'schema_version': 1, 'effect_id': recipe['id'], 'role': 'hit', 'style': 'toon', 'dominant_shape': 'burst',+ 'palette': {k: [200, 100, 50] for k in ('core', 'body', 'dark', 'matter')}, 'delivery': recipe['delivery'],+ 'anchor': 'body', 'beats': [{'frame': 6, 'name': 'contact', 'expect': 'short flash'}],+ 'layer_plan': [{'name': '0:body', 'role': 'body', 'primitive': 'sprite', 'exit': 'erode'}],+ 'acceptance': ['readable'], 'avoid': ['flat']}+ workflow.save_json(root / 'vfx/briefs/VFX_Test.json', brief)+ assert 'capture_brief_changed' in evidence.capture_issues(capture)+ capture = captured(lab)+ evidence.submit(capture['evidence_id'], 'reviewer-123', report(), [3, 15])+ partial = evidence.verify(recipe['id'], False)+ assert partial['passed_without_overview'] and not partial['verified'] and partial['issues'] == ['overview_not_checked']+ assert 'missing_or_stale_overview' in evidence.verify(recipe['id'])['issues']+ overview = root / 'vfx/previews/strips/overview_1.png'+ overview.parent.mkdir(parents=True, exist_ok=True)+ Image.new('RGB', (64, 32), 'red').save(overview)+ workflow.save_json(evidence.store() / 'overview.json', {'images': workflow.snapshot([overview]), 'evidence': {recipe['id']: capture['evidence_id']}})+ assert evidence.verify(recipe['id'])['verified']+ evidence.write_build(recipe, {'source': 'source', 'writes': 12})+ assert 'capture_build_changed' in evidence.verify(recipe['id'])['issues']+++def test_frame_plan_keeps_contact_and_flags_static_or_missing_capture(tmp_path):+ from vfxkit.review import sample_plan, frame_state+ entry = {'id': 'VFX_Test', 'duration': 1.2, 'peak': .1}+ expected = sample_plan(entry, 4)+ assert set(range(4, 10)) <= set(expected) and 78 in expected+ for f in [0, *expected]:+ Image.new('RGB', (32, 32), 'black').save(tmp_path / f'VFX_Test_f{f:03d}.png')+ assert frame_state(tmp_path, 'VFX_Test', expected)['status'] == 'inconclusive'+ Image.new('RGB', (32, 32), 'white').save(tmp_path / 'VFX_Test_f006.png')+ assert frame_state(tmp_path, 'VFX_Test', expected)['status'] == 'complete'+ (tmp_path / 'VFX_Test_f005.png').unlink()+ assert frame_state(tmp_path, 'VFX_Test', expected)['missing'] == [5]+ with pytest.raises(ValueError):+ sample_plan(entry, 0)+++def test_texture_checks_distinguish_intentional_blank_from_bad_grid(isolated):+ from vfxkit.texture_audit import audit+ p = isolated / 'vfx/textures/processed/T_Sheet.png'+ p.parent.mkdir(parents=True)+ im = Image.new('RGBA', (64, 64), (255, 255, 255, 0))+ ImageDraw.Draw(im).rectangle((8, 8, 20, 20), fill='white')+ im.save(p)+ result = audit('T_Sheet', 'flipbook', [2, 2], allow_empty=[1, 2, 3])+ assert result['ok'] and result['measurements']['empty_cells'] == [1, 2, 3]+ assert not any('Empty cells' in s for s in result['warnings'])+ assert (isolated / result['preview']).is_file() and result['preview'].startswith('vfx/work/')+ assert not audit('T_Sheet', 'flipbook', [3, 3])['ok']+ assert not audit('T_Sheet', 'uv_distortion')['ok']+ with pytest.raises(ValueError):+ audit('../T_Sheet')+++def test_reference_clock_and_real_ffmpeg_import(isolated):+ from vfxkit import reference+ assert reference.effect_time(3.0, 1.0, 2.0) == 1.0+ with pytest.raises(ValueError):+ reference.effect_time(1., 0., 0.)+ if not shutil.which('ffmpeg') or not shutil.which('ffprobe'):+ pytest.skip('ffmpeg reference decoder unavailable')+ source = isolated / 'source.mp4'+ subprocess.run(['ffmpeg', '-v', 'error', '-y', '-f', 'lavfi', '-i', 'testsrc2=size=128x96:rate=12:duration=1', str(source)], check=True)+ record = reference.import_clip(source, end=1., slow=2., fps=12)+ assert record['duration_effect'] == .5 and len(record['frames']) == 12+ assert record['times'][1] == pytest.approx(1 / 24)+ span = reference.frames(record['reference_id'], 0, .2, 4)+ assert (isolated / span['image']).is_file() and len(span['times']) == 4+++def test_reference_compare_requires_exact_fresh_render_frames(lab):+ from vfxkit import evidence, reference, workflow+ capture = captured(lab)+ ident = 'a' * 24+ source = evidence.store() / 'references' / ident / 'reference.png'+ source.parent.mkdir(parents=True)+ Image.new('RGB', (96, 64), 'orange').save(source)+ workflow.save_json(source.parent / 'manifest.json', {'reference_id': ident, 'duration_effect': .6,+ 'times': [0., .1, .5], 'frames': [workflow.relative(source)] * 3})+ result = reference.compare(ident, capture['evidence_id'], [.1, .5])+ assert (lab[0] / result['image']).is_file()+ assert result['pairs'][0]['rendered_frame'] == 6+ with pytest.raises(ValueError, match='was not captured'):+ reference.compare(ident, capture['evidence_id'], [.2])+ (lab[0] / 'vfx/godot/project.godot').write_text('changed')+ with pytest.raises(ValueError, match='stale'):+ reference.compare(ident, capture['evidence_id'], [.1])+++def test_project_lock_serializes_two_independent_processes(tmp_path):+ common = ('import sys;from pathlib import Path;sys.path.insert(0,sys.argv[1]);'+ 'import vfxkit.workflow as workflow;workflow.WORK=Path(sys.argv[2]);')+ owner_code = common + '\nwith workflow.project_lock():\n print("held",flush=True)\n sys.stdin.readline()\n'+ contender_code = common + '\nwith workflow.project_lock():\n print("acquired",flush=True)\n'+ args = [str(SCRIPTS), str(tmp_path)]+ env = {'VFX_PROJECT': str(tmp_path), 'PYTHONDONTWRITEBYTECODE': '1', 'PATH': '/usr/bin:/bin'}+ owner = subprocess.Popen([sys.executable, '-c', owner_code, *args], stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True, env=env)+ contender = None+ try:+ assert owner.stdout.readline().strip() == 'held'+ contender = subprocess.Popen([sys.executable, '-c', contender_code, *args], stdout=subprocess.PIPE, text=True, env=env)+ with pytest.raises(subprocess.TimeoutExpired):+ contender.communicate(timeout=.2)+ owner.stdin.write('release\n')+ owner.stdin.flush()+ assert owner.wait(timeout=5) == 0+ output, _ = contender.communicate(timeout=5)+ assert contender.returncode == 0 and output.strip() == 'acquired'+ assert (tmp_path / 'project.lock').is_file()+ finally:+ if owner.poll() is None:+ owner.kill()+ owner.wait()+ if contender is not None and contender.poll() is None:+ contender.kill()+ contender.wait()+++def test_project_lock_is_reentrant_within_a_process(isolated):+ from vfxkit import workflow++ @workflow.locked+ def inner():+ return 'ok'++ with workflow.project_lock():+ assert inner() == 'ok'+ assert (isolated / 'vfx/work/project.lock').is_file()+++def test_review_handoff_gives_a_reviewer_everything_and_submits_its_report(lab):+ from vfxkit import evidence, handoff+ root, recipe = lab+ capture = captured(lab)+ result = handoff.handoff(recipe['id'])+ brief = Path(result['prompt_file']).read_text()+ assert result['evidence_id'] == capture['evidence_id'] and result['captured_frames'] == [0, 3, 6, 15, 30, 36]+ for image in capture['images']:+ assert str(root / image) in brief+ assert result['report_file'] in brief and 'review_rubric.json' in brief and 'vfx/src' in brief+ assert result['reviewer_skill'] and Path(result['reviewer_skill']).name == 'SKILL.md' and result['reviewer_skill'] in brief+ assert json.loads((root / 'vfx/work/handoff/review_rubric.json').read_text())['criteria']+ assert 'vfx review-submit ' + capture['evidence_id'] in result['next']+ # The reviewer writes the report where the brief says; the default frames come from it.+ Path(result['report_file']).write_text(json.dumps(report() | {'observed_frames': [3, 15]}))+ stored = json.loads(Path(result['report_file']).read_text())+ assert evidence.submit(capture['evidence_id'], 'reviewer-7', stored, stored['observed_frames'])['verdict'] == 'ship'+++def test_review_handoff_refuses_a_missing_or_stale_capture(lab):+ from vfxkit import evidence, handoff+ root, recipe = lab+ with pytest.raises(ValueError, match='No standard capture'):+ handoff.handoff(recipe['id'])+ captured(lab)+ evidence.write_build(recipe, {'source': 'source', 'writes': 12}) # rebuilt after the capture+ with pytest.raises(ValueError, match='stale'):+ handoff.handoff(recipe['id'])