Skip to content

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

Sequences, blockout gate and an opt-in stylized hard-edge pack

Kana470c5fadf7b8
diff --git a/README.ja.md b/README.ja.md
index 8c41997..66960a7 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -13,6 +13,7 @@
- **`vfx-review`** — レビュアースキル。作者は自分の作品を採点しないため、別のエージェントがレシピを見ずに、固定の評価基準でストリップを採点します。
- **サンプル** — 完成済みのエフェクト 16 種。ブリーフとテクスチャ付き:遠距離ペア 4 組(炎、氷、毒、闇:飛翔体 + 着弾)、ヒット・斬撃・チャージ・シールド・ヒール各 1 種、そして怪獣セット(背びれを昇っていくチャージ、薙ぎ払えるアトミックビーム、写真調の爆発)。前後比較の診断事例 3 件も付属。
- **大規模でリアルなエフェクト** — `scale='kaiju'` は、キャラクタースケールのレシピを 40 倍大きく 2.5 倍遅くビルドします(サイズ、速度、重力、予算、レビューのカメラがすべて追従します)。`beam()` は、ゲームが毎フレーム終点を動かす保持型のビームを作ります(`Vfx.beam()` → `aim()` → `release()`)。`charge_chain()` は点の連なりに沿ってアークを灯します。写真調の炎、煤、煙のフリップブック。Forward+ で検証済みのソフトパーティクル。
+- **コンボ、ブロックアウト、スタイライズ形状** — シーケンスブリーフで複数のエフェクトをキャラクターアニメーションの拍に結び付け、ブロックアウト → ディテール → ポリッシュの順に進めます(テクスチャ作業の前に独立したブロックアウトレビューの合格が必要)。キャプチャはゲーム本体から取り込めます。参照には「盗むもの」のリストを付け、レビュアーが確認します。`vfx paintover` はキャプチャしたフレームをコンセプト用の画像編集プロンプトにします。ハードエッジのスタイライズ用プリミティブ(`spiral_ribbons`、`spike_crown`、`speed_streaks`、`stylized_pair`、`sparkle`)、グレースケールマスクのテンプレート、画面フィードバック(`screen=`:シェイク、インパクトフレーム、ヒットストップ。Lab が再生し、`Vfx.screen_cue` でゲームに渡します)。
## 動作要件
diff --git a/README.md b/README.md
index c3be1e1..055d498 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,12 @@ Agent skills that let a coding agent (Claude Code, Codex, Cursor, Gemini CLI, Gi
(sizes, speeds, gravity, budgets and the review camera all follow); `beam()` makes a held beam whose end point the
game moves every frame (`Vfx.beam()` → `aim()` → `release()`); `charge_chain()` lights arcs along a chain of
points; photographic fire, soot and smoke flipbooks; soft particles verified in Forward+.
+- **Combos, blockout and stylized shapes** — a sequence brief ties several effects to the beats of a character
+ animation and gates the work blockout → detail → polish (an independent blockout review must pass before any
+ texture work); captures can come from the game itself; references carry steal lists the reviewer checks; `vfx
+ paintover` turns a captured frame into an image-edit prompt for a concept target. Hard-edged stylized primitives
+ (`spiral_ribbons`, `spike_crown`, `speed_streaks`, `stylized_pair`, `sparkle`), greyscale mask templates, and
+ screen feedback (`screen=`: shake, impact frame, hit-stop) that the Lab plays and `Vfx.screen_cue` hands to the game.
## Requirements
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 77f1c47..16d9705 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -15,6 +15,7 @@
- **`vfx-review`** —— 评审技能:由另一个 agent 在看不到配方的情况下,按固定评分表给连拍图打分,因为作者从不给自己的作品打分。
- **示例** —— 十六个完成的效果,附设计简报和纹理:四组远程配对(火、冰、毒、暗:飞行体 + 命中),打击、斩击、蓄力、护盾、治疗各一个,以及一个怪兽套组(沿背鳍骨板攀升的蓄力、可以扫动的原子光束、照片级的爆炸);另有三个前后对照的诊断教案。
- **大型与写实效果** —— `scale='kaiju'` 把角色尺度的配方构建得大 40 倍、慢 2.5 倍(尺寸、速度、重力、预算和复查镜头全都随之变化);`beam()` 制作一条持续光束,终点由游戏每帧移动(`Vfx.beam()` → `aim()` → `release()`);`charge_chain()` 沿一串点点亮电弧;照片级的火焰、烟灰和烟雾序列帧;软粒子已在 Forward+ 中验证。
+- **连段、灰盒与风格化形状** —— 序列简报把多个特效绑定到角色动画的节拍上,按灰盒 → 细节 → 打磨推进(贴图工作之前必须先通过独立的灰盒评审);截图可以直接来自游戏本身;参考资料附带“偷什么”清单,由评审逐项检查;`vfx paintover` 把截到的关键帧变成概念图用的图像编辑提示词。硬边风格化原语(`spiral_ribbons`、`spike_crown`、`speed_streaks`、`stylized_pair`、`sparkle`)、灰度遮罩模板,以及屏幕反馈(`screen=`:震屏、冲击帧、顿帧,由 Lab 播放,并通过 `Vfx.screen_cue` 交给游戏)。
## 环境要求
diff --git a/skills/effekseer-vfx/SKILL.md b/skills/effekseer-vfx/SKILL.md
index 53ad7ea..68ed9ad 100644
--- a/skills/effekseer-vfx/SKILL.md
+++ b/skills/effekseer-vfx/SKILL.md
@@ -1,6 +1,6 @@
---
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, beam, charge, magic, buff or shield VFX, realistic or kaiju/giant-scale effects, 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.
+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, beam, charge, magic, buff or shield VFX, combos and finishers driven by a character animation, stylized hard-edged VFX, realistic or kaiju/giant-scale effects, or a VFX library for a Godot game. Covers design briefs, sequences with a blockout gate, reference steal lists, paintover concepts, texture generation prompts, Python recipe code, EffekseerCore compilation, filmstrip review, screen feedback, independent scoring and export.
license: MIT
compatibility: Build and render need macOS on Apple silicon or Windows (x64), 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, Linux or Windows with Python 3.11+.
metadata:
@@ -50,6 +50,17 @@ look. Say so plainly: report the work as **not compiled and not render-verified*
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.
+## Making a combo or a skill with several beats
+
+When several effects fire on the beats of one animation (a laser chain ending on a finisher), work on them as a
+**sequence** ([sequence](references/sequence.md)): measure the event times in the game, write
+`vfx/sequences/<SEQ_ID>.json`, and go **blockout → detail → polish**. The blockout uses basic shapes and solid colours
+only (`effect(..., stage='blockout')`) and must get an independent `ship` (`vfx sequence-review`, preferably with
+`--frames` captured in the game, then `sequence-handoff` / `sequence-submit`) before any texture work. Detail adds
+references with steal lists; polish adds a paintover concept (`vfx paintover`, an image-edit model, `vfx
+concept-compare`) and the finisher's screen feedback (`screen=`). Cut any element that does not carry the theme and
+record it in `cut`. Each effect in the sequence still has its own brief, recipe and single-effect review.
+
## 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.
@@ -60,6 +71,8 @@ look. Say so plainly: report the work as **not compiled and not render-verified*
- Units: recipe timing in 60 FPS frames, F-curves in percent of life, manifest duration/peak in seconds, Godot API rotation in radians.
- Write recipes at the Lab's character scale; for a larger world declare `scale` instead of hand-scaling numbers ([scale](references/scale.md)). Frames in briefs and reviews are the built, scaled timeline.
- Every effect declares `delivery`; a projectile needs a paired impact effect that points back to it.
+- Screen feedback (shake, impact frame, hit-stop) is manifest data (`screen=`), reviewed with the effect; the game
+ plays it from `Vfx.screen_cue`, never as a separate hand-tuned guess.
- 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.
@@ -73,6 +86,8 @@ look. Say so plainly: report the work as **not compiled and not render-verified*
| shield, pillar, boss, status, volumes, occlusion | [shapes.md](references/shapes.md) |
| matching a reference video | [reference.md](references/reference.md) |
| giants, kaiju, warships: anything far larger than a character | [scale.md](references/scale.md) |
+| combo, finisher, several effects on one animation, blockout, paintover, camera shake / flash frame / hit-stop | [sequence.md](references/sequence.md) |
+| stylized hard-edged look, only when the brief's `style` asks for it: toon shapes, spiral ribbons, spiky dark bases, star glints, greyscale masks | [stylized.md](references/stylized.md) |
| beam, laser, breath weapon, charge chain, values the game drives at runtime | [primitives.md](references/primitives.md) (`beam`, `charge_chain`, `bind`), [godot.md](references/godot.md#beams) |
| realistic / photographic explosion, fire, smoke, steam | [realism.md](references/realism.md) |
| a specific visual failure (white blob, empty tail, no break-up) | [cases.md](references/cases.md) |
diff --git a/skills/effekseer-vfx/assets/examples/texture_prompts.json b/skills/effekseer-vfx/assets/examples/texture_prompts.json
index 8663884..74c2133 100644
--- a/skills/effekseer-vfx/assets/examples/texture_prompts.json
+++ b/skills/effekseer-vfx/assets/examples/texture_prompts.json
@@ -174,6 +174,27 @@
"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 photorealistic EXPLOSION FIREBALL, like a high-speed film photograph of a real fuel explosion, rendered as a monochrome LUMINANCE mask: brightest white where the fire is hottest, mid greys for cooler turbulent fire, dark grey for soot-covered rolling surfaces. Frame 1: small blinding white compact core. Frames 2-6: the fireball expands fast into a turbulent rolling mass of many small convection cells, hot white-grey inside, with dark soot veins and darker crust forming on its edges. Frames 7-12: growth slows, the surface darkens and becomes mostly dark grey smoke with a few remaining bright pockets. Frames 13-16: dark, faint, torn remnants fading away to black. Grayscale only on a pure BLACK background; each frame stays fully inside its own cell with a black margin, never touching the cell border. No grid lines, no text, no ground, no debris.",
"post": "same original as T_FireballSheet01; RGB = 0.3 + 0.7 * luminance/0.8 (soot shading), alpha = silhouette (max of luminance and its 2 px blur, 0.03..0.16): the opaque body drawn under the fire with Blend",
"source": "image generation model; processed copy only (the original is not shipped)"
+ },
+ {
+ "id": "T_RibbonStrip01",
+ "size": 1024,
+ "prompt": "Game VFX greyscale mask texture, 2048x512 landscape. A single long horizontal hand-painted energy ribbon running the full width from the left edge to the right edge, pure white shape on a completely flat pure black background. The ribbon gently waves up and down twice, its thickness varies (thick in places, pinched thin in others), and both its upper and lower edges throw off sharp curved barbs / thorn-like hooks that sweep backwards like stylized anime flame tongues. Crisp hard edges, no blur, no gradients, no glow, no texture noise, solid flat white fill. The ribbon stays within the middle 70% of the height with black margin above and below. No text, no characters, no environment, no UI. An isolated mask asset to be tinted in a game engine.",
+ "post": "seamless in U: crossfade the last 12% of the width over the start, crop rows to the ribbon, pad 45% above and below, threshold .45-.55, 1024x256 alpha; then vfx helix-texture --turns 1 --bands 3 -> T_RibbonHelix01",
+ "source": "prompt template only: this texture is not shipped; generate it, then process it as `post` says (stylized hard-edge masks, references/stylized.md)"
+ },
+ {
+ "id": "T_SpikeCrown01",
+ "size": 1024,
+ "prompt": "Game VFX greyscale mask texture, 2048x512 landscape, seamlessly tileable left-to-right. A continuous band of tall jagged spikes rising from a solid base along the bottom edge: pure white shapes on a completely flat pure black background. Spikes of very uneven heights (some reach 90% of the image height, some only 30%), leaning slightly in different directions, some curved like thorns or shards of torn black paper, with sharp pointed tips and small secondary splinters breaking off. The bottom 10% is solid white with no gaps. Crisp hard edges, flat white fill, no blur, no gradients, no glow. No text, no characters, no environment, no UI. Isolated mask asset to be wrapped around a cylinder in a game engine.",
+ "post": "seamless in U: crossfade the last 12% of the width over the start, threshold .45-.55, 1024x256 alpha",
+ "source": "prompt template only: this texture is not shipped; generate it, then process it as `post` says (stylized hard-edge masks, references/stylized.md)"
+ },
+ {
+ "id": "T_SpikeSplat01",
+ "size": 512,
+ "prompt": "Game VFX greyscale mask texture, 1024x1024 square, viewed from directly above. A ground impact splat: a solid white roughly round centre (about 40% of the image width) with many sharp jagged spikes and shard-like streaks bursting radially outward in all directions, of very uneven lengths, some curving slightly, some broken into separate splinters near their tips, like a stylized anime crater burst or ink splash. Pure white shape on a completely flat pure black background, crisp hard edges, flat fill, no blur, no gradients, no glow. Keep a black margin at every border; nothing touches the edges. No text, no characters, no environment, no UI. Isolated decal mask to be tinted in a game engine.",
+ "post": "vfx process-texture --size 512",
+ "source": "prompt template only: this texture is not shipped; generate it, then process it as `post` says (stylized hard-edge masks, references/stylized.md)"
}
]
}
diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd
index 62fe21b..1578efb 100644
--- a/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd
+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/Vfx.gd
@@ -1,5 +1,8 @@
extends Node
## Game-facing Effekseer API. All effect internals stay behind this autoload.
+## Effects whose manifest entry has `screen` ({shake, flash_frames, flash, hitstop}) emit screen_cue at their peak:
+## connect it to the game's camera shake, impact frame and hit-stop.
+signal screen_cue(id: String, screen: Dictionary, position: Vector3)
var manifest: Array = []
var effects: Dictionary = {}
var active: Array[CombatVfxHandle] = []
@@ -33,6 +36,9 @@ func play(id: String, position: Vector3, rotation: Vector3 = Vector3.ZERO, effec
var defaults: Array = effects[id].get("inputs", [])
for i in defaults.size(): handle.inputs[i] = float(defaults[i])
handle.push_inputs()
+ if effects[id].has("screen"):
+ handle.cue(effects[id].screen, float(effects[id].get("peak", 0.0)))
+ handle.screen_cue.connect(func(screen: Dictionary, at: Vector3): screen_cue.emit(id, screen, at))
return handle
## Fire a beam effect (manifest delivery "beam") from `from` at `to`. Call `aim(from, to)` on the handle every frame
diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd
index 7ee9e81..e4c33a1 100644
--- a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd
+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxHandle.gd
@@ -5,6 +5,10 @@ extends Node3D
## Projectiles fly() to a point, emit `arrived` there and release() their trail.
## Beams aim() from a point at a point; the recipe's bind equations read the length (@In0) and power (@In1).
signal arrived(position: Vector3)
+## The manifest's screen feedback, emitted once when the effect clock reaches its peak (see Vfx.screen_cue).
+signal screen_cue(screen: Dictionary, position: Vector3)
+var screen: Dictionary = {}
+var screen_at: float = -1.0
## Current values of the game inputs @In0..@In3, pushed to the emitter every frame (a value set before the
## native effect exists would otherwise be lost).
var inputs: Array[float] = [0.0, 0.0, 0.0, 0.0]
@@ -77,6 +81,11 @@ func aim(from: Vector3, to: Vector3) -> void:
global_basis = Basis(x * size.x, y * size.y, z * size.z)
inputs[0] = length / maxf(size.y, 0.0001)
+## Emit screen_cue with `value` once `at` seconds of effect time have passed.
+func cue(value: Dictionary, at: float) -> void:
+ screen = value
+ screen_at = maxf(at, 0.0)
+
func set_input(index: int, value: float) -> void:
inputs[index] = value
@@ -95,6 +104,9 @@ func _process(delta: float) -> void:
inputs[1] = beam_power
push_inputs()
elapsed += delta * speed
+ if screen_at >= 0.0 and elapsed >= screen_at:
+ screen_at = -1.0
+ screen_cue.emit(screen, global_position)
if flight_elapsed >= 0.0:
flight_elapsed += delta * speed
var p := minf(flight_elapsed / flight_time, 1.0)
diff --git a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd
index d2d2118..c2e8408 100644
--- a/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd
+++ b/skills/effekseer-vfx/assets/godot-lab/scripts/VfxLab.gd
@@ -100,14 +100,33 @@ var stage: Node3D
var sun: DirectionalLight3D
var isolated_camera_base: Transform3D
var combat_camera_base: Transform3D
-# The beam the current sequence is firing and how it sweeps: two {t, to} keys and the muzzle; released at beam_end.
-var beam_handle: CombatVfxHandle
-var beam_path: Array = []
-var beam_end: float = 0.0
+# Beams the current exchange is firing: {handle, path: [{t, to}, {t, to}, {from}], end}; each sweeps between its two
+# keys and is released at its end time. A sequence can have several in flight at once.
+var beams: Array = []
+# --sequence=<json>: several effects performed one after another ({id, length, steps: [{t, id}]}, references/sequence.md).
+# Each step is staged like a single effect, shifted to its time; captures name their frames after the sequence id.
+var sequence_mode: bool = false
+var sequence_plan: Dictionary = {}
+var stage_offset: float = 0.0
+# Screen feedback from the manifest `screen` (shake, flash_frames + flash, hitstop), played at the effect's peak.
+var flash_layer: CanvasLayer
+var flash_rect: ColorRect
+var flash_left: int = 0
+var hitstop_left: float = 0.0
+const IMPACT_FRAME_SHADER := """shader_type canvas_item;
+uniform sampler2D screen_tex : hint_screen_texture, filter_linear;
+uniform int mode = 0; // 0 white flash, 1 invert: dark becomes white, light (characters, the effect) becomes ink
+void fragment() {
+ vec3 c = texture(screen_tex, SCREEN_UV).rgb;
+ float luma = dot(c, vec3(0.2126, 0.7152, 0.0722));
+ COLOR = mode == 1 ? vec4(vec3(step(luma, 0.32)), 1.0) : vec4(1.0, 1.0, 1.0, 0.85);
+}
+"""
func _ready() -> void:
_build_stage()
_build_ui()
+ _build_flash()
var args := OS.get_cmdline_user_args()
for arg in args:
if arg.begins_with("--capture="):
@@ -143,6 +162,11 @@ func _ready() -> void:
if arg == "--showcase": showcase = true
if arg == "--no-dummies": hide_dummies = true
if arg == "--isolated": combat = false
+ if arg.begins_with("--sequence="):
+ var plan = JSON.parse_string(FileAccess.get_file_as_string(arg.trim_prefix("--sequence=")))
+ if plan is Dictionary:
+ sequence_plan = plan
+ sequence_mode = true
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.
@@ -168,6 +192,21 @@ func _ready() -> void:
# Captures start each effect themselves, after the empty reference frame.
_select(index, not capture_mode)
+func _build_flash() -> void:
+ flash_layer = CanvasLayer.new()
+ flash_layer.layer = 50
+ add_child(flash_layer)
+ flash_rect = ColorRect.new()
+ flash_rect.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
+ flash_rect.mouse_filter = Control.MOUSE_FILTER_IGNORE
+ var mat := ShaderMaterial.new()
+ var shader := Shader.new()
+ shader.code = IMPACT_FRAME_SHADER
+ mat.shader = shader
+ flash_rect.material = mat
+ flash_rect.visible = false
+ flash_layer.add_child(flash_rect)
+
func _find_id(id: String) -> int:
for i in range(Vfx.manifest.size()):
if Vfx.manifest[i].id == id: return i
@@ -562,8 +601,9 @@ func _replay() -> void:
if Vfx.manifest.is_empty(): return
if capture_mode: seed(int(Vfx.manifest[index].get("seed", 1729)))
Vfx.stop_all()
- beam_handle = null
- beam_path = []
+ beams = []
+ flash_left = 0
+ flash_rect.visible = false
elapsed = 0
sequence_id += 1
events.clear()
@@ -576,6 +616,20 @@ func _replay() -> void:
shake = 0
camera.transform = camera_home
effect_start = 0.0
+ if sequence_mode:
+ # Every step staged as if it were the selected effect, shifted to its time on one clock.
+ delivery_text = "SEQUENCE · " + str(sequence_plan.get("id", ""))
+ for step in sequence_plan.get("steps", []):
+ var entry: Dictionary = Vfx.effects.get(str(step.id), {})
+ if entry.is_empty():
+ push_error("Sequence step is not in the manifest: " + str(step.id))
+ continue
+ stage_offset = float(step.t)
+ _stage(entry)
+ stage_offset = 0.0
+ effect_start = 0.0
+ sequence_end = float(sequence_plan.get("length", 2.0))
+ return
if combat:
_stage(item)
return
@@ -666,10 +720,12 @@ func _stage(item: Dictionary) -> void:
var from := player.position + MUZZLE * stage_scale
var near := enemy.position + Vector3(-1.6, 0.0, 0.12) * stage_scale
var chest := enemy.position + ATTACH_OFFSET.body * stage_scale
- beam_path = [{"t": launch_at, "to": near}, {"t": launch_at + hold * 0.7, "to": chest}, {"from": from}]
- beam_end = launch_at + hold
+ # A sequence of shots aims straight at the chest: the rake belongs to a single held beam.
+ var start_to := chest if sequence_mode else near
+ var ray := {"handle": null, "path": [{"t": stage_offset + launch_at, "to": start_to}, {"t": stage_offset + launch_at + hold * 0.7, "to": chest}, {"from": from}], "end": stage_offset + launch_at + hold}
+ beams.append(ray)
effect_start = launch_at
- _at(launch_at, func(): beam_handle = Vfx.beam(item.id, from, near))
+ _at(launch_at, func(): ray.handle = Vfx.beam(item.id, from, start_to))
_hit_at(launch_at + float(item.peak), item, player)
sequence_end = launch_at + float(item.duration)
"area":
@@ -698,11 +754,14 @@ func _hit_at(t: float, item: Dictionary, source: Node3D, victim: Node3D = enemy,
_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})
+ events.append({"t": t + stage_offset, "do": action})
func _move(actor: Node3D, key: Dictionary) -> void:
if not moves.has(actor.name): moves[actor.name] = []
- moves[actor.name].append(key)
+ var shifted := key.duplicate()
+ shifted.t = float(key.t) + stage_offset
+ if shifted.has("strike"): shifted.strike = float(key.strike)
+ moves[actor.name].append(shifted)
func _run_events() -> void:
var due := events.filter(func(e): return elapsed >= e.t)
@@ -812,6 +871,7 @@ 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
+ _screen(item)
var power := float(item.get("impact", 0.0))
if power <= 0.0: return
impact_fired = true
@@ -823,6 +883,22 @@ func _kick(item: Dictionary, at: Vector3) -> void:
flash_light.position = at + Vector3(0.4, 0.5, 1.2) * stage_scale
shake = 0.16 * power * stage_scale
+func _screen(item: Dictionary) -> void:
+ # The manifest's screen feedback, the way a game plays it: camera trauma, a few impact frames, a hit-stop.
+ var screen: Dictionary = item.get("screen", {})
+ if screen.is_empty(): return
+ shake = maxf(shake, 0.32 * float(screen.get("shake", 0.0)) * stage_scale)
+ var frames := int(screen.get("flash_frames", 0))
+ if frames > 0:
+ flash_left = frames
+ (flash_rect.material as ShaderMaterial).set_shader_parameter("mode", 1 if str(screen.get("flash", "white")) == "invert" else 0)
+ flash_rect.visible = true
+ # Captures keep the 60 FPS effect clock (frame numbers must match the manifest); interactive playback freezes.
+ var stop := float(screen.get("hitstop", 0.0))
+ if stop > 0.0 and not capture_mode:
+ hitstop_left = stop
+ Vfx.set_speed(0.05)
+
func _game_feel(delta: float) -> void:
flash_light.light_energy = move_toward(flash_light.light_energy, 0.0, delta * 22.0 * stage_scale)
shake = move_toward(shake, 0.0, delta * 0.7 * stage_scale)
@@ -843,6 +919,13 @@ func _process(delta: float) -> void:
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.
+ # Decrement before this frame's events: a flash set below shows on this frame and `flash_frames - 1` more.
+ if flash_left > 0:
+ flash_left -= 1
+ if flash_left == 0: flash_rect.visible = false
+ if hitstop_left > 0.0:
+ hitstop_left -= delta
+ if hitstop_left <= 0.0: Vfx.set_speed(1.0)
if not Vfx.paused and (not capture_mode or capture_started):
_run_events()
_game_feel(delta)
@@ -861,13 +944,16 @@ func _process(delta: float) -> void:
elif looped and not showcase and elapsed > sequence_end+.55: _replay()
func _steer_beam() -> void:
- # Sweep the beam's end point between its keys, then release it; captures and playback follow the same clock.
- if beam_handle == null or not is_instance_valid(beam_handle) or beam_handle.released or beam_path.size() < 3: return
- var a: Dictionary = beam_path[0]
- var b: Dictionary = beam_path[1]
- var u := _smooth(clampf((elapsed - float(a.t)) / maxf(float(b.t) - float(a.t), 0.001), 0.0, 1.0))
- beam_handle.aim(beam_path[2].from, (a.to as Vector3).lerp(b.to, u))
- if elapsed >= beam_end: beam_handle.release()
+ # Sweep each beam's end point between its keys, then release it; captures and playback follow the same clock.
+ for ray: Dictionary in beams:
+ var handle = ray.handle
+ if handle == null or not is_instance_valid(handle) or handle.released: continue
+ var path: Array = ray.path
+ var a: Dictionary = path[0]
+ var b: Dictionary = path[1]
+ var u := _smooth(clampf((elapsed - float(a.t)) / maxf(float(b.t) - float(a.t), 0.001), 0.0, 1.0))
+ handle.aim(path[2].from, (a.to as Vector3).lerp(b.to, u))
+ if elapsed >= float(ray.end): handle.release()
func _notification(what: int) -> void:
if what == NOTIFICATION_WM_CLOSE_REQUEST and capture_mode:
@@ -901,13 +987,16 @@ func _capture_tick(item: Dictionary) -> void:
func _strip_tick(item: Dictionary) -> void:
capture_frame += 1
+ # A sequence is captured as one take named after it, on its own clock.
+ var shot_id: String = str(sequence_plan.get("id", "SEQ")) if sequence_mode else str(item.id)
+ var seconds: float = float(sequence_plan.get("length", 2.0)) if sequence_mode else float(item.duration)
if capture_frame == 11 and not capture_started:
- _capture_image("%s_f000" % item.id) # empty stage: the reference for visibility metrics
+ _capture_image("%s_f000" % shot_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
+ capture_end = 12 + capture_offset + int(seconds * 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
@@ -915,8 +1004,11 @@ func _strip_tick(item: Dictionary) -> void:
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])
+ _capture_image("%s_f%03d" % [shot_id, local])
if capture_frame >= capture_end:
+ if sequence_mode:
+ get_tree().quit()
+ return
captured += 1
if capture_ids.size() > 0:
if captured >= capture_ids.size(): get_tree().quit(); return
diff --git a/skills/effekseer-vfx/assets/review_rubric.json b/skills/effekseer-vfx/assets/review_rubric.json
index ba91e6b..56638c0 100644
--- a/skills/effekseer-vfx/assets/review_rubric.json
+++ b/skills/effekseer-vfx/assets/review_rubric.json
@@ -10,7 +10,8 @@
{"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"}
+ {"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"},
+ {"id": "coherence", "question": "Do all layers speak one visual language: one palette family, one shape language (soft or hard-edged, round or spiky), one motion vocabulary, with no layer that looks borrowed from another effect?", "look_at": "whole strip"}
],
"output": {
"format": "JSON",
diff --git a/skills/effekseer-vfx/assets/sequence_rubric.json b/skills/effekseer-vfx/assets/sequence_rubric.json
new file mode 100644
index 0000000..1cc8ed9
--- /dev/null
+++ b/skills/effekseer-vfx/assets/sequence_rubric.json
@@ -0,0 +1,131 @@
+{
+ "purpose": "Independent review of a sequence: several effects fired one after another by a character's animation (a combo with a finisher). The reviewer gets the sequence strip, the per-step sheet, the theme, the step times, the steal list and the concept target, never the recipes. Stages narrow what is judged: a blockout is placeholder shapes and colours, judged only on timing, size, placement, readability and coherence.",
+ "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",
+ "stages": [
+ "blockout",
+ "detail",
+ "polish"
+ ],
+ "question": "From the first lit frames of each beat, can you tell what it is (shot, hit, finisher) and where it goes?"
+ },
+ {
+ "id": "timing",
+ "stages": [
+ "blockout",
+ "detail",
+ "polish"
+ ],
+ "question": "Does every beat land on the move that fires it, with short contacts, and does the rhythm build so the finisher reads as the climax rather than one more hit?"
+ },
+ {
+ "id": "scale",
+ "stages": [
+ "blockout",
+ "detail",
+ "polish"
+ ],
+ "question": "Are the beats sized against the character and against each other (small repeated shots, a much bigger finisher) without hiding the characters?"
+ },
+ {
+ "id": "placement",
+ "stages": [
+ "blockout",
+ "detail",
+ "polish"
+ ],
+ "question": "Do shots start at the hand or weapon and end on the target, and do ground parts sit on the ground under the target?"
+ },
+ {
+ "id": "coherence",
+ "stages": [
+ "blockout",
+ "detail",
+ "polish"
+ ],
+ "question": "Do all beats belong to one idea: one palette family, one shape language, one motion vocabulary, in the style the sequence chose? Name any element that comes out of nowhere; it should be cut, not polished."
+ },
+ {
+ "id": "layering",
+ "stages": [
+ "detail",
+ "polish"
+ ],
+ "question": "At each beat's strongest frame: a white-hot core, a saturated body and a dark accent or base, rather than one flat colour?"
+ },
+ {
+ "id": "shape_change",
+ "stages": [
+ "detail",
+ "polish"
+ ],
+ "question": "Do the main shapes erode, sweep, roll, spiral or break up over time, or only scale and fade?"
+ },
+ {
+ "id": "motion",
+ "stages": [
+ "detail",
+ "polish"
+ ],
+ "question": "Is there speed inside the shapes (streaks, spirals, sparks that burst then slow) and does secondary motion follow the action?"
+ },
+ {
+ "id": "tail",
+ "stages": [
+ "detail",
+ "polish"
+ ],
+ "question": "After the finisher, does deliberate residue (smoke, sparkles, ground marks) dissipate, rather than an empty or abruptly cut frame?"
+ },
+ {
+ "id": "steals",
+ "stages": [
+ "detail",
+ "polish"
+ ],
+ "question": "How many of the steal-list items are visibly present (3 = all clearly, 2 = most, 1 = few, 0 = none)? Mark each item seen or not in `steals`."
+ },
+ {
+ "id": "concept",
+ "stages": [
+ "polish"
+ ],
+ "question": "Does the finisher's key frame reach the paintover concept's palette, shapes and value structure?"
+ },
+ {
+ "id": "impact",
+ "stages": [
+ "polish"
+ ],
+ "question": "Does the finisher's screen feedback (impact frame / flash, camera shake, hit-stop) land on its contact, stay to a few frames and make the hit feel heavier without hiding the effect?"
+ }
+ ],
+ "output": {
+ "format": "JSON",
+ "schema": {
+ "id": "sequence id",
+ "stage": "blockout | detail | polish",
+ "scores": {
+ "<criterion id of this stage>": "0-3"
+ },
+ "steals": "[{item, seen}] for detail and polish",
+ "worst": "a lowest-scoring criterion",
+ "cut": "an element that does not carry the theme, or empty",
+ "fix": "one concrete change naming frames",
+ "verdict": "ship | iterate",
+ "observed_frames": "frame numbers looked at"
+ },
+ "rules": [
+ "Score only what is visible.",
+ "verdict is iterate when any score is below 2.",
+ "Name one fix only."
+ ]
+ }
+}
diff --git a/skills/effekseer-vfx/references/cli.md b/skills/effekseer-vfx/references/cli.md
index b914555..429dcbf 100644
--- a/skills/effekseer-vfx/references/cli.md
+++ b/skills/effekseer-vfx/references/cli.md
@@ -56,6 +56,11 @@ outside `EFFEKSEER_VFX_HOME`.
| `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) |
+| `sequence-validate <SEQ>` | Python | sequence brief: steps, stage gate, references, concept ([sequence](sequence.md)) |
+| `sequence-review <SEQ> [--frames DIR] [--fps N] [--step N] [--note]` | Godot, or game frames | one capture of the whole sequence: strip, per-step sheet, evidence ID |
+| `sequence-handoff <SEQ>` / `sequence-submit <evidence_id> <report> --reviewer ID` | capture | independent sequence review; a blockout `ship` writes the gate file |
+| `paintover <SEQ> [--frame N]` / `concept-compare <SEQ>` | capture | key frame + image-edit prompt for the concept; concept beside the latest frame |
+| `helix-texture <src> <dst> [--size] [--turns] [--bands] [--repeat]` | Python | wrap a ribbon strip mask into a tileable helix for `spiral_ribbons` |
## `--ids` and broken sources
diff --git a/skills/effekseer-vfx/references/godot.md b/skills/effekseer-vfx/references/godot.md
index fe981d3..ee40b9d 100644
--- a/skills/effekseer-vfx/references/godot.md
+++ b/skills/effekseer-vfx/references/godot.md
@@ -50,6 +50,21 @@ effect at that point.
Every handle starts from the manifest's `inputs` defaults and pushes its `inputs` to the emitter right away and then
every frame, so the first frame already uses the real values.
+## Screen feedback
+
+Effects with a manifest `screen` entry make their handle emit, once its clock reaches `peak`:
+
+```gdscript
+Vfx.screen_cue.connect(func(id: String, screen: Dictionary, at: Vector3):
+ camera.add_trauma(screen.get("shake", 0.0)) # your camera shake
+ if screen.get("hitstop", 0.0) > 0.0: hit_stop(screen.hitstop) # Engine.time_scale dip, restored in real time
+ if screen.get("flash_frames", 0) > 0: impact_frame(screen.flash_frames, screen.get("flash", "white")))
+```
+
+An impact frame is a full-screen overlay for that many rendered frames (count frames, not game time, or a hit-stop
+stretches it). `invert` turns the stage white and the characters and effect ink; pick the threshold for your
+stage's brightness ([sequence](sequence.md#screen-feedback)).
+
## Scaled effects
An effect built with `scale` (manifest `scale.world`, see [scale](scale.md)) is already in world units: play it at
diff --git a/skills/effekseer-vfx/references/primitives.md b/skills/effekseer-vfx/references/primitives.md
index cf2bd08..6f3e8ed 100644
--- a/skills/effekseer-vfx/references/primitives.md
+++ b/skills/effekseer-vfx/references/primitives.md
@@ -29,6 +29,8 @@ on top** (the Godot plugin ignores ZWrite between effect layers).
| `hold` | beam only: seconds the Lab fires it before release; `infinite` layers emit until then |
| `inputs` | default values of the game inputs `@In0..@In3` that `bind` equations read; beams use `beam_inputs(length)` |
| `scale` | `'giant'`, `'kaiju'`, a number or `{'world','time','budget'}`: build a character-scale recipe for a larger world ([scale](scale.md)) |
+| `screen` | `dict(shake=0..1, flash_frames=0..6, flash='white'|'invert', hitstop=0..0.3)`: screen feedback at `peak`, played by the Lab and emitted by `Vfx.screen_cue` ([sequence](sequence.md#screen-feedback)) |
+| `stage` | `'blockout'` (math textures only, judged on timing, size and readability), `'detail'` or `'polish'` ([sequence](sequence.md)) |
| `design` | one sentence of what the player sees; shown in the Lab and given to reviewers |
## Primitives
@@ -65,6 +67,10 @@ nature: contact stars, glows, sparks and smoke puffs (stacked into volume).
| `beam(name, core, body, rim, width=.5, ...)` | sustained beam the game aims and sweeps (breath weapon, laser, death ray) | axial billboards (`YAxisFixed`, pivot at the base) stretched to `@In0` and widened by `@In1` through `bind`; `T_BeamSection01` cross-section, noise streaming outward, mouth and end flashes, end sparks, optional `steam` and `scorch` left in world space ([godot](godot.md#beams)) |
| `charge_chain(name, anchors, color, hot, step=4, ...)` | arcs lighting a chain of points one after another (dorsal plates, coils, a ley line) | node glow + pop per anchor at `delay + i*step`; painted `T_ArcStrand01` arcs on a `DirectionalBillboard` aimed at the next anchor by an imperceptible velocity, re-struck mirrored every `restrike` frames until `until` |
+Stylized hard-edge shapes, for briefs whose `style` asks for that look ([stylized](stylized.md)): `hard_edge`,
+`stylized_pair`, `spiral_ribbons`, `spike_crown`, `speed_streaks`, `sparkle`; `INK` is their near-black. The existing
+primitives keep their defaults.
+
## Helpers
| Helper | Meaning |
diff --git a/skills/effekseer-vfx/references/review.md b/skills/effekseer-vfx/references/review.md
index 4a31dde..dc6f2eb 100644
--- a/skills/effekseer-vfx/references/review.md
+++ b/skills/effekseer-vfx/references/review.md
@@ -57,6 +57,12 @@ Flags alone are not a review. In the strip and the key-frame sheet ask:
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.
+## Sequences
+
+A combo or finisher is also reviewed as a whole: `vfx sequence-review` captures every step on one clock (in the Lab, or
+from frames the game rendered), and its own rubric scores only the criteria of the sequence's stage. See
+[sequence](sequence.md).
+
## Rounds and history
Each round fixes **one class of problem** and states it in `--note`; notes, flags and key timings append to
diff --git a/skills/effekseer-vfx/references/sequence.md b/skills/effekseer-vfx/references/sequence.md
new file mode 100644
index 0000000..fb5ec9b
--- /dev/null
+++ b/skills/effekseer-vfx/references/sequence.md
@@ -0,0 +1,108 @@
+# Sequences: combos, finishers and the staged workflow
+
+A skill is rarely one effect. A combo fires several shots on the beats of an animation and ends on a finisher; the
+player judges them together. Design, gate and review them together as a **sequence**. The workflow below follows how
+senior real-time VFX artists build such a piece. It is independent of the look: a realistic explosion chain, a
+painterly or a toon combo go through the same stages; the brief's `style` decides the materials and textures.
+
+1. **Let the animation lead.** Start from the character's real clips and their event times, not from an idea of the
+ effect. The sequence brief lists the moments the animation fires each effect.
+2. **Block out first.** Basic shapes and solid colours only, to settle timing, size and readability. No painted
+ textures until an independent blockout review says ship.
+3. **Add detail, then cut.** Detail makes hits punchier, but an element that does not carry the theme (a meteor that
+ comes out of nowhere at the end of a laser combo) is cut, not polished. Record what you cut and why.
+4. **Steal from references on purpose.** For every reference write what you take from it (the speed lines inside a
+ beam, a dark base where it meets the ground, the way smoke rolls over the impact, a colour). The reviewer checks
+ each item.
+5. **Paint over a key frame.** Turn a captured frame into a concept painting with an image-edit model and the steal
+ list; the concept becomes the visual target the polish rounds are compared with.
+6. **Textures and materials for the chosen style.** Realistic work keeps the existing painted and photographic
+ flipbooks ([realism](realism.md), [textures](textures.md)). Only when the brief's `style` asks for a stylized,
+ hard-edged look, use the greyscale masks and the hard-edge material in [stylized](stylized.md).
+7. **Screen feedback last.** Camera shake, a flash or impact frame and a hit-stop on the finisher's contact, declared
+ in the manifest (`screen`) so the game plays exactly what was reviewed.
+
+## The sequence brief
+
+`vfx/sequences/<SEQ_ID>.json` (IDs start with `SEQ_`):
+
+```json
+{
+ "schema_version": 1,
+ "sequence_id": "SEQ_Star_Combo",
+ "stage": "blockout",
+ "style": "stylized anime combat, hard-edged shapes",
+ "theme": "Magenta star fire: thin lasers build to one huge laser from the sky.",
+ "animation": "mage_atk1..4 fire a laser on each thrust; the burst calls the pillar 0.6 s in. Times measured in the game.",
+ "steps": [
+ {"t": 0.1, "effect": "VFX_Star_Laser", "beat": "atk1 thrust"},
+ {"t": 3.13, "effect": "VFX_Sky_Pillar", "beat": "finisher"}
+ ],
+ "references": [
+ {"source": "where it comes from", "steal": ["speed lines streaming inside the beam", "a dark base where the beam meets the ground"]}
+ ],
+ "concept": {"image": "vfx/concepts/SEQ_Star_Combo/concept.png", "frame": 210},
+ "cut": [{"idea": "meteor finisher", "why": "came out of nowhere; the laser theme ends on a bigger laser"}],
+ "acceptance": ["Each laser starts at the hand and ends on the target"]
+}
+```
+
+- `style` (optional) is the look, as in the effect briefs: it steers the paintover prompt and which texture and
+ material tools fit. Without it the paintover keeps the look of the captured frame.
+- `steps[].t` is seconds from the start of the capture; take it from the game (log the frame each event fires on)
+ rather than guessing. Each effect still has its own brief and recipe.
+- `stage` is `blockout`, `detail` or `polish`. `vfx sequence-validate` enforces the gates:
+ - **blockout**: every effect in the steps declares `effect(..., stage='blockout')`; lint then refuses painted
+ textures and flipbooks in those recipes (math textures only) and drops texture-craft warnings.
+ - **detail**: needs the blockout gate (`<SEQ_ID>.gate.json`, written when an independent blockout review says ship)
+ and references with steal lists.
+ - **polish**: also needs the concept image.
+
+## Capturing and reviewing
+
+```sh
+vfx sequence-review SEQ_Star_Combo # the Lab performs every step at its time
+vfx sequence-review SEQ_Star_Combo --frames <dir> # frames the game captured (preferred)
+vfx sequence-handoff SEQ_Star_Combo # reviewer brief for the latest capture
+vfx sequence-submit <evidence_id> <report.json> --reviewer <id>
+```
+
+The Lab stages each step with its delivery (beams aim straight at the target in a sequence; projectiles fly;
+targeted effects land on the target), but its dummies do not carry your character's animation, camera or lighting.
+**Prefer frames from the game**: render the combo at a fixed 60 FPS (Godot's `--write-movie <dir>/frame.png
+--fixed-fps 60`), keep every second frame, and name them `<SEQ_ID>_fNNN.png` with NNN counted from the capture start at
+60 FPS (or pass `--fps`). Game frames catch what the Lab cannot: a bright daylight stage that washes additive colour
+to white, effects hidden behind the character, a camera that frames the finisher badly.
+
+The strip labels every tile with frame, time and the step that starts there; the steps sheet shows each step at its
+start, +4, +10 and +20 frames. The rubric (`assets/sequence_rubric.json`) scores only the criteria of the capture's
+stage: a blockout is judged on read, timing, scale, placement and **coherence**; detail adds layering, shape change,
+motion, tail and the steal list; polish adds the concept and the screen feedback. One fix per round, as with single
+effects.
+
+## Paintover concept
+
+```sh
+vfx paintover SEQ_Star_Combo [--frame N] # copies the frame, writes the image-edit prompt from theme + steal list
+vfx concept-compare SEQ_Star_Combo # concept beside the latest capture's frame
+```
+
+Give the copied frame and the prompt to an image-edit model (the frame as the reference image). Keep its untouched
+output as `vfx/concepts/<SEQ_ID>/concept.png` and set `concept` in the brief. The concept is a target for palette,
+shapes and value structure, not a pixel match: the engine still decides sizes and brightness.
+
+## Screen feedback
+
+`effect(..., screen=dict(shake=.7, flash_frames=2, flash='invert', hitstop=.08))` plays at the effect's `peak`:
+
+| Key | Meaning | Starting point |
+|---|---|---|
+| `shake` | camera trauma 0..1 | 0.3 heavy hit, 0.6-0.8 finisher |
+| `flash_frames` | frames of a full-screen flash, 0..6 | 1-3; more reads as a fade, not an impact |
+| `flash` | `white` (a white veil) or `invert` (an impact frame: stage white, characters and effect ink) | `invert` suits stylized finishers; realistic work usually wants `white` or none |
+| `hitstop` | seconds of near-frozen game time, 0..0.3 | 0.05-0.1 |
+
+The Lab performs it (hit-stop only in interactive playback, so captures keep the 60 FPS clock). In the game, connect
+`Vfx.screen_cue(id, screen, position)` to the camera, an impact-frame overlay and the game's hit-stop. An impact frame
+on a bright stage needs a different threshold from the Lab's dark one: ink what is dark or in the effect's hue, white
+the rest. Give only the finisher an impact frame; on every hit it stops meaning anything.
diff --git a/skills/effekseer-vfx/references/stylized.md b/skills/effekseer-vfx/references/stylized.md
new file mode 100644
index 0000000..fe8e250
--- /dev/null
+++ b/skills/effekseer-vfx/references/stylized.md
@@ -0,0 +1,51 @@
+# Stylized hard-edge VFX
+
+**One style option, not a default.** Use this page only when the brief's `style` asks for a stylized, hard-edged
+look. Realistic, painterly or soft-glow effects keep the existing primitives and textures ([realism](realism.md),
+[textures](textures.md)); nothing here changes their defaults, and lint and review never require hard edges or ink
+outlines.
+
+The look of much current stylized game VFX: crisp toon shapes cut from hand-painted greyscale masks, a white-hot core
+in a saturated body, ink-dark accents (spiky bases, outlines) and small four-point star glints. Soft additive glows
+alone cannot reach it; neither can more bloom.
+
+## Greyscale masks + a steep cutoff
+
+A mask holds a shape as grey values; the material decides how it reads. A soft fade gives a smoky blob. A **steep,
+fixed alpha cutoff** gives a crisp shape with the painted outline; **moving** the cutoff over life (EaseIn: hold, then
+erode) breaks the shape apart from its thinnest parts first with a hard edge, which is what makes a ribbon or a spike
+look hand-animated.
+
+| Mask | Source | Use |
+|---|---|---|
+| `T_SwirlNoise01` | math (`vfx procedural`) | swirling breakup of smoke, energy fill, alpha erosion with curl |
+| `T_FlameBand01` | math | band of flame tongues (U tiles): crowns and ground fire on a cylinder |
+| `T_SpeedStreak01` | math | dashes of uneven length (tiles): scrolled along a beam they carry its speed |
+| ribbon strip (e.g. `T_RibbonStrip01`) | image model | one long barbed ribbon; `vfx helix-texture` wraps it into `T_RibbonHelix01` |
+| spike band (e.g. `T_SpikeCrown01`) | image model | jagged spikes rising from a solid base (U tiles) |
+| spiky splat (e.g. `T_SpikeSplat01`) | image model | radial burst for hits, muzzles and ground decals |
+
+The painted ones are not shipped: their prompts are templates in `assets/examples/texture_prompts.json` (white shape
+on flat black, hard edges, no glow). Wrapped masks must tile in U: crossfade the ends, then threshold again so the
+crossfade does not leave a grey smear.
+
+## Primitives
+
+| Helper | What it builds |
+|---|---|
+| `hard_edge(layer, threshold, outline, width, erode)` | steep cutoff + an edge band of `outline` colour inside the cut (visible on Blend layers) |
+| `stylized_pair(layer, outline, grow, ...)` | Blend ink silhouette slightly larger + the bright shape, same clock and cutoff: an outline that always hugs the shape |
+| `spiral_ribbons(name, color, radius, height, life, ...)` | double-sided cylinder with a helix mask scrolling round and along it, cut hard, ink edge |
+| `spike_crown(name, color, radius, height, life, flare, rise, ...)` | flaring cylinder with a spike-band mask that shoots up in `rise` frames and erodes from the tips |
+| `speed_streaks(name, color, radius, height, life, speed, ...)` | hard-cut dashes racing along a cylinder ("speed lives in the beam") |
+| `sparkle(name, color, size, count, ...)` | four-point star glints that pop, hold and pinch out |
+
+## Value and colour on real backgrounds
+
+- **Additive colour washes to white on a bright stage.** A magenta additive beam that reads on the Lab's dark slate
+ turns white over a daylit sky. Give the body an alpha-blended saturated colour and keep additive for the hot core
+ and the glints; check a bright background (`--bright`) or, better, frames from the game.
+- **Ink accents carry the shape**: a black spike crown or ink splat where a beam meets the ground, a dark rim behind a
+ thin laser. They read on any background and make the bright parts look brighter.
+- Keep the palette to one family plus white and ink. A second hue needs a job; a blue charge in a magenta combo is a
+ coherence failure, not an accent.
diff --git a/skills/effekseer-vfx/scripts/vfxkit/cli.py b/skills/effekseer-vfx/scripts/vfxkit/cli.py
index 303e3e9..29e0a90 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/cli.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/cli.py
@@ -15,6 +15,8 @@ authoring (no Core): list, lint, layer-schema, texture-info, texture-audit, pr
build (Core): 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
+sequences (combos): sequence-validate, sequence-review, sequence-handoff, sequence-submit, paintover, concept-compare
+stylized textures: helix-texture
"""
@@ -90,6 +92,22 @@ def parser():
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='+')
+ a = sub.add_parser('helix-texture', help='wrap a painted ribbon strip into a tileable helix mask for spiral_ribbons()')
+ a.add_argument('source'); a.add_argument('output'); a.add_argument('--size', type=int, default=512)
+ a.add_argument('--turns', type=int, default=1); a.add_argument('--bands', type=int, default=2); a.add_argument('--repeat', type=int, default=1)
+ a = sub.add_parser('sequence-validate', help='check vfx/sequences/<SEQ>.json: steps, stage gate, references, concept')
+ a.add_argument('id')
+ a = sub.add_parser('sequence-review', help='capture a whole sequence (Lab, or the game\'s own frames with --frames) as evidence')
+ a.add_argument('id'); a.add_argument('--frames', help='folder of PNG frames the game captured (names ending _fNNN at 60 FPS, or use --fps)')
+ a.add_argument('--fps', type=float, default=60); a.add_argument('--step', type=int, default=4); a.add_argument('--note', default='')
+ a = sub.add_parser('sequence-handoff', help='write the independent reviewer brief for the latest sequence capture')
+ a.add_argument('id')
+ a = sub.add_parser('sequence-submit', help='bind an independent sequence report; a blockout ship opens the detail gate')
+ a.add_argument('evidence_id'); a.add_argument('report'); a.add_argument('--reviewer', required=True)
+ a = sub.add_parser('paintover', help='pick a captured key frame and write the image-edit prompt for the concept painting')
+ a.add_argument('id'); a.add_argument('--frame', type=int)
+ a = sub.add_parser('concept-compare', help='the concept painting beside the latest captured frame')
+ a.add_argument('id')
return p
@@ -260,6 +278,30 @@ def run(args):
if c == 'package':
from .finalize import finalize
return finalize(args.preview_dir)
+ if c == 'helix-texture':
+ from PIL import Image
+ from .textures import helix
+ import numpy as np
+ out = helix(Image.open(args.source), args.size, args.turns, args.bands, args.repeat)
+ target = Path(args.output)
+ target.parent.mkdir(parents=True, exist_ok=True)
+ image = Image.new('RGBA', out.shape[::-1], (255, 255, 255, 0))
+ image.putalpha(Image.fromarray((np.clip(out, 0, 1) * 255).astype(np.uint8)))
+ image.save(target)
+ return {'ok': True, 'output': str(target), 'size': args.size, 'turns': args.turns, 'bands': args.bands}
+ if c.startswith('sequence-') or c in ('paintover', 'concept-compare'):
+ from . import sequence
+ if c == 'sequence-validate':
+ return sequence.validate(args.id)
+ if c == 'sequence-review':
+ return sequence.capture(args.id, args.frames, args.fps, args.step, args.note)
+ if c == 'sequence-handoff':
+ return sequence.handoff(args.id)
+ if c == 'sequence-submit':
+ return sequence.submit(args.evidence_id, args.report, args.reviewer)
+ if c == 'paintover':
+ return sequence.paintover(args.id, args.frame)
+ return sequence.concept_compare(args.id)
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)
diff --git a/skills/effekseer-vfx/scripts/vfxkit/handoff.py b/skills/effekseer-vfx/scripts/vfxkit/handoff.py
index b195d58..16792d7 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/handoff.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/handoff.py
@@ -72,7 +72,7 @@ def handoff(rid):
'## 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>", '
+ '"placement": 0, "tail": 0, "identity": 0, "coherence": 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.',
diff --git a/skills/effekseer-vfx/scripts/vfxkit/lint.py b/skills/effekseer-vfx/scripts/vfxkit/lint.py
index d9ddb60..2ab43ec 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/lint.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/lint.py
@@ -21,6 +21,24 @@ HOT_LUMA=.85 # same bar as review.py, so lint and review agree
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)
+STAGES=('blockout','detail','polish') # references/sequence.md
+SCREEN_KEYS={"shake","flash_frames","flash","hitstop"}
+
+def screen_errors(recipe):
+ """Screen feedback is game data (Vfx.gd emits it as screen_cue): keep it in the ranges a game can play."""
+ screen=recipe.get('screen')
+ if screen is None:return []
+ if not isinstance(screen,dict):return ["screen must be dict(shake=, flash_frames=, flash=, hitstop=)"]
+ out=[f'screen.{k}: unknown key; use {sorted(SCREEN_KEYS)}' for k in screen if k not in SCREEN_KEYS]
+ def number(k,lo,hi):
+ v=screen.get(k)
+ if v is not None and (isinstance(v,bool) or not isinstance(v,(int,float)) or not lo<=v<=hi):out.append(f'screen.{k} must be a number in {lo}..{hi}')
+ number("shake",0,1); number("hitstop",0,.3)
+ frames=screen.get('flash_frames')
+ if frames is not None and (type(frames) is not int or not 0<=frames<=6):out.append('screen.flash_frames must be 0..6 frames: an impact frame is a few frames, never a fade')
+ if screen.get('flash',None) not in (None,'white','invert'):out.append("screen.flash must be 'white' or 'invert'")
+ return out
+
def release_frames(recipe):
"""Frames after the start at which the reference performance releases sustained layers: a projectile's flight or a
beam's hold; 0 when the recipe has neither."""
@@ -90,6 +108,16 @@ def lint(recipe,known=None):
world,stretch,more=factors(recipe)
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")
+ errors+=screen_errors(recipe)
+ stage=recipe.get('stage')
+ if stage is not None and stage not in STAGES:errors.append(f"stage {stage!r} must be one of {STAGES}")
+ if stage=='blockout':
+ # A blockout judges timing, size and readability only: basic shapes in solid colours, no painted texture work yet.
+ for layer in layers:
+ for key in TEXTURE_KEYS:
+ name=stem(layer.get(key))
+ if name and name not in procedural:errors.append(f"{layer['name']}.{key}: {name} is a painted texture; a blockout uses basic shapes and math textures only")
+ if layer.get('flipbook'):errors.append(f"{layer['name']}: flipbook in a blockout; hold texture work until the blockout review passes")
release=release_frames(recipe)
sustained=[l for l in layers if l.get('infinite')]
if sustained and not release:errors.append(f"{sustained[0]['name']}: infinite layers emit until release, so the recipe needs flight (seconds of the reference flight) or hold (seconds a beam fires)")
@@ -162,6 +190,9 @@ def lint(recipe,known=None):
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')
+ if stage=='blockout':
+ # Shape change and value layering are texture and material work: a blockout is judged on timing, size and readability.
+ warnings=[w for w in warnings if not w.startswith(('no layer changes shape','no white-hot additive colour'))]
timeline=sorted(([l['name'],l.get('delay',0),round(lifetime(l,release=release))] for l in recipe['layers']),key=lambda t:t[1])
return {'id':rid,'errors':errors,'warnings':warnings,'budget':[total,limit],'timeline':timeline}
diff --git a/skills/effekseer-vfx/scripts/vfxkit/primitives.py b/skills/effekseer-vfx/scripts/vfxkit/primitives.py
index fd85c26..281e605 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/primitives.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/primitives.py
@@ -240,13 +240,15 @@ def tilted_ring(name,color,radius,life=14,delay=0,tilt=(-70,0,0),thickness=.3,**
"""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."""
+def column(name,color,radius,height,life,delay=0,scroll=(.003,-.02),radius2=None,**kw):
+ """Volumetric light shaft: streaks scroll up a cylinder, a static gradient fades the top, fresnel softens the sides.
+ radius2 tapers it (the radius at the far end of its height)."""
+ taper={'radius2':radius2} if radius2 is not None else {}
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
+ alpha_texture='T_GradientV01',alpha_wrap='Clamp',falloff=dict(begin=[255,255,255,255],end=[255,255,255,0],pow=1.6,blend='Mul'),**taper) | 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,
- hold=None,inputs=None,scale=None):
+ hold=None,inputs=None,scale=None,screen=None,stage=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
@@ -258,9 +260,15 @@ def effect(id,name,category,element,duration,layers,attach='impact',peak=.1,impa
inputs are the default values of the game inputs @In0..@In3 that `bind` equations read (a beam's length and power).
scale converts a recipe written at the Lab's character scale to a larger world: 'giant', 'kaiju', a number or
{'world','time','budget'} (see vfxkit.scale and references/scale.md).
+ screen is the screen feedback a game plays at `peak`: dict(shake=0..1 camera trauma,
+ flash_frames=0..6 frames of a full-screen impact frame, flash='white'|'invert', hitstop=0..0.3 seconds of
+ near-frozen game time). It is game data like delivery: the Lab performs it, Vfx.gd emits it as `screen_cue`.
+ stage is 'blockout' (basic shapes and solid colours only, judged on timing, size and readability), 'detail' or
+ 'polish' (see references/sequence.md); lint holds a blockout recipe to math textures.
"""
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),('hold',hold),('inputs',list(inputs) if inputs is not None else None)]:
+ for key,value in [('delivery',delivery),('flight',flight),('arc',arc),('hold',hold),('inputs',list(inputs) if inputs is not None else None),
+ ('screen',dict(screen) if screen is not None else None),('stage',stage)]:
if value is not None:entry[key]=value
if scale is not None and scale!='character':
from .scale import apply
@@ -484,4 +492,63 @@ def charge_chain(name,anchors,color,hot,step=4,until=None,width=.35,glow=.6,text
scale_start=[width*mirror,length,1],fade_in=0,fade_out=1,emissive=2.6))
return layers
+# ---------------------------------------------------------------- stylized hard-edge shapes (references/stylized.md)
+
+INK=(18,6,16,255) # near-black ink of the dark outlines and spiky bases
+
+def hard_edge(layer,threshold=.42,outline=INK,width=.08,erode=None):
+ """Read a greyscale mask as a crisp toon shape: a steep, fixed alpha cutoff instead of a soft fade, and an edge band
+ of `outline` colour just inside the cut, so the shape gets an ink line. With erode=(start,end) the threshold moves
+ over life (EaseIn: holds, then eats the shape away) and the edge travels with it, so the shape breaks up with a
+ hard edge instead of fading. The outline only shows on Blend layers (an additive black adds nothing); give additive
+ shapes a Blend ink copy behind them instead (stylized_pair)."""
+ cutoff=threshold if erode is None else dict(start=erode[0],end=erode[1],easing='EaseInQuadratic')
+ return layer|dict(cutoff=cutoff,edge=dict(color=list(outline),threshold=width,scaling=1))
+
+def stylized_pair(layer,outline=INK,grow=1.08,threshold=.42,width=.06,erode=None):
+ """[Blend ink silhouette slightly larger, bright shape with a hard cut]: the dark rim that makes hard-edged VFX read
+ on any background. Both share geometry, clock and cutoff, so the ink always hugs the shape."""
+ bright=hard_edge(layer,threshold,outline,width,erode)
+ bright.pop('edge',None)
+ ink={k:v for k,v in bright.items() if k not in ('emissive','color_curve','color_end','edge')}
+ ink.update(name=layer['name']+' ink',blend='Blend',color=list(outline))
+ for key in ('size','radius'):
+ if isinstance(ink.get(key),(int,float)):ink[key]=ink[key]*grow
+ if 'scale_start' in ink and all(isinstance(v,(int,float)) for v in ink['scale_start']):ink['scale_start']=[v*grow for v in ink['scale_start']]
+ if ink.get('procedural_model'):
+ spec=dict(ink['procedural_model']);spec['Shape/Radius']=spec.get('Shape/Radius',1)*grow
+ if 'Shape/Radius2' in spec:spec['Shape/Radius2']=spec['Shape/Radius2']*grow
+ ink['procedural_model']=spec
+ return [ink,bright]
+
+def speed_streaks(name,color,radius,height,life,delay=0,speed=.06,texture='T_SpeedStreak01',threshold=.35,**kw):
+ """Speed lives in the beam: hard-cut light dashes racing along a cylinder (down a sky beam with speed>0, up with
+ speed<0). The dashes, not the cylinder, carry the motion, so the beam reads fast even while it holds still."""
+ return mesh(name,'Cylinder',color,life,radius=radius,depth=height,texture=texture,uv_scroll=[0,speed],delay=delay,culling='Double',sides=40,rings=2,
+ alpha_texture='T_GradientV01',alpha_wrap='Clamp',cutoff=threshold,falloff=dict(begin=[255,255,255,255],end=[255,255,255,0],pow=1.2,blend='Mul'),**kw)
+
+def spiral_ribbons(name,color,radius,height,life,delay=0,texture='T_RibbonHelix01',spin=.02,climb=-.03,outline=INK,erode=(.15,.95),**kw):
+ """Ribbons that spiral round a pillar: a double-sided cylinder carrying a helix mask (`vfx helix-texture` wraps a
+ painted ribbon strip), scrolled round (spin) and along (climb) the axis and cut hard with an ink edge; erode breaks
+ the ribbons apart from their thin parts first. A Blend layer, so the ribbon keeps its own value over the beam."""
+ kw={'blend':'Blend',**kw}
+ return hard_edge(mesh(name,'Cylinder',color,life,radius=radius,depth=height,texture=texture,uv_scroll=[spin,climb],delay=delay,culling='Double',sides=48,rings=4,
+ **kw),outline=outline,erode=erode)
+
+def spike_crown(name,color,radius,height,life,delay=0,flare=1.7,texture='T_SpikeCrown01',rise=8,erode=(.05,.9),**kw):
+ """Jagged dark spikes erupting round a beam's foot: a cylinder flaring outward (top radius = radius*flare) with a
+ painted spike-band mask, Blend near-black, cut hard. It shoots up within `rise` frames and erodes from the tips.
+ The dark base is what makes a bright beam look like it strikes the ground."""
+ kw={'blend':'Blend',**kw}
+ key=min(95,100*rise/max(1,life_max(dict(life=life))))
+ return hard_edge(mesh(name,'Cylinder',color,life,radius=radius,radius2=radius*flare,depth=height,texture=texture,delay=delay,culling='Double',sides=40,rings=2,
+ scale_start=[1,1,1],scale_curve=[[0,.15],[key,1.08],[100,1]],**kw),outline=color,erode=erode)
+
+def sparkle(name,color,size,count=1,life=14,delay=0,interval=0,spread=0,**kw):
+ """Four-point star glints (the star of a stylized palette): pop to full size, hold, then pinch out while turning a
+ little. spread scatters them in a sphere of that radius."""
+ extra=dict(spawn=dict(shape='Sphere',radius=[0,spread])) if spread else {}
+ return sprite(name,'T_Star01',color,count=count,life=life,delay=delay,interval=interval,size=size,size_curve=[[0,.2],[15,1.15],[60,1],[100,0]],
+ rotation=[0,0,[-20,20]],spin=[0,0,[-.8,.8]],billboard='Billboard',fade_in=0,fade_out=3,emissive=1.8,**extra) | kw
+
__all__=[name for name in dir() if not name.startswith('_') and name not in ('Path','math','ROOT','T','is_path')]+['math']
diff --git a/skills/effekseer-vfx/scripts/vfxkit/sequence.py b/skills/effekseer-vfx/scripts/vfxkit/sequence.py
new file mode 100644
index 0000000..48a6a5c
--- /dev/null
+++ b/skills/effekseer-vfx/scripts/vfxkit/sequence.py
@@ -0,0 +1,467 @@
+"""Sequences: several effects performed one after another by a character's animation (a combo, a skill with a
+finisher), designed, gated and reviewed as one piece. See references/sequence.md.
+
+A sequence brief lives in vfx/sequences/<SEQ_ID>.json. It names the effects and the moments the animation fires
+them, the one theme that ties them together, what each reference is there to be stolen for, the paintover concept
+that is the visual target, and the ideas that were cut. The workflow is staged:
+
+ blockout -> detail -> polish
+
+A blockout uses basic shapes and solid colours only and is judged on timing, size and readability; the sequence may
+only move on to detail once an independent blockout review says ship (the gate is recorded next to the brief).
+Detail and polish need references with steal lists; polish needs the paintover concept.
+
+Captures come from the Lab (the dummies perform every step at its time) or from the game itself (`--frames`: frames
+the game captured with its own character, animation and camera), so the review sees the effects on the real moves.
+"""
+import json
+import re
+import shutil
+import uuid
+from pathlib import Path
+
+from . import workflow
+from .paths import ASSETS
+from .ownership import guard
+
+STAGES = ('blockout', 'detail', 'polish')
+FIELDS = {'schema_version', 'sequence_id', 'stage', 'style', 'theme', 'animation', 'steps', 'references', 'concept', 'cut', 'acceptance', 'screen'}
+RUBRIC = ASSETS / 'sequence_rubric.json'
+MAX_TILES = 24
+
+
+def sequence_id(value):
+ if not isinstance(value, str) or not re.fullmatch(r'SEQ_[A-Za-z0-9_]+', value):
+ raise ValueError('Expected a sequence ID such as SEQ_Star_Combo')
+ return value
+
+
+def path(sid):
+ return workflow.ROOT / f'vfx/sequences/{sequence_id(sid)}.json'
+
+
+def gate_path(sid):
+ return workflow.ROOT / f'vfx/sequences/{sequence_id(sid)}.gate.json'
+
+
+def read(sid):
+ p = path(sid)
+ if not p.is_file():
+ raise FileNotFoundError(f'No sequence brief {p.relative_to(workflow.ROOT).as_posix()}; write it first (references/sequence.md)')
+ return json.loads(p.read_text(encoding='utf-8'))
+
+
+def store():
+ return workflow.WORK / 'sequences'
+
+
+def rubric():
+ return json.loads(RUBRIC.read_text(encoding='utf-8'))
+
+
+def criteria(stage):
+ return [c['id'] for c in rubric()['criteria'] if stage in c['stages']]
+
+
+def recipe_hashes(seq):
+ """The compiled recipe snapshot of every effect in the sequence: a capture is stale once any of them changes."""
+ out = {}
+ for step in seq.get('steps', []):
+ rid = step.get('effect')
+ if isinstance(rid, str):
+ out[rid] = workflow.file_hash(workflow.ROOT / f'vfx/recipes/{rid}.json')
+ return out
+
+
+def validate(sid):
+ """Structure, effects, stage gate, references and concept. Errors block review; warnings are craft hints."""
+ seq = read(sid)
+ errors, warnings = [], []
+ errors += [f'Missing field: {k}' for k in ('schema_version', 'sequence_id', 'stage', 'theme', 'steps') if k not in seq]
+ errors += [f'Unknown field: {k}' for k in sorted(set(seq) - FIELDS)]
+ if seq.get('sequence_id') != sid:
+ errors.append('sequence_id differs from the file name')
+ stage = seq.get('stage')
+ if stage not in STAGES:
+ errors.append(f'stage must be one of {STAGES}')
+ if not isinstance(seq.get('theme'), str) or len(seq.get('theme', '').split()) < 4:
+ errors.append('theme needs one sentence: what every beat shares (palette, shape language, motion)')
+ steps = seq.get('steps') or []
+ if not steps:
+ errors.append('steps must list at least one {t, effect}')
+ times = []
+ from . import library
+ loaded, broken = {}, {}
+ for i, step in enumerate(steps):
+ rid = step.get('effect')
+ t = step.get('t')
+ if not isinstance(t, (int, float)) or t < 0:
+ errors.append(f'steps[{i}].t must be seconds from the start of the sequence')
+ else:
+ times.append(t)
+ try:
+ workflow.effect_id(rid)
+ loaded[rid] = loaded.get(rid) or library.get(rid)
+ except Exception as error: # a missing or broken source is the author's next fix, not a crash
+ broken[rid] = str(error)
+ if times != sorted(times):
+ errors.append('steps must be ordered by t')
+ errors += [f'{rid}: {message}' for rid, message in broken.items()]
+ if stage == 'blockout':
+ for rid, recipe in loaded.items():
+ if recipe and recipe.get('stage') != 'blockout':
+ errors.append(f"{rid}: a blockout sequence uses blockout effects; set effect(..., stage='blockout')")
+ if stage in ('detail', 'polish'):
+ gate = json.loads(gate_path(sid).read_text()) if gate_path(sid).is_file() else None
+ if not gate or gate.get('verdict') != 'ship':
+ errors.append('blockout gate: an independent blockout review of this sequence must say ship before detail work '
+ '(vfx sequence-review with stage blockout, then sequence-handoff / sequence-submit)')
+ refs = seq.get('references') or []
+ if not refs or any(not r.get('source') or not r.get('steal') for r in refs):
+ errors.append('references: every reference needs a source and a steal list of what to take from it')
+ for rid, recipe in loaded.items():
+ if recipe and recipe.get('stage') == 'blockout':
+ warnings.append(f'{rid} is still a blockout effect')
+ if stage == 'polish':
+ concept = seq.get('concept') or {}
+ image = workflow.ROOT / concept.get('image', '') if concept.get('image') else None
+ if not image or not image.is_file():
+ errors.append('concept: polish needs the paintover concept image (vfx paintover, then an image-edit model) as its visual target')
+ if not seq.get('cut'):
+ warnings.append('cut is empty: record the ideas you dropped and why (an element that does not carry the theme is cut, not polished)')
+ screen = seq.get('screen')
+ if screen is not None and not isinstance(screen, dict):
+ errors.append('screen must be an object')
+ return {'ok': not errors, 'sequence_id': sid, 'stage': stage, 'errors': errors, 'warnings': warnings,
+ 'steps': [{'t': s.get('t'), 'effect': s.get('effect')} for s in steps],
+ 'length': length(seq, loaded)}
+
+
+def length(seq, recipes=None):
+ """Seconds until the last step's effect is over (beams count their hold), plus a short settle."""
+ from . import library
+ end = 0.0
+ for step in seq.get('steps', []):
+ recipe = (recipes or {}).get(step.get('effect'))
+ if recipe is None:
+ try:
+ recipe = library.get(step.get('effect'))
+ except Exception:
+ continue
+ end = max(end, float(step.get('t', 0)) + float(recipe.get('duration', 1)))
+ return round(end + .2, 3)
+
+
+def _frame_number(p):
+ m = re.search(r'_f(\d+)$', Path(p).stem)
+ return int(m.group(1)) if m else None
+
+
+def strip(sid, seq, shots, target, columns=6, width=320, max_tiles=MAX_TILES, title=''):
+ """Time-labelled tiles of the whole sequence; tiles where a step starts carry its effect name."""
+ from PIL import Image, ImageDraw
+ starts = {round(float(s['t']) * 60): s['effect'] for s in seq['steps']}
+ if len(shots) > max_tiles:
+ by = {_frame_number(p): p for p in shots}
+ keep = set()
+ frames = sorted(by)
+ for f0 in starts: # never drop the frame where a step begins, or the one 6 frames later (its contact)
+ for want in (f0, f0 + 6):
+ keep.add(min(frames, key=lambda f: abs(f - want)))
+ room = max(2, max_tiles - len(keep))
+ keep.update(frames[round(i * (len(frames) - 1) / (room - 1))] for i in range(room))
+ shots = [by[f] for f in sorted(keep)]
+ first = Image.open(shots[0]).convert('RGB')
+ scale = width / first.width
+ height = round(first.height * 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), title or f'{sid} stage {seq.get("stage")} frames @60fps', fill=(200, 215, 230))
+ for i, shot in enumerate(shots):
+ tile = Image.open(shot).convert('RGB').resize((width, height), Image.Resampling.LANCZOS)
+ x, y = (i % columns) * width, 26 + (i // columns) * height
+ canvas.paste(tile, (x, y))
+ f = _frame_number(shot)
+ label = f'f{f} {f / 60:.2f}s'
+ near = [rid for f0, rid in starts.items() if 0 <= f - f0 < 4]
+ if near:
+ label += ' > ' + near[0].removeprefix('VFX_')
+ # Game frames can be bright: the label sits on a dark plate.
+ draw.rectangle((x + 2, y + 2, x + 10 + 6 * len(label), y + 16), fill=(8, 10, 16))
+ draw.text((x + 6, y + 4), label, fill=(255, 230, 120))
+ target.parent.mkdir(parents=True, exist_ok=True)
+ canvas.save(target)
+ return target
+
+
+def capture(sid, frames_dir=None, fps=60, step=4, note='', godot=None, timeout=900):
+ """Capture the sequence (Lab, or the game's own frames with frames_dir) and record it as sequence evidence."""
+ checked = validate(sid)
+ if not checked['ok']:
+ raise ValueError('Sequence brief has errors: ' + '; '.join(checked['errors']))
+ seq = read(sid)
+ eid = uuid.uuid4().hex
+ run = store() / 'runs' / eid
+ frames = run / 'frames'
+ frames.mkdir(parents=True)
+ source = 'game' if frames_dir else 'lab'
+ if frames_dir:
+ shots = sorted(Path(frames_dir).glob('*.png'))
+ if not shots:
+ raise FileNotFoundError(f'No PNG frames in {frames_dir}')
+ for i, shot in enumerate(shots):
+ n = _frame_number(shot)
+ f = n if n is not None else round(i * 60 / fps)
+ shutil.copy2(shot, frames / f'{sid}_f{f:03d}.png')
+ else:
+ _lab_capture(sid, seq, checked['length'], frames, step, godot, timeout)
+ shots = sorted((p for p in frames.glob(f'{sid}_f*.png') if _frame_number(p)), key=_frame_number)
+ if len(shots) < 3:
+ raise RuntimeError(f'Only {len(shots)} frames captured; check {run}')
+ out = workflow.ROOT / 'vfx/previews/sequences'
+ target = strip(sid, seq, shots, out / f'{sid}.png')
+ shutil.copy2(target, run / target.name)
+ keys = sheet_around_steps(sid, seq, shots, run / f'{sid}_steps.png')
+ record = {'evidence_id': eid, 'sequence_id': sid, 'stage': seq['stage'], 'source': source, 'time': _now(), 'note': note,
+ 'sequence_sha256': workflow.file_hash(path(sid)), 'recipes': recipe_hashes(seq),
+ 'images': workflow.snapshot([run / target.name, keys]),
+ 'frames': [workflow.relative(p) for p in shots]}
+ workflow.save_json(store() / f'{eid}.json', record)
+ workflow.save_json(store() / f'latest_{sid}.json', {'evidence_id': eid})
+ return {'ok': True, 'sequence_id': sid, 'evidence_id': eid, 'source': source, 'stage': seq['stage'], 'strip': str(target),
+ 'steps_sheet': str(keys), 'frames': len(shots), 'warnings': checked['warnings']}
+
+
+def sheet_around_steps(sid, seq, shots, target):
+ """For each step: the frames at its start, +4, +10 and +20 (contact, body, exit), one row per step."""
+ from PIL import Image, ImageDraw
+ by = {_frame_number(p): p for p in shots}
+ frames = sorted(by)
+ rows = []
+ for s in seq['steps']:
+ f0 = round(float(s['t']) * 60)
+ rows.append((s['effect'], [min(frames, key=lambda f: abs(f - (f0 + d))) for d in (0, 4, 10, 20)]))
+ first = Image.open(shots[0]).convert('RGB')
+ width = 300
+ height = round(first.height * width / first.width)
+ canvas = Image.new('RGB', (4 * width, len(rows) * (height + 18)), (8, 10, 16))
+ draw = ImageDraw.Draw(canvas)
+ for r, (rid, picks) in enumerate(rows):
+ y = r * (height + 18)
+ draw.text((6, y + 2), rid, fill=(200, 215, 230))
+ for c, f in enumerate(picks):
+ canvas.paste(Image.open(by[f]).convert('RGB').resize((width, height), Image.Resampling.LANCZOS), (c * width, y + 18))
+ draw.rectangle((c * width + 2, y + 20, c * width + 40, y + 34), fill=(8, 10, 16))
+ draw.text((c * width + 6, y + 22), f'f{f}', fill=(255, 230, 120))
+ canvas.save(target)
+ return target
+
+
+def _lab_capture(sid, seq, seconds, frames, step, godot, timeout):
+ import subprocess
+ from .paths import godot as godot_path
+ from .review import run_windowed
+ from . import evidence
+ project = workflow.ROOT / 'vfx/godot'
+ sync = evidence.template_issues()
+ if sync:
+ raise RuntimeError('Sync the Lab before review: ' + ', '.join(sync))
+ plan = frames.parent / 'sequence.json'
+ workflow.save_json(plan, {'id': sid, 'length': seconds, 'steps': [{'t': s['t'], 'id': s['effect']} for s in seq['steps']]})
+ godot = godot or godot_path()
+ imported = subprocess.run([godot, '--headless', '--editor', '--path', str(project), '--import'], capture_output=True, text=True, timeout=timeout)
+ if imported.returncode:
+ raise RuntimeError(f'Godot import failed: {imported.stderr[-2000:]}')
+ command = [godot, '--path', str(project), '--fixed-fps', '60', '--', '--strip=' + str(frames), f'--step={step}', '--sequence=' + str(plan)]
+ result = run_windowed(command, timeout, progress=lambda: any(frames.glob('*.png')))
+ (frames.parent / 'strip.log').write_text(result.stdout + result.stderr)
+ if result.returncode or 'SCRIPT ERROR:' in result.stdout + result.stderr:
+ raise RuntimeError(f'Godot sequence capture failed: {(result.stdout + result.stderr)[-2000:]}')
+
+
+def _now():
+ from datetime import datetime, timezone
+ return datetime.now(timezone.utc).isoformat()
+
+
+def latest(sid):
+ p = store() / f'latest_{sequence_id(sid)}.json'
+ if not p.is_file():
+ return None
+ return json.loads((store() / f"{json.loads(p.read_text())['evidence_id']}.json").read_text())
+
+
+def issues(record):
+ seq = read(record['sequence_id'])
+ out = []
+ if workflow.file_hash(path(record['sequence_id'])) != record['sequence_sha256']:
+ out.append('sequence_brief_changed')
+ if recipe_hashes(seq) != record['recipes']:
+ out.append('effect_rebuilt')
+ if not workflow.unchanged(record['images']):
+ out.append('images_changed')
+ return out
+
+
+def handoff(sid):
+ record = latest(sid)
+ if not record:
+ raise ValueError(f'No capture of {sid}; run vfx sequence-review {sid} first')
+ stale = issues(record)
+ if stale:
+ raise ValueError(f'The latest capture of {sid} is stale ({", ".join(stale)}); capture it again')
+ seq = read(sid)
+ stage = record['stage']
+ folder = workflow.WORK / 'handoff'
+ folder.mkdir(parents=True, exist_ok=True)
+ rub = guard(folder / 'sequence_rubric.json', workflow.ROOT / 'vfx')
+ shutil.copy2(RUBRIC, rub)
+ eid = record['evidence_id']
+ report = folder / f'{eid}.report.json'
+ frames = [_frame_number(p) for p in record['frames']]
+ frame_dir = workflow.absolute(record['frames'][0]).parent
+ names = criteria(stage)
+ steals = [item for r in (seq.get('references') or []) for item in r.get('steal', [])] if stage != 'blockout' else []
+ concept = (seq.get('concept') or {}).get('image')
+ lines = [
+ f'# Independent review of the sequence {sid} (stage: {stage})',
+ '',
+ 'You are the reviewer, not the author. Judge only what the images show; do not open vfx/src, vfx/recipes or the',
+ 'author\'s notes. The theme and step list below are context, not evidence.',
+ '',
+ f'Rubric (authoritative; score only the criteria whose "stages" include "{stage}"): {rub}',
+ '',
+ '## Open these images',
+ *[f'- {workflow.absolute(p)}' for p in record['images']],
+ f'Full-size frames: {frame_dir}/{sid}_fNNN.png (captured frames: {frames})',
+ *([f'Visual target (paintover concept the author is aiming at): {workflow.ROOT / concept}'] if concept else []),
+ '',
+ '## Context',
+ f'Source of the frames: {"the game itself (real character, animation and camera)" if record["source"] == "game" else "the VFX Lab (stand-in dummies)"}',
+ f'Theme: {seq.get("theme")}',
+ 'Steps (seconds from the start; the effect fired at that moment): ' + json.dumps(seq['steps'], ensure_ascii=False),
+ *(['Blockout stage: shapes and colours are placeholders on purpose. Judge only timing, rhythm, size, '
+ 'placement, readability and whether every beat belongs to one idea.'] if stage == 'blockout' else []),
+ *(['Steal list (check each one: is it visibly present in the frames?): ' + json.dumps(steals, ensure_ascii=False)] if steals else []),
+ '',
+ '## Output',
+ f'Write exactly one JSON object to {report}:',
+ json.dumps({'id': sid, 'stage': stage, 'scores': {k: 0 for k in names},
+ **({'steals': [{'item': s, 'seen': False} for s in steals]} if steals else {}),
+ 'worst': '<a lowest-scoring criterion>', 'cut': '<an element that does not belong to the theme, or "">',
+ 'fix': '<one concrete change, naming frames>', 'verdict': 'ship or iterate',
+ 'observed_frames': ['<frame numbers you looked at>']}, ensure_ascii=False),
+ 'Scores are 0-3 (0 missing or wrong, 1 present but weak, 2 clearly works, 3 reads instantly with its own identity).',
+ 'verdict is "iterate" if any score is below 2, otherwise "ship". Then reply with the scores, verdict and fix.',
+ ]
+ prompt = '\n'.join(lines) + '\n'
+ brief = guard(folder / f'{eid}.md', workflow.ROOT / 'vfx')
+ brief.write_text(prompt, encoding='utf-8')
+ return {'ok': True, 'sequence_id': sid, 'evidence_id': eid, 'stage': stage, 'prompt_file': str(brief), 'report_file': str(report),
+ 'next': f'Give the prompt file to a separate agent that has not seen the recipes, then: vfx sequence-submit {eid} {report} --reviewer <id>'}
+
+
+def submit(eid, report_path, reviewer):
+ record = json.loads((store() / f'{eid}.json').read_text())
+ stale = issues(record)
+ if stale:
+ raise ValueError('Cannot review stale evidence: ' + ', '.join(stale))
+ report = json.loads(Path(report_path).read_text(encoding='utf-8'))
+ names = criteria(record['stage'])
+ scores = report.get('scores', {})
+ if set(scores) != set(names) or any(type(v) is not int or not 0 <= v <= 3 for v in scores.values()):
+ raise ValueError(f'Scores must be integers 0..3 for exactly {names}')
+ if report.get('id') != record['sequence_id'] or report.get('worst') not in names or scores[report['worst']] != min(scores.values()):
+ raise ValueError('Report id or worst criterion is invalid')
+ verdict = 'ship' if min(scores.values()) >= 2 else 'iterate'
+ if report.get('verdict') != verdict or not str(report.get('fix', '')).strip():
+ raise ValueError('Report needs one fix and a verdict consistent with its scores')
+ captured = {_frame_number(p) for p in record['frames']}
+ # Reviewers sometimes quote frame numbers as strings; the frames themselves are what is checked.
+ observed = [int(f) if isinstance(f, str) and f.strip().isdigit() else f for f in report.get('observed_frames') or []]
+ if not observed or any(type(f) is not int or f not in captured for f in observed):
+ raise ValueError('observed_frames must name captured frames')
+ if not reviewer or reviewer.lower() in ('author', 'self'):
+ raise ValueError('A separately assigned reviewer identifier is required')
+ review = {'evidence_id': eid, 'reviewer': reviewer, 'time': _now(), 'report': report, 'rubric_sha256': workflow.file_hash(RUBRIC),
+ 'image_hashes': record['images'], 'independence': 'host_attested'}
+ workflow.save_json(store() / f'reviews/{eid}.json', review)
+ gate = None
+ if record['stage'] == 'blockout':
+ gate = {'evidence_id': eid, 'verdict': verdict, 'reviewer': reviewer, 'time': review['time'], 'scores': scores}
+ if verdict == 'ship':
+ workflow.save_json(gate_path(record['sequence_id']), gate)
+ return {'ok': True, 'sequence_id': record['sequence_id'], 'stage': record['stage'], 'verdict': verdict,
+ 'blockout_gate': ('open: detail work may start' if gate and verdict == 'ship' else 'closed' if gate else None)}
+
+
+def paintover(sid, frame=None):
+ """Pick a captured key frame and write the image-edit prompt that turns it into the concept painting."""
+ record = latest(sid)
+ if not record:
+ raise ValueError(f'No capture of {sid}; run vfx sequence-review {sid} first')
+ seq = read(sid)
+ by = {_frame_number(p): workflow.absolute(p) for p in record['frames']}
+ if frame is None:
+ last = round(float(seq['steps'][-1]['t']) * 60) + 12
+ frame = min(by, key=lambda f: abs(f - last))
+ if frame not in by:
+ raise ValueError(f'Frame {frame} was not captured; available: {sorted(by)}')
+ folder = workflow.ROOT / f'vfx/concepts/{sid}'
+ folder.mkdir(parents=True, exist_ok=True)
+ source = folder / f'paintover_source_f{frame:03d}.png'
+ shutil.copy2(by[frame], source)
+ steals = [f'- {item} (from {r.get("source")})' for r in (seq.get('references') or []) for item in r.get('steal', [])]
+ # The look comes from the brief: a realistic sequence must not be repainted as a toon concept.
+ style = seq.get('style') or 'the same visual style as the screenshot'
+ prompt = '\n'.join([
+ 'Paint over this game screenshot as a VFX concept frame. Keep the camera, the characters, their poses, the',
+ 'ground and the composition exactly; repaint only the visual effect, as a game VFX concept in this style:',
+ f'{style}. Keep clear value contrast (a hot core, a saturated body, darker accents or residue) and readable',
+ 'silhouettes.',
+ f'Theme: {seq.get("theme")}',
+ 'Add the elements stolen from the references that belong in this moment of the sequence:',
+ *(steals or ['- (no steal list yet: add references with steal lists to the sequence brief first)']),
+ 'No text, no labels, no UI, no watermark.',
+ ]) + '\n'
+ (folder / 'paintover_prompt.txt').write_text(prompt, encoding='utf-8')
+ concept = folder / 'concept.png'
+ return {'ok': True, 'sequence_id': sid, 'frame': frame, 'source_image': str(source), 'prompt_file': str(folder / 'paintover_prompt.txt'),
+ 'prompt': prompt, 'concept_image': str(concept),
+ 'next': ('Give the source image and the prompt to an image-edit model (the source as the reference image). Save its '
+ f'untouched output as {concept}, then set the sequence brief\'s concept to '
+ f'{{"image": "vfx/concepts/{sid}/concept.png", "frame": {frame}}} and compare later rounds with vfx concept-compare {sid}.')}
+
+
+def concept_compare(sid):
+ from PIL import Image, ImageDraw
+ seq = read(sid)
+ concept = seq.get('concept') or {}
+ image = workflow.ROOT / concept.get('image', '')
+ if not concept.get('image') or not image.is_file():
+ raise FileNotFoundError('The sequence has no concept image yet (vfx paintover)')
+ record = latest(sid)
+ if not record:
+ raise ValueError(f'No capture of {sid}')
+ by = {_frame_number(p): workflow.absolute(p) for p in record['frames']}
+ frame = min(by, key=lambda f: abs(f - int(concept.get('frame', 0))))
+ a = Image.open(image).convert('RGB')
+ b = Image.open(by[frame]).convert('RGB')
+ h = 540
+ a = a.resize((round(a.width * h / a.height), h))
+ b = b.resize((round(b.width * h / b.height), h))
+ canvas = Image.new('RGB', (a.width + b.width + 12, h + 28), (8, 10, 16))
+ draw = ImageDraw.Draw(canvas)
+ canvas.paste(a, (0, 28))
+ canvas.paste(b, (a.width + 12, 28))
+ draw.text((8, 6), 'CONCEPT (visual target)', fill=(255, 200, 140))
+ draw.text((a.width + 20, 6), f'CURRENT f{frame} ({record["source"]}, evidence {record["evidence_id"][:8]})', fill=(140, 255, 160))
+ target = workflow.ROOT / f'vfx/previews/sequences/{sid}_concept_compare.png'
+ target.parent.mkdir(parents=True, exist_ok=True)
+ canvas.save(target)
+ return {'ok': True, 'image': str(target), 'frame': frame}
diff --git a/skills/effekseer-vfx/scripts/vfxkit/textures.py b/skills/effekseer-vfx/scripts/vfxkit/textures.py
index 5efa880..a50da86 100644
--- a/skills/effekseer-vfx/scripts/vfxkit/textures.py
+++ b/skills/effekseer-vfx/scripts/vfxkit/textures.py
@@ -67,8 +67,74 @@ def masks(n=256):
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)
+ # Greyscale mask templates for the stylized hard-edge material (references/stylized.md): read through a steep
+ # cutoff they become crisp toon shapes, and an animated cutoff erodes them with a hard edge.
+ out['T_SwirlNoise01']=swirl(n,seed=41)
+ out['T_FlameBand01']=flame_band(n,seed=43)
+ out['T_SpeedStreak01']=speed_streaks(n,seed=47)
return out
+def _sample(field,yy,xx):
+ """Bilinear lookup with wrap-around, so warped fields stay tileable."""
+ n=field.shape[0]; y0=np.floor(yy).astype(int); x0=np.floor(xx).astype(int); fy=yy-y0; fx=xx-x0
+ g=lambda a,b:field[a%n,b%n]
+ return g(y0,x0)*(1-fy)*(1-fx)+g(y0+1,x0)*fy*(1-fx)+g(y0,x0+1)*(1-fy)*fx+g(y0+1,x0+1)*fy*fx
+
+def swirl(n,vortices=9,seed=0):
+ """Tileable vortex noise: streaky noise wound round a few periodic whirl centres (the curling grey mask that a
+ steep threshold turns into hand-painted-looking swirls)."""
+ rng=np.random.default_rng(seed); base=spectral(n,2.0,seed=seed+1)
+ # Bands across the noise get wound into spirals: each whirl turns the lookup by an angle that is several full
+ # turns at its centre and falls off with distance (a differential rotation, like a stirred fluid).
+ base=.5+.5*np.sin(base*np.pi*4)
+ yy,xx=np.mgrid[0:n,0:n].astype(np.float64); wy,wx=yy.copy(),xx.copy()
+ for cy,cx,spin,size in zip(rng.random(vortices)*n,rng.random(vortices)*n,rng.choice([-1,1],vortices)*rng.uniform(4.0,7.0,vortices),rng.uniform(.08,.14,vortices)*n):
+ dy=(wy-cy+n/2)%n-n/2; dx=(wx-cx+n/2)%n-n/2; d=np.hypot(dy,dx)
+ a=spin*np.exp(-(d/size)**1.5); c,s_=np.cos(a),np.sin(a)
+ wy,wx=cy+dy*c+dx*s_,cx+dx*c-dy*s_
+ out=_sample(base,wy,wx)
+ lo,hi=np.percentile(out,[2,98])
+ return np.clip((out-lo)/(hi-lo),0,1)
+
+def flame_band(n,tongues=9,seed=0):
+ """Band of flame tongues along U (tileable left-right): solid at the bottom, sharp uneven tips toward the top,
+ inner streaks; for spike/flame crowns wrapped round a cylinder."""
+ rng=np.random.default_rng(seed); y,x=np.mgrid[0:1:complex(n),0:1:complex(n)]; v=1-y # v: 0 bottom .. 1 top
+ body=np.zeros((n,n))
+ # Two interleaved rows of tongues with their own widths and heights overlap, so the crown has no even gaps.
+ for count,low,high,offset in ((tongues,.5,.95,0.),(tongues+4,.28,.6,.37)):
+ phase=rng.random(count); heights=rng.uniform(low,high,count)
+ u=(x+offset)*count; k=np.floor(u).astype(int)%count; f=u-np.floor(u)
+ lean=(f-.5+.22*np.sin((phase[k]+v*1.3)*6.28))*1.15
+ h=heights[k]*np.clip(1-(2*np.abs(lean))**1.4,0,1)
+ body=np.maximum(body,np.clip((h-v)/.03,0,1))
+ body=np.maximum(body,np.clip((.1-v)/.03,0,1)) # a solid foot: the band rises from one continuous base
+ streak=spectral(n,1.4,stretch=(8,1),seed=seed+5)
+ return np.clip(body*(.55+.6*streak),0,1)*np.clip(v/.02,0,1)
+
+def speed_streaks(n,seed=0):
+ """Tileable vertical dashes of uneven length and width: scrolled fast along a beam they read as speed."""
+ rng=np.random.default_rng(seed); out=np.zeros((n,n))
+ y=np.arange(n)[:,None]; x=np.arange(n)[None,:]
+ for _ in range(60):
+ cx=rng.random()*n; cy=rng.random()*n; w=rng.uniform(1.0,3.5); L=rng.uniform(.15,.5)*n
+ dx=(x-cx+n/2)%n-n/2; dy=(y-cy+n/2)%n-n/2
+ out=np.maximum(out,np.exp(-(dx/w)**2)*np.clip(1-np.abs(dy)/(L/2),0,1)**.6*rng.uniform(.5,1))
+ return np.clip(out,0,1)
+
+def helix(strip,size=512,turns=1,bands=2,repeat=1):
+ """Wrap a horizontal ribbon strip (white shape on black, any aspect) into a tileable texture whose ribbons run
+ diagonally: on a procedural cylinder (U round, V along the axis) they become `bands` ribbons spiralling `turns`
+ times round it, the strip repeated `repeat` times along each ribbon. All three must be integers so the texture
+ tiles."""
+ # A processed mask keeps its shape in alpha over white; a raw painting has it in luminance.
+ src=np.asarray(strip.getchannel('A') if strip.mode=='RGBA' and strip.getchannel('A').getextrema()[0]<255 else strip.convert('L'),dtype=np.float64)/255
+ h,w=src.shape
+ y,x=np.mgrid[0:size,0:size]/size # x = U round the cylinder, y = V along it
+ across=((y-x*turns)*bands)%1 # 0..1 across one ribbon band
+ along=(x*repeat)%1
+ return _sample(src,across*h,along*w)
+
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."""
diff --git a/skills/vfx-review/SKILL.md b/skills/vfx-review/SKILL.md
index 367d05c..fcb5f26 100644
--- a/skills/vfx-review/SKILL.md
+++ b/skills/vfx-review/SKILL.md
@@ -43,6 +43,7 @@ works · **3** reads instantly and has a distinct identity.
| `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 |
+| `coherence` | Do all layers speak one visual language (one palette family, one shape language, one motion vocabulary), with no layer that looks borrowed from another effect? | 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.
@@ -56,7 +57,7 @@ Return exactly one JSON object and save it where the author asks (for example `r
```json
{"id": "VFX_Fire_Explosion",
- "scores": {"read": 2, "timing": 3, "layering": 3, "shape_change": 2, "motion": 3, "placement": 3, "tail": 2, "identity": 3},
+ "scores": {"read": 2, "timing": 3, "layering": 3, "shape_change": 2, "motion": 3, "placement": 3, "tail": 2, "identity": 3, "coherence": 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",
diff --git a/tests/test_package.py b/tests/test_package.py
index b6f43e1..e734677 100644
--- a/tests/test_package.py
+++ b/tests/test_package.py
@@ -151,7 +151,7 @@ def test_examples_list_and_show_without_a_workspace(tmp_path):
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']
+ assert code == 0 and [c['id'] for c in rubric['criteria']] == ['read', 'timing', 'layering', 'shape_change', 'motion', 'placement', 'tail', 'identity', 'coherence']
code, schema = vfx('--project', str(project), 'layer-schema')
assert code == 0 and schema['ok'] and 'fade_out' in json.dumps(schema)
diff --git a/tests/test_scale_beam.py b/tests/test_scale_beam.py
index 04bd1f5..deb9ba4 100644
--- a/tests/test_scale_beam.py
+++ b/tests/test_scale_beam.py
@@ -270,7 +270,7 @@ def test_lab_scales_its_stage_and_stages_beams():
api = (ASSETS / 'godot-lab/scripts/Vfx.gd').read_text()
handle = (ASSETS / 'godot-lab/scripts/VfxHandle.gd').read_text()
test = (ASSETS / 'godot-lab/scripts/TestApi.gd').read_text()
- assert 'func _set_stage_scale' in lab and '"beam":' in lab and 'beam_handle.aim(' in lab and 'beam_handle.release()' in lab
+ assert 'func _set_stage_scale' in lab and '"beam":' in lab and 'handle.aim(' in lab and 'handle.release()' in lab and 'beams.append(' in lab
assert 'func beam(' in api and 'handle.inputs[i]' in api
assert 'func aim(' in handle and 'func start_beam(' in handle and 'emitter.set_dynamic_input(i, inputs[i])' in handle
assert 'manager.beam(' in test
diff --git a/tests/test_sequence.py b/tests/test_sequence.py
new file mode 100644
index 0000000..7de9fbe
--- /dev/null
+++ b/tests/test_sequence.py
@@ -0,0 +1,161 @@
+"""Sequences (combos), the blockout gate, screen feedback and the stylized hard-edge pack."""
+import json
+import subprocess
+import sys
+from pathlib import Path
+
+import numpy as np
+from PIL import Image
+
+from conftest import ASSETS, cli_env
+
+
+def vfx(*args, cwd=None):
+ run = subprocess.run([sys.executable, '-m', 'vfxkit', *args], capture_output=True, text=True, cwd=cwd, env=cli_env(), timeout=300)
+ lines = run.stdout.strip().splitlines()
+ assert len(lines) == 1, (run.stdout, run.stderr)
+ return run.returncode, json.loads(lines[0])
+
+
+SHOT = """from vfxkit.primitives import *
+def recipe():
+ return effect('{name}','{name}','hit','star',.4,[flash('Contact',WHITE,1.0,life=4,delay=1),
+ sprite('Body','{texture}',(255,60,160,255),life=12,size=1,cutoff=DISSOLVE,alpha_texture='T_NoiseTile01')],
+ peak=.03,impact=.3,delivery=MELEE{extra})
+"""
+
+
+def workspace(tmp_path, stage='blockout', texture='T_Glow01', screen=None):
+ code, result = vfx('--project', str(tmp_path), 'init', '--no-plugin')
+ assert code == 0, result
+ extra = f", stage='{stage}'" + (f', screen={screen!r}' if screen is not None else '')
+ for name in ('Shot_A', 'Finisher_A'):
+ (tmp_path / f'vfx/src/VFX_{name}.py').write_text(SHOT.format(name=name, texture=texture, extra=extra))
+ seq = {'schema_version': 1, 'sequence_id': 'SEQ_Test', 'stage': stage,
+ 'theme': 'Magenta star fire with hard edges throughout', 'animation': 'two beats',
+ 'steps': [{'t': 0.1, 'effect': 'VFX_Shot_A'}, {'t': 0.8, 'effect': 'VFX_Finisher_A'}],
+ 'references': [], 'concept': None, 'cut': [{'idea': 'meteor', 'why': 'off theme'}]}
+ (tmp_path / 'vfx/sequences').mkdir()
+ (tmp_path / 'vfx/sequences/SEQ_Test.json').write_text(json.dumps(seq))
+ return tmp_path
+
+
+def test_blockout_lint_holds_recipes_to_math_textures(tmp_path):
+ root = workspace(tmp_path, texture='T_SmokeSheet01')
+ code, result = vfx('--project', str(root), 'lint', '--ids', 'VFX_Shot_A')
+ assert code == 1 and any('painted texture' in e for e in result['errors']['VFX_Shot_A'])
+ root2 = workspace(tmp_path / 'b')
+ code, result = vfx('--project', str(root2), 'lint', '--ids', 'VFX_Shot_A')
+ assert code == 0 and not result['errors']
+
+
+def test_screen_feedback_is_validated(tmp_path):
+ root = workspace(tmp_path, screen={'shake': 2, 'flash_frames': 12, 'flash': 'rainbow', 'zoom': 1})
+ code, result = vfx('--project', str(root), 'lint', '--ids', 'VFX_Shot_A')
+ errors = ' '.join(result['errors']['VFX_Shot_A'])
+ assert code == 1 and 'screen.shake' in errors and 'flash_frames' in errors and 'screen.flash' in errors and 'screen.zoom' in errors
+ root2 = workspace(tmp_path / 'b', screen={'shake': .6, 'flash_frames': 2, 'flash': 'invert', 'hitstop': .08})
+ code, result = vfx('--project', str(root2), 'lint', '--ids', 'VFX_Shot_A')
+ assert code == 0
+
+
+def test_detail_needs_the_blockout_gate_and_steal_lists(tmp_path):
+ root = workspace(tmp_path, stage='detail')
+ code, result = vfx('--project', str(root), 'sequence-validate', 'SEQ_Test')
+ assert code == 1
+ joined = ' '.join(result['errors'])
+ assert 'blockout gate' in joined and 'steal list' in joined
+ seq = json.loads((root / 'vfx/sequences/SEQ_Test.json').read_text())
+ seq['references'] = [{'source': 'a board', 'steal': ['speed lines inside the beam']}]
+ (root / 'vfx/sequences/SEQ_Test.json').write_text(json.dumps(seq))
+ (root / 'vfx/sequences/SEQ_Test.gate.json').write_text(json.dumps({'verdict': 'ship'}))
+ code, result = vfx('--project', str(root), 'sequence-validate', 'SEQ_Test')
+ assert code == 0, result
+ seq['stage'] = 'polish'
+ (root / 'vfx/sequences/SEQ_Test.json').write_text(json.dumps(seq))
+ code, result = vfx('--project', str(root), 'sequence-validate', 'SEQ_Test')
+ assert code == 1 and any('concept' in e for e in result['errors'])
+
+
+def test_a_blockout_sequence_needs_blockout_effects(tmp_path):
+ root = workspace(tmp_path, stage='detail')
+ seq = json.loads((root / 'vfx/sequences/SEQ_Test.json').read_text())
+ seq['stage'] = 'blockout'
+ (root / 'vfx/sequences/SEQ_Test.json').write_text(json.dumps(seq))
+ code, result = vfx('--project', str(root), 'sequence-validate', 'SEQ_Test')
+ assert code == 1 and any("stage='blockout'" in e for e in result['errors'])
+
+
+def test_game_frames_become_evidence_and_a_blockout_ship_opens_the_gate(tmp_path):
+ root = workspace(tmp_path)
+ frames = tmp_path / 'game_frames'
+ frames.mkdir()
+ for f in range(0, 80, 4):
+ Image.new('RGB', (320, 180), (20 + f, 30, 40)).save(frames / f'SEQ_Test_f{f:03d}.png')
+ code, result = vfx('--project', str(root), 'sequence-review', 'SEQ_Test', '--frames', str(frames))
+ assert code == 0 and result['source'] == 'game' and Path(result['strip']).is_file()
+ code, handoff = vfx('--project', str(root), 'sequence-handoff', 'SEQ_Test')
+ assert code == 0
+ prompt = Path(handoff['prompt_file']).read_text(encoding='utf-8')
+ assert 'blockout' in prompt and 'coherence' in prompt and 'layering' not in prompt.split('## Output')[1]
+ report = {'id': 'SEQ_Test', 'stage': 'blockout', 'scores': {k: 2 for k in ('read', 'timing', 'scale', 'placement', 'coherence')},
+ 'worst': 'read', 'cut': '', 'fix': 'one change', 'verdict': 'ship', 'observed_frames': ['4', 8]}
+ path = tmp_path / 'report.json'
+ path.write_text(json.dumps(report))
+ code, result = vfx('--project', str(root), 'sequence-submit', handoff['evidence_id'], str(path), '--reviewer', 'author')
+ assert code == 1
+ code, result = vfx('--project', str(root), 'sequence-submit', handoff['evidence_id'], str(path), '--reviewer', 'reviewer-1')
+ assert code == 0 and result['verdict'] == 'ship' and (root / 'vfx/sequences/SEQ_Test.gate.json').is_file()
+ code, paint = vfx('--project', str(root), 'paintover', 'SEQ_Test', '--frame', '40')
+ assert code == 0 and Path(paint['source_image']).is_file() and 'Theme:' in paint['prompt']
+ # No style in the brief: the concept keeps the screenshot's look instead of being forced into a toon style.
+ assert 'hard-edged' not in paint['prompt'] and 'same visual style as the screenshot' in paint['prompt']
+ seq = json.loads((root / 'vfx/sequences/SEQ_Test.json').read_text())
+ seq['style'] = 'photoreal fire and smoke'
+ (root / 'vfx/sequences/SEQ_Test.json').write_text(json.dumps(seq))
+ code, paint = vfx('--project', str(root), 'paintover', 'SEQ_Test', '--frame', '40')
+ assert code == 0 and 'photoreal fire and smoke' in paint['prompt']
+
+
+def test_new_masks_tile_and_helix_wraps_a_strip():
+ from vfxkit.textures import masks, helix
+ m = masks(128)
+ for name in ('T_SwirlNoise01', 'T_SpeedStreak01'):
+ a = m[name]
+ # Across the wrap the change is no bigger than between ordinary neighbours (texture-info's seam ratio).
+ inner = (np.abs(np.diff(a, axis=1)).mean() + np.abs(np.diff(a, axis=0)).mean()) / 2
+ seam = (np.abs(a[:, 0] - a[:, -1]).mean() + np.abs(a[0] - a[-1]).mean()) / 2
+ assert seam / inner < 1.6, (name, seam / inner)
+ band = m['T_FlameBand01']
+ assert band[-6].mean() > .5 and band[2].mean() < .2 # solid base at the bottom, tips at the top
+ strip = Image.new('L', (256, 64), 0)
+ strip.paste(255, (0, 24, 256, 40))
+ out = helix(strip, size=64, turns=1, bands=2)
+ assert out.shape == (64, 64) and .1 < out.mean() < .5
+ assert abs(out[:, 0] - out[:, -1]).mean() < .3 # continues across the U seam
+
+
+def test_stylized_primitives_compile_to_known_fields():
+ from effekseer_ai.authoring import validate_layer
+ from vfxkit import primitives as p
+ layers = [p.spiral_ribbons('R', (200, 20, 110, 255), 1.5, 8, 40), p.spike_crown('S', p.INK, 1.2, 1.5, 40),
+ p.speed_streaks('L', p.WHITE, 1.0, 10, 30), p.sparkle('Star', p.WHITE, .5, count=3, spread=1),
+ *p.stylized_pair(p.sprite('Burst', 'T_Impact01', (255, 60, 160, 255), life=10, size=1.0), erode=(.2, .9))]
+ for layer in layers:
+ assert not validate_layer(layer), (layer['name'], validate_layer(layer))
+ ink, bright = layers[-2:]
+ assert ink['blend'] == 'Blend' and ink['size'] > bright['size'] and ink['cutoff'] == bright['cutoff']
+ entry = p.effect('X', 'X', 'element', 'star', 1, [], screen=dict(shake=.5), stage='detail')
+ assert entry['screen'] == {'shake': .5} and entry['stage'] == 'detail'
+
+
+def test_lab_and_runtime_play_sequences_and_screen_feedback():
+ lab = (ASSETS / 'godot-lab/scripts/VfxLab.gd').read_text(encoding='utf-8')
+ api = (ASSETS / 'godot-lab/scripts/Vfx.gd').read_text(encoding='utf-8')
+ handle = (ASSETS / 'godot-lab/scripts/VfxHandle.gd').read_text(encoding='utf-8')
+ assert '--sequence=' in lab and 'stage_offset' in lab and 'func _screen(' in lab and 'hint_screen_texture' in lab
+ assert 'signal screen_cue' in api and 'handle.cue(' in api
+ assert 'signal screen_cue' in handle and 'func cue(' in handle
+ rubric = json.loads((ASSETS / 'sequence_rubric.json').read_text(encoding='utf-8'))
+ blockout = [c['id'] for c in rubric['criteria'] if 'blockout' in c['stages']]
+ assert blockout == ['read', 'timing', 'scale', 'placement', 'coherence']
diff --git a/tests/test_workflow.py b/tests/test_workflow.py
index e317920..4e31dbe 100644
--- a/tests/test_workflow.py
+++ b/tests/test_workflow.py
@@ -95,7 +95,7 @@ def captured(lab):
def report():
- return {'id': 'VFX_Test', 'scores': {k: 2 for k in ('read', 'timing', 'layering', 'shape_change', 'motion', 'placement', 'tail', 'identity')},
+ return {'id': 'VFX_Test', 'scores': {k: 2 for k in ('read', 'timing', 'layering', 'shape_change', 'motion', 'placement', 'tail', 'identity', 'coherence')},
'worst': 'read', 'fix': 'Keep the main silhouette legible.', 'verdict': 'ship'}