Photoreal Blender scenes from a one-paragraph brief, built by AI agents: image→3D props on fal, scripted layout, lighting, camera and grade.
Python
Studio: shared password plus email or username, admin name reserved; add the Blender to Unreal converter
Apekshik Panigrahi02f7d79ae11e
diff --git a/.gitignore b/.gitignoreindex 21b11bb..cd74581 100644--- a/.gitignore+++ b/.gitignore@@ -62,3 +62,7 @@ builder_out/# Generation records (refs/**/*.json) hold local output paths; refs/ above already excludes them, this is explicitrefs/**/*.json*.tsbuildinfo++# Unreal build logs+*.out+unreal_fx/work/diff --git a/breakdown/site_rec.mjs b/breakdown/site_rec.mjsnew file mode 100644index 0000000..2c77885--- /dev/null+++ b/breakdown/site_rec.mjs@@ -0,0 +1,126 @@+// Frame-accurate screen recordings of anyscene.org for the trailer: headless Chrome at 1280x720 CSS px, device scale+// 1.5 (so 1920x1080 frames), stepped 1/24 s at a time. Scrolls, the cursor and every page video are set to the exact+// frame time before each screenshot, so motion is smooth regardless of how long a screenshot takes. The cursor is+// drawn into the page; clicks are shown (a ring), never performed, so nothing is downloaded or navigated mid-shot.+//+// node breakdown/site_rec.mjs <base url> <out dir> [segment ...]+// Needs playwright-core (any install) and Chrome; writes <out dir>/<segment>/%04d.png.+import { mkdirSync, rmSync } from 'node:fs';+import { join } from 'node:path';+import { createRequire } from 'node:module';++const require = createRequire(process.env.PLAYWRIGHT_FROM || import.meta.url);+const { chromium } = require('playwright-core');+const [base = 'http://127.0.0.1:4331', outDir = 'site_rec', ...only] = process.argv.slice(2);+const FPS = 24;+const ease = (a) => (a <= 0 ? 0 : a >= 1 ? 1 : a * a * (3 - 2 * a));+const lerp = (a, b, k) => a + (b - a) * k;+// keyframed value: [[t, v], ...] eased between keys+const track = (keys) => (t) => {+ if (t <= keys[0][0]) return keys[0][1];+ for (let i = 1; i < keys.length; i++) if (t <= keys[i][0]) {+ const [t0, v0] = keys[i - 1], [t1, v1] = keys[i];+ return Array.isArray(v0) ? v0.map((x, j) => lerp(x, v1[j], ease((t - t0) / (t1 - t0)))) : lerp(v0, v1, ease((t - t0) / (t1 - t0)));+ }+ return keys.at(-1)[1];+};++// Cursor and scroll targets are element selectors resolved on the page (centre of the element, page coordinates).+const SEGMENTS = {+ home: { path: '/', secs: 6.5, waitReel: true, reelAt: 17.4, // the reel from its second caustic chamber shot, then the submarine+ scroll: [[0, 0]], cursor: [[0, [1180, 760]], [2.2, [1180, 760]], [4.6, '.hero-copy a[href="/scenes/"]']], click: 5.4 },+ scenes: { path: '/scenes/', secs: 7.5,+ scroll: [[0, 0], [2.4, 250]], cursor: [[0, [700, 640]], [2.6, '.card[href="/scenes/submarine-control-room/"] .media'], [5.0, '.card[href="/scenes/submarine-control-room/"] .media']],+ hover: 2.6, click: 6.6 },+ scene: { path: '/scenes/submarine-control-room/', secs: 9.5,+ scroll: [[0, 0], [3.2, 0], [6.8, '#downloads']], cursor: [[0, [900, 560]], [6.4, [900, 560]], [8.0, '#downloads .btn']], click: 8.7, scrollPad: 120 },+ kits: { path: '/kits/', secs: 6.0, scroll: [[0, 0], [5.6, 1500]], cursor: [[0, [1240, 760]]] },+ kit: { path: '/kits/dai-pai-dong-street-kitchen/', secs: 7.0, scroll: [[0, 0], [1.6, '.item']], scrollPad: 140,+ cursor: [[0, [900, 600]], [2.0, '.item .media'], [4.4, '.item .media'], [5.6, '.item:nth-of-type(3) .media']], hover: 2.0 },+};++const CURSOR = `<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 24 24"><path d="M3 2l7.5 19 2.6-7.6L21 10.8z" fill="#111" stroke="#fff" stroke-width="1.6" stroke-linejoin="round"/></svg>`;++async function record(page, name, seg) {+ const dir = join(outDir, name);+ rmSync(dir, { recursive: true, force: true });+ mkdirSync(dir, { recursive: true });+ await page.goto(base + seg.path, { waitUntil: 'load' });+ await page.evaluate(() => document.querySelectorAll('img[loading="lazy"]').forEach((i) => (i.loading = 'eager')));+ await page.waitForLoadState('networkidle');+ if (seg.waitReel) await page.waitForSelector('[data-reel] video.on', { timeout: 30000 });+ if (seg.reelAt != null) await page.evaluate((at) => new Promise((ok) => {+ const v = document.querySelector('[data-reel] video');+ v.pause();+ v.addEventListener('seeked', ok, { once: true });+ v.currentTime = at;+ }), seg.reelAt);+ await page.waitForTimeout(1500); // walkthrough players start 300 ms after load+ await page.evaluate((svg) => {+ const c = document.createElement('div');+ c.id = '__cur';+ c.innerHTML = svg + '<i></i>';+ c.style.cssText = 'position:fixed;left:0;top:0;z-index:2147483647;pointer-events:none;width:44px;height:44px';+ const ring = c.querySelector('i');+ ring.style.cssText = 'position:absolute;left:-26px;top:-26px;width:52px;height:52px;border:4px solid #b3261e;border-radius:50%;opacity:0';+ document.body.append(c);+ }, CURSOR);+ // resolve selectors to page coordinates once, at scroll 0+ const at = async (v, pad = 0) => (typeof v === 'string'+ ? page.$eval(v, (el, pad) => { const r = el.getBoundingClientRect(); return [r.left + r.width / 2, r.top + scrollY - pad, r.top + scrollY + r.height / 2]; }, pad)+ : v);+ const scrollKeys = [];+ for (const [t, v] of seg.scroll) scrollKeys.push([t, typeof v === 'string' ? (await at(v, seg.scrollPad ?? 0))[1] : v]);+ const curKeys = [];+ for (const [t, v] of seg.cursor) curKeys.push([t, typeof v === 'string' ? await at(v) : [...v, null]]);+ const scrollAt = track(scrollKeys);+ const n = Math.round(seg.secs * FPS);+ for (let f = 0; f < n; f++) {+ const t = f / FPS;+ const y = Math.round(scrollAt(t));+ // cursor keys with a selector are in page coordinates (x, -, centreY); plain ones are viewport coordinates+ const key = (k) => (k[1][2] == null ? [k[1][0], k[1][1]] : [k[1][0], k[1][2] - y]);+ let cx, cy;+ const keys = curKeys.map((k) => [k[0], key(k)]);+ [cx, cy] = track(keys)(t);+ await page.mouse.move(cx, cy);+ const ring = seg.click != null && t >= seg.click ? Math.min(1, (t - seg.click) / 0.45) : -1;+ await page.evaluate(async ({ y, cx, cy, ring, t }) => {+ scrollTo(0, y);+ const c = document.getElementById('__cur');+ c.style.transform = `translate(${cx - 6}px, ${cy - 3}px)`;+ const r = c.querySelector('i');+ r.style.opacity = ring < 0 ? 0 : String(1 - ring);+ r.style.transform = `scale(${ring < 0 ? 0.4 : 0.4 + ring})`;+ // every video with a source runs on its own clock from the first frame it is seen+ const clocks = (window.__clocks ||= new Map());+ const vids = [...document.querySelectorAll('video')].filter((v) => v.currentSrc || v.src);+ await Promise.all(vids.map(async (v) => {+ if (v.readyState < 2 && !v.dataset.waited) {+ v.dataset.waited = '1'; // once per video: one that never loads must not stall every frame+ await new Promise((ok) => { v.addEventListener('loadeddata', ok, { once: true }); setTimeout(ok, 4000); });+ }+ if (v.readyState < 1) return;+ if (!clocks.has(v)) clocks.set(v, t - v.currentTime);+ if (!v.paused) v.pause();+ if (v.closest('.card, .item')) v.classList.add('on'); // their play() promise is pre-empted by the pause+ const want = v.duration ? (t - clocks.get(v)) % v.duration : 0;+ if (Math.abs(v.currentTime - want) > 0.001) {+ const done = new Promise((ok) => { v.addEventListener('seeked', ok, { once: true }); setTimeout(ok, 1500); });+ v.currentTime = want;+ await done;+ }+ }));+ // images that just scrolled into view+ await Promise.all([...document.images].filter((i) => !i.complete).map((i) => new Promise((ok) => { i.onload = i.onerror = ok; setTimeout(ok, 3000); })));+ }, { y, cx, cy, ring, t });+ await page.screenshot({ path: join(dir, `${String(f).padStart(4, '0')}.png`) });+ }+ console.log(`${name}: ${n} frames`);+}++const browser = await chromium.launch({ executablePath: process.env.CHROME || 'C:/Program Files/Google/Chrome/Application/chrome.exe',+ args: ['--autoplay-policy=no-user-gesture-required', '--hide-scrollbars'] });+const page = await browser.newPage({ viewport: { width: 1280, height: 720 }, deviceScaleFactor: 1.5 });+for (const [name, seg] of Object.entries(SEGMENTS)) if (!only.length || only.includes(name)) await record(page, name, seg);+await browser.close();diff --git a/breakdown/trailer.py b/breakdown/trailer.pynew file mode 100644index 0000000..715bf20--- /dev/null+++ b/breakdown/trailer.py@@ -0,0 +1,394 @@+"""AnyScene trailer (X, ~70 s) and the anyscene.org hero loop, 1920x1080 @ 24 fps.++ node breakdown/site_rec.mjs http://127.0.0.1:4331 breakdown/trailer/site # screen recordings of the site first+ uv run --python 3.13 --with pillow python -I breakdown/trailer.py [trailer] [hero] [--check]++Trailer, made to read on a phone in a feed: few words, big and bold, on cards between the footage, never over it.+ ONE IMAGE IN. -> the submarine and the bakery wiping from their reference to the set, the caustic chamber between+ (its reference is a film still, so it is not shown); about 5 s each -> 9 SCENES. -> all nine walkthroughs at once+ -> 5 PROP KITS. -> a kit lineup and turntables -> FREE ON ANYSCENE.ORG -> screen recordings of the site (landing,+ the catalogue, a scene page down to its downloads, a kit) -> end card.+Counts are the catalogue's (anyscene-org/data/catalog.json). Every scene and kit there downloads free (CC BY 4.0).++Hero loop: the three highlights only, no text, no bars (native 2.39:1, 1920x804), crossfaded and seamless (the last+shot crossfades into the first). Web encodes: h264 1080p, HEVC 1080p, h264 960 for phones, and a poster (its first frame).++ ANYSCENE_RUNS folder holding the endpoint runs and videos (default ../anyscene-runs)+ FFMPEG an ffmpeg with h264_nvenc (default: CapCut's bundled ffmpeg if found, else ffmpeg)++Writes ANYSCENE_RUNS/videos/anyscene_trailer.mp4 and breakdown/trailer/hero/*, plus parts.json and, with --check,+a contact sheet and a black/frozen-frame report per part in breakdown/trailer/.+"""++import glob+import json+import os+import subprocess+import sys+from pathlib import Path++ROOT = Path(__file__).resolve().parent.parent+if "FFMPEG" not in os.environ:+ capcut = sorted(glob.glob(os.path.expandvars(r"%LOCALAPPDATA%/CapCut/Apps/*/ffmpeg.exe")))+ os.environ["FFMPEG"] = capcut[-1] if capcut else "ffmpeg"++sys.path.insert(0, str(Path(__file__).resolve().parent))+from assemble import BG, DIM, FF, FPS, H, INK, LETTERBOX, W, duration, ff, font # noqa: E402+from PIL import Image, ImageDraw, ImageFont # noqa: E402++RUNS = Path(os.environ.get("ANYSCENE_RUNS", ROOT.parent / "anyscene-runs"))+V = RUNS / "videos"+SUB = RUNS / "shot_submarine"+KIT = ROOT / "breakdown/kit_supercut" # kit_supercut.py's full-quality segments (lineup dollies, turntable grids)+OUT = ROOT / "breakdown/trailer"+FINAL = V / "anyscene_trailer.mp4"+XF = 0.6 # crossfade, seconds+SEG_ENC = ["-an", "-c:v", "h264_nvenc", "-preset", "p6", "-rc", "vbr", "-cq", "15", "-b:v", "0", "-pix_fmt", "yuv420p"]+BRASS = (226, 178, 92)+BAR = (H - 804) // 2 # letterbox bar height for 2.39:1 footage++# (src, start, secs); a section's first shot carries its title in the bottom bar. Numbers are the catalogue's.+CAUSTIC = dict(kicker="Travertine hall · built in 30 min", title="The Caustic Chamber", shots=[+ (V / "caustic_shots/zoom_out_reveal.mp4", 0.0, 8.0), # caustics on the travertine, pulling back to the room+ (V / "caustic_shots2/reveal_from_sculpture.mp4", 1.6, 5.4),+ (V / "caustic_shots/rack_desk_chair.mp4", 0.0, 5.5), # 85 mm rack focus, sculpture to chair+ (V / "caustic_shots2/reveal_from_desk_chair.mp4", 1.8, 5.2),+])+BAKERY = dict(kicker="Paris · 1 reference image · 48 props", title="Maison Roussel", ref=RUNS / "refs/bakery_0.png",+ shots=[+ (V / "bakery_walkthrough.mp4", 0.0, 4.2), # the walk only while it is in the shop: from ~4.5 s it heads for the bakehouse+ (V / "bakery_pastry_push.mp4", 1.5, 7.0),+ (V / "bakery_closeup_croissant_macro.mp4", 0.0, 5.0),+ (V / "bakery_closeup_tarts.mp4", 0.5, 5.0),+ (V / "bakery_closeup_window_lettering.mp4", 0.5, 4.5),+])+SUBMARINE = dict(kicker="Control room · 1 reference image · 36 props", title="Submarine H-27",+ ref=RUNS / "refs/submarine_0.png", shots=[+ (next(SUB.glob("*_walk_in.mp4")), 0.0, 7.0),+ (next(SUB.glob("*_reveal_depth.mp4")), 0.5, 4.75),+ (next(SUB.glob("*_reveal_sonar.mp4")), 0.0, 5.25),+ (next(SUB.glob("*_reveal_planes.mp4")), 0.0, 5.25),+])+# Unreal Engine section, between the highlights and the kits: Apek's own editor recordings, (src, start, secs) each,+# letterboxed like the rest; the first carries this title. Empty -> no section.+UNREAL = dict(kicker="Same set · Unreal Engine 5.8", title="In Unreal", shots=[])+KITS = [(KIT / "41_daipaidong_dolly.mp4", 0.0, 6.5), (KIT / "12_orbital_turn.mp4", 0.0, 4.0),+ (KIT / "31_ramen_dolly.mp4", 0.0, 6.0)]+HOLD = 1.8 # seconds on the reference before it wipes+WIPE = 1.0++SITE = OUT / "site" # site_rec.mjs frames, one folder per segment+WALKS = ROOT.parent / "anyscene-org-staging/web/scenes" # the site's walkthrough encodes, one per scene+BARLOW = ROOT.parent / "anyscene-org/node_modules/@fontsource/barlow-condensed/files/barlow-condensed-latin-800-normal.woff"+GRID = ["caustic-chamber", "submarine-control-room", "mission-control-1970s", "hk-dai-pai-dong", "riad-tea-salon",+ "tokyo-ramen-shop", "tokyo-electronics-repair", "halloway-chemist", "maison-roussel"]+XF_X = 0.4 # the X cut's crossfades: quicker than the reel's++HERO = [ # (src, start, secs) at native 2.39:1; the loop starts (and its poster is) on the first shot+ (V / "bakery_pastry_push.mp4", 2.0, 5.0),+ (V / "caustic_shots/zoom_out_reveal.mp4", 0.5, 5.5),+ (next(SUB.glob("*_walk_in.mp4")), 1.0, 5.0),+ (V / "bakery_closeup_croissant_macro.mp4", 0.5, 4.5),+ (V / "caustic_shots2/reveal_from_desk_chair.mp4", 2.0, 4.5),+ (next(SUB.glob("*_reveal_depth.mp4")), 1.0, 4.25),+]+++def ease(a):+ a = min(max(a, 0.0), 1.0)+ return a * a * (3 - 2 * a)+++def mix(c0, c1, a):+ return tuple(int(c0[j] + (c1[j] - c0[j]) * a) for j in range(3))+++def centred(d, y, txt, fnt, fill):+ d.text(((W - d.textlength(txt, font=fnt)) / 2, y), txt, font=fnt, fill=fill)+++def fit(img, bw, bh):+ """Centre-crop img to bw:bh and resize."""+ r = bw / bh+ w, h = img.size+ if w / h > r:+ nw = int(h * r)+ img = img.crop(((w - nw) // 2, 0, (w - nw) // 2 + nw, h))+ else:+ nh = int(w / r)+ img = img.crop((0, (h - nh) // 2, w, (h - nh) // 2 + nh))+ return img.resize((bw, bh), Image.LANCZOS)+++KICK, TITLE, TOP = font("bahnschrift.ttf", 24), font("segoeuib.ttf", 44), font("bahnschrift.ttf", 30)+++def draw_bar_title(d, kicker, title, a):+ """Kicker over title, centred in the bottom letterbox bar, at opacity a (drawn onto a black bar)."""+ if a <= 0:+ return+ centred(d, H - BAR + 20, kicker.upper(), KICK, mix((0, 0, 0), BRASS, a))+ centred(d, H - BAR + 52, title, TITLE, mix((0, 0, 0), INK, a))+++def bar_title_png(path, kicker, title, top=None):+ img = Image.new("RGBA", (W, H), (0, 0, 0, 0))+ d = ImageDraw.Draw(img)+ centred(d, H - BAR + 20, kicker.upper(), KICK, BRASS + (255,))+ centred(d, H - BAR + 52, title, TITLE, INK + (255,))+ if top:+ centred(d, (BAR - 30) // 2 - 2, top, TOP, BRASS + (255,))+ img.save(path)+++def clip(src, ss, t, out, title=None, letterbox=True):+ """One stretch of footage at 1920x1080 (letterboxed) or native; title=(kicker, title[, top]) fades in the bars."""+ vf = f"{LETTERBOX if letterbox else f'scale={W}:-2:flags=lanczos'},fps={FPS},setsar=1,format=yuv420p"+ if not title:+ ff("-ss", f"{ss:.3f}", "-t", f"{t:.3f}", "-i", src, "-vf", vf, *SEG_ENC, out)+ return duration(out)+ png = out.with_suffix(".title.png")+ bar_title_png(png, *title)+ fade = f"fade=t=in:st=0.7:d=0.6:alpha=1,fade=t=out:st={t - 1.4:.2f}:d=0.6:alpha=1"+ ff("-ss", f"{ss:.3f}", "-t", f"{t:.3f}", "-i", src, "-loop", "1", "-t", f"{t:.3f}", "-i", png, "-filter_complex",+ f"[0:v]{vf}[v];[1:v]format=rgba,{fade}[c];[v][c]overlay=0:0:format=auto,format=yuv420p", *SEG_ENC, out)+ return duration(out)+++def wipe_shot(sec, out, shot=None, labels=True, hold=HOLD, wipe=WIPE):+ """The section's reference, letterboxed, with a slow push; then it wipes left to right to the finished set,+ already playing. With labels, top bar: ANY REFERENCE IN -> BLENDER SET OUT; bottom bar: the section title once the+ set is in. Rendered frame by frame with Pillow."""+ HOLD, WIPE = hold, wipe # noqa: N806 (shadow the defaults for this shot)+ src, ss, t = shot or sec["shots"][0]+ frames = OUT / f"_wipe_{out.stem}"+ src_dir = frames / "src"+ src_dir.mkdir(parents=True, exist_ok=True)+ for f in src_dir.glob("*.png"):+ f.unlink()+ ff("-ss", f"{ss:.3f}", "-t", f"{t:.3f}", "-i", src, "-vf", f"scale={W}:804:flags=lanczos,fps={FPS}", src_dir / "%04d.png")+ foot = sorted(src_dir.glob("*.png"))+ ref = fit(Image.open(sec["ref"]).convert("RGB"), W, 804)+ secs = HOLD + t+ n = int(round(secs * FPS))+ for f in range(n):+ tt = f / FPS+ z = 1 + 0.035 * ease(min(tt, HOLD + WIPE) / (HOLD + WIPE)) # push on the reference until it is gone+ cw, chh = int(W / z), int(804 / z)+ r = ref.crop(((W - cw) // 2, (804 - chh) // 2, (W - cw) // 2 + cw, (804 - chh) // 2 + chh)).resize((W, 804), Image.LANCZOS)+ a_ref = ease(tt / 0.5)+ pic = Image.blend(Image.new("RGB", (W, 804), (0, 0, 0)), r, a_ref) if a_ref < 1 else r+ p = ease((tt - HOLD) / WIPE)+ if p > 0:+ st = Image.open(foot[min(len(foot) - 1, int((tt - HOLD) * FPS))]).convert("RGB")+ cut = int(W * p)+ pic.paste(st.crop((0, 0, cut, 804)), (0, 0))+ if cut < W:+ ImageDraw.Draw(pic).line((cut, 0, cut, 804), fill=BRASS, width=3)+ fr = Image.new("RGB", (W, H), (0, 0, 0))+ fr.paste(pic, (0, BAR))+ if not labels:+ fr.save(frames / f"{f:04d}.png", compress_level=1)+ continue+ d = ImageDraw.Draw(fr)+ a_in = ease((tt - 0.2) / 0.5) * (1 - ease((tt - HOLD) / 0.4))+ a_out = ease((tt - HOLD - 0.3) / 0.5) * (1 - ease((tt - HOLD - 3.2) / 0.6))+ ty = (BAR - 30) // 2 - 2+ if a_in > 0:+ centred(d, ty, "ANY REFERENCE IN", TOP, mix((0, 0, 0), BRASS, a_in))+ if a_out > 0:+ centred(d, ty, "BLENDER SET OUT", TOP, mix((0, 0, 0), BRASS, a_out))+ draw_bar_title(d, sec["kicker"], sec["title"], ease((tt - HOLD - WIPE - 0.1) / 0.6) * (1 - ease((tt - secs + 1.4) / 0.6)))+ fr.save(frames / f"{f:04d}.png", compress_level=1)+ ff("-framerate", FPS, "-i", frames / "%04d.png", "-vf", "format=yuv420p", *SEG_ENC, out)+ return n / FPS+++def still_video(img, secs, out):+ png = out.with_suffix(".png")+ img.save(png)+ ff("-loop", "1", "-t", f"{secs:.3f}", "-i", png, "-vf", f"fps={FPS},format=yuv420p", *SEG_ENC, out)+ return secs+++def big_card(out, lines, secs=1.6):+ """Words only, big and bold (the site's Barlow Condensed 800), centred on the dark ground. lines: [(text, size,+ colour)], a word wrapped in *stars* is drawn in brass."""+ canvas = Image.new("RGB", (W, H), BG)+ d = ImageDraw.Draw(canvas)+ gap = 28+ y = (H - sum(s for _, s, _ in lines) - gap * (len(lines) - 1)) // 2 - 12+ for text, size, col in lines:+ f = ImageFont.truetype(str(BARLOW), size)+ words = text.split(" ")+ x = (W - d.textlength(text.replace("*", ""), font=f)) / 2+ for i, w in enumerate(words):+ c = BRASS if w.startswith("*") else col+ w = w.strip("*") + (" " if i < len(words) - 1 else "")+ d.text((x, y), w, font=f, fill=c)+ x += d.textlength(w, font=f)+ y += size + gap+ return still_video(canvas, secs, out)+++def grid9(out, secs=4.6):+ """All nine scenes' walkthroughs at once, 3 x 3, from the site's own encodes (6 px gaps)."""+ tw, th, g = 636, 356, 6+ inputs, chain = [], []+ for i, slug in enumerate(GRID):+ inputs += ["-ss", "2", "-t", f"{secs:.3f}", "-i", WALKS / slug / "walk.mp4"]+ chain.append(f"[{i}:v]scale={tw}:{th}:force_original_aspect_ratio=increase:flags=lanczos,crop={tw}:{th},setsar=1,fps={FPS}[t{i}]")+ layout = "|".join(f"{(i % 3) * (tw + g)}_{(i // 3) * (th + g)}" for i in range(9))+ chain.append("".join(f"[t{i}]" for i in range(9)) + f"xstack=inputs=9:layout={layout}:fill=0x0e0d0c,format=yuv420p")+ ff(*inputs, "-filter_complex", ";".join(chain), "-t", f"{secs:.3f}", *SEG_ENC, out)+ return duration(out)+++def site_clip(name, out):+ """One site_rec.mjs recording (1920x1080 PNG frames) as a segment."""+ ff("-framerate", FPS, "-i", SITE / name / "%04d.png", "-vf", "format=yuv420p", *SEG_ENC, out)+ return duration(out)+++def xfade_chain(parts, xf=XF):+ chain, prev, offset = [], "[0:v]", parts[0][1]+ for i in range(1, len(parts)):+ chain.append(f"{prev}[{i}:v]xfade=transition=fade:duration={xf}:offset={offset - xf:.3f}[x{i}]")+ offset += parts[i][1] - xf+ prev = f"[x{i}]"+ return chain, prev, offset+++def trailer():+ OUT.mkdir(parents=True, exist_ok=True)+ parts = []++ def add(name, fn):+ p = OUT / f"x{len(parts):02d}_{name}.mp4"+ parts.append((p, fn(p)))+ print(f" {p.name}: {parts[-1][1]:.2f} s", flush=True)++ big, mid = 210, 120+ add("card_in", lambda p: big_card(p, [("ONE IMAGE IN.", big, INK)], 1.5))+ sub_walk = SUBMARINE["shots"][0][0]+ add("sub_wipe", lambda p: wipe_shot(SUBMARINE, p, (sub_walk, 0.0, 3.6), labels=False, hold=1.1, wipe=0.8))+ add("caustic", lambda p: clip(V / "caustic_shots2/establishing_wide.mp4", 0.5, 4.6, p))+ add("bakery_wipe", lambda p: wipe_shot(BAKERY, p, (V / "bakery_walkthrough.mp4", 0.0, 3.6), labels=False, hold=1.1, wipe=0.8))+ for i, (src, ss, t) in enumerate(UNREAL["shots"]):+ add(f"unreal{i}", lambda p, a=(src, ss, t): clip(*a, p))+ add("card_scenes", lambda p: big_card(p, [("*9* SCENES.", big, INK)], 1.3))+ add("grid", grid9)+ add("card_kits", lambda p: big_card(p, [("*5* PROP KITS.", big, INK)], 1.3))+ add("kit_dolly", lambda p: clip(KIT / "41_daipaidong_dolly.mp4", 0.0, 4.2, p, letterbox=False))+ add("kit_turn", lambda p: clip(KIT / "12_orbital_turn.mp4", 0.0, 3.0, p, letterbox=False))+ add("card_free", lambda p: big_card(p, [("ALL *FREE*", big, INK), ("ANYSCENE.ORG", mid, INK)], 1.9))+ for name in ("home", "scenes", "scene", "kits", "kit"):+ add(f"site_{name}", lambda p, n=name: site_clip(n, p))+ add("end", lambda p: big_card(p, [("ANYSCENE.ORG", big, INK), ("*FREE* BLENDER SCENES + KITS", 78, DIM)], 4.0))++ inputs = [x for p, _ in parts for x in ("-i", p)]+ chain, prev, total = xfade_chain(parts, XF_X)+ chain.append(f"{prev}fade=t=in:st=0:d=0.5,fade=t=out:st={total - 0.8:.3f}:d=0.8[vout]")+ ff(*inputs, "-filter_complex", ";".join(chain), "-map", "[vout]", "-c:v", "h264_nvenc", "-preset", "p7", "-tune", "hq",+ "-multipass", "fullres", "-rc", "vbr", "-b:v", "24M", "-maxrate", "36M", "-bufsize", "48M", "-pix_fmt", "yuv420p",+ "-r", str(FPS), "-movflags", "+faststart", FINAL)+ (OUT / "parts.json").write_text(json.dumps([[p.name, round(d, 2)] for p, d in parts], indent=1))+ print(f"wrote {FINAL} ({duration(FINAL):.1f} s, {FINAL.stat().st_size / 1e6:.1f} MB)")+ return parts+++def hero():+ """Seamless loop: shot 1 from XF on, the rest crossfaded, then the last shot crossfades into shot 1's first XF+ seconds, so the last frame runs straight into the first."""+ d = OUT / "hero"+ d.mkdir(parents=True, exist_ok=True)+ parts = []+ for i, (src, ss, t) in enumerate(HERO):+ p = d / f"_h{i}.mp4"+ parts.append((p, clip(src, ss, t, p, letterbox=False)))+ first, d0 = parts[0]+ head, tail = d / "_h0_tail.mp4", d / "_h0_head.mp4"+ ff("-ss", f"{XF:.3f}", "-i", first, "-c:v", "h264_nvenc", "-preset", "p6", "-rc", "vbr", "-cq", "15", head)+ ff("-t", f"{XF:.3f}", "-i", first, "-c:v", "h264_nvenc", "-preset", "p6", "-rc", "vbr", "-cq", "15", tail)+ seq = [(head, duration(head))] + parts[1:] + [(tail, XF)]+ inputs = [x for p, _ in seq for x in ("-i", p)]+ chain, prev, total = xfade_chain(seq)+ master = d / "_hero_master.mp4"+ ff(*inputs, "-filter_complex", ";".join(chain), "-map", prev, *SEG_ENC, "-r", str(FPS), master)+ web = ["-an", "-pix_fmt", "yuv420p", "-r", str(FPS), "-g", "48", "-movflags", "+faststart"]+ nv = ["-preset", "p7", "-tune", "hq", "-multipass", "fullres", "-rc", "vbr"]+ outs = {+ "hero_1080.mp4": ["-c:v", "h264_nvenc", *nv, "-b:v", "1.9M", "-maxrate", "3.2M", "-bufsize", "4M", "-profile:v", "high"],+ "hero_1080_hevc.mp4": ["-c:v", "hevc_nvenc", *nv, "-b:v", "1.2M", "-maxrate", "2.2M", "-bufsize", "3M", "-tag:v", "hvc1"],+ "hero_960.mp4": ["-vf", "scale=960:-2:flags=lanczos", "-c:v", "h264_nvenc", *nv, "-b:v", "0.75M", "-maxrate", "1.3M",+ "-bufsize", "1.6M", "-profile:v", "high"],+ }+ for name, enc in outs.items():+ ff("-i", master, *enc, *web, d / name)+ print(f" {name}: {duration(d / name):.2f} s, {(d / name).stat().st_size / 1e6:.2f} MB")+ ff("-i", master, "-frames:v", "1", d / "hero_poster.png")+ print(f"hero loop {total:.2f} s -> {d}")+++def check(final, parts, out_dir, xf=XF_X):+ """Contact sheet (frames from every part) + per-part black / frozen report."""+ starts, t = [], 0.0+ for i, (p, d) in enumerate(parts):+ starts.append((Path(p).stem, t, d))+ t += d - (xf if i < len(parts) - 1 else 0)+ thumbs = []+ for name, st, d in starts:+ for frac in (0.2, 0.5, 0.85) if d > 6 else (0.3, 0.75):+ png = out_dir / f"_cs_{name}_{frac}.png"+ ff("-ss", f"{st + d * frac:.2f}", "-i", final, "-frames:v", "1", "-vf", "scale=400:-2", png)+ thumbs.append((f"{name} {st + d * frac:.1f}s", Image.open(png).convert("RGB")))+ cols = 6+ th = thumbs[0][1].height+ rows = (len(thumbs) + cols - 1) // cols+ sheet = Image.new("RGB", (cols * 400, rows * (th + 26)), (0, 0, 0))+ dr = ImageDraw.Draw(sheet)+ for i, (lab, im) in enumerate(thumbs):+ x, y = (i % cols) * 400, (i // cols) * (th + 26)+ sheet.paste(im, (x, y))+ dr.text((x + 6, y + th + 3), lab, font=font("consola.ttf", 17), fill=(230, 230, 230))+ sheet.save(out_dir / "contact_sheet.jpg", quality=88)++ raw = subprocess.run([FF, "-v", "error", "-i", str(final), "-vf", "fps=8,scale=64:36,format=gray", "-f", "rawvideo", "-"],+ capture_output=True, check=True).stdout+ n = len(raw) // 2304+ means, diffs = [], [0.0]+ for i in range(n):+ fr = raw[i * 2304:(i + 1) * 2304]+ means.append(sum(fr) / 2304)+ if i:+ diffs.append(sum(abs(a - b) for a, b in zip(fr, raw[(i - 1) * 2304:i * 2304])) / 2304)+ report = []+ for name, st, d in starts:+ a, b = int(st * 8), min(int((st + d) * 8), n)+ run = best = 0+ for v in diffs[a + 1:b]:+ run = run + 1 if v < 0.12 else 0+ best = max(best, run)+ report.append(dict(part=name, start=round(st, 2), secs=round(d, 2), min_luma=round(min(means[a:b]), 1),+ mean_luma=round(sum(means[a:b]) / (b - a), 1), longest_static_s=round(best / 8, 2)))+ (out_dir / "check.json").write_text(json.dumps(report, indent=1))+ for r in report:+ print(r)+++def main():+ todo = [a for a in sys.argv[1:] if not a.startswith("--")] or ["trailer", "hero"]+ for sec in (CAUSTIC, BAKERY, SUBMARINE):+ for src, _, _ in sec["shots"]:+ if not Path(src).exists():+ raise SystemExit(f"missing footage: {src}")+ if "trailer" in todo:+ parts = trailer()+ if "--check" in sys.argv:+ check(FINAL, parts, OUT)+ if "hero" in todo:+ hero()+++if __name__ == "__main__":+ main()diff --git a/builder/app.py b/builder/app.pyindex e23cc1d..c513842 100644--- a/builder/app.py+++ b/builder/app.py@@ -156,6 +156,9 @@ class BuildRequest(BaseModel):shots: BuildShots | None = Field(None, description=("Optional: shots of the finished set. When the build passes its critic, the AnyShot app (ANYSHOT_APP) shoots ""them and the stills/videos come back in shot_stills / shot_videos."))+ owner: str | None = Field(None, description=(+ "Optional: who asked for the build (e.g. an email). Listed in /builds; not part of the retry fingerprint, so "+ "an identical request from someone else attaches to the same build."))class BuildResponse(BaseModel):@@ -358,7 +361,8 @@ class SceneBuilderApp(fal.App):build_id, resume = rec["build_id"], Trueelse:build_id = "b_" + uuid.uuid4().hex[:10]- json.dump({"build_id": build_id, "fingerprint": fp, "started": time.time()}, open(index, "w"))+ json.dump({"build_id": build_id, "fingerprint": fp, "started": time.time(), "owner": req.owner},+ open(index, "w"))work = os.path.join(BUILDS_DIR, build_id)os.makedirs(os.path.join(work, "out"), exist_ok=True)@@ -417,7 +421,7 @@ class SceneBuilderApp(fal.App):"from the current state to the deliverables.")b.emit("received", "running", f"{'resuming' if resume else 'build'} {build_id}: {len(refs)} reference image(s)",reference_urls=req.reference_image_urls, prompt=req.prompt, dials=req.dials, effort=req.effort,- floor_plan_url=req.floor_plan_url)+ floor_plan_url=req.floor_plan_url, owner=req.owner)result = Nonetry:result = await b.run(scene_builder.agent_env())diff --git a/builder/gallery.py b/builder/gallery.pyindex 3185bef..6c71a3b 100644--- a/builder/gallery.py+++ b/builder/gallery.py@@ -103,8 +103,8 @@ def _fold(st, ev):st["last_t"] = ev["t"]if stage == "received":if ev.get("reference_urls") is not None and st["given"] is None:- st["given"] = {k: ev.get(k) for k in ("reference_urls", "prompt", "dials", "effort", "floor_plan_url", "items")- if k in ev}+ st["given"] = {k: ev.get(k) for k in ("reference_urls", "prompt", "dials", "effort", "floor_plan_url", "items",+ "owner") if k in ev}if re.match(r"(build|resuming) [bk]_", ev.get("message", "")):st["attempts"] += 1url = ev.get("preview_url")@@ -225,7 +225,7 @@ def summary(root, bid, kind="scene"):"passed": bool(last and last.get("passed")),"reference_urls": given.get("reference_urls") or [], "prompt": given.get("prompt") or "","dials": given.get("dials") or {}, "effort": given.get("effort"), "floor_plan_url": given.get("floor_plan_url"),- "items": given.get("items"), "name": (resp or {}).get("name"),+ "items": given.get("items"), "name": (resp or {}).get("name"), "owner": (rec or {}).get("owner") or given.get("owner"),"critic_rounds": rounds, "last_scores": (last or {}).get("scores"), "last_summary": (last or {}).get("summary"),"minutes": minutes, "cover": cover,"stills": stills[:MAX_LIST_IMAGES], "previews": previews[:MAX_LIST_IMAGES],diff --git a/unreal/CHANGELOG.md b/unreal/CHANGELOG.mdnew file mode 100644index 0000000..a150fa6--- /dev/null+++ b/unreal/CHANGELOG.md@@ -0,0 +1,118 @@+# unreal/ converter changelog++## 2026-11-02: one converter (all threads merged) + real-time look pass++Every per-scene thread worked on a copy of `unreal/` taken at 20:17 on 2026-11-01 (`unreal_bakery/_orig` and+`unreal_ramen/_orig` are that snapshot; `unreal_fx/ORIG.md5` and the caustic copy match it). They were merged as+three-way merges against that base, so mission control's 8 fixes, which were already in `unreal/`, stay as they were.+The thread folders are untouched and are now superseded by this one.++### Merged from the threads++| From | What | Where |+|---|---|---|+| caustic (`unreal_caustic/MERGE_BACK.patch`) | Gobo light functions (`M_AnyGobo` + `MPC_AnyTime`, animated mapping fitted to drift+sines, strength chain reduced), IES profiles, a constant emission strength scaling candela | export_blend.py, build_level.py (`stage_light_textures`, `master_gobo`, `gobo_mi`, `key_gobo_time`) |+| caustic | Local-fog fix: tiled LFVs (`lfv_tiles`), uniform scale from the 500 cm base sphere, `radial_fog_extinction` = σ·path, emissive matched to Cycles through the coverage term | build_level.py `stage_level` |+| caustic | Memory: `collect_garbage()` per texture/mesh chunk, `ANYSCENE_MESH_BATCH` | build_level.py |+| caustic | `ANYSCENE_DOLLY` moving-camera sequences, `MRQ_Clip` (whole playback range), `ANYSCENE_MRQ_RES`, `ANYSCENE_MRQ_OUT` | build_level.py |+| caustic | render_mrq.ps1 parameters (`-Project/-Dest/-Level/-ResX/-ResY`) and the full `-dpcvars` set incl. `r.TextureStreaming=0`; export.sh runs the exporter next to itself; side_by_side.py name patterns | render_mrq.ps1, export.sh, side_by_side.py |+| bakery (`anyscene-unreal/bakery/FIXLOG.md`) | #1/#2 hero camera: `ANYSCENE_HERO` → scene.json `active_camera` → `cam_street` → first camera | build_level.py, export_blend.py |+| bakery | #3 full `-dpcvars` in perf.ps1 | perf.ps1 |+| bakery | #5 per-camera `exposure` custom property → CineCamera post-process exposure bias | export_blend.py, build_level.py |+| bakery | #4 side_by_side.py `SBS_CYC` / `SBS_UE` / `SBS_CYC_LABEL` (both `{cam}` and the bakery's `{c}` work) | side_by_side.py |+| bakery | #7/#8 glass look: superseded by the new glass master below (same diagnosis: diffuse-lit white glass = milky veil) | build_level.py |+| ramen (`unreal_ramen/FIXLOG.md`) | **G8** `ensure_bake_uv`: set `active_render` by name after `uv_layers.new()` (posters, signs, decals, menus baked to a flat colour) | export_blend.py |+| ramen | **G9** Principled Alpha baked into ORM.R; cut-out assets get `M_AnyBakedMasked` (clip 0.33); existing MIs are reparented | export_blend.py, build_level.py |+| ramen | G3 Mantaflow domains become `fx` notes instead of opaque fog boxes; G4 `ANYSCENE_HERO_CAM` kept as an alias of `ANYSCENE_HERO` | export_blend.py, build_level.py |+| effects (`unreal_fx/CHANGES.md`) | `fx_pack.py`, `fxlib.py`, `fx_recipes/`, `fx_export.py`, `templates.json`, `FX_AGENT.md` copied in. The exporter calls `fx_export.classify` (`--no-fx` skips it; a failure only logs). `stage_fx`, `place_fx`, `key_flicker`, the fx warm-up in MRQ configs, `ANYSCENE_FX_OVERRIDES`, `ANYSCENE_CLIP_FRAMES` | export_blend.py, build_level.py |+| effects (round 2, synced 2026-11-02 after the merge) | `fx_pack.py`, `fx_export.py`, `fx_recipes/`, `templates*.json`, `FX_AGENT.md` replaced with unreal_fx's round-2 versions: the set_params garbage literal that blacked out every emissive sprite (the reason fire was invisible), in-place pack rebuilds (no `__build` leftovers), pixel coverage, fire pivot, camera-visible fire measurement, physical rain intensity. `classify()` signature unchanged; build_level.py needed nothing. Rebuild `/Game/AnySceneFX` with fx_pack.py in any project that has the old pack | fx_* |+| effects | **Behind a flag:** `ANYSCENE_FX_TYPES`. At merge time the default was `steam`, because fire did not render and rain was too faint. Since round 2 it is `steam,fire,rain` (see "Fx: fire and rain on by default"); other types still need `all` or their name. Flicker tracks are always keyed. The stage skips cleanly when `/Game/AnySceneFX` isn't in the project | build_level.py |+| fal (`unreal_fal/`) | Sharded/cached export: `--plan-out`, `--plan`, `--keys`, `--cache`, `--link-cache`, content hashes; asset names are computed over the full key list, so they are the same in every shard and for `--only` re-exports (before, an `--only` run could name a colliding asset differently); `--gpu` forces OptiX when a factory Blender would bake on the CPU | export_blend.py |++Not merged: `unreal_caustic/scene_defaults.patch` (as instructed); the fal app itself (`unreal_fal/app.py`,+`client.py`), which deploys separately but can now run this exporter unchanged.++### Overlaps resolved once++- **Glass-only meshes (bakery #6, ramen G7, upstream `sections`):** upstream's exporter-side `sections` mapping is kept.+ Exports without `sections` (all current bakery/ramen exports) fall back to the bakery rule (every slot is glass →+ drop the unused baked slot). Ramen's third variant (`n < len(mats)`) was dropped.+- **Glass look (bakery #7/#8 vs the new master):** replaced by the thin-translucent master below.+- **Local fog (caustic vs effects):** caustic's tiled, coverage-matched LFVs, plus the effects rule that volumes+ claimed by an fx entry get no LFV.+- **Hero camera (bakery vs ramen):** one lookup, both env names.+- **MRQ_Clip (caustic vs effects):** renders the sequence's whole playback range; camera sequences are+ `max(48, ANYSCENE_CLIP_FRAMES)` long, and dollies use their own length.+- **export.sh queueing (ramen `EXPORT_NOQUEUE` vs upstream `--gpu`):** upstream's (only `--gpu` bakes queue).+- **perf.ps1 `r.setres`:** upstream's (bakery #9 / ramen G6 are the same fix).++### Real-time look (glass, shadows, AO, tone)++**Glass: new `M_AnyGlass` (v2), thin translucency, no Substrate.** Substrate is off in these projects (`r.Substrate 0`),+and turning it on would recompile and change every scene, so the master uses the legacy Thin Translucent shading+model: Surface ForwardShading, a Fresnel-weighted specular layer with Lumen front-layer reflections, and a coloured+transmittance that tints what's behind it with 1/NoV path length. Per slot (`glass_params`): Transmittance = Blender+colour, Specular from the IOR, Roughness, a frost layer for rough glass (opacity 0 → 0.35), and screen-space IOR+refraction for solid glass (35 % of IOR−1); panes thinner than 2.5 cm get none. Glass renders before DOF, so it+defocuses with the scene. Older masters are rebuilt in place (`master_asset` + `AnySceneVersion` tag), so existing+projects pick it up on a `materials` rerun.+- Gotcha: in 5.8 Python, "Surface ForwardShading" is `TLM_SURFACE_PER_PIXEL_LIGHTING`. `TLM_SURFACE` fails to+ compile ("ThinTranslucent materials must use Surface ForwardShading") and the glass silently renders as the grey+ default material.++**Tone: AgX looks.** The builder ignored `grade.look`. A grey-ramp fit of UE's filmic curve (TonemapCommon.ush) against+Blender's AgX looks (config.ocio) shows the default UE curve *is* AgX High Contrast (best `color_contrast` 0.99,+rms 2/255). Each look therefore maps to `color_contrast = c_look / 1.4` plus the look's saturation, fitted within+~2/255 for every look: Base 0.71, Medium High 0.86, High 1.0, Very High 1.12. Base-contrast scenes were about 40 %+too contrasty before, and High Contrast scenes (bakery) were already right.++**Vignette.** The finish.sh `vignette=angle` → UE `vignette_intensity` mapping was a linear guess that came out about+40 % too weak (ramen: 0.39 vs the fitted 0.635), so frame edges were 1.5–2.5× brighter than Cycles. `vignette_intensity()`+now least-squares-fits UE's cos⁴ falloff (in scene linear, before the tone curve) to ffmpeg's display-space falloff+for the frame's aspect ratio.++**Lumen (grade post-process volume, so it travels with the level):** `lumen_front_layer_translucency_reflections`+on (mirror reflections on glass; Epic scalability leaves it off), `lumen_scene_detail` 2 (small props get cards),+`lumen_final_gather_quality` 2 (less noise and leaking in tight interiors). Overridable per key via `ANYSCENE_LOOK`.++**Shadows/AO: what was measured and not changed** (ramen, MRQ A/B, same frame):+- `r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing=1`: mean diff 0.4/255. Short-range AO is already on+ (screen space) at Epic/Cine.+- VSM penumbra `r.Shadow.Virtual.SMRT.MaxRayAngleFromLight` 0.03 → 0.15: 1.0/255.+- Hit lighting, skylight off, bloom off, film grain off: no measurable change. Height fog off: −1 to −4 in the shadows.+- Lumen diffuse GI off: the walls drop to almost Cycles' level. The "flat / no AO" read in ramen is mostly+ tone (look + vignette, fixed above) plus Lumen indirect light about 0.5 EV stronger than Cycles' in that narrow room.+ The bounce excess is not fixed: it isn't a surface-cache leak (hit lighting changes nothing) or a sky leak, and it+ needs a per-light-group investigation.++`ANYSCENE_LOOK` also takes `"light": {...}` (light component properties) and `"glass": {"refraction_scale", "pass"}`.++### Walkable levels: collision + PlayerStart (new `spawn` stage)++PIE / `-game` in the playground spawned the pawn at the world origin (`FindPlayerStart: ... NO PLAYERSTART`), or+somewhere it fell or glitched through floors: meshes are imported with `collision` off, and the PlayerStart sat at the+hero camera's height or was missing. The new `spawn` stage runs by default after `level`, and runs on its own with+`ANYSCENE_STAGES=spawn` on any level built from an export, including one already copied into another project:+- **Collision:** set meshes get complex-as-simple collision (exact, nothing generated, no reimport). Props smaller than+ `ANYSCENE_COLLIDE_MIN_CM` (default 25 cm), glass-only meshes, alpha-cut decals and the sky dome get NoCollision.+- **PlayerStart:** exactly one, placed on the floor under the hero camera + 92 cm with the camera's yaw. The search+ works in rings out to 6 m and only accepts floor-level spots: the floor is the lowest surface found, because a+ trace from eye height lands on stools and counters. Each spot must leave a 36 cm sphere (GameModeBase's+ DefaultPawn) overlapping nothing. A full 88 cm character capsule fit nowhere in the ramen aisle. Use+ `ANYSCENE_PLAYERSTART=keep` to leave a hand-placed start alone.+- The report gets a `spawn` record (start, yaw, floor samples, the first blockers). `ANYSCENE_REPORT` redirects+ the report.++### Fx: fire and rain on by default (round-2 fx files synced from unreal_fx/)+- `ANYSCENE_FX_TYPES` now defaults to `steam,fire,rain`. Drips, dust, sparks, smoke and fountain stay opt-in until a+ scene verifies them (or use `all`).+- Fire verified in AnySceneFX (HK cam_wok, MRQ). Tongues render in the gap between pan and collar, where Cycles shows+ them, at about 3.2k/3.7k nits. Rain renders as a faint streak veil that is still softer than Cycles' sparse bright+ drops; tune it through `ANYSCENE_FX_OVERRIDES` (`Opacity`, `SizeMin`).+- A project that places fx needs `/Game/AnySceneFX`. Build it with `fx_pack.py` (it rebuilds in place, so it is+ safe with placed levels). Today the pack only exists in `anyscene-unreal/AnySceneFX`.++### Other+- render_mrq.ps1 `-Cvars` for A/B renders without a rebuild.+- `skipped` fx ids no longer KeyError on note entries (Mantaflow) that have no `id`.+- Builder docstring lists every environment variable.diff --git a/unreal/FX_AGENT.md b/unreal/FX_AGENT.mdnew file mode 100644index 0000000..aa0e595--- /dev/null+++ b/unreal/FX_AGENT.md@@ -0,0 +1,84 @@+# FX_AGENT.md: converting any Blender effect to Niagara, by script++The effects layer is generic by construction. Nothing in it is specific to the HK scene. Read `NIAGARA.md` first for+the Unreal and Niagara background. This page covers the loop the converter (and the `/scene2unreal` agent) runs for+any scene.++```+Blender scene ──fx_export.py──▶ scene.json "fx" ──build_level.py (stage fx)──▶ NiagaraActors ──MRQ──▶ compare with Cycles+ classify + measure place, set User params, │+ read back, bounds, seed, warm-up ▼+ ◀── overrides.json (tuning, no re-export)+templates.json ◀──fx_pack.py◀── fx_recipes/*.json (new effect type = new recipe, no code)+```++## 1. The pieces++| File | What it does | Who edits it |+|---|---|---|+| `fx_recipes/NS_*.json` | One Niagara template each: emitters, module rewiring (links, one-line HLSL, enums), extra modules, renderers, and its own sprite materials (HLSL bodies). Ships: Fire, Steam, Smoke, Rain, Drips, DustMotes, Sparks/Embers, FountainJet | humans, or the agent for a new effect type |+| `fx_pack.py` | Builds `/Game/AnySceneFX` headlessly from the recipes through Epic's NiagaraToolsets, then writes `templates.json` (the param types, plus the `fx_types` each template serves) | nobody, per scene |+| `fx_export.py` | Blender side. Classifies volume shaders and particle systems by evidence: emission, drivers, albedo, velocity, gravity, lifetime, names. It measures the effect (baked density and emission slices: base, lean, reach, ring radius, optical depth; driver scroll speed; particle rate, speed, size; ground ray cast) and writes the `fx` entries | rules only |+| `build_level.py` `stage_fx` | Places a `NiagaraActor` per entry and sets the asset, then the typed params, then reads every param back (invalid = error). Also sets fixed bounds, the seed and the warm-up, and keys sampled light flicker into the camera sequences | nobody |+| `overrides.json` (`ANYSCENE_FX_OVERRIDES`) | `{fx_id or "type:<type>": {Param: value}}` applied on top of `scene.json`. This is the look-match knob, and it is reproducible | the agent |++## 2. The agent loop for a new scene++1. Run `fx_export.py`. Every entry gets `type`, `confidence`, `evidence`, the measured `physical` block and+ `params`.+2. **`technique: "agent"`** means no template serves that `type`, or the object was unclassifiable (`unknown`).+ Read its `evidence`, `physical` and `source.objects`, and look at the object in Blender (its node tree and+ modifiers). Then:+ - **An existing template fits** (a lava bubble is a slow orange `NS_Steam`; a waterfall mist is `NS_Steam` with+ a white albedo): set `technique: "niagara"`, `template`, and `params` in `overrides.json`, or patch the entry.+ - **Nothing fits** (falling leaves, snow, bubbles, fireflies, ribbons of a trail): write+ `fx_recipes/NS_<Name>.json`. Copy the closest recipe and change:+ - `fx_types`: the classifier types the template serves (add a type word to `TYPE_WORDS` in `fx_export.py` if+ it is new);+ - `common`: real-world defaults (cm, cm/s, s, nits);+ - `emitters[].core`: `gpu`, `material`, `aligned` (velocity-aligned streaks), `nonuniform` (Aspect = length /+ width), `curl`, `grow`, `sort`, `fade`;+ - `emitters[].inputs`: `[script, module, input, value]`, where `value` is a number, a bool,+ `{"link": "User.X", "type": "float"}`, `{"hlsl": "..."}` or `{"enum": "Display Name"}`. Hidden inputs need+ their parent switch set first: the tool refuses them and says so;+ - `emitters[].add_modules`: `{"asset": "/Niagara/Modules/...", "script": ..., "before": "SolveForcesAndVelocity",+ "inputs": {...}}`;+ - `emitters[].set_params`: `[script, "Particles.X", type, hlsl, before?]`;+ - `materials`: `{"M_AFX_<Name>": {"blend": "ADDITIVE|TRANSLUCENT", "lit": bool, "rgb": hlsl, "base": hlsl,+ "op": hlsl, "depth_fade": cm}}`. The HLSL bodies see `UV`, `PC` (particle colour), `PA` (alpha), `R`+ (random), `T` (time), `DP` (x = Intensity, y = Temperature) and the helpers `X.fbm(float2)` and+ `X.bb(kelvin)`.++ Keep the shared User parameter names (NIAGARA.md §3). Add scene-specific ones under `extra`.+3. Build only the new template. This takes about 1 minute, and the other templates stay as they are:+ `ANYSCENEFX_ONLY=NS_<Name> UnrealEditor-Cmd <proj> -run=pythonscript -script=fx_pack.py`.+ Check `templates_report.json`: `issues` must be empty and `compile.bHasErrors` false.+4. Run `build_level.py` with `ANYSCENE_STAGES=fx,sequences`. `build_report.json` → `fx[].params_invalid` must be+ empty.+5. Render MRQ stills and clips of the cameras that see the effect, and compare against Cycles (NIAGARA.md §6). Tune+ **only** through `overrides.json`: change one parameter per round, at most three rounds. If it still does not+ match, change the template or technique (flipbook / SVT, NIAGARA.md §5).++## 3. Rules learned on HK (apply everywhere)++- **Measure what a camera sees.** `fx_export` ray-casts each emitting sample to the scene cameras. On HK the only+ visible flame is the outer tail in the gap between the wok and its collar, about 1% of the volume. Brightness is the+ emission integrated along the view ray, and a grazing ray through a ring of flame is far brighter than one tongue.+- **Debug a dark sprite with a solid material.** Copy the recipe to `work/dbg_recipes/`, set+ `rgb: "return float3(50,0,50) * PA;"`, build with `ANYSCENEFX_RECIPES`, and place it from a scene.json copy. If the+ quads show up, the simulation is fine and the material inputs (PC, DP) are wrong.+- **Measure the visible part of the effect, not the whole volume.** Burner flames are full strength *under* the+ wok, where Cycles hides them too. Spawning there put every sprite inside the pan. `fx_export` now spawns fire on+ the upper half of the emitting band, at the outer edge of the ring.+- **A ring's slice "spread" is its radius, not the tongue width.** Size flame sprites from the flame height.+- **Steam opacity is tiny.** τ ≈ σ·width ≈ 0.05 for HK's woks, and the Cycles plume is barely visible. Don't+ "fix" a faint plume into fog.+- **Rain streaks need the shutter.** Length = drop + speed × shutter / fps. Cycles renders them motion-blurred.+- **Practical lights already exist.** `light_link` takes the brightest light within 1 m. Niagara's own light stays+ at 0, and the sampled `flicker` drives the practical light's intensity in Sequencer instead.+- **Headless gotchas:**+ - `GetStackIssues` asserts without Slate: only run it in a full editor (`ANYSCENEFX_STACK_ISSUES=1`).+ - `AddSetParametersModule` accepts HLSL defaults only for some types. `fx_pack` falls back to a typed default and+ then rewires the input.+ - `DefaultSystem` ships a stock "Fountain" emitter, which `fx_pack` removes.+ - Enum inputs come back as `NewEnumeratorN`: resolve them by display name (`UEnum_Info`).diff --git a/unreal/NIAGARA.md b/unreal/NIAGARA.mdnew file mode 100644index 0000000..72bd5cb--- /dev/null+++ b/unreal/NIAGARA.md@@ -0,0 +1,655 @@+# NIAGARA.md: porting AnyScene (Blender/Cycles) effects to Unreal 5.8++This is the converter agent's guide to effects: flames, steam, smoke, haze plumes, rain or drizzle, drips and splashes,+sparks and embers, dust motes, fountain jets, and screen or light flicker. Geometry, materials, lights, cameras and fog+already convert (`export_blend.py` writes `scene.json`, then `build_level.py` builds the level). This file covers+what comes next: classify each Blender effect, pick a technique, place it, render it through MRQ and compare it+with Cycles.++Everything marked *[engine]* was confirmed in the installed UE 5.8 files under `C:\Program Files\Epic Games\UE_5.8`.+Items marked *[docs]* come from dev.epicgames.com. Items marked *[untested]* are design guidance: verify them on the+first scene and update this file.++---++## 0. Read this first: findings that change the plan++1. **No built-in fire, steam, smoke or rain system ships with 5.8.** The Niagara plugin includes only generic emitter+ templates (Fountain, HangingParticulates, RecycleParticlesInView, BlowingParticles, DirectionalBurst, ...). There is+ no StarterContent `P_Fire` / `P_Steam` on this install. Real fire and smoke exist only as **NiagaraFluids** grid sims,+ which are Beta and expensive. Plan on an **AnySceneFX content plugin**: about ten master systems authored once, so+ the converter only places them and sets their parameters. Never author Niagara graphs at build time.+2. **Local fog volumes in `build_level.py` are the wrong size.** `ULocalFogVolumeComponent::GetBaseVolumeSize()`+ returns **500 cm**, and the proxy collapses the scale to a uniform sphere using the **max axis**+ (`LocalFogVolumeSceneProxy.cpp:34`) *[engine]*. `build_level.py` assumes a 100 cm unit and non-uniform scale, so+ every LFV comes out about 5x too large and spherical. That is why the wok "flame" became a large static emissive+ glow. `RadialFogExtinction` is also integrated in unit-sphere space: the optical depth straight through the centre+ is exactly `RadialFogExtinction`, independent of size (`LocalFogVolumeCommon.ush:178-203`). The correct mapping is+ **extinction = Blender density (1/m) x path length (m)**, not the raw density.+3. **Particles never reach the level.** The exporter only logs particle emitters into `fx` (no transform, no bounds,+ no velocity), and `build_level.py` ignores `fx`. That is why the HK drizzle and drips are missing. Steam is+ procedural 4D-noise volume shaders, which the exporter samples at one frame into a static LFV. Animated steam+ cannot survive that path.+4. **MRQ needs `render_warm_up_frames = True` for GPU particles.** The flag's own tooltip says GPU particles need the+ warm-up frames to be rendered *[engine: MoviePipelineAntiAliasingSetting.h]*. `build_level.py` already sets it+ (64 engine warm-up frames). Keep it, and keep `use_camera_cut_for_warm_up = False`, or `engine_warm_up_count` is+ ignored.+5. **Pass `fx.Niagara.ForceWaitForCompilationOnActivate=1` in `-dpcvars` for every headless render.** Otherwise a+ component activates while its scripts or GPU shaders are still compiling, and the first frames render without the+ effect. This is the Niagara equivalent of the `Editor.AsyncAssetCompilation=0` gotcha already in+ `render_shots.py`. The per-component property `bWaitForCompilationOnActivate` is editor-only data+ (`NiagaraComponent.cpp:1358`) *[engine]*.+6. **User parameters set from Python in the editor are saved with the level.** In editor builds, `SetVariableFloat`+ and the other setters also call `SetParameterOverride`, which writes `InstanceParameterOverrides`+ (`NiagaraComponent.cpp:2875, 4376`) *[engine]*. So build, set, `save_current_level()` works headlessly. The+ parameter must exist on the asset and the type must match exactly. A wrong name or wrong type is a **silent no-op**.+7. **Epic ships an AI toolset for Niagara authoring:** `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (plus+ `ToolsetRegistry`, both disabled by default). Its tools create systems, add emitters, modules, renderers and user+ variables, set stack inputs, and read compile errors and stack issues. You can call them from Python through+ `unreal.ToolsetRegistry.execute_tool(toolset, tool, json)`. Use this for the **one-time** authoring of the AnySceneFX+ templates, in a full editor session with an RHI. Do not use it in the per-scene build. It is Experimental. Its+ bundled skills (`Content/Python/skills/*.py`) are worth reading. They are summarised in §1 where relevant.+8. **Animated SVTs import headlessly from VDB.** `USparseVolumeTextureFactory` skips its dialog when the import is+ automated or running in a commandlet, auto-detects numbered `.vdb` sequences, and maps the `density` grid to+ attributes A.R (unorm8), with up to 4 other grids in B (fp16) (`SparseVolumeTextureFactory.cpp:40-108, 436`)+ *[engine]*. Blender 5.0 bundles the `openvdb` Python module (`5.0/python/lib/site-packages/openvdb.cp311-*.pyd`), so+ the exporter can write VDBs from procedural volumes itself.++---++## 1. Niagara essentials (only what the converter needs)++- **System > emitters > modules.** A *system* (`UNiagaraSystem`, the asset you place) contains *emitters*. Each+ emitter runs four script stacks in a fixed order: System Spawn/Update, then Emitter Spawn/Update, then Particle+ Spawn/Update. Spawn runs once at creation and Update runs every tick. Within Particle Update the order is forces,+ then collision, then exactly one velocity solve. *Renderers* (sprite, mesh, ribbon, light, ...) draw an emitter's+ particles.+- **Namespaces.** `User.*` is the external interface: set per component, read anywhere. `Engine.*` is read-only (delta+ time, owner transform). `System.*`, `Emitter.*` and `Particles.*` are written by their own scope.+ **Expose everything the converter sets as a `User.` parameter.** From Python, pass the bare name (`SpawnRate`). The+ `User.` prefix also resolves (`RedirectUserVariable`). There is no enum setter: set the int.+- **Types matter.** World-space anchors are `Position` (LWC-aware): use `set_variable_position`. Directions,+ velocities, wind and box extents are `Vector3`: use `set_variable_vec3`. Colours are `LinearColor`.+- **CPU vs GPU.** System and emitter scripts always run on the CPU VM. Only particle scripts move to the GPU.+ - Use **GPU** for anything sustained in the hundreds or more (rain, dust, steam puffs, sparks).+ - Use **CPU** for small counts and for any emitter with a **Light renderer**: light, decal and component renderers+ force the emitter to CPU.+ - A system can mix both.+- **Fixed bounds.** Use fixed bounds for every converter-placed effect. They are cheapest, work on CPU and GPU, and+ stop the culling surprises. Dynamic bounds are CPU-only. GPU emitters without fixed or programmable bounds cull+ wrongly. Set them per instance with `set_system_fixed_bounds(Box)` in **local space**: use the Blender domain or+ emitter box plus travel distance (velocity x lifetime).+- **Warm-up and pre-roll.** `UNiagaraSystem.WarmupTime / WarmupTickCount / WarmupTickDelta` simulate N ticks on+ activation in one frame. Per instance, set `override_warmup_settings = True`, `warmup_tick_count` and+ `warmup_tick_delta`. The component passes these to the instance at activation (`NiagaraComponent.cpp:1219`)+ *[engine]*. Rule: **warm-up time ≥ the longest particle lifetime x 1.5**, so the effect is in steady state on+ frame 1. Mirror Blender's negative `frame_start` (HK drizzle starts at -80) or the Mantaflow `PREROLL`.+- **Determinism and seeds.**+ - The system flag `bDeterminism` + `RandomSeed` makes the instance seed equal the system seed plus the component's+ `RandomSeedOffset`. Without it, every reset gets a random seed.+ - Emitters carry their own `bDeterminism` / `RandomSeed` too.+ - Turn both on in every AnySceneFX template. Set `set_random_seed_offset(hash(fx_id) & 0x7fffffff)` per instance so+ copies differ but runs repeat. The offset is applied on activation or reset, so set it before saving.+ - CPU emitters with determinism repeat exactly under MRQ's fixed timestep. Treat GPU emitters as "very close" *[untested]*.+ For bit-exact repeats, use a sim cache (§2.6).+- **Lit vs unlit sprites.**+ - Fire, embers, sparks, CRT glow: **unlit**, additive or translucent, emissive only.+ - Steam, smoke, haze, dust, rain: **lit translucent**. Use *Translucency Lighting Mode = Volumetric NonDirectional*+ (cheapest, soft) or *Volumetric PerVertex NonDirectional*. The directional modes only matter for normal-mapped+ smoke.+ - Prefer Masked over Translucent where blending allows (drops, chunky debris).+ - Translucent materials need **Two Sided** when seen from both sides.+ - Each material needs the usage flag for its renderer: `MaterialEditingLibrary.set_material_usage(mat,+ unreal.MaterialUsage.MATUSAGE_NIAGARA_SPRITES)`. In 5.8 the `bUsedWith*` flags are deprecated in favour of the+ usage accessor *[engine: Material.h:749]*.+- **Lumen.**+ - Particles do not contribute to Lumen GI or reflections as emitters: a fire sprite lights nothing. Light comes from+ a real light (§3, Lighting).+ - Lit translucent particles receive Lumen GI through the low-resolution translucency lighting volume, so expect+ soft, slightly flat shading.+ - Emissive particles are not in the Lumen scene: they will not show in reflections the way Cycles shows them.+- **Volumetric fog.**+ - A sprite with a **Volume-domain material** injects albedo, emissive and extinction into the volumetric-fog froxel+ grid. This gives real 3D density with no billboard edges *[docs: Volumetric Fog]*. Mesh renderers reject the Volume+ domain *[engine: NiagaraMeshRendererProperties.cpp:1380]*.+ - It needs an Exponential Height Fog with *Volumetric Fog* on, which the converter already spawns.+ - The grid is coarse and camera-aligned, so use it for haze plumes and soft steam bodies, not crisp wisps.+- **Translucency sorting.**+ - Within an emitter: `SortMode = ViewDepth` on the sprite renderer. Leave it at `None` for additive fire and sparks;+ sorting costs GPU time.+ - Between components, sorting is by bounds centre. Fix wrong-order overlaps with the primitive property+ `translucency_sort_priority`, or by splitting the bounds.+- **Depth of field.** Translucent materials default to `TranslucencyPass = MTP_AfterDOF` *[engine: Material.cpp:1183]*,+ so out-of-focus steam stays sharp. For effects in defocused regions (foreground steam in `cam_wok`), set+ `TranslucencyPass = MTP_BeforeDOF` in the template material, or in a second material variant.++---++## 2. Placing and driving Niagara from Python, headless++### 2.1 Confirmed API (UE 5.8, from `NiagaraComponent.h`, `NiagaraActor.h`, `NiagaraFunctionLibrary.h`)++| Need | Call |+|---|---|+| Place | `eas.spawn_actor_from_class(unreal.NiagaraActor, loc, rot)`. Same reason as `spawn_mesh()` in `build_level.py`: spawn by class in the commandlet |+| Component | `act.get_editor_property("niagara_component")` (UPROPERTY `NiagaraComponent`) |+| Set asset | `nc.set_asset(system, True)`. The second arg resets existing overrides: set the asset **first**, then the parameters |+| Float, int, bool | `nc.set_variable_float(name, v)`, `set_variable_int`, `set_variable_bool` |+| Vector, colour | `set_variable_vec3(name, unreal.Vector)`, `set_variable_vec2`, `set_variable_vec4`, `set_variable_linear_color(name, unreal.LinearColor)`, `set_variable_quat` |+| Position (LWC) | `set_variable_position(name, unreal.Vector)` |+| Objects | `set_variable_texture`, `set_variable_material`, `set_variable_static_mesh`, `set_variable_object`, `set_variable_actor` |+| Read back (verify) | `get_variable_float(name)` and the like. In Python these return `(value, is_valid)`; assert `is_valid` |+| Seed | `nc.set_random_seed_offset(int)` |+| Bounds | `nc.set_system_fixed_bounds(unreal.Box)`, `set_emitter_fixed_bounds(emitter_name, box)`; read back with `get_system_fixed_bounds()` |+| Warm-up | `nc.set_editor_property("override_warmup_settings", True)`, `("warmup_tick_count", n)`, `("warmup_tick_delta", dt)` |+| Scalability | `nc.set_allow_scalability(False)`. Cinematic renders must not be distance-culled by an Effect Type |+| Sequencer age | `set_age_update_mode(unreal.NiagaraAgeUpdateMode.DESIRED_AGE_NO_SEEK)`, `set_desired_age(t)`, `seek_to_desired_age(t)` |+| Manual sim | `advance_simulation(ticks, dt)`, `advance_simulation_by_time(seconds, dt)`, `reset_system()`, `reinitialize_system()` |+| Sim cache | `set_sim_cache(cache, reset)`. Capture with `NiagaraSimCacheFunctionLibrary.capture_niagara_sim_cache_immediate(...)` |+| Runtime spawn | `unreal.NiagaraFunctionLibrary.spawn_system_at_location(world, system, loc, rot, scale, auto_destroy, auto_activate, pool, precull)`. Do not use it for level building: it is a transient runtime spawn |++Python names are the snake_case form of the C++ names, with a property's `b` prefix dropped. No stub exists yet+(`Intermediate/PythonStub/unreal.py` is generated only with Developer Mode on). On first use, run+`dir(unreal.NiagaraComponent)` in the build log and fix any name that differs.++### 2.2 Placement snippet (goes into a `stage_fx()` in `build_level.py`)++```python+NS = {}+def fx_system(path):+ if path not in NS:+ NS[path] = unreal.load_asset(path)+ if NS[path] is None:+ warn(f"fx template missing: {path}")+ return NS[path]++def place_fx(eas, fx):+ sysasset = fx_system(fx["template"])+ if sysasset is None:+ return None+ q = fx["transform"]["quat"]+ act = eas.spawn_actor_from_class(unreal.NiagaraActor, V(fx["transform"]["loc"]),+ unreal.Quat(*q).rotator())+ act.set_actor_label("FX_" + fx["id"]); act.set_folder_path("FX")+ nc = act.get_editor_property("niagara_component")+ nc.set_asset(sysasset, True) # 1. asset first (resets overrides)+ for k, v in fx["params"].items(): # 2. typed user params+ t = fx["param_types"][k]+ if t == "float": nc.set_variable_float(k, float(v))+ elif t == "int": nc.set_variable_int(k, int(v))+ elif t == "bool": nc.set_variable_bool(k, bool(v))+ elif t == "vec3": nc.set_variable_vec3(k, V(v))+ elif t == "pos": nc.set_variable_position(k, V(v))+ elif t == "color": nc.set_variable_linear_color(k, unreal.LinearColor(*v[:3], v[3] if len(v) > 3 else 1))+ nc.set_random_seed_offset(fx["seed"]) # 3. determinism+ b = unreal.Box(); b.min = V(fx["bounds_local"]["min"]); b.max = V(fx["bounds_local"]["max"]); b.is_valid = True+ nc.set_system_fixed_bounds(b) # 4. bounds (local)+ nc.set_editor_property("override_warmup_settings", True) # 5. pre-roll+ nc.set_editor_property("warmup_tick_delta", 1.0 / 30.0)+ nc.set_editor_property("warmup_tick_count", int(math.ceil(fx["time"]["preroll_s"] * 30)))+ nc.set_allow_scalability(False)+ for k, t in fx["param_types"].items(): # 6. verify: silent no-ops are the main failure+ if t == "float":+ val, ok = nc.get_variable_float(k)+ if not ok: warn(f"{fx['id']}: user param {k} not on {fx['template']}")+ return act+```+Then call `les.save_current_level()`, as `stage_level` already does. Construct `unreal.Box` the way above, or with+keyword args. Check the result with `get_system_fixed_bounds()`.++### 2.3 Commandlet (`-run=pythonscript`) limits++- **Commandlets render nothing.** A commandlet uses the null RHI unless it is started with `-AllowCommandletRendering`+ (`LaunchEngineLoop.cpp:2246`) *[engine]*.+ - These need no RHI and work in the commandlet: placing actors, setting user parameters, fixed bounds, warm-up+ fields, seeds, and saving.+ - GPU emitters do not simulate there, and their compute shaders are not exercised.+ - Niagara VM script compilation is a DDC/ShaderCompileWorker job. It works from a commandlet, as cooking proves.+ Ship the templates **pre-compiled and saved** in the AnySceneFX plugin, so a fresh build only loads them.+- **The first render compiles shaders.** GPU sim shaders and particle material shaders compile on the first+ `-game -RenderOffscreen` run.+ - Pass `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Budget a one-off cold-DDC compile of about 2-5 minutes per new template set. Keep the DDC on persistent storage+ (`/data`) in the container.+- **Don't author Niagara graphs in the commandlet.** `UNiagaraSystemFactoryNew` exposes no Python properties.+ `EditorAssetLibrary.duplicate_asset()` works for "copy a template and tweak it", but tweaking stack inputs needs+ the NiagaraToolsets editor functions, which expect a full editor. Per-scene variation goes through user parameters,+ not new assets.+- **Plugins.** Niagara is on by default. If you use NiagaraFluids (Beta), NiagaraSimCaching or NiagaraMRQ, enable them+ in `AnySceneUE.uproject` (`"Plugins"`) **before** the build. Enabling a plugin mid-session needs a restart.++### 2.4 MRQ settings for particles (the `MRQ_Still` / `MRQ_Linear` configs in `stage_sequences`)++- `MoviePipelineAntiAliasingSetting`:+ - `engine_warm_up_count = 64`: game-thread ticks with no render; the cheap warm-up.+ - `render_warm_up_frames = True`: required for GPU particles, depth-buffer collision and GPU warm-up.+ - `use_camera_cut_for_warm_up = False`.+ - `temporal_sample_count = 8`: Niagara ticks once per temporal sub-sample, so the accumulation itself gives sprite+ motion blur.+ - Raise `engine_warm_up_count` to `ceil(max_lifetime_s x fps x 1.5)` when the scene's longest lifetime exceeds+ 64/24 s, for example slow steam with 6 s lifetimes.+- **Fixed timestep.** MRQ always steps the world at the sequence rate. Particle state is a pure function of frames+ since activation plus the seed, so the warm-up count must be identical between runs.+- **Pre-roll belongs in the asset or component.** Component warm-up (§2.2) runs on activation, before any MRQ frame.+ Use both component warm-up and MRQ engine warm-up: the first covers steady state, the second covers shader compile+ and streaming.+- `MoviePipelineGameOverrideSetting` (already added) forces cinematic scalability. Also call `set_allow_scalability(False)`+ on every component so Effect Type culling can't drop an effect.+- **Sequencer track (optional, for exact scrubbing).** Add a Niagara System track to the camera's level sequence,+ with a spawn section set to `SectionEvaluateBehavior = ActivateIfInactive` and+ `AgeUpdateMode = DesiredAgeNoSeek`. Age then follows sequence time instead of wall-clock ticks+ (`MovieSceneNiagaraSystemSpawnSection.h`) *[engine]*. Only do this if stills differ between runs.+- **NiagaraMRQ plugin.** It adds a data interface that tells a system whether MRQ is running, plus the temporal sample+ index and count. Use it only if a template must branch for offline quality, for example more particles under MRQ.++### 2.5 Light and screen flicker (not Niagara)++- **Flickering lights.** HK `wok_fire_*` uses a Python driver on `energy`.+ - Do not parse driver expressions. **Sample** the evaluated value per frame in the exporter: `frame_set(f)`, read+ `L.energy` for frames `[start, start+N)`.+ - Write `flicker.values` and key a Sequencer float track on the light's `intensity`, in the camera sequence.+ - Rendered through MRQ, this is deterministic and frame-exact.+- **CRT, screen and sign flicker.** Use a material, not Niagara.+ - Add `FlickerAmp`, `FlickerHz` and `ScanlineDensity` scalar parameters to `M_AnyBaked`'s emissive path, or to a+ dedicated `M_AnyScreen` master: emissive x (1 + amp x noise(time x Hz)), plus a rolling bar.+ - The source is `animated_materials` in the asset entry. Sample the emission strength curve the same way as lights.++### 2.6 When exact repeatability matters: sim caches++Capture the steady-state window once and assign it with `set_sim_cache`. Playback is then identical every run. Use+`capture_niagara_sim_cache_immediate` / `..._multi_frame` from `NiagaraSimCacheFunctionLibrary` in an editor session+with an RHI, or record with a Niagara Cache track in Sequencer (plugin `NiagaraSimCaching`). Only needed for hero+shots and A/B parameter tuning, where seed noise would hide a parameter change.++---++## 3. The template library (`/AnySceneFX/`)++Build these as a content plugin, `Plugins/AnySceneFX/Content/Systems/NS_*.uasset`, authored once and committed.++**Shared rules for every template.**+- `bDeterminism` on, at system and emitter level.+- Fixed bounds mode.+- World space, not local.+- Warm-up 0 in the asset. The converter sets it per instance.+- Every tunable is a `User.` parameter with a real-world default (cm, cm/s, s, nits, K).++**Common user parameters**, the same names in every system so the placement code stays generic:++| Name | Type | Meaning |+|---|---|---|+| `SpawnRate` | float | particles per second (or `Count` for bursts) |+| `LifetimeMin`, `LifetimeMax` | float | seconds |+| `SizeMin`, `SizeMax` | float | sprite size, cm |+| `Velocity` | vec3 | initial velocity, cm/s, world |+| `VelocityJitter` | float | 0..1 fraction (Blender `factor_random`) |+| `Wind` | vec3 | constant drift, cm/s |+| `Gravity` | float | 0..1 x 980 cm/s² |+| `BoxExtent` | vec3 | spawn box half-extent, cm (spawn shape = local box) |+| `Color` | color | albedo (lit) or emissive tint (unlit) |+| `Intensity` | float | emissive luminance multiplier, nits |+| `Opacity` | float | per-sprite peak alpha |+| `Temperature` | float | K, feeds a material `BlackBody` node (fire, embers) |+| `NoiseStrength`, `NoiseFreq` | float | curl-noise force amplitude and frequency |++The seed is not a parameter: it is the component's `RandomSeedOffset`.++**Starting assets that ship with 5.8.** These are mount paths. The engine plugin `/Niagara/` lives at+`Engine/Plugins/FX/Niagara/Content/`, and `/NiagaraFluids/` at `Engine/Plugins/FX/NiagaraFluids/Content/`.++- Emitters: `/Niagara/DefaultAssets/Templates/Emitters/{Fountain, HangingParticulates, RecycleParticlesInView,+ BlowingParticles, DirectionalBurst, OmnidirectionalBurst, SimpleSpriteBurst, SingleLoopingParticle, Minimal,+ UpwardMeshBurst, LocationBasedRibbon, StaticBeam, DynamicBeam, ConfettiBurst}`+- Systems: `/Niagara/DefaultAssets/Templates/Systems/{FountainLightweight, DirectionalBurst, RadialBurst,+ SimpleExplosion, MinimalLightweight, ...}`. The `*Lightweight` systems use stateless emitters, which the Niagara+ toolset cannot edit. Copy the stateful emitters instead.+- Behaviour examples (reference wiring): `/Niagara/DefaultAssets/Templates/BehaviorExamples/{SubUVAnimation,+ SpriteFacingAndAlignment, KillParticles, ...}`+- Fluids (Beta): `/NiagaraFluids/Templates/Gas/3D/Systems/{Grid3D_Gas_Fire, Grid3D_Gas_Smoke, Grid3D_Gas_ColoredFire,+ Grid3D_Gas_ColoredSmoke, Grid3D_MovingGridFire, Grid3D_Gas_Explosion}`, `.../Gas/2D/Systems/{Grid2D_Gas_SmokeFire,+ Grid2D_Gas_Smoke, Grid2D_Gas_MovingFire}`, `/NiagaraFluids/Templates/Liquid/3D/Systems/{Grid3D_Flip_Hose,+ Grid3D_Flip_Splash, Grid3D_Flip_Pool}`; materials `/NiagaraFluids/Materials/Grid3D/M_RayMarch_Fire*`,+ `MI_HeterogeneousVolumes_*`.+- Default sprite materials: `/Niagara/DefaultAssets/DefaultSpriteMaterial`, `M_DepthFade_SpriteSimple`.++**Units used in the mappings below.**+- Blender is metres, the exporter writes centimetres, and Blender axes map to Unreal as (x, -y, z).+- Volume density σ is extinction per metre. Volume emission strength *E* adds radiance per metre, so a slab of+ thickness *t* m that is optically thin glows at about *E·t* (Blender radiance units) = **683·E·t nits**. This is the+ same 683 lm/W the exporter uses for surfaces.+- **Sprite opacity from density.** For a plume of depth *L* (m) seen through *n* overlapping sprites, the target+ optical depth is τ = σ·L. Per-sprite α = 1 − exp(−τ/n). Estimate *n* ≈ SpawnRate × Lifetime × (sprite area ÷+ plume cross-section area).++### 3.1 Per-effect table++| Effect | AnySceneFX system, and how to start it | Key parameter mapping from Blender | Lighting | Real-time budget |+|---|---|---|---|---|+| **Fire / flames** (gas jets, wok, candles, braziers) | `NS_Fire`. Start from `SingleLoopingParticle` + `Fountain` (stateful copies). Two emitters: (a) a **SubUV flame** emitter with a flipbook **baked from the Blender flame volume** (§5.1), unlit additive, random start frame, `bSubImageBlend`; (b) a small blue-core emitter. Hero close-ups: `Grid3D_Gas_Fire` or an SVT (§5) | Domain box → `BoxExtent` and the emitter ring radius. Principled Volume `Emission Strength` x density-ramp peak x thickness → `Intensity` (683·E·t nits). `Emission Color` ramp at 0.6 → `Color`, or `Blackbody Intensity`/`Temperature` → `Temperature`. Flame height (density falloff z) → `Velocity.z` x Lifetime. Noise scroll rate (driver `frame*k`) → flipbook fps | Fire itself lights nothing. **Reuse the Blender practical lights** (`wok_fire_*`, `wok_blue_*` convert already) with the sampled flicker track (§2.5). If the scene has no light, add one CPU emitter with a Light renderer: one particle, `RadiusScale` ≈ flame height x 4, `bAffectsTranslucency` on. Cap: ≤ 4 Niagara lights per scene, ≤ 1 per fire | ≤ 40 sprites per flame, about 0.1 ms. Fluids fire: 1-3 ms at 64³; cinematic only |+| **Steam** (woks, pots, kettles, vents) | `NS_Steam`. Start from `Fountain`. GPU sprites, lit translucent (Volumetric NonDirectional), soft puff texture or a baked steam flipbook, curl noise, size grows x3-5 over life, alpha fades in and out. Add a second **Volume-domain sprite** emitter (§1) for the dense core when volumetric fog is on | Plume box (HK `steam_wok_i`: bottom z = wok rim, top = awning): base disc radius = 0.08 x box width → `BoxExtent`; `rise` (driver `-frame*rise`, m/frame) x fps x 100 → `Velocity.z`; `lean` → `Wind`. Lifetime = box height ÷ rise speed. Density `strength` x 9 (shader constant) = σ peak → `Opacity` by the formula above. `Color` 0.9 grey, anisotropy 0.5 → material phase (backlit glow: enable forward scatter in the material, or rely on volumetric fog) | Lit by scene lights. Needs the practical light behind it to read (HK hood strip, bulbs). `TranslucencyPass = BeforeDOF` for foreground plumes | 200-600 sprites per plume, 0.2-0.5 ms (overdraw-bound) |+| **Smoke** (cigarette curls, exhaust, chimneys) | `NS_Smoke` = `NS_Steam` with a darker albedo, slower rise and a longer life. Thin curls: a **ribbon** emitter (`LocationBasedRibbon`) with curl noise reads better than sprites | MC `smoke_curl_*`: box 0.18 x 0.18 x 0.75 m, noise scroll `-frame*0.012` → `Velocity.z` = 0.012 x fps x 100 cm/s; density 6 → ribbon width 0.5-1 cm, `Opacity` 0.3. Albedo (0.82, 0.8, 0.76) → `Color` | Lit translucent | ribbons: ≤ 3 per curl, negligible |+| **Haze plume / room haze** | Usually **not Niagara**. Homogeneous layers → Exponential Height Fog + Local Fog Volumes (§5.3). Moving plumes (street haze drifting under a light) → `NS_HazePlume`: a few big Volume-domain sprites (2-6 m) | Haze box σ → height fog density (existing code). Local plume: `RadialFogExtinction` = σ x diameter (m) (§0.2). Albedo, anisotropy → `fog_albedo`, `fog_phase_g`. Noise drift → `Wind` | Volumetric fog lighting only. Lights need `volumetric_scattering_intensity` > 0 (already mapped from Blender `visible_volume_scatter`) | LFV about 0.05 ms each; volume sprites 0.3 ms |+| **Rain / drizzle** | `NS_Rain`. Start from `RecycleParticlesInView` (keeps the rain around the camera) or a plain box-spawn GPU emitter. Velocity-aligned sprites (`Alignment = VelocityAligned`), streak length = speed x shutter, masked or translucent, `PixelCoverageMode` Automatic (sub-pixel streaks flicker under TSR otherwise) | Particle settings: `count`, `lifetime`, `frame_start/end` → `SpawnRate = count / (frame_end − frame_start) x fps`; `object_align_factor` (m/s) x 100 → `Velocity` (Blender (x,y,z) → (x,−y,z)); `factor_random` → `VelocityJitter`; emitter object box → `BoxExtent` + transform; instance-object radius x 2 → sprite width (≥ 0.15 cm, or it vanishes), length → streak length; drop material emission 0.5 / alpha 0.35 → `Intensity`, `Opacity` | Lit translucent or unlit with a faint emissive. Rain reads by **backlight**: check it against the street lights in the Cycles frames | GPU, 10k-40k alive, 0.3-0.8 ms |+| **Drips / splashes** | `NS_Drips`: GPU sprites spawned on a line (awning edge) under gravity, killed at the ground plane, plus an **event-free** splash: a second emitter spawned at the computed impact height with `DirectionalBurst`-style spray, or a splash flipbook. Ground ripples: decal flipbook or a puddle material, not particles | `awning_drips`: emitter box (thin strip) → spawn line; `count/span` → `SpawnRate`; `gravity` 1 → `Gravity` = 1; drop size → sprite size; ground z → `KillHeight` (extra user param) | Lit translucent drops; splash unlit-ish | ≤ 200 drops, ≤ 1k spray, about 0.1 ms |+| **Sparks / embers** | `NS_Sparks`: `Fountain` + velocity-aligned additive sprites, gravity, drag, short life. `NS_Embers`: slow buoyant glowing points with curl noise, long life | Particle `velocity`/`normal_factor` → `Velocity`; lifetime → Lifetime; emission colour or temperature → `Temperature` (material BlackBody) and `Intensity` = 683 x strength | Unlit additive; never a light per spark. One Light-renderer particle for a whole shower at most | ≤ 2k, 0.1-0.2 ms |+| **Dust motes** | `NS_DustMotes`: start from `HangingParticulates`. Tiny lit sprites, near-zero velocity, curl-noise drift; only visible inside light shafts, so lit translucent with a strong forward-scatter look | Blender dust particles: count over box volume → density per m³; `SpawnRate` keeps the alive count = count; size 0.05-0.2 cm; box → `BoxExtent` | Lit; needs a shaft light (spot or sun) in the frame | ≤ 3k, 0.1 ms |+| **Fountain water jets** | `NS_FountainJet`: start from `Fountain`, GPU, velocity-aligned stretched sprites + a mist emitter; for hero pools use `Grid3D_Flip_Hose` (Beta, expensive) | Nozzle object → position + direction; jet apex height *h* → `Velocity` = sqrt(2·980·h) cm/s along the nozzle; flow rate → `SpawnRate`; spread → `VelocityJitter` | Lit translucent with high specular-looking emissive edge; check against Cycles highlights | 5k-20k, 0.5 ms; FLIP 3-8 ms |+| **Screen / CRT / light flicker** | Material parameters + Sequencer tracks (§2.5). No Niagara | Sampled emission or energy curves | n/a | ~0 |++Fire, steam and smoke can borrow the **flipbook-from-Blender** path (§5.1). The look then comes from the exact Cycles+shader, and Niagara only supplies motion, variety and parallax.++### 3.2 Authoring the templates once++1. Use a full editor on a GPU box, with `NiagaraToolsets` + `ToolsetRegistry` enabled (Experimental).+2. Discover tool names with `unreal.ToolsetRegistry.get_all_toolset_json_schemas()`.+3. Per template:+ - `CreateNiagaraSystem` from an empty or minimal system;+ - `AddEmitter(<emitter template above>)`;+ - `AddUserVariables(...)`, using the shared parameter names;+ - `SetStackInputData` to link module inputs to the `User.` parameters;+ - `SetRendererData` for alignment, SubUV and sort settings;+ - `SetSystemData` for determinism and fixed bounds.+4. Then call `GetSystemCompileState` and `GetStackIssues`, and fix every error. Epic's own skill text says errors only+ surface once the system has compiled in the editor.+5. A human pass in the Niagara editor is fine as well. The contract is only the user-parameter list above.+6. Save, commit the plugin, and record each system's parameter list in `Plugins/AnySceneFX/templates.json`+ (`{"NS_Steam": {"SpawnRate": "float", ...}}`). The converter reads `param_types` from that file.++---++## 4. Detection rules and the `scene.json` `fx` schema++### 4.1 Classifying Blender effects (exporter side)++Walk every renderable object. A hit gets an `fx` entry and is **not** also exported as a mesh or an LFV, unless+§5 picks the LFV technique. Score each candidate type with the evidence below, take the highest score, and set+`confidence` = top score ÷ (top + runner-up).++| Evidence | Where | Points toward |+|---|---|---|+| Material is volume-only (`is_volume_only`) with `PRINCIPLED_VOLUME` | material | a volume type (steam / smoke / haze / fire) |+| Principled Volume `Emission Strength` > 0, or linked, or `Blackbody Intensity` > 0, or a `BLACKBODY` node, or a `VALTORGB` ramp into Emission Color with orange-to-blue stops | node tree | **fire** |+| Volume with emission 0, albedo > 0.85 grey, density driven by noise + a mapping driver on Z (`-frame*k`) | node tree + drivers | **steam** (k fast, under a hot object) or **smoke** (albedo < 0.85, or name) |+| Volume with no `TEX_NOISE` or a constant density, box > 3 m on its long axis | node tree + size | **haze** (→ fog, §5.3) |+| Volume with noise but drift ≤ 0.002 m/frame and large box | node tree | **haze plume** |+| `FLUID` modifier `DOMAIN`, `domain_type GAS`, cache in OPENVDB | modifier | steam / smoke / fire by `flow_type` of the FLOW objects (`SMOKE`, `FIRE`, `BOTH`) → prefer **SVT** (§5.2) |+| `FLUID` DOMAIN `LIQUID` | modifier | fountain or splash (mesh cache → Alembic or FLIP; flag it for agent review) |+| `VOLUME` object (VDB file) | object type | SVT direct import |+| `PARTICLE_SYSTEM` with `physics_type NEWTON`, `rotation_mode VEL`, velocity mostly −Z ≥ 3 m/s, small elongated instance | particle settings | **rain** |+| … same, slow (< 1 m/s) along −Z, `effector_weights.gravity` ≈ 1, emitter is a thin strip | particle settings | **drips** |+| particles with gravity, short life (< 1.5 s), emissive instance material | settings + material | **sparks** |+| particles with emissive instance, upward velocity, long life | | **embers** |+| particles with ~0 velocity, gravity 0, tiny instance, box emitter | | **dust motes** |+| particles from a small emitter with upward velocity cone, gravity 1, water-like instance (transmission or low roughness) | | **fountain** |+| `NODES` modifier whose tree contains `DISTRIBUTE_POINTS_IN_VOLUME`/`ON_FACES` + `INSTANCE_ON_POINTS` and a `SCENE_TIME` input driving `SET_POSITION` | geometry nodes | rain, dust or drips by the same velocity rules. Sample point positions at two frames to get the velocity |+| Material with drivers/keys on Emission Strength or Color, on a mesh that is a screen (prop name `screen`, `crt`, `monitor`, `tv`, `display`, `sign`) | `animated_materials` | **screen flicker** |+| Light with driver/action on `energy`/`color` | `light_entry.animated` | **light flicker** (sample the curve) |+| Object or material **name** contains a type word (`steam`, `vapor`, `smoke`, `curl`, `haze`, `fog`, `mist`, `flame`, `fire`, `ember`, `spark`, `rain`, `drizzle`, `drip`, `splash`, `dust`, `mote`, `fountain`, `jet`, `flicker`) | names | +2 to that type (tie-breaker, never sufficient alone) |++Also export, per entry:+- `bounds_ue`;+- the emitter shape (box, disc or line from the object's evaluated mesh bounds);+- `preroll_s` from `frame_start < 0` or the fluid `cache_frame_start`;+- the cameras whose frustum contains the bounds;+- the nearest light within 1 m (`light_link`), so fire never double-lights.++For procedural volumes, keep `sample_volume()` but take **8-16 slices**, not 4. Also measure the drift speed by+diffing the mapping-node location driver between two frames, and write the `params` directly.++### 4.2 Schema (JSON Schema 2020-12) for `scene.json → "fx"`++```json+{+ "$id": "anyscene/fx.schema.json",+ "type": "array",+ "items": {+ "type": "object",+ "required": ["id", "type", "confidence", "source", "transform", "bounds_ue", "technique", "params", "time", "seed"],+ "properties": {+ "id": {"type": "string", "pattern": "^[A-Za-z0-9_]+$"},+ "type": {"enum": ["fire", "steam", "smoke", "haze", "haze_plume", "rain", "drips", "splash", "sparks",+ "embers", "dust", "fountain", "screen_flicker", "light_flicker", "unknown"]},+ "confidence": {"type": "number", "minimum": 0, "maximum": 1},+ "source": {"type": "object", "required": ["kind", "objects"], "properties": {+ "kind": {"enum": ["volume_shader", "fluid_domain", "vdb", "particles", "geonodes",+ "animated_emission", "animated_light"]},+ "objects": {"type": "array", "items": {"type": "string"}},+ "material": {"type": ["string", "null"]},+ "evidence": {"type": "array", "items": {"type": "string"}}}},+ "transform": {"type": "object", "required": ["loc", "quat"], "properties": {+ "loc": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3},+ "quat": {"type": "array", "items": {"type": "number"}, "minItems": 4, "maxItems": 4},+ "scale": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3}}},+ "bounds_ue": {"type": "object", "required": ["center", "extent"], "properties": {+ "center": {"type": "array", "items": {"type": "number"}}, "extent": {"type": "array", "items": {"type": "number"}}}},+ "bounds_local": {"type": "object", "properties": {"min": {"type": "array"}, "max": {"type": "array"}}},+ "emitter_shape": {"type": "object", "properties": {+ "kind": {"enum": ["box", "disc", "ring", "line", "plane", "point", "mesh"]},+ "extent_cm": {"type": "array", "items": {"type": "number"}},+ "normal": {"type": "array", "items": {"type": "number"}}}},+ "technique": {"enum": ["niagara", "niagara_flipbook", "niagara_volume_sprite", "svt", "local_fog",+ "height_fog", "material", "sequencer_curve", "skip"]},+ "template": {"type": ["string", "null"], "description": "UE object path, e.g. /AnySceneFX/Systems/NS_Steam.NS_Steam"},+ "params": {"type": "object", "additionalProperties": {"type": ["number", "boolean", "array"]}},+ "param_types": {"type": "object", "additionalProperties": {"enum": ["float", "int", "bool", "vec3", "pos", "color"]}},+ "physical": {"type": "object", "description": "raw Blender-side measurements kept for the look-match pass",+ "properties": {+ "density_per_m": {"type": "number"}, "optical_depth": {"type": "number"},+ "albedo": {"type": "array"}, "anisotropy": {"type": "number"},+ "emission_nits": {"type": "number"}, "emission_color": {"type": "array"}, "temperature_k": {"type": "number"},+ "count": {"type": "integer"}, "lifetime_s": {"type": "array"}, "velocity_cm_s": {"type": "array"},+ "velocity_jitter": {"type": "number"}, "gravity": {"type": "number"}, "size_cm": {"type": "array"},+ "drift_cm_s": {"type": "array"}, "noise_scale_cm": {"type": "number"}}},+ "time": {"type": "object", "required": ["preroll_s", "fps"], "properties": {+ "preroll_s": {"type": "number", "minimum": 0}, "fps": {"type": "number"},+ "start_frame": {"type": "integer"}, "end_frame": {"type": "integer"}, "animated": {"type": "boolean"}}},+ "seed": {"type": "integer", "minimum": 0},+ "flicker": {"type": "object", "properties": {+ "target": {"type": "string"}, "property": {"enum": ["intensity", "emissive_scale", "color"]},+ "fps": {"type": "number"}, "values": {"type": "array", "items": {"type": "number"}}}},+ "flipbook": {"type": "object", "properties": {+ "texture": {"type": "string"}, "grid": {"type": "array"}, "fps": {"type": "number"}, "emissive": {"type": "boolean"}}},+ "vdb": {"type": "object", "properties": {"files": {"type": "string"}, "grids": {"type": "array"}}},+ "cameras": {"type": "array", "items": {"type": "string"}},+ "light_link": {"type": ["string", "null"]},+ "notes": {"type": "array", "items": {"type": "string"}}+ }+ }+}+```+- Units: positions are UE centimetres; velocities are cm/s in UE axes; `extent` is a half-extent in cm; `seed` =+ `crc32(id)`.+- **Ownership.** The exporter fills everything except `technique`, `template` and `params`. A deterministic step+ (`fx_plan.py`, using the decision table in §5.4) fills those three, and the agent may override them.+- `build_level.py` gets a `stage_fx` that dispatches on `technique`. Keep the old `volumes` map for backward+ compatibility, but skip any volume an `fx` entry claims.++---++## 5. Alternatives when Niagara is not the right tool++### 5.1 Flipbooks (SubUV) rendered from the Blender volume++**Best for:** fire, steam puffs and smoke at mid-distance. The look *is* the Cycles shader, with zero tuning of+Niagara colour or density.++How to bake, in a Blender job on the scene copy:+1. Isolate the volume object. Use a transparent film (`film_transparent`) and an orthographic camera fitted to the+ bounds, facing the hero camera's azimuth.+2. Use a black world, plus a neutral key light if the effect is lit (steam). Emissive flames need no light.+3. Render *N* = 64 frames at the scene fps from a steady-state frame. Crossfade the last 16 into the first 16 for a+ loop.+4. Tile 8x8 at 256-512 px per cell. Write RGBA as EXR, or PNG with premultiplied alpha.+5. Export twice for lit effects: an emissive-only pass, and an albedo/alpha pass.+6. Unreal side: `SubImageSize` (8,8) on the sprite renderer, plus a SubUV Animation module whose renderer input+ points at that renderer. Get all three of these right: the grid, the module, and the renderer binding. Any one+ wrong fails **silently**.++Use a flipbook when the camera stays within about 30° of the bake view. Beyond that, sprites rotate visibly; use two+or three bakes at different azimuths, or SVT.++### 5.2 Heterogeneous volumes from VDB (SVT)++**Best for:** hero steam, smoke or fire seen up close or from moving cameras. This is the real 3D density and is the+closest match to Cycles.++**Mantaflow domains.** `cache_data_format = OPENVDB` already writes `cache/data/fluid_data_####.vdb`. Re-save only+the `density`, `flame` and `temperature` grids, or the default mapping packs velocity components into attributes B.++**Procedural shader volumes** (HK steam, MC curls):+1. Sample the material on a 3D grid. Extend `sample_volume` to bake Z slices at 64-128 slices.+2. For animation, repeat per frame for 48-96 frames.+3. Write `.vdb` with Blender's bundled `openvdb` module: `openvdb.FloatGrid`, `copyFromArray`,+ `openvdb.write(path, grids)`.+4. Name the grids `density`, plus `emission` or `temperature`.++**Import into Unreal.**+- Use an `AssetImportTask` on the first file of the numbered sequence. In a commandlet the factory takes the+ unattended path and imports the sequence as an **animated SVT**.+- Optionally pass a `UOpenVDBImportOptionsObject` as `task.options` to control the grid mapping.+- The `InterchangeOpenVDB` plugin is disabled by default. The legacy SVT factory does not need it.++**Render.**+- Spawn `unreal.HeterogeneousVolume`. Its `heterogeneous_volume_component` takes a Volume-domain material that samples+ the SVT (start from `/NiagaraFluids/Materials/Grid3D/Instances/MI_HeterogeneousVolumes_Basic`).+- Animation fields on the component: `frame`, `frame_rate`, `start_frame`, `end_frame`, playing and looping.+- Lighting fields: `step_factor`, `shadow_step_factor`, `lighting_downsample_factor`.+- Map Blender density σ (1/m) to material extinction: σ ÷ 100 per cm, if the material works in world units. Calibrate+ once against a Cycles render of a test cube.++**Cvars.**+- `r.HeterogeneousVolumes 1` (default on).+- `r.HeterogeneousVolumes.Shadows 0` by default: turn it on for self-shadowing steam.+- `r.HeterogeneousVolumes.IndirectLighting 0` by default.+- `r.HeterogeneousVolumes.MaxStepCount 512`.+- `r.HeterogeneousVolumes.Composition 0`: draws before translucency. All *[engine: HeterogeneousVolumes.cpp]*.++**Cost.** Several ms per volume at 1440p. Fine for MRQ, too heavy for a real-time budget unless+`DownsampleFactor` = 2.++### 5.3 Fog for haze++- **Room or street haze** (homogeneous layers, or a large box with gentle noise): Exponential Height Fog plus+ volumetric fog, as `build_level.py` already does.+- **Local layers** (MC ceiling layer, under-awning haze): Local Fog Volumes. Fix §0.2 as follows.+ - Scale = (max box half-extent in cm) ÷ 500.+ - It is a sphere: a long flat box needs several LFVs tiled along its long axis, or height-fog mode+ (`height_fog_extinction`, `height_fog_falloff`, `height_fog_offset`).+ - `radial_fog_extinction` = σ x 2r (m), the optical depth through the centre.+ - `fog_emissive` is luminance: σ_e x 683 nits.+- **Never use an LFV for a flame or a plume.** It cannot move, and its shape is a sphere.++### 5.4 Decision table (per effect)++| Type | Default technique | Use instead when |+|---|---|---|+| fire | `niagara_flipbook` (NS_Fire, flame baked from Blender) | close-up hero, camera moves around it, long shot → `svt` (bake VDB 64 frames) or `Grid3D_Gas_Fire`; tiny candle → unlit sprite, no flipbook |+| steam | `niagara` (NS_Steam lit sprites) + volume-sprite core if volumetric fog is on | Mantaflow cache present, or a hero close-up → `svt`; distant/static → `niagara_flipbook` |+| smoke | curls → `niagara` ribbons; plumes → as steam | — |+| haze | `height_fog` / `local_fog` | visible moving wisps in a light beam → `niagara_volume_sprite` |+| haze_plume | `niagara_volume_sprite` | static in all shots → `local_fog` (fixed size rule) |+| rain | `niagara` (NS_Rain) | only seen through glass far away → material streaks on a card |+| drips / splash | `niagara` (NS_Drips) | ground ripples → animated decal / puddle material |+| sparks / embers | `niagara` | — |+| dust | `niagara` (NS_DustMotes) | — |+| fountain | `niagara` (NS_FountainJet) | Mantaflow liquid cache → Alembic mesh sequence (outside this doc; flag it) |+| screen_flicker / light_flicker | `material` / `sequencer_curve` | — |++---++## 6. Verification loop: did the effect land?++1. **Build.** Run `stage_fx` and save. The build report records, per effect: id, technique, template, user params+ read back (`get_variable_*` valid flags), and fixed bounds read back. Any invalid param is an error, not a warning.+2. **Render.**+ - Render MRQ stills from **every camera in the effect's `cameras`**:+ `render_mrq.ps1 -Cams ...`, with `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Use the **same frame number** as the Cycles still: the exporter's `--frame`, minus the sequence start.+ - For motion, render 24-frame clips of the effect cameras (`custom_end_frame = 24`).+ - Render twice with identical settings to check determinism: the two images' absolute difference should be ~0+ outside the TSR noise floor.+3. **Compare against Cycles.**+ - Use `side_by_side.py`. Compare in the same view transform: use `MRQ_Linear` EXR + Blender AgX, as the pipeline+ already does.+ - For each effect, crop its projected `bounds_ue` box in both images, then compare:+ - **coverage**: the fraction of crop pixels changed vs a render with the effect hidden; render one "FX off"+ still per camera;+ - **mean luminance** and the **99th-percentile luminance** inside the crop, for emissive effects;+ - **contrast and transmission**: background visibility through steam or haze;+ - hue of emissive effects;+ - for rain, streak count, length and angle.+4. **What to look for.**+ - The effect missing entirely: compile, bounds culling, wrong asset, or warm-up.+ - Popping-in in clips: warm-up too short.+ - A box-shaped cut-off: fixed bounds too small.+ - Sharp steam in a blurred foreground: the TranslucencyPass.+ - Black or flat steam: unlit, or no light behind it.+ - Fire that lights nothing, or double lighting: `light_link`.+ - Rain invisible: sprite under a pixel, so check the `PixelCoverageMode` and the width floor.+ - Stepping between frames: the age mode.+ - A sphere-shaped haze blob: the LFV rule.+5. **Adjustment rules.** Change one parameter per round, at most three rounds per effect, and log each round in the+ build report.+ - Coverage too low → raise `SizeMax` first (x1.3), then `SpawnRate` (x1.5). Too high → the reverse order.+ - Too opaque or too faint at matched coverage → scale `Opacity` by `ln(1−T_cycles)/ln(1−T_ue)` (T =+ transmission).+ - Emissive brightness → scale `Intensity` by `L99_cycles / L99_ue`, clamped to x[0.25, 4] per round.+ - Wrong height or reach → `LifetimeMax` (plumes) or `Velocity.z`; keep `Velocity x Lifetime` = the measured Cycles+ reach.+ - Wrong lean → `Wind`.+ - Rain too dense or sparse → `SpawnRate` by the streak-count ratio; streaks too short → the stretch factor+ (speed x shutter), not velocity.+ - After three rounds without converging, switch technique (§5.4 "use instead") and note why in `notes`.++---++## 7. Known gotchas (with sources)++| Gotcha | Fix | Source |+|---|---|---|+| GPU particles absent or frozen in MRQ warm-up | `render_warm_up_frames = True`; engine warm-up alone doesn't run GPU sims | `MoviePipelineAntiAliasingSetting.h` tooltip *[engine]*; Epic MRQ docs |+| `engine_warm_up_count` ignored | `use_camera_cut_for_warm_up = False` (it's EditCondition-gated) | same header |+| Effect missing on the first frames of an offscreen run | `fx.Niagara.ForceWaitForCompilationOnActivate=1` + `Editor.AsyncAssetCompilation=0` | `NiagaraComponent.cpp:112, 1358` *[engine]*; `render_shots.py` notes |+| Nothing renders or compiles in `-run=pythonscript` | expected: null RHI unless `-AllowCommandletRendering`; render in the `-game` pass | `LaunchEngineLoop.cpp:2246` *[engine]* |+| User param silently ignored | exact name + exact type; read back with `get_variable_*` and check the valid flag; set the asset before params (`set_asset` resets overrides) | `NiagaraComponent.cpp:4376, 4620` *[engine]*; NiagaraToolsets `blueprint_interop` skill |+| Effect culled when its origin leaves the view | fixed bounds covering the whole travel; GPU emitters can't use dynamic bounds | `NiagaraSystem.h:1052`; NiagaraToolsets `optimization` skill |+| Effect dropped at distance or by budget | `set_allow_scalability(False)`; `MoviePipelineGameOverrideSetting` | `NiagaraComponent.h` *[engine]* |+| Different particles every run | system + emitter `bDeterminism`, a fixed `RandomSeedOffset`, fixed MRQ warm-up; sim cache for bit-exact results | `NiagaraSystem.h:1073-1085` *[engine]* |+| Translucent FX sharp in defocused areas | material `TranslucencyPass = MTP_BeforeDOF` (default is AfterDOF) | `Material.h:142`, `Material.cpp:1183` *[engine]* |+| Sprite motion blur smears or vanishes | rely on MRQ temporal samples (8); renderer `MotionVectorSetting` Precise for fast sparks, Disable for steam; post-process motion blur is off in the converter (`motion_blur_amount 0`) | `NiagaraRendererProperties.h:480` *[engine]* |+| Thin rain or sparks flicker or disappear under TSR | `PixelCoverageMode` Automatic (project setting enabled) and a width floor; velocity-aligned streaks | `NiagaraSpriteRendererProperties.h` *[engine]* |+| Fire doesn't light the set; Lumen ignores emissive sprites | real lights (Blender practicals or one Light-renderer particle); Niagara lights are CPU-only and shadowless unless MegaLights (`bAllowMegaLights`, `bMegaLightsCastShadows`) | `NiagaraLightRendererProperties.h:62-110` *[engine]*; NiagaraToolsets `renderers` skill |+| Particle lights invisible in fog | light needs volumetric scattering intensity > 0 | *[docs: Volumetric Fog]* |+| Lit translucency looks flat or blotchy | it's the translucency lighting volume; use Volumetric NonDirectional, keep sprites large and soft | Lumen translucency behaviour *[docs]* |+| SubUV shows the whole atlas | renderer `SubImageSize` + a SubUV module + its renderer binding | NiagaraToolsets `renderers` skill |+| Local fog volume 5x too big / spherical | base radius 500 cm; uniform max-axis scale; extinction = optical depth through the centre | `LocalFogVolumeComponent.h:74`, `LocalFogVolumeCommon.ush:178-203` *[engine]* |+| VDB import pops a dialog | not in a commandlet or with automated tasks; numbered files become an animated SVT | `SparseVolumeTextureFactory.cpp:436` *[engine]* |+| Blender motion blur on volumes | irrelevant in UE, but the Cycles reference frames have no volume blur (object blur off on volume boxes); don't add any in UE either | HK `fx.py`, `SKILL.md` §11 |++**Sources.**+- Installed engine files:+ - `Engine/Plugins/FX/Niagara/Source/Niagara/{Public/NiagaraComponent.h, Public/NiagaraActor.h,+ Public/NiagaraFunctionLibrary.h, Classes/NiagaraSystem.h, Classes/NiagaraEmitter.h,+ Public/NiagaraLightRendererProperties.h, Public/NiagaraSpriteRendererProperties.h, Public/NiagaraCommon.h,+ Public/MovieScene/MovieSceneNiagaraSystemSpawnSection.h, Classes/NiagaraSimCacheFunctionLibrary.h,+ Private/NiagaraComponent.cpp, Private/NiagaraSystemInstance.cpp}`+ - `Engine/Plugins/FX/{NiagaraFluids, NiagaraMRQ, NiagaraSimCaching}`+ - `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (tools + `Content/Python/skills`)+ - `Engine/Plugins/Experimental/ToolsetRegistry`+ - `Engine/Plugins/MovieScene/MovieRenderPipeline/.../MoviePipelineAntiAliasingSetting.h`+ - `Engine/Source/Runtime/Engine/Classes/Components/{HeterogeneousVolumeComponent.h, LocalFogVolumeComponent.h}`+ - `Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp`+ - `Engine/Shaders/Private/LocalFogVolumes/LocalFogVolumeCommon.ush`+ - `Engine/Source/Editor/SparseVolumeTexture/Private/SparseVolumeTextureFactory.cpp`+ - `Engine/Source/Runtime/Engine/Public/Materials/Material.h`+ - `Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp`+- Epic docs:+ - [Volumetric Fog](https://dev.epicgames.com/documentation/en-us/unreal-engine/volumetric-fog-in-unreal-engine)+ - [Rendering your Niagara systems (MRQ)](https://dev.epicgames.com/documentation/unreal-engine/rendering-your-niagara-systems)+ - [NiagaraMRQ API](https://dev.epicgames.com/documentation/unreal-engine/API/PluginIndex/NiagaraMRQ)+ - [MoviePipelineAntiAliasingSetting (Python API)](https://api.unrealengine.com/INT/PythonAPI/class/MoviePipelineAntiAliasingSetting.html)+- AnyScene:+ - `scenes/hk-dai-pai-dong/scripts/{fx.py, lights.py, steam.py}`, `NOTES.md`+ - `scenes/mission-control-1970s/scripts/haze.py`+ - `SKILL.md` §11, `builder/CRAFT.md`diff --git a/unreal/TOGGLE.md b/unreal/TOGGLE.mdnew file mode 100644index 0000000..ccde400--- /dev/null+++ b/unreal/TOGGLE.md@@ -0,0 +1,155 @@+# TOGGLE.md: an `unreal` option on `/ref2scene`, and `/scene2unreal`++Design note. Nothing here is implemented yet. It builds on `unreal/export_blend.py`, `unreal/build_level.py`,+`unreal/render_mrq.ps1`, `unreal/perf.ps1` and `unreal/NIAGARA.md`, and on `builder/app.py`+(`SceneBuilderApp`, `BuildRequest`, `_build_and_shoot`).++## 1. API++### 1a. Toggle on `/ref2scene` (and its `/build` alias)++Add one optional field to `BuildRequest`. Like `shots`, it stays **out of the build fingerprint** (`fp` in `_build`),+so one Blender build serves any number of Unreal conversions.++```python+class UnrealOptions(BaseModel):+ enabled: bool = Field(True, description="Convert the passed build into an Unreal 5.8 level.")+ cameras: list[str] = Field(default_factory=list, description="Cameras to render MRQ stills from (default: every scouting camera in shots.json).")+ fx: bool = Field(True, description="Port effects (flames, steam, rain, ...) per NIAGARA.md. False: static fog only.")+ look_match_rounds: int = Field(2, description="Agent look-match passes against the Cycles frames (0 = deterministic conversion only).")+ package: str = Field("plugin", description="plugin: a UE content plugin zip (drop into any 5.8 project). uproject: a full project zip. both.")+ still_res: list[int] = Field([1920, 1080], description="MRQ still resolution (W, H).")+ clip_frames: int = Field(0, description="Also render N-frame MRQ clips per camera (0 = stills only).")+ perf: bool = Field(True, description="Run the real-time perf capture (CSV profiler, GPU memory) at perf_res.")+ perf_res: list[int] = Field([2560, 1440])+ gpu_budget_ms: float = Field(16.6, description="Real-time frame budget the perf report grades against.")++class BuildRequest(BaseModel):+ ...+ unreal: UnrealOptions | None = Field(None, description="Optional: once the build passes its critic, convert it to Unreal.")+```++Add to `BuildResponse`: `unreal_job: dict | None`, holding status, `request_id` and an error if any, with the same+shape as `shots_job`. Add `unreal: UnrealResult | None` (§3).++### 1b. Standalone `/scene2unreal`++`SceneUnrealRequest = {build_id: str, **UnrealOptions, fresh: bool = False, effort: str = "medium"}`.+- It runs on any finished build in `/data/anyscene/builder/<build_id>`.+- It is retry-safe the same way `_build` is: an index keyed by `sha256(build_id + options)` and an `.alive`+ heartbeat.+- `/ref2scene` with `unreal` set calls it **after** `_build`, exactly like `_anyshot`.+- Run it as a **separate fal app** (`anyscene-unreal`) on a UE container. The builder image stays Blender-only, and+ the UE image (about 40 GB with DDC) only starts when someone asks for Unreal. The builder forwards the order with+ `fal_client` and relays the stage lines, as `call_anyshot` does.++## 2. What runs after the critic passes++The gate is the same as for shots: `res.critiques[-1]["passed"] and res.scene_blend_url`.++| # | Stage | Where | Deterministic? |+|---|---|---|---|+| 1 | **Export**: `blender -b <copy> --python export_blend.py -- --out exp/ --gpu --grade-sh ... --frame <hero frame>`, sharded (§5), then a merge pass writes `scene.json` incl. `fx` (NIAGARA.md §4) and the flipbook / VDB bakes the FX plan asks for | builder GPU worker (has Blender + OptiX cache) or the UE worker if Blender is installed there | yes |+| 2 | **FX plan**: `fx_plan.py` fills `technique / template / params` per `fx` entry from the NIAGARA.md decision table | either | yes (rules); entries with `confidence < 0.6` are queued for the agent |+| 3 | **UE build**: `UnrealEditor-Cmd AnySceneUE.uproject -run=pythonscript -script=build_level.py` (stages textures, meshes, materials, level, fx, sequences) on a **Linux GPU container** with the AnySceneFX plugin preinstalled and a persistent DDC on `/data` | UE worker | yes |+| 4 | **Shader warm**: one `-game -RenderOffscreen` run of the level with `fx.Niagara.ForceWaitForCompilationOnActivate=1` and `Editor.AsyncAssetCompilation=0` to fill the DDC (skipped when DDC is warm) | UE worker | yes |+| 5 | **MRQ stills** per camera (`MRQ_Still` + `MRQ_Linear`), plus clips if requested | UE worker | yes, given a fixed seed and warm-up |+| 6 | **Look-match pass** (agent): compare against the Cycles stills (`side_by_side.py`, crops per `fx` bounds, exposure, fog), adjust **parameters only** (exposure offset, fog density, FX user params, light scale) with the NIAGARA.md §6 rules, rebuild only the `level`/`fx` stages, re-render; `look_match_rounds` times | UE worker + Claude | agent-judged, logged as a param diff |+| 7 | **Perf**: `perf.ps1`-equivalent `-game -RenderOffscreen` with `csvprofile`, `nvidia-smi` sampling | UE worker | measured |+| 8 | **Package**: `Plugins/AnyScene_<build>/Content/...` (+ `.uplugin`) zip; optionally the whole `.uproject` minus `Intermediate/`, `Saved/`, `DerivedDataCache/` | UE worker | yes |++**Linux notes.**+- The Linux editor renders through Vulkan (SM6). `-RenderOffscreen` works without a display. Install the Vulkan ICD+ from the NVIDIA container toolkit (`NVIDIA_DRIVER_CAPABILITIES=all`, as the builder Dockerfile already sets).+- Lumen with hardware ray tracing on Vulkan needs a recent driver. Fall back to `r.Lumen.HardwareRayTracing 0` and+ record which mode the render used.+- Swap the Windows `.ps1` wrappers for Python `subprocess` callers. `render_mrq.ps1` and `perf.ps1` are thin.+- Validate on Linux once against the Windows reference box before trusting look-match numbers. Vulkan vs D3D12+ shading differences are small but non-zero. *[untested]*++## 3. Outputs (`UnrealResult`)++```json+{+ "package_url": "...AnyScene_b_xxxx_plugin.zip",+ "uproject_url": "... (optional)",+ "stills": [{"camera": "cam_street", "ue": "...png", "ue_linear": "...exr", "cycles": "...png", "side_by_side": "...png"}],+ "clips": [],+ "look_match": {"rounds": 2, "changes": [{"round": 1, "target": "fx:steam_wok_0", "param": "Opacity", "from": 0.12, "to": 0.18, "why": "transmission 0.71 vs 0.58"}]},+ "fx": [{"id": "steam_wok_0", "type": "steam", "technique": "niagara", "template": "/AnySceneFX/Systems/NS_Steam", "status": "ok"}],+ "perf": {"res": [2560, 1440], "gpu_ms_p50": 0, "gpu_ms_p95": 0, "frame_ms_p95": 0, "gpu_mem_delta_mb": 0, "draw_calls": 0, "verdict": "within budget|over budget"},+ "build_report": "...build_report.json",+ "warnings": [],+ "minutes": {"export": 0, "ue_build": 0, "mrq": 0, "look_match": 0, "total": 0}+}+```++## 4. Time and cost (from the HK run: 627 meshes)++| Stage | HK today (serial) | With §5 sharding | Notes |+|---|---|---|---|+| Blender export (bake + GLB) | ~35 min | ~6-9 min | about 3.3 s per unique mesh; scales with unique meshes, not instances |+| FX bakes (flipbooks / VDB) | n/a | +2-6 min | only for `niagara_flipbook` / `svt` entries; runs in parallel with the mesh shards |+| UE build (import + level) | ~15 min | ~10-15 min | import-bound; Interchange is already batched by 16; FX stage adds < 1 min |+| Shader warm (cold DDC) | ~3-5 min | 0-5 min | ~0 once `/data` DDC is warm for the templates and master materials |+| MRQ stills | ~1 min/still | ~1 min/still | 3 cameras x (1 + rounds) with rounds = 2 → 9 stills ≈ 9 min (or ~45 s each when batched in one process instead of one per camera) |+| Look-match agent | n/a | ~3-5 min/round of thinking + rebuild (`level,fx` stages ≈ 1-2 min) | |+| Perf capture | n/a | ~2 min | 900 frames + startup |+| **Total** | **~55 min + stills** | **~30-40 min** | |++**Cost** = GPU-minutes x the fal machine rate, plus agent tokens.+- GPU time is about 35 GPU-minutes on the parallel path.+- The export shards are CPU-heavy. Bakes can use `--gpu` (OptiX) on the builder's own GPU. Run the export on the+ builder worker that already holds the scene, and hand only `exp/` (GLBs + PNGs, roughly 1-3 GB for HK) to the UE+ app through `/data`.+- Agent tokens apply only to look-match rounds and to low-confidence FX entries: roughly one Claude session of about+ 15-30 tool calls per round.+- With `look_match_rounds = 0` the job is purely deterministic and costs only GPU time.++## 5. Parallelizing the slow export++The export is embarrassingly parallel per unique mesh. Bakes are independent, and existing outputs are skipped+(rerunnable).++1. **Plan pass.** One quick Blender process classifies the objects and writes `export_plan.json`: the list of asset+ keys with estimated bake pixels (area x density). It does no baking.+2. **Shards.** Run *N* Blender processes on copies of the `.blend`, each started with `--shard i/N`. This is a new+ flag: keep `keys[k]` where `k % N == i`, after sorting by estimated cost and dealing round-robin, so shards+ balance. Each shard bakes into the shared `tex/` and `mesh/` directories.+ - Today's `--reverse` and `--only` already show that two processes can share the folder safely.+ - Pick *N* = min(CPU cores ÷ 4, 8) for CPU bakes. With `--gpu`, run 2-3 processes per GPU, since OptiX bakes are+ short and the time goes into Blender overhead.+3. **Merge pass.** One process with `--no-bake`. Every texture and GLB already exists, so it only writes+ `scene.json`, lights, cameras, world, grade and `fx`. This also removes the partial-`scene.json` merge+ (`ONLY`/`LIMIT` branch) from the hot path.+4. **Cache across builds.** Key `tex/` and `mesh/` by a hash of (evaluated mesh data + material node trees + bake+ settings). The same prop library recurs across scenes, and a retry of `/scene2unreal` re-bakes nothing.+5. **FX bakes** (flipbook renders, VDB sampling) are extra shards, scheduled first because they are the longest+ single jobs.++The UE side can overlap with the export. Start texture import of finished shards while the others are still baking:+the `textures` stage is rerunnable and skips assets that exist. Mesh import order does not matter.++## 6. Deterministic vs agent-judged++**Deterministic.** Same input gives the same output, so these steps are cacheable and testable.+- Everything in `export_blend.py`, and the fx classification scores.+- `fx_plan.py` technique and parameter mapping (NIAGARA.md §3-5).+- `build_level.py`.+- Seeds: `RandomSeedOffset = crc32(fx id)`.+- Warm-up counts.+- MRQ settings.+- Packaging.+- Perf numbers (measured, so noisy within ±5%).++**Agent-judged.** Logged as explicit parameter diffs, bounded by `look_match_rounds`.+- Low-confidence fx classification (< 0.6), including `unknown` entries.+- Switching technique when a parameter-only match fails after three rounds (NIAGARA.md §6.5).+- Exposure and fog calibration offsets.+- FX user-parameter tuning.+- Light scale tweaks.+- The final "does it read like the Cycles frame" verdict, which goes into the response next to the side-by-sides.++**Rule.** The agent never edits `build_level.py`, `export_blend.py` or templates during a job. It writes overrides to+`exp/overrides.json`, which `build_level.py` applies on top of `scene.json`. A rerun with the same overrides+reproduces the agent's result exactly.diff --git a/unreal/agx_view.py b/unreal/agx_view.pynew file mode 100644index 0000000..870bf9e--- /dev/null+++ b/unreal/agx_view.py@@ -0,0 +1,19 @@+"""Apply a Blender view transform (default AgX + the scene's look) to Unreal scene-linear EXRs (MRQ_Linear output),+so UE and Cycles frames can be compared through the same tone mapper.+ blender -b --factory-startup --python agx_view.py -- <in.exr> <out.png> [look] [exposure]+"""+import sys+import bpy++a = sys.argv[sys.argv.index("--") + 1:]+src, dst = a[0], a[1]+look = a[2] if len(a) > 2 else "AgX - Medium High Contrast"+expo = float(a[3]) if len(a) > 3 else 0.0+sc = bpy.context.scene+sc.view_settings.view_transform = "AgX"+sc.view_settings.look = look+sc.view_settings.exposure = expo+sc.render.image_settings.file_format = "PNG"+img = bpy.data.images.load(src)+img.save_render(dst, scene=sc)+print("AGX", src, "->", dst, flush=True)diff --git a/unreal/build_level.py b/unreal/build_level.pynew file mode 100644index 0000000..03dc2d0--- /dev/null+++ b/unreal/build_level.py@@ -0,0 +1,1517 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,spawn,fx,sequences (default: all; "lighttex" is part of+ textures: gobo images and IES profiles)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_MESH_BATCH Interchange imports in flight per wait (default 16; lower it when memory is tight)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)+ ANYSCENE_COLLIDE_MIN_CM props smaller than this (largest dimension, cm) get no collision (default 25)+ ANYSCENE_PLAYERSTART "keep" = the spawn stage leaves an existing PlayerStart alone (collision only)+ ANYSCENE_HERO PlayerStart camera (alias ANYSCENE_HERO_CAM); default the .blend's active camera, then cam_street+ ANYSCENE_LOOK JSON {"pp": {...}, "light": {...}} overriding the real-time look settings (LOOK below)+ ANYSCENE_FX_TYPES Niagara effect types to place (default "steam,fire,rain"; "all" = every classified type, see NIAGARA.md)+ ANYSCENE_FX_OVERRIDES optional JSON {fx id | "type:<type>": {UserParam: value}} applied on top of scene.json fx params+ (look-match tuning; TOGGLE.md "overrides.json")+ ANYSCENE_CLIP_FRAMES length of the MRQ_Clip config and of every camera sequence (default 96 = 4 s at 24 fps)+ ANYSCENE_DOLLY "camA>camB:frames[:name]" (or "camA>fwd150:frames") ;-separated: extra moving-camera sequences+ ANYSCENE_MRQ_RES WxH for the MRQ configs (default the scene's render resolution)+ ANYSCENE_MRQ_OUT MRQ output folder (default <export>/../compare/mrq)+ ANYSCENE_REPORT build report path (default <export>/build_report.json)++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,spawn,fx,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+MESH_BATCH = int(os.environ.get("ANYSCENE_MESH_BATCH", "16")) # Interchange imports in flight per wait (memory)+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))+FX_OVR = json.load(open(os.environ["ANYSCENE_FX_OVERRIDES"])) if os.environ.get("ANYSCENE_FX_OVERRIDES") else {}+CLIP_FRAMES = int(os.environ.get("ANYSCENE_CLIP_FRAMES", "96"))+# Niagara effect types the fx stage places (light flicker is always keyed). Steam, fire (round-2 pack) and rain are+# verified in renders; drips, dust, sparks, smoke and fountain stay opt-in until a scene verifies them ("all" = every+# type). See CHANGELOG.md "Fx: fire and rain on by default".+FX_TYPES = set(x for x in os.environ.get("ANYSCENE_FX_TYPES", "steam,fire,rain").split(",") if x)+# Real-time look settings written into every level (grade post-process volume and lights), so they travel with the+# level into any project. ANYSCENE_LOOK='{"pp": {...}, "light": {...}}' overrides single keys (calibration runs).+LOOK = {+ "pp": {+ # Mirror-quality Lumen reflections on the front glass layer (otherwise only the blurry radiance cache).+ "lumen_front_layer_translucency_reflections": True,+ # Tight interiors: small props (cups, bottles, stools) get Lumen cards and occlude GI; fewer final gather+ # leaks and less noise in corners. Defaults are 1.0.+ "lumen_scene_detail": 2.0,+ "lumen_final_gather_quality": 2.0,+ },+ "light": {},+ # Glass (master_glass / glass_params): share of (IOR - 1) used as screen-space refraction on solid glass, and+ # the translucency pass ("before_dof" | "after_dof").+ "glass": {"refraction_scale": 0.35, "pass": "before_dof"},+}+# Blender AgX looks (datafiles/colormanagement/config.ocio): GradingPrimary, log style, contrast around middle grey+# + saturation. UE's ColorContrast is the same operation (pow(x / 0.18, c) in scene linear, before the tone curve).+# UE's default filmic curve already matches AgX *High Contrast* (fitted on a grey ramp, -5..+2.5 stops: best UE+# contrast 0.99, rms 2/255), so each look maps to contrast c_look / 1.4 (Base 0.71, Medium High 0.86, Very High 1.12;+# every fit within ~2/255). Base Contrast scenes were rendered ~40% too contrasty before.+AGX_LOOKS = {"Very High Contrast": (1.57, 0.9), "High Contrast": (1.4, 0.95), "Medium High Contrast": (1.2, 1.0),+ "Base Contrast": (1.0, 1.0), "None": (1.0, 1.0), "Medium Low Contrast": (0.9, 1.05),+ "Low Contrast": (0.8, 1.1), "Very Low Contrast": (0.7, 1.15)}+UE_FILMIC_AGX_CONTRAST = 1.4+for _k, _v in json.loads(os.environ.get("ANYSCENE_LOOK", "{}")).items():+ LOOK[_k].update(_v)++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ # 4K bakes: without a GC per chunk the commandlet held every imported texture and ran out of memory+ # (~550 of 796 on a 32 GB box shared with other editors).+ unreal.SystemLibrary.collect_garbage()+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ # A crash inside a chunk leaves imported textures without their settings: re-check the linear channels.+ fixed = 0+ lin = [(ch, tex_path(os.path.splitext(os.path.basename(rel))[0])) for a in ASSETS for ch, rel in a.get("tex", {}).items() if ch in ("orm", "normal")]+ for k, (ch, p) in enumerate(lin):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if not d.is_valid():+ continue+ tx = d.get_asset()+ if tx and tx.get_editor_property("srgb"):+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS if ch == "orm" else unreal.TextureCompressionSettings.TC_NORMALMAP)+ if ch == "normal":+ tx.set_editor_property("flip_green_channel", True)+ EAL.save_loaded_asset(tx, False)+ fixed += 1+ if k % 64 == 63:+ unreal.SystemLibrary.collect_garbage()+ if fixed:+ log(f"textures: fixed settings on {fixed} linear textures")+ stage_light_textures()+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++def gobo_tex_path(rel):+ return f"{DEST}/Gobo/{os.path.splitext(os.path.basename(rel.replace(chr(92), '/')))[0]}"+++def ies_path(rel):+ return f"{DEST}/IES/{os.path.splitext(os.path.basename(rel.replace(chr(92), '/')))[0]}"+++def stage_light_textures():+ """Gobo images (linear grayscale, wrapping) and IES profiles (TextureLightProfile) referenced by the lights."""+ gobos, ies = {}, {}+ for L in scene["lights"]:+ for lay in (L.get("gobo_fx") or {}).get("layers", []):+ gobos[gobo_tex_path(lay["image"])] = lay+ if L.get("ies_file"):+ ies[ies_path(L["ies_file"])] = L["ies_file"]+ todo = [os.path.join(EXPORT, lay["image"]) for p, lay in gobos.items() if not EAL.does_asset_exist(p)]+ if todo:+ import_files(todo, f"{DEST}/Gobo")+ for p, lay in gobos.items():+ tx = EAL.load_asset(p)+ if tx is None:+ warn(f"gobo import failed {lay['image']}")+ continue+ lin = lay.get("colorspace", "Non-Color") in ("Non-Color", "Linear Rec.709", "Raw")+ tx.set_editor_property("srgb", not lin)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_GRAYSCALE)+ wrap = unreal.TextureAddress.TA_WRAP if lay.get("extension", "REPEAT") == "REPEAT" else unreal.TextureAddress.TA_CLAMP+ tx.set_editor_property("address_x", wrap)+ tx.set_editor_property("address_y", wrap)+ tx.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_EFFECTS)+ EAL.save_loaded_asset(tx, False)+ todo = [os.path.join(EXPORT, f) for p, f in ies.items() if not EAL.does_asset_exist(p)]+ if todo:+ import_files(todo, f"{DEST}/IES")+ for p, f in ies.items():+ prof = EAL.load_asset(p) if EAL.does_asset_exist(p) else None+ if prof is None:+ warn(f"IES import failed {f}")+ continue+ EAL.save_loaded_asset(prof, False) # import tasks run with save=False+ log(f"light textures: {len(gobos)} gobo images, {len(ies)} IES profiles")+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % MESH_BATCH == MESH_BATCH - 1 or i == len(todo) - 1:+ flush(a)+ unreal.SystemLibrary.collect_garbage()+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked(masked=False):+ """M_AnyBaked (opaque) or M_AnyBakedMasked: same graph, opacity mask = ORM.R (baked Principled Alpha)."""+ name = "M_AnyBakedMasked" if masked else "M_AnyBaked"+ path = f"{DEST}/Materials/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset(name, f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ if masked:+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_MASKED)+ # (MaterialExpressionDitherTemporalAA is not exposed to Python in 5.8: plain clip.)+ m.set_editor_property("opacity_mask_clip_value", 0.33)+ MEL.connect_material_property(orm, "R", unreal.MaterialProperty.MP_OPACITY_MASK)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_asset(name, version=1):+ """Get or create a master material. Returns (material, build): build is True when the graph must be (re)made.+ A master whose AnySceneVersion tag is older than `version` is rebuilt in place (all expressions deleted), so+ the instances and meshes that reference it keep working; untagged masters count as version 1."""+ path = f"{DEST}/Materials/{name}"+ if EAL.does_asset_exist(path):+ m = EAL.load_asset(path)+ if int(EAL.get_metadata_tag(m, "AnySceneVersion") or 1) >= version:+ return m, False+ MEL.delete_all_material_expressions(m)+ log(f"{name}: rebuilding master in place (v{version})")+ else:+ m = AT.create_asset(name, f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ EAL.set_metadata_tag(m, "AnySceneVersion", str(version))+ return m, True+++GLASS_VERSION = 2 # bump when the graph changes: older masters are rebuilt in place+++def master_glass():+ """Thin-translucent glass (legacy shading, no Substrate needed): a Fresnel-weighted specular layer (lit, with+ Lumen front-layer reflections) over a coloured transmittance that tints what is behind it, like Cycles'+ transmission. The old diffuse-lit translucent master read as milky plastic: white glass took light like paint.+ Transmittance colour per pass (Blender glass colour); thicker at grazing angles (1/NoV)+ Specular F0 / 0.08 from the IOR (0.5 at IOR 1.5)+ Roughness Blender roughness; Lumen blurs the reflection, the background stays sharp (no transmission blur)+ Opacity frost layer coverage: 0 for clear glass, up to ~0.35 for rough glass (FrostColor, diffuse-lit)+ Refraction IOR for solid glass (water glasses, bottles, domes); 1 = none for thin panes and windows"""+ m, build = master_asset("M_AnyGlass", GLASS_VERSION)+ if not build:+ return m+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_THIN_TRANSLUCENT)+ # Thin translucency requires "Surface ForwardShading", which is TLM_SURFACE_PER_PIXEL_LIGHTING in Python+ # (TLM_SURFACE is "Surface TranslucencyVolume": the master then fails to compile and renders as the grey default).+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ m.set_editor_property("refraction_method", unreal.RefractionMode.RM_INDEX_OF_REFRACTION)+ # Before DOF (the 5.8 default is after): glass in a defocused plane blurs with what is behind it (macro shots).+ tpass = {"before_dof": unreal.MaterialTranslucencyPass.MTP_BEFORE_DOF, "after_dof": unreal.MaterialTranslucencyPass.MTP_AFTER_DOF}+ for k, v in (("allow_front_layer_translucency", True), ("translucency_pass", tpass[LOOK["glass"]["pass"]])):+ try:+ m.set_editor_property(k, v)+ except Exception as ex: # noqa: BLE001+ warn(f"M_AnyGlass: {k}: {ex}")++ def p(cls, name, v, y):+ n = MEL.create_material_expression(m, cls, -500, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("default_value", v)+ return n+ tr = p(unreal.MaterialExpressionVectorParameter, "Transmittance", unreal.LinearColor(1, 1, 1, 1), 0)+ fc = p(unreal.MaterialExpressionVectorParameter, "FrostColor", unreal.LinearColor(0.8, 0.8, 0.8, 1), -200)+ r = p(unreal.MaterialExpressionScalarParameter, "Roughness", 0.02, 200)+ sp = p(unreal.MaterialExpressionScalarParameter, "Specular", 0.5, 300)+ o = p(unreal.MaterialExpressionScalarParameter, "Opacity", 0.0, 400)+ rf = p(unreal.MaterialExpressionScalarParameter, "Refraction", 1.0, 500)+ MEL.connect_material_property(fc, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(sp, "", unreal.MaterialProperty.MP_SPECULAR)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.connect_material_property(rf, "", unreal.MaterialProperty.MP_REFRACTION)+ out = MEL.create_material_expression(m, unreal.MaterialExpressionThinTranslucentMaterialOutput, -100, 0)+ MEL.connect_material_expressions(tr, "", out, "TransmittanceColor")+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def glass_params(a, g):+ """M_AnyGlass instance values for one Blender glass slot (see master_glass)."""+ b = a.get("check_bounds")+ thin = b is not None and min(abs(b["max"][i] - b["min"][i]) for i in range(3)) < 2.5 # panes, windows, doors+ ior = g.get("ior", 1.5)+ rough = g["roughness"]+ return {"Transmittance": g["color"][:3], "FrostColor": [0.8 * x for x in g["color"][:3]],+ "Roughness": max(rough, 0.02),+ "Specular": min(1.0, ((ior - 1) / (ior + 1)) ** 2 / 0.08),+ "Opacity": min(0.35, max(0.0, 0.7 * (rough - 0.05))),+ # Refraction in IOR mode bends the screen-space background by the surface normal; full strength smears+ # whole cups, a third of (IOR - 1) keeps the edge darkening/bending that makes solid glass read as glass.+ "Refraction": 1.0 if thin else 1.0 + (ior - 1.0) * LOOK["glass"]["refraction_scale"], "thin": thin}+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++GOBO_CH = ("LocX", "LocY", "Rot", "ScaleX", "ScaleY")+GOBO_KEYS = {"LocX": "loc_x", "LocY": "loc_y", "Rot": "rot", "ScaleX": "scale_x", "ScaleY": "scale_y"}+++def mpc_time():+ """Material parameter collection holding the gobo clock: GoboUseSeq = 0 -> real time (Time node + per-light+ TimeOffset); 1 -> GoboTime, keyed by the level sequences so MRQ frames land on the exact Blender frame."""+ path = f"{DEST}/Materials/MPC_AnyTime"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("MPC_AnyTime", f"{DEST}/Materials", unreal.MaterialParameterCollection, unreal.MaterialParameterCollectionFactoryNew())+ ps = []+ for n in ("GoboTime", "GoboUseSeq"):+ p = unreal.CollectionScalarParameter()+ p.set_editor_property("parameter_name", n)+ p.set_editor_property("default_value", 0.0)+ ps.append(p)+ m.set_editor_property("scalar_parameters", ps)+ EAL.save_loaded_asset(m, False)+ return m+++def master_gobo():+ """Light-function master for projected-texture (gobo) spots, matching Blender's TexCoord-Normal x/z, y/z+ projector: two texture layers, each with Mapping location / Z rotation / scale animated as+ c0 + v t + A1 sin(2 pi f1 t + p1) + A2 sin(2 pi f2 t + p2) (per channel: vector params <L>_<Ch> = (c0, v, A1, f1)+ and <L>_<Ch>P = (p1, A2, f2, p2)), combined as Gain * (WA a + WB b + Bias)^Gamma, divided by Peak (light+ functions are clamped to 0..1; the light's intensity carries the peak)."""+ path = f"{DEST}/Materials/M_AnyGobo"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGobo", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("material_domain", unreal.MaterialDomain.MD_LIGHT_FUNCTION)+ mpc = mpc_time()+ gobo_default = next((EAL.load_asset(gobo_tex_path(lay["image"])) for L in scene["lights"]+ for lay in (L.get("gobo_fx") or {}).get("layers", []) if EAL.does_asset_exist(gobo_tex_path(lay["image"]))), None)+ if gobo_default is None:+ warn("M_AnyGobo: no imported gobo texture to use as the sampler default")++ def scalar(name, v, x, y):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("default_value", v)+ return n++ def vec(name, v, x, y):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("default_value", unreal.LinearColor(*v))+ return n++ # Clock: lerp(Time + TimeOffset, GoboTime, GoboUseSeq)+ tm = MEL.create_material_expression(m, unreal.MaterialExpressionTime, -2400, -600)+ toff = scalar("TimeOffset", 0.0, -2400, -500)+ add = MEL.create_material_expression(m, unreal.MaterialExpressionAdd, -2200, -560)+ MEL.connect_material_expressions(tm, "", add, "A")+ MEL.connect_material_expressions(toff, "", add, "B")+ cps = []+ for i, n in enumerate(("GoboTime", "GoboUseSeq")):+ c = MEL.create_material_expression(m, unreal.MaterialExpressionCollectionParameter, -2400, -400 + 100 * i)+ c.set_editor_property("collection", mpc)+ c.set_editor_property("parameter_name", n)+ cps.append(c)+ lt = MEL.create_material_expression(m, unreal.MaterialExpressionLinearInterpolate, -2000, -500)+ MEL.connect_material_expressions(add, "", lt, "A")+ MEL.connect_material_expressions(cps[0], "", lt, "B")+ MEL.connect_material_expressions(cps[1], "", lt, "Alpha")+ uv = MEL.create_material_expression(m, unreal.MaterialExpressionTextureCoordinate, -2400, -800)+ tan = scalar("TanOuter", 0.8391, -2400, -700)++ def ch(c):+ return (f"({c}.x + {c}.y*T + {c}.z*sin(6.2831853*{c}.w*T + {c}P.x) + {c}P.y*sin(6.2831853*{c}P.z*T + {c}P.w))")++ code = ("float2 p = (UV * 2.0 - 1.0) * Tan;\n"+ "float2 d = float2(-p.y, -p.x); // Blender light-local (x/z, y/z)\n"+ f"float lx = {ch('LocX')}; float ly = {ch('LocY')}; float r = {ch('Rot')};\n"+ f"float2 s = d * float2({ch('ScaleX')}, {ch('ScaleY')});\n"+ "float c = cos(r); float sn = sin(r);\n"+ "float2 q = float2(s.x * c - s.y * sn, s.x * sn + s.y * c) + float2(lx, ly);\n"+ "return float2(q.x, -q.y); // Blender image v runs bottom-up")+ samples = []+ defaults = {"LocX": (0, 0, 0, 0), "LocY": (0, 0, 0, 0), "Rot": (0, 0, 0, 0), "ScaleX": (1, 0, 0, 0), "ScaleY": (1, 0, 0, 0)}+ camv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -2400, 300)+ lfs = scalar("LFScale", 1024.0, -2400, 400)+ srad = scalar("SourceRadius", 0.0, -2400, 500)+ pbias = scalar("PenumbraBias", -1.0, -2400, 600)+ for li, L in enumerate(("A", "B")):+ y0 = li * 1400+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -1500, y0)+ cu.set_editor_property("code", code)+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ cu.set_editor_property("description", f"GoboUV_{L}")+ names = ["UV", "Tan", "T"] + [n for c in GOBO_CH for n in (c, c + "P")]+ ins = []+ for n in names:+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", n)+ ins.append(ci)+ cu.set_editor_property("inputs", ins)+ MEL.connect_material_expressions(uv, "", cu, "UV")+ MEL.connect_material_expressions(tan, "", cu, "Tan")+ MEL.connect_material_expressions(lt, "", cu, "T")+ vecs = {}+ for k, c in enumerate(GOBO_CH):+ a = vec(f"{L}_{c}", defaults[c], -1900, y0 + k * 220)+ b = vec(f"{L}_{c}P", (0, 0, 0, 0), -1900, y0 + k * 220 + 110)+ MEL.connect_material_expressions(a, "RGBA", cu, c)+ MEL.connect_material_expressions(b, "RGBA", cu, c + "P")+ vecs[c] = a+ # Penumbra: Cycles evaluates the gobo from every point of the light's disk, so the pattern blurs by the+ # angle SourceRadius / distance (tan units), times the mapping scale in texture space. Light functions are+ # point-projected; pick the mip whose texel matches that blur. CameraVector in a light function is the+ # light-space vector divided by LightFunctionScale (LightFunctionPixelShader.usf).+ mipc = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -1500, y0 + 1150)+ # Blur radius R texels = s * r / d * TexSize. A disk of radius R is roughly a Gaussian of sigma R/2, which+ # mip log2(R) - 1 (bilinear) approximates; PenumbraBias (default -1) is the look-match knob.+ mipc.set_editor_property("code", "float d = length(LV) * LFScale; if (d < 1.0) return 0.0;\n"+ "float s = max(abs(SX.x), abs(SY.x));\n"+ "return clamp(log2(max(s * SourceRadius / d * TexSize, 1.0)) + Bias, 0.0, 8.0);")+ mipc.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT1)+ mipc.set_editor_property("description", f"GoboPenumbraMip_{L}")+ ins = []+ for n in ("LV", "LFScale", "SourceRadius", "TexSize", "SX", "SY", "Bias"):+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", n)+ ins.append(ci)+ mipc.set_editor_property("inputs", ins)+ MEL.connect_material_expressions(camv, "", mipc, "LV")+ MEL.connect_material_expressions(lfs, "", mipc, "LFScale")+ MEL.connect_material_expressions(srad, "", mipc, "SourceRadius")+ MEL.connect_material_expressions(scalar(f"TexSize{L}", 2048.0, -1900, y0 + 1250), "", mipc, "TexSize")+ MEL.connect_material_expressions(vecs["ScaleX"], "RGBA", mipc, "SX")+ MEL.connect_material_expressions(vecs["ScaleY"], "RGBA", mipc, "SY")+ MEL.connect_material_expressions(pbias, "", mipc, "Bias")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -1100, y0)+ tx.set_editor_property("parameter_name", f"Tex{L}")+ tx.set_editor_property("mip_value_mode", unreal.TextureMipValueMode.TMVM_MIP_LEVEL)+ if not MEL.connect_material_expressions(mipc, "", tx, "Level"): # pin is "Level" in TMVM_MIP_LEVEL mode+ warn("M_AnyGobo: could not connect the penumbra mip")+ # The default must match the sampler type (linear grayscale), or the master fails to compile and every+ # light function silently does nothing (same trap as the ORM default in M_AnyBaked).+ tx.set_editor_property("texture", gobo_default)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_GRAYSCALE)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ w = scalar(f"W{L}", 0.5, -1100, y0 + 250)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -800, y0)+ MEL.connect_material_expressions(tx, "R", mul, "A")+ MEL.connect_material_expressions(w, "", mul, "B")+ samples.append(mul)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -500, 0)+ cu.set_editor_property("code", "return saturate(Gain * pow(max(A + B + Bias, 0.0), Gamma) * InvPeak);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT1)+ cu.set_editor_property("description", "GoboCombine")+ ins = []+ for n in ("A", "B", "Bias", "Gamma", "Gain", "InvPeak"):+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", n)+ ins.append(ci)+ cu.set_editor_property("inputs", ins)+ MEL.connect_material_expressions(samples[0], "", cu, "A")+ MEL.connect_material_expressions(samples[1], "", cu, "B")+ for n, v, yy in (("Bias", 0.0, 300), ("Gamma", 1.0, 400), ("Gain", 1.0, 500), ("InvPeak", 1.0, 600)):+ MEL.connect_material_expressions(scalar(n, v, -800, yy), "", cu, n)+ MEL.connect_material_property(cu, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def gobo_mi(L):+ """Material instance of M_AnyGobo for one light's gobo_fx entry."""+ g = L["gobo_fx"]+ m = mi("MI_Gobo_" + L["name"], master_gobo())+ lays = g["layers"][:2]+ if len(g["layers"]) > 2:+ warn(f"{L['name']}: {len(g['layers'])} gobo layers, master takes 2")+ if g.get("coord") != "normal_projective":+ warn(f"{L['name']}: gobo coordinates '{g.get('coord')}' approximated as the Normal x/z, y/z projector")+ fps = g.get("fps", 24.0)+ MEL.set_material_instance_scalar_parameter_value(m, "TanOuter", math.tan(math.radians(L["outer_cone"])))+ MEL.set_material_instance_scalar_parameter_value(m, "TimeOffset", scene.get("frame", 0) / fps)+ cb = g["combine"]+ w = list(cb["weights"][:2]) + [0.0] * (2 - len(lays))+ for li, Ln in enumerate(("A", "B")):+ lay = lays[min(li, len(lays) - 1)]+ tx = EAL.load_asset(gobo_tex_path(lay["image"]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, f"Tex{Ln}", tx)+ MEL.set_material_instance_scalar_parameter_value(m, f"W{Ln}", w[li] if li < len(lays) else 0.0)+ mp = lay.get("mapping") or {}+ for c in GOBO_CH:+ e = mp.get(GOBO_KEYS[c]) or {"c0": 1.0 if c.startswith("Scale") else 0.0, "v": 0.0, "sines": []}+ s = (e.get("sines") or []) + [[0.0, 0.0, 0.0]] * 2+ MEL.set_material_instance_vector_parameter_value(m, f"{Ln}_{c}", unreal.LinearColor(e["c0"], e["v"], s[0][0], s[0][1]))+ MEL.set_material_instance_vector_parameter_value(m, f"{Ln}_{c}P", unreal.LinearColor(s[0][2], s[1][0], s[1][1], s[1][2]))+ MEL.set_material_instance_scalar_parameter_value(m, "Bias", cb["bias"])+ MEL.set_material_instance_scalar_parameter_value(m, "Gamma", cb["gamma"])+ MEL.set_material_instance_scalar_parameter_value(m, "Gain", cb["gain"])+ MEL.set_material_instance_scalar_parameter_value(m, "InvPeak", 1.0 / max(g["peak"], 1e-6))+ MEL.set_material_instance_scalar_parameter_value(m, "SourceRadius", L.get("source_radius", 0.0))+ MEL.set_material_instance_scalar_parameter_value(m, "LFScale", 1024.0)+ for li, Ln in enumerate(("A", "B")):+ lay = lays[min(li, len(lays) - 1)]+ MEL.set_material_instance_scalar_parameter_value(m, f"TexSize{Ln}", float(max(lay.get("size") or [2048])))+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ masked = master_baked(masked=True) if any(a.get("alpha") for a in ASSETS) else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], masked if a.get("alpha") else baked)+ MEL.set_material_instance_parent(m, masked if a.get("alpha") else baked) # existing MI: reparent+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ MEL.set_material_instance_parent(gm, glass)+ gp = glass_params(a, g)+ for pn in ("Transmittance", "FrostColor"):+ c = gp[pn]+ MEL.set_material_instance_vector_parameter_value(gm, pn, unreal.LinearColor(c[0], c[1], c[2], 1))+ for pn in ("Roughness", "Specular", "Opacity", "Refraction"):+ MEL.set_material_instance_scalar_parameter_value(gm, pn, gp[pn])+ REPORT.setdefault("glass", {})[f"{a['asset']}_glass{k}"] = {k2: (round(v, 3) if isinstance(v, float) else v)+ for k2, v in gp.items() if k2 in ("thin", "Opacity", "Refraction", "Roughness")}+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ if a.get("sections"):+ # The GLB keeps only the materials its faces use (an all-glass pane has just the glass section).+ mats = [mats[min(s, len(mats) - 1)] for s in a["sections"]]+ elif len(a.get("glass", [])) >= len(a.get("slots", [])) > 0:+ # Exports from before "sections": a glass-only mesh lost its unused BAKED slot 0 in the GLB, so its+ # only sections are glass.+ mats = mats[1:]+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++LFV_BASE_CM = 500.0 # ULocalFogVolumeComponent::GetBaseVolumeSize()+++def lfv_tiles(b, max_aspect=1.5):+ """Cover a box (center, half-extent cm) with spheres: one sphere of radius max(half-extent) when the box is+ roughly cubic, else a row of spheres of radius = the smaller of the two larger half-extents along the long axis+ (a long flat box must not become one giant ball). Returns [(center, radius_cm)]."""+ e = list(b["extent"])+ c = list(b["center"])+ order = sorted(range(3), key=lambda i: -e[i])+ big, mid = e[order[0]], e[order[1]]+ if big <= max_aspect * mid:+ return [(c, max(e))]+ r = mid+ n = max(1, math.ceil(big / r))+ out = []+ for k in range(n):+ p = list(c)+ p[order[0]] = c[order[0]] - big + r + (2 * big - 2 * r) * (k / max(n - 1, 1))+ out.append((p, r))+ return out+++def vignette_intensity(angle, w, h):+ """UE vignette intensity matching ffmpeg's vignette=angle (finish.sh). ffmpeg multiplies the display-encoded+ frame by cos(angle * d / dmax)^4; UE multiplies scene linear by 1 / (1 + I^2 r^2)^2 before the tone curve, where+ a display factor f is about f^1.41 in linear (UE filmic: 1.64x display code per stop around middle grey).+ Least-squares fit over the frame (the old linear guess, 0.45 at PI/4, was about 40% too weak)."""+ a = h / w+ s = math.sqrt(2) / math.sqrt(1 + a * a)+ pts = []+ for j in range(20):+ for i in range(40):+ px, py = (i + 0.5) / 20 - 1, (j + 0.5) / 10 - 1+ dn = math.hypot(px * w / 2, py * h / 2) / math.hypot(w / 2, h / 2)+ pts.append(((px * s) ** 2 + (py * a * s) ** 2, max(math.cos(angle * dn), 0) ** 4))+ pts = [(r2, f ** 1.41) for r2, f in pts]+ return min((sum((1 / (1 + I * I * r2) ** 2 - t) ** 2 for r2, t in pts), I) for I in (k * 0.005 for k in range(300)))[1]+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ for k, v in LOOK["light"].items():+ c.set_editor_property(k, v)+ if L.get("gobo_fx") and L["type"] == "SPOT":+ # Light functions are clamped to 0..1: the material divides the pattern by its peak, the light carries it.+ g = L["gobo_fx"]+ c.set_editor_property("intensity", L["candela"] * g["peak"])+ c.set_editor_property("light_function_material", gobo_mi(L))+ c.set_editor_property("light_function_scale", unreal.Vector(1024, 1024, 1024)) # uniform: x/z ratio intact+ c.set_editor_property("light_function_fade_distance", 1.0e6)+ ec = g.get("emission_color") or [1, 1, 1]+ if max(ec) > 0 and any(abs(x - 1) > 1e-3 for x in ec):+ col = [a * b for a, b in zip(L["color"], ec)]+ mx = max(col)+ c.set_light_color(unreal.LinearColor(*(x / mx for x in col), 1.0), True)+ c.set_editor_property("intensity", L["candela"] * g["peak"] * mx)+ REPORT.setdefault("gobos", {})[L["name"]] = {"peak": g["peak"], "mean": g.get("mean"), "layers": len(g["layers"])}+ elif L.get("gobo_fx"):+ warn(f"{L['name']}: gobo on a {L['type']} light not converted (spot only)")+ if L.get("ies_file"):+ prof = EAL.load_asset(ies_path(L["ies_file"]))+ if prof:+ c.set_editor_property("ies_texture", prof)+ # Cycles' IES node normalises the profile and the light power carries the brightness: keep candela.+ c.set_editor_property("use_ies_brightness", False)+ else:+ warn(f"{L['name']}: IES profile {L['ies_file']} not imported")+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if C.get("exposure"): # per-camera exposure offset on top of the grade's manual exposure+ pp = cc.get_editor_property("post_process_settings")+ pp.set_editor_property("override_auto_exposure_bias", True)+ pp.set_editor_property("auto_exposure_bias", scene["grade"]["exposure"] + C["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF)+ cc.set_editor_property("post_process_settings", pp)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0] or v.get("claimed_by_fx"):+ continue # effects (flames, plumes) are Niagara now: an LFV can neither move nor take their shape+ for k, (ctr, r_cm) in enumerate(lfv_tiles(v["bounds_ue"])):+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(ctr), unreal.Rotator(0, 0, 0))+ lf.set_actor_label(f"LFV_{name}" + (f"_{k}" if k else ""))+ lf.set_folder_path("Volumes")+ # LocalFogVolume: base radius 500 cm (GetBaseVolumeSize), the proxy turns the scale into a sphere from+ # the max axis (LocalFogVolumeSceneProxy.cpp:34), so scale uniformly to the wanted radius.+ sc_ = r_cm / LFV_BASE_CM+ lf.set_actor_scale3d(unreal.Vector(sc_, sc_, sc_))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"]) # Blender density = extinction per metre+ emit = max(v["emission"])+ path_m = 2.0 * r_cm / 100.0+ # RadialFogExtinction is the optical depth straight through the centre (LocalFogVolumeCommon.ush),+ # independent of size: sigma (1/m) x path length (m).+ tau = max(dens * path_m, 1e-3) # emissive-only volumes still need a little medium (coverage > 0)+ lc.set_editor_property("radial_fog_extinction", tau)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ # UE adds FogEmissive x coverage (1 - e^-tau) (LocalFogVolumeCommon.ush). Cycles through the centre:+ # 683 x emit x (1 - e^-(sigma p)) / sigma nits (683 x emit x p when sigma -> 0). Match the two.+ lc_nits = 683 * emit * ((1 - math.exp(-dens * path_m)) / dens if dens > 1e-6 else path_m)+ E = lc_nits / (1 - math.exp(-tau))+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * E, ec[1] * E, ec[2] * E, 1))+ REPORT.setdefault("local_fog", []).append({"volume": name, "radius_cm": round(r_cm, 1), "scale": round(sc_, 4),+ "radial_fog_extinction": round(dens * path_m, 5)})+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", vignette_intensity(ff["vignette_angle_rad"], *g.get("resolution", [1920, 804])))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ look = g.get("look") or "None"+ agx = AGX_LOOKS.get(look.split(" - ", 1)[-1]) if g.get("view_transform") == "AgX" else None+ if agx:+ c = agx[0] / UE_FILMIC_AGX_CONTRAST+ ov("color_contrast", unreal.Vector4(c, c, c, 1.0))+ ov("color_saturation", unreal.Vector4(agx[1], agx[1], agx[1], 1.0))+ REPORT["look"] = {"view": f"AgX / {look}", "ue_contrast": round(c, 3), "saturation": agx[1]}+ else:+ warn(f"view transform {g.get('view_transform')!r} / look {look!r}: no tone match (UE filmic as is)")+ for k, v in LOOK["pp"].items():+ if isinstance(v, str) and "." in v: # enum from JSON, e.g. "LumenRayLightingModeOverride.HIT_LIGHTING"+ en, mem = v.split(".", 1)+ v = getattr(getattr(unreal, en), mem)+ ov(k, v)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Collision and the PlayerStart are the "spawn" stage (it needs the saved level and cooked collision).+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++def key_gobo_time(seq, n_frames, frame0=None):+ """Drive MPC_AnyTime from the sequence: GoboUseSeq = 1 and GoboTime = (Blender frame0 + f) / fps keyed on every+ frame, so MRQ frame f shows the gobo state of Blender frame frame0 + f (temporal sub-samples interpolate)."""+ if not any(L.get("gobo_fx") for L in scene["lights"]):+ return+ mpc = mpc_time()+ fps = scene["grade"].get("fps", 24)+ frame0 = scene.get("frame", 0) if frame0 is None else frame0+ try:+ tr = seq.add_track(unreal.MovieSceneMaterialParameterCollectionTrack)+ except Exception:+ tr = seq.add_master_track(unreal.MovieSceneMaterialParameterCollectionTrack)+ tr.set_editor_property("mpc", mpc)+ sec = tr.add_section()+ sec.set_range(0, n_frames)+ tick = seq.get_tick_resolution()+ tpf = tick.numerator / tick.denominator / fps+ lin = unreal.MovieSceneKeyInterpolation.LINEAR+ sec.add_scalar_parameter_key("GoboUseSeq", unreal.FrameNumber(0), 1.0, lin)+ for f in range(n_frames + 1):+ sec.add_scalar_parameter_key("GoboTime", unreal.FrameNumber(round(f * tpf)), (frame0 + f) / fps, lin)+++def make_dolly(spec, eas, fps):+ """ANYSCENE_DOLLY="camA>camB:frames[:name]": a CineCamera moving linearly from camera A's transform to camera+ B's (lens from A) over N frames, as SEQ_<name> for an MRQ clip."""+ a, rest = spec.split(">", 1)+ parts = rest.split(":")+ b, n = parts[0], int(parts[1]) if len(parts) > 1 else 96+ name = parts[2] if len(parts) > 2 else f"dolly_{a}"+ ca = next((C for C in scene["cameras"] if C["name"] == a), None)+ if b.startswith("fwd") and ca is not None: # "camA>fwd150": push in 150 cm along camera A's view axis+ d = float(b[3:])+ cb = dict(ca, loc=[ca["loc"][i] + ca["forward"][i] * d for i in range(3)])+ else:+ cb = next((C for C in scene["cameras"] if C["name"] == b), None)+ if ca is None or cb is None:+ warn(f"dolly {spec}: camera missing")+ return+ old = next((x for x in eas.get_all_level_actors() if x.get_actor_label() == name), None)+ if old:+ eas.destroy_actor(old)+ ra, rb = rot_fu(ca["forward"], ca["up"]), rot_fu(cb["forward"], cb["up"])+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(ca["loc"]), ra)+ act.set_actor_label(name)+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", ca["sensor_width_mm"])+ fb.set_editor_property("sensor_height", ca["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", ca["lens_mm"])+ cc.set_editor_property("current_aperture", 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.DISABLE)+ cc.set_editor_property("focus_settings", fs)+ sp = f"{DEST}/Sequences/SEQ_{name}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{name}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(n)+ bnd = seq.add_possessable(act)+ tt = bnd.add_track(unreal.MovieScene3DTransformTrack)+ ts = tt.add_section()+ ts.set_range(0, n)+ chs = ts.get_all_channels()+ lin = unreal.MovieSceneKeyInterpolation.LINEAR++ def unwrap(x, y):+ while y - x > 180:+ y -= 360+ while y - x < -180:+ y += 360+ return y+ va = [ca["loc"][0], ca["loc"][1], ca["loc"][2], ra.roll, ra.pitch, ra.yaw]+ vb = [cb["loc"][0], cb["loc"][1], cb["loc"][2], unwrap(ra.roll, rb.roll), unwrap(ra.pitch, rb.pitch), unwrap(ra.yaw, rb.yaw)]+ for i in range(6):+ chs[i].add_key(unreal.FrameNumber(0), va[i], interpolation=lin)+ chs[i].add_key(unreal.FrameNumber(n), vb[i], interpolation=lin)+ for i in range(6, 9):+ chs[i].add_key(unreal.FrameNumber(0), 1.0)+ try:+ ct = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ ct = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ cs = ct.add_section()+ cs.set_range(0, n)+ cs.set_camera_binding_id(seq.get_binding_id(bnd) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, bnd))+ key_gobo_time(seq, n)+ EAL.save_loaded_asset(seq, False)+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).save_current_level()+ log(f"dolly {name}: {a} -> {b}, {n} frames")+++# ------------------------------------------------------------------ effects (NIAGARA.md §2)++def fx_params(fx):+ p = dict(fx.get("params", {}))+ for key in ("type:" + fx["type"], fx["id"]):+ p.update(FX_OVR.get(key, {}))+ return p+++def place_fx(eas, fx, systems):+ path = fx["template"]+ if path not in systems:+ systems[path] = unreal.load_asset(path)+ if systems[path] is None:+ warn(f"fx template missing: {path}")+ sysasset = systems[path]+ if sysasset is None:+ return None+ t = fx["transform"]+ act = eas.spawn_actor_from_class(unreal.NiagaraActor, V(t["loc"]), unreal.Quat(*t["quat"]).rotator())+ act.set_actor_label("FX_" + fx["id"])+ act.set_folder_path("FX")+ nc = act.get_editor_property("niagara_component")+ nc.set_asset(sysasset, True) # 1. asset first: set_asset resets overrides+ params, types = fx_params(fx), fx.get("param_types", {})+ for k, v in params.items(): # 2. typed user parameters+ ty = types.get(k, "float")+ if ty == "float":+ nc.set_variable_float(k, float(v))+ elif ty == "int":+ nc.set_variable_int(k, int(v))+ elif ty == "bool":+ nc.set_variable_bool(k, bool(v))+ elif ty == "vec3":+ nc.set_variable_vec3(k, V(v))+ elif ty == "pos":+ nc.set_variable_position(k, V(v))+ elif ty == "color":+ nc.set_variable_linear_color(k, unreal.LinearColor(v[0], v[1], v[2], v[3] if len(v) > 3 else 1.0))+ nc.set_random_seed_offset(int(fx["seed"]) & 0x7FFFFFFF) # 3. determinism+ bl = fx.get("bounds_local") or {"min": [-e for e in fx["bounds_ue"]["extent"]], "max": fx["bounds_ue"]["extent"]}+ nc.set_system_fixed_bounds(unreal.Box(V(bl["min"]), V(bl["max"]))) # 4. fixed bounds, local space+ fps = fx["time"].get("fps", 24)+ ticks = int(math.ceil(fx["time"]["preroll_s"] * fps))+ nc.set_editor_property("override_warmup_settings", True) # 5. pre-roll to steady state on activation+ nc.set_editor_property("warmup_tick_delta", 1.0 / fps)+ nc.set_editor_property("warmup_tick_count", ticks)+ try:+ nc.set_editor_property("allow_scalability", False) # cinematic: never culled by an effect type+ except Exception:+ pass+ # 6. verify: a wrong name or type is a silent no-op, so read every parameter back.+ getters = {"float": nc.get_variable_float, "int": nc.get_variable_int, "bool": nc.get_variable_bool,+ "vec3": nc.get_variable_vec3, "pos": nc.get_variable_position, "color": nc.get_variable_color}+ bad = []+ for k in params:+ try:+ r = getters[types.get(k, "float")](k)+ ok = r[1] if isinstance(r, tuple) else r is not None+ except Exception:+ ok = False+ if not ok:+ bad.append(k)+ rec = {"id": fx["id"], "type": fx["type"], "template": path, "params_set": len(params), "params_invalid": bad,+ "bounds": [list(bl["min"]), list(bl["max"])], "bounds_readback": str(nc.get_system_fixed_bounds())[:200],+ "warmup_ticks": ticks, "seed": int(fx["seed"]) & 0x7FFFFFFF,+ "overrides": {k: v for k, v in params.items() if fx.get("params", {}).get(k) != v}}+ if bad:+ REPORT.setdefault("errors", []).append(f"{fx['id']}: user params not on {path}: {bad}")+ log("ERROR", fx["id"], "invalid params", bad)+ REPORT.setdefault("fx", []).append(rec)+ return act+++def stage_fx():+ t = time.time()+ fxs = [f for f in scene.get("fx", []) if f.get("technique") in ("niagara", "niagara_flipbook") and f.get("template")+ and ("all" in FX_TYPES or f["type"] in FX_TYPES)]+ if not fxs:+ log("fx: nothing to place (ANYSCENE_FX_TYPES=" + ",".join(sorted(FX_TYPES)) + ")")+ return+ if not EAL.does_directory_exist("/Game/AnySceneFX"):+ warn("fx: /Game/AnySceneFX is not in this project (build it with fx_pack.py or copy it in); no effects placed")+ return+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ les.load_level(f"{DEST}/{LEVEL}")+ for a in eas.get_all_level_actors(): # rerunnable on its own: drop the previous pass's effects+ if a.get_actor_label().startswith("FX_"):+ eas.destroy_actor(a)+ systems = {}+ n = sum(1 for fx in fxs if place_fx(eas, fx, systems))+ skipped = [f.get("id", f.get("name")) for f in scene.get("fx", []) if f not in fxs]+ if skipped:+ warn(f"fx not placed (technique not handled here): {skipped}")+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), f"{DEST}/{LEVEL}")+ log(f"fx: {n} niagara actors")+ REPORT["timings"]["fx_s"] = round(time.time() - t)+++def key_flicker(seq, eas, fps):+ """Light flicker sampled by the exporter (fx[].flicker): a float track on the light component's intensity."""+ lights = {a.get_actor_label(): a for a in eas.get_all_level_actors() if isinstance(a, unreal.Light)}+ for fx in scene.get("fx", []):+ fl = fx.get("flicker")+ if not fl or fl["target"] not in lights:+ continue+ lc = lights[fl["target"]].light_component+ base = lc.get_editor_property("intensity")+ try:+ b = seq.add_possessable(lc)+ tr = b.add_track(unreal.MovieSceneFloatTrack)+ tr.set_property_name_and_path("Intensity", "Intensity")+ sec = tr.add_section()+ sec.set_range(0, len(fl["values"]))+ ch = sec.get_all_channels()[0]+ for i, v in enumerate(fl["values"]):+ ch.add_key(unreal.FrameNumber(i), base * v)+ REPORT.setdefault("flicker", []).append({"light": fl["target"], "keys": len(fl["values"])})+ except Exception as e:+ warn(f"flicker track on {fl['target']} failed: {e}")+++# ------------------------------------------------------------------ spawn (collision + PlayerStart)++COLLIDE_MIN_CM = float(os.environ.get("ANYSCENE_COLLIDE_MIN_CM", "25")) # smaller props get no collision+++def hero_camera():+ """ANYSCENE_HERO (or ANYSCENE_HERO_CAM), else the .blend's active camera (scene.json "active_camera"), else+ cam_street, else the first camera."""+ want = [os.environ.get("ANYSCENE_HERO") or os.environ.get("ANYSCENE_HERO_CAM"), scene.get("active_camera"), "cam_street"]+ return next((c for w in want if w for c in scene["cameras"] if c["name"] == w), scene["cameras"][0] if scene["cameras"] else None)+++def stage_spawn():+ """Make a built level walkable in PIE / -game. Rerunnable on its own (ANYSCENE_STAGES=spawn) on any level built+ from this export, e.g. after the level was copied into another project.+ Collision: meshes are imported without collision primitives, so the pawn fell through every floor. Set+ geometry gets complex-as-simple collision (exact, nothing to generate); props smaller than+ ANYSCENE_COLLIDE_MIN_CM, glass-only meshes, alpha-cut decals and the sky dome get NoCollision.+ PlayerStart: exactly one per level, on the floor under the hero camera (line trace) + 92 cm, with the camera's+ yaw, nudged up to 6 m sideways (staying at floor level) until the default pawn (35 cm sphere) overlaps nothing. (It used to sit at the camera's+ height, in the air or inside a prop, and some levels had none, so the pawn spawned at the origin.)"""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ by = {a["asset"]: a for a in scene["assets"]}+ by_label = {p["name"]: p["asset"] for p in scene["placements"]}+ done, on, off = set(), 0, 0+ for act in eas.get_all_level_actors():+ if not isinstance(act, unreal.StaticMeshActor):+ continue+ c = act.static_mesh_component+ sm = c.static_mesh+ if sm is None:+ continue+ a = by.get(by_label.get(act.get_actor_label(), "")) or by.get(sm.get_name())+ _, ext = act.get_actor_bounds(False)+ size = 2 * max(ext.x, ext.y, ext.z)+ if (a is None or size < COLLIDE_MIN_CM or (a.get("glass") and not a.get("tex")) or a.get("alpha")):+ c.set_collision_profile_name("NoCollision")+ off += 1+ continue+ if sm.get_path_name() not in done:+ done.add(sm.get_path_name())+ bs = sm.get_editor_property("body_setup")+ if bs is None:+ warn(f"{sm.get_name()}: no body setup, no collision")+ else:+ bs.set_editor_property("collision_trace_flag", unreal.CollisionTraceFlag.CTF_USE_COMPLEX_AS_SIMPLE)+ EAL.save_loaded_asset(sm, False)+ c.set_collision_profile_name("BlockAll")+ on += 1+ log(f"spawn: collision on {on} actors ({len(done)} meshes), none on {off}")+ rec = {"collision_actors": on, "collision_meshes": len(done), "no_collision_actors": off}+ starts = [a for a in eas.get_all_level_actors() if isinstance(a, unreal.PlayerStart)]+ hero = hero_camera()+ if starts and os.environ.get("ANYSCENE_PLAYERSTART") == "keep": # a hand-placed start stays+ hero = None+ rec["player_start_kept"] = [a.get_actor_label() for a in starts]+ else:+ for a in starts:+ eas.destroy_actor(a)+ if hero:+ world = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world()+ yaw = rot_fu(hero["forward"], [0, 0, 1]).yaw+ cam = V(hero["loc"])+ vis = unreal.TraceTypeQuery.TRACE_TYPE_QUERY1 # Visibility++ def floor_at(x, y):+ hit = unreal.SystemLibrary.line_trace_single(world, unreal.Vector(x, y, cam.z), unreal.Vector(x, y, cam.z - 3000),+ vis, True, [], unreal.DrawDebugTrace.NONE, True)+ h = hit.to_tuple() if hit is not None else None+ return h[4].z if h and h[0] else None # (blocking_hit, initial_overlap, time, distance, location, ...)++ def free(p):+ # The pawn GameModeBase spawns (DefaultPawn) is a 35 cm sphere; a full 88 cm character capsule fails in+ # tight sets like the ramen aisle (hanging lamps, wall shelves at head height).+ hit = unreal.SystemLibrary.sphere_trace_single(world, p, p + unreal.Vector(0, 0, 1), 36.0, vis, True, [],+ unreal.DrawDebugTrace.NONE, True)+ h = hit.to_tuple() if hit is not None else None+ if h and h[0] and len(rec.setdefault("blocked_by", [])) < 3:+ rec["blocked_by"].append([h[9].get_actor_label() if h[9] else None, round(h[4].z), bool(h[1])])+ return not (h and h[0])+ # Rings around the camera; the floor is the lowest surface found within 6 m (a trace from eye height can+ # land on a stool or a counter), and only spots at floor level count.+ cands = []+ for r in range(0, 630, 30):+ for k in range(1 if r == 0 else 24):+ ang = 2 * math.pi * k / 24+ x, y = cam.x + r * math.cos(ang), cam.y + r * math.sin(ang)+ z = floor_at(x, y)+ if z is not None:+ cands.append((r, x, y, z))+ best = None+ if cands:+ z0 = min(c[3] for c in cands)+ low = [c for c in cands if c[3] <= z0 + 20]+ rec["floor"] = {"z": round(z0, 1), "samples": len(cands), "at_floor": len(low),+ "heights": sorted({round(c[3]) for c in cands})[:12]}+ for r, x, y, z in low:+ if free(unreal.Vector(x, y, z + 92.0)):+ best = (unreal.Vector(x, y, z + 92.0), r)+ break+ if best is None:+ z = floor_at(cam.x, cam.y)+ best = (unreal.Vector(cam.x, cam.y, z + 92.0 if z is not None else cam.z), None)+ warn(f"spawn: no free spot within 6 m of {hero['name']}" + ("" if z is not None else ", and no floor under it"))+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, best[0], unreal.Rotator(0, 0, yaw))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ rec.update({"player_start": [round(best[0].x, 1), round(best[0].y, 1), round(best[0].z, 1)], "yaw": round(yaw, 1),+ "camera": hero["name"], "camera_z": round(cam.z, 1), "nudge_cm": best[1]})+ log("spawn:", json.dumps(rec))+ REPORT["spawn"] = rec+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["spawn_s"] = round(time.time() - t)+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(max(48, CLIP_FRAMES))+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, max(48, CLIP_FRAMES))+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ key_gobo_time(seq, 48)+ key_flicker(seq, eas, fps)+ EAL.save_loaded_asset(seq, False)+ for spec in [s for s in os.environ.get("ANYSCENE_DOLLY", "").split(";") if s]:+ make_dolly(spec, eas, fps)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = [int(x) for x in os.environ["ANYSCENE_MRQ_RES"].split("x")] if os.environ.get("ANYSCENE_MRQ_RES") else scene["grade"].get("resolution", [1920, 804])+ # MRQ_Clip = MRQ_Still over the sequence's whole playback range (dolly clips).+ # Engine warm-up must also cover the longest effect pre-roll (NIAGARA.md section 2.4), on top of the component warm-up.+ warm = max([64] + [int(math.ceil(f["time"]["preroll_s"] * fps * 1.5)) for f in scene.get("fx", [])+ if "time" in f and ("all" in FX_TYPES or f.get("type") in FX_TYPES)])+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True), ("MRQ_Clip", False)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.environ.get("ANYSCENE_MRQ_OUT", os.path.join(EXPORT, "..", "compare", "mrq")).replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = name != "MRQ_Clip"+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = warm+ aa.use_camera_cut_for_warm_up = False+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "fx": stage_fx, "spawn": stage_spawn, "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.environ.get("ANYSCENE_REPORT") or os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal/csv_summary.sh b/unreal/csv_summary.shnew file mode 100644index 0000000..1a3f187--- /dev/null+++ b/unreal/csv_summary.sh@@ -0,0 +1,16 @@+#!/usr/bin/env bash+# Summarise an Unreal CSV profile: mean / p50 / p95 of frame, game, render, RHI and GPU time plus the top GPU passes.+# bash csv_summary.sh <Profile(...).csv> [skip_first_frames=60]+f="$1"; skip="${2:-60}"+awk -F, -v skip="$skip" '+NR==1 { for (i=1;i<=NF;i++) col[$i]=i; next }+$1 ~ /^\[/ || NF < 10 { next }+{ n++; if (n<=skip) next; m+++ for (k in col) if (k=="FrameTime"||k=="GameThreadTime"||k=="RenderThreadTime"||k=="RHIThreadTime"||k=="GPUTime"||k ~ /^GPU\//) { v=$(col[k])+0; s[k]+=v; a[k,m]=v } }+END {+ printf "frames=%d (after skipping %d)\n", m, skip+ split("FrameTime GameThreadTime RenderThreadTime RHIThreadTime GPUTime", ks, " ")+ for (j=1;j<=5;j++) { k=ks[j]; c=0; for (i=1;i<=m;i++) t[++c]=a[k,i]; asort(t); printf "%-17s mean %6.2f ms p50 %6.2f p95 %6.2f\n", k, s[k]/m, t[int(c*0.5)], t[int(c*0.95)]; delete t }+ printf "fps(mean frame) %.1f\n", 1000/(s["FrameTime"]/m)+ for (k in s) if (k ~ /^GPU\//) printf "%8.3f %s\n", s[k]/m, k | "sort -rn | head -12"+}' "$f"diff --git a/unreal/export.sh b/unreal/export.shnew file mode 100644index 0000000..e8e814d--- /dev/null+++ b/unreal/export.sh@@ -0,0 +1,27 @@+#!/usr/bin/env bash+# export_blend.py through the GPU queue, resumed until it finishes. Blender 5.0.1 Cycles bake crashes intermittently+# (EXCEPTION_ACCESS_VIOLATION in OpenImageIO ustring::operator= under ccl::create_mesh, ~1 per 250 bakes, a different+# asset each time); the exporter skips assets whose GLB/texture already exist, so a rerun resumes where it died.+# bash unreal/export.sh <copy.blend> <out_dir> [export_blend.py args...] (log: <out_dir>/export.log)+# EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py"+A="$(cd "$(dirname "$0")/.." && pwd)"+HERE="$(cd "$(dirname "$0")" && (pwd -W 2>/dev/null || pwd))" # this folder's exporter (C:/ form for Windows Blender): per-scene copies run their own+. "$A/pipeline/env.sh"+blend="$1"; out="$2"; shift 2+mkdir -p "$out"+: > "$out/export.log"+pre=()+[ -n "$EXPORT_PRE" ] && pre=(--python "$EXPORT_PRE")+# Only a --gpu bake needs the shared GPU queue; a CPU bake runs now instead of waiting behind other scenes' renders.+q=()+case " $* " in *" --gpu "*) q=(bash "$A/pipeline/gpu_run.sh") ;; esac+for i in $(seq 1 "${EXPORT_TRIES:-6}"); do+ "${q[@]}" "$BLENDER" -b "$blend" "${pre[@]}" --python "$HERE/export_blend.py" -- --out "$out" "$@" \+ >> "$out/export.log" 2>&1+ rc=$?+ if grep -q "^EXPORT wrote" "$out/export.log"; then echo "export: done after $i run(s)"; exit 0; fi+ # rc 0 without "wrote" is a Python exception (Blender exits 0 on those): retrying will not help.+ [ "$rc" = 0 ] && { echo "export: python error, see $out/export.log"; exit 1; }+ echo "export: run $i exited rc=$rc without finishing; resuming" | tee -a "$out/export.log"+done+echo "export: gave up after ${EXPORT_TRIES:-6} runs"; exit 1diff --git a/unreal/export_blend.py b/unreal/export_blend.pynew file mode 100644index 0000000..680f5e6--- /dev/null+++ b/unreal/export_blend.py@@ -0,0 +1,1681 @@+"""AnyScene -> Unreal export: bake every surface material to PBR textures, export one GLB per unique mesh, and write+scene.json (placements, lights, cameras, world, volumes, grade) in Unreal units and axes.++ blender -b <COPY of scene.blend> --python export_blend.py -- --out <dir> [--frame 60] [--only a,b] [--limit N]+ [--density 1024] [--max-res 4096] [--grade-sh scenes/<id>/scripts/grade.sh] [--ffmpeg path]+ [--dof '{"cam_street": [9.5, 2.8]}'] [--no-bake] [--no-fx] [--cpu-threads 0]+ [--plan-out plan.json | --plan plan.json [--keys shard.json]] [--cache DIR [--link-cache]]++Sharded (TOGGLE.md section 5; unreal_fal/app.py runs it on fal):+ 1. --plan-out plan.json: classify, name every asset, hash it (evaluated mesh + material node trees + bake settings ++ this file) and estimate its bake cost; no baking, no volumes, no world. Asset names come from the full key list,+ so they are the same in every process.+ 2. --plan plan.json --keys shard.json --cache DIR: bake and export only these asset keys (any number of processes,+ on any number of machines) and store each finished asset in DIR/<hash[:2]>/<hash>/. Writes no scene.json.+ 3. --plan plan.json --cache DIR --no-bake [--link-cache]: the merge. Every asset comes from the cache (symlinked with+ --link-cache), then scene.json, volumes, lights, cameras, world and grade are written as usual.+ Without --plan, --cache alone also works in one process: finished assets are reused across exports.++Never saves the .blend (it modifies the open file in memory: new UV layers, converted text/curves). Rerunnable:+textures and GLBs that already exist are skipped (delete <out>/tex/<asset>_* or <out>/mesh/<asset>.glb to redo one).++Conventions written to scene.json+ * Space: Unreal (cm, X forward, Y right, Z up, left-handed). Blender (x, y, z) m -> Unreal (x, -y, z) * 100.+ Object transforms are S*M*S with S = diag(1,-1,1), given as location, quaternion (x,y,z,w) and scale.+ * Mesh GLBs are exported in object-local space at identity; the Unreal importer maps glTF to its own axes, so+ build_level.py checks the result against "check_bounds" for the first assets.+ * Photometry: 683 lm/W. Point/spot cd = 683 * P / (4 pi); area cd = 683 * P / pi; sun lux = 683 * S;+ emissive nits = 683 * strength; sky radiance x 683. Exposure: Blender pixel = L_b * 2^exposure, so the Unreal+ manual exposure is EV100 = log2(683 / 1.2) - exposure (written as grade.ev100).+ * Bake: every surface material (procedural or not) is baked per unique mesh into one texture set on a bake UV:+ BaseColor (sRGB png), ORM (R=1, G=roughness, B=metallic, linear png), Normal (tangent, OpenGL +Y, png, only if a+ material perturbs the normal), Emissive (sRGB png + scale, only if emissive). Glass slots (transmission > 0.5)+ are not baked: they keep their own material slot and parameters.+"""+import bmesh # noqa: F401 (kept for hand edits)+import hashlib+import json+import math+import os+import re+import shutil+import subprocess+import sys+import time++import bpy+import numpy as np+from mathutils import Matrix, Vector++LM_PER_W = 683.0+argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+++def arg(name, default=None):+ return argv[argv.index(name) + 1] if name in argv else default+++OUT = os.path.abspath(arg("--out", "unreal_export"))+FRAME = int(arg("--frame", "60"))+ONLY = set(x for x in arg("--only", "").split(",") if x)+LIMIT = int(arg("--limit", "0"))+DENSITY = float(arg("--density", "1024")) # bake px per metre of sqrt(surface area)+MAX_RES = int(arg("--max-res", "4096"))+NO_BAKE = "--no-bake" in argv+NO_FX = "--no-fx" in argv # skip the Niagara effects classifier (fx_export.py)+DOF = json.loads(arg("--dof", "{}"))+GRADE_SH = arg("--grade-sh")+FFMPEG = arg("--ffmpeg", os.environ.get("FFMPEG", "ffmpeg")) # pipeline/env.sh exports FFMPEG (ffmpeg is not on PATH here)+THREADS = int(arg("--cpu-threads", "0"))+GPU = "--gpu" in argv # bake with OptiX (run through pipeline/gpu_run.sh)+REVERSE = "--reverse" in argv # walk assets from the end: a second process can share the work+PLAN_OUT = arg("--plan-out") # plan pass: write the asset plan and stop+PLAN = arg("--plan") # names and hashes from a plan pass (shards and merge)+KEYS = arg("--keys") # shard: a JSON list of asset keys to bake/export; nothing else is written+CACHE = arg("--cache") # bake cache dir: <hash[:2]>/<hash>/{mesh.glb, meta.json, base.png, ...}+LINK_CACHE = "--link-cache" in argv # symlink cached files into --out instead of copying them++SRC = bpy.data.filepath+if not SRC or os.path.basename(SRC) == "hk.blend" and "scenes" in SRC.replace("\\", "/").split("/"):+ print("export_blend: refusing to run on a scene's own .blend; open a copy", flush=True)+ sys.exit(1)++for d in ("mesh", "tex", "world", "grade"):+ os.makedirs(os.path.join(OUT, d), exist_ok=True)++sc = bpy.context.scene+sc.frame_set(FRAME)+S = Matrix.Diagonal((1.0, -1.0, 1.0, 1.0))+LOG = []+++def log(*a):+ s = " ".join(str(x) for x in a)+ LOG.append(s)+ print("EXPORT", s, flush=True)+++def ue_vec(v, scale=100.0):+ return [v[0] * scale, -v[1] * scale, v[2] * scale]+++def ue_xform(mw):+ t = S @ mw @ S+ loc, rot, scl = t.decompose()+ return {"loc": [loc.x * 100, loc.y * 100, loc.z * 100], "quat": [rot.x, rot.y, rot.z, rot.w], "scale": list(scl)}+++def ue_axes(mw):+ """Forward (-Z local) and up (+Y local) of a Blender camera/light in Unreal axes."""+ r = mw.to_3x3().normalized()+ f = r @ Vector((0, 0, -1))+ u = r @ Vector((0, 1, 0))+ return [f.x, -f.y, f.z], [u.x, -u.y, u.z]+++def safe(name):+ return re.sub(r"[^A-Za-z0-9_]", "_", name)[:60]+++# ------------------------------------------------------------------ material inspection++def output_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ for n in outs:+ if n.is_active_output:+ return n+ return outs[0] if outs else None+++def surface_shader(m):+ if not m or not m.node_tree:+ return None+ o = output_node(m.node_tree)+ if not o or not o.inputs["Surface"].is_linked:+ return None+ return o.inputs["Surface"].links[0].from_node+++def is_volume_only(m):+ if not m or not m.node_tree:+ return False+ o = output_node(m.node_tree)+ return bool(o and o.inputs["Volume"].is_linked and not o.inputs["Surface"].is_linked)+++def find_principled(m):+ sh = surface_shader(m)+ if sh is None:+ return None+ if sh.type == "BSDF_PRINCIPLED":+ return sh+ # Mix shaders etc.: first principled upstream.+ seen, stack = set(), [sh]+ while stack:+ n = stack.pop()+ if n.name in seen:+ continue+ seen.add(n.name)+ if n.type == "BSDF_PRINCIPLED":+ return n+ for i in n.inputs:+ for l in i.links:+ stack.append(l.from_node)+ return None+++def is_glass(m):+ p = find_principled(m)+ if p is not None:+ return (not p.inputs["Transmission Weight"].is_linked) and p.inputs["Transmission Weight"].default_value > 0.5+ sh = surface_shader(m)+ return sh is not None and sh.type in ("BSDF_GLASS", "BSDF_REFRACTION")+++def glass_params(m):+ p = find_principled(m)+ if p is None:+ return {"color": [1, 1, 1], "roughness": 0.0, "ior": 1.45}+ c = p.inputs["Base Color"].default_value+ return {"color": [c[0], c[1], c[2]], "roughness": p.inputs["Roughness"].default_value,+ "ior": p.inputs["IOR"].default_value, "alpha": p.inputs["Alpha"].default_value}+++def emissive(m):+ sh = surface_shader(m)+ if sh is None:+ return False+ if sh.type == "EMISSION":+ return True+ p = find_principled(m)+ if p is None:+ return False+ s = p.inputs["Emission Strength"]+ c = p.inputs["Emission Color"]+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))+++def cuts_out(m):+ """Principled Alpha linked or below 1 (decals keyed from luminance, stickers): baked into ORM.R, masked in UE."""+ p = find_principled(m)+ return bool(p and (p.inputs["Alpha"].is_linked or p.inputs["Alpha"].default_value < 0.999))+++def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+++def uses_object_dependence(m):+ """Nodes whose result depends on the object it sits on (bakes per representative instance)."""+ if not m or not m.node_tree:+ return []+ hits = set()+ def walk(nt):+ for n in nt.nodes:+ if n.type in ("OBJECT_INFO", "AMBIENT_OCCLUSION", "NEW_GEOMETRY", "BEVEL"):+ hits.add(n.type)+ if n.type == "TEX_COORD":+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+ if n.type == "ATTRIBUTE" and n.attribute_type in ("OBJECT", "INSTANCER"):+ hits.add("ATTR_" + n.attribute_name)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+ return sorted(hits)+++def animated(m):+ ad = m.node_tree.animation_data if m and m.node_tree else None+ return bool(ad and (ad.drivers or ad.action))+++# ------------------------------------------------------------------ scene classification++def particle_instancers():+ srcs, emitters = set(), set()+ for o in sc.objects:+ for md in o.modifiers:+ if md.type == "PARTICLE_SYSTEM":+ st = md.particle_system.settings+ emitters.add(o.name)+ if st.render_type == "OBJECT" and st.instance_object:+ srcs.add(st.instance_object.name)+ if st.render_type == "COLLECTION" and st.instance_collection:+ srcs.update(x.name for x in st.instance_collection.all_objects)+ return srcs, emitters+++def object_attr_values(o):+ """Values of the object attributes (Attribute node, type Object/Instancer) its materials read, e.g. a per-console+ screen_idx choosing which CRT page shows. Instances that differ in them cannot share one bake."""+ vals = set()+ for s in o.material_slots:+ for h in uses_object_dependence(s.material):+ if h.startswith("ATTR_"):+ vals.add(f"{h[5:]}={o.get(h[5:])}")+ return sorted(vals)+++def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+ av = object_attr_values(o)+ return "m_" + o.data.name + ("|" + ",".join(av) if av else "")+ return "o_" + o.name+++def tri_count(me):+ me.calc_loop_triangles()+ return len(me.loop_triangles)+++def render_uv(me):+ return next((l for l in me.uv_layers if l.active_render), None) or me.uv_layers.active+++def uv_ok(me):+ """True if the active render UV is a usable non-overlapping atlas inside 0..1 (generated-prop style)."""+ uvl = render_uv(me)+ if uvl is None or len(me.loop_triangles) == 0:+ return False+ n = len(me.loops)+ uv = np.empty(n * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ if uv.min() < -0.01 or uv.max() > 1.01:+ return False+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ total = float(a.sum())+ if total > 1.02 or total < 0.05:+ return False+ # Coarse overlap check: rasterise triangle centroids+vertices into a 512 grid weighted by area.+ g = 512+ idx = np.clip((t.mean(axis=1) * g).astype(np.int32), 0, g - 1)+ occ = np.zeros((g, g), np.float64)+ np.add.at(occ, (idx[:, 1], idx[:, 0]), a)+ return float(occ.max()) < 4.0 / (g * g) + 1e-4 or total < 0.9+++def surface_area(o, me):+ mw = o.matrix_world+ me.calc_loop_triangles()+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3)+ m3 = np.array(mw.to_3x3())+ co = co @ m3.T+ vt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ t = co[vt.reshape(-1, 3)]+ return float(0.5 * np.linalg.norm(np.cross(t[:, 1] - t[:, 0], t[:, 2] - t[:, 0]), axis=1).sum())+++def pow2(x, lo, hi):+ r = lo+ while r < x and r < hi:+ r *= 2+ return min(r, hi)+++# ------------------------------------------------------------------ baking++BAKE_SCENE = None+++def bake_scene():+ global BAKE_SCENE+ if BAKE_SCENE is None:+ bs = bpy.data.scenes.new("__bake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "GPU" if GPU else "CPU"+ if GPU: # device prefs live in user preferences, not the .blend: a factory Blender would bake on the CPU+ prefs = bpy.context.preferences.addons["cycles"].preferences+ if prefs.compute_device_type == "NONE" or not any(d.use and d.type != "CPU" for d in prefs.devices):+ prefs.compute_device_type = "OPTIX"+ prefs.get_devices()+ for d in prefs.devices:+ d.use = d.type == "OPTIX"+ log("bake device:", prefs.compute_device_type, [d.name for d in prefs.devices if d.use])+ bs.cycles.samples = 4+ bs.cycles.use_denoising = False+ bs.render.bake.margin = 8+ bs.render.bake.use_clear = True+ bs.render.bake.target = "IMAGE_TEXTURES"+ if THREADS:+ bs.render.threads_mode = "FIXED"+ bs.render.threads = THREADS+ bs.world = sc.world+ bs.frame_current = FRAME+ BAKE_SCENE = bs+ return BAKE_SCENE+++def run_bake(o, kind):+ bs = bake_scene()+ vl = bs.view_layers[0]+ with bpy.context.temp_override(scene=bs, view_layer=vl, object=o, active_object=o,+ selected_objects=[o], selected_editable_objects=[o]):+ if kind == "NORMAL":+ bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT", margin=8, use_clear=True)+ else:+ bpy.ops.object.bake(type="EMIT", margin=8, use_clear=True)+++def _src(sock):+ return sock.links[0].from_socket if sock.is_linked else None+++class Rewire:+ """Temporarily route one Principled channel into an Emission shader on the material output."""++ def __init__(self, m, channel, img):+ self.m, self.nt = m, m.node_tree+ self.added, self.saved = [], None+ nt = self.nt+ out = output_node(nt)+ p = find_principled(m)+ sh = surface_shader(m)+ em = nt.nodes.new("ShaderNodeEmission")+ self.added.append(em)+ em.inputs["Strength"].default_value = 1.0+ col = em.inputs["Color"]+ if channel == "base":+ if p is not None:+ s = p.inputs["Base Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ elif sh is not None and sh.type == "EMISSION":+ col.default_value = (0, 0, 0, 1)+ elif sh is not None and "Color" in sh.inputs:+ s = sh.inputs["Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+ # R=alpha (1 unless the material cuts out: decals, stickers; no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0+ if p is not None and p.inputs["Alpha"].is_linked:+ nt.links.new(_src(p.inputs["Alpha"]), cmb.inputs[0])+ elif p is not None:+ cmb.inputs[0].default_value = p.inputs["Alpha"].default_value+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+ else:+ cmb.inputs[i].default_value = p.inputs[k].default_value if p is not None else dv+ nt.links.new(cmb.outputs[0], col)+ elif channel == "emit":+ if sh is not None and sh.type == "EMISSION":+ for k in ("Color", "Strength"):+ s = sh.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[k])+ else:+ em.inputs[k].default_value = s.default_value+ elif p is not None:+ for k, ek in (("Emission Color", "Color"), ("Emission Strength", "Strength")):+ s = p.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[ek])+ else:+ em.inputs[ek].default_value = s.default_value+ else:+ col.default_value = (0, 0, 0, 1)+ if out is not None:+ self.saved = _src(out.inputs["Surface"])+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ self.out = out+ self.tex = nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.added.append(self.tex)+ nt.nodes.active = self.tex++ def restore(self):+ nt = self.nt+ if self.out is not None:+ for l in list(self.out.inputs["Surface"].links):+ nt.links.remove(l)+ if self.saved is not None:+ nt.links.new(self.saved, self.out.inputs["Surface"])+ for n in self.added:+ nt.nodes.remove(n)+++class TargetOnly:+ """For the normal bake: keep the material, just add the active target image node."""++ def __init__(self, m, img):+ self.nt = m.node_tree+ self.tex = self.nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.nt.nodes.active = self.tex++ def restore(self):+ self.nt.nodes.remove(self.tex)+++def new_img(name, res, colorspace, is_float=False):+ old = bpy.data.images.get(name)+ if old:+ bpy.data.images.remove(old)+ w, h = (res, res) if isinstance(res, int) else res+ img = bpy.data.images.new(name, w, h, alpha=False, float_buffer=is_float)+ img.colorspace_settings.name = colorspace+ return img+++def save_png(img, path):+ img.filepath_raw = path+ img.file_format = "PNG"+ img.save()+++def bake_channel(o, mats, channel, res, path):+ cs = {"base": "sRGB", "orm": "Non-Color", "emit": "Linear Rec.709", "normal": "Non-Color"}[channel]+ img = new_img("__bake_" + channel, res, cs, is_float=(channel == "emit"))+ rw = []+ try:+ seen = set()+ for m in mats:+ if m is None or m.name in seen or m.node_tree is None:+ continue+ seen.add(m.name)+ rw.append(TargetOnly(m, img) if channel == "normal" else Rewire(m, channel, img))+ run_bake(o, "NORMAL" if channel == "normal" else "EMIT")+ finally:+ for r in rw:+ r.restore()+ scale = 1.0+ if channel == "emit":+ w, h = (res, res) if isinstance(res, int) else res+ px = np.empty(w * h * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mx = float(np.percentile(px.max(axis=1), 99.95)) if px.size else 0.0+ scale = max(mx, 1e-6)+ out = bpy.data.images.new("__emit_png", w, h, alpha=False)+ out.colorspace_settings.name = "sRGB"+ q = np.ones((w * h, 4), np.float32)+ q[:, :3] = np.clip(px / scale, 0, 1)+ out.pixels.foreach_set(q.ravel())+ save_png(out, path)+ bpy.data.images.remove(out)+ else:+ save_png(img, path)+ bpy.data.images.remove(img)+ return scale+++def uv_stats(me, name):+ """UV coords of a layer and the fraction of the 0..1 square its triangles cover."""+ uvl = me.uv_layers[name]+ uv = np.empty(len(me.loops) * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ me.calc_loop_triangles()+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ return uv, float(a.sum())+++def uv_world_scale(o, me, uv):+ """Area-weighted mean world length (m) of one UV unit along u and along v (per-loop uv array, n x 2)."""+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3) @ np.array(o.matrix_world.to_3x3()).T+ me.calc_loop_triangles()+ nt = len(me.loop_triangles)+ if nt == 0:+ return 0.0, 0.0+ vt = np.empty(nt * 3, np.int32)+ lt = np.empty(nt * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ me.loop_triangles.foreach_get("loops", lt)+ P = co[vt.reshape(-1, 3)].astype(np.float64)+ T = uv[lt.reshape(-1, 3)].astype(np.float64)+ e1, e2 = P[:, 1] - P[:, 0], P[:, 2] - P[:, 0]+ d1, d2 = T[:, 1] - T[:, 0], T[:, 2] - T[:, 0]+ det = d1[:, 0] * d2[:, 1] - d2[:, 0] * d1[:, 1]+ ok = np.abs(det) > 1e-12+ if not ok.any():+ return 0.0, 0.0+ e1, e2, d1, d2, det = e1[ok], e2[ok], d1[ok], d2[ok], det[ok][:, None]+ dpdu = (e1 * d2[:, 1:2] - e2 * d1[:, 1:2]) / det+ dpdv = (e2 * d1[:, 0:1] - e1 * d2[:, 0:1]) / det+ w = 0.5 * np.linalg.norm(np.cross(e1, e2), axis=1)+ if w.sum() <= 0:+ return 0.0, 0.0+ return float((np.linalg.norm(dpdu, axis=1) * w).sum() / w.sum()), float((np.linalg.norm(dpdv, axis=1) * w).sum() / w.sum())+++def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+ empty square one. Returns (uv name, kept, aspect w/h, uv coverage)."""+ me = me_owner.data+ if "bake" in me.uv_layers:+ me.uv_layers.active = me.uv_layers["bake"]+ return "bake", False, me_owner.get("_bake_aspect", 1.0), me_owner.get("_bake_cov", 0.5)+ me.calc_loop_triangles()+ if uv_ok(me):+ ar = render_uv(me)+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)+ ar_name = ar.name if ar is not None else None+ uvl = me.uv_layers.new(name="bake")+ if ar_name is not None:+ # Keep materials reading their original UVs. Look the layer up again: uv_layers.new() reallocates the+ # collection, and setting active_render through the old reference left NO render UV, so every image node+ # with an implicit UV sampled one texel (posters, flyers, calendars, decals baked to a flat colour).+ me.uv_layers[ar_name].active_render = True+ uvl = me.uv_layers["bake"]+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ vl.objects.active = me_owner+ me_owner.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ bpy.ops.mesh.select_all(action="SELECT")+ bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=False)+ try:+ bpy.ops.uv.select_all(action="SELECT")+ bpy.ops.uv.pack_islands(rotate=True, margin=0.003, shape_method="AABB", scale=True)+ except Exception as ex: # noqa: BLE001+ log("pack_islands failed", me_owner.name, ex)+ bpy.ops.object.mode_set(mode="OBJECT")+ me_owner.select_set(False)+ uv, _ = uv_stats(me, "bake")+ lo, hi = uv.min(axis=0), uv.max(axis=0)+ span = np.maximum(hi - lo, 1e-6)+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+ # smart_project unwraps in object-local space, so a non-uniformly scaled object (a unit plane scaled to a 4.2 x 2.1 m+ # display) gets islands whose UV proportions are not its world proportions, and the span ratio above was 1:16 for a+ # 2:1 quad (512 x 4096 texture: 1/4 the texels across the short side). Pick W:H from the world-space length of one+ # UV unit along u and v instead, so texels come out square on the real surface.+ su, sv = uv_world_scale(me_owner, me, uv)+ if su > 0 and sv > 0:+ aspect = su / sv+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+++def bake_size(area, cov, aspect, kept):+ """Texture W,H so texel density is ~DENSITY px/m over the real surface; power of two, clamped."""+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4 # big architecture: coarser texels+ px = d * d * area / cov+ lo = 1024 if kept else 32+ w = pow2(math.sqrt(px * aspect), lo, MAX_RES)+ h = pow2(math.sqrt(px / aspect), lo, MAX_RES)+ if kept:+ w = h = min(max(w, h), 2048) # generated props: their own atlas, 1-2K+ return w, h+++# ------------------------------------------------------------------ bake cache (content hashes)++# Any edit to this file changes every hash: a cached bake is only reused by the exact code that made it.+CODE_SIG = hashlib.sha256(open(__file__, "rb").read()).hexdigest()[:16] if "__file__" in globals() else "nofile"+_UI_PROPS = {"rna_type", "name", "label", "location", "location_absolute", "width", "width_hidden", "height",+ "dimensions", "select", "show_options", "show_preview", "show_texture", "hide", "use_custom_color",+ "color", "parent", "inputs", "outputs", "internal_links", "warning_propagation", "color_tag"}+_SIGS = {}+++def _val(v, depth=0):+ """A deterministic, address-free description of an RNA value (node property or socket default)."""+ if v is None or isinstance(v, (bool, int, str)):+ return v+ if isinstance(v, float):+ return round(v, 6)+ if isinstance(v, bpy.types.Image):+ return ("image", image_sig(v))+ if isinstance(v, bpy.types.NodeTree):+ return ("tree", tree_sig(v))+ if isinstance(v, bpy.types.ColorRamp):+ return ("ramp", v.color_mode, v.interpolation, v.hue_interpolation,+ [(round(e.position, 6), _val(tuple(e.color))) for e in v.elements])+ if isinstance(v, bpy.types.CurveMapping):+ return ("curves", _val(tuple(v.black_level)), _val(tuple(v.white_level)), v.extend,+ [[(_val(tuple(p.location)), p.handle_type) for p in c.points] for c in v.curves])+ if isinstance(v, bpy.types.ID):+ return ("id", type(v).__name__, v.name)+ if isinstance(v, bpy.types.bpy_struct):+ return ("struct", struct_sig(v, depth + 1)) if depth < 3 else ("struct", type(v).__name__)+ try:+ return tuple(_val(x, depth) for x in v)+ except TypeError:+ return type(v).__name__+++def struct_sig(st, depth=0):+ out = []+ for p in st.bl_rna.properties:+ k = p.identifier+ if k in _UI_PROPS or k.startswith("bl_") or p.type == "COLLECTION":+ continue+ try:+ out.append((k, _val(getattr(st, k), depth)))+ except Exception: # noqa: BLE001 (write-only / context-dependent properties)+ pass+ return out+++def image_sig(img):+ key = ("img", img.as_pointer())+ if key not in _SIGS:+ h = hashlib.sha256(repr((img.source, tuple(img.size), img.colorspace_settings.name, img.alpha_mode)).encode())+ if img.packed_file:+ h.update(img.packed_file.data)+ elif img.source == "FILE" and os.path.exists(bpy.path.abspath(img.filepath)):+ with open(bpy.path.abspath(img.filepath), "rb") as f:+ h.update(f.read())+ elif img.source == "GENERATED":+ h.update(repr((img.generated_type, img.generated_width, img.generated_height,+ _val(tuple(img.generated_color)))).encode())+ else:+ h.update(img.filepath.encode())+ _SIGS[key] = h.hexdigest()[:24]+ return _SIGS[key]+++def tree_sig(nt):+ key = ("tree", nt.as_pointer()) # embedded material trees all share one name+ if key not in _SIGS:+ _SIGS[key] = "cycle" # a group that (somehow) contains itself+ nodes = []+ for n in sorted(nt.nodes, key=lambda n: n.name):+ ins = [(i.identifier, i.is_linked, None if i.is_linked or not hasattr(i, "default_value") else _val(i.default_value))+ for i in n.inputs]+ nodes.append((n.bl_idname, n.name, struct_sig(n), ins))+ links = sorted((l.from_node.name, l.from_socket.identifier, l.to_node.name, l.to_socket.identifier, l.is_muted)+ for l in nt.links)+ _SIGS[key] = hashlib.sha256(repr((nodes, links)).encode()).hexdigest()[:24]+ return _SIGS[key]+++def material_sig(m):+ if m is None:+ return None+ if m.node_tree is None:+ return ("plain", _val(tuple(m.diffuse_color)), round(m.roughness, 6), round(m.metallic, 6))+ return tree_sig(m.node_tree)+++_ATTR = {"FLOAT": (1, np.float32, "value"), "INT": (1, np.int32, "value"), "FLOAT_VECTOR": (3, np.float32, "vector"),+ "FLOAT_COLOR": (4, np.float32, "color"), "BYTE_COLOR": (4, np.float32, "color"), "BOOLEAN": (1, bool, "value"),+ "FLOAT2": (2, np.float32, "vector"), "INT8": (1, np.int32, "value"), "INT32_2D": (2, np.int32, "value"),+ "QUATERNION": (4, np.float32, "value")}+++def mesh_sig(me):+ """Hash of the (evaluated) mesh: topology, every attribute (positions, UVs, colours, materials, sharpness) and the+ corner normals the tangent-space normal bake and the GLB normals come from."""+ h = hashlib.sha256()+ a = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("loop_start", a)+ h.update(a.tobytes())+ for at in sorted(me.attributes, key=lambda x: x.name):+ h.update(repr((at.name, at.domain, at.data_type, len(at.data))).encode())+ spec = _ATTR.get(at.data_type)+ if spec is None:+ continue+ k, dt, prop = spec+ buf = np.empty(len(at.data) * k, dt)+ try:+ at.data.foreach_get(prop, buf)+ except Exception: # noqa: BLE001+ buf = np.array([getattr(d, prop) for d in at.data], dtype=dt)+ h.update(buf.tobytes())+ for l in me.uv_layers:+ h.update(repr((l.name, l.active, l.active_render)).encode())+ try:+ cn = np.empty(len(me.loops) * 3, np.float32)+ me.corner_normals.foreach_get("vector", cn)+ h.update(np.round(cn, 5).tobytes())+ except Exception: # noqa: BLE001+ pass+ return h.hexdigest()+++def asset_hash(rep, ev, mats):+ """Content key of one exported asset (GLB + texture set + meta): evaluated mesh, materials, world-space scale+ (texel density), bake settings, Blender version and this exporter. Materials that read the object they sit on+ (Object Info, object coordinates, object attributes, ...) also key on that representative object."""+ h = hashlib.sha256(repr((CODE_SIG, bpy.app.version_string, DENSITY, MAX_RES, FRAME)).encode())+ h.update(mesh_sig(ev).encode())+ h.update(repr([material_sig(m) for m in mats]).encode())+ h.update(repr([round(x, 5) for r in rep.matrix_world.to_3x3() for x in r]).encode())+ if any(uses_object_dependence(m) for m in mats if m):+ h.update(repr((rep.name, [round(x, 5) for r in rep.matrix_world for x in r], object_attr_values(rep),+ _val(tuple(rep.color)), rep.pass_index)).encode())+ return h.hexdigest()[:32]+++def cache_dir(h):+ return os.path.join(CACHE, h[:2], h)+++def _cache_files(an):+ """Cache file name -> path in --out for asset `an`."""+ files = {"mesh.glb": os.path.join(OUT, "mesh", an + ".glb"), "meta.json": os.path.join(OUT, "mesh", an + ".json"),+ "emit.png.json": os.path.join(OUT, "tex", f"{an}_emit.png.json")}+ for c in ("base", "orm", "normal", "emit"):+ files[c + ".png"] = os.path.join(OUT, "tex", f"{an}_{c}.png")+ return files+++def cache_fetch(h, an):+ d = cache_dir(h)+ if not os.path.exists(os.path.join(d, "ready")):+ return False+ for name, dst in _cache_files(an).items():+ src = os.path.join(d, name)+ if not os.path.exists(src):+ continue+ if os.path.lexists(dst):+ os.remove(dst)+ if LINK_CACHE:+ os.symlink(src, dst)+ else:+ shutil.copyfile(src, dst)+ return True+++def cache_store(h, an):+ """Copy a finished asset into the cache: written to a temp dir, then renamed into place (concurrent writers race+ harmlessly; the first rename wins)."""+ d = cache_dir(h)+ if os.path.exists(os.path.join(d, "ready")):+ return+ tmp = f"{d}.tmp{os.getpid()}"+ shutil.rmtree(tmp, ignore_errors=True)+ os.makedirs(tmp)+ for name, src in _cache_files(an).items():+ if os.path.exists(src):+ shutil.copyfile(src, os.path.join(tmp, name))+ open(os.path.join(tmp, "ready"), "w").write(an)+ try:+ os.rename(tmp, d)+ except OSError:+ shutil.rmtree(tmp, ignore_errors=True)+ if not os.path.exists(os.path.join(d, "ready")):+ raise+++# ------------------------------------------------------------------ export++def to_mesh_object(o):+ """Text/curve objects -> real mesh objects (evaluated) in a scratch collection; originals hidden."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ n = bpy.data.objects.new(o.name + "__mesh", me)+ c = bpy.data.collections.get("__converted") or bpy.data.collections.new("__converted")+ if c.name not in sc.collection.children:+ sc.collection.children.link(c)+ c.objects.link(n)+ n.matrix_world = o.matrix_world.copy()+ for k in ("visible_shadow", "visible_camera", "visible_glossy", "visible_diffuse"):+ setattr(n, k, getattr(o, k))+ o.hide_render = True+ return n+++def export_glb(o, uv_name, glass_slots, path):+ """Evaluated mesh at identity with only the bake UV; slots: 0 = baked, 1+ = each glass material."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ for l in [l for l in me.uv_layers if l.name != uv_name]:+ me.uv_layers.remove(l)+ if len(me.uv_layers):+ me.uv_layers[0].name = "UVMap"+ gl = list(glass_slots)+ mi = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("material_index", mi)+ remap = np.zeros(max(len(o.material_slots), 1), np.int32)+ for i in range(len(o.material_slots)):+ remap[i] = gl.index(i) + 1 if i in gl else 0+ mi = remap[np.clip(mi, 0, len(remap) - 1)]+ me.polygons.foreach_set("material_index", mi)+ me.materials.clear()+ base = bpy.data.materials.get("BAKED") or bpy.data.materials.new("BAKED")+ me.materials.append(base)+ for k, gi in enumerate(gl):+ gm = bpy.data.materials.get(f"GLASS_{k}") or bpy.data.materials.new(f"GLASS_{k}")+ me.materials.append(gm)+ tmp = bpy.data.objects.new("__export", me)+ sc.collection.objects.link(tmp)+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ tmp.select_set(True)+ vl.objects.active = tmp+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_apply=True,+ export_materials="PLACEHOLDER", export_texcoords=True, export_normals=True,+ export_tangents=True, export_yup=True, export_animations=False,+ export_cameras=False, export_lights=False, export_extras=False)+ bpy.data.objects.remove(tmp)+ bpy.data.meshes.remove(me)+++# ------------------------------------------------------------------ volumes++def sample_bounds(o):+ corners = [o.matrix_world @ Vector(c) for c in o.bound_box]+ lo = Vector([min(c[i] for c in corners) for i in range(3)])+ hi = Vector([max(c[i] for c in corners) for i in range(3)])+ return {"center": ue_vec((lo + hi) / 2), "extent": [(hi.x - lo.x) * 50, (hi.y - lo.y) * 50, (hi.z - lo.z) * 50]}+++def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+ m = next((m for m in o.data.materials if m and is_volume_only(m)), None)+ if m is None:+ return None+ pv = next((nd for nd in m.node_tree.nodes if nd.type == "PRINCIPLED_VOLUME"), None)+ if pv is None:+ return None+ me0 = o.data+ xs = [v.co.x for v in me0.vertices]+ ys = [v.co.y for v in me0.vertices]+ zs = [v.co.z for v in me0.vertices]+ lo, hi = Vector((min(xs), min(ys), min(zs))), Vector((max(xs), max(ys), max(zs)))+ res = {"levels": [], "density": [], "emission": [], "emission_color": None}+ for f in levels:+ z = lo.z + f * (hi.z - lo.z)+ me = bpy.data.meshes.new("__slice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__slice", me)+ sc.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ out = output_node(nt)+ for l in list(out.inputs["Volume"].links):+ nt.links.remove(l)+ vals = {}+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ em = nt.nodes.new("ShaderNodeEmission")+ s = pvc.inputs[sock]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ img = new_img("__vol", n, "Non-Color", is_float=True)+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ bs = bake_scene()+ bs.collection.objects.link(sl)+ try:+ run_bake(sl, "EMIT")+ finally:+ bs.collection.objects.unlink(sl)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ vals[key] = float(px.reshape(-1, 4)[:, 0].mean())+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ res["levels"].append(f)+ res["density"].append(vals["density"])+ res["emission"].append(vals["emission"])+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ c = pv.inputs["Color"].default_value+ res["albedo"] = [c[0], c[1], c[2]]+ res["anisotropy"] = pv.inputs["Anisotropy"].default_value+ ec = pv.inputs["Emission Color"]+ if ec.is_linked:+ # Sample the colour ramp if it is one (flame): mid-height colour as a representative.+ n0 = ec.links[0].from_node+ if n0.type == "VALTORGB":+ res["emission_color"] = list(n0.color_ramp.evaluate(0.6))[:3]+ else:+ res["emission_color"] = list(ec.default_value)[:3]+ mw = o.matrix_world+ corners = [mw @ Vector((x, y, z)) for x in (lo.x, hi.x) for y in (lo.y, hi.y) for z in (lo.z, hi.z)]+ wlo = Vector([min(c[i] for c in corners) for i in range(3)])+ whi = Vector([max(c[i] for c in corners) for i in range(3)])+ res["bounds_ue"] = {"center": ue_vec((wlo + whi) / 2), "extent": [(whi.x - wlo.x) * 50, (whi.y - wlo.y) * 50, (whi.z - wlo.z) * 50]}+ res["bounds_m"] = {"lo": list(wlo), "hi": list(whi)}+ res["material"] = m.name+ res["animated"] = animated(m)+ return res+++# ------------------------------------------------------------------ lights / cameras / world / grade++def export_ies(nd, light_name):+ """IES profile -> <OUT>/ies/<name>.ies (external file copied, internal text datablock written). Returns the+ path relative to OUT, or None."""+ d = os.path.join(OUT, "ies")+ os.makedirs(d, exist_ok=True)+ try:+ if nd.mode == "EXTERNAL":+ src = bpy.path.abspath(nd.filepath)+ if not os.path.exists(src):+ log("ies missing", light_name, src)+ return None+ dst = os.path.join(d, safe(os.path.splitext(os.path.basename(src))[0]) + ".ies")+ if not os.path.exists(dst):+ with open(src, "rb") as fi, open(dst, "wb") as fo:+ fo.write(fi.read())+ else:+ if nd.ies is None:+ return None+ dst = os.path.join(d, safe(nd.ies.name.rsplit(".", 1)[0]) + ".ies")+ with open(dst, "w", encoding="utf-8") as fo:+ fo.write(nd.ies.as_string())+ except OSError as ex:+ log("ies export failed", light_name, ex)+ return None+ return os.path.relpath(dst, OUT)+++def export_image_file(img, sub="gobo"):+ """A (possibly packed) image -> <OUT>/<sub>/<name>.<ext>; returns the path relative to OUT."""+ d = os.path.join(OUT, sub)+ os.makedirs(d, exist_ok=True)+ base = os.path.basename(bpy.path.abspath(img.filepath)) or img.name+ stem, ext = os.path.splitext(base)+ ext = ext.lower() if ext.lower() in (".png", ".jpg", ".jpeg", ".tga", ".exr", ".tif", ".tiff") else ".png"+ dst = os.path.join(d, safe(stem) + ext)+ if not os.path.exists(dst):+ if img.packed_file:+ with open(dst, "wb") as fo:+ fo.write(img.packed_file.data)+ elif os.path.exists(bpy.path.abspath(img.filepath)):+ with open(bpy.path.abspath(img.filepath), "rb") as fi, open(dst, "wb") as fo:+ fo.write(fi.read())+ else: # generated / missing on disk: write the pixels+ dst = os.path.join(d, safe(stem) + ".png")+ im2 = img.copy()+ save_png(im2, dst)+ bpy.data.images.remove(im2)+ return os.path.relpath(dst, OUT)+++def _fcurves(idblock):+ """All F-curves of an ID's action (Blender 5 layered actions: layers -> strips -> channelbag(slot))."""+ ad = getattr(idblock, "animation_data", None)+ act = ad.action if ad else None+ if act is None:+ return []+ out = list(getattr(act, "fcurves", []) or [])+ if not out and hasattr(act, "layers"):+ for ly in act.layers:+ for st in ly.strips:+ cb = st.channelbag(ad.action_slot) if ad.action_slot else None+ if cb:+ out += list(cb.fcurves)+ return out+++def fit_channel(t, y, n_sines=2, fmin=0.01, fmax=1.5, step=0.002):+ """y(t) ~ c0 + v t + sum_k A_k sin(2 pi f_k t + phi_k), greedy frequency search + joint linear least squares.+ Returns {"c0", "v", "sines": [[A, f, phi], ...], "rms"} (t in seconds)."""+ t = np.asarray(t, np.float64)+ y = np.asarray(y, np.float64)+ cols = [np.ones_like(t), t]+ freqs = []+ grid = np.arange(fmin, fmax, step)+ for _ in range(n_sines):+ best = None+ for f in grid:+ if any(abs(f - g) < 2 * step for g in freqs):+ continue+ w = 2 * math.pi * f+ A = np.vstack(cols + [np.sin(w * t), np.cos(w * t)]).T+ c, res, *_ = np.linalg.lstsq(A, y, rcond=None)+ r = float(((A @ c - y) ** 2).sum())+ if best is None or r < best[0]:+ best = (r, f)+ if best is None:+ break+ f = best[1]+ freqs.append(f)+ w = 2 * math.pi * f+ cols += [np.sin(w * t), np.cos(w * t)]+ A = np.vstack(cols).T+ c, *_ = np.linalg.lstsq(A, y, rcond=None)+ rms = float(np.sqrt(((A @ c - y) ** 2).mean()))+ sines = []+ for k, f in enumerate(freqs):+ a, b = c[2 + 2 * k], c[3 + 2 * k]+ sines.append([float(math.hypot(a, b)), float(f), float(math.atan2(b, a))]) # A sin(wt+phi) = A cos(phi) sin + A sin(phi) cos+ return {"c0": float(c[0]), "v": float(c[1]), "sines": sines, "rms": rms, "range": [float(y.min()), float(y.max())]}+++def _reduce_strength(sock, layers, light):+ """Reduce the node chain feeding a light's emission Strength to gain * (sum_i w_i * tex_i + bias) ^ gamma.+ Supports Math ADD/SUBTRACT/MULTIPLY/DIVIDE/POWER with constants, Map Range (linear) and Image Texture leaves+ (Color or Alpha output). Returns a dict or raises ValueError."""+ if not sock.is_linked:+ return {"w": {}, "bias": float(sock.default_value), "gamma": 1.0, "gain": 1.0, "clamp": False}+ n = sock.links[0].from_node+ if n.type == "TEX_IMAGE":+ i = next(k for k, l in enumerate(layers) if l["node"] == n.name)+ return {"w": {i: 1.0}, "bias": 0.0, "gamma": 1.0, "gain": 1.0, "clamp": False}+ if n.type == "MAP_RANGE" and n.data_type == "FLOAT" and n.interpolation_type == "LINEAR":+ f = _reduce_strength(n.inputs[0], layers, light)+ a, b, c, d = (n.inputs[k].default_value for k in (1, 2, 3, 4))+ if any(n.inputs[k].is_linked for k in (1, 2, 3, 4)) or abs(a) > 1e-6 or abs(c) > 1e-6:+ raise ValueError(f"{light}: map range other than 0..b -> 0..d")+ f["gain"] *= d / b+ f["clamp"] = f["clamp"] or n.clamp+ return f+ if n.type == "MATH":+ op = n.operation+ lk = [i.is_linked for i in n.inputs[:2]]+ if op in ("ADD", "SUBTRACT") and all(lk):+ fa, fb = _reduce_strength(n.inputs[0], layers, light), _reduce_strength(n.inputs[1], layers, light)+ if fa["gamma"] != 1 or fb["gamma"] != 1:+ raise ValueError(f"{light}: sum of non-linear terms")+ s = -1.0 if op == "SUBTRACT" else 1.0+ w = {k: fa["gain"] * v for k, v in fa["w"].items()}+ for k, v in fb["w"].items():+ w[k] = w.get(k, 0.0) + s * fb["gain"] * v+ return {"w": w, "bias": fa["gain"] * fa["bias"] + s * fb["gain"] * fb["bias"], "gamma": 1.0, "gain": 1.0, "clamp": False}+ if lk[0] and not lk[1] or lk[1] and not lk[0]:+ src = n.inputs[0] if lk[0] else n.inputs[1]+ k = n.inputs[1].default_value if lk[0] else n.inputs[0].default_value+ f = _reduce_strength(src, layers, light)+ if op == "MULTIPLY" or (op == "DIVIDE" and lk[0]):+ m = k if op == "MULTIPLY" else 1.0 / k+ if f["gamma"] == 1.0:+ f["w"] = {i: v * m for i, v in f["w"].items()}+ f["bias"] *= m+ else:+ f["gain"] *= m+ return f+ if op in ("ADD", "SUBTRACT") and f["gamma"] == 1.0 and f["gain"] == 1.0:+ f["bias"] += k if op == "ADD" else (-k if lk[0] else k)+ if op == "SUBTRACT" and lk[1]:+ raise ValueError(f"{light}: const - texture")+ return f+ if op == "POWER" and lk[0]:+ f["gain"] = f["gain"] ** k+ f["gamma"] *= k+ return f+ raise ValueError(f"{light}: unsupported math {op}")+ raise ValueError(f"{light}: unsupported node {n.type} in the strength chain")+++def gobo_entry(o):+ """Projected-texture (gobo) light: the image layers, their Mapping transform and its animation fitted to drift ++ sines, and the strength chain reduced to gain * (sum w_i tex_i + bias)^gamma. None if the light has no image."""+ L = o.data+ nt = L.node_tree+ texs = [n for n in nt.nodes if n.type == "TEX_IMAGE" and n.image]+ if not texs:+ return None+ fcs = {(fc.data_path, fc.array_index): fc for fc in _fcurves(nt)}+ fps = sc.render.fps / sc.render.fps_base+ layers, warns = [], []+ coord = "unknown"+ for tx in texs:+ lay = {"node": tx.name, "image": export_image_file(tx.image), "extension": tx.extension,+ "interpolation": tx.interpolation, "colorspace": tx.image.colorspace_settings.name,+ "size": list(tx.image.size)}+ vin = tx.inputs["Vector"]+ mp = vin.links[0].from_node if vin.is_linked else None+ if mp is not None and mp.type == "MAPPING":+ if mp.vector_type not in ("POINT", "TEXTURE"):+ warns.append(f"mapping type {mp.vector_type}")+ rot = mp.inputs["Rotation"].default_value+ if abs(rot[0]) > 1e-4 or abs(rot[1]) > 1e-4:+ warns.append("mapping X/Y rotation ignored")+ chans = {}+ for key, sock, idx in (("loc_x", "Location", 0), ("loc_y", "Location", 1), ("rot", "Rotation", 2),+ ("scale_x", "Scale", 0), ("scale_y", "Scale", 1)):+ si = list(mp.inputs).index(mp.inputs[sock])+ fc = fcs.get((f'nodes["{mp.name}"].inputs[{si}].default_value', idx))+ if fc is None or len(fc.keyframe_points) < 2:+ chans[key] = {"c0": float(mp.inputs[sock].default_value[idx]), "v": 0.0, "sines": [], "rms": 0.0}+ continue+ k0, k1 = fc.keyframe_points[0].co[0], fc.keyframe_points[-1].co[0]+ frames = np.arange(math.floor(k0), math.ceil(k1) + 1)+ vals = [fc.evaluate(float(f)) for f in frames]+ chans[key] = fit_channel(frames / fps, vals)+ chans[key]["keys"] = len(fc.keyframe_points)+ chans[key]["frames"] = [int(frames[0]), int(frames[-1])]+ if fc.modifiers:+ warns.append(f"{key}: fcurve modifiers {[m.type for m in fc.modifiers]} sampled, not exported")+ if mp.vector_type == "TEXTURE": # inverse transform: not supported by the master material+ warns.append("TEXTURE-type mapping treated as POINT")+ lay["mapping"] = chans+ lay["animated"] = any(c.get("keys") for c in chans.values())+ src = mp.inputs["Vector"].links[0].from_node if mp.inputs["Vector"].is_linked else None+ else:+ lay["mapping"] = None+ src = mp+ # Coordinate source: TexCoord Normal -> x/z, y/z (perspective projector) is the standard spot gobo.+ c = "unknown"+ if src is not None and src.type == "COMBXYZ":+ ins = [src.inputs[i].links[0].from_node if src.inputs[i].is_linked else None for i in (0, 1)]+ if all(n is not None and n.type == "MATH" and n.operation == "DIVIDE" for n in ins):+ seps = {l.from_node.type for n in ins for i in n.inputs[:2] for l in i.links}+ tc = {l.from_node for n in ins for i in n.inputs[:2] for l in i.links if l.from_node.type == "SEPXYZ"}+ if seps == {"SEPXYZ"} and len(tc) == 1:+ sep = next(iter(tc))+ ln = sep.inputs[0].links[0] if sep.inputs[0].is_linked else None+ if ln and ln.from_node.type == "TEX_COORD":+ c = "normal_projective" if ln.from_socket.name == "Normal" else ln.from_socket.name.lower() + "_projective"+ elif src is not None and src.type == "TEX_COORD":+ c = src.outputs[0].name.lower()+ for s in src.outputs:+ if s.is_linked:+ c = s.name.lower() + "_raw"+ coord = c if coord == "unknown" else coord+ if c != coord:+ warns.append(f"layers use different coordinates ({coord} vs {c})")+ layers.append(lay)+ em = next((n for n in nt.nodes if n.type == "EMISSION"), None)+ g = {"coord": coord, "layers": layers, "fps": fps}+ try:+ f = _reduce_strength(em.inputs["Strength"], layers, o.name) if em else None+ except ValueError as ex:+ warns.append(str(ex))+ f = None+ if f is None: # fall back to an equal-weight average of the layers, unit gain+ f = {"w": {i: 1.0 / len(layers) for i in range(len(layers))}, "bias": 0.0, "gamma": 1.0, "gain": 1.0, "clamp": False}+ g["combine"] = {"weights": [f["w"].get(i, 0.0) for i in range(len(layers))], "bias": f["bias"], "gamma": f["gamma"],+ "gain": f["gain"], "clamp": f["clamp"]}+ # Peak (all textures at 1) and mean (layers decorrelated) of the strength pattern.+ w = np.array(g["combine"]["weights"])+ g["peak"] = float(f["gain"] * max(w.clip(0).sum() + f["bias"], 1e-6) ** f["gamma"])+ try:+ rng = np.random.default_rng(0)+ acc = np.full(100000, f["bias"], np.float64)+ for i, tx in enumerate(texs):+ im = tx.image+ px = np.empty(im.size[0] * im.size[1] * im.channels, np.float32)+ im.pixels.foreach_get(px)+ px = px.reshape(-1, im.channels)[:, :3].mean(axis=1)+ acc += w[i] * px[rng.integers(0, px.size, acc.size)]+ g["mean"] = float((f["gain"] * np.clip(acc, 0, None) ** f["gamma"]).mean())+ except Exception as ex: # noqa: BLE001+ g["mean"] = None+ warns.append(f"mean estimate failed: {ex}")+ if em is not None:+ ec = em.inputs["Color"]+ g["emission_color"] = list(ec.default_value)[:3] if not ec.is_linked else [1.0, 1.0, 1.0]+ g["warnings"] = warns+ for wmsg in warns:+ log("gobo", o.name, wmsg)+ return g+++def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+ mx = max(col) or 1.0+ P = L.energy+ e = {"name": o.name, "type": L.type, "color": [c / mx for c in col], "energy_w": P,+ "cast_shadows": bool(getattr(L, "use_shadow", True)),+ "specular": 1.0 if getattr(o, "visible_glossy", True) else 0.0,+ "diffuse": 1.0 if getattr(o, "visible_diffuse", True) else 0.0,+ "volume": 1.0 if getattr(o, "visible_volume_scatter", True) else 0.0,+ "loc": ue_vec(o.matrix_world.translation), "animated": bool(L.animation_data and (L.animation_data.drivers or L.animation_data.action))}+ f, u = ue_axes(o.matrix_world)+ e["forward"], e["up"] = f, u+ k = mx # colour normalisation folds into intensity+ if L.type in ("POINT", "SPOT"):+ e["candela"] = LM_PER_W * P * k / (4 * math.pi)+ e["source_radius"] = L.shadow_soft_size * 100+ e["soft_falloff"] = bool(getattr(L, "use_soft_falloff", True))+ if L.type == "SPOT":+ outer = math.degrees(L.spot_size) / 2+ e["outer_cone"] = min(outer, 80.0)+ e["inner_cone"] = outer * (1 - L.spot_blend)+ if outer > 80:+ e["note"] = f"spot cone {outer * 2:.0f} deg > Unreal max 160: clamped"+ elif L.type == "AREA":+ e["candela"] = LM_PER_W * P * k / math.pi+ e["shape"] = L.shape+ sx = L.size+ sy = L.size_y if L.shape in ("RECTANGLE", "ELLIPSE") else L.size+ sxx, syy, _ = o.matrix_world.to_scale()+ e["width"], e["height"] = sx * sxx * 100, sy * syy * 100+ e["spread_deg"] = math.degrees(getattr(L, "spread", math.pi))+ elif L.type == "SUN":+ e["lux"] = LM_PER_W * P * k+ e["angle_deg"] = math.degrees(L.angle)+ # IES / gobo: node-based light textures.+ if L.use_nodes and L.node_tree:+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")+ f = export_ies(nd, o.name)+ if f:+ e["ies_file"] = f+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)+ em = next((nd for nd in L.node_tree.nodes if nd.type == "EMISSION"), None)+ if em is not None and not em.inputs["Strength"].is_linked and "candela" in e:+ e["candela"] *= em.inputs["Strength"].default_value # a constant node strength scales the light+ g = gobo_entry(o)+ if g:+ e["gobo_fx"] = g+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+++def camera_entry(o):+ c = o.data+ f, u = ue_axes(o.matrix_world)+ rx, ry = sc.render.resolution_x, sc.render.resolution_y+ sw = c.sensor_width if c.sensor_fit in ("AUTO", "HORIZONTAL") else c.sensor_height * rx / ry+ d = {"name": o.name, "type": c.type, "lens_mm": c.lens, "sensor_width_mm": sw, "sensor_height_mm": sw * ry / rx,+ "sensor_fit": c.sensor_fit, "shift": [c.shift_x, c.shift_y], "clip": [c.clip_start * 100, c.clip_end * 100],+ "loc": ue_vec(o.matrix_world.translation), "forward": f, "up": u,+ "dof": {"enabled": c.dof.use_dof, "focus_cm": c.dof.focus_distance * 100, "fstop": c.dof.aperture_fstop,+ "blades": c.dof.aperture_blades, "focus_object": c.dof.focus_object.name if c.dof.focus_object else None}}+ if "exposure" in o: # per-camera exposure offset (AnyScene builder cameras.py stores it as a custom property)+ d["exposure"] = float(o["exposure"])+ if o.name in DOF:+ fd, fs = DOF[o.name]+ d["dof"].update(enabled=True, focus_cm=fd * 100, fstop=fs, source="--dof override (stills script)")+ return d+++def world_bake(path, w=2048, h=1024, spp=32):+ ws = bpy.data.scenes.new("__world")+ ws.world = sc.world+ ws.render.engine = "CYCLES"+ ws.cycles.device = "CPU"+ ws.cycles.samples = spp+ ws.render.resolution_x, ws.render.resolution_y, ws.render.resolution_percentage = w, h, 100+ ws.view_settings.view_transform = "Standard"+ ws.render.image_settings.file_format = "OPEN_EXR"+ ws.render.image_settings.color_depth = "16"+ cd = bpy.data.cameras.new("__pano")+ cd.type = "PANO"+ try:+ cd.panorama_type = "EQUIRECTANGULAR"+ except Exception:+ cd.cycles.panorama_type = "EQUIRECTANGULAR"+ co = bpy.data.objects.new("__pano", cd)+ ws.collection.objects.link(co)+ co.rotation_euler = (math.radians(90), 0, math.radians(-90)) # looking +X? (equirect centre = -Y in Blender -> fixed below)+ co.rotation_euler = (math.radians(90), 0, 0)+ ws.camera = co+ ws.render.filepath = path+ with bpy.context.temp_override(scene=ws):+ bpy.ops.render.render(write_still=True, scene=ws.name)+ # mean radiance for the sky light estimate+ img = bpy.data.images.load(path)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mean = px.mean(axis=0).tolist()+ bpy.data.images.remove(img)+ return {"equirect_exr": path, "mean_radiance": mean, "camera_note": "equirect centre looks along Blender +Y"}+++def compositor_nodes():+ # 5.0: compositing_node_group; Scene.node_tree is gone (use_nodes can still read True with no tree).+ tree = getattr(sc, "compositing_node_group", None) or getattr(sc, "node_tree", None)+ if tree is None:+ return []+ out = []+ for n in tree.nodes:+ d = {"type": n.bl_idname, "name": n.name, "inputs": {}}+ for i in n.inputs:+ if i.is_linked or not hasattr(i, "default_value"):+ continue+ v = i.default_value+ try:+ v = v if isinstance(v, str) else list(v)+ except TypeError:+ pass+ if isinstance(v, (int, float, str, list, bool)):+ d["inputs"][i.name] = v+ for k in ("glare_type", "quality", "blend_type"):+ if hasattr(n, k):+ d[k] = getattr(n, k)+ out.append(d)+ return out+++def ffmpeg_grade(grade_sh):+ """Pull GRADE="..." out of a scene's grade.sh; split into colour (LUT-able) and spatial filters."""+ txt = open(grade_sh, encoding="utf-8").read()+ m = re.search(r'GRADE="([^"]+)"', txt)+ if not m:+ return None+ filters = [f for f in m.group(1).split(",") if f]+ colour = [f for f in filters if f.split("=")[0] in ("curves", "hue", "eq", "colorbalance", "colorchannelmixer", "lutrgb", "colortemperature")]+ spatial = [f for f in filters if f not in colour]+ g = {"source": grade_sh, "filter": m.group(1), "colour": colour, "spatial": spatial}+ for f in spatial:+ if f.startswith("vignette"):+ a = re.search(r"angle=PI/([\d.]+)", f)+ g["vignette_angle_rad"] = math.pi / float(a.group(1)) if a else math.pi / 5+ if f.startswith("rgbashift"):+ g["chromatic_px"] = 1+ noise = re.search(r"noise=alls=(\d+)", txt)+ if noise:+ g["grain_strength"] = int(noise.group(1))+ return g+++def make_lut(colour_filters, path):+ """UE colour grading LUT (256x16, 16 slices of 16x16; R across a slice, G down, B by slice), with the ffmpeg+ colour filters applied. Unreal applies it after the tone curve, i.e. in display space, like ffmpeg on the PNG."""+ n = 16+ ident = os.path.join(os.path.dirname(path), "lut_identity.png")+ img = bpy.data.images.new("__lut", n * n, n, alpha=False)+ img.colorspace_settings.name = "Non-Color"+ px = np.zeros((n, n * n, 4), np.float32)+ for b in range(n):+ for g in range(n):+ for r in range(n):+ px[g, b * n + r] = (r / (n - 1), g / (n - 1), b / (n - 1), 1)+ # Blender rows go bottom-up; UE LUT row 0 (top) is G=0.+ img.pixels.foreach_set(px[::-1].ravel())+ save_png(img, ident)+ bpy.data.images.remove(img)+ if not colour_filters:+ return ident+ cmd = [FFMPEG, "-v", "error", "-y", "-i", ident, "-vf", ",".join(colour_filters), "-frames:v", "1", path]+ try:+ r = subprocess.run(cmd, capture_output=True, text=True)+ except OSError as ex:+ log("LUT ffmpeg not runnable (pass --ffmpeg or set FFMPEG):", FFMPEG, ex)+ return ident+ if r.returncode != 0:+ log("LUT ffmpeg failed:", r.stderr[:300])+ return ident+ return path+++# ------------------------------------------------------------------ main++def write_plan(keys, assets, names, report, n_objs, t0):+ """Plan pass: every asset's name, content hash and estimated bake cost (pixels x channels), for sharding."""+ dg = bpy.context.evaluated_depsgraph_get()+ rows = []+ for k in keys:+ rep = assets[k][0]+ mats = [s.material for s in rep.material_slots]+ bake_mats = [m for m in mats if m and not is_glass(m)]+ ev = rep.evaluated_get(dg).data+ area = surface_area(rep, ev)+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4+ px = min(d * d * area / 0.6, MAX_RES * MAX_RES) if bake_mats else 0+ nch = (2 + any(perturbs_normal(m) for m in bake_mats) + any(emissive(m) for m in bake_mats)) if bake_mats else 0+ rows.append({"key": k, "asset": names[k], "hash": asset_hash(rep, ev, mats), "tris": tri_count(ev),+ "area_m2": round(area, 3), "est_px": int(px * nch), "channels": nch, "instances": len(assets[k]),+ "object_dependent": sorted({x for m in bake_mats for x in uses_object_dependence(m)})})+ plan = {"source": SRC, "frame": FRAME, "density": DENSITY, "max_res": MAX_RES, "code": CODE_SIG,+ "blender": bpy.app.version_string, "objects": n_objs, "assets": rows,+ "placements": sum(r["instances"] for r in rows), "volumes": sorted(report["volumes"]),+ "skipped": report["skipped"], "converted": report["converted"], "plan_s": round(time.time() - t0, 1)}+ json.dump(plan, open(PLAN_OUT, "w", encoding="utf-8"), indent=1)+ log(f"plan written {PLAN_OUT}: {len(rows)} assets, {plan['placements']} placements, "+ f"{sum(r['est_px'] for r in rows) / 1e6:.0f} Mpx to bake, in {plan['plan_s']}s")+++def main():+ t0 = time.time()+ srcs, emitters = particle_instancers()+ report = {"skipped": [], "converted": [], "volumes": {}, "fx": [], "warnings": []}+ objs = []+ for o in list(sc.objects):+ if o.hide_render or not o.visible_get():+ if o.type in ("MESH", "FONT", "CURVE") and not o.hide_render:+ pass+ if o.hide_render:+ continue+ if o.name in srcs:+ report["skipped"].append([o.name, "particle instance source (exported as fx note)"])+ continue+ if o.name in emitters:+ st = [md.particle_system.settings for md in o.modifiers if md.type == "PARTICLE_SYSTEM"]+ report["fx"].append({"name": o.name, "kind": "particles", "count": sum(s.count for s in st),+ "instance": [s.instance_object.name if s.instance_object else None for s in st],+ "lifetime": [s.lifetime for s in st], "velocity": [list(s.object_align_factor) for s in st]})+ if not o.show_instancer_for_render:+ continue+ if o.type in ("FONT", "CURVE", "SURFACE", "META"):+ if o.type == "CURVE" and o.data.bevel_depth == 0 and not o.data.bevel_object and o.data.extrude == 0:+ report["skipped"].append([o.name, "curve without geometry"])+ continue+ n = to_mesh_object(o)+ report["converted"].append([o.name, o.type])+ objs.append(n)+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):+ fl = next((md for md in o.modifiers if md.type == "FLUID" and md.fluid_type == "DOMAIN"), None)+ if fl is not None:+ # Mantaflow smoke: the slice bake cannot see the cache grids, so it reads the shader's constant+ # density multiplier (8.0 on the ramen steam) and would become an opaque fog box. Niagara gap.+ d = fl.domain_settings+ report["fx"].append({"name": o.name, "kind": "mantaflow_" + d.domain_type.lower(),+ "cache": bpy.path.abspath(d.cache_directory), "resolution": d.resolution_max,+ "bounds_ue": sample_bounds(o)})+ log("volume", o.name, "is a Mantaflow domain: exported as an fx note, not a fog volume")+ continue+ if PLAN_OUT or KEYS: # sampled by the merge pass only+ report["volumes"][o.name] = None+ continue+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+ log("volume", o.name, [round(x, 4) for x in v["density"]], [round(x, 2) for x in v["emission"]])+ continue+ objs.append(o)+ if not NO_FX and not (PLAN_OUT or KEYS): # plan/shard passes write no scene.json+ # Effects layer (NIAGARA.md, unreal/fx_export.py): volume shaders and particle systems classified into+ # Niagara entries. The note entries above stay (Mantaflow domains, raw particle counts) for anything it misses.+ try:+ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))+ import fx_export+ fx = fx_export.classify(sc, FRAME, sorted(emitters), sorted(report["volumes"]),+ os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates.json"))+ claimed = {o for e in fx for o in e["source"]["objects"]}+ report["fx"] = [n for n in report["fx"] if n.get("name") not in claimed] + fx+ for o in claimed:+ if o in report["volumes"]:+ report["volumes"][o]["claimed_by_fx"] = True+ except Exception as ex: # noqa: BLE001 (the fx layer is optional: never lose an export to it)+ log("fx classify failed", repr(ex))+ report["warnings"].append(f"fx classify failed: {ex!r}")+ # Group by unique mesh.+ assets = {}+ for o in objs:+ k = mesh_key(o)+ assets.setdefault(k, []).append(o)+ keys = sorted(assets, key=lambda k: assets[k][0].name, reverse=REVERSE)+ if ONLY:+ keys = [k for k in keys if any(o.name in ONLY or o.name.split("__")[0] in ONLY for o in assets[k])]+ if LIMIT:+ keys = keys[:LIMIT]+ # Asset names over the whole key list (the same in every shard), or the plan's.+ names, used = {}, set()+ for ai, k in enumerate(keys):+ rep = assets[k][0]+ an = safe(rep.data.name if k.startswith("m_") else rep.name)+ an = f"{an}_{ai:03d}" if an in used else an+ used.add(an)+ names[k] = an+ if KEYS:+ want = set(json.load(open(KEYS, encoding="utf-8")))+ keys = [k for k in keys if k in want]+ hashes = {}+ if PLAN:+ plan = json.load(open(PLAN, encoding="utf-8"))+ for row in plan["assets"]:+ if row["key"] in names:+ names[row["key"]], hashes[row["key"]] = row["asset"], row["hash"]+ missing = [k for k in keys if k not in hashes]+ if missing:+ log(f"WARNING {len(missing)} asset keys are not in the plan (hashed here): {missing[:5]}")+ if PLAN_OUT:+ write_plan(keys, assets, names, report, len(objs), t0)+ return+ log(f"{len(objs)} mesh objects -> {len(assets)} unique meshes; exporting {len(keys)}")+ entries, placements, shard = [], [], []+ for ai, k in enumerate(keys):+ group = assets[k]+ rep = group[0]+ an = names[k]+ mats = [s.material for s in rep.material_slots]+ glass = [i for i, m in enumerate(mats) if m and is_glass(m)]+ bake_mats = [m for i, m in enumerate(mats) if i not in glass]+ dg = bpy.context.evaluated_depsgraph_get()+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+ # Material sections the GLB really has, in order (0 = baked, k+1 = glass k). glTF drops unused materials, so an+ # all-glass pane has one section, the glass one; build_level used to give it the baked (opaque) material.+ mi_ = np.empty(len(ev.polygons), np.int32)+ ev.polygons.foreach_get("material_index", mi_)+ sect = sorted({(glass.index(int(i)) + 1) if int(i) in glass else 0 for i in np.unique(mi_)}) if len(mi_) else [0]+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+ meta = glb[:-4] + ".json"+ done = os.path.exists(glb) # written after every bake of the asset succeeded+ h = (hashes.get(k) or asset_hash(rep, ev, mats)) if CACHE else None+ cached = bool(h) and not done and cache_fetch(h, an)+ done = done or cached+ if done:+ # Resume: skip the UV unwrap (an edit-mode smart_project per asset). Blender 5.0.1's bake crashes+ # (OpenImageIO ustring::operator= in ccl::create_mesh) after a few hundred unwrap+bake cycles in one+ # process; re-unwrapping every finished asset on resume made it crash at the same asset every time.+ m0 = json.load(open(meta)) if os.path.exists(meta) else {}+ uv_name, kept, cov, res = None, m0.get("uv") == "kept", m0.get("uv_coverage", 0.0), m0.get("res", [0, 0])+ else:+ uv_name, kept, aspect, cov = ensure_bake_uv(rep, rep)+ res = bake_size(area, cov, aspect, kept)+ e = {"asset": an, "key": k, "tris": tris, "area_m2": round(area, 3), "uv": "kept" if kept else "smart_project",+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera), "sections": sect}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+ bake_scene().collection.objects.link(rep)+ try:+ bake_channel(rep, bake_mats, "base", res, p["base"])+ bake_channel(rep, bake_mats, "orm", res, p["orm"])+ if any(m and perturbs_normal(m) for m in bake_mats):+ bake_channel(rep, bake_mats, "normal", res, p["normal"])+ if any(m and emissive(m) for m in bake_mats):+ s = bake_channel(rep, bake_mats, "emit", res, p["emit"])+ json.dump({"scale": s}, open(p["emit"] + ".json", "w"))+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])+ e["alpha"] = any(m and cuts_out(m) for m in bake_mats)+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+ e["tex"] = {c: os.path.relpath(v, OUT) for c, v in p.items() if os.path.exists(v)}+ if not os.path.exists(glb):+ export_glb(rep, uv_name, glass, glb)+ if not done:+ json.dump({"res": list(res), "uv": e["uv"], "uv_coverage": e["uv_coverage"]}, open(meta, "w"))+ e["glb"] = os.path.relpath(glb, OUT)+ # Local bounds in Unreal axes for the importer orientation check.+ bb = [Vector(c) for c in rep.bound_box]+ e["check_bounds"] = {"min": ue_vec(Vector([min(c[i] for c in bb) for i in range(3)])),+ "max": ue_vec(Vector([max(c[i] for c in bb) for i in range(3)]))}+ e["bake_s"] = round(time.time() - t1, 1)+ if h:+ e["hash"] = h+ if not cached and not (NO_BAKE and bake_mats): # never cache an unbaked (texture-less) asset+ cache_store(h, an)+ shard.append({"key": k, "asset": an, "hash": h, "cached": cached, "bake_s": e["bake_s"]})+ entries.append(e)+ for o in group:+ placements.append({"name": o.name, "asset": an, **ue_xform(o.matrix_world),+ "shadow": bool(o.visible_shadow), "camera_visible": bool(o.visible_camera)})+ log(f"[{ai + 1}/{len(keys)}] {an} tris={tris} res={res} uv={e['uv']} inst={len(group)} {e['bake_s']}s"+ + (" (cache)" if cached else ""))+ if KEYS:+ json.dump(shard, open(os.path.join(OUT, f"shard_{os.path.basename(KEYS)}"), "w"), indent=1)+ log(f"shard done: {len(shard)} assets ({sum(r['cached'] for r in shard)} from cache) in {time.time() - t0:.0f}s")+ return+ # Lights, cameras, world, grade.+ lights = [light_entry(o) for o in sc.objects if o.type == "LIGHT" and not o.hide_render]+ cams = [camera_entry(o) for o in sc.objects if o.type == "CAMERA"]+ world = None+ wpath = os.path.join(OUT, "world", "sky.exr")+ if sc.world:+ world = world_bake(wpath) if not os.path.exists(wpath) or "--rebake-world" in argv else {"equirect_exr": wpath}+ if "mean_radiance" not in world:+ img = bpy.data.images.load(wpath)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ world["mean_radiance"] = px.reshape(-1, 4)[:, :3].mean(axis=0).tolist()+ bpy.data.images.remove(img)+ world["equirect_exr"] = os.path.relpath(wpath, OUT)+ world["nits_scale"] = LM_PER_W+ vs = sc.view_settings+ grade = {"view_transform": vs.view_transform, "look": vs.look, "exposure": vs.exposure, "gamma": vs.gamma,+ "use_curve_mapping": vs.use_curve_mapping,+ "ev100": math.log2(LM_PER_W / 1.2) - vs.exposure,+ "compositor": compositor_nodes(),+ "motion_blur": {"on": sc.render.use_motion_blur, "shutter": sc.render.motion_blur_shutter},+ "resolution": [sc.render.resolution_x, sc.render.resolution_y], "fps": sc.render.fps}+ if vs.use_curve_mapping:+ grade["curves"] = [[(p.location[0], p.location[1]) for p in c.points] for c in vs.curve_mapping.curves]+ if GRADE_SH and os.path.exists(GRADE_SH):+ g = ffmpeg_grade(GRADE_SH)+ if g:+ g["lut"] = os.path.relpath(make_lut(g["colour"], os.path.join(OUT, "grade", "lut_grade.png")), OUT)+ grade["ffmpeg"] = g+ scene = {"source": SRC, "frame": FRAME, "units": "unreal cm, X fwd, Y right, Z up", "lm_per_w": LM_PER_W,+ "assets": entries, "placements": placements, "lights": lights, "cameras": cams, "active_camera": sc.camera.name if sc.camera else None, "world": world,+ "volumes": report["volumes"], "fx": report["fx"], "grade": grade,+ "skipped": report["skipped"], "converted": report["converted"], "export_s": round(time.time() - t0)}+ jp = os.path.join(OUT, "scene.json")+ if os.path.exists(jp) and (ONLY or LIMIT):+ old = json.load(open(jp, encoding="utf-8"))+ have = {e["asset"] for e in entries}+ scene["assets"] = [e for e in old.get("assets", []) if e["asset"] not in have] + entries+ scene["placements"] = [p for p in old.get("placements", []) if p["asset"] not in have] + placements+ json.dump(scene, open(jp, "w", encoding="utf-8"), indent=1)+ log(f"wrote {jp}: {len(scene['assets'])} assets, {len(scene['placements'])} placements, {len(lights)} lights, "+ f"{len(cams)} cameras, {len(report['volumes'])} volumes in {time.time() - t0:.0f}s")+++main()diff --git a/unreal/fx_export.py b/unreal/fx_export.pynew file mode 100644index 0000000..5335d03--- /dev/null+++ b/unreal/fx_export.py@@ -0,0 +1,732 @@+"""Effects classifier for the AnyScene -> Unreal exporter (NIAGARA.md §4): turns volume-shader effects and particle+systems into `scene.json["fx"]` entries (schema in NIAGARA.md §4.2) with a technique, an AnySceneFX template and its+User parameters filled in, so build_level.py only places and sets them.++Used two ways:+ * from export_blend.py: `import fx_export; fx = fx_export.classify(sc, frame, emitters, volumes)`+ * standalone (no mesh bakes; patches an existing export):+ blender -b <copy>.blend --python unreal_fx/fx_export.py -- --scene <export>/scene.json --out <dir>/scene.json [--frame 60]+ writes the input scene.json + "fx" (and marks the volumes an fx entry claims) to --out.++Detection is evidence-based (material node tree, drivers, particle settings, names as a tie-breaker). Parameters+come from measurements: procedural volumes are baked on horizontal slices (density / emission per texel) to get+the plume's base, lean, spread and reach; driver expressions on mapping nodes give the scroll (rise) speed; particle+settings give rate, speed, size and lifetime; the ground under a drip line comes from a ray cast.+"""+import json+import math+import os+import re+import sys+import zlib++import bpy+import numpy as np+from mathutils import Vector++LM_PER_W = 683.0+TEMPLATES = "/Game/AnySceneFX/Systems/{0}.{0}"+TYPE_WORDS = {"fire": ("flame", "fire", "burner"), "steam": ("steam", "vapor", "vapour"), "smoke": ("smoke", "curl"),+ "haze": ("haze", "fog", "mist"), "rain": ("rain", "drizzle"), "drips": ("drip",), "dust": ("dust", "mote"),+ "sparks": ("spark",), "embers": ("ember",)}+PARAM_TYPES = None # filled from templates.json when present+++def log(*a):+ print("FXEXPORT", *a, flush=True)+++def ue_vec(v, s=100.0):+ return [v[0] * s, -v[1] * s, v[2] * s]+++def ue_dir(v, s=100.0):+ return [v[0] * s, -v[1] * s, v[2] * s]+++def crc(s):+ return zlib.crc32(s.encode()) & 0x7FFFFFFF+++def name_hint(name):+ n = name.lower()+ return {t for t, ws in TYPE_WORDS.items() if any(w in n for w in ws)}+++# ------------------------------------------------------------------ node-tree evidence++def out_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ return next((n for n in outs if n.is_active_output), outs[0] if outs else None)+++def volume_material(o):+ for s in o.material_slots:+ m = s.material+ if m and m.node_tree:+ o_ = out_node(m.node_tree)+ if o_ and o_.inputs["Volume"].is_linked and not o_.inputs["Surface"].is_linked:+ return m+ return None+++def principled_volume(m):+ return next((n for n in m.node_tree.nodes if n.type == "PRINCIPLED_VOLUME"), None)+++def drivers(m):+ ad = m.node_tree.animation_data if m.node_tree else None+ return list(ad.drivers) if ad else []+++def driver_rate(d, fps):+ """Per-second rate of a driver expression that is linear in `frame` (e.g. "-frame * 0.055")."""+ ex = d.driver.expression+ try:+ f = lambda fr: eval(ex, {"__builtins__": {}}, {"frame": fr, "sin": math.sin, "cos": math.cos}) # noqa: E731+ return (f(101.0) - f(100.0)) * fps+ except Exception:+ return None+++def mapping_scroll(m, fps):+ """Pattern velocity in object space (m/s) from Mapping-node Location drivers: the pattern moves by -dL/scale."""+ v = [0.0, 0.0, 0.0]+ found = False+ for d in drivers(m):+ mt = re.match(r'nodes\["([^"]+)"\]\.inputs\[(\d+)\]\.default_value', d.data_path)+ if not mt:+ continue+ nd = m.node_tree.nodes.get(mt.group(1))+ if not nd or nd.type != "MAPPING" or int(mt.group(2)) != 1: # inputs[1] = Location+ continue+ r = driver_rate(d, fps)+ if r is None:+ continue+ sc = nd.inputs["Scale"].default_value[d.array_index] or 1.0+ v[d.array_index] = -r / sc+ found = True+ return v if found else None+++def noise_evolution(m, fps):+ """Fastest 4D-noise W rate (1/s): how quickly the pattern re-forms (flicker / boil)."""+ rates = []+ for d in drivers(m):+ mt = re.match(r'nodes\["([^"]+)"\]\.inputs\[\d+\]\.default_value', d.data_path)+ if mt and m.node_tree.nodes.get(mt.group(1)) and m.node_tree.nodes[mt.group(1)].type == "TEX_NOISE":+ r = driver_rate(d, fps)+ if r is not None:+ rates.append(abs(r))+ return max(rates) if rates else 0.0+++def emission_colour(m, levels_z, weights):+ """Emission-weighted mean colour. Handles a ColorRamp on Emission Color (evaluated at each level's generated z+ when its factor comes from a generated/Z chain; otherwise at 0.6)."""+ pv = principled_volume(m)+ s = pv.inputs["Emission Color"]+ if not s.is_linked:+ return list(s.default_value)[:3]+ n0 = s.links[0].from_node+ if n0.type != "VALTORGB":+ return [1.0, 0.5, 0.1]+ fac = n0.inputs[0]+ by_z = fac.is_linked and fac.links[0].from_node.type == "SEPXYZ" and fac.links[0].from_socket.name == "Z"+ if not by_z:+ return list(n0.color_ramp.evaluate(0.6))[:3]+ acc, w = np.zeros(3), 0.0+ for z, wt in zip(levels_z, weights):+ acc += np.array(n0.color_ramp.evaluate(float(z))[:3]) * wt+ w += wt+ return list(acc / max(w, 1e-9))+++# ------------------------------------------------------------------ slice sampling (Cycles EMIT bakes)++_BS = None+++def bake_scene(frame):+ global _BS+ if _BS is None:+ bs = bpy.data.scenes.new("__fxbake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "CPU"+ bs.cycles.samples = 1+ bs.cycles.use_denoising = False+ bs.render.bake.target = "IMAGE_TEXTURES"+ bs.frame_current = frame+ _BS = bs+ return _BS+++def sample_slices(o, m, frame, n=32, levels=12):+ """Bake Density and Emission Strength of a volume material on `levels` horizontal slices through the object's box+ (sharing its object and texture space). Returns lo, hi (object space) and arrays [levels, n, n] per channel."""+ me0 = o.data+ xs = [v.co for v in me0.vertices]+ lo = Vector([min(c[i] for c in xs) for i in range(3)])+ hi = Vector([max(c[i] for c in xs) for i in range(3)])+ pv = principled_volume(m)+ zs = [lo.z + (k + 0.5) / levels * (hi.z - lo.z) for k in range(levels)]+ out = {"density": np.zeros((levels, n, n)), "emission": np.zeros((levels, n, n))}+ bs = bake_scene(frame)+ for li, z in enumerate(zs):+ me = bpy.data.meshes.new("__fxslice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__fxslice", me)+ bs.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ on = out_node(nt)+ for l in list(on.inputs["Volume"].links):+ nt.links.remove(l)+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ s = pvc.inputs[sock]+ if not s.is_linked and s.default_value == 0:+ continue+ em = nt.nodes.new("ShaderNodeEmission")+ if s.is_linked:+ nt.links.new(s.links[0].from_socket, em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], on.inputs["Surface"])+ img = bpy.data.images.new("__fxvol", n, n, alpha=False, float_buffer=True)+ img.colorspace_settings.name = "Non-Color"+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ with bpy.context.temp_override(scene=bs, view_layer=bs.view_layers[0], object=sl, active_object=sl,+ selected_objects=[sl], selected_editable_objects=[sl]):+ bpy.ops.object.bake(type="EMIT", margin=0, use_clear=True)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ out[key][li] = px.reshape(n, n, 4)[:, :, 0] # [row = y, col = x]+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ return lo, hi, zs, out+++def plume_stats(o, lo, hi, zs, field, n):+ """Per-level weighted centroid (world), radial spread (m) and peak, from a [levels, n, n] field."""+ mw = o.matrix_world+ xs = np.linspace(lo.x, hi.x, n, endpoint=False) + (hi.x - lo.x) / (2 * n)+ ys = np.linspace(lo.y, hi.y, n, endpoint=False) + (hi.y - lo.y) / (2 * n)+ X, Y = np.meshgrid(xs, ys)+ sx, sy, sz = mw.to_scale()+ rows = []+ for k, z in enumerate(zs):+ f = np.clip(field[k], 0, None)+ tot = f.sum()+ if tot <= 1e-9:+ rows.append(None)+ continue+ cx, cy = (f * X).sum() / tot, (f * Y).sum() / tot+ r = np.sqrt(((X - cx) * sx) ** 2 + ((Y - cy) * sy) ** 2)+ rows.append({"c": mw @ Vector((cx, cy, z)), "spread": float((f * r).sum() / tot), "r_peak": float(r[np.unravel_index(np.argmax(f), f.shape)]),+ "peak": float(np.percentile(f, 98)), "mean": float(f.mean()), "sum": float(tot)})+ return rows+++# ------------------------------------------------------------------ entries++def template_for(typ, default):+ """Template whose recipe lists this fx type (templates.json "fx_types"), so a recipe an agent adds for a new type+ is picked up without code changes; falls back to the built-in default."""+ for name, t in (PARAM_TYPES or {}).items():+ if typ in t.get("fx_types", []):+ return name+ return default+++def base_entry(fid, typ, conf, kind, objs, mat, evidence, center_ue, extent_ue, technique, template, fps, preroll):+ template = template_for(typ, template) if template else template+ if technique == "niagara" and template is None:+ technique = "agent" # no template for this type yet: queued for the look-match agent (FX_AGENT.md)+ return {"id": re.sub(r"[^A-Za-z0-9_]", "_", fid), "type": typ, "confidence": round(conf, 2),+ "source": {"kind": kind, "objects": objs, "material": mat, "evidence": evidence},+ "transform": {"loc": center_ue, "quat": [0, 0, 0, 1], "scale": [1, 1, 1]},+ "bounds_ue": {"center": center_ue, "extent": extent_ue},+ "technique": technique, "template": TEMPLATES.format(template) if template else None,+ "params": {}, "param_types": {}, "physical": {}, "time": {"preroll_s": preroll, "fps": fps},+ "seed": crc(fid), "notes": []}+++def set_params(e, params):+ tpl = e["template"].split("/")[-1].split(".")[0] if e["template"] else None+ types = (PARAM_TYPES or {}).get(tpl, {}).get("params", {})+ for k, v in params.items():+ if types and k not in types:+ e["notes"].append(f"param {k} not on {tpl}: dropped")+ continue+ e["params"][k] = [round(x, 4) for x in v] if isinstance(v, (list, tuple)) else round(float(v), 4)+ e["param_types"][k] = types.get(k) or ("color" if k == "Color" else "vec3" if isinstance(v, (list, tuple)) else "float")+++def nearest_light(sc, p_world, radius=1.0):+ """The dominant light near the effect (highest energy within radius), so fire never double-lights."""+ best = None+ for o in sc.objects:+ if o.type == "LIGHT" and not o.hide_render:+ d = (o.matrix_world.translation - p_world).length+ if d <= radius and (best is None or o.data.energy > best[0]):+ best = (o.data.energy, o.name)+ return best[1] if best else None+++def flicker(sc, light_name, frame, n, fps):+ o = sc.objects.get(light_name)+ if not o or not (o.data.animation_data and o.data.animation_data.drivers):+ return None+ vals = []+ for f in range(frame, frame + n):+ sc.frame_set(f)+ vals.append(o.data.energy)+ sc.frame_set(frame)+ base = vals[0] or 1.0+ return {"target": light_name, "property": "intensity", "fps": fps, "start_frame": frame,+ "values": [round(v / base, 4) for v in vals], "note": "multiplier on the light's exported intensity"}+++def classify_volume(sc, o, m, frame, fps):+ pv = principled_volume(m)+ ev, score = [], {}+ emit_linked = pv.inputs["Emission Strength"].is_linked or pv.inputs["Emission Strength"].default_value > 0+ bb = pv.inputs["Blackbody Intensity"].default_value > 0+ if emit_linked or bb:+ score["fire"] = score.get("fire", 0) + 4+ ev.append("principled volume emission")+ scroll = mapping_scroll(m, fps)+ has_noise = any(n.type == "TEX_NOISE" for n in m.node_tree.nodes)+ alb = list(pv.inputs["Color"].default_value)[:3]+ dims = o.dimensions+ if not emit_linked:+ if has_noise and scroll and scroll[2] > 0.3:+ score["steam" if min(alb) > 0.85 else "smoke"] = 4+ ev.append(f"noise scrolling up {scroll[2]:.2f} m/s, albedo {min(alb):.2f}")+ if max(dims) > 3.0 and (not scroll or abs(scroll[2]) < 0.05 * fps):+ score["haze"] = score.get("haze", 0) + 3+ ev.append(f"large box {max(dims):.1f} m")+ for t in name_hint(o.name) | name_hint(m.name):+ score[t] = score.get(t, 0) + 2+ ev.append(f"name hint {t}")+ if not score:+ return None, ev, 0.0+ ranked = sorted(score.items(), key=lambda kv: -kv[1])+ top = ranked[0]+ runner = ranked[1][1] if len(ranked) > 1 else 0+ return top[0], ev, top[1] / (top[1] + runner)+++def seen_from(sc, dg, p, cams, skip):+ """True if the world point p has an unobstructed line to any camera (volume-only objects are see-through)."""+ for cpos in cams:+ d = cpos - p+ dist = d.length+ d.normalize()+ q, left = p.copy(), dist+ for _ in range(16):+ hit, loc, _n, _i, ob, _m = sc.ray_cast(dg, q, d, distance=left)+ if not hit:+ return True+ if ob is not None and (getattr(ob, "original", ob).name in skip or volume_material(getattr(ob, "original", ob))):+ step = (loc - q).length + 1e-3+ q, left = loc + d * 1e-3, left - step+ continue+ break+ return False+++def visible_field(sc, o, lo, hi, zs, field, n, rel=0.02):+ """Mask each slice of `field` to the samples some scene camera can see, which is what Cycles shows: burner jets+ under a wok, flame inside a collar, a fire behind fireplace walls are hidden by opaque geometry. Samples under+ `rel` x the field's peak are dropped. Returns the masked field and the visible fraction per level."""+ cams = [c.matrix_world.translation.copy() for c in sc.objects if c.type == "CAMERA"]+ mw = o.matrix_world+ if not cams:+ return field.copy(), [1.0] * len(zs)+ dg = bpy.context.evaluated_depsgraph_get()+ xs = np.linspace(lo.x, hi.x, n, endpoint=False) + (hi.x - lo.x) / (2 * n)+ ys = np.linspace(lo.y, hi.y, n, endpoint=False) + (hi.y - lo.y) / (2 * n)+ thr = rel * float(np.clip(field, 0, None).max())+ out, frac = np.zeros_like(field), []+ for k, z in enumerate(zs):+ f = np.clip(field[k], 0, None)+ for j, i in zip(*np.nonzero(f > thr)):+ if seen_from(sc, dg, mw @ Vector((xs[i], ys[j], z)), cams, {o.name}):+ out[k, j, i] = f[j, i]+ frac.append(float(out[k].sum() / f.sum()) if f.sum() > 1e-9 else 0.0)+ return out, frac+++def view_radiance(sc, o, lo, hi, zs, field, vis, n):+ """Line integral of `field` (emission per metre) along each camera's view ray through every camera-visible sample:+ the radiance Cycles shows there (a ray grazing a ring of flame crosses far more than one tongue's width).+ Returns the 90th percentile over samples and cameras, in the field's units x metres."""+ cams = [c.matrix_world.translation.copy() for c in sc.objects if c.type == "CAMERA"]+ if not cams:+ return 0.0+ mw = o.matrix_world+ inv = mw.inverted()+ levels = len(zs)+ dz = (zs[1] - zs[0]) if levels > 1 else (hi.z - lo.z)+ sx, sy, sz = mw.to_scale()+ step = 0.5 * min((hi.x - lo.x) / n, (hi.y - lo.y) / n, dz)+ step_m = step * (sx + sy + sz) / 3+ span = (hi - lo).length+ xs = np.linspace(lo.x, hi.x, n, endpoint=False) + (hi.x - lo.x) / (2 * n)+ ys = np.linspace(lo.y, hi.y, n, endpoint=False) + (hi.y - lo.y) / (2 * n)+ out = []+ for k, j, i in zip(*np.nonzero(vis > 0)):+ p = Vector((xs[i], ys[j], zs[k]))+ best = 0.0+ for c in cams:+ d = (p - inv @ c).normalized()+ ts = np.arange(-span, span, step)+ P = np.array(p)[None] + ts[:, None] * np.array(d)[None]+ ii = np.floor((P[:, 0] - lo.x) / (hi.x - lo.x) * n).astype(int)+ jj = np.floor((P[:, 1] - lo.y) / (hi.y - lo.y) * n).astype(int)+ kk = np.floor((P[:, 2] - lo.z) / (hi.z - lo.z) * levels).astype(int)+ ok = (ii >= 0) & (ii < n) & (jj >= 0) & (jj < n) & (kk >= 0) & (kk < levels)+ best = max(best, float(np.clip(field[kk[ok], jj[ok], ii[ok]], 0, None).sum() * step_m))+ out.append(best)+ return float(np.percentile(out, 90)) if out else 0.0+++def visible_rz(em, R, zw):+ w = np.clip(em, 0, None)+ if w.sum() <= 0:+ return None+ rr = np.broadcast_to(R[None], w.shape).ravel()+ zz = np.broadcast_to(np.array(zw)[:, None, None], w.shape).ravel()+ ww = w.ravel()+ o = np.argsort(rr)+ c = np.cumsum(ww[o]) / ww.sum()+ return {"r": round(float((rr * ww).sum() / ww.sum()), 3), "z": round(float((zz * ww).sum() / ww.sum()), 3),+ "r10": round(float(rr[o][np.searchsorted(c, 0.1)]), 3), "r90": round(float(rr[o][np.searchsorted(c, 0.9)]), 3)}+++def fire_entry(sc, o, m, frame, fps, ev, conf):+ n = 32+ lo, hi, zs, f = sample_slices(o, m, frame, n=n, levels=12)+ em_all = f["emission"]+ st_all = plume_stats(o, lo, hi, zs, em_all, n)+ pk_all = max(x["peak"] for x in st_all if x)+ # Only what a scene camera can see counts (Cycles hides the rest the same way): burner jets under a wok, flame+ # inside a collar, a fire behind fireplace walls. Measure the visible part; fall back to the upper half of the band+ # when nothing is visible (a fire inside a closed box is still worth a glow).+ em, vfrac = visible_field(sc, o, lo, hi, zs, em_all, n)+ st = plume_stats(o, lo, hi, zs, em, n)+ # A visible arc covers few texels: compare per-level maxima, not the slice-wide percentile in plume_stats.+ mx_vis = em.reshape(len(zs), -1).max(axis=1)+ occluded = bool(mx_vis.max() < 0.01 * float(em_all.max()))+ lev = [k for k in range(len(zs)) if st[k] and mx_vis[k] > 0.08 * mx_vis.max()] if not occluded else []+ if occluded:+ em, st = em_all, st_all+ lev = [k for k, r in enumerate(st) if r and r["peak"] > 0.08 * pk_all]+ mw = o.matrix_world+ zw = [(mw @ Vector((0, 0, zs[k]))).z for k in range(len(zs))]+ vis = (lev[len(lev) // 2:] if len(lev) > 3 else lev) if occluded else lev+ z0, z1 = zw[vis[0]], zw[lev[-1]]+ dz = (zw[1] - zw[0]) if len(zw) > 1 else 0.05+ # The ring is the emission-weighted radius of the visible part about the whole flame's axis (only the arc facing+ # the camera is visible, so the visible centroid itself is off-axis).+ axis = st_all[lev[0]]["c"] if st_all[lev[0]] else st[lev[0]]["c"]+ ax, ay = (mw.inverted() @ axis).xy+ sx, sy, _ = mw.to_scale()+ gx = np.linspace(lo.x, hi.x, n, endpoint=False) + (hi.x - lo.x) / (2 * n)+ gy = np.linspace(lo.y, hi.y, n, endpoint=False) + (hi.y - lo.y) / (2 * n)+ GX, GY = np.meshgrid(gx, gy)+ R = np.hypot((GX - ax) * sx, (GY - ay) * sy)+ wv = np.clip(em[vis], 0, None)+ ring = float((wv * R[None]).sum() / wv.sum()) if not occluded else float(max(st[k]["r_peak"] for k in vis))+ base = {"c": Vector((axis.x, axis.y, z0))}+ width = max(0.01, float(np.average([st_all[k]["spread"] for k in vis if st_all[k]])) * 0.5)+ E = float(np.percentile(em[lev][em[lev] > 0], 99)) if (em[lev] > 0).any() else float(np.percentile(em_all, 99))+ # Colour from the visible upper part of the flame (the blue base is the Core emitter's job).+ # The licking tips (faint, above the 8% body threshold) carry the flame colour; the blue base is the Core emitter.+ pk = max(x["peak"] for x in st_all if x)+ faint = [k for k, r in enumerate(st_all) if r and r["peak"] > 0.01 * pk]+ upper = set(faint[-3:])+ weights = [st_all[k]["sum"] if st_all[k] and k in upper else 0 for k in range(len(zs))]+ gz = [(k + 0.5) / len(zs) for k in range(len(zs))]+ # Flame body colour = the warmest colour among emitting levels (the blue base is drawn by the Core emitter).+ cands = [emission_colour(m, [gz[k]], [1.0]) for k in faint]+ col = max(cands, key=lambda c: c[0] / (c[2] + 0.05)) if cands else emission_colour(m, gz, weights)+ if max(col) < 1e-3: # an emissive flame is never black: fall back to the whole flame's emission-weighted colour+ col = emission_colour(m, gz, [st_all[k]["sum"] if st_all[k] else 0 for k in range(len(zs))])+ mx = max(col) or 1.0+ height = max(0.03, z1 - z0 + dz)+ scroll = mapping_scroll(m, fps) or [0, 0, 1.0]+ boil = noise_evolution(m, fps)+ life = float(np.clip(height / max(scroll[2], 0.3), 0.18, 0.5))+ c = Vector((base["c"].x, base["c"].y, z0))+ e = base_entry(o.name, "fire", conf, "volume_shader", [o.name], m.name, ev, ue_vec(c),+ [(hi.x - lo.x) * 50 * mw.to_scale()[0], (hi.y - lo.y) * 50 * mw.to_scale()[1], (height + 0.1) * 100],+ "niagara", "NS_Fire", fps, 1.0)+ e["bounds_local"] = {"min": [-(ring + 0.15) * 100, -(ring + 0.15) * 100, -10], "max": [(ring + 0.15) * 100, (ring + 0.15) * 100, (height + 0.25) * 100]}+ e["emitter_shape"] = {"kind": "ring", "extent_cm": [ring * 100, ring * 100, 2]}+ tongue = max(height, 0.08) * 100+ # What Cycles shows is the emission integrated along the view ray, through the whole flame in front of and behind+ # the visible sample (the hidden core still glows through the gap). Sprites overlap ~2x (see SpawnRate).+ L = view_radiance(sc, o, lo, hi, zs, em_all, em if not occluded else em_all, n)+ nits = LM_PER_W * (L if L > 0 else E * 0.45 * tongue / 100) * 0.5+ set_params(e, {+ "RingRadius": ring * 100, "BoxExtent": [ring * 100, ring * 100, 2],+ "Velocity": [0, 0, tongue / life], "LifetimeMin": life * 0.7, "LifetimeMax": life * 1.1,+ # Tongue sprites: ~1/4 of the flame height wide, 2.5x as tall (the slice spread of a ring is ~ its radius,+ # so it cannot give the tongue width).+ "SizeMin": max(2.0, tongue * 0.35), "SizeMax": max(3.0, tongue * 0.55), "Aspect": 2.5,+ # Enough tongues for a continuous ring: circumference / tongue width, refreshed every lifetime, x2 overlap.+ "SpawnRate": float(np.clip(2 * (2 * math.pi * ring * 100) / max(tongue * 0.32, 1) / life, 30, 600)),+ "Color": [col[0] / mx, col[1] / mx, col[2] / mx, 1.0], "Intensity": nits, "Opacity": 1.0,+ "NoiseStrength": 300 + 30 * boil, "NoiseFreq": 0.06, "Drag": 2.0, "VelocityJitter": 0.3, "Grow": -0.5,+ "CoreIntensity": 0.35, "LightIntensity": 0.0, "LightRadius": max(100.0, tongue * 6), "LightOffset": [0, 0, tongue * 0.5],+ })+ e["physical"] = {"emission_nits": round(nits, 1), "view_radiance_p90": round(L, 4), "emission_color": col, "emission_per_m_p99": E, "ring_radius_m": ring,+ "height_m": height, "tongue_halfwidth_m": width,+ "profile": [[round(zw[k], 3), round(st[k]["r_peak"], 3), round(st[k]["peak"], 2)] for k in lev], "scroll_m_s": scroll, "noise_w_rate": boil,+ # [z, emission seen by a scene camera / total] per emitting level+ "visibility": [[round(zw[k], 3), round(vfrac[k], 3)] for k in range(len(zs)) if st_all[k]],+ "occluded_fallback": occluded,+ # where the camera-visible emission sits: weighted r (m, about the axis) and z (m, world), r 10/90 %+ "visible_rz": visible_rz(em, R, zw)}+ e["time"]["preroll_s"] = round(life * 3, 2)+ L = nearest_light(sc, c, 1.0)+ e["light_link"] = L+ if L:+ e["notes"].append(f"practical light {L} lights the set; Niagara LightIntensity left at 0 (no double lighting)")+ fl = flicker(sc, L, frame, 240, fps)+ if fl:+ e["flicker"] = fl+ return e+++def steam_entry(sc, o, m, frame, fps, typ, ev, conf):+ n = 32+ lo, hi, zs, f = sample_slices(o, m, frame, n=n, levels=12)+ d = f["density"]+ st = plume_stats(o, lo, hi, zs, d, n)+ mw = o.matrix_world+ good = [k for k, r in enumerate(st) if r and r["peak"] > 0.05 * max(x["peak"] for x in st if x)]+ if not good:+ return None+ b, t = st[good[0]], st[good[-1]]+ z0 = (mw @ Vector((0, 0, lo.z))).z+ ztop = t["c"].z+ height = max(0.2, ztop - z0)+ scroll = mapping_scroll(m, fps) or [0, 0, 0.5]+ rise = max(0.15, scroll[2])+ # The 4D noise scrolls fast but the plume body is only ~height/rise old at the top: lifetime = reach / rise.+ life = float(np.clip(height / rise, 1.0, 6.0))+ lean = (t["c"] - b["c"]) / life # m/s horizontal drift of the centroid+ sigma = float(np.percentile(d[good], 95)) # 1/m in the wisps+ width = 2 * float(np.mean([st[k]["spread"] for k in good]))+ tau = sigma * width # optical depth across the plume in the dense wisps+ base_r = max(0.04, b["spread"])+ alb = list(principled_volume(m).inputs["Color"].default_value)[:3]+ # Sprites: start ~2 x base radius, grow so the top spread matches.+ s0 = base_r * 2 * 100+ grow = float(np.clip((2 * t["spread"] * 100) / max(s0, 1) - 1, 1.0, 6.0))+ rate = float(np.clip(60.0 * height, 40, 160)) # puffs per second: ~100-300 alive per plume+ alive = rate * life+ overlap = max(1.0, alive * (s0 * (1 + grow / 2)) ** 2 / max((width * 100) * (height * 100), 1))+ alpha = float(np.clip(1 - math.exp(-tau / overlap), 0.02, 0.6))+ c = Vector((b["c"].x, b["c"].y, z0))+ e = base_entry(o.name, typ, conf, "volume_shader", [o.name], m.name, ev, ue_vec(c),+ [(hi.x - lo.x) * 50 * mw.to_scale()[0], (hi.y - lo.y) * 50 * mw.to_scale()[1], height * 50 + 30],+ "niagara", "NS_Steam" if typ == "steam" else "NS_Steam", fps, round(life * 1.5, 2))+ ext = [(hi.x - lo.x) * mw.to_scale()[0] * 100, (hi.y - lo.y) * mw.to_scale()[1] * 100]+ e["bounds_local"] = {"min": [-ext[0], -ext[1], -20], "max": [ext[0], ext[1], height * 100 + 80]}+ e["emitter_shape"] = {"kind": "disc", "extent_cm": [base_r * 100, base_r * 100, 2]}+ set_params(e, {+ "SpawnRate": rate, "LifetimeMin": life * 0.8, "LifetimeMax": life * 1.1,+ "SizeMin": s0 * 0.8, "SizeMax": s0 * 1.3, "Grow": grow,+ "Velocity": [0, 0, rise * 100], "Wind": ue_dir(Vector((lean.x, lean.y, 0))), "Drag": 1.2, "VelocityJitter": 0.3,+ "BoxExtent": [base_r * 100, base_r * 100, 2], "Color": alb + [1.0], "Opacity": alpha, "Intensity": 0.0,+ "NoiseStrength": 40 + 30 * rise, "NoiseFreq": 0.02,+ })+ e["physical"] = {"density_per_m": sigma, "optical_depth": tau, "albedo": alb,+ "anisotropy": principled_volume(m).inputs["Anisotropy"].default_value, "lifetime_s": [life],+ "drift_cm_s": [x * 100 for x in lean], "noise_scale_cm": None, "height_m": height, "width_m": width,+ "base_radius_m": base_r, "scroll_m_s": scroll}+ e["notes"].append(f"alive ~{alive:.0f} sprites, est. overlap {overlap:.1f}")+ return e+++def particle_entry(sc, o, frame, fps, shutter):+ md = next(md for md in o.modifiers if md.type == "PARTICLE_SYSTEM")+ ps = md.particle_system.settings+ span = max(1, ps.frame_end - ps.frame_start)+ life_s = ps.lifetime / fps+ v = Vector(ps.object_align_factor)+ speed = v.length+ g = ps.effector_weights.gravity+ ev = [f"particles count {ps.count} over {span} frames, life {life_s:.2f}s, velocity {tuple(round(x, 2) for x in v)}, gravity {g}"]+ inst = ps.instance_object+ radius, length = 0.001, 0.02+ if inst:+ dims = sorted(inst.dimensions)+ radius, length = dims[0] / 2, dims[2]+ score = {}+ if speed >= 3 and v.z < 0 and g < 0.5:+ score["rain"] = 4+ if speed < 1 and g >= 0.5:+ score["drips"] = 4+ if speed < 0.2 and g < 0.1:+ score["dust"] = 3+ if v.z > 0.5 and g >= 0.5:+ score["fountain"] = 3 # launched upward, falls back: jets, sprinklers+ if g >= 0.3 and life_s < 1.5 and speed >= 1:+ score["sparks"] = score.get("sparks", 0) + 2 # short-lived ballistic bits (+ emissive instance below)+ for t in name_hint(o.name):+ score[t] = score.get(t, 0) + 2+ if not score:+ return unknown_entry(o, "particles", ev, fps)+ ranked = sorted(score.items(), key=lambda kv: -kv[1])+ typ = ranked[0][0]+ conf = ranked[0][1] / (ranked[0][1] + (ranked[1][1] if len(ranked) > 1 else 0))+ corners = [o.matrix_world @ Vector(c) for c in o.bound_box]+ lo = Vector([min(c[i] for c in corners) for i in range(3)])+ hi = Vector([max(c[i] for c in corners) for i in range(3)])+ ctr = (lo + hi) / 2+ half = [(hi[i] - lo[i]) * 50 for i in range(3)]+ rate = ps.count / span * fps+ # Drop material: emission strength + alpha of the instance (Principled).+ emis, alpha, colr = 0.0, 1.0, [0.8, 0.85, 0.9]+ if inst and inst.material_slots and inst.material_slots[0].material and inst.material_slots[0].material.node_tree:+ b = next((n for n in inst.material_slots[0].material.node_tree.nodes if n.type == "BSDF_PRINCIPLED"), None)+ if b:+ emis = b.inputs["Emission Strength"].default_value+ alpha = b.inputs["Alpha"].default_value+ colr = list(b.inputs["Emission Color"].default_value)[:3] if emis > 0 else list(b.inputs["Base Color"].default_value)[:3]+ width_cm = max(0.15, radius * 2 * 100)+ preroll = max(0.0, -ps.frame_start / fps)+ if typ == "rain":+ # Streak = drop length + distance travelled during the shutter (Cycles renders the drops motion-blurred).+ streak = length + speed * shutter / fps+ fall_h = hi.z - ground_z(sc, ctr, lo.z)+ life = min(life_s, fall_h / max(speed, 0.1) + 0.05)+ e = base_entry(o.name, "rain", conf, "particles", [o.name], inst.name if inst else None, ev, ue_vec(ctr), half, "niagara", "NS_Rain", fps, round(life * 1.5, 2))+ e["bounds_local"] = {"min": [-half[0] - 50, -half[1] - 50, -fall_h * 100 - 50], "max": [half[0] + 50, half[1] + 50, 50]}+ e["emitter_shape"] = {"kind": "box", "extent_cm": half}+ # Same alive density as Blender (count over its own lifetime), but only for the part above the ground.+ set_params(e, {"SpawnRate": rate, "LifetimeMin": life * 0.95, "LifetimeMax": life,+ "Velocity": ue_dir(v), "VelocityJitter": ps.factor_random * 0.2, "BoxExtent": half,+ "SizeMin": width_cm * (1 - ps.size_random), "SizeMax": width_cm, "Aspect": streak * 100 / width_cm,+ "Color": colr + [1.0], "Intensity": LM_PER_W * emis * length / streak, "Opacity": alpha, "Gravity": 0.0, "Drag": 0.0})+ e["physical"] = {"count": ps.count, "lifetime_s": [life_s], "velocity_cm_s": ue_dir(v), "size_cm": [width_cm, streak * 100],+ "emission_nits": LM_PER_W * emis, "fall_m": fall_h}+ e["notes"].append(f"streak {streak * 100:.1f} cm = drop {length * 100:.1f} cm + {speed:.1f} m/s x {shutter / fps * 1000:.0f} ms shutter")+ else:+ gz = ground_z(sc, ctr, lo.z)+ fall_h = max(0.05, lo.z - gz)+ v0 = -v.z+ t_fall = (-v0 + math.sqrt(v0 * v0 + 2 * 9.81 * g * fall_h)) / (9.81 * g) if g > 0 else fall_h / max(v0, 0.1)+ life = min(life_s, t_fall)+ e = base_entry(o.name, typ, conf, "particles", [o.name], inst.name if inst else None, ev, ue_vec(ctr), half, "niagara",+ {"drips": "NS_Drips", "dust": "NS_DustMotes", "sparks": "NS_Sparks", "fountain": "NS_FountainJet"}.get(typ, "NS_Drips"),+ fps, round(life * 2, 2))+ e["bounds_local"] = {"min": [-half[0] - 30, -half[1] - 30, -fall_h * 100 - 30], "max": [half[0] + 30, half[1] + 30, 30]}+ e["emitter_shape"] = {"kind": "line" if min(half[0], half[1]) < 5 else "box", "extent_cm": half}+ streak = length + (v0 + 9.81 * g * life * 0.5) * shutter / fps * 0.5+ set_params(e, {"SpawnRate": rate, "LifetimeMin": life, "LifetimeMax": life, "Velocity": ue_dir(v), "Gravity": g, "Drag": 0.0,+ "VelocityJitter": ps.factor_random * 0.2, "BoxExtent": half, "SizeMin": width_cm * (1 - ps.size_random),+ "SizeMax": width_cm, "Aspect": max(1.0, streak * 100 / width_cm), "Color": colr + [1.0],+ "Intensity": LM_PER_W * emis * length / max(streak, length), "Opacity": alpha})+ e["physical"] = {"count": ps.count, "lifetime_s": [life_s], "gravity": g, "size_cm": [width_cm, length * 100], "fall_m": fall_h,+ "ground_z_m": gz}+ e["notes"].append("Intensity = 683 x drop emission x drop / streak length: Cycles smears the drop's radiance over its motion-blurred"+ " streak; sub-pixel streaks keep their energy through the sprite renderer's pixel coverage")+ return e+++def unknown_entry(o, kind, ev, fps, mat=None):+ """Something animated we could not classify: keep its box and evidence, queue it for the agent (FX_AGENT.md)."""+ corners = [o.matrix_world @ Vector(c) for c in o.bound_box]+ lo = Vector([min(c[i] for c in corners) for i in range(3)])+ hi = Vector([max(c[i] for c in corners) for i in range(3)])+ e = base_entry(o.name, "unknown", 0.0, kind, [o.name], mat, ev, ue_vec((lo + hi) / 2), [(hi[i] - lo[i]) * 50 for i in range(3)],+ "agent", None, fps, 0.0)+ e["notes"].append("unclassified: pick or author a template (fx_recipes), then set technique/template/params")+ return e+++def ground_z(sc, p, below):+ dg = bpy.context.evaluated_depsgraph_get()+ hit, loc, *_ = sc.ray_cast(dg, Vector((p.x, p.y, below - 0.01)), Vector((0, 0, -1)), distance=50.0)+ return loc.z if hit else 0.0+++def classify(sc, frame, emitter_names, volume_objects, templates_json=None):+ """Return the fx list for the scene. `volume_objects`: names of volume-only mesh objects; `emitter_names`: objects+ with particle systems. Entries claiming a volume carry source.objects = [name]."""+ global PARAM_TYPES+ if templates_json and os.path.exists(templates_json):+ PARAM_TYPES = json.load(open(templates_json))+ fps = sc.render.fps / sc.render.fps_base+ shutter = sc.render.motion_blur_shutter if sc.render.use_motion_blur else 0.0+ sc.frame_set(frame)+ out = []+ for name in volume_objects:+ o = sc.objects[name]+ m = volume_material(o)+ if not m:+ continue+ typ, ev, conf = classify_volume(sc, o, m, frame, fps)+ log("volume", name, typ, round(conf, 2), ev)+ if typ == "fire":+ out.append(fire_entry(sc, o, m, frame, fps, ev, conf))+ elif typ in ("steam", "smoke"):+ e = steam_entry(sc, o, m, frame, fps, typ, ev, conf)+ if e:+ out.append(e)+ elif typ is None:+ out.append(unknown_entry(o, "volume_shader", ev, fps, m.name))+ # haze stays on the fog path (height fog / local fog volumes)+ for name in emitter_names:+ o = sc.objects[name]+ e = particle_entry(sc, o, frame, fps, shutter)+ if e:+ out.append(e)+ log("particles", name, e["type"], e["confidence"])+ sc.frame_set(frame)+ return out+++def main():+ argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+ a = lambda k, d=None: argv[argv.index(k) + 1] if k in argv else d # noqa: E731+ scene_in, out = a("--scene"), a("--out")+ frame = int(a("--frame", "60"))+ sc = bpy.context.scene+ vols = [o.name for o in sc.objects if o.type == "MESH" and not o.hide_render and volume_material(o)+ and all((s.material is None) or s.material == volume_material(o) or True for s in o.material_slots)]+ ems = [o.name for o in sc.objects if not o.hide_render and any(md.type == "PARTICLE_SYSTEM" for md in o.modifiers)]+ fx = classify(sc, frame, ems, vols, a("--templates", os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates.json")))+ scene = json.load(open(scene_in, encoding="utf-8")) if scene_in else {}+ scene["fx"] = fx+ claimed = {o for e in fx for o in e["source"]["objects"]}+ for k, v in scene.get("volumes", {}).items():+ if k in claimed:+ v["claimed_by_fx"] = True+ json.dump(scene, open(out, "w", encoding="utf-8"), indent=1)+ log("wrote", out, len(fx), "fx entries", [(e["id"], e["type"]) for e in fx])+++if __name__ == "__main__":+ main()diff --git a/unreal/fx_pack.py b/unreal/fx_pack.pynew file mode 100644index 0000000..74d14d1--- /dev/null+++ b/unreal/fx_pack.py@@ -0,0 +1,588 @@+"""Build the AnySceneFX template pack (/Game/AnySceneFX) from scratch: sprite materials + NS_Fire, NS_Steam, NS_Rain,+NS_Drips, NS_DustMotes, every one exposing the shared User parameters from NIAGARA.md §3, and write templates.json+(the param_types contract build_level.py reads).++Headless, rerunnable (deletes and rebuilds the pack); needs the NiagaraToolsets + ToolsetRegistry plugins enabled:+ UnrealEditor-Cmd <project>.uproject -run=pythonscript -script="<path>/fx_pack.py" -unattended -nosplash -nop4+Env: ANYSCENEFX_ROOT (default /Game/AnySceneFX), ANYSCENEFX_JSON (where templates.json goes, default next to this file),+ ANYSCENEFX_RECIPES (extra recipe folders), ANYSCENEFX_ONLY (comma list of NS_ names to rebuild; others untouched).++Authoring goes through Epic's experimental NiagaraToolsets (unreal.ToolsetRegistry.execute_tool), wrapped in fxlib.py.+Every template starts from the stateful Fountain emitter (SpawnRate, InitializeParticle, ShapeLocation, AddVelocity,+GravityForce, Drag, ScaleColor, Solve) and rewires its inputs to User parameters with links or one-line HLSL.+"""+import json+import os+import re+import sys++sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))+import unreal # noqa: E402++import fxlib as F # noqa: E402++ROOT = os.environ.get("ANYSCENEFX_ROOT", "/Game/AnySceneFX")+OUT_JSON = os.environ.get("ANYSCENEFX_JSON", os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates.json"))+EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+REPORT = {"systems": {}, "materials": [], "errors": []}+++def log(*a):+ unreal.log_warning("FXPACK " + " ".join(str(x) for x in a))+++# ------------------------------------------------------------------ materials++# Shared HLSL helpers for the Custom nodes: value noise + fbm, and a blackbody approximation (Kelvin -> linear RGB).+HELPERS = """struct AFX {+ float h(float2 p) { return frac(sin(dot(p, float2(127.1, 311.7))) * 43758.5453); }+ float n(float2 p) { float2 i = floor(p); float2 f = frac(p); f = f * f * (3.0 - 2.0 * f);+ return lerp(lerp(h(i), h(i + float2(1, 0)), f.x), lerp(h(i + float2(0, 1)), h(i + float2(1, 1)), f.x), f.y); }+ float fbm(float2 p) { return 0.5 * n(p) + 0.25 * n(p * 2.03 + 1.7) + 0.125 * n(p * 4.01 + 3.1); }+ float3 bb(float k) { float t = clamp(k, 1000.0, 12000.0) / 100.0;+ float r = t <= 66.0 ? 1.0 : saturate(1.292936 * pow(t - 60.0, -0.1332047));+ float g = t <= 66.0 ? saturate(0.3900816 * log(t) - 0.6318414) : saturate(1.129891 * pow(t - 60.0, -0.0755148));+ float b = t >= 66.0 ? 1.0 : (t <= 19.0 ? 0.0 : saturate(0.5432068 * log(t - 10.0) - 1.1962541));+ float3 c = float3(r, g, b); return c * c; }+};+AFX X;+"""++# Per material: custom HLSL for (rgb, opacity). Inputs: UV, PC (particle colour rgb), PA (particle alpha), R (particle+# random), T (time), DP (dynamic parameter: x = Intensity, y = Temperature K).+MATS = {+ # Additive flame tongue on a tall sprite (UV.y 0 = top). Colour hotter at the base; Temperature > 0 swaps in blackbody.+ "M_AFX_Flame": dict(blend="ADDITIVE", lit=False, rgb="""+float y = 1.0 - UV.y;+float t = T * 1.6 + R * 17.0;+float d = X.fbm(float2(UV.x * 3.0 + R * 5.0, y * 2.0 - t * 2.2)) - 0.5;+float x = (UV.x - 0.5 + d * 0.25 * y) * 2.0;+float w = lerp(0.85, 0.3, saturate(y));+float across = exp(-3.0 * (x / w) * (x / w));+float along = smoothstep(0.0, 0.15, y) * smoothstep(1.0, 0.45 + d * 0.4, y);+float body = across * along;+float3 col = DP.y > 0 ? X.bb(DP.y * lerp(1.15, 0.8, y)) : PC * lerp(float3(1.25, 1.15, 0.95), float3(0.95, 0.75, 0.65), y);+return col * body * PA * DP.x;""", op="return 1;"),+ # Soft, noisy steam puff. Lit translucent (volumetric non-directional), before DOF, depth-faded.+ "M_AFX_Steam": dict(blend="TRANSLUCENT", lit=True, depth_fade=12.0, rgb="return PC * DP.x;", base="return PC;", op="""+float2 c = UV - 0.5;+float r = length(c) * 2.0;+float a = saturate(1.0 - r); a = a * a * (3.0 - 2.0 * a);+float n = X.fbm(UV * 2.6 + float2(R * 7.1, R * 3.3 + T * 0.12));+return PA * a * saturate(n * 1.8 - 0.3);"""),+ # Velocity-aligned streak (UV.x across, UV.y along), lit with a little emissive so it reads against the dark.+ "M_AFX_Streak": dict(blend="TRANSLUCENT", lit=True, rgb="""+float x = abs(UV.x - 0.5) * 2.0;+float a = saturate(1.0 - x);+return PC * DP.x * a * a;""", base="return PC;", op="""+float x = abs(UV.x - 0.5) * 2.0;+float a = saturate(1.0 - x); a *= a;+return PA * a * saturate(UV.y * 5.0) * saturate((1.0 - UV.y) * 5.0);"""),+ # Round mote.+ "M_AFX_Mote": dict(blend="TRANSLUCENT", lit=True, rgb="return PC * DP.x;", base="return PC;", op="""+float r = length(UV - 0.5) * 2.0;+float a = saturate(1.0 - r);+return PA * a * a;"""),+}+++def make_material(name, spec):+ folder = f"{ROOT}/Materials"+ path = f"{folder}/{name}"+ if EAL.does_asset_exist(path):+ # The templates reference their materials and deleting a referenced asset can crash the editor: rebuild the+ # graph in place.+ m = EAL.load_asset(path)+ MEL.delete_all_material_expressions(m)+ else:+ m = AT.create_asset(name, folder, unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", getattr(unreal.BlendMode, "BLEND_" + spec["blend"]))+ m.set_editor_property("two_sided", True)+ if spec["lit"]:+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_DEFAULT_LIT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_VOLUMETRIC_NON_DIRECTIONAL)+ else:+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # Foreground plumes in defocused areas (cam_wok) must blur with DOF.+ m.set_editor_property("translucency_pass", unreal.MaterialTranslucencyPass.MTP_BEFORE_DOF)+ MEL.set_material_usage(m, unreal.MaterialUsage.MATUSAGE_NIAGARA_SPRITES)+ y = 0+ def node(cls, x=-900):+ nonlocal y+ y += 160+ return MEL.create_material_expression(m, cls, x, y)+ uv = node(unreal.MaterialExpressionTextureCoordinate)+ pc = node(unreal.MaterialExpressionParticleColor)+ pr = node(unreal.MaterialExpressionParticleRandom)+ tm = node(unreal.MaterialExpressionTime)+ dp = node(unreal.MaterialExpressionDynamicParameter)+ # DynamicParameter defaults (used if the emitter does not write Particles.DynamicMaterialParameter): 1 nit, no blackbody.+ dp.set_editor_property("default_value", unreal.LinearColor(1.0, 0.0, 0.0, 0.0))+ dpm = node(unreal.MaterialExpressionComponentMask)+ dpm.set_editor_property("r", True)+ dpm.set_editor_property("g", True)+ MEL.connect_material_expressions(dp, "RGBA", dpm, "")++ def custom(code, out_type):+ c = node(unreal.MaterialExpressionCustom, -400)+ c.set_editor_property("code", HELPERS + code.strip())+ c.set_editor_property("output_type", out_type)+ ins = []+ for nm in ("UV", "PC", "PA", "R", "T", "DP"):+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", nm)+ ins.append(ci)+ c.set_editor_property("inputs", ins)+ MEL.connect_material_expressions(uv, "", c, "UV")+ MEL.connect_material_expressions(pc, "", c, "PC")+ MEL.connect_material_expressions(pc, "A", c, "PA")+ MEL.connect_material_expressions(pr, "", c, "R")+ MEL.connect_material_expressions(tm, "", c, "T")+ MEL.connect_material_expressions(dpm, "", c, "DP")+ return c++ MEL.connect_material_property(custom(spec["rgb"], unreal.CustomMaterialOutputType.CMOT_FLOAT3), "",+ unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ if spec.get("base"):+ MEL.connect_material_property(custom(spec["base"], unreal.CustomMaterialOutputType.CMOT_FLOAT3), "",+ unreal.MaterialProperty.MP_BASE_COLOR)+ if spec["blend"] != "ADDITIVE":+ op = custom(spec["op"], unreal.CustomMaterialOutputType.CMOT_FLOAT1)+ if spec.get("depth_fade"):+ df = node(unreal.MaterialExpressionDepthFade, -150)+ df.set_editor_property("fade_distance_default", spec["depth_fade"])+ MEL.connect_material_expressions(op, "", df, "Opacity")+ op = df+ MEL.connect_material_property(op, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ REPORT["materials"].append(path)+ return f"{path}.{name}"+++# ------------------------------------------------------------------ niagara helpers++NT = { # Niagara type structs for user variables / linked inputs+ "float": "/Script/Niagara.NiagaraFloat", "int": "/Script/Niagara.NiagaraInt32", "bool": "/Script/Niagara.NiagaraBool",+ "vec3": "/Script/CoreUObject.Vector3f", "vec2": "/Script/CoreUObject.Vector2f", "color": "/Script/CoreUObject.LinearColor",+ "pos": "/Script/Niagara.NiagaraPosition", "vec4": "/Script/CoreUObject.Vector4f",+}+ENUMS = {}+++def enum_value(enum_path, want):+ """Enum inputs come back as NewEnumeratorN: resolve a display name (case-insensitive substring) to its entry."""+ if enum_path not in ENUMS:+ info = F.call("UEnum_Info", {"enum": F.ref(enum_path)}, toolset="NiagaraToolsets.NiagaraToolset_Info")+ ENUMS[enum_path] = info+ info = ENUMS[enum_path]+ s = info if isinstance(info, str) else json.dumps(info)+ try:+ d = json.loads(s)+ while isinstance(d, str):+ d = json.loads(d)+ except Exception:+ d = None+ pairs = []+ if isinstance(d, dict):+ vals = d.get("returnValue", d)+ if isinstance(vals, str):+ try:+ vals = json.loads(vals)+ except Exception:+ pass+ if isinstance(vals, dict):+ vals = vals.get("Values", vals.get("values", []))+ for v in vals if isinstance(vals, list) else []:+ if isinstance(v, dict):+ pairs.append((v.get("Name") or v.get("name"), v.get("DisplayName") or v.get("displayName") or ""))+ if not pairs:+ pairs = re.findall(r'"(?:name|enumName)"\s*:\s*"([^"]+)"[^}]*?"display(?:Name)?"\s*:\s*"([^"]*)"', s)+ for nm, disp in pairs:+ if want.lower() == (disp or "").lower():+ return nm, disp+ for nm, disp in pairs:+ if want.lower() in (disp or "").lower() or want.lower() in nm.lower():+ return nm, disp+ raise RuntimeError(f"enum {enum_path}: no value like {want!r} in {pairs} raw={s[:1500]}")+++def v_float(x):+ return {"struct": F.ref("/Script/Niagara.NiagaraFloat"), "value": {"value": float(x)}}+++def v_bool(b):+ return {"struct": F.ref("/Script/Niagara.NiagaraBool"), "value": {"value": -1 if b else 0}}+++def v_int(i):+ return {"struct": F.ref("/Script/Niagara.NiagaraInt32"), "value": {"value": int(i)}}+++def v_link(name, typ):+ return {"struct": F.ref("/Script/NiagaraEditor.NiagaraExt_StackInputData_Linked"),+ "value": {"linkedVariable": {"name": name, "type": {"classStructOrEnum": F.ref(NT[typ])}}}}+++def v_hlsl(expr):+ return {"struct": F.ref("/Script/NiagaraEditor.NiagaraExt_StackInputData_HlslExpression"), "value": {"hlslExpression": expr}}+++class Sys:+ def __init__(self, name, params):+ self.name = name+ self.final = f"{ROOT}/Systems/{name}"+ self.path = f"{self.final}.{name}"+ self.params = params+ self.topo = {}+ self.issues = []+ if EAL.does_asset_exist(self.final):+ # Placed levels reference the templates and deleting (or consolidating) a referenced system crashes the+ # editor or leaves redirectors: rebuild in place instead. Strip every emitter and user variable, keep the asset.+ summ = F.call("GetSystemSummary", {"system": F.ref(self.path)})+ summ = summ.get("returnValue", summ)+ for e in summ.get("emitters", []):+ F.call("RemoveEmitter", {"emitterToRemove": F.item(self.path, e["emitterName"])}, check=False)+ old_uv = [{"name": u["name"], "type": u["type"]} for u in summ.get("userVariables", [])]+ if old_uv:+ F.call("RemoveUserVariables", {"system": F.ref(self.path), "variablesToRemove": old_uv}, check=False)+ log("system", name, "rebuilt in place: removed", len(summ.get("emitters", [])), "emitters,", len(old_uv), "user vars")+ else:+ F.call("CreateNiagaraSystem", {"assetName": name, "assetPath": f"{ROOT}/Systems",+ "templateSystem": F.ref("/Niagara/DefaultAssets/DefaultSystem.DefaultSystem")})+ # DefaultSystem ships with a stock "Fountain" emitter: drop it, templates add their own named emitters.+ F.call("RemoveEmitter", {"emitterToRemove": F.item(self.path, "Fountain")}, check=False)+ uv = []+ for k, (t, dv, desc) in params.items():+ if t == "float":+ val = v_float(dv)+ elif t == "int":+ val = v_int(dv)+ elif t == "bool":+ val = v_bool(dv)+ elif t == "color":+ val = {"struct": F.ref("/Script/CoreUObject.LinearColor"), "value": dict(zip("rgba", list(dv) + [1.0] * (4 - len(dv))))}+ else: # vec3 / pos+ val = {"struct": F.ref(NT[t] if t == "pos" else "/Script/CoreUObject.Vector3f"), "value": dict(zip("xyz", dv))}+ uv.append({"name": k, "type": {"classStructOrEnum": F.ref(NT[t])}, "defaultValue": val, "description": desc})+ try:+ F.call("AddUserVariables", {"system": F.ref(self.path), "variablesToAdd": uv})+ except RuntimeError:+ # Some builds only accept the double-precision Vector struct as a default value: retry vec3 defaults that way.+ for u in uv:+ if u["defaultValue"]["struct"]["refPath"] == "/Script/CoreUObject.Vector3f":+ u["defaultValue"]["struct"] = F.ref("/Script/CoreUObject.Vector")+ F.call("AddUserVariables", {"system": F.ref(self.path), "variablesToAdd": uv})++ def system_data(self, **kw):+ F.call("SetSystemData", {"system": F.ref(self.path), "systemData": {"propertyValues": json.dumps(kw)}})++ def emitter(self, template, want):+ t = F.call("AddEmitter", {"system": F.ref(self.path), "emitterName": want,+ "templateEmitter": F.ref(f"/Niagara/DefaultAssets/Templates/Emitters/{template}.{template}")})+ t = t.get("returnValue", t) if isinstance(t, dict) else t+ name = t["emitterName"] if isinstance(t, dict) and "emitterName" in t else want+ self.topo[name] = t+ return name++ def emitter_data(self, em, **kw):+ F.call("SetEmitterData", {"emitter": F.item(self.path, em), "emitterData": {"propertyValues": json.dumps(kw)}})++ def inputs_of(self, em, script, module):+ t = F.call("GetModuleTopology", {"moduleRef": F.item(self.path, em, script, module)})+ t = t.get("returnValue", t)+ return {i["name"]: i for i in t.get("inputs", [])}++ def set(self, em, script, module, inp, val):+ """val: number | bool | ('link', 'User.X', type) | ('hlsl', expr) | ('enum', display) | raw instanced dict."""+ if isinstance(val, tuple) and val[0] == "enum":+ ins = self.inputs_of(em, script, module)+ if inp not in ins:+ raise RuntimeError(f"{self.name}/{em}/{module}: no input {inp!r}; have {sorted(ins)}")+ ep = ins[inp]["type"]["classStructOrEnum"]["refPath"]+ nm, disp = enum_value(ep, val[1])+ val = {"struct": F.ref("/Script/NiagaraEditor.NiagaraExt_StackInputData_Enum"),+ "value": {"enum": F.ref(ep), "enumName": nm, "displayName": disp}}+ elif isinstance(val, tuple) and val[0] == "link":+ val = v_link(val[1], val[2])+ elif isinstance(val, tuple) and val[0] == "hlsl":+ val = v_hlsl(val[1])+ elif isinstance(val, bool):+ val = v_bool(val)+ elif isinstance(val, (int, float)):+ val = v_float(val)+ try:+ F.call("SetStackInputData", {"stackInputRef": F.item(self.path, em, script, module, inputs=[inp]), "inputData": val})+ except RuntimeError as e:+ self.issues.append(f"set {em}/{module}/{inp}: {str(e)[:400]}")+ log("ERR", self.name, em, module, inp, str(e)[:400])++ def add_module(self, em, script, asset, before=""):+ t = F.call("AddModule", {"moduleLocationRef": F.item(self.path, em, script, before), "moduleAsset": F.ref(asset)})+ t = t.get("returnValue", t)+ return t["moduleName"], {i["name"]: i for i in t.get("inputs", [])}++ def set_params(self, em, script, entries, before=""):+ """entries: [(Particles.Name, type, hlsl)] -> one SetParameters module.+ AddSetParametersModule accepts an HLSL default without error but stores a garbage literal (seen: a Vector4f+ x = -4.2e36, which blacked out every emissive sprite). So always add with a typed placeholder, rewire each+ entry to its HLSL with SetStackInputData, and read the values back."""+ typed = {"float": v_float(0.0), "int": v_int(0), "bool": v_bool(False),+ "vec3": {"struct": F.ref("/Script/CoreUObject.Vector3f"), "value": {"x": 0, "y": 0, "z": 0}},+ "vec4": {"struct": F.ref("/Script/CoreUObject.Vector4f"), "value": {"x": 0, "y": 0, "z": 0, "w": 0}},+ "color": {"struct": F.ref("/Script/CoreUObject.LinearColor"), "value": {"r": 1, "g": 1, "b": 1, "a": 1}}}+ ps = [{"variable": {"name": n, "type": {"classStructOrEnum": F.ref(NT[t])}}, "defaultValue": typed[t]} for n, t, e in entries]+ try:+ t = F.call("AddSetParametersModule", {"moduleLocationRef": F.item(self.path, em, script, before), "parameters": ps})+ t = t.get("returnValue", t)+ mn = t["moduleName"]+ names = [i["name"] for i in t.get("inputs", [])]+ for n, ty, e in entries:+ k = next((x for x in names if x == n or x.endswith(n.split(".")[-1])), n)+ self.set(em, script, mn, k, ("hlsl", e))+ got = F.call("GetModuleInputValues", {"moduleRef": F.item(self.path, em, script, mn)}, check=False)+ got = got.get("returnValue", got) if isinstance(got, dict) else {}+ vals = {i["name"]: i.get("value", {}) for i in (got.get("inputs", []) if isinstance(got, dict) else [])}+ for n, ty, e in entries:+ v = next((v for k, v in vals.items() if k == n or k.endswith(n.split(".")[-1])), None)+ if v is None or "Hlsl" not in json.dumps(v.get("struct", {})):+ self.issues.append(f"setparams {em}/{n}: HLSL did not stick, read back {json.dumps(v)[:200]}")+ log("ERR", self.name, em, "setparams readback", n, json.dumps(v)[:200])+ except RuntimeError as e:+ self.issues.append(f"setparams {em}: {str(e)[:400]}")+ log("ERR", self.name, em, "setparams", str(e)[:400])++ def renderer(self, em, idx, **kw):+ try:+ F.call("SetRendererData", {"renderer": F.item(self.path, em, renderer=idx), "rendererData": {"propertyValues": json.dumps(kw)}})+ except RuntimeError as e:+ self.issues.append(f"renderer {em}/{idx}: {str(e)[:400]}")+ log("ERR", self.name, em, "renderer", str(e)[:400])++ def finish(self):+ sysobj = unreal.load_asset(self.path)+ if sysobj is not None:+ # Force a synchronous compile so the saved asset carries compiled scripts (render runs only load it).+ try:+ sysobj.request_compile(True)+ except Exception:+ pass+ try:+ unreal.NiagaraEditorFunctionLibrary # noqa: B018+ except Exception:+ pass+ EAL.save_loaded_asset(sysobj, False)+ st = F.call("GetSystemCompileState", {"system": F.ref(self.path)}, check=False)+ # GetStackIssues builds Slate curve widgets and asserts without a Slate app: only in a full editor session.+ si = F.call("GetStackIssues", {"system": F.ref(self.path)}, check=False) if os.environ.get("ANYSCENEFX_STACK_ISSUES") else None+ REPORT["systems"][self.name] = {"path": self.path, "issues": self.issues, "compile": st, "stack_issues": si,+ "params": {k: v[0] for k, v in self.params.items()}}+ log("system", self.name, "issues", len(self.issues))+++# ------------------------------------------------------------------ the shared parameter contract++def common(spawn, life, size, vel, color, intensity, opacity, box, wind=(0, 0, 0), gravity=0.0, drag=0.0, jitter=0.1,+ noise=0.0, noise_freq=0.01, grow=0.0, aspect=1.0, temperature=0.0):+ return {+ "SpawnRate": ("float", spawn, "particles per second"),+ "LifetimeMin": ("float", life[0], "s"), "LifetimeMax": ("float", life[1], "s"),+ "SizeMin": ("float", size[0], "sprite width, cm"), "SizeMax": ("float", size[1], "sprite width, cm"),+ "Aspect": ("float", aspect, "sprite length / width (streaks, flame tongues)"),+ "Velocity": ("vec3", vel, "initial (and terminal, with Drag) velocity, cm/s, world"),+ "VelocityJitter": ("float", jitter, "0..1 cone spread (Blender factor_random)"),+ "Wind": ("vec3", wind, "constant drift, cm/s"),+ "Gravity": ("float", gravity, "0..1 x 980 cm/s2"),+ "Drag": ("float", drag, "linear drag 1/s; with drag the particle settles at Velocity + Wind"),+ "BoxExtent": ("vec3", box, "spawn box half extent, cm, local"),+ "Color": ("color", color, "albedo (lit) or emissive tint (unlit)"),+ "Intensity": ("float", intensity, "emissive luminance multiplier, nits"),+ "Opacity": ("float", opacity, "per-sprite peak alpha"),+ "Temperature": ("float", temperature, "K; > 0 replaces Color with blackbody (fire)"),+ "NoiseStrength": ("float", noise, "curl-noise force, cm/s2"),+ "NoiseFreq": ("float", noise_freq, "curl-noise frequency, 1/cm"),+ "Grow": ("float", grow, "sprite size growth over life (size x (1 + Grow x age))"),+ }+++FADE = "saturate(Particles.NormalizedAge * {a}) * saturate((1.0 - Particles.NormalizedAge) * {b})"+++def fountain_core(s, em, *, gpu, material, fade=(6.0, 2.5), aligned=False, sort=False, curl=True, grow=True, nonuniform=False,+ pivot=(0.5, 0.5)):+ """Rewire a Fountain emitter to the shared User parameters."""+ s.emitter_data(em, SimTarget="GPUComputeSim" if gpu else "CPUSim", bDeterminism=True, RandomSeed=abs(hash(s.name + em)) % 100000,+ CalculateBoundsMode="Fixed", FixedBounds={"min": {"x": -500, "y": -500, "z": -500}, "max": {"x": 500, "y": 500, "z": 500}, "isValid": True},+ bLocalSpace=False)+ EU, PS, PU = "EmitterUpdateScript", "ParticleSpawnScript", "ParticleUpdateScript"+ s.set(em, EU, "SpawnRate", "SpawnRate", ("link", "User.SpawnRate", "float"))+ s.set(em, PS, "InitializeParticle", "Lifetime Min", ("link", "User.LifetimeMin", "float"))+ s.set(em, PS, "InitializeParticle", "Lifetime Max", ("link", "User.LifetimeMax", "float"))+ s.set(em, PS, "InitializeParticle", "Color", ("hlsl", "float4(User.Color.r, User.Color.g, User.Color.b, User.Opacity)"))+ if nonuniform:+ s.set(em, PS, "InitializeParticle", "Sprite Size Mode", ("enum", "Random Non-Uniform"))+ s.set(em, PS, "InitializeParticle", "Sprite Size Min", ("hlsl", "float2(User.SizeMin, User.SizeMin * User.Aspect)"))+ s.set(em, PS, "InitializeParticle", "Sprite Size Max", ("hlsl", "float2(User.SizeMax, User.SizeMax * User.Aspect)"))+ if not aligned:+ # Elongated sprites (tongues, streaks) have an up: the Fountain's random sprite rotation would point them anywhere.+ s.set(em, PS, "InitializeParticle", "Sprite Rotation Mode", ("enum", "Unset"))+ else:+ s.set(em, PS, "InitializeParticle", "Uniform Sprite Size Min", ("link", "User.SizeMin", "float"))+ s.set(em, PS, "InitializeParticle", "Uniform Sprite Size Max", ("link", "User.SizeMax", "float"))+ if aligned:+ s.set(em, PS, "InitializeParticle", "Sprite Rotation Mode", ("enum", "Unset"))+ s.set(em, PS, "ShapeLocation", "Shape Primitive", ("enum", "Box"))+ s.set(em, PS, "ShapeLocation", "Box Size", ("hlsl", "User.BoxExtent * 2.0"))+ s.set(em, PS, "AddVelocity", "Velocity Speed", ("hlsl", "length(User.Velocity)"))+ s.set(em, PS, "AddVelocity", "Cone Axis", ("hlsl", "normalize(User.Velocity + float3(0.0, 0.0, 0.0001))"))+ s.set(em, PS, "AddVelocity", "Cone Angle", ("hlsl", "User.VelocityJitter * 90.0"))+ s.set(em, PS, "AddVelocity", "Rotation Coordinate Space", ("enum", "World"))+ # Intensity + temperature reach the material through the dynamic parameter.+ s.set_params(em, PS, [("Particles.DynamicMaterialParameter", "vec4", "float4(User.Intensity, User.Temperature, 0.0, 0.0)")])+ # Forces: with linear drag k, the force (V + W) k - g makes the particle settle at Velocity + Wind.+ s.set(em, PU, "GravityForce", "Gravity", ("hlsl", "(User.Velocity + User.Wind) * User.Drag + float3(0.0, 0.0, -980.0 * User.Gravity)"))+ s.set(em, PU, "Drag", "Drag", ("link", "User.Drag", "float"))+ s.set(em, PU, "ScaleColor", "Scale Alpha", ("hlsl", FADE.format(a=fade[0], b=fade[1])))+ if curl:+ mn, ins = s.add_module(em, PU, "/Niagara/Modules/Update/Forces/V2/CurlNoiseForce.CurlNoiseForce", before="SolveForcesAndVelocity")+ for k in ins:+ kl = k.lower()+ if "strength" in kl:+ s.set(em, PU, mn, k, ("link", "User.NoiseStrength", "float"))+ elif "frequency" in kl:+ s.set(em, PU, mn, k, ("link", "User.NoiseFreq", "float"))+ REPORT.setdefault("curl_inputs", sorted(ins))+ if grow:+ mn, ins = s.add_module(em, PU, "/Niagara/Modules/Update/Size/ScaleSpriteSize.ScaleSpriteSize")+ s.set(em, PU, mn, "Scale Sprite Size Mode", ("enum", "Non-Uniform"))+ ins = s.inputs_of(em, PU, mn)+ k = next((k for k, i in ins.items() if "Vector2f" in i["type"]["classStructOrEnum"]["refPath"] and i.get("bIsVisible")), None)+ REPORT.setdefault("scalesize_inputs", {k: [i["type"]["classStructOrEnum"]["refPath"].split(".")[-1], i.get("bIsVisible")] for k, i in ins.items()})+ if k:+ s.set(em, PU, mn, k, ("hlsl", "float2(1.0, 1.0) * (1.0 + User.Grow * Particles.NormalizedAge)"))+ else:+ s.issues.append(f"ScaleSpriteSize: no Vector2f scale input in {sorted(ins)}")+ s.renderer(em, 0, Material=F.ref(material), Alignment="VelocityAligned" if aligned else "Unaligned",+ FacingMode="FaceCameraPosition" if aligned else "FaceCamera", SortMode="ViewDepth" if sort else "None",+ PixelCoverageMode="Enabled", bCastShadows=False, MotionVectorSetting="Disable" if not aligned else "AutoDetect",+ PivotInUVSpace={"x": pivot[0], "y": pivot[1]})+++def to_val(v):+ """Recipe JSON value -> Sys.set value: number | bool | {"link","type"} | {"hlsl"} | {"enum"}."""+ if isinstance(v, dict):+ if "link" in v:+ return ("link", v["link"], v.get("type", "float"))+ if "hlsl" in v:+ return ("hlsl", v["hlsl"])+ if "enum" in v:+ return ("enum", v["enum"])+ return v+++def load_recipes():+ """Built-in recipes (fx_recipes/*.json next to this file) + any in ANYSCENEFX_RECIPES (a folder, os.pathsep-separated).+ A later recipe with the same name replaces an earlier one, so an agent can override a built-in."""+ dirs = [os.path.join(os.path.dirname(os.path.abspath(__file__)), "fx_recipes")]+ dirs += [d for d in os.environ.get("ANYSCENEFX_RECIPES", "").split(os.pathsep) if d]+ out = {}+ for d in dirs:+ for f in sorted(os.listdir(d)) if os.path.isdir(d) else []:+ if f.endswith(".json"):+ r = json.load(open(os.path.join(d, f)))+ out[r["name"]] = r+ return out+++def build_recipe(r, mats):+ PU = "ParticleUpdateScript"+ c = r.get("common", {})+ params = common(spawn=c.get("spawn", 50), life=c.get("life", (1, 2)), size=c.get("size", (5, 10)), vel=c.get("vel", (0, 0, 0)),+ color=c.get("color", (1, 1, 1)), intensity=c.get("intensity", 0.0), opacity=c.get("opacity", 1.0),+ box=c.get("box", (10, 10, 10)), wind=c.get("wind", (0, 0, 0)), gravity=c.get("gravity", 0.0), drag=c.get("drag", 0.0),+ jitter=c.get("jitter", 0.1), noise=c.get("noise", 0.0), noise_freq=c.get("noise_freq", 0.01), grow=c.get("grow", 0.0),+ aspect=c.get("aspect", 1.0), temperature=c.get("temperature", 0.0))+ for k, (t, dv, desc) in r.get("extra", {}).items():+ params[k] = (t, tuple(dv) if isinstance(dv, list) else dv, desc)+ s = Sys(r["name"], params)+ sy = r.get("system", {})+ lo, hi = sy.get("bounds", [[-200, -200, -200], [200, 200, 200]])+ s.system_data(bDeterminism=True, RandomSeed=int(sy.get("seed", 1)), bFixedBounds=True,+ FixedBounds={"min": dict(zip("xyz", lo)), "max": dict(zip("xyz", hi)), "isValid": True})+ for e in r["emitters"]:+ em = s.emitter(e.get("template", "Fountain"), e["name"])+ if e.get("core") is not None:+ k = dict(e["core"])+ k["material"] = mats[k["material"]]+ k["fade"] = tuple(k.get("fade", (6.0, 2.5)))+ fountain_core(s, em, **k)+ if e.get("emitter_data"):+ s.emitter_data(em, **e["emitter_data"])+ for script, module, inp, val in e.get("inputs", []):+ s.set(em, script, module, inp, to_val(val))+ for m in e.get("add_modules", []):+ mn, ins = s.add_module(em, m.get("script", PU), m["asset"], before=m.get("before", ""))+ for inp, val in m.get("inputs", {}).items():+ s.set(em, m.get("script", PU), mn, inp, to_val(val))+ # One SetParameters module per (script, position): several modules in a row crashed the toolset headless.+ groups = {}+ for sp in e.get("set_params", []):+ groups.setdefault((sp[0], sp[4] if len(sp) > 4 else ""), []).append(tuple(sp[1:4]))+ for (script, before), entries in groups.items():+ s.set_params(em, script, entries, before=before)+ for idx in sorted(e.get("remove_renderers", []), reverse=True):+ try:+ F.call("RemoveRenderer", {"rendererToRemove": F.item(s.path, em, renderer=idx)})+ except RuntimeError as x:+ s.issues.append(f"remove renderer {em}/{idx}: {x}")+ for rd in e.get("add_renderers", []):+ res = F.call("AddRenderer", {"newRendererLocation": F.item(s.path, em), "rendererClass": F.ref("/Script/Niagara." + rd["class"])})+ res = res.get("returnValue", res) if isinstance(res, dict) else res+ s.renderer(em, int(res.get("index", 0)) if isinstance(res, dict) else 0, **rd.get("data", {}))+ for idx, data in e.get("renderer_data", {}).items():+ if "Material" in data and data["Material"] in mats:+ data = dict(data, Material=F.ref(mats[data["Material"]]))+ s.renderer(em, int(idx), **data)+ s.finish()+ REPORT["systems"][r["name"]].update({"fx_types": r.get("fx_types", []), "description": r.get("description", "")})+++def build():+ for p in (f"{ROOT}/Systems", f"{ROOT}/Materials"):+ if not EAL.does_directory_exist(p):+ EAL.make_directory(p)+ recipes = load_recipes()+ only = set(x for x in os.environ.get("ANYSCENEFX_ONLY", "").split(",") if x)+ allm = dict(MATS)+ for r in recipes.values():+ allm.update(r.get("materials", {}))+ # Materials: all of them on a full build; on an ANYSCENEFX_ONLY build just the ones those recipes ship.+ want_m = set(allm) if not only else {m for n in only for m in recipes[n].get("materials", {})}+ mats = {k: f"{ROOT}/Materials/{k}.{k}" for k in allm}+ for k in sorted(want_m):+ mats[k] = make_material(k, allm[k])+ log("materials", sorted(want_m))+ for name, r in recipes.items():+ if only and name not in only:+ continue+ build_recipe(r, mats)+ # templates.json is the converter's contract: merge, so a partial (ANYSCENEFX_ONLY) build keeps the others.+ out = json.load(open(OUT_JSON)) if os.path.exists(OUT_JSON) and only else {}+ for k, v in REPORT["systems"].items():+ out[k] = {"path": v["path"], "params": v["params"], "fx_types": v.get("fx_types", []), "description": v.get("description", "")}+ json.dump(out, open(OUT_JSON, "w"), indent=1)+ REPORT["toolset_log"] = F.LOG+ json.dump(REPORT, open(OUT_JSON.replace(".json", "_report.json"), "w"), indent=1, default=str)+ log("done", OUT_JSON, sum(len(v["issues"]) for v in REPORT["systems"].values()), "issues")+++try:+ build()+except Exception as e: # keep the partial report+ import traceback+ REPORT["errors"].append(traceback.format_exc())+ REPORT["toolset_log"] = F.LOG+ json.dump(REPORT, open(OUT_JSON.replace(".json", "_report.json"), "w"), indent=1, default=str)+ log("FAILED", e)diff --git a/unreal/fx_recipes/NS_Drips.json b/unreal/fx_recipes/NS_Drips.jsonnew file mode 100644index 0000000..372a307--- /dev/null+++ b/unreal/fx_recipes/NS_Drips.json@@ -0,0 +1,10 @@+{+ "name": "NS_Drips",+ "description": "Drops falling off an edge or line (awnings, pipes, leaves) under gravity; lifetime = fall time to the ground below.",+ "fx_types": ["drips"],+ "common": {"spawn": 6, "life": [0.6, 0.7], "size": [0.35, 0.5], "vel": [0, 0, -20], "color": [0.8, 0.85, 0.9], "intensity": 60, "opacity": 0.6,+ "box": [2, 300, 1], "gravity": 1.0, "jitter": 0.05, "aspect": 3.0},+ "system": {"seed": 4404, "bounds": [[-50, -400, -300], [50, 400, 20]]},+ "emitters": [{"name": "Drops", "template": "Fountain",+ "core": {"gpu": true, "material": "M_AFX_Streak", "fade": [40.0, 40.0], "aligned": true, "curl": false, "grow": false, "nonuniform": true}}]+}diff --git a/unreal/fx_recipes/NS_DustMotes.json b/unreal/fx_recipes/NS_DustMotes.jsonnew file mode 100644index 0000000..25f0a2b--- /dev/null+++ b/unreal/fx_recipes/NS_DustMotes.json@@ -0,0 +1,9 @@+{+ "name": "NS_DustMotes",+ "description": "Floating dust / pollen / ash motes in a box with curl-noise drift; only reads inside light shafts.",+ "fx_types": ["dust"],+ "common": {"spawn": 150, "life": [8.0, 12.0], "size": [0.08, 0.2], "vel": [0, 0, 0], "color": [0.9, 0.85, 0.75], "intensity": 0.0, "opacity": 0.8,+ "box": [200, 200, 150], "drag": 2.0, "jitter": 1.0, "noise": 20, "noise_freq": 0.01},+ "system": {"seed": 5505, "bounds": [[-300, -300, -250], [300, 300, 250]]},+ "emitters": [{"name": "Motes", "template": "Fountain", "core": {"gpu": true, "material": "M_AFX_Mote", "fade": [4.0, 4.0], "grow": false}}]+}diff --git a/unreal/fx_recipes/NS_Fire.json b/unreal/fx_recipes/NS_Fire.jsonnew file mode 100644index 0000000..0b3f18f--- /dev/null+++ b/unreal/fx_recipes/NS_Fire.json@@ -0,0 +1,310 @@+{+ "name": "NS_Fire",+ "description": "Flame tongues on a ring (gas burner, wok, brazier; candle at small sizes): CPU additive sprites + blue core + one capped flickering Niagara light (off by default when the scene has a practical).",+ "fx_types": [+ "fire"+ ],+ "common": {+ "spawn": 60,+ "life": [+ 0.25,+ 0.45+ ],+ "size": [+ 4,+ 7+ ],+ "vel": [+ 0,+ 0,+ 70+ ],+ "color": [+ 1.0,+ 0.45,+ 0.1+ ],+ "intensity": 4000,+ "opacity": 1.0,+ "box": [+ 14,+ 14,+ 2+ ],+ "drag": 3.0,+ "jitter": 0.15,+ "noise": 400,+ "noise_freq": 0.05,+ "grow": -0.5,+ "aspect": 2.6+ },+ "extra": {+ "CoreIntensity": [+ "float",+ 0.35,+ "blue core luminance as a fraction of Intensity"+ ],+ "RingRadius": [+ "float",+ 16.0,+ "burner ring radius, cm (flames spawn on the ring)"+ ],+ "LightIntensity": [+ "float",+ 0.0,+ "Niagara point light brightness; 0 = off (scene has a practical). Capped at 2e4"+ ],+ "LightRadius": [+ "float",+ 150.0,+ "Niagara light attenuation radius, cm"+ ],+ "LightOffset": [+ "vec3",+ [+ 0,+ 0,+ 10+ ],+ "light position relative to the fire, cm"+ ]+ },+ "system": {+ "seed": 1101,+ "bounds": [+ [+ -60,+ -60,+ -20+ ],+ [+ 60,+ 60,+ 80+ ]+ ]+ },+ "emitters": [+ {+ "name": "Flames",+ "template": "Fountain",+ "core": {+ "gpu": true,+ "material": "M_AFX_Flame",+ "fade": [+ 10.0,+ 3.0+ ],+ "nonuniform": true,+ "pivot": [+ 0.5,+ 0.85+ ]+ },+ "inputs": [+ [+ "ParticleSpawnScript",+ "ShapeLocation",+ "Shape Primitive",+ {+ "enum": "Ring"+ }+ ],+ [+ "ParticleSpawnScript",+ "ShapeLocation",+ "Ring Radius",+ {+ "link": "User.RingRadius",+ "type": "float"+ }+ ]+ ]+ },+ {+ "name": "Core",+ "template": "Fountain",+ "core": {+ "gpu": true,+ "material": "M_AFX_Flame",+ "fade": [+ 10.0,+ 3.0+ ],+ "curl": false,+ "grow": false,+ "nonuniform": true,+ "pivot": [+ 0.5,+ 0.85+ ]+ },+ "inputs": [+ [+ "ParticleSpawnScript",+ "ShapeLocation",+ "Shape Primitive",+ {+ "enum": "Ring"+ }+ ],+ [+ "ParticleSpawnScript",+ "ShapeLocation",+ "Ring Radius",+ {+ "hlsl": "User.RingRadius * 0.85"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Color",+ {+ "hlsl": "float4(0.25, 0.42, 1.0, User.Opacity)"+ }+ ],+ [+ "EmitterUpdateScript",+ "SpawnRate",+ "SpawnRate",+ {+ "hlsl": "User.SpawnRate * 0.8"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Lifetime Min",+ {+ "hlsl": "User.LifetimeMin * 0.35"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Lifetime Max",+ {+ "hlsl": "User.LifetimeMax * 0.35"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Sprite Size Min",+ {+ "hlsl": "float2(User.SizeMin * 0.5, User.SizeMin * 0.8)"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Sprite Size Max",+ {+ "hlsl": "float2(User.SizeMax * 0.5, User.SizeMax * 0.8)"+ }+ ]+ ],+ "set_params": [+ [+ "ParticleSpawnScript",+ "Particles.DynamicMaterialParameter",+ "vec4",+ "float4(User.Intensity * User.CoreIntensity, 0.0, 0.0, 0.0)"+ ]+ ]+ },+ {+ "name": "Light",+ "template": "SingleLoopingParticle",+ "emitter_data": {+ "SimTarget": "CPUSim",+ "bDeterminism": true,+ "RandomSeed": 77,+ "CalculateBoundsMode": "Fixed",+ "FixedBounds": {+ "min": {+ "x": -60,+ "y": -60,+ "z": -20+ },+ "max": {+ "x": 60,+ "y": 60,+ "z": 80+ },+ "isValid": true+ }+ },+ "inputs": [+ [+ "EmitterUpdateScript",+ "EmitterState",+ "Life Cycle Mode",+ {+ "enum": "Self"+ }+ ],+ [+ "EmitterUpdateScript",+ "EmitterState",+ "Loop Behavior",+ {+ "enum": "Once"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "UsePositionOffset",+ true+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Position Offset",+ {+ "link": "User.LightOffset",+ "type": "vec3"+ }+ ],+ [+ "ParticleUpdateScript",+ "ParticleState",+ "Kill Particles When Lifetime Has Elapsed",+ false+ ]+ ],+ "set_params": [+ [+ "ParticleUpdateScript",+ "Particles.LightRadius",+ "float",+ "User.LightRadius",+ "SolveForcesAndVelocity"+ ],+ [+ "ParticleUpdateScript",+ "Particles.Color",+ "color",+ "float4(User.Color.r, User.Color.g, User.Color.b, 1.0) * min(User.LightIntensity, 20000.0) * (1.0 + 0.22 * sin(Engine.Time * 11.3) + 0.14 * sin(Engine.Time * 23.7 + 1.3) + 0.08 * sin(Engine.Time * 41.0))",+ "SolveForcesAndVelocity"+ ]+ ],+ "remove_renderers": [+ 0+ ],+ "add_renderers": [+ {+ "class": "NiagaraLightRendererProperties",+ "data": {+ "bUseInverseSquaredFalloff": true,+ "bAffectsTranslucency": true,+ "RadiusScale": 1.0,+ "bAlphaScalesBrightness": false+ }+ }+ ]+ }+ ]+}\ No newline at end of filediff --git a/unreal/fx_recipes/NS_FountainJet.json b/unreal/fx_recipes/NS_FountainJet.jsonnew file mode 100644index 0000000..6cf6418--- /dev/null+++ b/unreal/fx_recipes/NS_FountainJet.json@@ -0,0 +1,10 @@+{+ "name": "NS_FountainJet",+ "description": "Water jet / spray / sprinkler / hose: GPU velocity-aligned streaks launched along Velocity and falling under gravity; Velocity = sqrt(2 g h) along the nozzle.",+ "fx_types": ["fountain", "splash"],+ "common": {"spawn": 1500, "life": [1.0, 1.4], "size": [0.4, 0.8], "vel": [0, 0, 440], "color": [0.85, 0.9, 0.95], "intensity": 20, "opacity": 0.4,+ "box": [1, 1, 1], "gravity": 1.0, "drag": 0.1, "jitter": 0.06, "aspect": 6.0},+ "system": {"seed": 7707, "bounds": [[-300, -300, -50], [300, 300, 400]]},+ "emitters": [{"name": "Jet", "template": "Fountain",+ "core": {"gpu": true, "material": "M_AFX_Streak", "fade": [30.0, 6.0], "aligned": true, "curl": false, "grow": false, "nonuniform": true}}]+}diff --git a/unreal/fx_recipes/NS_Rain.json b/unreal/fx_recipes/NS_Rain.jsonnew file mode 100644index 0000000..6d1b850--- /dev/null+++ b/unreal/fx_recipes/NS_Rain.json@@ -0,0 +1,10 @@+{+ "name": "NS_Rain",+ "description": "Rain / drizzle over a box: GPU velocity-aligned lit streaks with a faint emissive; streak length = drop + speed x shutter (Aspect).",+ "fx_types": ["rain"],+ "common": {"spawn": 4000, "life": [1.0, 1.2], "size": [0.25, 0.35], "vel": [25, -10, -500], "color": [0.8, 0.85, 0.9], "intensity": 60,+ "opacity": 0.35, "box": [300, 300, 5], "jitter": 0.03, "aspect": 40.0},+ "system": {"seed": 3303, "bounds": [[-400, -400, -700], [400, 400, 50]]},+ "emitters": [{"name": "Streaks", "template": "Fountain",+ "core": {"gpu": true, "material": "M_AFX_Streak", "fade": [30.0, 30.0], "aligned": true, "curl": false, "grow": false, "nonuniform": true}}]+}diff --git a/unreal/fx_recipes/NS_Smoke.json b/unreal/fx_recipes/NS_Smoke.jsonnew file mode 100644index 0000000..6fd6c6f--- /dev/null+++ b/unreal/fx_recipes/NS_Smoke.json@@ -0,0 +1,9 @@+{+ "name": "NS_Smoke",+ "description": "Darker, slower, longer-lived plume (chimneys, exhaust, incense; cigarettes at small sizes): the steam puff look with smoke defaults.",+ "fx_types": ["smoke"],+ "common": {"spawn": 25, "life": [5.0, 8.0], "size": [6, 12], "vel": [0, 0, 20], "color": [0.32, 0.31, 0.3], "intensity": 0.0, "opacity": 0.3,+ "box": [4, 4, 1], "wind": [10, 0, 0], "drag": 1.0, "jitter": 0.15, "noise": 30, "noise_freq": 0.03, "grow": 4.0},+ "system": {"seed": 2303, "bounds": [[-200, -200, -10], [300, 200, 400]]},+ "emitters": [{"name": "Puffs", "template": "Fountain", "core": {"gpu": true, "material": "M_AFX_Steam", "fade": [3.0, 1.2], "sort": true}}]+}diff --git a/unreal/fx_recipes/NS_Sparks.json b/unreal/fx_recipes/NS_Sparks.jsonnew file mode 100644index 0000000..176d6d6--- /dev/null+++ b/unreal/fx_recipes/NS_Sparks.json@@ -0,0 +1,12 @@+{+ "name": "NS_Sparks",+ "description": "Sparks / embers: hot additive velocity-aligned streaks under gravity and drag (grinders, welding, fireworks; campfire embers with Gravity ~ -0.05 and a long life). Ships its own material: the pattern for an agent adding a new look.",+ "fx_types": ["sparks", "embers"],+ "common": {"spawn": 200, "life": [0.4, 0.9], "size": [0.2, 0.4], "vel": [0, 0, 400], "color": [1.0, 0.55, 0.15], "intensity": 20000, "opacity": 1.0,+ "box": [2, 2, 2], "gravity": 1.0, "drag": 0.5, "jitter": 0.5, "aspect": 8.0, "temperature": 1900},+ "system": {"seed": 6606, "bounds": [[-300, -300, -200], [300, 300, 400]]},+ "materials": {"M_AFX_Spark": {"blend": "ADDITIVE", "lit": false, "op": "return 0;",+ "rgb": "float x = abs(UV.x - 0.5) * 2.0;\nfloat a = saturate(1.0 - x);\na *= a * saturate(UV.y * 3.0) * saturate((1.0 - UV.y) * 6.0);\nfloat3 col = DP.y > 0 ? X.bb(DP.y) : PC;\nreturn col * a * PA * DP.x;"}},+ "emitters": [{"name": "Sparks", "template": "Fountain",+ "core": {"gpu": true, "material": "M_AFX_Spark", "fade": [50.0, 1.5], "aligned": true, "curl": false, "grow": false, "nonuniform": true}}]+}diff --git a/unreal/fx_recipes/NS_Steam.json b/unreal/fx_recipes/NS_Steam.jsonnew file mode 100644index 0000000..37501e5--- /dev/null+++ b/unreal/fx_recipes/NS_Steam.json@@ -0,0 +1,9 @@+{+ "name": "NS_Steam",+ "description": "Rising lit vapour plume (woks, pots, kettles, vents, manholes): GPU soft puffs, growing, curl noise, drifting with Wind, depth-sorted, before-DOF.",+ "fx_types": ["steam"],+ "common": {"spawn": 40, "life": [3.0, 4.5], "size": [12, 22], "vel": [0, 0, 30], "color": [0.9, 0.9, 0.9], "intensity": 0.0, "opacity": 0.18,+ "box": [10, 10, 2], "wind": [15, 0, 0], "drag": 1.5, "jitter": 0.25, "noise": 60, "noise_freq": 0.02, "grow": 3.0},+ "system": {"seed": 2202, "bounds": [[-150, -150, -10], [250, 150, 250]]},+ "emitters": [{"name": "Puffs", "template": "Fountain", "core": {"gpu": true, "material": "M_AFX_Steam", "fade": [5.0, 1.6], "sort": true}}]+}diff --git a/unreal/fxlib.py b/unreal/fxlib.pynew file mode 100644index 0000000..b2c744c--- /dev/null+++ b/unreal/fxlib.py@@ -0,0 +1,41 @@+"""Thin synchronous wrapper over Epic's experimental NiagaraToolsets (unreal.ToolsetRegistry.execute_tool), used by+fx_pack.py to author the AnySceneFX templates headlessly (UnrealEditor-Cmd -run=pythonscript)."""+import json++import unreal++TS = "NiagaraToolsets.NiagaraToolset_System"+LOG = []+++def call(tool, args, toolset=TS, check=True):+ unreal.log("FXCALL " + tool + " " + json.dumps(args)[:200])+ r = unreal.ToolsetRegistry.execute_tool(toolset, tool, json.dumps(args))+ if not r.get_editor_property("is_complete"):+ LOG.append(f"{tool} not complete synchronously")+ err = r.get_editor_property("error")+ if err:+ LOG.append(f"{tool} ERROR {err}")+ if check:+ raise RuntimeError(f"{tool}: {err}\nargs={json.dumps(args)[:1500]}")+ return None+ v = r.get_value_as_json_string()+ try:+ while isinstance(v, str) and v[:1] in "{[\"":+ v = json.loads(v)+ except Exception:+ pass+ if isinstance(v, dict) and set(v) == {"returnValue"}:+ v = v["returnValue"]+ while isinstance(v, str) and v[:1] in "{[":+ v = json.loads(v)+ return v+++def ref(path):+ return {"refPath": path}+++def item(system, emitter="", script="", module="", renderer=-1, inputs=()):+ return {"system": ref(system), "emitterName": emitter, "scriptName": script, "moduleName": module,+ "rendererIndex": renderer, "inputNameStack": list(inputs)}diff --git a/unreal/make_copy.py b/unreal/make_copy.pynew file mode 100644index 0000000..0a0063e--- /dev/null+++ b/unreal/make_copy.py@@ -0,0 +1,12 @@+"""Make a working copy of a scene .blend with all external paths absolute (a plain file copy breaks the scene's+//../../refs/... texture paths as soon as it lives in another folder). The source file is only read.+ blender -b scenes/<id>/<scene>.blend --python unreal/make_copy.py -- <out.blend>+"""+import sys+import bpy++out = sys.argv[sys.argv.index("--") + 1]+assert bpy.path.abspath(out) != bpy.data.filepath, "refusing to overwrite the source .blend"+bpy.ops.file.make_paths_absolute()+bpy.ops.wm.save_as_mainfile(filepath=out, copy=True, relative_remap=False, compress=False)+print("COPY", bpy.data.filepath, "->", out, flush=True)diff --git a/unreal/perf.ps1 b/unreal/perf.ps1new file mode 100644index 0000000..75216fc--- /dev/null+++ b/unreal/perf.ps1@@ -0,0 +1,41 @@+# Standalone (-game) real-time performance run of a built AnyScene level, with no window (-RenderOffscreen).+# Captures N frames with the CSV profiler (frame/game/render/GPU times) from the PlayerStart (hero camera), and samples+# total GPU memory with nvidia-smi before and during the run.+# powershell -File perf.ps1 [-Map /Game/AnyScene/HK/L_HK] [-ResX 2560] [-ResY 1440] [-Frames 900] [-Extra "r.Lumen.HardwareRayTracing 0"]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Map = "/Game/AnyScene/HK/L_HK",+ [int]$ResX = 2560, [int]$ResY = 1440, [int]$Frames = 900, [int]$TimeoutS = 600,+ [string]$Tag = "perf", [string]$Extra = ""+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor.exe"+$saved = Join-Path (Split-Path $Project) "Saved"+$csvDir = Join-Path $saved "Profiling\CSV"+$before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+$mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+# The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+# -resx/-resy are ignored under -RenderOffscreen (the HK run captured 1066x600 until r.setres was passed by hand).+$cmds = "r.setres ${ResX}x${ResY}w,r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+if ($Extra) { $cmds = "$Extra,$cmds" }+$args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+$proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+$peak = $mem0+$sw = [Diagnostics.Stopwatch]::StartNew()+$csv = $null+while (-not $proc.HasExited -and $sw.Elapsed.TotalSeconds -lt $TimeoutS) {+ Start-Sleep -Seconds 2+ $m = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ if ($m -gt $peak) { $peak = $m }+ $new = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | Where-Object { $before -notcontains $_.FullName }+ if ($new) {+ $f = $new | Sort-Object LastWriteTime | Select-Object -Last 1+ # The CSV is written when the capture ends; wait until the file stops growing.+ $s1 = $f.Length; Start-Sleep -Seconds 3; $s2 = (Get-Item $f.FullName).Length+ if ($s1 -eq $s2 -and $s2 -gt 0) { $csv = $f.FullName; break }+ }+}+if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force }+"gpu_mem_before_mb=$mem0 gpu_mem_peak_mb=$peak delta_mb=$($peak - $mem0)"+"csv=$csv"diff --git a/unreal/render_mrq.ps1 b/unreal/render_mrq.ps1new file mode 100644index 0000000..322b5b4--- /dev/null+++ b/unreal/render_mrq.ps1@@ -0,0 +1,24 @@+# Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+# UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+# powershell -File render_mrq.ps1 [-Cams cam_street,cam_table,cam_wok] [-Project ...] [-Dest /Game/AnyScene/HK] [-Level L_HK]+# [-Config MRQ_Still|MRQ_Linear|MRQ_Clip] [-Cvars "r.Foo=1,r.Bar=2"]+# -Cvars adds console variables for an A/B render without rebuilding (they go into -dpcvars).+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Dest = "/Game/AnyScene/HK", [string]$Level = "L_HK",+ [string]$Cams = "cam_street,cam_table,cam_wok", [string]$Config = "MRQ_Still",+ [int]$ResX = 1920, [int]$ResY = 804, [string]$Cvars = ""+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"+# Async compilation off (props render invisible / placeholder under -RenderOffscreen otherwise), Niagara waits for+# its shaders, no texture streaming (low mips in a short session).+$dp = "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1,r.TextureStreaming=0"+if ($Cvars) { $dp = "$dp,$Cvars" }+foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed "-resx=$ResX" "-resy=$ResY" -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+ $dp | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+}diff --git a/unreal/render_shots.py b/unreal/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal/side_by_side.py b/unreal/side_by_side.pynew file mode 100644index 0000000..21ba7e3--- /dev/null+++ b/unreal/side_by_side.py@@ -0,0 +1,52 @@+"""Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.+File names are patterns: SBS_CYC="{cam}_graded.png", SBS_UE="cam_{cam}.png" (e.g. SBS_UE="SEQ_{cam}.0000.png" for MRQ; {c} = {cam}).+SBS_CYC_LABEL sets the left label (default "Cycles graded").+"""+import os+import sys++from PIL import Image, ImageDraw, ImageFont++cyc, ue, out = sys.argv[1:4]+cams = (sys.argv[4] if len(sys.argv) > 4 else "street,table,wok").split(",")+os.makedirs(out, exist_ok=True)+H = 804+LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")+CYC_LABEL = os.environ.get("SBS_CYC_LABEL", "Cycles graded")+CYC_FMT = os.environ.get("SBS_CYC", "{cam}_graded.png")+UE_FMT = os.environ.get("SBS_UE", "cam_{cam}.png")+try:+ font = ImageFont.truetype("arial.ttf", 28)+except OSError:+ font = ImageFont.load_default()+++def fit(p):+ im = Image.open(p).convert("RGB")+ return im.resize((round(im.width * H / im.height), H), Image.LANCZOS)+++rows = []+for c in cams:+ a = fit(os.path.join(cyc, CYC_FMT.format(cam=c, c=c)))+ up = os.path.join(ue, UE_FMT.format(cam=c, c=c))+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+ for x, t in ((12, f"{CYC_LABEL} {c}"), (a.width + 20, f"{LABEL} {c}")):+ d.rectangle([x - 6, 8, x + 12 + int(d.textlength(t, font=font)), 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)+ print("wrote", os.path.join(out, f"{c}.png"))+w = max(r.width for r in rows)+allim = Image.new("RGB", (w, sum(r.height for r in rows) + 8 * (len(rows) - 1)), (255, 255, 255))+y = 0+for r in rows:+ allim.paste(r, (0, y))+ y += r.height + 8+allim.resize((allim.width // 2, allim.height // 2), Image.LANCZOS).save(os.path.join(out, "all.png"))diff --git a/unreal/templates.json b/unreal/templates.jsonnew file mode 100644index 0000000..f247265--- /dev/null+++ b/unreal/templates.json@@ -0,0 +1,233 @@+{+ "NS_Drips": {+ "path": "/Game/AnySceneFX/Systems/NS_Drips.NS_Drips",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "drips"+ ],+ "description": "Drops falling off an edge or line (awnings, pipes, leaves) under gravity; lifetime = fall time to the ground below."+ },+ "NS_DustMotes": {+ "path": "/Game/AnySceneFX/Systems/NS_DustMotes.NS_DustMotes",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "dust"+ ],+ "description": "Floating dust / pollen / ash motes in a box with curl-noise drift; only reads inside light shafts."+ },+ "NS_Fire": {+ "path": "/Game/AnySceneFX/Systems/NS_Fire.NS_Fire",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float",+ "CoreIntensity": "float",+ "RingRadius": "float",+ "LightIntensity": "float",+ "LightRadius": "float",+ "LightOffset": "vec3"+ },+ "fx_types": [+ "fire"+ ],+ "description": "Flame tongues on a ring (gas burner, wok, brazier; candle at small sizes): CPU additive sprites + blue core + one capped flickering Niagara light (off by default when the scene has a practical)."+ },+ "NS_FountainJet": {+ "path": "/Game/AnySceneFX/Systems/NS_FountainJet.NS_FountainJet",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "fountain",+ "splash"+ ],+ "description": "Water jet / spray / sprinkler / hose: GPU velocity-aligned streaks launched along Velocity and falling under gravity; Velocity = sqrt(2 g h) along the nozzle."+ },+ "NS_Rain": {+ "path": "/Game/AnySceneFX/Systems/NS_Rain.NS_Rain",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "rain"+ ],+ "description": "Rain / drizzle over a box: GPU velocity-aligned lit streaks with a faint emissive; streak length = drop + speed x shutter (Aspect)."+ },+ "NS_Smoke": {+ "path": "/Game/AnySceneFX/Systems/NS_Smoke.NS_Smoke",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "smoke"+ ],+ "description": "Darker, slower, longer-lived plume (chimneys, exhaust, incense; cigarettes at small sizes): the steam puff look with smoke defaults."+ },+ "NS_Sparks": {+ "path": "/Game/AnySceneFX/Systems/NS_Sparks.NS_Sparks",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "sparks",+ "embers"+ ],+ "description": "Sparks / embers: hot additive velocity-aligned streaks under gravity and drag (grinders, welding, fireworks; campfire embers with Gravity ~ -0.05 and a long life). Ships its own material: the pattern for an agent adding a new look."+ },+ "NS_Steam": {+ "path": "/Game/AnySceneFX/Systems/NS_Steam.NS_Steam",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "steam"+ ],+ "description": "Rising lit vapour plume (woks, pots, kettles, vents, manholes): GPU soft puffs, growing, curl noise, drifting with Wind, depth-sorted, before-DOF."+ }+}\ No newline at end of filediff --git a/unreal/templates_report.json b/unreal/templates_report.jsonnew file mode 100644index 0000000..4258677--- /dev/null+++ b/unreal/templates_report.json@@ -0,0 +1,712 @@+{+ "systems": {+ "NS_Drips": {+ "path": "/Game/AnySceneFX/Systems/NS_Drips.NS_Drips",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Drops",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Drops",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Drops",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "drips"+ ],+ "description": "Drops falling off an edge or line (awnings, pipes, leaves) under gravity; lifetime = fall time to the ground below."+ },+ "NS_DustMotes": {+ "path": "/Game/AnySceneFX/Systems/NS_DustMotes.NS_DustMotes",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Motes",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Motes",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Motes",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "dust"+ ],+ "description": "Floating dust / pollen / ash motes in a box with curl-noise drift; only reads inside light shafts."+ },+ "NS_Fire": {+ "path": "/Game/AnySceneFX/Systems/NS_Fire.NS_Fire",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": true,+ "bIsStale": true,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Flames",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Flames",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Flames",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Core",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Core",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Core",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Light",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "Unknown",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Light",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "Unknown",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float",+ "CoreIntensity": "float",+ "RingRadius": "float",+ "LightIntensity": "float",+ "LightRadius": "float",+ "LightOffset": "vec3"+ },+ "fx_types": [+ "fire"+ ],+ "description": "Flame tongues on a ring (gas burner, wok, brazier; candle at small sizes): CPU additive sprites + blue core + one capped flickering Niagara light (off by default when the scene has a practical)."+ },+ "NS_FountainJet": {+ "path": "/Game/AnySceneFX/Systems/NS_FountainJet.NS_FountainJet",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Jet",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Jet",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Jet",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "fountain",+ "splash"+ ],+ "description": "Water jet / spray / sprinkler / hose: GPU velocity-aligned streaks launched along Velocity and falling under gravity; Velocity = sqrt(2 g h) along the nozzle."+ },+ "NS_Rain": {+ "path": "/Game/AnySceneFX/Systems/NS_Rain.NS_Rain",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Streaks",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Streaks",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Streaks",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "rain"+ ],+ "description": "Rain / drizzle over a box: GPU velocity-aligned lit streaks with a faint emissive; streak length = drop + speed x shutter (Aspect)."+ },+ "NS_Smoke": {+ "path": "/Game/AnySceneFX/Systems/NS_Smoke.NS_Smoke",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "smoke"+ ],+ "description": "Darker, slower, longer-lived plume (chimneys, exhaust, incense; cigarettes at small sizes): the steam puff look with smoke defaults."+ },+ "NS_Sparks": {+ "path": "/Game/AnySceneFX/Systems/NS_Sparks.NS_Sparks",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Sparks",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Sparks",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Sparks",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "sparks",+ "embers"+ ],+ "description": "Sparks / embers: hot additive velocity-aligned streaks under gravity and drag (grinders, welding, fireworks; campfire embers with Gravity ~ -0.05 and a long life). Ships its own material: the pattern for an agent adding a new look."+ },+ "NS_Steam": {+ "path": "/Game/AnySceneFX/Systems/NS_Steam.NS_Steam",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "steam"+ ],+ "description": "Rising lit vapour plume (woks, pots, kettles, vents, manholes): GPU soft puffs, growing, curl noise, drifting with Wind, depth-sorted, before-DOF."+ }+ },+ "materials": [+ "/Game/AnySceneFX/Materials/M_AFX_Flame",+ "/Game/AnySceneFX/Materials/M_AFX_Mote",+ "/Game/AnySceneFX/Materials/M_AFX_Spark",+ "/Game/AnySceneFX/Materials/M_AFX_Steam",+ "/Game/AnySceneFX/Materials/M_AFX_Streak"+ ],+ "errors": [],+ "curl_inputs": [+ "Bias Noise",+ "Bias Noise Field",+ "Coordinate Space",+ "Curl Noise Cone Mask Angle",+ "Curl Noise Cone Mask Axis",+ "Curl Noise Cone Mask Falloff Angle",+ "CurlNoise",+ "Debug Every N Particles",+ "Debug Force Line Length",+ "Mask Curl Noise",+ "Noise Frequency",+ "Noise Quality / Cost",+ "Noise Strength",+ "Pan Noise",+ "Pan Noise Field",+ "Random Seed",+ "Randomization Vector",+ "Randomize Noise Sample",+ "Sample Position",+ "Scale Curl Lookup By Engine Owner Scale",+ "Write to Intrinsic Parameters"+ ],+ "scalesize_inputs": {+ "Scale Sprite Size Mode": [+ "ENiagara_ScaleSpriteSize",+ true+ ],+ "Uniform Curve Sprite Scale": [+ "NiagaraDataInterfaceCurve",+ false+ ],+ "Non-Uniform Curve Sprite Scale": [+ "NiagaraDataInterfaceVector2DCurve",+ false+ ],+ "Uniform Curve Index": [+ "NiagaraFloat",+ false+ ],+ "Non-Uniform Curve Index": [+ "NiagaraFloat",+ false+ ],+ "Non-Uniform Curve Scale": [+ "Vector2f",+ false+ ],+ "Uniform Curve Scale": [+ "NiagaraFloat",+ false+ ],+ "Scale Factor": [+ "Vector2f",+ true+ ],+ "Uniform Scale Factor": [+ "NiagaraFloat",+ false+ ],+ "Initial Sprite Size": [+ "Vector2f",+ true+ ]+ },+ "toolset_log": []+}\ No newline at end of filediff --git a/unreal_bakery/NIAGARA.md b/unreal_bakery/NIAGARA.mdnew file mode 100644index 0000000..72bd5cb--- /dev/null+++ b/unreal_bakery/NIAGARA.md@@ -0,0 +1,655 @@+# NIAGARA.md: porting AnyScene (Blender/Cycles) effects to Unreal 5.8++This is the converter agent's guide to effects: flames, steam, smoke, haze plumes, rain or drizzle, drips and splashes,+sparks and embers, dust motes, fountain jets, and screen or light flicker. Geometry, materials, lights, cameras and fog+already convert (`export_blend.py` writes `scene.json`, then `build_level.py` builds the level). This file covers+what comes next: classify each Blender effect, pick a technique, place it, render it through MRQ and compare it+with Cycles.++Everything marked *[engine]* was confirmed in the installed UE 5.8 files under `C:\Program Files\Epic Games\UE_5.8`.+Items marked *[docs]* come from dev.epicgames.com. Items marked *[untested]* are design guidance: verify them on the+first scene and update this file.++---++## 0. Read this first: findings that change the plan++1. **No built-in fire, steam, smoke or rain system ships with 5.8.** The Niagara plugin includes only generic emitter+ templates (Fountain, HangingParticulates, RecycleParticlesInView, BlowingParticles, DirectionalBurst, ...). There is+ no StarterContent `P_Fire` / `P_Steam` on this install. Real fire and smoke exist only as **NiagaraFluids** grid sims,+ which are Beta and expensive. Plan on an **AnySceneFX content plugin**: about ten master systems authored once, so+ the converter only places them and sets their parameters. Never author Niagara graphs at build time.+2. **Local fog volumes in `build_level.py` are the wrong size.** `ULocalFogVolumeComponent::GetBaseVolumeSize()`+ returns **500 cm**, and the proxy collapses the scale to a uniform sphere using the **max axis**+ (`LocalFogVolumeSceneProxy.cpp:34`) *[engine]*. `build_level.py` assumes a 100 cm unit and non-uniform scale, so+ every LFV comes out about 5x too large and spherical. That is why the wok "flame" became a large static emissive+ glow. `RadialFogExtinction` is also integrated in unit-sphere space: the optical depth straight through the centre+ is exactly `RadialFogExtinction`, independent of size (`LocalFogVolumeCommon.ush:178-203`). The correct mapping is+ **extinction = Blender density (1/m) x path length (m)**, not the raw density.+3. **Particles never reach the level.** The exporter only logs particle emitters into `fx` (no transform, no bounds,+ no velocity), and `build_level.py` ignores `fx`. That is why the HK drizzle and drips are missing. Steam is+ procedural 4D-noise volume shaders, which the exporter samples at one frame into a static LFV. Animated steam+ cannot survive that path.+4. **MRQ needs `render_warm_up_frames = True` for GPU particles.** The flag's own tooltip says GPU particles need the+ warm-up frames to be rendered *[engine: MoviePipelineAntiAliasingSetting.h]*. `build_level.py` already sets it+ (64 engine warm-up frames). Keep it, and keep `use_camera_cut_for_warm_up = False`, or `engine_warm_up_count` is+ ignored.+5. **Pass `fx.Niagara.ForceWaitForCompilationOnActivate=1` in `-dpcvars` for every headless render.** Otherwise a+ component activates while its scripts or GPU shaders are still compiling, and the first frames render without the+ effect. This is the Niagara equivalent of the `Editor.AsyncAssetCompilation=0` gotcha already in+ `render_shots.py`. The per-component property `bWaitForCompilationOnActivate` is editor-only data+ (`NiagaraComponent.cpp:1358`) *[engine]*.+6. **User parameters set from Python in the editor are saved with the level.** In editor builds, `SetVariableFloat`+ and the other setters also call `SetParameterOverride`, which writes `InstanceParameterOverrides`+ (`NiagaraComponent.cpp:2875, 4376`) *[engine]*. So build, set, `save_current_level()` works headlessly. The+ parameter must exist on the asset and the type must match exactly. A wrong name or wrong type is a **silent no-op**.+7. **Epic ships an AI toolset for Niagara authoring:** `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (plus+ `ToolsetRegistry`, both disabled by default). Its tools create systems, add emitters, modules, renderers and user+ variables, set stack inputs, and read compile errors and stack issues. You can call them from Python through+ `unreal.ToolsetRegistry.execute_tool(toolset, tool, json)`. Use this for the **one-time** authoring of the AnySceneFX+ templates, in a full editor session with an RHI. Do not use it in the per-scene build. It is Experimental. Its+ bundled skills (`Content/Python/skills/*.py`) are worth reading. They are summarised in §1 where relevant.+8. **Animated SVTs import headlessly from VDB.** `USparseVolumeTextureFactory` skips its dialog when the import is+ automated or running in a commandlet, auto-detects numbered `.vdb` sequences, and maps the `density` grid to+ attributes A.R (unorm8), with up to 4 other grids in B (fp16) (`SparseVolumeTextureFactory.cpp:40-108, 436`)+ *[engine]*. Blender 5.0 bundles the `openvdb` Python module (`5.0/python/lib/site-packages/openvdb.cp311-*.pyd`), so+ the exporter can write VDBs from procedural volumes itself.++---++## 1. Niagara essentials (only what the converter needs)++- **System > emitters > modules.** A *system* (`UNiagaraSystem`, the asset you place) contains *emitters*. Each+ emitter runs four script stacks in a fixed order: System Spawn/Update, then Emitter Spawn/Update, then Particle+ Spawn/Update. Spawn runs once at creation and Update runs every tick. Within Particle Update the order is forces,+ then collision, then exactly one velocity solve. *Renderers* (sprite, mesh, ribbon, light, ...) draw an emitter's+ particles.+- **Namespaces.** `User.*` is the external interface: set per component, read anywhere. `Engine.*` is read-only (delta+ time, owner transform). `System.*`, `Emitter.*` and `Particles.*` are written by their own scope.+ **Expose everything the converter sets as a `User.` parameter.** From Python, pass the bare name (`SpawnRate`). The+ `User.` prefix also resolves (`RedirectUserVariable`). There is no enum setter: set the int.+- **Types matter.** World-space anchors are `Position` (LWC-aware): use `set_variable_position`. Directions,+ velocities, wind and box extents are `Vector3`: use `set_variable_vec3`. Colours are `LinearColor`.+- **CPU vs GPU.** System and emitter scripts always run on the CPU VM. Only particle scripts move to the GPU.+ - Use **GPU** for anything sustained in the hundreds or more (rain, dust, steam puffs, sparks).+ - Use **CPU** for small counts and for any emitter with a **Light renderer**: light, decal and component renderers+ force the emitter to CPU.+ - A system can mix both.+- **Fixed bounds.** Use fixed bounds for every converter-placed effect. They are cheapest, work on CPU and GPU, and+ stop the culling surprises. Dynamic bounds are CPU-only. GPU emitters without fixed or programmable bounds cull+ wrongly. Set them per instance with `set_system_fixed_bounds(Box)` in **local space**: use the Blender domain or+ emitter box plus travel distance (velocity x lifetime).+- **Warm-up and pre-roll.** `UNiagaraSystem.WarmupTime / WarmupTickCount / WarmupTickDelta` simulate N ticks on+ activation in one frame. Per instance, set `override_warmup_settings = True`, `warmup_tick_count` and+ `warmup_tick_delta`. The component passes these to the instance at activation (`NiagaraComponent.cpp:1219`)+ *[engine]*. Rule: **warm-up time ≥ the longest particle lifetime x 1.5**, so the effect is in steady state on+ frame 1. Mirror Blender's negative `frame_start` (HK drizzle starts at -80) or the Mantaflow `PREROLL`.+- **Determinism and seeds.**+ - The system flag `bDeterminism` + `RandomSeed` makes the instance seed equal the system seed plus the component's+ `RandomSeedOffset`. Without it, every reset gets a random seed.+ - Emitters carry their own `bDeterminism` / `RandomSeed` too.+ - Turn both on in every AnySceneFX template. Set `set_random_seed_offset(hash(fx_id) & 0x7fffffff)` per instance so+ copies differ but runs repeat. The offset is applied on activation or reset, so set it before saving.+ - CPU emitters with determinism repeat exactly under MRQ's fixed timestep. Treat GPU emitters as "very close" *[untested]*.+ For bit-exact repeats, use a sim cache (§2.6).+- **Lit vs unlit sprites.**+ - Fire, embers, sparks, CRT glow: **unlit**, additive or translucent, emissive only.+ - Steam, smoke, haze, dust, rain: **lit translucent**. Use *Translucency Lighting Mode = Volumetric NonDirectional*+ (cheapest, soft) or *Volumetric PerVertex NonDirectional*. The directional modes only matter for normal-mapped+ smoke.+ - Prefer Masked over Translucent where blending allows (drops, chunky debris).+ - Translucent materials need **Two Sided** when seen from both sides.+ - Each material needs the usage flag for its renderer: `MaterialEditingLibrary.set_material_usage(mat,+ unreal.MaterialUsage.MATUSAGE_NIAGARA_SPRITES)`. In 5.8 the `bUsedWith*` flags are deprecated in favour of the+ usage accessor *[engine: Material.h:749]*.+- **Lumen.**+ - Particles do not contribute to Lumen GI or reflections as emitters: a fire sprite lights nothing. Light comes from+ a real light (§3, Lighting).+ - Lit translucent particles receive Lumen GI through the low-resolution translucency lighting volume, so expect+ soft, slightly flat shading.+ - Emissive particles are not in the Lumen scene: they will not show in reflections the way Cycles shows them.+- **Volumetric fog.**+ - A sprite with a **Volume-domain material** injects albedo, emissive and extinction into the volumetric-fog froxel+ grid. This gives real 3D density with no billboard edges *[docs: Volumetric Fog]*. Mesh renderers reject the Volume+ domain *[engine: NiagaraMeshRendererProperties.cpp:1380]*.+ - It needs an Exponential Height Fog with *Volumetric Fog* on, which the converter already spawns.+ - The grid is coarse and camera-aligned, so use it for haze plumes and soft steam bodies, not crisp wisps.+- **Translucency sorting.**+ - Within an emitter: `SortMode = ViewDepth` on the sprite renderer. Leave it at `None` for additive fire and sparks;+ sorting costs GPU time.+ - Between components, sorting is by bounds centre. Fix wrong-order overlaps with the primitive property+ `translucency_sort_priority`, or by splitting the bounds.+- **Depth of field.** Translucent materials default to `TranslucencyPass = MTP_AfterDOF` *[engine: Material.cpp:1183]*,+ so out-of-focus steam stays sharp. For effects in defocused regions (foreground steam in `cam_wok`), set+ `TranslucencyPass = MTP_BeforeDOF` in the template material, or in a second material variant.++---++## 2. Placing and driving Niagara from Python, headless++### 2.1 Confirmed API (UE 5.8, from `NiagaraComponent.h`, `NiagaraActor.h`, `NiagaraFunctionLibrary.h`)++| Need | Call |+|---|---|+| Place | `eas.spawn_actor_from_class(unreal.NiagaraActor, loc, rot)`. Same reason as `spawn_mesh()` in `build_level.py`: spawn by class in the commandlet |+| Component | `act.get_editor_property("niagara_component")` (UPROPERTY `NiagaraComponent`) |+| Set asset | `nc.set_asset(system, True)`. The second arg resets existing overrides: set the asset **first**, then the parameters |+| Float, int, bool | `nc.set_variable_float(name, v)`, `set_variable_int`, `set_variable_bool` |+| Vector, colour | `set_variable_vec3(name, unreal.Vector)`, `set_variable_vec2`, `set_variable_vec4`, `set_variable_linear_color(name, unreal.LinearColor)`, `set_variable_quat` |+| Position (LWC) | `set_variable_position(name, unreal.Vector)` |+| Objects | `set_variable_texture`, `set_variable_material`, `set_variable_static_mesh`, `set_variable_object`, `set_variable_actor` |+| Read back (verify) | `get_variable_float(name)` and the like. In Python these return `(value, is_valid)`; assert `is_valid` |+| Seed | `nc.set_random_seed_offset(int)` |+| Bounds | `nc.set_system_fixed_bounds(unreal.Box)`, `set_emitter_fixed_bounds(emitter_name, box)`; read back with `get_system_fixed_bounds()` |+| Warm-up | `nc.set_editor_property("override_warmup_settings", True)`, `("warmup_tick_count", n)`, `("warmup_tick_delta", dt)` |+| Scalability | `nc.set_allow_scalability(False)`. Cinematic renders must not be distance-culled by an Effect Type |+| Sequencer age | `set_age_update_mode(unreal.NiagaraAgeUpdateMode.DESIRED_AGE_NO_SEEK)`, `set_desired_age(t)`, `seek_to_desired_age(t)` |+| Manual sim | `advance_simulation(ticks, dt)`, `advance_simulation_by_time(seconds, dt)`, `reset_system()`, `reinitialize_system()` |+| Sim cache | `set_sim_cache(cache, reset)`. Capture with `NiagaraSimCacheFunctionLibrary.capture_niagara_sim_cache_immediate(...)` |+| Runtime spawn | `unreal.NiagaraFunctionLibrary.spawn_system_at_location(world, system, loc, rot, scale, auto_destroy, auto_activate, pool, precull)`. Do not use it for level building: it is a transient runtime spawn |++Python names are the snake_case form of the C++ names, with a property's `b` prefix dropped. No stub exists yet+(`Intermediate/PythonStub/unreal.py` is generated only with Developer Mode on). On first use, run+`dir(unreal.NiagaraComponent)` in the build log and fix any name that differs.++### 2.2 Placement snippet (goes into a `stage_fx()` in `build_level.py`)++```python+NS = {}+def fx_system(path):+ if path not in NS:+ NS[path] = unreal.load_asset(path)+ if NS[path] is None:+ warn(f"fx template missing: {path}")+ return NS[path]++def place_fx(eas, fx):+ sysasset = fx_system(fx["template"])+ if sysasset is None:+ return None+ q = fx["transform"]["quat"]+ act = eas.spawn_actor_from_class(unreal.NiagaraActor, V(fx["transform"]["loc"]),+ unreal.Quat(*q).rotator())+ act.set_actor_label("FX_" + fx["id"]); act.set_folder_path("FX")+ nc = act.get_editor_property("niagara_component")+ nc.set_asset(sysasset, True) # 1. asset first (resets overrides)+ for k, v in fx["params"].items(): # 2. typed user params+ t = fx["param_types"][k]+ if t == "float": nc.set_variable_float(k, float(v))+ elif t == "int": nc.set_variable_int(k, int(v))+ elif t == "bool": nc.set_variable_bool(k, bool(v))+ elif t == "vec3": nc.set_variable_vec3(k, V(v))+ elif t == "pos": nc.set_variable_position(k, V(v))+ elif t == "color": nc.set_variable_linear_color(k, unreal.LinearColor(*v[:3], v[3] if len(v) > 3 else 1))+ nc.set_random_seed_offset(fx["seed"]) # 3. determinism+ b = unreal.Box(); b.min = V(fx["bounds_local"]["min"]); b.max = V(fx["bounds_local"]["max"]); b.is_valid = True+ nc.set_system_fixed_bounds(b) # 4. bounds (local)+ nc.set_editor_property("override_warmup_settings", True) # 5. pre-roll+ nc.set_editor_property("warmup_tick_delta", 1.0 / 30.0)+ nc.set_editor_property("warmup_tick_count", int(math.ceil(fx["time"]["preroll_s"] * 30)))+ nc.set_allow_scalability(False)+ for k, t in fx["param_types"].items(): # 6. verify: silent no-ops are the main failure+ if t == "float":+ val, ok = nc.get_variable_float(k)+ if not ok: warn(f"{fx['id']}: user param {k} not on {fx['template']}")+ return act+```+Then call `les.save_current_level()`, as `stage_level` already does. Construct `unreal.Box` the way above, or with+keyword args. Check the result with `get_system_fixed_bounds()`.++### 2.3 Commandlet (`-run=pythonscript`) limits++- **Commandlets render nothing.** A commandlet uses the null RHI unless it is started with `-AllowCommandletRendering`+ (`LaunchEngineLoop.cpp:2246`) *[engine]*.+ - These need no RHI and work in the commandlet: placing actors, setting user parameters, fixed bounds, warm-up+ fields, seeds, and saving.+ - GPU emitters do not simulate there, and their compute shaders are not exercised.+ - Niagara VM script compilation is a DDC/ShaderCompileWorker job. It works from a commandlet, as cooking proves.+ Ship the templates **pre-compiled and saved** in the AnySceneFX plugin, so a fresh build only loads them.+- **The first render compiles shaders.** GPU sim shaders and particle material shaders compile on the first+ `-game -RenderOffscreen` run.+ - Pass `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Budget a one-off cold-DDC compile of about 2-5 minutes per new template set. Keep the DDC on persistent storage+ (`/data`) in the container.+- **Don't author Niagara graphs in the commandlet.** `UNiagaraSystemFactoryNew` exposes no Python properties.+ `EditorAssetLibrary.duplicate_asset()` works for "copy a template and tweak it", but tweaking stack inputs needs+ the NiagaraToolsets editor functions, which expect a full editor. Per-scene variation goes through user parameters,+ not new assets.+- **Plugins.** Niagara is on by default. If you use NiagaraFluids (Beta), NiagaraSimCaching or NiagaraMRQ, enable them+ in `AnySceneUE.uproject` (`"Plugins"`) **before** the build. Enabling a plugin mid-session needs a restart.++### 2.4 MRQ settings for particles (the `MRQ_Still` / `MRQ_Linear` configs in `stage_sequences`)++- `MoviePipelineAntiAliasingSetting`:+ - `engine_warm_up_count = 64`: game-thread ticks with no render; the cheap warm-up.+ - `render_warm_up_frames = True`: required for GPU particles, depth-buffer collision and GPU warm-up.+ - `use_camera_cut_for_warm_up = False`.+ - `temporal_sample_count = 8`: Niagara ticks once per temporal sub-sample, so the accumulation itself gives sprite+ motion blur.+ - Raise `engine_warm_up_count` to `ceil(max_lifetime_s x fps x 1.5)` when the scene's longest lifetime exceeds+ 64/24 s, for example slow steam with 6 s lifetimes.+- **Fixed timestep.** MRQ always steps the world at the sequence rate. Particle state is a pure function of frames+ since activation plus the seed, so the warm-up count must be identical between runs.+- **Pre-roll belongs in the asset or component.** Component warm-up (§2.2) runs on activation, before any MRQ frame.+ Use both component warm-up and MRQ engine warm-up: the first covers steady state, the second covers shader compile+ and streaming.+- `MoviePipelineGameOverrideSetting` (already added) forces cinematic scalability. Also call `set_allow_scalability(False)`+ on every component so Effect Type culling can't drop an effect.+- **Sequencer track (optional, for exact scrubbing).** Add a Niagara System track to the camera's level sequence,+ with a spawn section set to `SectionEvaluateBehavior = ActivateIfInactive` and+ `AgeUpdateMode = DesiredAgeNoSeek`. Age then follows sequence time instead of wall-clock ticks+ (`MovieSceneNiagaraSystemSpawnSection.h`) *[engine]*. Only do this if stills differ between runs.+- **NiagaraMRQ plugin.** It adds a data interface that tells a system whether MRQ is running, plus the temporal sample+ index and count. Use it only if a template must branch for offline quality, for example more particles under MRQ.++### 2.5 Light and screen flicker (not Niagara)++- **Flickering lights.** HK `wok_fire_*` uses a Python driver on `energy`.+ - Do not parse driver expressions. **Sample** the evaluated value per frame in the exporter: `frame_set(f)`, read+ `L.energy` for frames `[start, start+N)`.+ - Write `flicker.values` and key a Sequencer float track on the light's `intensity`, in the camera sequence.+ - Rendered through MRQ, this is deterministic and frame-exact.+- **CRT, screen and sign flicker.** Use a material, not Niagara.+ - Add `FlickerAmp`, `FlickerHz` and `ScanlineDensity` scalar parameters to `M_AnyBaked`'s emissive path, or to a+ dedicated `M_AnyScreen` master: emissive x (1 + amp x noise(time x Hz)), plus a rolling bar.+ - The source is `animated_materials` in the asset entry. Sample the emission strength curve the same way as lights.++### 2.6 When exact repeatability matters: sim caches++Capture the steady-state window once and assign it with `set_sim_cache`. Playback is then identical every run. Use+`capture_niagara_sim_cache_immediate` / `..._multi_frame` from `NiagaraSimCacheFunctionLibrary` in an editor session+with an RHI, or record with a Niagara Cache track in Sequencer (plugin `NiagaraSimCaching`). Only needed for hero+shots and A/B parameter tuning, where seed noise would hide a parameter change.++---++## 3. The template library (`/AnySceneFX/`)++Build these as a content plugin, `Plugins/AnySceneFX/Content/Systems/NS_*.uasset`, authored once and committed.++**Shared rules for every template.**+- `bDeterminism` on, at system and emitter level.+- Fixed bounds mode.+- World space, not local.+- Warm-up 0 in the asset. The converter sets it per instance.+- Every tunable is a `User.` parameter with a real-world default (cm, cm/s, s, nits, K).++**Common user parameters**, the same names in every system so the placement code stays generic:++| Name | Type | Meaning |+|---|---|---|+| `SpawnRate` | float | particles per second (or `Count` for bursts) |+| `LifetimeMin`, `LifetimeMax` | float | seconds |+| `SizeMin`, `SizeMax` | float | sprite size, cm |+| `Velocity` | vec3 | initial velocity, cm/s, world |+| `VelocityJitter` | float | 0..1 fraction (Blender `factor_random`) |+| `Wind` | vec3 | constant drift, cm/s |+| `Gravity` | float | 0..1 x 980 cm/s² |+| `BoxExtent` | vec3 | spawn box half-extent, cm (spawn shape = local box) |+| `Color` | color | albedo (lit) or emissive tint (unlit) |+| `Intensity` | float | emissive luminance multiplier, nits |+| `Opacity` | float | per-sprite peak alpha |+| `Temperature` | float | K, feeds a material `BlackBody` node (fire, embers) |+| `NoiseStrength`, `NoiseFreq` | float | curl-noise force amplitude and frequency |++The seed is not a parameter: it is the component's `RandomSeedOffset`.++**Starting assets that ship with 5.8.** These are mount paths. The engine plugin `/Niagara/` lives at+`Engine/Plugins/FX/Niagara/Content/`, and `/NiagaraFluids/` at `Engine/Plugins/FX/NiagaraFluids/Content/`.++- Emitters: `/Niagara/DefaultAssets/Templates/Emitters/{Fountain, HangingParticulates, RecycleParticlesInView,+ BlowingParticles, DirectionalBurst, OmnidirectionalBurst, SimpleSpriteBurst, SingleLoopingParticle, Minimal,+ UpwardMeshBurst, LocationBasedRibbon, StaticBeam, DynamicBeam, ConfettiBurst}`+- Systems: `/Niagara/DefaultAssets/Templates/Systems/{FountainLightweight, DirectionalBurst, RadialBurst,+ SimpleExplosion, MinimalLightweight, ...}`. The `*Lightweight` systems use stateless emitters, which the Niagara+ toolset cannot edit. Copy the stateful emitters instead.+- Behaviour examples (reference wiring): `/Niagara/DefaultAssets/Templates/BehaviorExamples/{SubUVAnimation,+ SpriteFacingAndAlignment, KillParticles, ...}`+- Fluids (Beta): `/NiagaraFluids/Templates/Gas/3D/Systems/{Grid3D_Gas_Fire, Grid3D_Gas_Smoke, Grid3D_Gas_ColoredFire,+ Grid3D_Gas_ColoredSmoke, Grid3D_MovingGridFire, Grid3D_Gas_Explosion}`, `.../Gas/2D/Systems/{Grid2D_Gas_SmokeFire,+ Grid2D_Gas_Smoke, Grid2D_Gas_MovingFire}`, `/NiagaraFluids/Templates/Liquid/3D/Systems/{Grid3D_Flip_Hose,+ Grid3D_Flip_Splash, Grid3D_Flip_Pool}`; materials `/NiagaraFluids/Materials/Grid3D/M_RayMarch_Fire*`,+ `MI_HeterogeneousVolumes_*`.+- Default sprite materials: `/Niagara/DefaultAssets/DefaultSpriteMaterial`, `M_DepthFade_SpriteSimple`.++**Units used in the mappings below.**+- Blender is metres, the exporter writes centimetres, and Blender axes map to Unreal as (x, -y, z).+- Volume density σ is extinction per metre. Volume emission strength *E* adds radiance per metre, so a slab of+ thickness *t* m that is optically thin glows at about *E·t* (Blender radiance units) = **683·E·t nits**. This is the+ same 683 lm/W the exporter uses for surfaces.+- **Sprite opacity from density.** For a plume of depth *L* (m) seen through *n* overlapping sprites, the target+ optical depth is τ = σ·L. Per-sprite α = 1 − exp(−τ/n). Estimate *n* ≈ SpawnRate × Lifetime × (sprite area ÷+ plume cross-section area).++### 3.1 Per-effect table++| Effect | AnySceneFX system, and how to start it | Key parameter mapping from Blender | Lighting | Real-time budget |+|---|---|---|---|---|+| **Fire / flames** (gas jets, wok, candles, braziers) | `NS_Fire`. Start from `SingleLoopingParticle` + `Fountain` (stateful copies). Two emitters: (a) a **SubUV flame** emitter with a flipbook **baked from the Blender flame volume** (§5.1), unlit additive, random start frame, `bSubImageBlend`; (b) a small blue-core emitter. Hero close-ups: `Grid3D_Gas_Fire` or an SVT (§5) | Domain box → `BoxExtent` and the emitter ring radius. Principled Volume `Emission Strength` x density-ramp peak x thickness → `Intensity` (683·E·t nits). `Emission Color` ramp at 0.6 → `Color`, or `Blackbody Intensity`/`Temperature` → `Temperature`. Flame height (density falloff z) → `Velocity.z` x Lifetime. Noise scroll rate (driver `frame*k`) → flipbook fps | Fire itself lights nothing. **Reuse the Blender practical lights** (`wok_fire_*`, `wok_blue_*` convert already) with the sampled flicker track (§2.5). If the scene has no light, add one CPU emitter with a Light renderer: one particle, `RadiusScale` ≈ flame height x 4, `bAffectsTranslucency` on. Cap: ≤ 4 Niagara lights per scene, ≤ 1 per fire | ≤ 40 sprites per flame, about 0.1 ms. Fluids fire: 1-3 ms at 64³; cinematic only |+| **Steam** (woks, pots, kettles, vents) | `NS_Steam`. Start from `Fountain`. GPU sprites, lit translucent (Volumetric NonDirectional), soft puff texture or a baked steam flipbook, curl noise, size grows x3-5 over life, alpha fades in and out. Add a second **Volume-domain sprite** emitter (§1) for the dense core when volumetric fog is on | Plume box (HK `steam_wok_i`: bottom z = wok rim, top = awning): base disc radius = 0.08 x box width → `BoxExtent`; `rise` (driver `-frame*rise`, m/frame) x fps x 100 → `Velocity.z`; `lean` → `Wind`. Lifetime = box height ÷ rise speed. Density `strength` x 9 (shader constant) = σ peak → `Opacity` by the formula above. `Color` 0.9 grey, anisotropy 0.5 → material phase (backlit glow: enable forward scatter in the material, or rely on volumetric fog) | Lit by scene lights. Needs the practical light behind it to read (HK hood strip, bulbs). `TranslucencyPass = BeforeDOF` for foreground plumes | 200-600 sprites per plume, 0.2-0.5 ms (overdraw-bound) |+| **Smoke** (cigarette curls, exhaust, chimneys) | `NS_Smoke` = `NS_Steam` with a darker albedo, slower rise and a longer life. Thin curls: a **ribbon** emitter (`LocationBasedRibbon`) with curl noise reads better than sprites | MC `smoke_curl_*`: box 0.18 x 0.18 x 0.75 m, noise scroll `-frame*0.012` → `Velocity.z` = 0.012 x fps x 100 cm/s; density 6 → ribbon width 0.5-1 cm, `Opacity` 0.3. Albedo (0.82, 0.8, 0.76) → `Color` | Lit translucent | ribbons: ≤ 3 per curl, negligible |+| **Haze plume / room haze** | Usually **not Niagara**. Homogeneous layers → Exponential Height Fog + Local Fog Volumes (§5.3). Moving plumes (street haze drifting under a light) → `NS_HazePlume`: a few big Volume-domain sprites (2-6 m) | Haze box σ → height fog density (existing code). Local plume: `RadialFogExtinction` = σ x diameter (m) (§0.2). Albedo, anisotropy → `fog_albedo`, `fog_phase_g`. Noise drift → `Wind` | Volumetric fog lighting only. Lights need `volumetric_scattering_intensity` > 0 (already mapped from Blender `visible_volume_scatter`) | LFV about 0.05 ms each; volume sprites 0.3 ms |+| **Rain / drizzle** | `NS_Rain`. Start from `RecycleParticlesInView` (keeps the rain around the camera) or a plain box-spawn GPU emitter. Velocity-aligned sprites (`Alignment = VelocityAligned`), streak length = speed x shutter, masked or translucent, `PixelCoverageMode` Automatic (sub-pixel streaks flicker under TSR otherwise) | Particle settings: `count`, `lifetime`, `frame_start/end` → `SpawnRate = count / (frame_end − frame_start) x fps`; `object_align_factor` (m/s) x 100 → `Velocity` (Blender (x,y,z) → (x,−y,z)); `factor_random` → `VelocityJitter`; emitter object box → `BoxExtent` + transform; instance-object radius x 2 → sprite width (≥ 0.15 cm, or it vanishes), length → streak length; drop material emission 0.5 / alpha 0.35 → `Intensity`, `Opacity` | Lit translucent or unlit with a faint emissive. Rain reads by **backlight**: check it against the street lights in the Cycles frames | GPU, 10k-40k alive, 0.3-0.8 ms |+| **Drips / splashes** | `NS_Drips`: GPU sprites spawned on a line (awning edge) under gravity, killed at the ground plane, plus an **event-free** splash: a second emitter spawned at the computed impact height with `DirectionalBurst`-style spray, or a splash flipbook. Ground ripples: decal flipbook or a puddle material, not particles | `awning_drips`: emitter box (thin strip) → spawn line; `count/span` → `SpawnRate`; `gravity` 1 → `Gravity` = 1; drop size → sprite size; ground z → `KillHeight` (extra user param) | Lit translucent drops; splash unlit-ish | ≤ 200 drops, ≤ 1k spray, about 0.1 ms |+| **Sparks / embers** | `NS_Sparks`: `Fountain` + velocity-aligned additive sprites, gravity, drag, short life. `NS_Embers`: slow buoyant glowing points with curl noise, long life | Particle `velocity`/`normal_factor` → `Velocity`; lifetime → Lifetime; emission colour or temperature → `Temperature` (material BlackBody) and `Intensity` = 683 x strength | Unlit additive; never a light per spark. One Light-renderer particle for a whole shower at most | ≤ 2k, 0.1-0.2 ms |+| **Dust motes** | `NS_DustMotes`: start from `HangingParticulates`. Tiny lit sprites, near-zero velocity, curl-noise drift; only visible inside light shafts, so lit translucent with a strong forward-scatter look | Blender dust particles: count over box volume → density per m³; `SpawnRate` keeps the alive count = count; size 0.05-0.2 cm; box → `BoxExtent` | Lit; needs a shaft light (spot or sun) in the frame | ≤ 3k, 0.1 ms |+| **Fountain water jets** | `NS_FountainJet`: start from `Fountain`, GPU, velocity-aligned stretched sprites + a mist emitter; for hero pools use `Grid3D_Flip_Hose` (Beta, expensive) | Nozzle object → position + direction; jet apex height *h* → `Velocity` = sqrt(2·980·h) cm/s along the nozzle; flow rate → `SpawnRate`; spread → `VelocityJitter` | Lit translucent with high specular-looking emissive edge; check against Cycles highlights | 5k-20k, 0.5 ms; FLIP 3-8 ms |+| **Screen / CRT / light flicker** | Material parameters + Sequencer tracks (§2.5). No Niagara | Sampled emission or energy curves | n/a | ~0 |++Fire, steam and smoke can borrow the **flipbook-from-Blender** path (§5.1). The look then comes from the exact Cycles+shader, and Niagara only supplies motion, variety and parallax.++### 3.2 Authoring the templates once++1. Use a full editor on a GPU box, with `NiagaraToolsets` + `ToolsetRegistry` enabled (Experimental).+2. Discover tool names with `unreal.ToolsetRegistry.get_all_toolset_json_schemas()`.+3. Per template:+ - `CreateNiagaraSystem` from an empty or minimal system;+ - `AddEmitter(<emitter template above>)`;+ - `AddUserVariables(...)`, using the shared parameter names;+ - `SetStackInputData` to link module inputs to the `User.` parameters;+ - `SetRendererData` for alignment, SubUV and sort settings;+ - `SetSystemData` for determinism and fixed bounds.+4. Then call `GetSystemCompileState` and `GetStackIssues`, and fix every error. Epic's own skill text says errors only+ surface once the system has compiled in the editor.+5. A human pass in the Niagara editor is fine as well. The contract is only the user-parameter list above.+6. Save, commit the plugin, and record each system's parameter list in `Plugins/AnySceneFX/templates.json`+ (`{"NS_Steam": {"SpawnRate": "float", ...}}`). The converter reads `param_types` from that file.++---++## 4. Detection rules and the `scene.json` `fx` schema++### 4.1 Classifying Blender effects (exporter side)++Walk every renderable object. A hit gets an `fx` entry and is **not** also exported as a mesh or an LFV, unless+§5 picks the LFV technique. Score each candidate type with the evidence below, take the highest score, and set+`confidence` = top score ÷ (top + runner-up).++| Evidence | Where | Points toward |+|---|---|---|+| Material is volume-only (`is_volume_only`) with `PRINCIPLED_VOLUME` | material | a volume type (steam / smoke / haze / fire) |+| Principled Volume `Emission Strength` > 0, or linked, or `Blackbody Intensity` > 0, or a `BLACKBODY` node, or a `VALTORGB` ramp into Emission Color with orange-to-blue stops | node tree | **fire** |+| Volume with emission 0, albedo > 0.85 grey, density driven by noise + a mapping driver on Z (`-frame*k`) | node tree + drivers | **steam** (k fast, under a hot object) or **smoke** (albedo < 0.85, or name) |+| Volume with no `TEX_NOISE` or a constant density, box > 3 m on its long axis | node tree + size | **haze** (→ fog, §5.3) |+| Volume with noise but drift ≤ 0.002 m/frame and large box | node tree | **haze plume** |+| `FLUID` modifier `DOMAIN`, `domain_type GAS`, cache in OPENVDB | modifier | steam / smoke / fire by `flow_type` of the FLOW objects (`SMOKE`, `FIRE`, `BOTH`) → prefer **SVT** (§5.2) |+| `FLUID` DOMAIN `LIQUID` | modifier | fountain or splash (mesh cache → Alembic or FLIP; flag it for agent review) |+| `VOLUME` object (VDB file) | object type | SVT direct import |+| `PARTICLE_SYSTEM` with `physics_type NEWTON`, `rotation_mode VEL`, velocity mostly −Z ≥ 3 m/s, small elongated instance | particle settings | **rain** |+| … same, slow (< 1 m/s) along −Z, `effector_weights.gravity` ≈ 1, emitter is a thin strip | particle settings | **drips** |+| particles with gravity, short life (< 1.5 s), emissive instance material | settings + material | **sparks** |+| particles with emissive instance, upward velocity, long life | | **embers** |+| particles with ~0 velocity, gravity 0, tiny instance, box emitter | | **dust motes** |+| particles from a small emitter with upward velocity cone, gravity 1, water-like instance (transmission or low roughness) | | **fountain** |+| `NODES` modifier whose tree contains `DISTRIBUTE_POINTS_IN_VOLUME`/`ON_FACES` + `INSTANCE_ON_POINTS` and a `SCENE_TIME` input driving `SET_POSITION` | geometry nodes | rain, dust or drips by the same velocity rules. Sample point positions at two frames to get the velocity |+| Material with drivers/keys on Emission Strength or Color, on a mesh that is a screen (prop name `screen`, `crt`, `monitor`, `tv`, `display`, `sign`) | `animated_materials` | **screen flicker** |+| Light with driver/action on `energy`/`color` | `light_entry.animated` | **light flicker** (sample the curve) |+| Object or material **name** contains a type word (`steam`, `vapor`, `smoke`, `curl`, `haze`, `fog`, `mist`, `flame`, `fire`, `ember`, `spark`, `rain`, `drizzle`, `drip`, `splash`, `dust`, `mote`, `fountain`, `jet`, `flicker`) | names | +2 to that type (tie-breaker, never sufficient alone) |++Also export, per entry:+- `bounds_ue`;+- the emitter shape (box, disc or line from the object's evaluated mesh bounds);+- `preroll_s` from `frame_start < 0` or the fluid `cache_frame_start`;+- the cameras whose frustum contains the bounds;+- the nearest light within 1 m (`light_link`), so fire never double-lights.++For procedural volumes, keep `sample_volume()` but take **8-16 slices**, not 4. Also measure the drift speed by+diffing the mapping-node location driver between two frames, and write the `params` directly.++### 4.2 Schema (JSON Schema 2020-12) for `scene.json → "fx"`++```json+{+ "$id": "anyscene/fx.schema.json",+ "type": "array",+ "items": {+ "type": "object",+ "required": ["id", "type", "confidence", "source", "transform", "bounds_ue", "technique", "params", "time", "seed"],+ "properties": {+ "id": {"type": "string", "pattern": "^[A-Za-z0-9_]+$"},+ "type": {"enum": ["fire", "steam", "smoke", "haze", "haze_plume", "rain", "drips", "splash", "sparks",+ "embers", "dust", "fountain", "screen_flicker", "light_flicker", "unknown"]},+ "confidence": {"type": "number", "minimum": 0, "maximum": 1},+ "source": {"type": "object", "required": ["kind", "objects"], "properties": {+ "kind": {"enum": ["volume_shader", "fluid_domain", "vdb", "particles", "geonodes",+ "animated_emission", "animated_light"]},+ "objects": {"type": "array", "items": {"type": "string"}},+ "material": {"type": ["string", "null"]},+ "evidence": {"type": "array", "items": {"type": "string"}}}},+ "transform": {"type": "object", "required": ["loc", "quat"], "properties": {+ "loc": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3},+ "quat": {"type": "array", "items": {"type": "number"}, "minItems": 4, "maxItems": 4},+ "scale": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3}}},+ "bounds_ue": {"type": "object", "required": ["center", "extent"], "properties": {+ "center": {"type": "array", "items": {"type": "number"}}, "extent": {"type": "array", "items": {"type": "number"}}}},+ "bounds_local": {"type": "object", "properties": {"min": {"type": "array"}, "max": {"type": "array"}}},+ "emitter_shape": {"type": "object", "properties": {+ "kind": {"enum": ["box", "disc", "ring", "line", "plane", "point", "mesh"]},+ "extent_cm": {"type": "array", "items": {"type": "number"}},+ "normal": {"type": "array", "items": {"type": "number"}}}},+ "technique": {"enum": ["niagara", "niagara_flipbook", "niagara_volume_sprite", "svt", "local_fog",+ "height_fog", "material", "sequencer_curve", "skip"]},+ "template": {"type": ["string", "null"], "description": "UE object path, e.g. /AnySceneFX/Systems/NS_Steam.NS_Steam"},+ "params": {"type": "object", "additionalProperties": {"type": ["number", "boolean", "array"]}},+ "param_types": {"type": "object", "additionalProperties": {"enum": ["float", "int", "bool", "vec3", "pos", "color"]}},+ "physical": {"type": "object", "description": "raw Blender-side measurements kept for the look-match pass",+ "properties": {+ "density_per_m": {"type": "number"}, "optical_depth": {"type": "number"},+ "albedo": {"type": "array"}, "anisotropy": {"type": "number"},+ "emission_nits": {"type": "number"}, "emission_color": {"type": "array"}, "temperature_k": {"type": "number"},+ "count": {"type": "integer"}, "lifetime_s": {"type": "array"}, "velocity_cm_s": {"type": "array"},+ "velocity_jitter": {"type": "number"}, "gravity": {"type": "number"}, "size_cm": {"type": "array"},+ "drift_cm_s": {"type": "array"}, "noise_scale_cm": {"type": "number"}}},+ "time": {"type": "object", "required": ["preroll_s", "fps"], "properties": {+ "preroll_s": {"type": "number", "minimum": 0}, "fps": {"type": "number"},+ "start_frame": {"type": "integer"}, "end_frame": {"type": "integer"}, "animated": {"type": "boolean"}}},+ "seed": {"type": "integer", "minimum": 0},+ "flicker": {"type": "object", "properties": {+ "target": {"type": "string"}, "property": {"enum": ["intensity", "emissive_scale", "color"]},+ "fps": {"type": "number"}, "values": {"type": "array", "items": {"type": "number"}}}},+ "flipbook": {"type": "object", "properties": {+ "texture": {"type": "string"}, "grid": {"type": "array"}, "fps": {"type": "number"}, "emissive": {"type": "boolean"}}},+ "vdb": {"type": "object", "properties": {"files": {"type": "string"}, "grids": {"type": "array"}}},+ "cameras": {"type": "array", "items": {"type": "string"}},+ "light_link": {"type": ["string", "null"]},+ "notes": {"type": "array", "items": {"type": "string"}}+ }+ }+}+```+- Units: positions are UE centimetres; velocities are cm/s in UE axes; `extent` is a half-extent in cm; `seed` =+ `crc32(id)`.+- **Ownership.** The exporter fills everything except `technique`, `template` and `params`. A deterministic step+ (`fx_plan.py`, using the decision table in §5.4) fills those three, and the agent may override them.+- `build_level.py` gets a `stage_fx` that dispatches on `technique`. Keep the old `volumes` map for backward+ compatibility, but skip any volume an `fx` entry claims.++---++## 5. Alternatives when Niagara is not the right tool++### 5.1 Flipbooks (SubUV) rendered from the Blender volume++**Best for:** fire, steam puffs and smoke at mid-distance. The look *is* the Cycles shader, with zero tuning of+Niagara colour or density.++How to bake, in a Blender job on the scene copy:+1. Isolate the volume object. Use a transparent film (`film_transparent`) and an orthographic camera fitted to the+ bounds, facing the hero camera's azimuth.+2. Use a black world, plus a neutral key light if the effect is lit (steam). Emissive flames need no light.+3. Render *N* = 64 frames at the scene fps from a steady-state frame. Crossfade the last 16 into the first 16 for a+ loop.+4. Tile 8x8 at 256-512 px per cell. Write RGBA as EXR, or PNG with premultiplied alpha.+5. Export twice for lit effects: an emissive-only pass, and an albedo/alpha pass.+6. Unreal side: `SubImageSize` (8,8) on the sprite renderer, plus a SubUV Animation module whose renderer input+ points at that renderer. Get all three of these right: the grid, the module, and the renderer binding. Any one+ wrong fails **silently**.++Use a flipbook when the camera stays within about 30° of the bake view. Beyond that, sprites rotate visibly; use two+or three bakes at different azimuths, or SVT.++### 5.2 Heterogeneous volumes from VDB (SVT)++**Best for:** hero steam, smoke or fire seen up close or from moving cameras. This is the real 3D density and is the+closest match to Cycles.++**Mantaflow domains.** `cache_data_format = OPENVDB` already writes `cache/data/fluid_data_####.vdb`. Re-save only+the `density`, `flame` and `temperature` grids, or the default mapping packs velocity components into attributes B.++**Procedural shader volumes** (HK steam, MC curls):+1. Sample the material on a 3D grid. Extend `sample_volume` to bake Z slices at 64-128 slices.+2. For animation, repeat per frame for 48-96 frames.+3. Write `.vdb` with Blender's bundled `openvdb` module: `openvdb.FloatGrid`, `copyFromArray`,+ `openvdb.write(path, grids)`.+4. Name the grids `density`, plus `emission` or `temperature`.++**Import into Unreal.**+- Use an `AssetImportTask` on the first file of the numbered sequence. In a commandlet the factory takes the+ unattended path and imports the sequence as an **animated SVT**.+- Optionally pass a `UOpenVDBImportOptionsObject` as `task.options` to control the grid mapping.+- The `InterchangeOpenVDB` plugin is disabled by default. The legacy SVT factory does not need it.++**Render.**+- Spawn `unreal.HeterogeneousVolume`. Its `heterogeneous_volume_component` takes a Volume-domain material that samples+ the SVT (start from `/NiagaraFluids/Materials/Grid3D/Instances/MI_HeterogeneousVolumes_Basic`).+- Animation fields on the component: `frame`, `frame_rate`, `start_frame`, `end_frame`, playing and looping.+- Lighting fields: `step_factor`, `shadow_step_factor`, `lighting_downsample_factor`.+- Map Blender density σ (1/m) to material extinction: σ ÷ 100 per cm, if the material works in world units. Calibrate+ once against a Cycles render of a test cube.++**Cvars.**+- `r.HeterogeneousVolumes 1` (default on).+- `r.HeterogeneousVolumes.Shadows 0` by default: turn it on for self-shadowing steam.+- `r.HeterogeneousVolumes.IndirectLighting 0` by default.+- `r.HeterogeneousVolumes.MaxStepCount 512`.+- `r.HeterogeneousVolumes.Composition 0`: draws before translucency. All *[engine: HeterogeneousVolumes.cpp]*.++**Cost.** Several ms per volume at 1440p. Fine for MRQ, too heavy for a real-time budget unless+`DownsampleFactor` = 2.++### 5.3 Fog for haze++- **Room or street haze** (homogeneous layers, or a large box with gentle noise): Exponential Height Fog plus+ volumetric fog, as `build_level.py` already does.+- **Local layers** (MC ceiling layer, under-awning haze): Local Fog Volumes. Fix §0.2 as follows.+ - Scale = (max box half-extent in cm) ÷ 500.+ - It is a sphere: a long flat box needs several LFVs tiled along its long axis, or height-fog mode+ (`height_fog_extinction`, `height_fog_falloff`, `height_fog_offset`).+ - `radial_fog_extinction` = σ x 2r (m), the optical depth through the centre.+ - `fog_emissive` is luminance: σ_e x 683 nits.+- **Never use an LFV for a flame or a plume.** It cannot move, and its shape is a sphere.++### 5.4 Decision table (per effect)++| Type | Default technique | Use instead when |+|---|---|---|+| fire | `niagara_flipbook` (NS_Fire, flame baked from Blender) | close-up hero, camera moves around it, long shot → `svt` (bake VDB 64 frames) or `Grid3D_Gas_Fire`; tiny candle → unlit sprite, no flipbook |+| steam | `niagara` (NS_Steam lit sprites) + volume-sprite core if volumetric fog is on | Mantaflow cache present, or a hero close-up → `svt`; distant/static → `niagara_flipbook` |+| smoke | curls → `niagara` ribbons; plumes → as steam | — |+| haze | `height_fog` / `local_fog` | visible moving wisps in a light beam → `niagara_volume_sprite` |+| haze_plume | `niagara_volume_sprite` | static in all shots → `local_fog` (fixed size rule) |+| rain | `niagara` (NS_Rain) | only seen through glass far away → material streaks on a card |+| drips / splash | `niagara` (NS_Drips) | ground ripples → animated decal / puddle material |+| sparks / embers | `niagara` | — |+| dust | `niagara` (NS_DustMotes) | — |+| fountain | `niagara` (NS_FountainJet) | Mantaflow liquid cache → Alembic mesh sequence (outside this doc; flag it) |+| screen_flicker / light_flicker | `material` / `sequencer_curve` | — |++---++## 6. Verification loop: did the effect land?++1. **Build.** Run `stage_fx` and save. The build report records, per effect: id, technique, template, user params+ read back (`get_variable_*` valid flags), and fixed bounds read back. Any invalid param is an error, not a warning.+2. **Render.**+ - Render MRQ stills from **every camera in the effect's `cameras`**:+ `render_mrq.ps1 -Cams ...`, with `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Use the **same frame number** as the Cycles still: the exporter's `--frame`, minus the sequence start.+ - For motion, render 24-frame clips of the effect cameras (`custom_end_frame = 24`).+ - Render twice with identical settings to check determinism: the two images' absolute difference should be ~0+ outside the TSR noise floor.+3. **Compare against Cycles.**+ - Use `side_by_side.py`. Compare in the same view transform: use `MRQ_Linear` EXR + Blender AgX, as the pipeline+ already does.+ - For each effect, crop its projected `bounds_ue` box in both images, then compare:+ - **coverage**: the fraction of crop pixels changed vs a render with the effect hidden; render one "FX off"+ still per camera;+ - **mean luminance** and the **99th-percentile luminance** inside the crop, for emissive effects;+ - **contrast and transmission**: background visibility through steam or haze;+ - hue of emissive effects;+ - for rain, streak count, length and angle.+4. **What to look for.**+ - The effect missing entirely: compile, bounds culling, wrong asset, or warm-up.+ - Popping-in in clips: warm-up too short.+ - A box-shaped cut-off: fixed bounds too small.+ - Sharp steam in a blurred foreground: the TranslucencyPass.+ - Black or flat steam: unlit, or no light behind it.+ - Fire that lights nothing, or double lighting: `light_link`.+ - Rain invisible: sprite under a pixel, so check the `PixelCoverageMode` and the width floor.+ - Stepping between frames: the age mode.+ - A sphere-shaped haze blob: the LFV rule.+5. **Adjustment rules.** Change one parameter per round, at most three rounds per effect, and log each round in the+ build report.+ - Coverage too low → raise `SizeMax` first (x1.3), then `SpawnRate` (x1.5). Too high → the reverse order.+ - Too opaque or too faint at matched coverage → scale `Opacity` by `ln(1−T_cycles)/ln(1−T_ue)` (T =+ transmission).+ - Emissive brightness → scale `Intensity` by `L99_cycles / L99_ue`, clamped to x[0.25, 4] per round.+ - Wrong height or reach → `LifetimeMax` (plumes) or `Velocity.z`; keep `Velocity x Lifetime` = the measured Cycles+ reach.+ - Wrong lean → `Wind`.+ - Rain too dense or sparse → `SpawnRate` by the streak-count ratio; streaks too short → the stretch factor+ (speed x shutter), not velocity.+ - After three rounds without converging, switch technique (§5.4 "use instead") and note why in `notes`.++---++## 7. Known gotchas (with sources)++| Gotcha | Fix | Source |+|---|---|---|+| GPU particles absent or frozen in MRQ warm-up | `render_warm_up_frames = True`; engine warm-up alone doesn't run GPU sims | `MoviePipelineAntiAliasingSetting.h` tooltip *[engine]*; Epic MRQ docs |+| `engine_warm_up_count` ignored | `use_camera_cut_for_warm_up = False` (it's EditCondition-gated) | same header |+| Effect missing on the first frames of an offscreen run | `fx.Niagara.ForceWaitForCompilationOnActivate=1` + `Editor.AsyncAssetCompilation=0` | `NiagaraComponent.cpp:112, 1358` *[engine]*; `render_shots.py` notes |+| Nothing renders or compiles in `-run=pythonscript` | expected: null RHI unless `-AllowCommandletRendering`; render in the `-game` pass | `LaunchEngineLoop.cpp:2246` *[engine]* |+| User param silently ignored | exact name + exact type; read back with `get_variable_*` and check the valid flag; set the asset before params (`set_asset` resets overrides) | `NiagaraComponent.cpp:4376, 4620` *[engine]*; NiagaraToolsets `blueprint_interop` skill |+| Effect culled when its origin leaves the view | fixed bounds covering the whole travel; GPU emitters can't use dynamic bounds | `NiagaraSystem.h:1052`; NiagaraToolsets `optimization` skill |+| Effect dropped at distance or by budget | `set_allow_scalability(False)`; `MoviePipelineGameOverrideSetting` | `NiagaraComponent.h` *[engine]* |+| Different particles every run | system + emitter `bDeterminism`, a fixed `RandomSeedOffset`, fixed MRQ warm-up; sim cache for bit-exact results | `NiagaraSystem.h:1073-1085` *[engine]* |+| Translucent FX sharp in defocused areas | material `TranslucencyPass = MTP_BeforeDOF` (default is AfterDOF) | `Material.h:142`, `Material.cpp:1183` *[engine]* |+| Sprite motion blur smears or vanishes | rely on MRQ temporal samples (8); renderer `MotionVectorSetting` Precise for fast sparks, Disable for steam; post-process motion blur is off in the converter (`motion_blur_amount 0`) | `NiagaraRendererProperties.h:480` *[engine]* |+| Thin rain or sparks flicker or disappear under TSR | `PixelCoverageMode` Automatic (project setting enabled) and a width floor; velocity-aligned streaks | `NiagaraSpriteRendererProperties.h` *[engine]* |+| Fire doesn't light the set; Lumen ignores emissive sprites | real lights (Blender practicals or one Light-renderer particle); Niagara lights are CPU-only and shadowless unless MegaLights (`bAllowMegaLights`, `bMegaLightsCastShadows`) | `NiagaraLightRendererProperties.h:62-110` *[engine]*; NiagaraToolsets `renderers` skill |+| Particle lights invisible in fog | light needs volumetric scattering intensity > 0 | *[docs: Volumetric Fog]* |+| Lit translucency looks flat or blotchy | it's the translucency lighting volume; use Volumetric NonDirectional, keep sprites large and soft | Lumen translucency behaviour *[docs]* |+| SubUV shows the whole atlas | renderer `SubImageSize` + a SubUV module + its renderer binding | NiagaraToolsets `renderers` skill |+| Local fog volume 5x too big / spherical | base radius 500 cm; uniform max-axis scale; extinction = optical depth through the centre | `LocalFogVolumeComponent.h:74`, `LocalFogVolumeCommon.ush:178-203` *[engine]* |+| VDB import pops a dialog | not in a commandlet or with automated tasks; numbered files become an animated SVT | `SparseVolumeTextureFactory.cpp:436` *[engine]* |+| Blender motion blur on volumes | irrelevant in UE, but the Cycles reference frames have no volume blur (object blur off on volume boxes); don't add any in UE either | HK `fx.py`, `SKILL.md` §11 |++**Sources.**+- Installed engine files:+ - `Engine/Plugins/FX/Niagara/Source/Niagara/{Public/NiagaraComponent.h, Public/NiagaraActor.h,+ Public/NiagaraFunctionLibrary.h, Classes/NiagaraSystem.h, Classes/NiagaraEmitter.h,+ Public/NiagaraLightRendererProperties.h, Public/NiagaraSpriteRendererProperties.h, Public/NiagaraCommon.h,+ Public/MovieScene/MovieSceneNiagaraSystemSpawnSection.h, Classes/NiagaraSimCacheFunctionLibrary.h,+ Private/NiagaraComponent.cpp, Private/NiagaraSystemInstance.cpp}`+ - `Engine/Plugins/FX/{NiagaraFluids, NiagaraMRQ, NiagaraSimCaching}`+ - `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (tools + `Content/Python/skills`)+ - `Engine/Plugins/Experimental/ToolsetRegistry`+ - `Engine/Plugins/MovieScene/MovieRenderPipeline/.../MoviePipelineAntiAliasingSetting.h`+ - `Engine/Source/Runtime/Engine/Classes/Components/{HeterogeneousVolumeComponent.h, LocalFogVolumeComponent.h}`+ - `Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp`+ - `Engine/Shaders/Private/LocalFogVolumes/LocalFogVolumeCommon.ush`+ - `Engine/Source/Editor/SparseVolumeTexture/Private/SparseVolumeTextureFactory.cpp`+ - `Engine/Source/Runtime/Engine/Public/Materials/Material.h`+ - `Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp`+- Epic docs:+ - [Volumetric Fog](https://dev.epicgames.com/documentation/en-us/unreal-engine/volumetric-fog-in-unreal-engine)+ - [Rendering your Niagara systems (MRQ)](https://dev.epicgames.com/documentation/unreal-engine/rendering-your-niagara-systems)+ - [NiagaraMRQ API](https://dev.epicgames.com/documentation/unreal-engine/API/PluginIndex/NiagaraMRQ)+ - [MoviePipelineAntiAliasingSetting (Python API)](https://api.unrealengine.com/INT/PythonAPI/class/MoviePipelineAntiAliasingSetting.html)+- AnyScene:+ - `scenes/hk-dai-pai-dong/scripts/{fx.py, lights.py, steam.py}`, `NOTES.md`+ - `scenes/mission-control-1970s/scripts/haze.py`+ - `SKILL.md` §11, `builder/CRAFT.md`diff --git a/unreal_bakery/TOGGLE.md b/unreal_bakery/TOGGLE.mdnew file mode 100644index 0000000..ccde400--- /dev/null+++ b/unreal_bakery/TOGGLE.md@@ -0,0 +1,155 @@+# TOGGLE.md: an `unreal` option on `/ref2scene`, and `/scene2unreal`++Design note. Nothing here is implemented yet. It builds on `unreal/export_blend.py`, `unreal/build_level.py`,+`unreal/render_mrq.ps1`, `unreal/perf.ps1` and `unreal/NIAGARA.md`, and on `builder/app.py`+(`SceneBuilderApp`, `BuildRequest`, `_build_and_shoot`).++## 1. API++### 1a. Toggle on `/ref2scene` (and its `/build` alias)++Add one optional field to `BuildRequest`. Like `shots`, it stays **out of the build fingerprint** (`fp` in `_build`),+so one Blender build serves any number of Unreal conversions.++```python+class UnrealOptions(BaseModel):+ enabled: bool = Field(True, description="Convert the passed build into an Unreal 5.8 level.")+ cameras: list[str] = Field(default_factory=list, description="Cameras to render MRQ stills from (default: every scouting camera in shots.json).")+ fx: bool = Field(True, description="Port effects (flames, steam, rain, ...) per NIAGARA.md. False: static fog only.")+ look_match_rounds: int = Field(2, description="Agent look-match passes against the Cycles frames (0 = deterministic conversion only).")+ package: str = Field("plugin", description="plugin: a UE content plugin zip (drop into any 5.8 project). uproject: a full project zip. both.")+ still_res: list[int] = Field([1920, 1080], description="MRQ still resolution (W, H).")+ clip_frames: int = Field(0, description="Also render N-frame MRQ clips per camera (0 = stills only).")+ perf: bool = Field(True, description="Run the real-time perf capture (CSV profiler, GPU memory) at perf_res.")+ perf_res: list[int] = Field([2560, 1440])+ gpu_budget_ms: float = Field(16.6, description="Real-time frame budget the perf report grades against.")++class BuildRequest(BaseModel):+ ...+ unreal: UnrealOptions | None = Field(None, description="Optional: once the build passes its critic, convert it to Unreal.")+```++Add to `BuildResponse`: `unreal_job: dict | None`, holding status, `request_id` and an error if any, with the same+shape as `shots_job`. Add `unreal: UnrealResult | None` (§3).++### 1b. Standalone `/scene2unreal`++`SceneUnrealRequest = {build_id: str, **UnrealOptions, fresh: bool = False, effort: str = "medium"}`.+- It runs on any finished build in `/data/anyscene/builder/<build_id>`.+- It is retry-safe the same way `_build` is: an index keyed by `sha256(build_id + options)` and an `.alive`+ heartbeat.+- `/ref2scene` with `unreal` set calls it **after** `_build`, exactly like `_anyshot`.+- Run it as a **separate fal app** (`anyscene-unreal`) on a UE container. The builder image stays Blender-only, and+ the UE image (about 40 GB with DDC) only starts when someone asks for Unreal. The builder forwards the order with+ `fal_client` and relays the stage lines, as `call_anyshot` does.++## 2. What runs after the critic passes++The gate is the same as for shots: `res.critiques[-1]["passed"] and res.scene_blend_url`.++| # | Stage | Where | Deterministic? |+|---|---|---|---|+| 1 | **Export**: `blender -b <copy> --python export_blend.py -- --out exp/ --gpu --grade-sh ... --frame <hero frame>`, sharded (§5), then a merge pass writes `scene.json` incl. `fx` (NIAGARA.md §4) and the flipbook / VDB bakes the FX plan asks for | builder GPU worker (has Blender + OptiX cache) or the UE worker if Blender is installed there | yes |+| 2 | **FX plan**: `fx_plan.py` fills `technique / template / params` per `fx` entry from the NIAGARA.md decision table | either | yes (rules); entries with `confidence < 0.6` are queued for the agent |+| 3 | **UE build**: `UnrealEditor-Cmd AnySceneUE.uproject -run=pythonscript -script=build_level.py` (stages textures, meshes, materials, level, fx, sequences) on a **Linux GPU container** with the AnySceneFX plugin preinstalled and a persistent DDC on `/data` | UE worker | yes |+| 4 | **Shader warm**: one `-game -RenderOffscreen` run of the level with `fx.Niagara.ForceWaitForCompilationOnActivate=1` and `Editor.AsyncAssetCompilation=0` to fill the DDC (skipped when DDC is warm) | UE worker | yes |+| 5 | **MRQ stills** per camera (`MRQ_Still` + `MRQ_Linear`), plus clips if requested | UE worker | yes, given a fixed seed and warm-up |+| 6 | **Look-match pass** (agent): compare against the Cycles stills (`side_by_side.py`, crops per `fx` bounds, exposure, fog), adjust **parameters only** (exposure offset, fog density, FX user params, light scale) with the NIAGARA.md §6 rules, rebuild only the `level`/`fx` stages, re-render; `look_match_rounds` times | UE worker + Claude | agent-judged, logged as a param diff |+| 7 | **Perf**: `perf.ps1`-equivalent `-game -RenderOffscreen` with `csvprofile`, `nvidia-smi` sampling | UE worker | measured |+| 8 | **Package**: `Plugins/AnyScene_<build>/Content/...` (+ `.uplugin`) zip; optionally the whole `.uproject` minus `Intermediate/`, `Saved/`, `DerivedDataCache/` | UE worker | yes |++**Linux notes.**+- The Linux editor renders through Vulkan (SM6). `-RenderOffscreen` works without a display. Install the Vulkan ICD+ from the NVIDIA container toolkit (`NVIDIA_DRIVER_CAPABILITIES=all`, as the builder Dockerfile already sets).+- Lumen with hardware ray tracing on Vulkan needs a recent driver. Fall back to `r.Lumen.HardwareRayTracing 0` and+ record which mode the render used.+- Swap the Windows `.ps1` wrappers for Python `subprocess` callers. `render_mrq.ps1` and `perf.ps1` are thin.+- Validate on Linux once against the Windows reference box before trusting look-match numbers. Vulkan vs D3D12+ shading differences are small but non-zero. *[untested]*++## 3. Outputs (`UnrealResult`)++```json+{+ "package_url": "...AnyScene_b_xxxx_plugin.zip",+ "uproject_url": "... (optional)",+ "stills": [{"camera": "cam_street", "ue": "...png", "ue_linear": "...exr", "cycles": "...png", "side_by_side": "...png"}],+ "clips": [],+ "look_match": {"rounds": 2, "changes": [{"round": 1, "target": "fx:steam_wok_0", "param": "Opacity", "from": 0.12, "to": 0.18, "why": "transmission 0.71 vs 0.58"}]},+ "fx": [{"id": "steam_wok_0", "type": "steam", "technique": "niagara", "template": "/AnySceneFX/Systems/NS_Steam", "status": "ok"}],+ "perf": {"res": [2560, 1440], "gpu_ms_p50": 0, "gpu_ms_p95": 0, "frame_ms_p95": 0, "gpu_mem_delta_mb": 0, "draw_calls": 0, "verdict": "within budget|over budget"},+ "build_report": "...build_report.json",+ "warnings": [],+ "minutes": {"export": 0, "ue_build": 0, "mrq": 0, "look_match": 0, "total": 0}+}+```++## 4. Time and cost (from the HK run: 627 meshes)++| Stage | HK today (serial) | With §5 sharding | Notes |+|---|---|---|---|+| Blender export (bake + GLB) | ~35 min | ~6-9 min | about 3.3 s per unique mesh; scales with unique meshes, not instances |+| FX bakes (flipbooks / VDB) | n/a | +2-6 min | only for `niagara_flipbook` / `svt` entries; runs in parallel with the mesh shards |+| UE build (import + level) | ~15 min | ~10-15 min | import-bound; Interchange is already batched by 16; FX stage adds < 1 min |+| Shader warm (cold DDC) | ~3-5 min | 0-5 min | ~0 once `/data` DDC is warm for the templates and master materials |+| MRQ stills | ~1 min/still | ~1 min/still | 3 cameras x (1 + rounds) with rounds = 2 → 9 stills ≈ 9 min (or ~45 s each when batched in one process instead of one per camera) |+| Look-match agent | n/a | ~3-5 min/round of thinking + rebuild (`level,fx` stages ≈ 1-2 min) | |+| Perf capture | n/a | ~2 min | 900 frames + startup |+| **Total** | **~55 min + stills** | **~30-40 min** | |++**Cost** = GPU-minutes x the fal machine rate, plus agent tokens.+- GPU time is about 35 GPU-minutes on the parallel path.+- The export shards are CPU-heavy. Bakes can use `--gpu` (OptiX) on the builder's own GPU. Run the export on the+ builder worker that already holds the scene, and hand only `exp/` (GLBs + PNGs, roughly 1-3 GB for HK) to the UE+ app through `/data`.+- Agent tokens apply only to look-match rounds and to low-confidence FX entries: roughly one Claude session of about+ 15-30 tool calls per round.+- With `look_match_rounds = 0` the job is purely deterministic and costs only GPU time.++## 5. Parallelizing the slow export++The export is embarrassingly parallel per unique mesh. Bakes are independent, and existing outputs are skipped+(rerunnable).++1. **Plan pass.** One quick Blender process classifies the objects and writes `export_plan.json`: the list of asset+ keys with estimated bake pixels (area x density). It does no baking.+2. **Shards.** Run *N* Blender processes on copies of the `.blend`, each started with `--shard i/N`. This is a new+ flag: keep `keys[k]` where `k % N == i`, after sorting by estimated cost and dealing round-robin, so shards+ balance. Each shard bakes into the shared `tex/` and `mesh/` directories.+ - Today's `--reverse` and `--only` already show that two processes can share the folder safely.+ - Pick *N* = min(CPU cores ÷ 4, 8) for CPU bakes. With `--gpu`, run 2-3 processes per GPU, since OptiX bakes are+ short and the time goes into Blender overhead.+3. **Merge pass.** One process with `--no-bake`. Every texture and GLB already exists, so it only writes+ `scene.json`, lights, cameras, world, grade and `fx`. This also removes the partial-`scene.json` merge+ (`ONLY`/`LIMIT` branch) from the hot path.+4. **Cache across builds.** Key `tex/` and `mesh/` by a hash of (evaluated mesh data + material node trees + bake+ settings). The same prop library recurs across scenes, and a retry of `/scene2unreal` re-bakes nothing.+5. **FX bakes** (flipbook renders, VDB sampling) are extra shards, scheduled first because they are the longest+ single jobs.++The UE side can overlap with the export. Start texture import of finished shards while the others are still baking:+the `textures` stage is rerunnable and skips assets that exist. Mesh import order does not matter.++## 6. Deterministic vs agent-judged++**Deterministic.** Same input gives the same output, so these steps are cacheable and testable.+- Everything in `export_blend.py`, and the fx classification scores.+- `fx_plan.py` technique and parameter mapping (NIAGARA.md §3-5).+- `build_level.py`.+- Seeds: `RandomSeedOffset = crc32(fx id)`.+- Warm-up counts.+- MRQ settings.+- Packaging.+- Perf numbers (measured, so noisy within ±5%).++**Agent-judged.** Logged as explicit parameter diffs, bounded by `look_match_rounds`.+- Low-confidence fx classification (< 0.6), including `unknown` entries.+- Switching technique when a parameter-only match fails after three rounds (NIAGARA.md §6.5).+- Exposure and fog calibration offsets.+- FX user-parameter tuning.+- Light scale tweaks.+- The final "does it read like the Cycles frame" verdict, which goes into the response next to the side-by-sides.++**Rule.** The agent never edits `build_level.py`, `export_blend.py` or templates during a job. It writes overrides to+`exp/overrides.json`, which `build_level.py` applies on top of `scene.json`. A rerun with the same overrides+reproduces the agent's result exactly.diff --git a/unreal_bakery/_orig/agx_view.py b/unreal_bakery/_orig/agx_view.pynew file mode 100644index 0000000..870bf9e--- /dev/null+++ b/unreal_bakery/_orig/agx_view.py@@ -0,0 +1,19 @@+"""Apply a Blender view transform (default AgX + the scene's look) to Unreal scene-linear EXRs (MRQ_Linear output),+so UE and Cycles frames can be compared through the same tone mapper.+ blender -b --factory-startup --python agx_view.py -- <in.exr> <out.png> [look] [exposure]+"""+import sys+import bpy++a = sys.argv[sys.argv.index("--") + 1:]+src, dst = a[0], a[1]+look = a[2] if len(a) > 2 else "AgX - Medium High Contrast"+expo = float(a[3]) if len(a) > 3 else 0.0+sc = bpy.context.scene+sc.view_settings.view_transform = "AgX"+sc.view_settings.look = look+sc.view_settings.exposure = expo+sc.render.image_settings.file_format = "PNG"+img = bpy.data.images.load(src)+img.save_render(dst, scene=sc)+print("AGX", src, "->", dst, flush=True)diff --git a/unreal_bakery/_orig/build_level.py b/unreal_bakery/_orig/build_level.pynew file mode 100644index 0000000..66897bb--- /dev/null+++ b/unreal_bakery/_orig/build_level.py@@ -0,0 +1,671 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,sequences (default: all)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % 16 == 15 or i == len(todo) - 1:+ flush(a)+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked():+ path = f"{DEST}/Materials/M_AnyBaked"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyBaked", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_glass():+ path = f"{DEST}/Materials/M_AnyGlass"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGlass", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ c = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, -500, 0)+ c.set_editor_property("parameter_name", "Color")+ c.set_editor_property("default_value", unreal.LinearColor(1, 1, 1, 1))+ r = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 200)+ r.set_editor_property("parameter_name", "Roughness")+ r.set_editor_property("default_value", 0.05)+ o = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 350)+ o.set_editor_property("parameter_name", "Opacity")+ o.set_editor_property("default_value", 0.25)+ MEL.connect_material_property(c, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], baked)+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ c = g["color"]+ MEL.set_material_instance_vector_parameter_value(gm, "Color", unreal.LinearColor(c[0], c[1], c[2], 1))+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0]:+ continue+ b = v["bounds_ue"]+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(b["center"]), unreal.Rotator(0, 0, 0))+ lf.set_actor_label("LFV_" + name)+ lf.set_folder_path("Volumes")+ # Local fog volumes are unit spheres of radius 100 cm at scale 1 (assumed); scale to the box.+ lf.set_actor_scale3d(unreal.Vector(b["extent"][0] / 100, b["extent"][1] / 100, b["extent"][2] / 100))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"])+ emit = max(v["emission"])+ lc.set_editor_property("radial_fog_extinction", dens)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ lc.set_editor_property("radial_fog_extinction", 1.0)+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * emit, ec[1] * emit, ec[2] * emit, 1))+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", min(1.0, ff["vignette_angle_rad"] / (math.pi / 4) * 0.45))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+ hero = next((c for c in scene["cameras"] if c["name"] == "cam_street"), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(48)+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, 48)+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ EAL.save_loaded_asset(seq, False)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = scene["grade"].get("resolution", [1920, 804])+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.path.join(EXPORT, "..", "compare", "mrq").replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = True+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = 64+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal_bakery/_orig/csv_summary.sh b/unreal_bakery/_orig/csv_summary.shnew file mode 100644index 0000000..1a3f187--- /dev/null+++ b/unreal_bakery/_orig/csv_summary.sh@@ -0,0 +1,16 @@+#!/usr/bin/env bash+# Summarise an Unreal CSV profile: mean / p50 / p95 of frame, game, render, RHI and GPU time plus the top GPU passes.+# bash csv_summary.sh <Profile(...).csv> [skip_first_frames=60]+f="$1"; skip="${2:-60}"+awk -F, -v skip="$skip" '+NR==1 { for (i=1;i<=NF;i++) col[$i]=i; next }+$1 ~ /^\[/ || NF < 10 { next }+{ n++; if (n<=skip) next; m+++ for (k in col) if (k=="FrameTime"||k=="GameThreadTime"||k=="RenderThreadTime"||k=="RHIThreadTime"||k=="GPUTime"||k ~ /^GPU\//) { v=$(col[k])+0; s[k]+=v; a[k,m]=v } }+END {+ printf "frames=%d (after skipping %d)\n", m, skip+ split("FrameTime GameThreadTime RenderThreadTime RHIThreadTime GPUTime", ks, " ")+ for (j=1;j<=5;j++) { k=ks[j]; c=0; for (i=1;i<=m;i++) t[++c]=a[k,i]; asort(t); printf "%-17s mean %6.2f ms p50 %6.2f p95 %6.2f\n", k, s[k]/m, t[int(c*0.5)], t[int(c*0.95)]; delete t }+ printf "fps(mean frame) %.1f\n", 1000/(s["FrameTime"]/m)+ for (k in s) if (k ~ /^GPU\//) printf "%8.3f %s\n", s[k]/m, k | "sort -rn | head -12"+}' "$f"diff --git a/unreal_bakery/_orig/export.sh b/unreal_bakery/_orig/export.shnew file mode 100644index 0000000..92e1f3f--- /dev/null+++ b/unreal_bakery/_orig/export.sh@@ -0,0 +1,23 @@+#!/usr/bin/env bash+# export_blend.py through the GPU queue, resumed until it finishes. Blender 5.0.1 Cycles bake crashes intermittently+# (EXCEPTION_ACCESS_VIOLATION in OpenImageIO ustring::operator= under ccl::create_mesh, ~1 per 250 bakes, a different+# asset each time); the exporter skips assets whose GLB/texture already exist, so a rerun resumes where it died.+# bash unreal/export.sh <copy.blend> <out_dir> [export_blend.py args...] (log: <out_dir>/export.log)+# EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py"+A="$(cd "$(dirname "$0")/.." && pwd)"+. "$A/pipeline/env.sh"+blend="$1"; out="$2"; shift 2+mkdir -p "$out"+: > "$out/export.log"+pre=()+[ -n "$EXPORT_PRE" ] && pre=(--python "$EXPORT_PRE")+for i in $(seq 1 "${EXPORT_TRIES:-6}"); do+ bash "$A/pipeline/gpu_run.sh" "$BLENDER" -b "$blend" "${pre[@]}" --python "$A/unreal/export_blend.py" -- --out "$out" "$@" \+ >> "$out/export.log" 2>&1+ rc=$?+ if grep -q "^EXPORT wrote" "$out/export.log"; then echo "export: done after $i run(s)"; exit 0; fi+ # rc 0 without "wrote" is a Python exception (Blender exits 0 on those): retrying will not help.+ [ "$rc" = 0 ] && { echo "export: python error, see $out/export.log"; exit 1; }+ echo "export: run $i exited rc=$rc without finishing; resuming" | tee -a "$out/export.log"+done+echo "export: gave up after ${EXPORT_TRIES:-6} runs"; exit 1diff --git a/unreal_bakery/_orig/export_blend.py b/unreal_bakery/_orig/export_blend.pynew file mode 100644index 0000000..89ff833--- /dev/null+++ b/unreal_bakery/_orig/export_blend.py@@ -0,0 +1,1023 @@+"""AnyScene -> Unreal export: bake every surface material to PBR textures, export one GLB per unique mesh, and write+scene.json (placements, lights, cameras, world, volumes, grade) in Unreal units and axes.++ blender -b <COPY of scene.blend> --python export_blend.py -- --out <dir> [--frame 60] [--only a,b] [--limit N]+ [--density 1024] [--max-res 4096] [--grade-sh scenes/<id>/scripts/grade.sh] [--ffmpeg path]+ [--dof '{"cam_street": [9.5, 2.8]}'] [--no-bake] [--cpu-threads 0]++Never saves the .blend (it modifies the open file in memory: new UV layers, converted text/curves). Rerunnable:+textures and GLBs that already exist are skipped (delete <out>/tex/<asset>_* or <out>/mesh/<asset>.glb to redo one).++Conventions written to scene.json+ * Space: Unreal (cm, X forward, Y right, Z up, left-handed). Blender (x, y, z) m -> Unreal (x, -y, z) * 100.+ Object transforms are S*M*S with S = diag(1,-1,1), given as location, quaternion (x,y,z,w) and scale.+ * Mesh GLBs are exported in object-local space at identity; the Unreal importer maps glTF to its own axes, so+ build_level.py checks the result against "check_bounds" for the first assets.+ * Photometry: 683 lm/W. Point/spot cd = 683 * P / (4 pi); area cd = 683 * P / pi; sun lux = 683 * S;+ emissive nits = 683 * strength; sky radiance x 683. Exposure: Blender pixel = L_b * 2^exposure, so the Unreal+ manual exposure is EV100 = log2(683 / 1.2) - exposure (written as grade.ev100).+ * Bake: every surface material (procedural or not) is baked per unique mesh into one texture set on a bake UV:+ BaseColor (sRGB png), ORM (R=1, G=roughness, B=metallic, linear png), Normal (tangent, OpenGL +Y, png, only if a+ material perturbs the normal), Emissive (sRGB png + scale, only if emissive). Glass slots (transmission > 0.5)+ are not baked: they keep their own material slot and parameters.+"""+import bmesh # noqa: F401 (kept for hand edits)+import json+import math+import os+import re+import subprocess+import sys+import time++import bpy+import numpy as np+from mathutils import Matrix, Vector++LM_PER_W = 683.0+argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+++def arg(name, default=None):+ return argv[argv.index(name) + 1] if name in argv else default+++OUT = os.path.abspath(arg("--out", "unreal_export"))+FRAME = int(arg("--frame", "60"))+ONLY = set(x for x in arg("--only", "").split(",") if x)+LIMIT = int(arg("--limit", "0"))+DENSITY = float(arg("--density", "1024")) # bake px per metre of sqrt(surface area)+MAX_RES = int(arg("--max-res", "4096"))+NO_BAKE = "--no-bake" in argv+DOF = json.loads(arg("--dof", "{}"))+GRADE_SH = arg("--grade-sh")+FFMPEG = arg("--ffmpeg", os.environ.get("FFMPEG", "ffmpeg")) # pipeline/env.sh exports FFMPEG (ffmpeg is not on PATH here)+THREADS = int(arg("--cpu-threads", "0"))+GPU = "--gpu" in argv # bake with OptiX (run through pipeline/gpu_run.sh)+REVERSE = "--reverse" in argv # walk assets from the end: a second process can share the work++SRC = bpy.data.filepath+if not SRC or os.path.basename(SRC) == "hk.blend" and "scenes" in SRC.replace("\\", "/").split("/"):+ print("export_blend: refusing to run on a scene's own .blend; open a copy", flush=True)+ sys.exit(1)++for d in ("mesh", "tex", "world", "grade"):+ os.makedirs(os.path.join(OUT, d), exist_ok=True)++sc = bpy.context.scene+sc.frame_set(FRAME)+S = Matrix.Diagonal((1.0, -1.0, 1.0, 1.0))+LOG = []+++def log(*a):+ s = " ".join(str(x) for x in a)+ LOG.append(s)+ print("EXPORT", s, flush=True)+++def ue_vec(v, scale=100.0):+ return [v[0] * scale, -v[1] * scale, v[2] * scale]+++def ue_xform(mw):+ t = S @ mw @ S+ loc, rot, scl = t.decompose()+ return {"loc": [loc.x * 100, loc.y * 100, loc.z * 100], "quat": [rot.x, rot.y, rot.z, rot.w], "scale": list(scl)}+++def ue_axes(mw):+ """Forward (-Z local) and up (+Y local) of a Blender camera/light in Unreal axes."""+ r = mw.to_3x3().normalized()+ f = r @ Vector((0, 0, -1))+ u = r @ Vector((0, 1, 0))+ return [f.x, -f.y, f.z], [u.x, -u.y, u.z]+++def safe(name):+ return re.sub(r"[^A-Za-z0-9_]", "_", name)[:60]+++# ------------------------------------------------------------------ material inspection++def output_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ for n in outs:+ if n.is_active_output:+ return n+ return outs[0] if outs else None+++def surface_shader(m):+ if not m or not m.node_tree:+ return None+ o = output_node(m.node_tree)+ if not o or not o.inputs["Surface"].is_linked:+ return None+ return o.inputs["Surface"].links[0].from_node+++def is_volume_only(m):+ if not m or not m.node_tree:+ return False+ o = output_node(m.node_tree)+ return bool(o and o.inputs["Volume"].is_linked and not o.inputs["Surface"].is_linked)+++def find_principled(m):+ sh = surface_shader(m)+ if sh is None:+ return None+ if sh.type == "BSDF_PRINCIPLED":+ return sh+ # Mix shaders etc.: first principled upstream.+ seen, stack = set(), [sh]+ while stack:+ n = stack.pop()+ if n.name in seen:+ continue+ seen.add(n.name)+ if n.type == "BSDF_PRINCIPLED":+ return n+ for i in n.inputs:+ for l in i.links:+ stack.append(l.from_node)+ return None+++def is_glass(m):+ p = find_principled(m)+ if p is not None:+ return (not p.inputs["Transmission Weight"].is_linked) and p.inputs["Transmission Weight"].default_value > 0.5+ sh = surface_shader(m)+ return sh is not None and sh.type in ("BSDF_GLASS", "BSDF_REFRACTION")+++def glass_params(m):+ p = find_principled(m)+ if p is None:+ return {"color": [1, 1, 1], "roughness": 0.0, "ior": 1.45}+ c = p.inputs["Base Color"].default_value+ return {"color": [c[0], c[1], c[2]], "roughness": p.inputs["Roughness"].default_value,+ "ior": p.inputs["IOR"].default_value, "alpha": p.inputs["Alpha"].default_value}+++def emissive(m):+ sh = surface_shader(m)+ if sh is None:+ return False+ if sh.type == "EMISSION":+ return True+ p = find_principled(m)+ if p is None:+ return False+ s = p.inputs["Emission Strength"]+ c = p.inputs["Emission Color"]+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))+++def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+++def uses_object_dependence(m):+ """Nodes whose result depends on the object it sits on (bakes per representative instance)."""+ if not m or not m.node_tree:+ return []+ hits = set()+ def walk(nt):+ for n in nt.nodes:+ if n.type in ("OBJECT_INFO", "AMBIENT_OCCLUSION", "NEW_GEOMETRY", "BEVEL"):+ hits.add(n.type)+ if n.type == "TEX_COORD":+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+ return sorted(hits)+++def animated(m):+ ad = m.node_tree.animation_data if m and m.node_tree else None+ return bool(ad and (ad.drivers or ad.action))+++# ------------------------------------------------------------------ scene classification++def particle_instancers():+ srcs, emitters = set(), set()+ for o in sc.objects:+ for md in o.modifiers:+ if md.type == "PARTICLE_SYSTEM":+ st = md.particle_system.settings+ emitters.add(o.name)+ if st.render_type == "OBJECT" and st.instance_object:+ srcs.add(st.instance_object.name)+ if st.render_type == "COLLECTION" and st.instance_collection:+ srcs.update(x.name for x in st.instance_collection.all_objects)+ return srcs, emitters+++def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+ return "m_" + o.data.name+ return "o_" + o.name+++def tri_count(me):+ me.calc_loop_triangles()+ return len(me.loop_triangles)+++def render_uv(me):+ return next((l for l in me.uv_layers if l.active_render), None) or me.uv_layers.active+++def uv_ok(me):+ """True if the active render UV is a usable non-overlapping atlas inside 0..1 (generated-prop style)."""+ uvl = render_uv(me)+ if uvl is None or len(me.loop_triangles) == 0:+ return False+ n = len(me.loops)+ uv = np.empty(n * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ if uv.min() < -0.01 or uv.max() > 1.01:+ return False+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ total = float(a.sum())+ if total > 1.02 or total < 0.05:+ return False+ # Coarse overlap check: rasterise triangle centroids+vertices into a 512 grid weighted by area.+ g = 512+ idx = np.clip((t.mean(axis=1) * g).astype(np.int32), 0, g - 1)+ occ = np.zeros((g, g), np.float64)+ np.add.at(occ, (idx[:, 1], idx[:, 0]), a)+ return float(occ.max()) < 4.0 / (g * g) + 1e-4 or total < 0.9+++def surface_area(o, me):+ mw = o.matrix_world+ me.calc_loop_triangles()+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3)+ m3 = np.array(mw.to_3x3())+ co = co @ m3.T+ vt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ t = co[vt.reshape(-1, 3)]+ return float(0.5 * np.linalg.norm(np.cross(t[:, 1] - t[:, 0], t[:, 2] - t[:, 0]), axis=1).sum())+++def pow2(x, lo, hi):+ r = lo+ while r < x and r < hi:+ r *= 2+ return min(r, hi)+++# ------------------------------------------------------------------ baking++BAKE_SCENE = None+++def bake_scene():+ global BAKE_SCENE+ if BAKE_SCENE is None:+ bs = bpy.data.scenes.new("__bake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "GPU" if GPU else "CPU"+ bs.cycles.samples = 4+ bs.cycles.use_denoising = False+ bs.render.bake.margin = 8+ bs.render.bake.use_clear = True+ bs.render.bake.target = "IMAGE_TEXTURES"+ if THREADS:+ bs.render.threads_mode = "FIXED"+ bs.render.threads = THREADS+ bs.world = sc.world+ bs.frame_current = FRAME+ BAKE_SCENE = bs+ return BAKE_SCENE+++def run_bake(o, kind):+ bs = bake_scene()+ vl = bs.view_layers[0]+ with bpy.context.temp_override(scene=bs, view_layer=vl, object=o, active_object=o,+ selected_objects=[o], selected_editable_objects=[o]):+ if kind == "NORMAL":+ bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT", margin=8, use_clear=True)+ else:+ bpy.ops.object.bake(type="EMIT", margin=8, use_clear=True)+++def _src(sock):+ return sock.links[0].from_socket if sock.is_linked else None+++class Rewire:+ """Temporarily route one Principled channel into an Emission shader on the material output."""++ def __init__(self, m, channel, img):+ self.m, self.nt = m, m.node_tree+ self.added, self.saved = [], None+ nt = self.nt+ out = output_node(nt)+ p = find_principled(m)+ sh = surface_shader(m)+ em = nt.nodes.new("ShaderNodeEmission")+ self.added.append(em)+ em.inputs["Strength"].default_value = 1.0+ col = em.inputs["Color"]+ if channel == "base":+ if p is not None:+ s = p.inputs["Base Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ elif sh is not None and sh.type == "EMISSION":+ col.default_value = (0, 0, 0, 1)+ elif sh is not None and "Color" in sh.inputs:+ s = sh.inputs["Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+ # R=1 (no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+ else:+ cmb.inputs[i].default_value = p.inputs[k].default_value if p is not None else dv+ nt.links.new(cmb.outputs[0], col)+ elif channel == "emit":+ if sh is not None and sh.type == "EMISSION":+ for k in ("Color", "Strength"):+ s = sh.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[k])+ else:+ em.inputs[k].default_value = s.default_value+ elif p is not None:+ for k, ek in (("Emission Color", "Color"), ("Emission Strength", "Strength")):+ s = p.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[ek])+ else:+ em.inputs[ek].default_value = s.default_value+ else:+ col.default_value = (0, 0, 0, 1)+ if out is not None:+ self.saved = _src(out.inputs["Surface"])+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ self.out = out+ self.tex = nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.added.append(self.tex)+ nt.nodes.active = self.tex++ def restore(self):+ nt = self.nt+ if self.out is not None:+ for l in list(self.out.inputs["Surface"].links):+ nt.links.remove(l)+ if self.saved is not None:+ nt.links.new(self.saved, self.out.inputs["Surface"])+ for n in self.added:+ nt.nodes.remove(n)+++class TargetOnly:+ """For the normal bake: keep the material, just add the active target image node."""++ def __init__(self, m, img):+ self.nt = m.node_tree+ self.tex = self.nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.nt.nodes.active = self.tex++ def restore(self):+ self.nt.nodes.remove(self.tex)+++def new_img(name, res, colorspace, is_float=False):+ old = bpy.data.images.get(name)+ if old:+ bpy.data.images.remove(old)+ w, h = (res, res) if isinstance(res, int) else res+ img = bpy.data.images.new(name, w, h, alpha=False, float_buffer=is_float)+ img.colorspace_settings.name = colorspace+ return img+++def save_png(img, path):+ img.filepath_raw = path+ img.file_format = "PNG"+ img.save()+++def bake_channel(o, mats, channel, res, path):+ cs = {"base": "sRGB", "orm": "Non-Color", "emit": "Linear Rec.709", "normal": "Non-Color"}[channel]+ img = new_img("__bake_" + channel, res, cs, is_float=(channel == "emit"))+ rw = []+ try:+ seen = set()+ for m in mats:+ if m is None or m.name in seen or m.node_tree is None:+ continue+ seen.add(m.name)+ rw.append(TargetOnly(m, img) if channel == "normal" else Rewire(m, channel, img))+ run_bake(o, "NORMAL" if channel == "normal" else "EMIT")+ finally:+ for r in rw:+ r.restore()+ scale = 1.0+ if channel == "emit":+ w, h = (res, res) if isinstance(res, int) else res+ px = np.empty(w * h * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mx = float(np.percentile(px.max(axis=1), 99.95)) if px.size else 0.0+ scale = max(mx, 1e-6)+ out = bpy.data.images.new("__emit_png", w, h, alpha=False)+ out.colorspace_settings.name = "sRGB"+ q = np.ones((w * h, 4), np.float32)+ q[:, :3] = np.clip(px / scale, 0, 1)+ out.pixels.foreach_set(q.ravel())+ save_png(out, path)+ bpy.data.images.remove(out)+ else:+ save_png(img, path)+ bpy.data.images.remove(img)+ return scale+++def uv_stats(me, name):+ """UV coords of a layer and the fraction of the 0..1 square its triangles cover."""+ uvl = me.uv_layers[name]+ uv = np.empty(len(me.loops) * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ me.calc_loop_triangles()+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ return uv, float(a.sum())+++def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+ empty square one. Returns (uv name, kept, aspect w/h, uv coverage)."""+ me = me_owner.data+ if "bake" in me.uv_layers:+ me.uv_layers.active = me.uv_layers["bake"]+ return "bake", False, me_owner.get("_bake_aspect", 1.0), me_owner.get("_bake_cov", 0.5)+ me.calc_loop_triangles()+ if uv_ok(me):+ ar = render_uv(me)+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)+ uvl = me.uv_layers.new(name="bake")+ if ar is not None:+ ar.active_render = True # keep materials reading their original UVs+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ vl.objects.active = me_owner+ me_owner.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ bpy.ops.mesh.select_all(action="SELECT")+ bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=False)+ try:+ bpy.ops.uv.select_all(action="SELECT")+ bpy.ops.uv.pack_islands(rotate=True, margin=0.003, shape_method="AABB", scale=True)+ except Exception as ex: # noqa: BLE001+ log("pack_islands failed", me_owner.name, ex)+ bpy.ops.object.mode_set(mode="OBJECT")+ me_owner.select_set(False)+ uv, _ = uv_stats(me, "bake")+ lo, hi = uv.min(axis=0), uv.max(axis=0)+ span = np.maximum(hi - lo, 1e-6)+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+++def bake_size(area, cov, aspect, kept):+ """Texture W,H so texel density is ~DENSITY px/m over the real surface; power of two, clamped."""+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4 # big architecture: coarser texels+ px = d * d * area / cov+ lo = 1024 if kept else 32+ w = pow2(math.sqrt(px * aspect), lo, MAX_RES)+ h = pow2(math.sqrt(px / aspect), lo, MAX_RES)+ if kept:+ w = h = min(max(w, h), 2048) # generated props: their own atlas, 1-2K+ return w, h+++# ------------------------------------------------------------------ export++def to_mesh_object(o):+ """Text/curve objects -> real mesh objects (evaluated) in a scratch collection; originals hidden."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ n = bpy.data.objects.new(o.name + "__mesh", me)+ c = bpy.data.collections.get("__converted") or bpy.data.collections.new("__converted")+ if c.name not in sc.collection.children:+ sc.collection.children.link(c)+ c.objects.link(n)+ n.matrix_world = o.matrix_world.copy()+ for k in ("visible_shadow", "visible_camera", "visible_glossy", "visible_diffuse"):+ setattr(n, k, getattr(o, k))+ o.hide_render = True+ return n+++def export_glb(o, uv_name, glass_slots, path):+ """Evaluated mesh at identity with only the bake UV; slots: 0 = baked, 1+ = each glass material."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ for l in [l for l in me.uv_layers if l.name != uv_name]:+ me.uv_layers.remove(l)+ if len(me.uv_layers):+ me.uv_layers[0].name = "UVMap"+ gl = list(glass_slots)+ mi = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("material_index", mi)+ remap = np.zeros(max(len(o.material_slots), 1), np.int32)+ for i in range(len(o.material_slots)):+ remap[i] = gl.index(i) + 1 if i in gl else 0+ mi = remap[np.clip(mi, 0, len(remap) - 1)]+ me.polygons.foreach_set("material_index", mi)+ me.materials.clear()+ base = bpy.data.materials.get("BAKED") or bpy.data.materials.new("BAKED")+ me.materials.append(base)+ for k, gi in enumerate(gl):+ gm = bpy.data.materials.get(f"GLASS_{k}") or bpy.data.materials.new(f"GLASS_{k}")+ me.materials.append(gm)+ tmp = bpy.data.objects.new("__export", me)+ sc.collection.objects.link(tmp)+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ tmp.select_set(True)+ vl.objects.active = tmp+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_apply=True,+ export_materials="PLACEHOLDER", export_texcoords=True, export_normals=True,+ export_tangents=True, export_yup=True, export_animations=False,+ export_cameras=False, export_lights=False, export_extras=False)+ bpy.data.objects.remove(tmp)+ bpy.data.meshes.remove(me)+++# ------------------------------------------------------------------ volumes++def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+ m = next((m for m in o.data.materials if m and is_volume_only(m)), None)+ if m is None:+ return None+ pv = next((nd for nd in m.node_tree.nodes if nd.type == "PRINCIPLED_VOLUME"), None)+ if pv is None:+ return None+ me0 = o.data+ xs = [v.co.x for v in me0.vertices]+ ys = [v.co.y for v in me0.vertices]+ zs = [v.co.z for v in me0.vertices]+ lo, hi = Vector((min(xs), min(ys), min(zs))), Vector((max(xs), max(ys), max(zs)))+ res = {"levels": [], "density": [], "emission": [], "emission_color": None}+ for f in levels:+ z = lo.z + f * (hi.z - lo.z)+ me = bpy.data.meshes.new("__slice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__slice", me)+ sc.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ out = output_node(nt)+ for l in list(out.inputs["Volume"].links):+ nt.links.remove(l)+ vals = {}+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ em = nt.nodes.new("ShaderNodeEmission")+ s = pvc.inputs[sock]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ img = new_img("__vol", n, "Non-Color", is_float=True)+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ bs = bake_scene()+ bs.collection.objects.link(sl)+ try:+ run_bake(sl, "EMIT")+ finally:+ bs.collection.objects.unlink(sl)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ vals[key] = float(px.reshape(-1, 4)[:, 0].mean())+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ res["levels"].append(f)+ res["density"].append(vals["density"])+ res["emission"].append(vals["emission"])+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ c = pv.inputs["Color"].default_value+ res["albedo"] = [c[0], c[1], c[2]]+ res["anisotropy"] = pv.inputs["Anisotropy"].default_value+ ec = pv.inputs["Emission Color"]+ if ec.is_linked:+ # Sample the colour ramp if it is one (flame): mid-height colour as a representative.+ n0 = ec.links[0].from_node+ if n0.type == "VALTORGB":+ res["emission_color"] = list(n0.color_ramp.evaluate(0.6))[:3]+ else:+ res["emission_color"] = list(ec.default_value)[:3]+ mw = o.matrix_world+ corners = [mw @ Vector((x, y, z)) for x in (lo.x, hi.x) for y in (lo.y, hi.y) for z in (lo.z, hi.z)]+ wlo = Vector([min(c[i] for c in corners) for i in range(3)])+ whi = Vector([max(c[i] for c in corners) for i in range(3)])+ res["bounds_ue"] = {"center": ue_vec((wlo + whi) / 2), "extent": [(whi.x - wlo.x) * 50, (whi.y - wlo.y) * 50, (whi.z - wlo.z) * 50]}+ res["bounds_m"] = {"lo": list(wlo), "hi": list(whi)}+ res["material"] = m.name+ res["animated"] = animated(m)+ return res+++# ------------------------------------------------------------------ lights / cameras / world / grade++def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+ mx = max(col) or 1.0+ P = L.energy+ e = {"name": o.name, "type": L.type, "color": [c / mx for c in col], "energy_w": P,+ "cast_shadows": bool(getattr(L, "use_shadow", True)),+ "specular": 1.0 if getattr(o, "visible_glossy", True) else 0.0,+ "diffuse": 1.0 if getattr(o, "visible_diffuse", True) else 0.0,+ "volume": 1.0 if getattr(o, "visible_volume_scatter", True) else 0.0,+ "loc": ue_vec(o.matrix_world.translation), "animated": bool(L.animation_data and (L.animation_data.drivers or L.animation_data.action))}+ f, u = ue_axes(o.matrix_world)+ e["forward"], e["up"] = f, u+ k = mx # colour normalisation folds into intensity+ if L.type in ("POINT", "SPOT"):+ e["candela"] = LM_PER_W * P * k / (4 * math.pi)+ e["source_radius"] = L.shadow_soft_size * 100+ e["soft_falloff"] = bool(getattr(L, "use_soft_falloff", True))+ if L.type == "SPOT":+ outer = math.degrees(L.spot_size) / 2+ e["outer_cone"] = min(outer, 80.0)+ e["inner_cone"] = outer * (1 - L.spot_blend)+ if outer > 80:+ e["note"] = f"spot cone {outer * 2:.0f} deg > Unreal max 160: clamped"+ elif L.type == "AREA":+ e["candela"] = LM_PER_W * P * k / math.pi+ e["shape"] = L.shape+ sx = L.size+ sy = L.size_y if L.shape in ("RECTANGLE", "ELLIPSE") else L.size+ sxx, syy, _ = o.matrix_world.to_scale()+ e["width"], e["height"] = sx * sxx * 100, sy * syy * 100+ e["spread_deg"] = math.degrees(getattr(L, "spread", math.pi))+ elif L.type == "SUN":+ e["lux"] = LM_PER_W * P * k+ e["angle_deg"] = math.degrees(L.angle)+ # IES / gobo: node-based light textures.+ if L.use_nodes and L.node_tree:+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+++def camera_entry(o):+ c = o.data+ f, u = ue_axes(o.matrix_world)+ rx, ry = sc.render.resolution_x, sc.render.resolution_y+ sw = c.sensor_width if c.sensor_fit in ("AUTO", "HORIZONTAL") else c.sensor_height * rx / ry+ d = {"name": o.name, "type": c.type, "lens_mm": c.lens, "sensor_width_mm": sw, "sensor_height_mm": sw * ry / rx,+ "sensor_fit": c.sensor_fit, "shift": [c.shift_x, c.shift_y], "clip": [c.clip_start * 100, c.clip_end * 100],+ "loc": ue_vec(o.matrix_world.translation), "forward": f, "up": u,+ "dof": {"enabled": c.dof.use_dof, "focus_cm": c.dof.focus_distance * 100, "fstop": c.dof.aperture_fstop,+ "blades": c.dof.aperture_blades, "focus_object": c.dof.focus_object.name if c.dof.focus_object else None}}+ if o.name in DOF:+ fd, fs = DOF[o.name]+ d["dof"].update(enabled=True, focus_cm=fd * 100, fstop=fs, source="--dof override (stills script)")+ return d+++def world_bake(path, w=2048, h=1024, spp=32):+ ws = bpy.data.scenes.new("__world")+ ws.world = sc.world+ ws.render.engine = "CYCLES"+ ws.cycles.device = "CPU"+ ws.cycles.samples = spp+ ws.render.resolution_x, ws.render.resolution_y, ws.render.resolution_percentage = w, h, 100+ ws.view_settings.view_transform = "Standard"+ ws.render.image_settings.file_format = "OPEN_EXR"+ ws.render.image_settings.color_depth = "16"+ cd = bpy.data.cameras.new("__pano")+ cd.type = "PANO"+ try:+ cd.panorama_type = "EQUIRECTANGULAR"+ except Exception:+ cd.cycles.panorama_type = "EQUIRECTANGULAR"+ co = bpy.data.objects.new("__pano", cd)+ ws.collection.objects.link(co)+ co.rotation_euler = (math.radians(90), 0, math.radians(-90)) # looking +X? (equirect centre = -Y in Blender -> fixed below)+ co.rotation_euler = (math.radians(90), 0, 0)+ ws.camera = co+ ws.render.filepath = path+ with bpy.context.temp_override(scene=ws):+ bpy.ops.render.render(write_still=True, scene=ws.name)+ # mean radiance for the sky light estimate+ img = bpy.data.images.load(path)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mean = px.mean(axis=0).tolist()+ bpy.data.images.remove(img)+ return {"equirect_exr": path, "mean_radiance": mean, "camera_note": "equirect centre looks along Blender +Y"}+++def compositor_nodes():+ # 5.0: compositing_node_group; Scene.node_tree is gone (use_nodes can still read True with no tree).+ tree = getattr(sc, "compositing_node_group", None) or getattr(sc, "node_tree", None)+ if tree is None:+ return []+ out = []+ for n in tree.nodes:+ d = {"type": n.bl_idname, "name": n.name, "inputs": {}}+ for i in n.inputs:+ if i.is_linked or not hasattr(i, "default_value"):+ continue+ v = i.default_value+ try:+ v = v if isinstance(v, str) else list(v)+ except TypeError:+ pass+ if isinstance(v, (int, float, str, list, bool)):+ d["inputs"][i.name] = v+ for k in ("glare_type", "quality", "blend_type"):+ if hasattr(n, k):+ d[k] = getattr(n, k)+ out.append(d)+ return out+++def ffmpeg_grade(grade_sh):+ """Pull GRADE="..." out of a scene's grade.sh; split into colour (LUT-able) and spatial filters."""+ txt = open(grade_sh, encoding="utf-8").read()+ m = re.search(r'GRADE="([^"]+)"', txt)+ if not m:+ return None+ filters = [f for f in m.group(1).split(",") if f]+ colour = [f for f in filters if f.split("=")[0] in ("curves", "hue", "eq", "colorbalance", "colorchannelmixer", "lutrgb", "colortemperature")]+ spatial = [f for f in filters if f not in colour]+ g = {"source": grade_sh, "filter": m.group(1), "colour": colour, "spatial": spatial}+ for f in spatial:+ if f.startswith("vignette"):+ a = re.search(r"angle=PI/([\d.]+)", f)+ g["vignette_angle_rad"] = math.pi / float(a.group(1)) if a else math.pi / 5+ if f.startswith("rgbashift"):+ g["chromatic_px"] = 1+ noise = re.search(r"noise=alls=(\d+)", txt)+ if noise:+ g["grain_strength"] = int(noise.group(1))+ return g+++def make_lut(colour_filters, path):+ """UE colour grading LUT (256x16, 16 slices of 16x16; R across a slice, G down, B by slice), with the ffmpeg+ colour filters applied. Unreal applies it after the tone curve, i.e. in display space, like ffmpeg on the PNG."""+ n = 16+ ident = os.path.join(os.path.dirname(path), "lut_identity.png")+ img = bpy.data.images.new("__lut", n * n, n, alpha=False)+ img.colorspace_settings.name = "Non-Color"+ px = np.zeros((n, n * n, 4), np.float32)+ for b in range(n):+ for g in range(n):+ for r in range(n):+ px[g, b * n + r] = (r / (n - 1), g / (n - 1), b / (n - 1), 1)+ # Blender rows go bottom-up; UE LUT row 0 (top) is G=0.+ img.pixels.foreach_set(px[::-1].ravel())+ save_png(img, ident)+ bpy.data.images.remove(img)+ if not colour_filters:+ return ident+ cmd = [FFMPEG, "-v", "error", "-y", "-i", ident, "-vf", ",".join(colour_filters), "-frames:v", "1", path]+ try:+ r = subprocess.run(cmd, capture_output=True, text=True)+ except OSError as ex:+ log("LUT ffmpeg not runnable (pass --ffmpeg or set FFMPEG):", FFMPEG, ex)+ return ident+ if r.returncode != 0:+ log("LUT ffmpeg failed:", r.stderr[:300])+ return ident+ return path+++# ------------------------------------------------------------------ main++def main():+ t0 = time.time()+ srcs, emitters = particle_instancers()+ report = {"skipped": [], "converted": [], "volumes": {}, "fx": [], "warnings": []}+ objs = []+ for o in list(sc.objects):+ if o.hide_render or not o.visible_get():+ if o.type in ("MESH", "FONT", "CURVE") and not o.hide_render:+ pass+ if o.hide_render:+ continue+ if o.name in srcs:+ report["skipped"].append([o.name, "particle instance source (exported as fx note)"])+ continue+ if o.name in emitters:+ st = [md.particle_system.settings for md in o.modifiers if md.type == "PARTICLE_SYSTEM"]+ report["fx"].append({"name": o.name, "kind": "particles", "count": sum(s.count for s in st),+ "instance": [s.instance_object.name if s.instance_object else None for s in st],+ "lifetime": [s.lifetime for s in st], "velocity": [list(s.object_align_factor) for s in st]})+ if not o.show_instancer_for_render:+ continue+ if o.type in ("FONT", "CURVE", "SURFACE", "META"):+ if o.type == "CURVE" and o.data.bevel_depth == 0 and not o.data.bevel_object and o.data.extrude == 0:+ report["skipped"].append([o.name, "curve without geometry"])+ continue+ n = to_mesh_object(o)+ report["converted"].append([o.name, o.type])+ objs.append(n)+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+ log("volume", o.name, [round(x, 4) for x in v["density"]], [round(x, 2) for x in v["emission"]])+ continue+ objs.append(o)+ # Group by unique mesh.+ assets = {}+ for o in objs:+ k = mesh_key(o)+ assets.setdefault(k, []).append(o)+ keys = sorted(assets, key=lambda k: assets[k][0].name, reverse=REVERSE)+ if ONLY:+ keys = [k for k in keys if any(o.name in ONLY or o.name.split("__")[0] in ONLY for o in assets[k])]+ if LIMIT:+ keys = keys[:LIMIT]+ log(f"{len(objs)} mesh objects -> {len(assets)} unique meshes; exporting {len(keys)}")+ entries, placements = [], []+ for ai, k in enumerate(keys):+ group = assets[k]+ rep = group[0]+ an = safe(rep.data.name if k.startswith("m_") else rep.name)+ an = f"{an}_{ai:03d}" if any(e["asset"] == an for e in entries) else an+ mats = [s.material for s in rep.material_slots]+ glass = [i for i, m in enumerate(mats) if m and is_glass(m)]+ bake_mats = [m for i, m in enumerate(mats) if i not in glass]+ dg = bpy.context.evaluated_depsgraph_get()+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+ meta = glb[:-4] + ".json"+ done = os.path.exists(glb) # written after every bake of the asset succeeded+ if done:+ # Resume: skip the UV unwrap (an edit-mode smart_project per asset). Blender 5.0.1's bake crashes+ # (OpenImageIO ustring::operator= in ccl::create_mesh) after a few hundred unwrap+bake cycles in one+ # process; re-unwrapping every finished asset on resume made it crash at the same asset every time.+ m0 = json.load(open(meta)) if os.path.exists(meta) else {}+ uv_name, kept, cov, res = None, m0.get("uv") == "kept", m0.get("uv_coverage", 0.0), m0.get("res", [0, 0])+ else:+ uv_name, kept, aspect, cov = ensure_bake_uv(rep, rep)+ res = bake_size(area, cov, aspect, kept)+ e = {"asset": an, "key": k, "tris": tris, "area_m2": round(area, 3), "uv": "kept" if kept else "smart_project",+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera)}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+ bake_scene().collection.objects.link(rep)+ try:+ bake_channel(rep, bake_mats, "base", res, p["base"])+ bake_channel(rep, bake_mats, "orm", res, p["orm"])+ if any(m and perturbs_normal(m) for m in bake_mats):+ bake_channel(rep, bake_mats, "normal", res, p["normal"])+ if any(m and emissive(m) for m in bake_mats):+ s = bake_channel(rep, bake_mats, "emit", res, p["emit"])+ json.dump({"scale": s}, open(p["emit"] + ".json", "w"))+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+ e["tex"] = {c: os.path.relpath(v, OUT) for c, v in p.items() if os.path.exists(v)}+ if not os.path.exists(glb):+ export_glb(rep, uv_name, glass, glb)+ if not done:+ json.dump({"res": list(res), "uv": e["uv"], "uv_coverage": e["uv_coverage"]}, open(meta, "w"))+ e["glb"] = os.path.relpath(glb, OUT)+ # Local bounds in Unreal axes for the importer orientation check.+ bb = [Vector(c) for c in rep.bound_box]+ e["check_bounds"] = {"min": ue_vec(Vector([min(c[i] for c in bb) for i in range(3)])),+ "max": ue_vec(Vector([max(c[i] for c in bb) for i in range(3)]))}+ e["bake_s"] = round(time.time() - t1, 1)+ entries.append(e)+ for o in group:+ placements.append({"name": o.name, "asset": an, **ue_xform(o.matrix_world),+ "shadow": bool(o.visible_shadow), "camera_visible": bool(o.visible_camera)})+ log(f"[{ai + 1}/{len(keys)}] {an} tris={tris} res={res} uv={e['uv']} inst={len(group)} {e['bake_s']}s")+ # Lights, cameras, world, grade.+ lights = [light_entry(o) for o in sc.objects if o.type == "LIGHT" and not o.hide_render]+ cams = [camera_entry(o) for o in sc.objects if o.type == "CAMERA"]+ world = None+ wpath = os.path.join(OUT, "world", "sky.exr")+ if sc.world:+ world = world_bake(wpath) if not os.path.exists(wpath) or "--rebake-world" in argv else {"equirect_exr": wpath}+ if "mean_radiance" not in world:+ img = bpy.data.images.load(wpath)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ world["mean_radiance"] = px.reshape(-1, 4)[:, :3].mean(axis=0).tolist()+ bpy.data.images.remove(img)+ world["equirect_exr"] = os.path.relpath(wpath, OUT)+ world["nits_scale"] = LM_PER_W+ vs = sc.view_settings+ grade = {"view_transform": vs.view_transform, "look": vs.look, "exposure": vs.exposure, "gamma": vs.gamma,+ "use_curve_mapping": vs.use_curve_mapping,+ "ev100": math.log2(LM_PER_W / 1.2) - vs.exposure,+ "compositor": compositor_nodes(),+ "motion_blur": {"on": sc.render.use_motion_blur, "shutter": sc.render.motion_blur_shutter},+ "resolution": [sc.render.resolution_x, sc.render.resolution_y], "fps": sc.render.fps}+ if vs.use_curve_mapping:+ grade["curves"] = [[(p.location[0], p.location[1]) for p in c.points] for c in vs.curve_mapping.curves]+ if GRADE_SH and os.path.exists(GRADE_SH):+ g = ffmpeg_grade(GRADE_SH)+ if g:+ g["lut"] = os.path.relpath(make_lut(g["colour"], os.path.join(OUT, "grade", "lut_grade.png")), OUT)+ grade["ffmpeg"] = g+ scene = {"source": SRC, "frame": FRAME, "units": "unreal cm, X fwd, Y right, Z up", "lm_per_w": LM_PER_W,+ "assets": entries, "placements": placements, "lights": lights, "cameras": cams, "world": world,+ "volumes": report["volumes"], "fx": report["fx"], "grade": grade,+ "skipped": report["skipped"], "converted": report["converted"], "export_s": round(time.time() - t0)}+ jp = os.path.join(OUT, "scene.json")+ if os.path.exists(jp) and (ONLY or LIMIT):+ old = json.load(open(jp, encoding="utf-8"))+ have = {e["asset"] for e in entries}+ scene["assets"] = [e for e in old.get("assets", []) if e["asset"] not in have] + entries+ scene["placements"] = [p for p in old.get("placements", []) if p["asset"] not in have] + placements+ json.dump(scene, open(jp, "w", encoding="utf-8"), indent=1)+ log(f"wrote {jp}: {len(scene['assets'])} assets, {len(scene['placements'])} placements, {len(lights)} lights, "+ f"{len(cams)} cameras, {len(report['volumes'])} volumes in {time.time() - t0:.0f}s")+++main()diff --git a/unreal_bakery/_orig/make_copy.py b/unreal_bakery/_orig/make_copy.pynew file mode 100644index 0000000..0a0063e--- /dev/null+++ b/unreal_bakery/_orig/make_copy.py@@ -0,0 +1,12 @@+"""Make a working copy of a scene .blend with all external paths absolute (a plain file copy breaks the scene's+//../../refs/... texture paths as soon as it lives in another folder). The source file is only read.+ blender -b scenes/<id>/<scene>.blend --python unreal/make_copy.py -- <out.blend>+"""+import sys+import bpy++out = sys.argv[sys.argv.index("--") + 1]+assert bpy.path.abspath(out) != bpy.data.filepath, "refusing to overwrite the source .blend"+bpy.ops.file.make_paths_absolute()+bpy.ops.wm.save_as_mainfile(filepath=out, copy=True, relative_remap=False, compress=False)+print("COPY", bpy.data.filepath, "->", out, flush=True)diff --git a/unreal_bakery/_orig/perf.ps1 b/unreal_bakery/_orig/perf.ps1new file mode 100644index 0000000..a601daf--- /dev/null+++ b/unreal_bakery/_orig/perf.ps1@@ -0,0 +1,40 @@+# Standalone (-game) real-time performance run of a built AnyScene level, with no window (-RenderOffscreen).+# Captures N frames with the CSV profiler (frame/game/render/GPU times) from the PlayerStart (hero camera), and samples+# total GPU memory with nvidia-smi before and during the run.+# powershell -File perf.ps1 [-Map /Game/AnyScene/HK/L_HK] [-ResX 2560] [-ResY 1440] [-Frames 900] [-Extra "r.Lumen.HardwareRayTracing 0"]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Map = "/Game/AnyScene/HK/L_HK",+ [int]$ResX = 2560, [int]$ResY = 1440, [int]$Frames = 900, [int]$TimeoutS = 600,+ [string]$Tag = "perf", [string]$Extra = ""+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor.exe"+$saved = Join-Path (Split-Path $Project) "Saved"+$csvDir = Join-Path $saved "Profiling\CSV"+$before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+$mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+# The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+$cmds = "r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+if ($Extra) { $cmds = "$Extra,$cmds" }+$args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+ "-dpcvars=Editor.AsyncAssetCompilation=0") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+$proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+$peak = $mem0+$sw = [Diagnostics.Stopwatch]::StartNew()+$csv = $null+while (-not $proc.HasExited -and $sw.Elapsed.TotalSeconds -lt $TimeoutS) {+ Start-Sleep -Seconds 2+ $m = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ if ($m -gt $peak) { $peak = $m }+ $new = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | Where-Object { $before -notcontains $_.FullName }+ if ($new) {+ $f = $new | Sort-Object LastWriteTime | Select-Object -Last 1+ # The CSV is written when the capture ends; wait until the file stops growing.+ $s1 = $f.Length; Start-Sleep -Seconds 3; $s2 = (Get-Item $f.FullName).Length+ if ($s1 -eq $s2 -and $s2 -gt 0) { $csv = $f.FullName; break }+ }+}+if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force }+"gpu_mem_before_mb=$mem0 gpu_mem_peak_mb=$peak delta_mb=$($peak - $mem0)"+"csv=$csv"diff --git a/unreal_bakery/_orig/render_mrq.ps1 b/unreal_bakery/_orig/render_mrq.ps1new file mode 100644index 0000000..841229a--- /dev/null+++ b/unreal_bakery/_orig/render_mrq.ps1@@ -0,0 +1,17 @@+# Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+# UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+# powershell -File render_mrq.ps1 [-Cams cam_street,cam_table,cam_wok] [-Config MRQ_Still|MRQ_Linear]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Dest = "/Game/AnyScene/HK", [string]$Level = "L_HK",+ [string]$Cams = "cam_street,cam_table,cam_wok", [string]$Config = "MRQ_Still"+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"+foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+ "-dpcvars=Editor.AsyncAssetCompilation=0" | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+}diff --git a/unreal_bakery/_orig/render_shots.py b/unreal_bakery/_orig/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal_bakery/_orig/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_bakery/_orig/side_by_side.py b/unreal_bakery/_orig/side_by_side.pynew file mode 100644index 0000000..e55eddd--- /dev/null+++ b/unreal_bakery/_orig/side_by_side.py@@ -0,0 +1,47 @@+"""Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.+"""+import os+import sys++from PIL import Image, ImageDraw, ImageFont++cyc, ue, out = sys.argv[1:4]+cams = (sys.argv[4] if len(sys.argv) > 4 else "street,table,wok").split(",")+os.makedirs(out, exist_ok=True)+H = 804+LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")+try:+ font = ImageFont.truetype("arial.ttf", 28)+except OSError:+ font = ImageFont.load_default()+++def fit(p):+ im = Image.open(p).convert("RGB")+ return im.resize((round(im.width * H / im.height), H), Image.LANCZOS)+++rows = []+for c in cams:+ a = fit(os.path.join(cyc, f"{c}_graded.png"))+ up = os.path.join(ue, f"cam_{c}.png")+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+ for x, t in ((12, f"Cycles graded {c}"), (a.width + 20, f"{LABEL} {c}")):+ d.rectangle([x - 6, 8, x + 360, 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)+ print("wrote", os.path.join(out, f"{c}.png"))+w = max(r.width for r in rows)+allim = Image.new("RGB", (w, sum(r.height for r in rows) + 8 * (len(rows) - 1)), (255, 255, 255))+y = 0+for r in rows:+ allim.paste(r, (0, y))+ y += r.height + 8+allim.resize((allim.width // 2, allim.height // 2), Image.LANCZOS).save(os.path.join(out, "all.png"))diff --git a/unreal_bakery/agx_view.py b/unreal_bakery/agx_view.pynew file mode 100644index 0000000..870bf9e--- /dev/null+++ b/unreal_bakery/agx_view.py@@ -0,0 +1,19 @@+"""Apply a Blender view transform (default AgX + the scene's look) to Unreal scene-linear EXRs (MRQ_Linear output),+so UE and Cycles frames can be compared through the same tone mapper.+ blender -b --factory-startup --python agx_view.py -- <in.exr> <out.png> [look] [exposure]+"""+import sys+import bpy++a = sys.argv[sys.argv.index("--") + 1:]+src, dst = a[0], a[1]+look = a[2] if len(a) > 2 else "AgX - Medium High Contrast"+expo = float(a[3]) if len(a) > 3 else 0.0+sc = bpy.context.scene+sc.view_settings.view_transform = "AgX"+sc.view_settings.look = look+sc.view_settings.exposure = expo+sc.render.image_settings.file_format = "PNG"+img = bpy.data.images.load(src)+img.save_render(dst, scene=sc)+print("AGX", src, "->", dst, flush=True)diff --git a/unreal_bakery/build_level.py b/unreal_bakery/build_level.pynew file mode 100644index 0000000..e9e8105--- /dev/null+++ b/unreal_bakery/build_level.py@@ -0,0 +1,688 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,sequences (default: all)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % 16 == 15 or i == len(todo) - 1:+ flush(a)+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked():+ path = f"{DEST}/Materials/M_AnyBaked"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyBaked", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_glass():+ path = f"{DEST}/Materials/M_AnyGlass"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGlass", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ c = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, -500, 0)+ c.set_editor_property("parameter_name", "Color")+ c.set_editor_property("default_value", unreal.LinearColor(1, 1, 1, 1))+ r = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 200)+ r.set_editor_property("parameter_name", "Roughness")+ r.set_editor_property("default_value", 0.05)+ o = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 350)+ o.set_editor_property("parameter_name", "Opacity")+ o.set_editor_property("default_value", 0.25)+ MEL.connect_material_property(c, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], baked)+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ # M_AnyGlass is diffuse-lit translucency: a white base colour turns every sunlit pane into a milky veil.+ # Cycles clear glass has no diffuse term, so clear panes get a near-black base (reflections come from+ # specular); rough/frosted glass keeps more of its colour.+ k_d = min(1.0, 0.03 + 3.0 * g["roughness"])+ c = [x * k_d for x in g["color"]]+ MEL.set_material_instance_vector_parameter_value(gm, "Color", unreal.LinearColor(c[0], c[1], c[2], 1))+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ # Clear glass at the master's 0.25 opacity veils whatever is behind it (two vitrine panes ~44% white);+ # scale with roughness so clear panes stay near-invisible and frosted ones keep some body.+ MEL.set_material_instance_scalar_parameter_value(gm, "Opacity", min(0.25, 0.06 + 0.6 * g["roughness"]))+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ if len(a.get("glass", [])) >= len(a.get("slots", [])) > 0:+ # Glass-only mesh: the GLB's unused BAKED slot 0 is dropped on export, so its only sections are glass.+ mats = mats[1:]+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if C.get("exposure"): # per-camera exposure offset on top of the grade's manual exposure+ pp = cc.get_editor_property("post_process_settings")+ pp.set_editor_property("override_auto_exposure_bias", True)+ pp.set_editor_property("auto_exposure_bias", scene["grade"]["exposure"] + C["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF)+ cc.set_editor_property("post_process_settings", pp)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0]:+ continue+ b = v["bounds_ue"]+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(b["center"]), unreal.Rotator(0, 0, 0))+ lf.set_actor_label("LFV_" + name)+ lf.set_folder_path("Volumes")+ # Local fog volumes are unit spheres of radius 100 cm at scale 1 (assumed); scale to the box.+ lf.set_actor_scale3d(unreal.Vector(b["extent"][0] / 100, b["extent"][1] / 100, b["extent"][2] / 100))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"])+ emit = max(v["emission"])+ lc.set_editor_property("radial_fog_extinction", dens)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ lc.set_editor_property("radial_fog_extinction", 1.0)+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * emit, ec[1] * emit, ec[2] * emit, 1))+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", min(1.0, ff["vignette_angle_rad"] / (math.pi / 4) * 0.45))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+ # Hero = ANYSCENE_HERO, else the .blend's active camera (scene.json "active_camera"), else cam_street, else the first.+ want = [os.environ.get("ANYSCENE_HERO"), scene.get("active_camera"), "cam_street"]+ hero = next((c for w in want if w for c in scene["cameras"] if c["name"] == w), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(48)+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, 48)+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ EAL.save_loaded_asset(seq, False)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = scene["grade"].get("resolution", [1920, 804])+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.path.join(EXPORT, "..", "compare", "mrq").replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = True+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = 64+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal_bakery/csv_summary.sh b/unreal_bakery/csv_summary.shnew file mode 100644index 0000000..1a3f187--- /dev/null+++ b/unreal_bakery/csv_summary.sh@@ -0,0 +1,16 @@+#!/usr/bin/env bash+# Summarise an Unreal CSV profile: mean / p50 / p95 of frame, game, render, RHI and GPU time plus the top GPU passes.+# bash csv_summary.sh <Profile(...).csv> [skip_first_frames=60]+f="$1"; skip="${2:-60}"+awk -F, -v skip="$skip" '+NR==1 { for (i=1;i<=NF;i++) col[$i]=i; next }+$1 ~ /^\[/ || NF < 10 { next }+{ n++; if (n<=skip) next; m+++ for (k in col) if (k=="FrameTime"||k=="GameThreadTime"||k=="RenderThreadTime"||k=="RHIThreadTime"||k=="GPUTime"||k ~ /^GPU\//) { v=$(col[k])+0; s[k]+=v; a[k,m]=v } }+END {+ printf "frames=%d (after skipping %d)\n", m, skip+ split("FrameTime GameThreadTime RenderThreadTime RHIThreadTime GPUTime", ks, " ")+ for (j=1;j<=5;j++) { k=ks[j]; c=0; for (i=1;i<=m;i++) t[++c]=a[k,i]; asort(t); printf "%-17s mean %6.2f ms p50 %6.2f p95 %6.2f\n", k, s[k]/m, t[int(c*0.5)], t[int(c*0.95)]; delete t }+ printf "fps(mean frame) %.1f\n", 1000/(s["FrameTime"]/m)+ for (k in s) if (k ~ /^GPU\//) printf "%8.3f %s\n", s[k]/m, k | "sort -rn | head -12"+}' "$f"diff --git a/unreal_bakery/export.sh b/unreal_bakery/export.shnew file mode 100644index 0000000..92e1f3f--- /dev/null+++ b/unreal_bakery/export.sh@@ -0,0 +1,23 @@+#!/usr/bin/env bash+# export_blend.py through the GPU queue, resumed until it finishes. Blender 5.0.1 Cycles bake crashes intermittently+# (EXCEPTION_ACCESS_VIOLATION in OpenImageIO ustring::operator= under ccl::create_mesh, ~1 per 250 bakes, a different+# asset each time); the exporter skips assets whose GLB/texture already exist, so a rerun resumes where it died.+# bash unreal/export.sh <copy.blend> <out_dir> [export_blend.py args...] (log: <out_dir>/export.log)+# EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py"+A="$(cd "$(dirname "$0")/.." && pwd)"+. "$A/pipeline/env.sh"+blend="$1"; out="$2"; shift 2+mkdir -p "$out"+: > "$out/export.log"+pre=()+[ -n "$EXPORT_PRE" ] && pre=(--python "$EXPORT_PRE")+for i in $(seq 1 "${EXPORT_TRIES:-6}"); do+ bash "$A/pipeline/gpu_run.sh" "$BLENDER" -b "$blend" "${pre[@]}" --python "$A/unreal/export_blend.py" -- --out "$out" "$@" \+ >> "$out/export.log" 2>&1+ rc=$?+ if grep -q "^EXPORT wrote" "$out/export.log"; then echo "export: done after $i run(s)"; exit 0; fi+ # rc 0 without "wrote" is a Python exception (Blender exits 0 on those): retrying will not help.+ [ "$rc" = 0 ] && { echo "export: python error, see $out/export.log"; exit 1; }+ echo "export: run $i exited rc=$rc without finishing; resuming" | tee -a "$out/export.log"+done+echo "export: gave up after ${EXPORT_TRIES:-6} runs"; exit 1diff --git a/unreal_bakery/export_blend.py b/unreal_bakery/export_blend.pynew file mode 100644index 0000000..afb8c1c--- /dev/null+++ b/unreal_bakery/export_blend.py@@ -0,0 +1,1025 @@+"""AnyScene -> Unreal export: bake every surface material to PBR textures, export one GLB per unique mesh, and write+scene.json (placements, lights, cameras, world, volumes, grade) in Unreal units and axes.++ blender -b <COPY of scene.blend> --python export_blend.py -- --out <dir> [--frame 60] [--only a,b] [--limit N]+ [--density 1024] [--max-res 4096] [--grade-sh scenes/<id>/scripts/grade.sh] [--ffmpeg path]+ [--dof '{"cam_street": [9.5, 2.8]}'] [--no-bake] [--cpu-threads 0]++Never saves the .blend (it modifies the open file in memory: new UV layers, converted text/curves). Rerunnable:+textures and GLBs that already exist are skipped (delete <out>/tex/<asset>_* or <out>/mesh/<asset>.glb to redo one).++Conventions written to scene.json+ * Space: Unreal (cm, X forward, Y right, Z up, left-handed). Blender (x, y, z) m -> Unreal (x, -y, z) * 100.+ Object transforms are S*M*S with S = diag(1,-1,1), given as location, quaternion (x,y,z,w) and scale.+ * Mesh GLBs are exported in object-local space at identity; the Unreal importer maps glTF to its own axes, so+ build_level.py checks the result against "check_bounds" for the first assets.+ * Photometry: 683 lm/W. Point/spot cd = 683 * P / (4 pi); area cd = 683 * P / pi; sun lux = 683 * S;+ emissive nits = 683 * strength; sky radiance x 683. Exposure: Blender pixel = L_b * 2^exposure, so the Unreal+ manual exposure is EV100 = log2(683 / 1.2) - exposure (written as grade.ev100).+ * Bake: every surface material (procedural or not) is baked per unique mesh into one texture set on a bake UV:+ BaseColor (sRGB png), ORM (R=1, G=roughness, B=metallic, linear png), Normal (tangent, OpenGL +Y, png, only if a+ material perturbs the normal), Emissive (sRGB png + scale, only if emissive). Glass slots (transmission > 0.5)+ are not baked: they keep their own material slot and parameters.+"""+import bmesh # noqa: F401 (kept for hand edits)+import json+import math+import os+import re+import subprocess+import sys+import time++import bpy+import numpy as np+from mathutils import Matrix, Vector++LM_PER_W = 683.0+argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+++def arg(name, default=None):+ return argv[argv.index(name) + 1] if name in argv else default+++OUT = os.path.abspath(arg("--out", "unreal_export"))+FRAME = int(arg("--frame", "60"))+ONLY = set(x for x in arg("--only", "").split(",") if x)+LIMIT = int(arg("--limit", "0"))+DENSITY = float(arg("--density", "1024")) # bake px per metre of sqrt(surface area)+MAX_RES = int(arg("--max-res", "4096"))+NO_BAKE = "--no-bake" in argv+DOF = json.loads(arg("--dof", "{}"))+GRADE_SH = arg("--grade-sh")+FFMPEG = arg("--ffmpeg", os.environ.get("FFMPEG", "ffmpeg")) # pipeline/env.sh exports FFMPEG (ffmpeg is not on PATH here)+THREADS = int(arg("--cpu-threads", "0"))+GPU = "--gpu" in argv # bake with OptiX (run through pipeline/gpu_run.sh)+REVERSE = "--reverse" in argv # walk assets from the end: a second process can share the work++SRC = bpy.data.filepath+if not SRC or os.path.basename(SRC) == "hk.blend" and "scenes" in SRC.replace("\\", "/").split("/"):+ print("export_blend: refusing to run on a scene's own .blend; open a copy", flush=True)+ sys.exit(1)++for d in ("mesh", "tex", "world", "grade"):+ os.makedirs(os.path.join(OUT, d), exist_ok=True)++sc = bpy.context.scene+sc.frame_set(FRAME)+S = Matrix.Diagonal((1.0, -1.0, 1.0, 1.0))+LOG = []+++def log(*a):+ s = " ".join(str(x) for x in a)+ LOG.append(s)+ print("EXPORT", s, flush=True)+++def ue_vec(v, scale=100.0):+ return [v[0] * scale, -v[1] * scale, v[2] * scale]+++def ue_xform(mw):+ t = S @ mw @ S+ loc, rot, scl = t.decompose()+ return {"loc": [loc.x * 100, loc.y * 100, loc.z * 100], "quat": [rot.x, rot.y, rot.z, rot.w], "scale": list(scl)}+++def ue_axes(mw):+ """Forward (-Z local) and up (+Y local) of a Blender camera/light in Unreal axes."""+ r = mw.to_3x3().normalized()+ f = r @ Vector((0, 0, -1))+ u = r @ Vector((0, 1, 0))+ return [f.x, -f.y, f.z], [u.x, -u.y, u.z]+++def safe(name):+ return re.sub(r"[^A-Za-z0-9_]", "_", name)[:60]+++# ------------------------------------------------------------------ material inspection++def output_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ for n in outs:+ if n.is_active_output:+ return n+ return outs[0] if outs else None+++def surface_shader(m):+ if not m or not m.node_tree:+ return None+ o = output_node(m.node_tree)+ if not o or not o.inputs["Surface"].is_linked:+ return None+ return o.inputs["Surface"].links[0].from_node+++def is_volume_only(m):+ if not m or not m.node_tree:+ return False+ o = output_node(m.node_tree)+ return bool(o and o.inputs["Volume"].is_linked and not o.inputs["Surface"].is_linked)+++def find_principled(m):+ sh = surface_shader(m)+ if sh is None:+ return None+ if sh.type == "BSDF_PRINCIPLED":+ return sh+ # Mix shaders etc.: first principled upstream.+ seen, stack = set(), [sh]+ while stack:+ n = stack.pop()+ if n.name in seen:+ continue+ seen.add(n.name)+ if n.type == "BSDF_PRINCIPLED":+ return n+ for i in n.inputs:+ for l in i.links:+ stack.append(l.from_node)+ return None+++def is_glass(m):+ p = find_principled(m)+ if p is not None:+ return (not p.inputs["Transmission Weight"].is_linked) and p.inputs["Transmission Weight"].default_value > 0.5+ sh = surface_shader(m)+ return sh is not None and sh.type in ("BSDF_GLASS", "BSDF_REFRACTION")+++def glass_params(m):+ p = find_principled(m)+ if p is None:+ return {"color": [1, 1, 1], "roughness": 0.0, "ior": 1.45}+ c = p.inputs["Base Color"].default_value+ return {"color": [c[0], c[1], c[2]], "roughness": p.inputs["Roughness"].default_value,+ "ior": p.inputs["IOR"].default_value, "alpha": p.inputs["Alpha"].default_value}+++def emissive(m):+ sh = surface_shader(m)+ if sh is None:+ return False+ if sh.type == "EMISSION":+ return True+ p = find_principled(m)+ if p is None:+ return False+ s = p.inputs["Emission Strength"]+ c = p.inputs["Emission Color"]+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))+++def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+++def uses_object_dependence(m):+ """Nodes whose result depends on the object it sits on (bakes per representative instance)."""+ if not m or not m.node_tree:+ return []+ hits = set()+ def walk(nt):+ for n in nt.nodes:+ if n.type in ("OBJECT_INFO", "AMBIENT_OCCLUSION", "NEW_GEOMETRY", "BEVEL"):+ hits.add(n.type)+ if n.type == "TEX_COORD":+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+ return sorted(hits)+++def animated(m):+ ad = m.node_tree.animation_data if m and m.node_tree else None+ return bool(ad and (ad.drivers or ad.action))+++# ------------------------------------------------------------------ scene classification++def particle_instancers():+ srcs, emitters = set(), set()+ for o in sc.objects:+ for md in o.modifiers:+ if md.type == "PARTICLE_SYSTEM":+ st = md.particle_system.settings+ emitters.add(o.name)+ if st.render_type == "OBJECT" and st.instance_object:+ srcs.add(st.instance_object.name)+ if st.render_type == "COLLECTION" and st.instance_collection:+ srcs.update(x.name for x in st.instance_collection.all_objects)+ return srcs, emitters+++def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+ return "m_" + o.data.name+ return "o_" + o.name+++def tri_count(me):+ me.calc_loop_triangles()+ return len(me.loop_triangles)+++def render_uv(me):+ return next((l for l in me.uv_layers if l.active_render), None) or me.uv_layers.active+++def uv_ok(me):+ """True if the active render UV is a usable non-overlapping atlas inside 0..1 (generated-prop style)."""+ uvl = render_uv(me)+ if uvl is None or len(me.loop_triangles) == 0:+ return False+ n = len(me.loops)+ uv = np.empty(n * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ if uv.min() < -0.01 or uv.max() > 1.01:+ return False+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ total = float(a.sum())+ if total > 1.02 or total < 0.05:+ return False+ # Coarse overlap check: rasterise triangle centroids+vertices into a 512 grid weighted by area.+ g = 512+ idx = np.clip((t.mean(axis=1) * g).astype(np.int32), 0, g - 1)+ occ = np.zeros((g, g), np.float64)+ np.add.at(occ, (idx[:, 1], idx[:, 0]), a)+ return float(occ.max()) < 4.0 / (g * g) + 1e-4 or total < 0.9+++def surface_area(o, me):+ mw = o.matrix_world+ me.calc_loop_triangles()+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3)+ m3 = np.array(mw.to_3x3())+ co = co @ m3.T+ vt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ t = co[vt.reshape(-1, 3)]+ return float(0.5 * np.linalg.norm(np.cross(t[:, 1] - t[:, 0], t[:, 2] - t[:, 0]), axis=1).sum())+++def pow2(x, lo, hi):+ r = lo+ while r < x and r < hi:+ r *= 2+ return min(r, hi)+++# ------------------------------------------------------------------ baking++BAKE_SCENE = None+++def bake_scene():+ global BAKE_SCENE+ if BAKE_SCENE is None:+ bs = bpy.data.scenes.new("__bake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "GPU" if GPU else "CPU"+ bs.cycles.samples = 4+ bs.cycles.use_denoising = False+ bs.render.bake.margin = 8+ bs.render.bake.use_clear = True+ bs.render.bake.target = "IMAGE_TEXTURES"+ if THREADS:+ bs.render.threads_mode = "FIXED"+ bs.render.threads = THREADS+ bs.world = sc.world+ bs.frame_current = FRAME+ BAKE_SCENE = bs+ return BAKE_SCENE+++def run_bake(o, kind):+ bs = bake_scene()+ vl = bs.view_layers[0]+ with bpy.context.temp_override(scene=bs, view_layer=vl, object=o, active_object=o,+ selected_objects=[o], selected_editable_objects=[o]):+ if kind == "NORMAL":+ bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT", margin=8, use_clear=True)+ else:+ bpy.ops.object.bake(type="EMIT", margin=8, use_clear=True)+++def _src(sock):+ return sock.links[0].from_socket if sock.is_linked else None+++class Rewire:+ """Temporarily route one Principled channel into an Emission shader on the material output."""++ def __init__(self, m, channel, img):+ self.m, self.nt = m, m.node_tree+ self.added, self.saved = [], None+ nt = self.nt+ out = output_node(nt)+ p = find_principled(m)+ sh = surface_shader(m)+ em = nt.nodes.new("ShaderNodeEmission")+ self.added.append(em)+ em.inputs["Strength"].default_value = 1.0+ col = em.inputs["Color"]+ if channel == "base":+ if p is not None:+ s = p.inputs["Base Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ elif sh is not None and sh.type == "EMISSION":+ col.default_value = (0, 0, 0, 1)+ elif sh is not None and "Color" in sh.inputs:+ s = sh.inputs["Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+ # R=1 (no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+ else:+ cmb.inputs[i].default_value = p.inputs[k].default_value if p is not None else dv+ nt.links.new(cmb.outputs[0], col)+ elif channel == "emit":+ if sh is not None and sh.type == "EMISSION":+ for k in ("Color", "Strength"):+ s = sh.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[k])+ else:+ em.inputs[k].default_value = s.default_value+ elif p is not None:+ for k, ek in (("Emission Color", "Color"), ("Emission Strength", "Strength")):+ s = p.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[ek])+ else:+ em.inputs[ek].default_value = s.default_value+ else:+ col.default_value = (0, 0, 0, 1)+ if out is not None:+ self.saved = _src(out.inputs["Surface"])+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ self.out = out+ self.tex = nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.added.append(self.tex)+ nt.nodes.active = self.tex++ def restore(self):+ nt = self.nt+ if self.out is not None:+ for l in list(self.out.inputs["Surface"].links):+ nt.links.remove(l)+ if self.saved is not None:+ nt.links.new(self.saved, self.out.inputs["Surface"])+ for n in self.added:+ nt.nodes.remove(n)+++class TargetOnly:+ """For the normal bake: keep the material, just add the active target image node."""++ def __init__(self, m, img):+ self.nt = m.node_tree+ self.tex = self.nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.nt.nodes.active = self.tex++ def restore(self):+ self.nt.nodes.remove(self.tex)+++def new_img(name, res, colorspace, is_float=False):+ old = bpy.data.images.get(name)+ if old:+ bpy.data.images.remove(old)+ w, h = (res, res) if isinstance(res, int) else res+ img = bpy.data.images.new(name, w, h, alpha=False, float_buffer=is_float)+ img.colorspace_settings.name = colorspace+ return img+++def save_png(img, path):+ img.filepath_raw = path+ img.file_format = "PNG"+ img.save()+++def bake_channel(o, mats, channel, res, path):+ cs = {"base": "sRGB", "orm": "Non-Color", "emit": "Linear Rec.709", "normal": "Non-Color"}[channel]+ img = new_img("__bake_" + channel, res, cs, is_float=(channel == "emit"))+ rw = []+ try:+ seen = set()+ for m in mats:+ if m is None or m.name in seen or m.node_tree is None:+ continue+ seen.add(m.name)+ rw.append(TargetOnly(m, img) if channel == "normal" else Rewire(m, channel, img))+ run_bake(o, "NORMAL" if channel == "normal" else "EMIT")+ finally:+ for r in rw:+ r.restore()+ scale = 1.0+ if channel == "emit":+ w, h = (res, res) if isinstance(res, int) else res+ px = np.empty(w * h * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mx = float(np.percentile(px.max(axis=1), 99.95)) if px.size else 0.0+ scale = max(mx, 1e-6)+ out = bpy.data.images.new("__emit_png", w, h, alpha=False)+ out.colorspace_settings.name = "sRGB"+ q = np.ones((w * h, 4), np.float32)+ q[:, :3] = np.clip(px / scale, 0, 1)+ out.pixels.foreach_set(q.ravel())+ save_png(out, path)+ bpy.data.images.remove(out)+ else:+ save_png(img, path)+ bpy.data.images.remove(img)+ return scale+++def uv_stats(me, name):+ """UV coords of a layer and the fraction of the 0..1 square its triangles cover."""+ uvl = me.uv_layers[name]+ uv = np.empty(len(me.loops) * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ me.calc_loop_triangles()+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ return uv, float(a.sum())+++def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+ empty square one. Returns (uv name, kept, aspect w/h, uv coverage)."""+ me = me_owner.data+ if "bake" in me.uv_layers:+ me.uv_layers.active = me.uv_layers["bake"]+ return "bake", False, me_owner.get("_bake_aspect", 1.0), me_owner.get("_bake_cov", 0.5)+ me.calc_loop_triangles()+ if uv_ok(me):+ ar = render_uv(me)+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)+ uvl = me.uv_layers.new(name="bake")+ if ar is not None:+ ar.active_render = True # keep materials reading their original UVs+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ vl.objects.active = me_owner+ me_owner.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ bpy.ops.mesh.select_all(action="SELECT")+ bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=False)+ try:+ bpy.ops.uv.select_all(action="SELECT")+ bpy.ops.uv.pack_islands(rotate=True, margin=0.003, shape_method="AABB", scale=True)+ except Exception as ex: # noqa: BLE001+ log("pack_islands failed", me_owner.name, ex)+ bpy.ops.object.mode_set(mode="OBJECT")+ me_owner.select_set(False)+ uv, _ = uv_stats(me, "bake")+ lo, hi = uv.min(axis=0), uv.max(axis=0)+ span = np.maximum(hi - lo, 1e-6)+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+++def bake_size(area, cov, aspect, kept):+ """Texture W,H so texel density is ~DENSITY px/m over the real surface; power of two, clamped."""+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4 # big architecture: coarser texels+ px = d * d * area / cov+ lo = 1024 if kept else 32+ w = pow2(math.sqrt(px * aspect), lo, MAX_RES)+ h = pow2(math.sqrt(px / aspect), lo, MAX_RES)+ if kept:+ w = h = min(max(w, h), 2048) # generated props: their own atlas, 1-2K+ return w, h+++# ------------------------------------------------------------------ export++def to_mesh_object(o):+ """Text/curve objects -> real mesh objects (evaluated) in a scratch collection; originals hidden."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ n = bpy.data.objects.new(o.name + "__mesh", me)+ c = bpy.data.collections.get("__converted") or bpy.data.collections.new("__converted")+ if c.name not in sc.collection.children:+ sc.collection.children.link(c)+ c.objects.link(n)+ n.matrix_world = o.matrix_world.copy()+ for k in ("visible_shadow", "visible_camera", "visible_glossy", "visible_diffuse"):+ setattr(n, k, getattr(o, k))+ o.hide_render = True+ return n+++def export_glb(o, uv_name, glass_slots, path):+ """Evaluated mesh at identity with only the bake UV; slots: 0 = baked, 1+ = each glass material."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ for l in [l for l in me.uv_layers if l.name != uv_name]:+ me.uv_layers.remove(l)+ if len(me.uv_layers):+ me.uv_layers[0].name = "UVMap"+ gl = list(glass_slots)+ mi = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("material_index", mi)+ remap = np.zeros(max(len(o.material_slots), 1), np.int32)+ for i in range(len(o.material_slots)):+ remap[i] = gl.index(i) + 1 if i in gl else 0+ mi = remap[np.clip(mi, 0, len(remap) - 1)]+ me.polygons.foreach_set("material_index", mi)+ me.materials.clear()+ base = bpy.data.materials.get("BAKED") or bpy.data.materials.new("BAKED")+ me.materials.append(base)+ for k, gi in enumerate(gl):+ gm = bpy.data.materials.get(f"GLASS_{k}") or bpy.data.materials.new(f"GLASS_{k}")+ me.materials.append(gm)+ tmp = bpy.data.objects.new("__export", me)+ sc.collection.objects.link(tmp)+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ tmp.select_set(True)+ vl.objects.active = tmp+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_apply=True,+ export_materials="PLACEHOLDER", export_texcoords=True, export_normals=True,+ export_tangents=True, export_yup=True, export_animations=False,+ export_cameras=False, export_lights=False, export_extras=False)+ bpy.data.objects.remove(tmp)+ bpy.data.meshes.remove(me)+++# ------------------------------------------------------------------ volumes++def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+ m = next((m for m in o.data.materials if m and is_volume_only(m)), None)+ if m is None:+ return None+ pv = next((nd for nd in m.node_tree.nodes if nd.type == "PRINCIPLED_VOLUME"), None)+ if pv is None:+ return None+ me0 = o.data+ xs = [v.co.x for v in me0.vertices]+ ys = [v.co.y for v in me0.vertices]+ zs = [v.co.z for v in me0.vertices]+ lo, hi = Vector((min(xs), min(ys), min(zs))), Vector((max(xs), max(ys), max(zs)))+ res = {"levels": [], "density": [], "emission": [], "emission_color": None}+ for f in levels:+ z = lo.z + f * (hi.z - lo.z)+ me = bpy.data.meshes.new("__slice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__slice", me)+ sc.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ out = output_node(nt)+ for l in list(out.inputs["Volume"].links):+ nt.links.remove(l)+ vals = {}+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ em = nt.nodes.new("ShaderNodeEmission")+ s = pvc.inputs[sock]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ img = new_img("__vol", n, "Non-Color", is_float=True)+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ bs = bake_scene()+ bs.collection.objects.link(sl)+ try:+ run_bake(sl, "EMIT")+ finally:+ bs.collection.objects.unlink(sl)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ vals[key] = float(px.reshape(-1, 4)[:, 0].mean())+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ res["levels"].append(f)+ res["density"].append(vals["density"])+ res["emission"].append(vals["emission"])+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ c = pv.inputs["Color"].default_value+ res["albedo"] = [c[0], c[1], c[2]]+ res["anisotropy"] = pv.inputs["Anisotropy"].default_value+ ec = pv.inputs["Emission Color"]+ if ec.is_linked:+ # Sample the colour ramp if it is one (flame): mid-height colour as a representative.+ n0 = ec.links[0].from_node+ if n0.type == "VALTORGB":+ res["emission_color"] = list(n0.color_ramp.evaluate(0.6))[:3]+ else:+ res["emission_color"] = list(ec.default_value)[:3]+ mw = o.matrix_world+ corners = [mw @ Vector((x, y, z)) for x in (lo.x, hi.x) for y in (lo.y, hi.y) for z in (lo.z, hi.z)]+ wlo = Vector([min(c[i] for c in corners) for i in range(3)])+ whi = Vector([max(c[i] for c in corners) for i in range(3)])+ res["bounds_ue"] = {"center": ue_vec((wlo + whi) / 2), "extent": [(whi.x - wlo.x) * 50, (whi.y - wlo.y) * 50, (whi.z - wlo.z) * 50]}+ res["bounds_m"] = {"lo": list(wlo), "hi": list(whi)}+ res["material"] = m.name+ res["animated"] = animated(m)+ return res+++# ------------------------------------------------------------------ lights / cameras / world / grade++def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+ mx = max(col) or 1.0+ P = L.energy+ e = {"name": o.name, "type": L.type, "color": [c / mx for c in col], "energy_w": P,+ "cast_shadows": bool(getattr(L, "use_shadow", True)),+ "specular": 1.0 if getattr(o, "visible_glossy", True) else 0.0,+ "diffuse": 1.0 if getattr(o, "visible_diffuse", True) else 0.0,+ "volume": 1.0 if getattr(o, "visible_volume_scatter", True) else 0.0,+ "loc": ue_vec(o.matrix_world.translation), "animated": bool(L.animation_data and (L.animation_data.drivers or L.animation_data.action))}+ f, u = ue_axes(o.matrix_world)+ e["forward"], e["up"] = f, u+ k = mx # colour normalisation folds into intensity+ if L.type in ("POINT", "SPOT"):+ e["candela"] = LM_PER_W * P * k / (4 * math.pi)+ e["source_radius"] = L.shadow_soft_size * 100+ e["soft_falloff"] = bool(getattr(L, "use_soft_falloff", True))+ if L.type == "SPOT":+ outer = math.degrees(L.spot_size) / 2+ e["outer_cone"] = min(outer, 80.0)+ e["inner_cone"] = outer * (1 - L.spot_blend)+ if outer > 80:+ e["note"] = f"spot cone {outer * 2:.0f} deg > Unreal max 160: clamped"+ elif L.type == "AREA":+ e["candela"] = LM_PER_W * P * k / math.pi+ e["shape"] = L.shape+ sx = L.size+ sy = L.size_y if L.shape in ("RECTANGLE", "ELLIPSE") else L.size+ sxx, syy, _ = o.matrix_world.to_scale()+ e["width"], e["height"] = sx * sxx * 100, sy * syy * 100+ e["spread_deg"] = math.degrees(getattr(L, "spread", math.pi))+ elif L.type == "SUN":+ e["lux"] = LM_PER_W * P * k+ e["angle_deg"] = math.degrees(L.angle)+ # IES / gobo: node-based light textures.+ if L.use_nodes and L.node_tree:+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+++def camera_entry(o):+ c = o.data+ f, u = ue_axes(o.matrix_world)+ rx, ry = sc.render.resolution_x, sc.render.resolution_y+ sw = c.sensor_width if c.sensor_fit in ("AUTO", "HORIZONTAL") else c.sensor_height * rx / ry+ d = {"name": o.name, "type": c.type, "lens_mm": c.lens, "sensor_width_mm": sw, "sensor_height_mm": sw * ry / rx,+ "sensor_fit": c.sensor_fit, "shift": [c.shift_x, c.shift_y], "clip": [c.clip_start * 100, c.clip_end * 100],+ "loc": ue_vec(o.matrix_world.translation), "forward": f, "up": u,+ "dof": {"enabled": c.dof.use_dof, "focus_cm": c.dof.focus_distance * 100, "fstop": c.dof.aperture_fstop,+ "blades": c.dof.aperture_blades, "focus_object": c.dof.focus_object.name if c.dof.focus_object else None}}+ if "exposure" in o: # per-camera exposure offset (AnyScene builder cameras.py stores it as a custom property)+ d["exposure"] = float(o["exposure"])+ if o.name in DOF:+ fd, fs = DOF[o.name]+ d["dof"].update(enabled=True, focus_cm=fd * 100, fstop=fs, source="--dof override (stills script)")+ return d+++def world_bake(path, w=2048, h=1024, spp=32):+ ws = bpy.data.scenes.new("__world")+ ws.world = sc.world+ ws.render.engine = "CYCLES"+ ws.cycles.device = "CPU"+ ws.cycles.samples = spp+ ws.render.resolution_x, ws.render.resolution_y, ws.render.resolution_percentage = w, h, 100+ ws.view_settings.view_transform = "Standard"+ ws.render.image_settings.file_format = "OPEN_EXR"+ ws.render.image_settings.color_depth = "16"+ cd = bpy.data.cameras.new("__pano")+ cd.type = "PANO"+ try:+ cd.panorama_type = "EQUIRECTANGULAR"+ except Exception:+ cd.cycles.panorama_type = "EQUIRECTANGULAR"+ co = bpy.data.objects.new("__pano", cd)+ ws.collection.objects.link(co)+ co.rotation_euler = (math.radians(90), 0, math.radians(-90)) # looking +X? (equirect centre = -Y in Blender -> fixed below)+ co.rotation_euler = (math.radians(90), 0, 0)+ ws.camera = co+ ws.render.filepath = path+ with bpy.context.temp_override(scene=ws):+ bpy.ops.render.render(write_still=True, scene=ws.name)+ # mean radiance for the sky light estimate+ img = bpy.data.images.load(path)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mean = px.mean(axis=0).tolist()+ bpy.data.images.remove(img)+ return {"equirect_exr": path, "mean_radiance": mean, "camera_note": "equirect centre looks along Blender +Y"}+++def compositor_nodes():+ # 5.0: compositing_node_group; Scene.node_tree is gone (use_nodes can still read True with no tree).+ tree = getattr(sc, "compositing_node_group", None) or getattr(sc, "node_tree", None)+ if tree is None:+ return []+ out = []+ for n in tree.nodes:+ d = {"type": n.bl_idname, "name": n.name, "inputs": {}}+ for i in n.inputs:+ if i.is_linked or not hasattr(i, "default_value"):+ continue+ v = i.default_value+ try:+ v = v if isinstance(v, str) else list(v)+ except TypeError:+ pass+ if isinstance(v, (int, float, str, list, bool)):+ d["inputs"][i.name] = v+ for k in ("glare_type", "quality", "blend_type"):+ if hasattr(n, k):+ d[k] = getattr(n, k)+ out.append(d)+ return out+++def ffmpeg_grade(grade_sh):+ """Pull GRADE="..." out of a scene's grade.sh; split into colour (LUT-able) and spatial filters."""+ txt = open(grade_sh, encoding="utf-8").read()+ m = re.search(r'GRADE="([^"]+)"', txt)+ if not m:+ return None+ filters = [f for f in m.group(1).split(",") if f]+ colour = [f for f in filters if f.split("=")[0] in ("curves", "hue", "eq", "colorbalance", "colorchannelmixer", "lutrgb", "colortemperature")]+ spatial = [f for f in filters if f not in colour]+ g = {"source": grade_sh, "filter": m.group(1), "colour": colour, "spatial": spatial}+ for f in spatial:+ if f.startswith("vignette"):+ a = re.search(r"angle=PI/([\d.]+)", f)+ g["vignette_angle_rad"] = math.pi / float(a.group(1)) if a else math.pi / 5+ if f.startswith("rgbashift"):+ g["chromatic_px"] = 1+ noise = re.search(r"noise=alls=(\d+)", txt)+ if noise:+ g["grain_strength"] = int(noise.group(1))+ return g+++def make_lut(colour_filters, path):+ """UE colour grading LUT (256x16, 16 slices of 16x16; R across a slice, G down, B by slice), with the ffmpeg+ colour filters applied. Unreal applies it after the tone curve, i.e. in display space, like ffmpeg on the PNG."""+ n = 16+ ident = os.path.join(os.path.dirname(path), "lut_identity.png")+ img = bpy.data.images.new("__lut", n * n, n, alpha=False)+ img.colorspace_settings.name = "Non-Color"+ px = np.zeros((n, n * n, 4), np.float32)+ for b in range(n):+ for g in range(n):+ for r in range(n):+ px[g, b * n + r] = (r / (n - 1), g / (n - 1), b / (n - 1), 1)+ # Blender rows go bottom-up; UE LUT row 0 (top) is G=0.+ img.pixels.foreach_set(px[::-1].ravel())+ save_png(img, ident)+ bpy.data.images.remove(img)+ if not colour_filters:+ return ident+ cmd = [FFMPEG, "-v", "error", "-y", "-i", ident, "-vf", ",".join(colour_filters), "-frames:v", "1", path]+ try:+ r = subprocess.run(cmd, capture_output=True, text=True)+ except OSError as ex:+ log("LUT ffmpeg not runnable (pass --ffmpeg or set FFMPEG):", FFMPEG, ex)+ return ident+ if r.returncode != 0:+ log("LUT ffmpeg failed:", r.stderr[:300])+ return ident+ return path+++# ------------------------------------------------------------------ main++def main():+ t0 = time.time()+ srcs, emitters = particle_instancers()+ report = {"skipped": [], "converted": [], "volumes": {}, "fx": [], "warnings": []}+ objs = []+ for o in list(sc.objects):+ if o.hide_render or not o.visible_get():+ if o.type in ("MESH", "FONT", "CURVE") and not o.hide_render:+ pass+ if o.hide_render:+ continue+ if o.name in srcs:+ report["skipped"].append([o.name, "particle instance source (exported as fx note)"])+ continue+ if o.name in emitters:+ st = [md.particle_system.settings for md in o.modifiers if md.type == "PARTICLE_SYSTEM"]+ report["fx"].append({"name": o.name, "kind": "particles", "count": sum(s.count for s in st),+ "instance": [s.instance_object.name if s.instance_object else None for s in st],+ "lifetime": [s.lifetime for s in st], "velocity": [list(s.object_align_factor) for s in st]})+ if not o.show_instancer_for_render:+ continue+ if o.type in ("FONT", "CURVE", "SURFACE", "META"):+ if o.type == "CURVE" and o.data.bevel_depth == 0 and not o.data.bevel_object and o.data.extrude == 0:+ report["skipped"].append([o.name, "curve without geometry"])+ continue+ n = to_mesh_object(o)+ report["converted"].append([o.name, o.type])+ objs.append(n)+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+ log("volume", o.name, [round(x, 4) for x in v["density"]], [round(x, 2) for x in v["emission"]])+ continue+ objs.append(o)+ # Group by unique mesh.+ assets = {}+ for o in objs:+ k = mesh_key(o)+ assets.setdefault(k, []).append(o)+ keys = sorted(assets, key=lambda k: assets[k][0].name, reverse=REVERSE)+ if ONLY:+ keys = [k for k in keys if any(o.name in ONLY or o.name.split("__")[0] in ONLY for o in assets[k])]+ if LIMIT:+ keys = keys[:LIMIT]+ log(f"{len(objs)} mesh objects -> {len(assets)} unique meshes; exporting {len(keys)}")+ entries, placements = [], []+ for ai, k in enumerate(keys):+ group = assets[k]+ rep = group[0]+ an = safe(rep.data.name if k.startswith("m_") else rep.name)+ an = f"{an}_{ai:03d}" if any(e["asset"] == an for e in entries) else an+ mats = [s.material for s in rep.material_slots]+ glass = [i for i, m in enumerate(mats) if m and is_glass(m)]+ bake_mats = [m for i, m in enumerate(mats) if i not in glass]+ dg = bpy.context.evaluated_depsgraph_get()+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+ meta = glb[:-4] + ".json"+ done = os.path.exists(glb) # written after every bake of the asset succeeded+ if done:+ # Resume: skip the UV unwrap (an edit-mode smart_project per asset). Blender 5.0.1's bake crashes+ # (OpenImageIO ustring::operator= in ccl::create_mesh) after a few hundred unwrap+bake cycles in one+ # process; re-unwrapping every finished asset on resume made it crash at the same asset every time.+ m0 = json.load(open(meta)) if os.path.exists(meta) else {}+ uv_name, kept, cov, res = None, m0.get("uv") == "kept", m0.get("uv_coverage", 0.0), m0.get("res", [0, 0])+ else:+ uv_name, kept, aspect, cov = ensure_bake_uv(rep, rep)+ res = bake_size(area, cov, aspect, kept)+ e = {"asset": an, "key": k, "tris": tris, "area_m2": round(area, 3), "uv": "kept" if kept else "smart_project",+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera)}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+ bake_scene().collection.objects.link(rep)+ try:+ bake_channel(rep, bake_mats, "base", res, p["base"])+ bake_channel(rep, bake_mats, "orm", res, p["orm"])+ if any(m and perturbs_normal(m) for m in bake_mats):+ bake_channel(rep, bake_mats, "normal", res, p["normal"])+ if any(m and emissive(m) for m in bake_mats):+ s = bake_channel(rep, bake_mats, "emit", res, p["emit"])+ json.dump({"scale": s}, open(p["emit"] + ".json", "w"))+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+ e["tex"] = {c: os.path.relpath(v, OUT) for c, v in p.items() if os.path.exists(v)}+ if not os.path.exists(glb):+ export_glb(rep, uv_name, glass, glb)+ if not done:+ json.dump({"res": list(res), "uv": e["uv"], "uv_coverage": e["uv_coverage"]}, open(meta, "w"))+ e["glb"] = os.path.relpath(glb, OUT)+ # Local bounds in Unreal axes for the importer orientation check.+ bb = [Vector(c) for c in rep.bound_box]+ e["check_bounds"] = {"min": ue_vec(Vector([min(c[i] for c in bb) for i in range(3)])),+ "max": ue_vec(Vector([max(c[i] for c in bb) for i in range(3)]))}+ e["bake_s"] = round(time.time() - t1, 1)+ entries.append(e)+ for o in group:+ placements.append({"name": o.name, "asset": an, **ue_xform(o.matrix_world),+ "shadow": bool(o.visible_shadow), "camera_visible": bool(o.visible_camera)})+ log(f"[{ai + 1}/{len(keys)}] {an} tris={tris} res={res} uv={e['uv']} inst={len(group)} {e['bake_s']}s")+ # Lights, cameras, world, grade.+ lights = [light_entry(o) for o in sc.objects if o.type == "LIGHT" and not o.hide_render]+ cams = [camera_entry(o) for o in sc.objects if o.type == "CAMERA"]+ world = None+ wpath = os.path.join(OUT, "world", "sky.exr")+ if sc.world:+ world = world_bake(wpath) if not os.path.exists(wpath) or "--rebake-world" in argv else {"equirect_exr": wpath}+ if "mean_radiance" not in world:+ img = bpy.data.images.load(wpath)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ world["mean_radiance"] = px.reshape(-1, 4)[:, :3].mean(axis=0).tolist()+ bpy.data.images.remove(img)+ world["equirect_exr"] = os.path.relpath(wpath, OUT)+ world["nits_scale"] = LM_PER_W+ vs = sc.view_settings+ grade = {"view_transform": vs.view_transform, "look": vs.look, "exposure": vs.exposure, "gamma": vs.gamma,+ "use_curve_mapping": vs.use_curve_mapping,+ "ev100": math.log2(LM_PER_W / 1.2) - vs.exposure,+ "compositor": compositor_nodes(),+ "motion_blur": {"on": sc.render.use_motion_blur, "shutter": sc.render.motion_blur_shutter},+ "resolution": [sc.render.resolution_x, sc.render.resolution_y], "fps": sc.render.fps}+ if vs.use_curve_mapping:+ grade["curves"] = [[(p.location[0], p.location[1]) for p in c.points] for c in vs.curve_mapping.curves]+ if GRADE_SH and os.path.exists(GRADE_SH):+ g = ffmpeg_grade(GRADE_SH)+ if g:+ g["lut"] = os.path.relpath(make_lut(g["colour"], os.path.join(OUT, "grade", "lut_grade.png")), OUT)+ grade["ffmpeg"] = g+ scene = {"source": SRC, "frame": FRAME, "units": "unreal cm, X fwd, Y right, Z up", "lm_per_w": LM_PER_W,+ "assets": entries, "placements": placements, "lights": lights, "cameras": cams, "active_camera": sc.camera.name if sc.camera else None, "world": world,+ "volumes": report["volumes"], "fx": report["fx"], "grade": grade,+ "skipped": report["skipped"], "converted": report["converted"], "export_s": round(time.time() - t0)}+ jp = os.path.join(OUT, "scene.json")+ if os.path.exists(jp) and (ONLY or LIMIT):+ old = json.load(open(jp, encoding="utf-8"))+ have = {e["asset"] for e in entries}+ scene["assets"] = [e for e in old.get("assets", []) if e["asset"] not in have] + entries+ scene["placements"] = [p for p in old.get("placements", []) if p["asset"] not in have] + placements+ json.dump(scene, open(jp, "w", encoding="utf-8"), indent=1)+ log(f"wrote {jp}: {len(scene['assets'])} assets, {len(scene['placements'])} placements, {len(lights)} lights, "+ f"{len(cams)} cameras, {len(report['volumes'])} volumes in {time.time() - t0:.0f}s")+++main()diff --git a/unreal_bakery/make_copy.py b/unreal_bakery/make_copy.pynew file mode 100644index 0000000..0a0063e--- /dev/null+++ b/unreal_bakery/make_copy.py@@ -0,0 +1,12 @@+"""Make a working copy of a scene .blend with all external paths absolute (a plain file copy breaks the scene's+//../../refs/... texture paths as soon as it lives in another folder). The source file is only read.+ blender -b scenes/<id>/<scene>.blend --python unreal/make_copy.py -- <out.blend>+"""+import sys+import bpy++out = sys.argv[sys.argv.index("--") + 1]+assert bpy.path.abspath(out) != bpy.data.filepath, "refusing to overwrite the source .blend"+bpy.ops.file.make_paths_absolute()+bpy.ops.wm.save_as_mainfile(filepath=out, copy=True, relative_remap=False, compress=False)+print("COPY", bpy.data.filepath, "->", out, flush=True)diff --git a/unreal_bakery/perf.ps1 b/unreal_bakery/perf.ps1new file mode 100644index 0000000..4aeb4b4--- /dev/null+++ b/unreal_bakery/perf.ps1@@ -0,0 +1,41 @@+# Standalone (-game) real-time performance run of a built AnyScene level, with no window (-RenderOffscreen).+# Captures N frames with the CSV profiler (frame/game/render/GPU times) from the PlayerStart (hero camera), and samples+# total GPU memory with nvidia-smi before and during the run.+# powershell -File perf.ps1 [-Map /Game/AnyScene/HK/L_HK] [-ResX 2560] [-ResY 1440] [-Frames 900] [-Extra "r.Lumen.HardwareRayTracing 0"]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Map = "/Game/AnyScene/HK/L_HK",+ [int]$ResX = 2560, [int]$ResY = 1440, [int]$Frames = 900, [int]$TimeoutS = 600,+ [string]$Tag = "perf", [string]$Extra = ""+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor.exe"+$saved = Join-Path (Split-Path $Project) "Saved"+$csvDir = Join-Path $saved "Profiling\CSV"+$before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+$mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+# -resx/-resy are ignored under -RenderOffscreen (the CSV showed 1066x600): r.setres sets the real size.+# The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+$cmds = "r.setres ${ResX}x${ResY}w,r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+if ($Extra) { $cmds = "$Extra,$cmds" }+$args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+$proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+$peak = $mem0+$sw = [Diagnostics.Stopwatch]::StartNew()+$csv = $null+while (-not $proc.HasExited -and $sw.Elapsed.TotalSeconds -lt $TimeoutS) {+ Start-Sleep -Seconds 2+ $m = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ if ($m -gt $peak) { $peak = $m }+ $new = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | Where-Object { $before -notcontains $_.FullName }+ if ($new) {+ $f = $new | Sort-Object LastWriteTime | Select-Object -Last 1+ # The CSV is written when the capture ends; wait until the file stops growing.+ $s1 = $f.Length; Start-Sleep -Seconds 3; $s2 = (Get-Item $f.FullName).Length+ if ($s1 -eq $s2 -and $s2 -gt 0) { $csv = $f.FullName; break }+ }+}+if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force }+"gpu_mem_before_mb=$mem0 gpu_mem_peak_mb=$peak delta_mb=$($peak - $mem0)"+"csv=$csv"diff --git a/unreal_bakery/render_mrq.ps1 b/unreal_bakery/render_mrq.ps1new file mode 100644index 0000000..caa346a--- /dev/null+++ b/unreal_bakery/render_mrq.ps1@@ -0,0 +1,17 @@+# Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+# UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+# powershell -File render_mrq.ps1 [-Cams cam_street,cam_table,cam_wok] [-Config MRQ_Still|MRQ_Linear]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Dest = "/Game/AnyScene/HK", [string]$Level = "L_HK",+ [string]$Cams = "cam_street,cam_table,cam_wok", [string]$Config = "MRQ_Still"+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"+foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1" | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+}diff --git a/unreal_bakery/render_shots.py b/unreal_bakery/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal_bakery/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_bakery/side_by_side.py b/unreal_bakery/side_by_side.pynew file mode 100644index 0000000..eba7215--- /dev/null+++ b/unreal_bakery/side_by_side.py@@ -0,0 +1,52 @@+"""Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.+File names come from SBS_CYC / SBS_UE (str.format patterns with {c}), default "{c}_graded.png" / "cam_{c}.png";+SBS_CYC_LABEL names the left side (default "Cycles graded").+"""+import os+import sys++from PIL import Image, ImageDraw, ImageFont++cyc, ue, out = sys.argv[1:4]+cams = (sys.argv[4] if len(sys.argv) > 4 else "street,table,wok").split(",")+os.makedirs(out, exist_ok=True)+H = 804+LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")+CYC_LABEL = os.environ.get("SBS_CYC_LABEL", "Cycles graded")+CYC_PAT = os.environ.get("SBS_CYC", "{c}_graded.png")+UE_PAT = os.environ.get("SBS_UE", "cam_{c}.png")+try:+ font = ImageFont.truetype("arial.ttf", 28)+except OSError:+ font = ImageFont.load_default()+++def fit(p):+ im = Image.open(p).convert("RGB")+ return im.resize((round(im.width * H / im.height), H), Image.LANCZOS)+++rows = []+for c in cams:+ a = fit(os.path.join(cyc, CYC_PAT.format(c=c)))+ up = os.path.join(ue, UE_PAT.format(c=c))+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+ for x, t in ((12, f"{CYC_LABEL} {c}"), (a.width + 20, f"{LABEL} {c}")):+ d.rectangle([x - 6, 8, x + 12 + int(d.textlength(t, font=font)), 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)+ print("wrote", os.path.join(out, f"{c}.png"))+w = max(r.width for r in rows)+allim = Image.new("RGB", (w, sum(r.height for r in rows) + 8 * (len(rows) - 1)), (255, 255, 255))+y = 0+for r in rows:+ allim.paste(r, (0, y))+ y += r.height + 8+allim.resize((allim.width // 2, allim.height // 2), Image.LANCZOS).save(os.path.join(out, "all.png"))diff --git a/unreal_caustic/MERGE_BACK.patch b/unreal_caustic/MERGE_BACK.patchnew file mode 100644index 0000000..7868bc0--- /dev/null+++ b/unreal_caustic/MERGE_BACK.patch@@ -0,0 +1,1038 @@+--- unreal/export_blend.py 2026-11-01 20:25:14.754928300 -0800++++ unreal_caustic/export_blend.py 2026-11-01 20:17:24.643016700 -0800+@@ -194,8 +194,6 @@+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+- if n.type == "ATTRIBUTE" and n.attribute_type in ("OBJECT", "INSTANCER"):+- hits.add("ATTR_" + n.attribute_name)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+@@ -223,21 +221,9 @@+ return srcs, emitters+++-def object_attr_values(o):+- """Values of the object attributes (Attribute node, type Object/Instancer) its materials read, e.g. a per-console+- screen_idx choosing which CRT page shows. Instances that differ in them cannot share one bake."""+- vals = set()+- for s in o.material_slots:+- for h in uses_object_dependence(s.material):+- if h.startswith("ATTR_"):+- vals.add(f"{h[5:]}={o.get(h[5:])}")+- return sorted(vals)+-+-+ def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+- av = object_attr_values(o)+- return "m_" + o.data.name + ("|" + ",".join(av) if av else "")++ return "m_" + o.data.name+ return "o_" + o.name+++@@ -495,36 +481,6 @@+ return uv, float(a.sum())+++-def uv_world_scale(o, me, uv):+- """Area-weighted mean world length (m) of one UV unit along u and along v (per-loop uv array, n x 2)."""+- co = np.empty(len(me.vertices) * 3, np.float32)+- me.vertices.foreach_get("co", co)+- co = co.reshape(-1, 3) @ np.array(o.matrix_world.to_3x3()).T+- me.calc_loop_triangles()+- nt = len(me.loop_triangles)+- if nt == 0:+- return 0.0, 0.0+- vt = np.empty(nt * 3, np.int32)+- lt = np.empty(nt * 3, np.int32)+- me.loop_triangles.foreach_get("vertices", vt)+- me.loop_triangles.foreach_get("loops", lt)+- P = co[vt.reshape(-1, 3)].astype(np.float64)+- T = uv[lt.reshape(-1, 3)].astype(np.float64)+- e1, e2 = P[:, 1] - P[:, 0], P[:, 2] - P[:, 0]+- d1, d2 = T[:, 1] - T[:, 0], T[:, 2] - T[:, 0]+- det = d1[:, 0] * d2[:, 1] - d2[:, 0] * d1[:, 1]+- ok = np.abs(det) > 1e-12+- if not ok.any():+- return 0.0, 0.0+- e1, e2, d1, d2, det = e1[ok], e2[ok], d1[ok], d2[ok], det[ok][:, None]+- dpdu = (e1 * d2[:, 1:2] - e2 * d1[:, 1:2]) / det+- dpdv = (e2 * d1[:, 0:1] - e1 * d2[:, 0:1]) / det+- w = 0.5 * np.linalg.norm(np.cross(e1, e2), axis=1)+- if w.sum() <= 0:+- return 0.0, 0.0+- return float((np.linalg.norm(dpdu, axis=1) * w).sum() / w.sum()), float((np.linalg.norm(dpdv, axis=1) * w).sum() / w.sum())+-+-+ def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+@@ -565,13 +521,6 @@+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+- # smart_project unwraps in object-local space, so a non-uniformly scaled object (a unit plane scaled to a 4.2 x 2.1 m+- # display) gets islands whose UV proportions are not its world proportions, and the span ratio above was 1:16 for a+- # 2:1 quad (512 x 4096 texture: 1/4 the texels across the short side). Pick W:H from the world-space length of one+- # UV unit along u and v instead, so texels come out square on the real surface.+- su, sv = uv_world_scale(me_owner, me, uv)+- if su > 0 and sv > 0:+- aspect = su / sv+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+@@ -737,6 +686,267 @@++ # ------------------------------------------------------------------ lights / cameras / world / grade+++def export_ies(nd, light_name):++ """IES profile -> <OUT>/ies/<name>.ies (external file copied, internal text datablock written). Returns the++ path relative to OUT, or None."""++ d = os.path.join(OUT, "ies")++ os.makedirs(d, exist_ok=True)++ try:++ if nd.mode == "EXTERNAL":++ src = bpy.path.abspath(nd.filepath)++ if not os.path.exists(src):++ log("ies missing", light_name, src)++ return None++ dst = os.path.join(d, safe(os.path.splitext(os.path.basename(src))[0]) + ".ies")++ if not os.path.exists(dst):++ with open(src, "rb") as fi, open(dst, "wb") as fo:++ fo.write(fi.read())++ else:++ if nd.ies is None:++ return None++ dst = os.path.join(d, safe(nd.ies.name.rsplit(".", 1)[0]) + ".ies")++ with open(dst, "w", encoding="utf-8") as fo:++ fo.write(nd.ies.as_string())++ except OSError as ex:++ log("ies export failed", light_name, ex)++ return None++ return os.path.relpath(dst, OUT)++++++def export_image_file(img, sub="gobo"):++ """A (possibly packed) image -> <OUT>/<sub>/<name>.<ext>; returns the path relative to OUT."""++ d = os.path.join(OUT, sub)++ os.makedirs(d, exist_ok=True)++ base = os.path.basename(bpy.path.abspath(img.filepath)) or img.name++ stem, ext = os.path.splitext(base)++ ext = ext.lower() if ext.lower() in (".png", ".jpg", ".jpeg", ".tga", ".exr", ".tif", ".tiff") else ".png"++ dst = os.path.join(d, safe(stem) + ext)++ if not os.path.exists(dst):++ if img.packed_file:++ with open(dst, "wb") as fo:++ fo.write(img.packed_file.data)++ elif os.path.exists(bpy.path.abspath(img.filepath)):++ with open(bpy.path.abspath(img.filepath), "rb") as fi, open(dst, "wb") as fo:++ fo.write(fi.read())++ else: # generated / missing on disk: write the pixels++ dst = os.path.join(d, safe(stem) + ".png")++ im2 = img.copy()++ save_png(im2, dst)++ bpy.data.images.remove(im2)++ return os.path.relpath(dst, OUT)++++++def _fcurves(idblock):++ """All F-curves of an ID's action (Blender 5 layered actions: layers -> strips -> channelbag(slot))."""++ ad = getattr(idblock, "animation_data", None)++ act = ad.action if ad else None++ if act is None:++ return []++ out = list(getattr(act, "fcurves", []) or [])++ if not out and hasattr(act, "layers"):++ for ly in act.layers:++ for st in ly.strips:++ cb = st.channelbag(ad.action_slot) if ad.action_slot else None++ if cb:++ out += list(cb.fcurves)++ return out++++++def fit_channel(t, y, n_sines=2, fmin=0.01, fmax=1.5, step=0.002):++ """y(t) ~ c0 + v t + sum_k A_k sin(2 pi f_k t + phi_k), greedy frequency search + joint linear least squares.++ Returns {"c0", "v", "sines": [[A, f, phi], ...], "rms"} (t in seconds)."""++ t = np.asarray(t, np.float64)++ y = np.asarray(y, np.float64)++ cols = [np.ones_like(t), t]++ freqs = []++ grid = np.arange(fmin, fmax, step)++ for _ in range(n_sines):++ best = None++ for f in grid:++ if any(abs(f - g) < 2 * step for g in freqs):++ continue++ w = 2 * math.pi * f++ A = np.vstack(cols + [np.sin(w * t), np.cos(w * t)]).T++ c, res, *_ = np.linalg.lstsq(A, y, rcond=None)++ r = float(((A @ c - y) ** 2).sum())++ if best is None or r < best[0]:++ best = (r, f)++ if best is None:++ break++ f = best[1]++ freqs.append(f)++ w = 2 * math.pi * f++ cols += [np.sin(w * t), np.cos(w * t)]++ A = np.vstack(cols).T++ c, *_ = np.linalg.lstsq(A, y, rcond=None)++ rms = float(np.sqrt(((A @ c - y) ** 2).mean()))++ sines = []++ for k, f in enumerate(freqs):++ a, b = c[2 + 2 * k], c[3 + 2 * k]++ sines.append([float(math.hypot(a, b)), float(f), float(math.atan2(b, a))]) # A sin(wt+phi) = A cos(phi) sin + A sin(phi) cos++ return {"c0": float(c[0]), "v": float(c[1]), "sines": sines, "rms": rms, "range": [float(y.min()), float(y.max())]}++++++def _reduce_strength(sock, layers, light):++ """Reduce the node chain feeding a light's emission Strength to gain * (sum_i w_i * tex_i + bias) ^ gamma.++ Supports Math ADD/SUBTRACT/MULTIPLY/DIVIDE/POWER with constants, Map Range (linear) and Image Texture leaves++ (Color or Alpha output). Returns a dict or raises ValueError."""++ if not sock.is_linked:++ return {"w": {}, "bias": float(sock.default_value), "gamma": 1.0, "gain": 1.0, "clamp": False}++ n = sock.links[0].from_node++ if n.type == "TEX_IMAGE":++ i = next(k for k, l in enumerate(layers) if l["node"] == n.name)++ return {"w": {i: 1.0}, "bias": 0.0, "gamma": 1.0, "gain": 1.0, "clamp": False}++ if n.type == "MAP_RANGE" and n.data_type == "FLOAT" and n.interpolation_type == "LINEAR":++ f = _reduce_strength(n.inputs[0], layers, light)++ a, b, c, d = (n.inputs[k].default_value for k in (1, 2, 3, 4))++ if any(n.inputs[k].is_linked for k in (1, 2, 3, 4)) or abs(a) > 1e-6 or abs(c) > 1e-6:++ raise ValueError(f"{light}: map range other than 0..b -> 0..d")++ f["gain"] *= d / b++ f["clamp"] = f["clamp"] or n.clamp++ return f++ if n.type == "MATH":++ op = n.operation++ lk = [i.is_linked for i in n.inputs[:2]]++ if op in ("ADD", "SUBTRACT") and all(lk):++ fa, fb = _reduce_strength(n.inputs[0], layers, light), _reduce_strength(n.inputs[1], layers, light)++ if fa["gamma"] != 1 or fb["gamma"] != 1:++ raise ValueError(f"{light}: sum of non-linear terms")++ s = -1.0 if op == "SUBTRACT" else 1.0++ w = {k: fa["gain"] * v for k, v in fa["w"].items()}++ for k, v in fb["w"].items():++ w[k] = w.get(k, 0.0) + s * fb["gain"] * v++ return {"w": w, "bias": fa["gain"] * fa["bias"] + s * fb["gain"] * fb["bias"], "gamma": 1.0, "gain": 1.0, "clamp": False}++ if lk[0] and not lk[1] or lk[1] and not lk[0]:++ src = n.inputs[0] if lk[0] else n.inputs[1]++ k = n.inputs[1].default_value if lk[0] else n.inputs[0].default_value++ f = _reduce_strength(src, layers, light)++ if op == "MULTIPLY" or (op == "DIVIDE" and lk[0]):++ m = k if op == "MULTIPLY" else 1.0 / k++ if f["gamma"] == 1.0:++ f["w"] = {i: v * m for i, v in f["w"].items()}++ f["bias"] *= m++ else:++ f["gain"] *= m++ return f++ if op in ("ADD", "SUBTRACT") and f["gamma"] == 1.0 and f["gain"] == 1.0:++ f["bias"] += k if op == "ADD" else (-k if lk[0] else k)++ if op == "SUBTRACT" and lk[1]:++ raise ValueError(f"{light}: const - texture")++ return f++ if op == "POWER" and lk[0]:++ f["gain"] = f["gain"] ** k++ f["gamma"] *= k++ return f++ raise ValueError(f"{light}: unsupported math {op}")++ raise ValueError(f"{light}: unsupported node {n.type} in the strength chain")++++++def gobo_entry(o):++ """Projected-texture (gobo) light: the image layers, their Mapping transform and its animation fitted to drift +++ sines, and the strength chain reduced to gain * (sum w_i tex_i + bias)^gamma. None if the light has no image."""++ L = o.data++ nt = L.node_tree++ texs = [n for n in nt.nodes if n.type == "TEX_IMAGE" and n.image]++ if not texs:++ return None++ fcs = {(fc.data_path, fc.array_index): fc for fc in _fcurves(nt)}++ fps = sc.render.fps / sc.render.fps_base++ layers, warns = [], []++ coord = "unknown"++ for tx in texs:++ lay = {"node": tx.name, "image": export_image_file(tx.image), "extension": tx.extension,++ "interpolation": tx.interpolation, "colorspace": tx.image.colorspace_settings.name,++ "size": list(tx.image.size)}++ vin = tx.inputs["Vector"]++ mp = vin.links[0].from_node if vin.is_linked else None++ if mp is not None and mp.type == "MAPPING":++ if mp.vector_type not in ("POINT", "TEXTURE"):++ warns.append(f"mapping type {mp.vector_type}")++ rot = mp.inputs["Rotation"].default_value++ if abs(rot[0]) > 1e-4 or abs(rot[1]) > 1e-4:++ warns.append("mapping X/Y rotation ignored")++ chans = {}++ for key, sock, idx in (("loc_x", "Location", 0), ("loc_y", "Location", 1), ("rot", "Rotation", 2),++ ("scale_x", "Scale", 0), ("scale_y", "Scale", 1)):++ si = list(mp.inputs).index(mp.inputs[sock])++ fc = fcs.get((f'nodes["{mp.name}"].inputs[{si}].default_value', idx))++ if fc is None or len(fc.keyframe_points) < 2:++ chans[key] = {"c0": float(mp.inputs[sock].default_value[idx]), "v": 0.0, "sines": [], "rms": 0.0}++ continue++ k0, k1 = fc.keyframe_points[0].co[0], fc.keyframe_points[-1].co[0]++ frames = np.arange(math.floor(k0), math.ceil(k1) + 1)++ vals = [fc.evaluate(float(f)) for f in frames]++ chans[key] = fit_channel(frames / fps, vals)++ chans[key]["keys"] = len(fc.keyframe_points)++ chans[key]["frames"] = [int(frames[0]), int(frames[-1])]++ if fc.modifiers:++ warns.append(f"{key}: fcurve modifiers {[m.type for m in fc.modifiers]} sampled, not exported")++ if mp.vector_type == "TEXTURE": # inverse transform: not supported by the master material++ warns.append("TEXTURE-type mapping treated as POINT")++ lay["mapping"] = chans++ lay["animated"] = any(c.get("keys") for c in chans.values())++ src = mp.inputs["Vector"].links[0].from_node if mp.inputs["Vector"].is_linked else None++ else:++ lay["mapping"] = None++ src = mp++ # Coordinate source: TexCoord Normal -> x/z, y/z (perspective projector) is the standard spot gobo.++ c = "unknown"++ if src is not None and src.type == "COMBXYZ":++ ins = [src.inputs[i].links[0].from_node if src.inputs[i].is_linked else None for i in (0, 1)]++ if all(n is not None and n.type == "MATH" and n.operation == "DIVIDE" for n in ins):++ seps = {l.from_node.type for n in ins for i in n.inputs[:2] for l in i.links}++ tc = {l.from_node for n in ins for i in n.inputs[:2] for l in i.links if l.from_node.type == "SEPXYZ"}++ if seps == {"SEPXYZ"} and len(tc) == 1:++ sep = next(iter(tc))++ ln = sep.inputs[0].links[0] if sep.inputs[0].is_linked else None++ if ln and ln.from_node.type == "TEX_COORD":++ c = "normal_projective" if ln.from_socket.name == "Normal" else ln.from_socket.name.lower() + "_projective"++ elif src is not None and src.type == "TEX_COORD":++ c = src.outputs[0].name.lower()++ for s in src.outputs:++ if s.is_linked:++ c = s.name.lower() + "_raw"++ coord = c if coord == "unknown" else coord++ if c != coord:++ warns.append(f"layers use different coordinates ({coord} vs {c})")++ layers.append(lay)++ em = next((n for n in nt.nodes if n.type == "EMISSION"), None)++ g = {"coord": coord, "layers": layers, "fps": fps}++ try:++ f = _reduce_strength(em.inputs["Strength"], layers, o.name) if em else None++ except ValueError as ex:++ warns.append(str(ex))++ f = None++ if f is None: # fall back to an equal-weight average of the layers, unit gain++ f = {"w": {i: 1.0 / len(layers) for i in range(len(layers))}, "bias": 0.0, "gamma": 1.0, "gain": 1.0, "clamp": False}++ g["combine"] = {"weights": [f["w"].get(i, 0.0) for i in range(len(layers))], "bias": f["bias"], "gamma": f["gamma"],++ "gain": f["gain"], "clamp": f["clamp"]}++ # Peak (all textures at 1) and mean (layers decorrelated) of the strength pattern.++ w = np.array(g["combine"]["weights"])++ g["peak"] = float(f["gain"] * max(w.clip(0).sum() + f["bias"], 1e-6) ** f["gamma"])++ try:++ rng = np.random.default_rng(0)++ acc = np.full(100000, f["bias"], np.float64)++ for i, tx in enumerate(texs):++ im = tx.image++ px = np.empty(im.size[0] * im.size[1] * im.channels, np.float32)++ im.pixels.foreach_get(px)++ px = px.reshape(-1, im.channels)[:, :3].mean(axis=1)++ acc += w[i] * px[rng.integers(0, px.size, acc.size)]++ g["mean"] = float((f["gain"] * np.clip(acc, 0, None) ** f["gamma"]).mean())++ except Exception as ex: # noqa: BLE001++ g["mean"] = None++ warns.append(f"mean estimate failed: {ex}")++ if em is not None:++ ec = em.inputs["Color"]++ g["emission_color"] = list(ec.default_value)[:3] if not ec.is_linked else [1.0, 1.0, 1.0]++ g["warnings"] = warns++ for wmsg in warns:++ log("gobo", o.name, wmsg)++ return g+++++ def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+@@ -777,8 +987,17 @@+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")++ f = export_ies(nd, o.name)++ if f:++ e["ies_file"] = f+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)++ em = next((nd for nd in L.node_tree.nodes if nd.type == "EMISSION"), None)++ if em is not None and not em.inputs["Strength"].is_linked and "candela" in e:++ e["candela"] *= em.inputs["Strength"].default_value # a constant node strength scales the light++ g = gobo_entry(o)++ if g:++ e["gobo_fx"] = g+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+@@ -974,11 +1193,6 @@+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+- # Material sections the GLB really has, in order (0 = baked, k+1 = glass k). glTF drops unused materials, so an+- # all-glass pane has one section, the glass one; build_level used to give it the baked (opaque) material.+- mi_ = np.empty(len(ev.polygons), np.int32)+- ev.polygons.foreach_get("material_index", mi_)+- sect = sorted({(glass.index(int(i)) + 1) if int(i) in glass else 0 for i in np.unique(mi_)}) if len(mi_) else [0]+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+@@ -997,7 +1211,7 @@+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+- "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera), "sections": sect}++ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera)}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+--- unreal/build_level.py 2026-11-01 20:25:17.725321300 -0800++++ unreal_caustic/build_level.py 2026-11-01 21:37:29.617093600 -0800+@@ -29,6 +29,7 @@+ STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,sequences").split(",")+ ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+ NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))++MESH_BATCH = int(os.environ.get("ANYSCENE_MESH_BATCH", "16")) # Interchange imports in flight per wait (memory)+ EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))++ EAL = unreal.EditorAssetLibrary+@@ -107,7 +108,30 @@+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)++ # 4K bakes: without a GC per chunk the commandlet held every imported texture and ran out of memory++ # (~550 of 796 on a 32 GB box shared with other editors).++ unreal.SystemLibrary.collect_garbage()+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")++ # A crash inside a chunk leaves imported textures without their settings: re-check the linear channels.++ fixed = 0++ lin = [(ch, tex_path(os.path.splitext(os.path.basename(rel))[0])) for a in ASSETS for ch, rel in a.get("tex", {}).items() if ch in ("orm", "normal")]++ for k, (ch, p) in enumerate(lin):++ d = unreal.EditorAssetLibrary.find_asset_data(p)++ if not d.is_valid():++ continue++ tx = d.get_asset()++ if tx and tx.get_editor_property("srgb"):++ tx.set_editor_property("srgb", False)++ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS if ch == "orm" else unreal.TextureCompressionSettings.TC_NORMALMAP)++ if ch == "normal":++ tx.set_editor_property("flip_green_channel", True)++ EAL.save_loaded_asset(tx, False)++ fixed += 1++ if k % 64 == 63:++ unreal.SystemLibrary.collect_garbage()++ if fixed:++ log(f"textures: fixed settings on {fixed} linear textures")++ stage_light_textures()+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+@@ -123,6 +147,50 @@+ REPORT["timings"]["textures_s"] = round(time.time() - t)++++def gobo_tex_path(rel):++ return f"{DEST}/Gobo/{os.path.splitext(os.path.basename(rel.replace(chr(92), '/')))[0]}"++++++def ies_path(rel):++ return f"{DEST}/IES/{os.path.splitext(os.path.basename(rel.replace(chr(92), '/')))[0]}"++++++def stage_light_textures():++ """Gobo images (linear grayscale, wrapping) and IES profiles (TextureLightProfile) referenced by the lights."""++ gobos, ies = {}, {}++ for L in scene["lights"]:++ for lay in (L.get("gobo_fx") or {}).get("layers", []):++ gobos[gobo_tex_path(lay["image"])] = lay++ if L.get("ies_file"):++ ies[ies_path(L["ies_file"])] = L["ies_file"]++ todo = [os.path.join(EXPORT, lay["image"]) for p, lay in gobos.items() if not EAL.does_asset_exist(p)]++ if todo:++ import_files(todo, f"{DEST}/Gobo")++ for p, lay in gobos.items():++ tx = EAL.load_asset(p)++ if tx is None:++ warn(f"gobo import failed {lay['image']}")++ continue++ lin = lay.get("colorspace", "Non-Color") in ("Non-Color", "Linear Rec.709", "Raw")++ tx.set_editor_property("srgb", not lin)++ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_GRAYSCALE)++ wrap = unreal.TextureAddress.TA_WRAP if lay.get("extension", "REPEAT") == "REPEAT" else unreal.TextureAddress.TA_CLAMP++ tx.set_editor_property("address_x", wrap)++ tx.set_editor_property("address_y", wrap)++ tx.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_EFFECTS)++ EAL.save_loaded_asset(tx, False)++ todo = [os.path.join(EXPORT, f) for p, f in ies.items() if not EAL.does_asset_exist(p)]++ if todo:++ import_files(todo, f"{DEST}/IES")++ for p, f in ies.items():++ prof = EAL.load_asset(p) if EAL.does_asset_exist(p) else None++ if prof is None:++ warn(f"IES import failed {f}")++ continue++ EAL.save_loaded_asset(prof, False) # import tasks run with save=False++ log(f"light textures: {len(gobos)} gobo images, {len(ies)} IES profiles")+++++ # ------------------------------------------------------------------ meshes++ def mesh_folder(a):+@@ -188,8 +256,9 @@++ for i, a in enumerate(todo):+ queue(a)+- if i % 16 == 15 or i == len(todo) - 1:++ if i % MESH_BATCH == MESH_BATCH - 1 or i == len(todo) - 1:+ flush(a)++ unreal.SystemLibrary.collect_garbage()+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+@@ -327,6 +396,214 @@+ return m++++GOBO_CH = ("LocX", "LocY", "Rot", "ScaleX", "ScaleY")++GOBO_KEYS = {"LocX": "loc_x", "LocY": "loc_y", "Rot": "rot", "ScaleX": "scale_x", "ScaleY": "scale_y"}++++++def mpc_time():++ """Material parameter collection holding the gobo clock: GoboUseSeq = 0 -> real time (Time node + per-light++ TimeOffset); 1 -> GoboTime, keyed by the level sequences so MRQ frames land on the exact Blender frame."""++ path = f"{DEST}/Materials/MPC_AnyTime"++ if EAL.does_asset_exist(path):++ return EAL.load_asset(path)++ m = AT.create_asset("MPC_AnyTime", f"{DEST}/Materials", unreal.MaterialParameterCollection, unreal.MaterialParameterCollectionFactoryNew())++ ps = []++ for n in ("GoboTime", "GoboUseSeq"):++ p = unreal.CollectionScalarParameter()++ p.set_editor_property("parameter_name", n)++ p.set_editor_property("default_value", 0.0)++ ps.append(p)++ m.set_editor_property("scalar_parameters", ps)++ EAL.save_loaded_asset(m, False)++ return m++++++def master_gobo():++ """Light-function master for projected-texture (gobo) spots, matching Blender's TexCoord-Normal x/z, y/z++ projector: two texture layers, each with Mapping location / Z rotation / scale animated as++ c0 + v t + A1 sin(2 pi f1 t + p1) + A2 sin(2 pi f2 t + p2) (per channel: vector params <L>_<Ch> = (c0, v, A1, f1)++ and <L>_<Ch>P = (p1, A2, f2, p2)), combined as Gain * (WA a + WB b + Bias)^Gamma, divided by Peak (light++ functions are clamped to 0..1; the light's intensity carries the peak)."""++ path = f"{DEST}/Materials/M_AnyGobo"++ if EAL.does_asset_exist(path):++ return EAL.load_asset(path)++ m = AT.create_asset("M_AnyGobo", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())++ m.set_editor_property("material_domain", unreal.MaterialDomain.MD_LIGHT_FUNCTION)++ mpc = mpc_time()++ gobo_default = next((EAL.load_asset(gobo_tex_path(lay["image"])) for L in scene["lights"]++ for lay in (L.get("gobo_fx") or {}).get("layers", []) if EAL.does_asset_exist(gobo_tex_path(lay["image"]))), None)++ if gobo_default is None:++ warn("M_AnyGobo: no imported gobo texture to use as the sampler default")++++ def scalar(name, v, x, y):++ n = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, x, y)++ n.set_editor_property("parameter_name", name)++ n.set_editor_property("default_value", v)++ return n++++ def vec(name, v, x, y):++ n = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, x, y)++ n.set_editor_property("parameter_name", name)++ n.set_editor_property("default_value", unreal.LinearColor(*v))++ return n++++ # Clock: lerp(Time + TimeOffset, GoboTime, GoboUseSeq)++ tm = MEL.create_material_expression(m, unreal.MaterialExpressionTime, -2400, -600)++ toff = scalar("TimeOffset", 0.0, -2400, -500)++ add = MEL.create_material_expression(m, unreal.MaterialExpressionAdd, -2200, -560)++ MEL.connect_material_expressions(tm, "", add, "A")++ MEL.connect_material_expressions(toff, "", add, "B")++ cps = []++ for i, n in enumerate(("GoboTime", "GoboUseSeq")):++ c = MEL.create_material_expression(m, unreal.MaterialExpressionCollectionParameter, -2400, -400 + 100 * i)++ c.set_editor_property("collection", mpc)++ c.set_editor_property("parameter_name", n)++ cps.append(c)++ lt = MEL.create_material_expression(m, unreal.MaterialExpressionLinearInterpolate, -2000, -500)++ MEL.connect_material_expressions(add, "", lt, "A")++ MEL.connect_material_expressions(cps[0], "", lt, "B")++ MEL.connect_material_expressions(cps[1], "", lt, "Alpha")++ uv = MEL.create_material_expression(m, unreal.MaterialExpressionTextureCoordinate, -2400, -800)++ tan = scalar("TanOuter", 0.8391, -2400, -700)++++ def ch(c):++ return (f"({c}.x + {c}.y*T + {c}.z*sin(6.2831853*{c}.w*T + {c}P.x) + {c}P.y*sin(6.2831853*{c}P.z*T + {c}P.w))")++++ code = ("float2 p = (UV * 2.0 - 1.0) * Tan;\n"++ "float2 d = float2(-p.y, -p.x); // Blender light-local (x/z, y/z)\n"++ f"float lx = {ch('LocX')}; float ly = {ch('LocY')}; float r = {ch('Rot')};\n"++ f"float2 s = d * float2({ch('ScaleX')}, {ch('ScaleY')});\n"++ "float c = cos(r); float sn = sin(r);\n"++ "float2 q = float2(s.x * c - s.y * sn, s.x * sn + s.y * c) + float2(lx, ly);\n"++ "return float2(q.x, -q.y); // Blender image v runs bottom-up")++ samples = []++ defaults = {"LocX": (0, 0, 0, 0), "LocY": (0, 0, 0, 0), "Rot": (0, 0, 0, 0), "ScaleX": (1, 0, 0, 0), "ScaleY": (1, 0, 0, 0)}++ camv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -2400, 300)++ lfs = scalar("LFScale", 1024.0, -2400, 400)++ srad = scalar("SourceRadius", 0.0, -2400, 500)++ pbias = scalar("PenumbraBias", -1.0, -2400, 600)++ for li, L in enumerate(("A", "B")):++ y0 = li * 1400++ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -1500, y0)++ cu.set_editor_property("code", code)++ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)++ cu.set_editor_property("description", f"GoboUV_{L}")++ names = ["UV", "Tan", "T"] + [n for c in GOBO_CH for n in (c, c + "P")]++ ins = []++ for n in names:++ ci = unreal.CustomInput()++ ci.set_editor_property("input_name", n)++ ins.append(ci)++ cu.set_editor_property("inputs", ins)++ MEL.connect_material_expressions(uv, "", cu, "UV")++ MEL.connect_material_expressions(tan, "", cu, "Tan")++ MEL.connect_material_expressions(lt, "", cu, "T")++ vecs = {}++ for k, c in enumerate(GOBO_CH):++ a = vec(f"{L}_{c}", defaults[c], -1900, y0 + k * 220)++ b = vec(f"{L}_{c}P", (0, 0, 0, 0), -1900, y0 + k * 220 + 110)++ MEL.connect_material_expressions(a, "RGBA", cu, c)++ MEL.connect_material_expressions(b, "RGBA", cu, c + "P")++ vecs[c] = a++ # Penumbra: Cycles evaluates the gobo from every point of the light's disk, so the pattern blurs by the++ # angle SourceRadius / distance (tan units), times the mapping scale in texture space. Light functions are++ # point-projected; pick the mip whose texel matches that blur. CameraVector in a light function is the++ # light-space vector divided by LightFunctionScale (LightFunctionPixelShader.usf).++ mipc = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -1500, y0 + 1150)++ # Blur radius R texels = s * r / d * TexSize. A disk of radius R is roughly a Gaussian of sigma R/2, which++ # mip log2(R) - 1 (bilinear) approximates; PenumbraBias (default -1) is the look-match knob.++ mipc.set_editor_property("code", "float d = length(LV) * LFScale; if (d < 1.0) return 0.0;\n"++ "float s = max(abs(SX.x), abs(SY.x));\n"++ "return clamp(log2(max(s * SourceRadius / d * TexSize, 1.0)) + Bias, 0.0, 8.0);")++ mipc.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT1)++ mipc.set_editor_property("description", f"GoboPenumbraMip_{L}")++ ins = []++ for n in ("LV", "LFScale", "SourceRadius", "TexSize", "SX", "SY", "Bias"):++ ci = unreal.CustomInput()++ ci.set_editor_property("input_name", n)++ ins.append(ci)++ mipc.set_editor_property("inputs", ins)++ MEL.connect_material_expressions(camv, "", mipc, "LV")++ MEL.connect_material_expressions(lfs, "", mipc, "LFScale")++ MEL.connect_material_expressions(srad, "", mipc, "SourceRadius")++ MEL.connect_material_expressions(scalar(f"TexSize{L}", 2048.0, -1900, y0 + 1250), "", mipc, "TexSize")++ MEL.connect_material_expressions(vecs["ScaleX"], "RGBA", mipc, "SX")++ MEL.connect_material_expressions(vecs["ScaleY"], "RGBA", mipc, "SY")++ MEL.connect_material_expressions(pbias, "", mipc, "Bias")++ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -1100, y0)++ tx.set_editor_property("parameter_name", f"Tex{L}")++ tx.set_editor_property("mip_value_mode", unreal.TextureMipValueMode.TMVM_MIP_LEVEL)++ if not MEL.connect_material_expressions(mipc, "", tx, "Level"): # pin is "Level" in TMVM_MIP_LEVEL mode++ warn("M_AnyGobo: could not connect the penumbra mip")++ # The default must match the sampler type (linear grayscale), or the master fails to compile and every++ # light function silently does nothing (same trap as the ORM default in M_AnyBaked).++ tx.set_editor_property("texture", gobo_default)++ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_GRAYSCALE)++ MEL.connect_material_expressions(cu, "", tx, "UVs")++ w = scalar(f"W{L}", 0.5, -1100, y0 + 250)++ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -800, y0)++ MEL.connect_material_expressions(tx, "R", mul, "A")++ MEL.connect_material_expressions(w, "", mul, "B")++ samples.append(mul)++ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -500, 0)++ cu.set_editor_property("code", "return saturate(Gain * pow(max(A + B + Bias, 0.0), Gamma) * InvPeak);")++ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT1)++ cu.set_editor_property("description", "GoboCombine")++ ins = []++ for n in ("A", "B", "Bias", "Gamma", "Gain", "InvPeak"):++ ci = unreal.CustomInput()++ ci.set_editor_property("input_name", n)++ ins.append(ci)++ cu.set_editor_property("inputs", ins)++ MEL.connect_material_expressions(samples[0], "", cu, "A")++ MEL.connect_material_expressions(samples[1], "", cu, "B")++ for n, v, yy in (("Bias", 0.0, 300), ("Gamma", 1.0, 400), ("Gain", 1.0, 500), ("InvPeak", 1.0, 600)):++ MEL.connect_material_expressions(scalar(n, v, -800, yy), "", cu, n)++ MEL.connect_material_property(cu, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)++ MEL.recompile_material(m)++ EAL.save_loaded_asset(m, False)++ return m++++++def gobo_mi(L):++ """Material instance of M_AnyGobo for one light's gobo_fx entry."""++ g = L["gobo_fx"]++ m = mi("MI_Gobo_" + L["name"], master_gobo())++ lays = g["layers"][:2]++ if len(g["layers"]) > 2:++ warn(f"{L['name']}: {len(g['layers'])} gobo layers, master takes 2")++ if g.get("coord") != "normal_projective":++ warn(f"{L['name']}: gobo coordinates '{g.get('coord')}' approximated as the Normal x/z, y/z projector")++ fps = g.get("fps", 24.0)++ MEL.set_material_instance_scalar_parameter_value(m, "TanOuter", math.tan(math.radians(L["outer_cone"])))++ MEL.set_material_instance_scalar_parameter_value(m, "TimeOffset", scene.get("frame", 0) / fps)++ cb = g["combine"]++ w = list(cb["weights"][:2]) + [0.0] * (2 - len(lays))++ for li, Ln in enumerate(("A", "B")):++ lay = lays[min(li, len(lays) - 1)]++ tx = EAL.load_asset(gobo_tex_path(lay["image"]))++ if tx:++ MEL.set_material_instance_texture_parameter_value(m, f"Tex{Ln}", tx)++ MEL.set_material_instance_scalar_parameter_value(m, f"W{Ln}", w[li] if li < len(lays) else 0.0)++ mp = lay.get("mapping") or {}++ for c in GOBO_CH:++ e = mp.get(GOBO_KEYS[c]) or {"c0": 1.0 if c.startswith("Scale") else 0.0, "v": 0.0, "sines": []}++ s = (e.get("sines") or []) + [[0.0, 0.0, 0.0]] * 2++ MEL.set_material_instance_vector_parameter_value(m, f"{Ln}_{c}", unreal.LinearColor(e["c0"], e["v"], s[0][0], s[0][1]))++ MEL.set_material_instance_vector_parameter_value(m, f"{Ln}_{c}P", unreal.LinearColor(s[0][2], s[1][0], s[1][1], s[1][2]))++ MEL.set_material_instance_scalar_parameter_value(m, "Bias", cb["bias"])++ MEL.set_material_instance_scalar_parameter_value(m, "Gamma", cb["gamma"])++ MEL.set_material_instance_scalar_parameter_value(m, "Gain", cb["gain"])++ MEL.set_material_instance_scalar_parameter_value(m, "InvPeak", 1.0 / max(g["peak"], 1e-6))++ MEL.set_material_instance_scalar_parameter_value(m, "SourceRadius", L.get("source_radius", 0.0))++ MEL.set_material_instance_scalar_parameter_value(m, "LFScale", 1024.0)++ for li, Ln in enumerate(("A", "B")):++ lay = lays[min(li, len(lays) - 1)]++ MEL.set_material_instance_scalar_parameter_value(m, f"TexSize{Ln}", float(max(lay.get("size") or [2048])))++ EAL.save_loaded_asset(m, False)++ return m+++++ def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+@@ -362,9 +639,6 @@+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+- if a.get("sections"):+- # The GLB keeps only the materials its faces use (an all-glass pane has just the glass section).+- mats = [mats[min(s, len(mats) - 1)] for s in a["sections"]]+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+@@ -391,6 +665,29 @@+ return act++++LFV_BASE_CM = 500.0 # ULocalFogVolumeComponent::GetBaseVolumeSize()++++++def lfv_tiles(b, max_aspect=1.5):++ """Cover a box (center, half-extent cm) with spheres: one sphere of radius max(half-extent) when the box is++ roughly cubic, else a row of spheres of radius = the smaller of the two larger half-extents along the long axis++ (a long flat box must not become one giant ball). Returns [(center, radius_cm)]."""++ e = list(b["extent"])++ c = list(b["center"])++ order = sorted(range(3), key=lambda i: -e[i])++ big, mid = e[order[0]], e[order[1]]++ if big <= max_aspect * mid:++ return [(c, max(e))]++ r = mid++ n = max(1, math.ceil(big / r))++ out = []++ for k in range(n):++ p = list(c)++ p[order[0]] = c[order[0]] - big + r + (2 * big - 2 * r) * (k / max(n - 1, 1))++ out.append((p, r))++ return out+++++ def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+@@ -473,6 +770,30 @@+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])++ if L.get("gobo_fx") and L["type"] == "SPOT":++ # Light functions are clamped to 0..1: the material divides the pattern by its peak, the light carries it.++ g = L["gobo_fx"]++ c.set_editor_property("intensity", L["candela"] * g["peak"])++ c.set_editor_property("light_function_material", gobo_mi(L))++ c.set_editor_property("light_function_scale", unreal.Vector(1024, 1024, 1024)) # uniform: x/z ratio intact++ c.set_editor_property("light_function_fade_distance", 1.0e6)++ ec = g.get("emission_color") or [1, 1, 1]++ if max(ec) > 0 and any(abs(x - 1) > 1e-3 for x in ec):++ col = [a * b for a, b in zip(L["color"], ec)]++ mx = max(col)++ c.set_light_color(unreal.LinearColor(*(x / mx for x in col), 1.0), True)++ c.set_editor_property("intensity", L["candela"] * g["peak"] * mx)++ REPORT.setdefault("gobos", {})[L["name"]] = {"peak": g["peak"], "mean": g.get("mean"), "layers": len(g["layers"])}++ elif L.get("gobo_fx"):++ warn(f"{L['name']}: gobo on a {L['type']} light not converted (spot only)")++ if L.get("ies_file"):++ prof = EAL.load_asset(ies_path(L["ies_file"]))++ if prof:++ c.set_editor_property("ies_texture", prof)++ # Cycles' IES node normalises the profile and the light power carries the brightness: keep candela.++ c.set_editor_property("use_ies_brightness", False)++ else:++ warn(f"{L['name']}: IES profile {L['ies_file']} not imported")+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+@@ -536,24 +857,35 @@+ for name, v in vols.items():+ if name == haze[0]:+ continue+- b = v["bounds_ue"]+- lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(b["center"]), unreal.Rotator(0, 0, 0))+- lf.set_actor_label("LFV_" + name)+- lf.set_folder_path("Volumes")+- # Local fog volumes are unit spheres of radius 100 cm at scale 1 (assumed); scale to the box.+- lf.set_actor_scale3d(unreal.Vector(b["extent"][0] / 100, b["extent"][1] / 100, b["extent"][2] / 100))+- lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+- dens = max(v["density"])+- emit = max(v["emission"])+- lc.set_editor_property("radial_fog_extinction", dens)+- lc.set_editor_property("height_fog_extinction", 0.0)+- al = v["albedo"]+- lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+- lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+- if emit > 0 and v.get("emission_color"):+- ec = v["emission_color"]+- lc.set_editor_property("radial_fog_extinction", 1.0)+- lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * emit, ec[1] * emit, ec[2] * emit, 1))++ for k, (ctr, r_cm) in enumerate(lfv_tiles(v["bounds_ue"])):++ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(ctr), unreal.Rotator(0, 0, 0))++ lf.set_actor_label(f"LFV_{name}" + (f"_{k}" if k else ""))++ lf.set_folder_path("Volumes")++ # LocalFogVolume: base radius 500 cm (GetBaseVolumeSize), the proxy turns the scale into a sphere from++ # the max axis (LocalFogVolumeSceneProxy.cpp:34), so scale uniformly to the wanted radius.++ sc_ = r_cm / LFV_BASE_CM++ lf.set_actor_scale3d(unreal.Vector(sc_, sc_, sc_))++ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)++ dens = max(v["density"]) # Blender density = extinction per metre++ emit = max(v["emission"])++ path_m = 2.0 * r_cm / 100.0++ # RadialFogExtinction is the optical depth straight through the centre (LocalFogVolumeCommon.ush),++ # independent of size: sigma (1/m) x path length (m).++ tau = max(dens * path_m, 1e-3) # emissive-only volumes still need a little medium (coverage > 0)++ lc.set_editor_property("radial_fog_extinction", tau)++ lc.set_editor_property("height_fog_extinction", 0.0)++ al = v["albedo"]++ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))++ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))++ if emit > 0 and v.get("emission_color"):++ ec = v["emission_color"]++ # UE adds FogEmissive x coverage (1 - e^-tau) (LocalFogVolumeCommon.ush). Cycles through the centre:++ # 683 x emit x (1 - e^-(sigma p)) / sigma nits (683 x emit x p when sigma -> 0). Match the two.++ lc_nits = 683 * emit * ((1 - math.exp(-dens * path_m)) / dens if dens > 1e-6 else path_m)++ E = lc_nits / (1 - math.exp(-tau))++ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * E, ec[1] * E, ec[2] * E, 1))++ REPORT.setdefault("local_fog", []).append({"volume": name, "radius_cm": round(r_cm, 1), "scale": round(sc_, 4),++ "radial_fog_extinction": round(dens * path_m, 5)})+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+@@ -588,7 +920,8 @@+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+- hero = next((c for c in scene["cameras"] if c["name"] == "cam_street"), scene["cameras"][0] if scene["cameras"] else None)++ hero_name = os.environ.get("ANYSCENE_HERO", "cam_street")++ hero = next((c for c in scene["cameras"] if c["name"] == hero_name), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+@@ -598,6 +931,102 @@+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}++++def key_gobo_time(seq, n_frames, frame0=None):++ """Drive MPC_AnyTime from the sequence: GoboUseSeq = 1 and GoboTime = (Blender frame0 + f) / fps keyed on every++ frame, so MRQ frame f shows the gobo state of Blender frame frame0 + f (temporal sub-samples interpolate)."""++ if not any(L.get("gobo_fx") for L in scene["lights"]):++ return++ mpc = mpc_time()++ fps = scene["grade"].get("fps", 24)++ frame0 = scene.get("frame", 0) if frame0 is None else frame0++ try:++ tr = seq.add_track(unreal.MovieSceneMaterialParameterCollectionTrack)++ except Exception:++ tr = seq.add_master_track(unreal.MovieSceneMaterialParameterCollectionTrack)++ tr.set_editor_property("mpc", mpc)++ sec = tr.add_section()++ sec.set_range(0, n_frames)++ tick = seq.get_tick_resolution()++ tpf = tick.numerator / tick.denominator / fps++ lin = unreal.MovieSceneKeyInterpolation.LINEAR++ sec.add_scalar_parameter_key("GoboUseSeq", unreal.FrameNumber(0), 1.0, lin)++ for f in range(n_frames + 1):++ sec.add_scalar_parameter_key("GoboTime", unreal.FrameNumber(round(f * tpf)), (frame0 + f) / fps, lin)++++++def make_dolly(spec, eas, fps):++ """ANYSCENE_DOLLY="camA>camB:frames[:name]": a CineCamera moving linearly from camera A's transform to camera++ B's (lens from A) over N frames, as SEQ_<name> for an MRQ clip."""++ a, rest = spec.split(">", 1)++ parts = rest.split(":")++ b, n = parts[0], int(parts[1]) if len(parts) > 1 else 96++ name = parts[2] if len(parts) > 2 else f"dolly_{a}"++ ca = next((C for C in scene["cameras"] if C["name"] == a), None)++ if b.startswith("fwd") and ca is not None: # "camA>fwd150": push in 150 cm along camera A's view axis++ d = float(b[3:])++ cb = dict(ca, loc=[ca["loc"][i] + ca["forward"][i] * d for i in range(3)])++ else:++ cb = next((C for C in scene["cameras"] if C["name"] == b), None)++ if ca is None or cb is None:++ warn(f"dolly {spec}: camera missing")++ return++ old = next((x for x in eas.get_all_level_actors() if x.get_actor_label() == name), None)++ if old:++ eas.destroy_actor(old)++ ra, rb = rot_fu(ca["forward"], ca["up"]), rot_fu(cb["forward"], cb["up"])++ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(ca["loc"]), ra)++ act.set_actor_label(name)++ act.set_folder_path("Cameras")++ cc = act.get_cine_camera_component()++ fb = cc.get_editor_property("filmback")++ fb.set_editor_property("sensor_width", ca["sensor_width_mm"])++ fb.set_editor_property("sensor_height", ca["sensor_height_mm"])++ cc.set_editor_property("filmback", fb)++ cc.set_editor_property("current_focal_length", ca["lens_mm"])++ cc.set_editor_property("current_aperture", 22.0)++ fs = cc.get_editor_property("focus_settings")++ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.DISABLE)++ cc.set_editor_property("focus_settings", fs)++ sp = f"{DEST}/Sequences/SEQ_{name}"++ if EAL.does_asset_exist(sp):++ EAL.delete_asset(sp)++ seq = AT.create_asset(f"SEQ_{name}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())++ seq.set_display_rate(unreal.FrameRate(fps, 1))++ seq.set_playback_start(0)++ seq.set_playback_end(n)++ bnd = seq.add_possessable(act)++ tt = bnd.add_track(unreal.MovieScene3DTransformTrack)++ ts = tt.add_section()++ ts.set_range(0, n)++ chs = ts.get_all_channels()++ lin = unreal.MovieSceneKeyInterpolation.LINEAR++++ def unwrap(x, y):++ while y - x > 180:++ y -= 360++ while y - x < -180:++ y += 360++ return y++ va = [ca["loc"][0], ca["loc"][1], ca["loc"][2], ra.roll, ra.pitch, ra.yaw]++ vb = [cb["loc"][0], cb["loc"][1], cb["loc"][2], unwrap(ra.roll, rb.roll), unwrap(ra.pitch, rb.pitch), unwrap(ra.yaw, rb.yaw)]++ for i in range(6):++ chs[i].add_key(unreal.FrameNumber(0), va[i], interpolation=lin)++ chs[i].add_key(unreal.FrameNumber(n), vb[i], interpolation=lin)++ for i in range(6, 9):++ chs[i].add_key(unreal.FrameNumber(0), 1.0)++ try:++ ct = seq.add_track(unreal.MovieSceneCameraCutTrack)++ except Exception:++ ct = seq.add_master_track(unreal.MovieSceneCameraCutTrack)++ cs = ct.add_section()++ cs.set_range(0, n)++ cs.set_camera_binding_id(seq.get_binding_id(bnd) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, bnd))++ key_gobo_time(seq, n)++ EAL.save_loaded_asset(seq, False)++ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).save_current_level()++ log(f"dolly {name}: {a} -> {b}, {n} frames")+++++ def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+@@ -629,11 +1058,15 @@+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)++ key_gobo_time(seq, 48)+ EAL.save_loaded_asset(seq, False)++ for spec in [s for s in os.environ.get("ANYSCENE_DOLLY", "").split(";") if s]:++ make_dolly(spec, eas, fps)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+- res = scene["grade"].get("resolution", [1920, 804])+- for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True)):++ res = [int(x) for x in os.environ["ANYSCENE_MRQ_RES"].split("x")] if os.environ.get("ANYSCENE_MRQ_RES") else scene["grade"].get("resolution", [1920, 804])++ # MRQ_Clip = MRQ_Still over the sequence's whole playback range (dolly clips).++ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True), ("MRQ_Clip", False)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+@@ -653,7 +1086,7 @@+ out.output_directory = unreal.DirectoryPath(os.path.join(EXPORT, "..", "compare", "mrq").replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+- out.use_custom_playback_range = True++ out.use_custom_playback_range = name != "MRQ_Clip"+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+--- unreal/export.sh 2026-11-01 20:36:10.032235300 -0800++++ unreal_caustic/export.sh 2026-11-01 20:16:55.422631500 -0800+@@ -5,17 +5,15 @@+ # bash unreal/export.sh <copy.blend> <out_dir> [export_blend.py args...] (log: <out_dir>/export.log)+ # EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py"+ A="$(cd "$(dirname "$0")/.." && pwd)"++HERE="$(cd "$(dirname "$0")" && (pwd -W 2>/dev/null || pwd))" # this folder's exporter (C:/ form for Windows Blender)+ . "$A/pipeline/env.sh"+ blend="$1"; out="$2"; shift 2+ mkdir -p "$out"+ : > "$out/export.log"+ pre=()+ [ -n "$EXPORT_PRE" ] && pre=(--python "$EXPORT_PRE")+-# Only a --gpu bake needs the shared GPU queue; a CPU bake runs now instead of waiting behind other scenes' renders.+-q=()+-case " $* " in *" --gpu "*) q=(bash "$A/pipeline/gpu_run.sh") ;; esac+ for i in $(seq 1 "${EXPORT_TRIES:-6}"); do+- "${q[@]}" "$BLENDER" -b "$blend" "${pre[@]}" --python "$A/unreal/export_blend.py" -- --out "$out" "$@" \++ bash "$A/pipeline/gpu_run.sh" "$BLENDER" -b "$blend" "${pre[@]}" --python "$HERE/export_blend.py" -- --out "$out" "$@" \+ >> "$out/export.log" 2>&1+ rc=$?+ if grep -q "^EXPORT wrote" "$out/export.log"; then echo "export: done after $i run(s)"; exit 0; fi+--- unreal/side_by_side.py 2026-11-01 18:40:20.523349700 -0800++++ unreal_caustic/side_by_side.py 2026-11-01 21:10:00.226569300 -0800+@@ -1,6 +1,8 @@+ """Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+ Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.++File names are patterns: SBS_CYC="{cam}_graded.png", SBS_UE="cam_{cam}.png" (e.g. SBS_UE="SEQ_{cam}.0000.png" for MRQ).++SBS_CYC_LABEL sets the left label (default "Cycles graded").+ """+ import os+ import sys+@@ -12,6 +14,9 @@+ os.makedirs(out, exist_ok=True)+ H = 804+ LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")++CYC_LABEL = os.environ.get("SBS_CYC_LABEL", "Cycles graded")++CYC_FMT = os.environ.get("SBS_CYC", "{cam}_graded.png")++UE_FMT = os.environ.get("SBS_UE", "cam_{cam}.png")+ try:+ font = ImageFont.truetype("arial.ttf", 28)+ except OSError:+@@ -25,15 +30,15 @@++ rows = []+ for c in cams:+- a = fit(os.path.join(cyc, f"{c}_graded.png"))+- up = os.path.join(ue, f"cam_{c}.png")++ a = fit(os.path.join(cyc, CYC_FMT.format(cam=c)))++ up = os.path.join(ue, UE_FMT.format(cam=c))+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+- for x, t in ((12, f"Cycles graded {c}"), (a.width + 20, f"{LABEL} {c}")):+- d.rectangle([x - 6, 8, x + 360, 46], fill=(0, 0, 0))++ for x, t in ((12, f"{CYC_LABEL} {c}"), (a.width + 20, f"{LABEL} {c}")):++ d.rectangle([x - 6, 8, x + 12 + int(d.textlength(t, font=font)), 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)diff --git a/unreal_caustic/NIAGARA.md b/unreal_caustic/NIAGARA.mdnew file mode 100644index 0000000..72bd5cb--- /dev/null+++ b/unreal_caustic/NIAGARA.md@@ -0,0 +1,655 @@+# NIAGARA.md: porting AnyScene (Blender/Cycles) effects to Unreal 5.8++This is the converter agent's guide to effects: flames, steam, smoke, haze plumes, rain or drizzle, drips and splashes,+sparks and embers, dust motes, fountain jets, and screen or light flicker. Geometry, materials, lights, cameras and fog+already convert (`export_blend.py` writes `scene.json`, then `build_level.py` builds the level). This file covers+what comes next: classify each Blender effect, pick a technique, place it, render it through MRQ and compare it+with Cycles.++Everything marked *[engine]* was confirmed in the installed UE 5.8 files under `C:\Program Files\Epic Games\UE_5.8`.+Items marked *[docs]* come from dev.epicgames.com. Items marked *[untested]* are design guidance: verify them on the+first scene and update this file.++---++## 0. Read this first: findings that change the plan++1. **No built-in fire, steam, smoke or rain system ships with 5.8.** The Niagara plugin includes only generic emitter+ templates (Fountain, HangingParticulates, RecycleParticlesInView, BlowingParticles, DirectionalBurst, ...). There is+ no StarterContent `P_Fire` / `P_Steam` on this install. Real fire and smoke exist only as **NiagaraFluids** grid sims,+ which are Beta and expensive. Plan on an **AnySceneFX content plugin**: about ten master systems authored once, so+ the converter only places them and sets their parameters. Never author Niagara graphs at build time.+2. **Local fog volumes in `build_level.py` are the wrong size.** `ULocalFogVolumeComponent::GetBaseVolumeSize()`+ returns **500 cm**, and the proxy collapses the scale to a uniform sphere using the **max axis**+ (`LocalFogVolumeSceneProxy.cpp:34`) *[engine]*. `build_level.py` assumes a 100 cm unit and non-uniform scale, so+ every LFV comes out about 5x too large and spherical. That is why the wok "flame" became a large static emissive+ glow. `RadialFogExtinction` is also integrated in unit-sphere space: the optical depth straight through the centre+ is exactly `RadialFogExtinction`, independent of size (`LocalFogVolumeCommon.ush:178-203`). The correct mapping is+ **extinction = Blender density (1/m) x path length (m)**, not the raw density.+3. **Particles never reach the level.** The exporter only logs particle emitters into `fx` (no transform, no bounds,+ no velocity), and `build_level.py` ignores `fx`. That is why the HK drizzle and drips are missing. Steam is+ procedural 4D-noise volume shaders, which the exporter samples at one frame into a static LFV. Animated steam+ cannot survive that path.+4. **MRQ needs `render_warm_up_frames = True` for GPU particles.** The flag's own tooltip says GPU particles need the+ warm-up frames to be rendered *[engine: MoviePipelineAntiAliasingSetting.h]*. `build_level.py` already sets it+ (64 engine warm-up frames). Keep it, and keep `use_camera_cut_for_warm_up = False`, or `engine_warm_up_count` is+ ignored.+5. **Pass `fx.Niagara.ForceWaitForCompilationOnActivate=1` in `-dpcvars` for every headless render.** Otherwise a+ component activates while its scripts or GPU shaders are still compiling, and the first frames render without the+ effect. This is the Niagara equivalent of the `Editor.AsyncAssetCompilation=0` gotcha already in+ `render_shots.py`. The per-component property `bWaitForCompilationOnActivate` is editor-only data+ (`NiagaraComponent.cpp:1358`) *[engine]*.+6. **User parameters set from Python in the editor are saved with the level.** In editor builds, `SetVariableFloat`+ and the other setters also call `SetParameterOverride`, which writes `InstanceParameterOverrides`+ (`NiagaraComponent.cpp:2875, 4376`) *[engine]*. So build, set, `save_current_level()` works headlessly. The+ parameter must exist on the asset and the type must match exactly. A wrong name or wrong type is a **silent no-op**.+7. **Epic ships an AI toolset for Niagara authoring:** `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (plus+ `ToolsetRegistry`, both disabled by default). Its tools create systems, add emitters, modules, renderers and user+ variables, set stack inputs, and read compile errors and stack issues. You can call them from Python through+ `unreal.ToolsetRegistry.execute_tool(toolset, tool, json)`. Use this for the **one-time** authoring of the AnySceneFX+ templates, in a full editor session with an RHI. Do not use it in the per-scene build. It is Experimental. Its+ bundled skills (`Content/Python/skills/*.py`) are worth reading. They are summarised in §1 where relevant.+8. **Animated SVTs import headlessly from VDB.** `USparseVolumeTextureFactory` skips its dialog when the import is+ automated or running in a commandlet, auto-detects numbered `.vdb` sequences, and maps the `density` grid to+ attributes A.R (unorm8), with up to 4 other grids in B (fp16) (`SparseVolumeTextureFactory.cpp:40-108, 436`)+ *[engine]*. Blender 5.0 bundles the `openvdb` Python module (`5.0/python/lib/site-packages/openvdb.cp311-*.pyd`), so+ the exporter can write VDBs from procedural volumes itself.++---++## 1. Niagara essentials (only what the converter needs)++- **System > emitters > modules.** A *system* (`UNiagaraSystem`, the asset you place) contains *emitters*. Each+ emitter runs four script stacks in a fixed order: System Spawn/Update, then Emitter Spawn/Update, then Particle+ Spawn/Update. Spawn runs once at creation and Update runs every tick. Within Particle Update the order is forces,+ then collision, then exactly one velocity solve. *Renderers* (sprite, mesh, ribbon, light, ...) draw an emitter's+ particles.+- **Namespaces.** `User.*` is the external interface: set per component, read anywhere. `Engine.*` is read-only (delta+ time, owner transform). `System.*`, `Emitter.*` and `Particles.*` are written by their own scope.+ **Expose everything the converter sets as a `User.` parameter.** From Python, pass the bare name (`SpawnRate`). The+ `User.` prefix also resolves (`RedirectUserVariable`). There is no enum setter: set the int.+- **Types matter.** World-space anchors are `Position` (LWC-aware): use `set_variable_position`. Directions,+ velocities, wind and box extents are `Vector3`: use `set_variable_vec3`. Colours are `LinearColor`.+- **CPU vs GPU.** System and emitter scripts always run on the CPU VM. Only particle scripts move to the GPU.+ - Use **GPU** for anything sustained in the hundreds or more (rain, dust, steam puffs, sparks).+ - Use **CPU** for small counts and for any emitter with a **Light renderer**: light, decal and component renderers+ force the emitter to CPU.+ - A system can mix both.+- **Fixed bounds.** Use fixed bounds for every converter-placed effect. They are cheapest, work on CPU and GPU, and+ stop the culling surprises. Dynamic bounds are CPU-only. GPU emitters without fixed or programmable bounds cull+ wrongly. Set them per instance with `set_system_fixed_bounds(Box)` in **local space**: use the Blender domain or+ emitter box plus travel distance (velocity x lifetime).+- **Warm-up and pre-roll.** `UNiagaraSystem.WarmupTime / WarmupTickCount / WarmupTickDelta` simulate N ticks on+ activation in one frame. Per instance, set `override_warmup_settings = True`, `warmup_tick_count` and+ `warmup_tick_delta`. The component passes these to the instance at activation (`NiagaraComponent.cpp:1219`)+ *[engine]*. Rule: **warm-up time ≥ the longest particle lifetime x 1.5**, so the effect is in steady state on+ frame 1. Mirror Blender's negative `frame_start` (HK drizzle starts at -80) or the Mantaflow `PREROLL`.+- **Determinism and seeds.**+ - The system flag `bDeterminism` + `RandomSeed` makes the instance seed equal the system seed plus the component's+ `RandomSeedOffset`. Without it, every reset gets a random seed.+ - Emitters carry their own `bDeterminism` / `RandomSeed` too.+ - Turn both on in every AnySceneFX template. Set `set_random_seed_offset(hash(fx_id) & 0x7fffffff)` per instance so+ copies differ but runs repeat. The offset is applied on activation or reset, so set it before saving.+ - CPU emitters with determinism repeat exactly under MRQ's fixed timestep. Treat GPU emitters as "very close" *[untested]*.+ For bit-exact repeats, use a sim cache (§2.6).+- **Lit vs unlit sprites.**+ - Fire, embers, sparks, CRT glow: **unlit**, additive or translucent, emissive only.+ - Steam, smoke, haze, dust, rain: **lit translucent**. Use *Translucency Lighting Mode = Volumetric NonDirectional*+ (cheapest, soft) or *Volumetric PerVertex NonDirectional*. The directional modes only matter for normal-mapped+ smoke.+ - Prefer Masked over Translucent where blending allows (drops, chunky debris).+ - Translucent materials need **Two Sided** when seen from both sides.+ - Each material needs the usage flag for its renderer: `MaterialEditingLibrary.set_material_usage(mat,+ unreal.MaterialUsage.MATUSAGE_NIAGARA_SPRITES)`. In 5.8 the `bUsedWith*` flags are deprecated in favour of the+ usage accessor *[engine: Material.h:749]*.+- **Lumen.**+ - Particles do not contribute to Lumen GI or reflections as emitters: a fire sprite lights nothing. Light comes from+ a real light (§3, Lighting).+ - Lit translucent particles receive Lumen GI through the low-resolution translucency lighting volume, so expect+ soft, slightly flat shading.+ - Emissive particles are not in the Lumen scene: they will not show in reflections the way Cycles shows them.+- **Volumetric fog.**+ - A sprite with a **Volume-domain material** injects albedo, emissive and extinction into the volumetric-fog froxel+ grid. This gives real 3D density with no billboard edges *[docs: Volumetric Fog]*. Mesh renderers reject the Volume+ domain *[engine: NiagaraMeshRendererProperties.cpp:1380]*.+ - It needs an Exponential Height Fog with *Volumetric Fog* on, which the converter already spawns.+ - The grid is coarse and camera-aligned, so use it for haze plumes and soft steam bodies, not crisp wisps.+- **Translucency sorting.**+ - Within an emitter: `SortMode = ViewDepth` on the sprite renderer. Leave it at `None` for additive fire and sparks;+ sorting costs GPU time.+ - Between components, sorting is by bounds centre. Fix wrong-order overlaps with the primitive property+ `translucency_sort_priority`, or by splitting the bounds.+- **Depth of field.** Translucent materials default to `TranslucencyPass = MTP_AfterDOF` *[engine: Material.cpp:1183]*,+ so out-of-focus steam stays sharp. For effects in defocused regions (foreground steam in `cam_wok`), set+ `TranslucencyPass = MTP_BeforeDOF` in the template material, or in a second material variant.++---++## 2. Placing and driving Niagara from Python, headless++### 2.1 Confirmed API (UE 5.8, from `NiagaraComponent.h`, `NiagaraActor.h`, `NiagaraFunctionLibrary.h`)++| Need | Call |+|---|---|+| Place | `eas.spawn_actor_from_class(unreal.NiagaraActor, loc, rot)`. Same reason as `spawn_mesh()` in `build_level.py`: spawn by class in the commandlet |+| Component | `act.get_editor_property("niagara_component")` (UPROPERTY `NiagaraComponent`) |+| Set asset | `nc.set_asset(system, True)`. The second arg resets existing overrides: set the asset **first**, then the parameters |+| Float, int, bool | `nc.set_variable_float(name, v)`, `set_variable_int`, `set_variable_bool` |+| Vector, colour | `set_variable_vec3(name, unreal.Vector)`, `set_variable_vec2`, `set_variable_vec4`, `set_variable_linear_color(name, unreal.LinearColor)`, `set_variable_quat` |+| Position (LWC) | `set_variable_position(name, unreal.Vector)` |+| Objects | `set_variable_texture`, `set_variable_material`, `set_variable_static_mesh`, `set_variable_object`, `set_variable_actor` |+| Read back (verify) | `get_variable_float(name)` and the like. In Python these return `(value, is_valid)`; assert `is_valid` |+| Seed | `nc.set_random_seed_offset(int)` |+| Bounds | `nc.set_system_fixed_bounds(unreal.Box)`, `set_emitter_fixed_bounds(emitter_name, box)`; read back with `get_system_fixed_bounds()` |+| Warm-up | `nc.set_editor_property("override_warmup_settings", True)`, `("warmup_tick_count", n)`, `("warmup_tick_delta", dt)` |+| Scalability | `nc.set_allow_scalability(False)`. Cinematic renders must not be distance-culled by an Effect Type |+| Sequencer age | `set_age_update_mode(unreal.NiagaraAgeUpdateMode.DESIRED_AGE_NO_SEEK)`, `set_desired_age(t)`, `seek_to_desired_age(t)` |+| Manual sim | `advance_simulation(ticks, dt)`, `advance_simulation_by_time(seconds, dt)`, `reset_system()`, `reinitialize_system()` |+| Sim cache | `set_sim_cache(cache, reset)`. Capture with `NiagaraSimCacheFunctionLibrary.capture_niagara_sim_cache_immediate(...)` |+| Runtime spawn | `unreal.NiagaraFunctionLibrary.spawn_system_at_location(world, system, loc, rot, scale, auto_destroy, auto_activate, pool, precull)`. Do not use it for level building: it is a transient runtime spawn |++Python names are the snake_case form of the C++ names, with a property's `b` prefix dropped. No stub exists yet+(`Intermediate/PythonStub/unreal.py` is generated only with Developer Mode on). On first use, run+`dir(unreal.NiagaraComponent)` in the build log and fix any name that differs.++### 2.2 Placement snippet (goes into a `stage_fx()` in `build_level.py`)++```python+NS = {}+def fx_system(path):+ if path not in NS:+ NS[path] = unreal.load_asset(path)+ if NS[path] is None:+ warn(f"fx template missing: {path}")+ return NS[path]++def place_fx(eas, fx):+ sysasset = fx_system(fx["template"])+ if sysasset is None:+ return None+ q = fx["transform"]["quat"]+ act = eas.spawn_actor_from_class(unreal.NiagaraActor, V(fx["transform"]["loc"]),+ unreal.Quat(*q).rotator())+ act.set_actor_label("FX_" + fx["id"]); act.set_folder_path("FX")+ nc = act.get_editor_property("niagara_component")+ nc.set_asset(sysasset, True) # 1. asset first (resets overrides)+ for k, v in fx["params"].items(): # 2. typed user params+ t = fx["param_types"][k]+ if t == "float": nc.set_variable_float(k, float(v))+ elif t == "int": nc.set_variable_int(k, int(v))+ elif t == "bool": nc.set_variable_bool(k, bool(v))+ elif t == "vec3": nc.set_variable_vec3(k, V(v))+ elif t == "pos": nc.set_variable_position(k, V(v))+ elif t == "color": nc.set_variable_linear_color(k, unreal.LinearColor(*v[:3], v[3] if len(v) > 3 else 1))+ nc.set_random_seed_offset(fx["seed"]) # 3. determinism+ b = unreal.Box(); b.min = V(fx["bounds_local"]["min"]); b.max = V(fx["bounds_local"]["max"]); b.is_valid = True+ nc.set_system_fixed_bounds(b) # 4. bounds (local)+ nc.set_editor_property("override_warmup_settings", True) # 5. pre-roll+ nc.set_editor_property("warmup_tick_delta", 1.0 / 30.0)+ nc.set_editor_property("warmup_tick_count", int(math.ceil(fx["time"]["preroll_s"] * 30)))+ nc.set_allow_scalability(False)+ for k, t in fx["param_types"].items(): # 6. verify: silent no-ops are the main failure+ if t == "float":+ val, ok = nc.get_variable_float(k)+ if not ok: warn(f"{fx['id']}: user param {k} not on {fx['template']}")+ return act+```+Then call `les.save_current_level()`, as `stage_level` already does. Construct `unreal.Box` the way above, or with+keyword args. Check the result with `get_system_fixed_bounds()`.++### 2.3 Commandlet (`-run=pythonscript`) limits++- **Commandlets render nothing.** A commandlet uses the null RHI unless it is started with `-AllowCommandletRendering`+ (`LaunchEngineLoop.cpp:2246`) *[engine]*.+ - These need no RHI and work in the commandlet: placing actors, setting user parameters, fixed bounds, warm-up+ fields, seeds, and saving.+ - GPU emitters do not simulate there, and their compute shaders are not exercised.+ - Niagara VM script compilation is a DDC/ShaderCompileWorker job. It works from a commandlet, as cooking proves.+ Ship the templates **pre-compiled and saved** in the AnySceneFX plugin, so a fresh build only loads them.+- **The first render compiles shaders.** GPU sim shaders and particle material shaders compile on the first+ `-game -RenderOffscreen` run.+ - Pass `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Budget a one-off cold-DDC compile of about 2-5 minutes per new template set. Keep the DDC on persistent storage+ (`/data`) in the container.+- **Don't author Niagara graphs in the commandlet.** `UNiagaraSystemFactoryNew` exposes no Python properties.+ `EditorAssetLibrary.duplicate_asset()` works for "copy a template and tweak it", but tweaking stack inputs needs+ the NiagaraToolsets editor functions, which expect a full editor. Per-scene variation goes through user parameters,+ not new assets.+- **Plugins.** Niagara is on by default. If you use NiagaraFluids (Beta), NiagaraSimCaching or NiagaraMRQ, enable them+ in `AnySceneUE.uproject` (`"Plugins"`) **before** the build. Enabling a plugin mid-session needs a restart.++### 2.4 MRQ settings for particles (the `MRQ_Still` / `MRQ_Linear` configs in `stage_sequences`)++- `MoviePipelineAntiAliasingSetting`:+ - `engine_warm_up_count = 64`: game-thread ticks with no render; the cheap warm-up.+ - `render_warm_up_frames = True`: required for GPU particles, depth-buffer collision and GPU warm-up.+ - `use_camera_cut_for_warm_up = False`.+ - `temporal_sample_count = 8`: Niagara ticks once per temporal sub-sample, so the accumulation itself gives sprite+ motion blur.+ - Raise `engine_warm_up_count` to `ceil(max_lifetime_s x fps x 1.5)` when the scene's longest lifetime exceeds+ 64/24 s, for example slow steam with 6 s lifetimes.+- **Fixed timestep.** MRQ always steps the world at the sequence rate. Particle state is a pure function of frames+ since activation plus the seed, so the warm-up count must be identical between runs.+- **Pre-roll belongs in the asset or component.** Component warm-up (§2.2) runs on activation, before any MRQ frame.+ Use both component warm-up and MRQ engine warm-up: the first covers steady state, the second covers shader compile+ and streaming.+- `MoviePipelineGameOverrideSetting` (already added) forces cinematic scalability. Also call `set_allow_scalability(False)`+ on every component so Effect Type culling can't drop an effect.+- **Sequencer track (optional, for exact scrubbing).** Add a Niagara System track to the camera's level sequence,+ with a spawn section set to `SectionEvaluateBehavior = ActivateIfInactive` and+ `AgeUpdateMode = DesiredAgeNoSeek`. Age then follows sequence time instead of wall-clock ticks+ (`MovieSceneNiagaraSystemSpawnSection.h`) *[engine]*. Only do this if stills differ between runs.+- **NiagaraMRQ plugin.** It adds a data interface that tells a system whether MRQ is running, plus the temporal sample+ index and count. Use it only if a template must branch for offline quality, for example more particles under MRQ.++### 2.5 Light and screen flicker (not Niagara)++- **Flickering lights.** HK `wok_fire_*` uses a Python driver on `energy`.+ - Do not parse driver expressions. **Sample** the evaluated value per frame in the exporter: `frame_set(f)`, read+ `L.energy` for frames `[start, start+N)`.+ - Write `flicker.values` and key a Sequencer float track on the light's `intensity`, in the camera sequence.+ - Rendered through MRQ, this is deterministic and frame-exact.+- **CRT, screen and sign flicker.** Use a material, not Niagara.+ - Add `FlickerAmp`, `FlickerHz` and `ScanlineDensity` scalar parameters to `M_AnyBaked`'s emissive path, or to a+ dedicated `M_AnyScreen` master: emissive x (1 + amp x noise(time x Hz)), plus a rolling bar.+ - The source is `animated_materials` in the asset entry. Sample the emission strength curve the same way as lights.++### 2.6 When exact repeatability matters: sim caches++Capture the steady-state window once and assign it with `set_sim_cache`. Playback is then identical every run. Use+`capture_niagara_sim_cache_immediate` / `..._multi_frame` from `NiagaraSimCacheFunctionLibrary` in an editor session+with an RHI, or record with a Niagara Cache track in Sequencer (plugin `NiagaraSimCaching`). Only needed for hero+shots and A/B parameter tuning, where seed noise would hide a parameter change.++---++## 3. The template library (`/AnySceneFX/`)++Build these as a content plugin, `Plugins/AnySceneFX/Content/Systems/NS_*.uasset`, authored once and committed.++**Shared rules for every template.**+- `bDeterminism` on, at system and emitter level.+- Fixed bounds mode.+- World space, not local.+- Warm-up 0 in the asset. The converter sets it per instance.+- Every tunable is a `User.` parameter with a real-world default (cm, cm/s, s, nits, K).++**Common user parameters**, the same names in every system so the placement code stays generic:++| Name | Type | Meaning |+|---|---|---|+| `SpawnRate` | float | particles per second (or `Count` for bursts) |+| `LifetimeMin`, `LifetimeMax` | float | seconds |+| `SizeMin`, `SizeMax` | float | sprite size, cm |+| `Velocity` | vec3 | initial velocity, cm/s, world |+| `VelocityJitter` | float | 0..1 fraction (Blender `factor_random`) |+| `Wind` | vec3 | constant drift, cm/s |+| `Gravity` | float | 0..1 x 980 cm/s² |+| `BoxExtent` | vec3 | spawn box half-extent, cm (spawn shape = local box) |+| `Color` | color | albedo (lit) or emissive tint (unlit) |+| `Intensity` | float | emissive luminance multiplier, nits |+| `Opacity` | float | per-sprite peak alpha |+| `Temperature` | float | K, feeds a material `BlackBody` node (fire, embers) |+| `NoiseStrength`, `NoiseFreq` | float | curl-noise force amplitude and frequency |++The seed is not a parameter: it is the component's `RandomSeedOffset`.++**Starting assets that ship with 5.8.** These are mount paths. The engine plugin `/Niagara/` lives at+`Engine/Plugins/FX/Niagara/Content/`, and `/NiagaraFluids/` at `Engine/Plugins/FX/NiagaraFluids/Content/`.++- Emitters: `/Niagara/DefaultAssets/Templates/Emitters/{Fountain, HangingParticulates, RecycleParticlesInView,+ BlowingParticles, DirectionalBurst, OmnidirectionalBurst, SimpleSpriteBurst, SingleLoopingParticle, Minimal,+ UpwardMeshBurst, LocationBasedRibbon, StaticBeam, DynamicBeam, ConfettiBurst}`+- Systems: `/Niagara/DefaultAssets/Templates/Systems/{FountainLightweight, DirectionalBurst, RadialBurst,+ SimpleExplosion, MinimalLightweight, ...}`. The `*Lightweight` systems use stateless emitters, which the Niagara+ toolset cannot edit. Copy the stateful emitters instead.+- Behaviour examples (reference wiring): `/Niagara/DefaultAssets/Templates/BehaviorExamples/{SubUVAnimation,+ SpriteFacingAndAlignment, KillParticles, ...}`+- Fluids (Beta): `/NiagaraFluids/Templates/Gas/3D/Systems/{Grid3D_Gas_Fire, Grid3D_Gas_Smoke, Grid3D_Gas_ColoredFire,+ Grid3D_Gas_ColoredSmoke, Grid3D_MovingGridFire, Grid3D_Gas_Explosion}`, `.../Gas/2D/Systems/{Grid2D_Gas_SmokeFire,+ Grid2D_Gas_Smoke, Grid2D_Gas_MovingFire}`, `/NiagaraFluids/Templates/Liquid/3D/Systems/{Grid3D_Flip_Hose,+ Grid3D_Flip_Splash, Grid3D_Flip_Pool}`; materials `/NiagaraFluids/Materials/Grid3D/M_RayMarch_Fire*`,+ `MI_HeterogeneousVolumes_*`.+- Default sprite materials: `/Niagara/DefaultAssets/DefaultSpriteMaterial`, `M_DepthFade_SpriteSimple`.++**Units used in the mappings below.**+- Blender is metres, the exporter writes centimetres, and Blender axes map to Unreal as (x, -y, z).+- Volume density σ is extinction per metre. Volume emission strength *E* adds radiance per metre, so a slab of+ thickness *t* m that is optically thin glows at about *E·t* (Blender radiance units) = **683·E·t nits**. This is the+ same 683 lm/W the exporter uses for surfaces.+- **Sprite opacity from density.** For a plume of depth *L* (m) seen through *n* overlapping sprites, the target+ optical depth is τ = σ·L. Per-sprite α = 1 − exp(−τ/n). Estimate *n* ≈ SpawnRate × Lifetime × (sprite area ÷+ plume cross-section area).++### 3.1 Per-effect table++| Effect | AnySceneFX system, and how to start it | Key parameter mapping from Blender | Lighting | Real-time budget |+|---|---|---|---|---|+| **Fire / flames** (gas jets, wok, candles, braziers) | `NS_Fire`. Start from `SingleLoopingParticle` + `Fountain` (stateful copies). Two emitters: (a) a **SubUV flame** emitter with a flipbook **baked from the Blender flame volume** (§5.1), unlit additive, random start frame, `bSubImageBlend`; (b) a small blue-core emitter. Hero close-ups: `Grid3D_Gas_Fire` or an SVT (§5) | Domain box → `BoxExtent` and the emitter ring radius. Principled Volume `Emission Strength` x density-ramp peak x thickness → `Intensity` (683·E·t nits). `Emission Color` ramp at 0.6 → `Color`, or `Blackbody Intensity`/`Temperature` → `Temperature`. Flame height (density falloff z) → `Velocity.z` x Lifetime. Noise scroll rate (driver `frame*k`) → flipbook fps | Fire itself lights nothing. **Reuse the Blender practical lights** (`wok_fire_*`, `wok_blue_*` convert already) with the sampled flicker track (§2.5). If the scene has no light, add one CPU emitter with a Light renderer: one particle, `RadiusScale` ≈ flame height x 4, `bAffectsTranslucency` on. Cap: ≤ 4 Niagara lights per scene, ≤ 1 per fire | ≤ 40 sprites per flame, about 0.1 ms. Fluids fire: 1-3 ms at 64³; cinematic only |+| **Steam** (woks, pots, kettles, vents) | `NS_Steam`. Start from `Fountain`. GPU sprites, lit translucent (Volumetric NonDirectional), soft puff texture or a baked steam flipbook, curl noise, size grows x3-5 over life, alpha fades in and out. Add a second **Volume-domain sprite** emitter (§1) for the dense core when volumetric fog is on | Plume box (HK `steam_wok_i`: bottom z = wok rim, top = awning): base disc radius = 0.08 x box width → `BoxExtent`; `rise` (driver `-frame*rise`, m/frame) x fps x 100 → `Velocity.z`; `lean` → `Wind`. Lifetime = box height ÷ rise speed. Density `strength` x 9 (shader constant) = σ peak → `Opacity` by the formula above. `Color` 0.9 grey, anisotropy 0.5 → material phase (backlit glow: enable forward scatter in the material, or rely on volumetric fog) | Lit by scene lights. Needs the practical light behind it to read (HK hood strip, bulbs). `TranslucencyPass = BeforeDOF` for foreground plumes | 200-600 sprites per plume, 0.2-0.5 ms (overdraw-bound) |+| **Smoke** (cigarette curls, exhaust, chimneys) | `NS_Smoke` = `NS_Steam` with a darker albedo, slower rise and a longer life. Thin curls: a **ribbon** emitter (`LocationBasedRibbon`) with curl noise reads better than sprites | MC `smoke_curl_*`: box 0.18 x 0.18 x 0.75 m, noise scroll `-frame*0.012` → `Velocity.z` = 0.012 x fps x 100 cm/s; density 6 → ribbon width 0.5-1 cm, `Opacity` 0.3. Albedo (0.82, 0.8, 0.76) → `Color` | Lit translucent | ribbons: ≤ 3 per curl, negligible |+| **Haze plume / room haze** | Usually **not Niagara**. Homogeneous layers → Exponential Height Fog + Local Fog Volumes (§5.3). Moving plumes (street haze drifting under a light) → `NS_HazePlume`: a few big Volume-domain sprites (2-6 m) | Haze box σ → height fog density (existing code). Local plume: `RadialFogExtinction` = σ x diameter (m) (§0.2). Albedo, anisotropy → `fog_albedo`, `fog_phase_g`. Noise drift → `Wind` | Volumetric fog lighting only. Lights need `volumetric_scattering_intensity` > 0 (already mapped from Blender `visible_volume_scatter`) | LFV about 0.05 ms each; volume sprites 0.3 ms |+| **Rain / drizzle** | `NS_Rain`. Start from `RecycleParticlesInView` (keeps the rain around the camera) or a plain box-spawn GPU emitter. Velocity-aligned sprites (`Alignment = VelocityAligned`), streak length = speed x shutter, masked or translucent, `PixelCoverageMode` Automatic (sub-pixel streaks flicker under TSR otherwise) | Particle settings: `count`, `lifetime`, `frame_start/end` → `SpawnRate = count / (frame_end − frame_start) x fps`; `object_align_factor` (m/s) x 100 → `Velocity` (Blender (x,y,z) → (x,−y,z)); `factor_random` → `VelocityJitter`; emitter object box → `BoxExtent` + transform; instance-object radius x 2 → sprite width (≥ 0.15 cm, or it vanishes), length → streak length; drop material emission 0.5 / alpha 0.35 → `Intensity`, `Opacity` | Lit translucent or unlit with a faint emissive. Rain reads by **backlight**: check it against the street lights in the Cycles frames | GPU, 10k-40k alive, 0.3-0.8 ms |+| **Drips / splashes** | `NS_Drips`: GPU sprites spawned on a line (awning edge) under gravity, killed at the ground plane, plus an **event-free** splash: a second emitter spawned at the computed impact height with `DirectionalBurst`-style spray, or a splash flipbook. Ground ripples: decal flipbook or a puddle material, not particles | `awning_drips`: emitter box (thin strip) → spawn line; `count/span` → `SpawnRate`; `gravity` 1 → `Gravity` = 1; drop size → sprite size; ground z → `KillHeight` (extra user param) | Lit translucent drops; splash unlit-ish | ≤ 200 drops, ≤ 1k spray, about 0.1 ms |+| **Sparks / embers** | `NS_Sparks`: `Fountain` + velocity-aligned additive sprites, gravity, drag, short life. `NS_Embers`: slow buoyant glowing points with curl noise, long life | Particle `velocity`/`normal_factor` → `Velocity`; lifetime → Lifetime; emission colour or temperature → `Temperature` (material BlackBody) and `Intensity` = 683 x strength | Unlit additive; never a light per spark. One Light-renderer particle for a whole shower at most | ≤ 2k, 0.1-0.2 ms |+| **Dust motes** | `NS_DustMotes`: start from `HangingParticulates`. Tiny lit sprites, near-zero velocity, curl-noise drift; only visible inside light shafts, so lit translucent with a strong forward-scatter look | Blender dust particles: count over box volume → density per m³; `SpawnRate` keeps the alive count = count; size 0.05-0.2 cm; box → `BoxExtent` | Lit; needs a shaft light (spot or sun) in the frame | ≤ 3k, 0.1 ms |+| **Fountain water jets** | `NS_FountainJet`: start from `Fountain`, GPU, velocity-aligned stretched sprites + a mist emitter; for hero pools use `Grid3D_Flip_Hose` (Beta, expensive) | Nozzle object → position + direction; jet apex height *h* → `Velocity` = sqrt(2·980·h) cm/s along the nozzle; flow rate → `SpawnRate`; spread → `VelocityJitter` | Lit translucent with high specular-looking emissive edge; check against Cycles highlights | 5k-20k, 0.5 ms; FLIP 3-8 ms |+| **Screen / CRT / light flicker** | Material parameters + Sequencer tracks (§2.5). No Niagara | Sampled emission or energy curves | n/a | ~0 |++Fire, steam and smoke can borrow the **flipbook-from-Blender** path (§5.1). The look then comes from the exact Cycles+shader, and Niagara only supplies motion, variety and parallax.++### 3.2 Authoring the templates once++1. Use a full editor on a GPU box, with `NiagaraToolsets` + `ToolsetRegistry` enabled (Experimental).+2. Discover tool names with `unreal.ToolsetRegistry.get_all_toolset_json_schemas()`.+3. Per template:+ - `CreateNiagaraSystem` from an empty or minimal system;+ - `AddEmitter(<emitter template above>)`;+ - `AddUserVariables(...)`, using the shared parameter names;+ - `SetStackInputData` to link module inputs to the `User.` parameters;+ - `SetRendererData` for alignment, SubUV and sort settings;+ - `SetSystemData` for determinism and fixed bounds.+4. Then call `GetSystemCompileState` and `GetStackIssues`, and fix every error. Epic's own skill text says errors only+ surface once the system has compiled in the editor.+5. A human pass in the Niagara editor is fine as well. The contract is only the user-parameter list above.+6. Save, commit the plugin, and record each system's parameter list in `Plugins/AnySceneFX/templates.json`+ (`{"NS_Steam": {"SpawnRate": "float", ...}}`). The converter reads `param_types` from that file.++---++## 4. Detection rules and the `scene.json` `fx` schema++### 4.1 Classifying Blender effects (exporter side)++Walk every renderable object. A hit gets an `fx` entry and is **not** also exported as a mesh or an LFV, unless+§5 picks the LFV technique. Score each candidate type with the evidence below, take the highest score, and set+`confidence` = top score ÷ (top + runner-up).++| Evidence | Where | Points toward |+|---|---|---|+| Material is volume-only (`is_volume_only`) with `PRINCIPLED_VOLUME` | material | a volume type (steam / smoke / haze / fire) |+| Principled Volume `Emission Strength` > 0, or linked, or `Blackbody Intensity` > 0, or a `BLACKBODY` node, or a `VALTORGB` ramp into Emission Color with orange-to-blue stops | node tree | **fire** |+| Volume with emission 0, albedo > 0.85 grey, density driven by noise + a mapping driver on Z (`-frame*k`) | node tree + drivers | **steam** (k fast, under a hot object) or **smoke** (albedo < 0.85, or name) |+| Volume with no `TEX_NOISE` or a constant density, box > 3 m on its long axis | node tree + size | **haze** (→ fog, §5.3) |+| Volume with noise but drift ≤ 0.002 m/frame and large box | node tree | **haze plume** |+| `FLUID` modifier `DOMAIN`, `domain_type GAS`, cache in OPENVDB | modifier | steam / smoke / fire by `flow_type` of the FLOW objects (`SMOKE`, `FIRE`, `BOTH`) → prefer **SVT** (§5.2) |+| `FLUID` DOMAIN `LIQUID` | modifier | fountain or splash (mesh cache → Alembic or FLIP; flag it for agent review) |+| `VOLUME` object (VDB file) | object type | SVT direct import |+| `PARTICLE_SYSTEM` with `physics_type NEWTON`, `rotation_mode VEL`, velocity mostly −Z ≥ 3 m/s, small elongated instance | particle settings | **rain** |+| … same, slow (< 1 m/s) along −Z, `effector_weights.gravity` ≈ 1, emitter is a thin strip | particle settings | **drips** |+| particles with gravity, short life (< 1.5 s), emissive instance material | settings + material | **sparks** |+| particles with emissive instance, upward velocity, long life | | **embers** |+| particles with ~0 velocity, gravity 0, tiny instance, box emitter | | **dust motes** |+| particles from a small emitter with upward velocity cone, gravity 1, water-like instance (transmission or low roughness) | | **fountain** |+| `NODES` modifier whose tree contains `DISTRIBUTE_POINTS_IN_VOLUME`/`ON_FACES` + `INSTANCE_ON_POINTS` and a `SCENE_TIME` input driving `SET_POSITION` | geometry nodes | rain, dust or drips by the same velocity rules. Sample point positions at two frames to get the velocity |+| Material with drivers/keys on Emission Strength or Color, on a mesh that is a screen (prop name `screen`, `crt`, `monitor`, `tv`, `display`, `sign`) | `animated_materials` | **screen flicker** |+| Light with driver/action on `energy`/`color` | `light_entry.animated` | **light flicker** (sample the curve) |+| Object or material **name** contains a type word (`steam`, `vapor`, `smoke`, `curl`, `haze`, `fog`, `mist`, `flame`, `fire`, `ember`, `spark`, `rain`, `drizzle`, `drip`, `splash`, `dust`, `mote`, `fountain`, `jet`, `flicker`) | names | +2 to that type (tie-breaker, never sufficient alone) |++Also export, per entry:+- `bounds_ue`;+- the emitter shape (box, disc or line from the object's evaluated mesh bounds);+- `preroll_s` from `frame_start < 0` or the fluid `cache_frame_start`;+- the cameras whose frustum contains the bounds;+- the nearest light within 1 m (`light_link`), so fire never double-lights.++For procedural volumes, keep `sample_volume()` but take **8-16 slices**, not 4. Also measure the drift speed by+diffing the mapping-node location driver between two frames, and write the `params` directly.++### 4.2 Schema (JSON Schema 2020-12) for `scene.json → "fx"`++```json+{+ "$id": "anyscene/fx.schema.json",+ "type": "array",+ "items": {+ "type": "object",+ "required": ["id", "type", "confidence", "source", "transform", "bounds_ue", "technique", "params", "time", "seed"],+ "properties": {+ "id": {"type": "string", "pattern": "^[A-Za-z0-9_]+$"},+ "type": {"enum": ["fire", "steam", "smoke", "haze", "haze_plume", "rain", "drips", "splash", "sparks",+ "embers", "dust", "fountain", "screen_flicker", "light_flicker", "unknown"]},+ "confidence": {"type": "number", "minimum": 0, "maximum": 1},+ "source": {"type": "object", "required": ["kind", "objects"], "properties": {+ "kind": {"enum": ["volume_shader", "fluid_domain", "vdb", "particles", "geonodes",+ "animated_emission", "animated_light"]},+ "objects": {"type": "array", "items": {"type": "string"}},+ "material": {"type": ["string", "null"]},+ "evidence": {"type": "array", "items": {"type": "string"}}}},+ "transform": {"type": "object", "required": ["loc", "quat"], "properties": {+ "loc": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3},+ "quat": {"type": "array", "items": {"type": "number"}, "minItems": 4, "maxItems": 4},+ "scale": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3}}},+ "bounds_ue": {"type": "object", "required": ["center", "extent"], "properties": {+ "center": {"type": "array", "items": {"type": "number"}}, "extent": {"type": "array", "items": {"type": "number"}}}},+ "bounds_local": {"type": "object", "properties": {"min": {"type": "array"}, "max": {"type": "array"}}},+ "emitter_shape": {"type": "object", "properties": {+ "kind": {"enum": ["box", "disc", "ring", "line", "plane", "point", "mesh"]},+ "extent_cm": {"type": "array", "items": {"type": "number"}},+ "normal": {"type": "array", "items": {"type": "number"}}}},+ "technique": {"enum": ["niagara", "niagara_flipbook", "niagara_volume_sprite", "svt", "local_fog",+ "height_fog", "material", "sequencer_curve", "skip"]},+ "template": {"type": ["string", "null"], "description": "UE object path, e.g. /AnySceneFX/Systems/NS_Steam.NS_Steam"},+ "params": {"type": "object", "additionalProperties": {"type": ["number", "boolean", "array"]}},+ "param_types": {"type": "object", "additionalProperties": {"enum": ["float", "int", "bool", "vec3", "pos", "color"]}},+ "physical": {"type": "object", "description": "raw Blender-side measurements kept for the look-match pass",+ "properties": {+ "density_per_m": {"type": "number"}, "optical_depth": {"type": "number"},+ "albedo": {"type": "array"}, "anisotropy": {"type": "number"},+ "emission_nits": {"type": "number"}, "emission_color": {"type": "array"}, "temperature_k": {"type": "number"},+ "count": {"type": "integer"}, "lifetime_s": {"type": "array"}, "velocity_cm_s": {"type": "array"},+ "velocity_jitter": {"type": "number"}, "gravity": {"type": "number"}, "size_cm": {"type": "array"},+ "drift_cm_s": {"type": "array"}, "noise_scale_cm": {"type": "number"}}},+ "time": {"type": "object", "required": ["preroll_s", "fps"], "properties": {+ "preroll_s": {"type": "number", "minimum": 0}, "fps": {"type": "number"},+ "start_frame": {"type": "integer"}, "end_frame": {"type": "integer"}, "animated": {"type": "boolean"}}},+ "seed": {"type": "integer", "minimum": 0},+ "flicker": {"type": "object", "properties": {+ "target": {"type": "string"}, "property": {"enum": ["intensity", "emissive_scale", "color"]},+ "fps": {"type": "number"}, "values": {"type": "array", "items": {"type": "number"}}}},+ "flipbook": {"type": "object", "properties": {+ "texture": {"type": "string"}, "grid": {"type": "array"}, "fps": {"type": "number"}, "emissive": {"type": "boolean"}}},+ "vdb": {"type": "object", "properties": {"files": {"type": "string"}, "grids": {"type": "array"}}},+ "cameras": {"type": "array", "items": {"type": "string"}},+ "light_link": {"type": ["string", "null"]},+ "notes": {"type": "array", "items": {"type": "string"}}+ }+ }+}+```+- Units: positions are UE centimetres; velocities are cm/s in UE axes; `extent` is a half-extent in cm; `seed` =+ `crc32(id)`.+- **Ownership.** The exporter fills everything except `technique`, `template` and `params`. A deterministic step+ (`fx_plan.py`, using the decision table in §5.4) fills those three, and the agent may override them.+- `build_level.py` gets a `stage_fx` that dispatches on `technique`. Keep the old `volumes` map for backward+ compatibility, but skip any volume an `fx` entry claims.++---++## 5. Alternatives when Niagara is not the right tool++### 5.1 Flipbooks (SubUV) rendered from the Blender volume++**Best for:** fire, steam puffs and smoke at mid-distance. The look *is* the Cycles shader, with zero tuning of+Niagara colour or density.++How to bake, in a Blender job on the scene copy:+1. Isolate the volume object. Use a transparent film (`film_transparent`) and an orthographic camera fitted to the+ bounds, facing the hero camera's azimuth.+2. Use a black world, plus a neutral key light if the effect is lit (steam). Emissive flames need no light.+3. Render *N* = 64 frames at the scene fps from a steady-state frame. Crossfade the last 16 into the first 16 for a+ loop.+4. Tile 8x8 at 256-512 px per cell. Write RGBA as EXR, or PNG with premultiplied alpha.+5. Export twice for lit effects: an emissive-only pass, and an albedo/alpha pass.+6. Unreal side: `SubImageSize` (8,8) on the sprite renderer, plus a SubUV Animation module whose renderer input+ points at that renderer. Get all three of these right: the grid, the module, and the renderer binding. Any one+ wrong fails **silently**.++Use a flipbook when the camera stays within about 30° of the bake view. Beyond that, sprites rotate visibly; use two+or three bakes at different azimuths, or SVT.++### 5.2 Heterogeneous volumes from VDB (SVT)++**Best for:** hero steam, smoke or fire seen up close or from moving cameras. This is the real 3D density and is the+closest match to Cycles.++**Mantaflow domains.** `cache_data_format = OPENVDB` already writes `cache/data/fluid_data_####.vdb`. Re-save only+the `density`, `flame` and `temperature` grids, or the default mapping packs velocity components into attributes B.++**Procedural shader volumes** (HK steam, MC curls):+1. Sample the material on a 3D grid. Extend `sample_volume` to bake Z slices at 64-128 slices.+2. For animation, repeat per frame for 48-96 frames.+3. Write `.vdb` with Blender's bundled `openvdb` module: `openvdb.FloatGrid`, `copyFromArray`,+ `openvdb.write(path, grids)`.+4. Name the grids `density`, plus `emission` or `temperature`.++**Import into Unreal.**+- Use an `AssetImportTask` on the first file of the numbered sequence. In a commandlet the factory takes the+ unattended path and imports the sequence as an **animated SVT**.+- Optionally pass a `UOpenVDBImportOptionsObject` as `task.options` to control the grid mapping.+- The `InterchangeOpenVDB` plugin is disabled by default. The legacy SVT factory does not need it.++**Render.**+- Spawn `unreal.HeterogeneousVolume`. Its `heterogeneous_volume_component` takes a Volume-domain material that samples+ the SVT (start from `/NiagaraFluids/Materials/Grid3D/Instances/MI_HeterogeneousVolumes_Basic`).+- Animation fields on the component: `frame`, `frame_rate`, `start_frame`, `end_frame`, playing and looping.+- Lighting fields: `step_factor`, `shadow_step_factor`, `lighting_downsample_factor`.+- Map Blender density σ (1/m) to material extinction: σ ÷ 100 per cm, if the material works in world units. Calibrate+ once against a Cycles render of a test cube.++**Cvars.**+- `r.HeterogeneousVolumes 1` (default on).+- `r.HeterogeneousVolumes.Shadows 0` by default: turn it on for self-shadowing steam.+- `r.HeterogeneousVolumes.IndirectLighting 0` by default.+- `r.HeterogeneousVolumes.MaxStepCount 512`.+- `r.HeterogeneousVolumes.Composition 0`: draws before translucency. All *[engine: HeterogeneousVolumes.cpp]*.++**Cost.** Several ms per volume at 1440p. Fine for MRQ, too heavy for a real-time budget unless+`DownsampleFactor` = 2.++### 5.3 Fog for haze++- **Room or street haze** (homogeneous layers, or a large box with gentle noise): Exponential Height Fog plus+ volumetric fog, as `build_level.py` already does.+- **Local layers** (MC ceiling layer, under-awning haze): Local Fog Volumes. Fix §0.2 as follows.+ - Scale = (max box half-extent in cm) ÷ 500.+ - It is a sphere: a long flat box needs several LFVs tiled along its long axis, or height-fog mode+ (`height_fog_extinction`, `height_fog_falloff`, `height_fog_offset`).+ - `radial_fog_extinction` = σ x 2r (m), the optical depth through the centre.+ - `fog_emissive` is luminance: σ_e x 683 nits.+- **Never use an LFV for a flame or a plume.** It cannot move, and its shape is a sphere.++### 5.4 Decision table (per effect)++| Type | Default technique | Use instead when |+|---|---|---|+| fire | `niagara_flipbook` (NS_Fire, flame baked from Blender) | close-up hero, camera moves around it, long shot → `svt` (bake VDB 64 frames) or `Grid3D_Gas_Fire`; tiny candle → unlit sprite, no flipbook |+| steam | `niagara` (NS_Steam lit sprites) + volume-sprite core if volumetric fog is on | Mantaflow cache present, or a hero close-up → `svt`; distant/static → `niagara_flipbook` |+| smoke | curls → `niagara` ribbons; plumes → as steam | — |+| haze | `height_fog` / `local_fog` | visible moving wisps in a light beam → `niagara_volume_sprite` |+| haze_plume | `niagara_volume_sprite` | static in all shots → `local_fog` (fixed size rule) |+| rain | `niagara` (NS_Rain) | only seen through glass far away → material streaks on a card |+| drips / splash | `niagara` (NS_Drips) | ground ripples → animated decal / puddle material |+| sparks / embers | `niagara` | — |+| dust | `niagara` (NS_DustMotes) | — |+| fountain | `niagara` (NS_FountainJet) | Mantaflow liquid cache → Alembic mesh sequence (outside this doc; flag it) |+| screen_flicker / light_flicker | `material` / `sequencer_curve` | — |++---++## 6. Verification loop: did the effect land?++1. **Build.** Run `stage_fx` and save. The build report records, per effect: id, technique, template, user params+ read back (`get_variable_*` valid flags), and fixed bounds read back. Any invalid param is an error, not a warning.+2. **Render.**+ - Render MRQ stills from **every camera in the effect's `cameras`**:+ `render_mrq.ps1 -Cams ...`, with `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Use the **same frame number** as the Cycles still: the exporter's `--frame`, minus the sequence start.+ - For motion, render 24-frame clips of the effect cameras (`custom_end_frame = 24`).+ - Render twice with identical settings to check determinism: the two images' absolute difference should be ~0+ outside the TSR noise floor.+3. **Compare against Cycles.**+ - Use `side_by_side.py`. Compare in the same view transform: use `MRQ_Linear` EXR + Blender AgX, as the pipeline+ already does.+ - For each effect, crop its projected `bounds_ue` box in both images, then compare:+ - **coverage**: the fraction of crop pixels changed vs a render with the effect hidden; render one "FX off"+ still per camera;+ - **mean luminance** and the **99th-percentile luminance** inside the crop, for emissive effects;+ - **contrast and transmission**: background visibility through steam or haze;+ - hue of emissive effects;+ - for rain, streak count, length and angle.+4. **What to look for.**+ - The effect missing entirely: compile, bounds culling, wrong asset, or warm-up.+ - Popping-in in clips: warm-up too short.+ - A box-shaped cut-off: fixed bounds too small.+ - Sharp steam in a blurred foreground: the TranslucencyPass.+ - Black or flat steam: unlit, or no light behind it.+ - Fire that lights nothing, or double lighting: `light_link`.+ - Rain invisible: sprite under a pixel, so check the `PixelCoverageMode` and the width floor.+ - Stepping between frames: the age mode.+ - A sphere-shaped haze blob: the LFV rule.+5. **Adjustment rules.** Change one parameter per round, at most three rounds per effect, and log each round in the+ build report.+ - Coverage too low → raise `SizeMax` first (x1.3), then `SpawnRate` (x1.5). Too high → the reverse order.+ - Too opaque or too faint at matched coverage → scale `Opacity` by `ln(1−T_cycles)/ln(1−T_ue)` (T =+ transmission).+ - Emissive brightness → scale `Intensity` by `L99_cycles / L99_ue`, clamped to x[0.25, 4] per round.+ - Wrong height or reach → `LifetimeMax` (plumes) or `Velocity.z`; keep `Velocity x Lifetime` = the measured Cycles+ reach.+ - Wrong lean → `Wind`.+ - Rain too dense or sparse → `SpawnRate` by the streak-count ratio; streaks too short → the stretch factor+ (speed x shutter), not velocity.+ - After three rounds without converging, switch technique (§5.4 "use instead") and note why in `notes`.++---++## 7. Known gotchas (with sources)++| Gotcha | Fix | Source |+|---|---|---|+| GPU particles absent or frozen in MRQ warm-up | `render_warm_up_frames = True`; engine warm-up alone doesn't run GPU sims | `MoviePipelineAntiAliasingSetting.h` tooltip *[engine]*; Epic MRQ docs |+| `engine_warm_up_count` ignored | `use_camera_cut_for_warm_up = False` (it's EditCondition-gated) | same header |+| Effect missing on the first frames of an offscreen run | `fx.Niagara.ForceWaitForCompilationOnActivate=1` + `Editor.AsyncAssetCompilation=0` | `NiagaraComponent.cpp:112, 1358` *[engine]*; `render_shots.py` notes |+| Nothing renders or compiles in `-run=pythonscript` | expected: null RHI unless `-AllowCommandletRendering`; render in the `-game` pass | `LaunchEngineLoop.cpp:2246` *[engine]* |+| User param silently ignored | exact name + exact type; read back with `get_variable_*` and check the valid flag; set the asset before params (`set_asset` resets overrides) | `NiagaraComponent.cpp:4376, 4620` *[engine]*; NiagaraToolsets `blueprint_interop` skill |+| Effect culled when its origin leaves the view | fixed bounds covering the whole travel; GPU emitters can't use dynamic bounds | `NiagaraSystem.h:1052`; NiagaraToolsets `optimization` skill |+| Effect dropped at distance or by budget | `set_allow_scalability(False)`; `MoviePipelineGameOverrideSetting` | `NiagaraComponent.h` *[engine]* |+| Different particles every run | system + emitter `bDeterminism`, a fixed `RandomSeedOffset`, fixed MRQ warm-up; sim cache for bit-exact results | `NiagaraSystem.h:1073-1085` *[engine]* |+| Translucent FX sharp in defocused areas | material `TranslucencyPass = MTP_BeforeDOF` (default is AfterDOF) | `Material.h:142`, `Material.cpp:1183` *[engine]* |+| Sprite motion blur smears or vanishes | rely on MRQ temporal samples (8); renderer `MotionVectorSetting` Precise for fast sparks, Disable for steam; post-process motion blur is off in the converter (`motion_blur_amount 0`) | `NiagaraRendererProperties.h:480` *[engine]* |+| Thin rain or sparks flicker or disappear under TSR | `PixelCoverageMode` Automatic (project setting enabled) and a width floor; velocity-aligned streaks | `NiagaraSpriteRendererProperties.h` *[engine]* |+| Fire doesn't light the set; Lumen ignores emissive sprites | real lights (Blender practicals or one Light-renderer particle); Niagara lights are CPU-only and shadowless unless MegaLights (`bAllowMegaLights`, `bMegaLightsCastShadows`) | `NiagaraLightRendererProperties.h:62-110` *[engine]*; NiagaraToolsets `renderers` skill |+| Particle lights invisible in fog | light needs volumetric scattering intensity > 0 | *[docs: Volumetric Fog]* |+| Lit translucency looks flat or blotchy | it's the translucency lighting volume; use Volumetric NonDirectional, keep sprites large and soft | Lumen translucency behaviour *[docs]* |+| SubUV shows the whole atlas | renderer `SubImageSize` + a SubUV module + its renderer binding | NiagaraToolsets `renderers` skill |+| Local fog volume 5x too big / spherical | base radius 500 cm; uniform max-axis scale; extinction = optical depth through the centre | `LocalFogVolumeComponent.h:74`, `LocalFogVolumeCommon.ush:178-203` *[engine]* |+| VDB import pops a dialog | not in a commandlet or with automated tasks; numbered files become an animated SVT | `SparseVolumeTextureFactory.cpp:436` *[engine]* |+| Blender motion blur on volumes | irrelevant in UE, but the Cycles reference frames have no volume blur (object blur off on volume boxes); don't add any in UE either | HK `fx.py`, `SKILL.md` §11 |++**Sources.**+- Installed engine files:+ - `Engine/Plugins/FX/Niagara/Source/Niagara/{Public/NiagaraComponent.h, Public/NiagaraActor.h,+ Public/NiagaraFunctionLibrary.h, Classes/NiagaraSystem.h, Classes/NiagaraEmitter.h,+ Public/NiagaraLightRendererProperties.h, Public/NiagaraSpriteRendererProperties.h, Public/NiagaraCommon.h,+ Public/MovieScene/MovieSceneNiagaraSystemSpawnSection.h, Classes/NiagaraSimCacheFunctionLibrary.h,+ Private/NiagaraComponent.cpp, Private/NiagaraSystemInstance.cpp}`+ - `Engine/Plugins/FX/{NiagaraFluids, NiagaraMRQ, NiagaraSimCaching}`+ - `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (tools + `Content/Python/skills`)+ - `Engine/Plugins/Experimental/ToolsetRegistry`+ - `Engine/Plugins/MovieScene/MovieRenderPipeline/.../MoviePipelineAntiAliasingSetting.h`+ - `Engine/Source/Runtime/Engine/Classes/Components/{HeterogeneousVolumeComponent.h, LocalFogVolumeComponent.h}`+ - `Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp`+ - `Engine/Shaders/Private/LocalFogVolumes/LocalFogVolumeCommon.ush`+ - `Engine/Source/Editor/SparseVolumeTexture/Private/SparseVolumeTextureFactory.cpp`+ - `Engine/Source/Runtime/Engine/Public/Materials/Material.h`+ - `Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp`+- Epic docs:+ - [Volumetric Fog](https://dev.epicgames.com/documentation/en-us/unreal-engine/volumetric-fog-in-unreal-engine)+ - [Rendering your Niagara systems (MRQ)](https://dev.epicgames.com/documentation/unreal-engine/rendering-your-niagara-systems)+ - [NiagaraMRQ API](https://dev.epicgames.com/documentation/unreal-engine/API/PluginIndex/NiagaraMRQ)+ - [MoviePipelineAntiAliasingSetting (Python API)](https://api.unrealengine.com/INT/PythonAPI/class/MoviePipelineAntiAliasingSetting.html)+- AnyScene:+ - `scenes/hk-dai-pai-dong/scripts/{fx.py, lights.py, steam.py}`, `NOTES.md`+ - `scenes/mission-control-1970s/scripts/haze.py`+ - `SKILL.md` §11, `builder/CRAFT.md`diff --git a/unreal_caustic/TOGGLE.md b/unreal_caustic/TOGGLE.mdnew file mode 100644index 0000000..ccde400--- /dev/null+++ b/unreal_caustic/TOGGLE.md@@ -0,0 +1,155 @@+# TOGGLE.md: an `unreal` option on `/ref2scene`, and `/scene2unreal`++Design note. Nothing here is implemented yet. It builds on `unreal/export_blend.py`, `unreal/build_level.py`,+`unreal/render_mrq.ps1`, `unreal/perf.ps1` and `unreal/NIAGARA.md`, and on `builder/app.py`+(`SceneBuilderApp`, `BuildRequest`, `_build_and_shoot`).++## 1. API++### 1a. Toggle on `/ref2scene` (and its `/build` alias)++Add one optional field to `BuildRequest`. Like `shots`, it stays **out of the build fingerprint** (`fp` in `_build`),+so one Blender build serves any number of Unreal conversions.++```python+class UnrealOptions(BaseModel):+ enabled: bool = Field(True, description="Convert the passed build into an Unreal 5.8 level.")+ cameras: list[str] = Field(default_factory=list, description="Cameras to render MRQ stills from (default: every scouting camera in shots.json).")+ fx: bool = Field(True, description="Port effects (flames, steam, rain, ...) per NIAGARA.md. False: static fog only.")+ look_match_rounds: int = Field(2, description="Agent look-match passes against the Cycles frames (0 = deterministic conversion only).")+ package: str = Field("plugin", description="plugin: a UE content plugin zip (drop into any 5.8 project). uproject: a full project zip. both.")+ still_res: list[int] = Field([1920, 1080], description="MRQ still resolution (W, H).")+ clip_frames: int = Field(0, description="Also render N-frame MRQ clips per camera (0 = stills only).")+ perf: bool = Field(True, description="Run the real-time perf capture (CSV profiler, GPU memory) at perf_res.")+ perf_res: list[int] = Field([2560, 1440])+ gpu_budget_ms: float = Field(16.6, description="Real-time frame budget the perf report grades against.")++class BuildRequest(BaseModel):+ ...+ unreal: UnrealOptions | None = Field(None, description="Optional: once the build passes its critic, convert it to Unreal.")+```++Add to `BuildResponse`: `unreal_job: dict | None`, holding status, `request_id` and an error if any, with the same+shape as `shots_job`. Add `unreal: UnrealResult | None` (§3).++### 1b. Standalone `/scene2unreal`++`SceneUnrealRequest = {build_id: str, **UnrealOptions, fresh: bool = False, effort: str = "medium"}`.+- It runs on any finished build in `/data/anyscene/builder/<build_id>`.+- It is retry-safe the same way `_build` is: an index keyed by `sha256(build_id + options)` and an `.alive`+ heartbeat.+- `/ref2scene` with `unreal` set calls it **after** `_build`, exactly like `_anyshot`.+- Run it as a **separate fal app** (`anyscene-unreal`) on a UE container. The builder image stays Blender-only, and+ the UE image (about 40 GB with DDC) only starts when someone asks for Unreal. The builder forwards the order with+ `fal_client` and relays the stage lines, as `call_anyshot` does.++## 2. What runs after the critic passes++The gate is the same as for shots: `res.critiques[-1]["passed"] and res.scene_blend_url`.++| # | Stage | Where | Deterministic? |+|---|---|---|---|+| 1 | **Export**: `blender -b <copy> --python export_blend.py -- --out exp/ --gpu --grade-sh ... --frame <hero frame>`, sharded (§5), then a merge pass writes `scene.json` incl. `fx` (NIAGARA.md §4) and the flipbook / VDB bakes the FX plan asks for | builder GPU worker (has Blender + OptiX cache) or the UE worker if Blender is installed there | yes |+| 2 | **FX plan**: `fx_plan.py` fills `technique / template / params` per `fx` entry from the NIAGARA.md decision table | either | yes (rules); entries with `confidence < 0.6` are queued for the agent |+| 3 | **UE build**: `UnrealEditor-Cmd AnySceneUE.uproject -run=pythonscript -script=build_level.py` (stages textures, meshes, materials, level, fx, sequences) on a **Linux GPU container** with the AnySceneFX plugin preinstalled and a persistent DDC on `/data` | UE worker | yes |+| 4 | **Shader warm**: one `-game -RenderOffscreen` run of the level with `fx.Niagara.ForceWaitForCompilationOnActivate=1` and `Editor.AsyncAssetCompilation=0` to fill the DDC (skipped when DDC is warm) | UE worker | yes |+| 5 | **MRQ stills** per camera (`MRQ_Still` + `MRQ_Linear`), plus clips if requested | UE worker | yes, given a fixed seed and warm-up |+| 6 | **Look-match pass** (agent): compare against the Cycles stills (`side_by_side.py`, crops per `fx` bounds, exposure, fog), adjust **parameters only** (exposure offset, fog density, FX user params, light scale) with the NIAGARA.md §6 rules, rebuild only the `level`/`fx` stages, re-render; `look_match_rounds` times | UE worker + Claude | agent-judged, logged as a param diff |+| 7 | **Perf**: `perf.ps1`-equivalent `-game -RenderOffscreen` with `csvprofile`, `nvidia-smi` sampling | UE worker | measured |+| 8 | **Package**: `Plugins/AnyScene_<build>/Content/...` (+ `.uplugin`) zip; optionally the whole `.uproject` minus `Intermediate/`, `Saved/`, `DerivedDataCache/` | UE worker | yes |++**Linux notes.**+- The Linux editor renders through Vulkan (SM6). `-RenderOffscreen` works without a display. Install the Vulkan ICD+ from the NVIDIA container toolkit (`NVIDIA_DRIVER_CAPABILITIES=all`, as the builder Dockerfile already sets).+- Lumen with hardware ray tracing on Vulkan needs a recent driver. Fall back to `r.Lumen.HardwareRayTracing 0` and+ record which mode the render used.+- Swap the Windows `.ps1` wrappers for Python `subprocess` callers. `render_mrq.ps1` and `perf.ps1` are thin.+- Validate on Linux once against the Windows reference box before trusting look-match numbers. Vulkan vs D3D12+ shading differences are small but non-zero. *[untested]*++## 3. Outputs (`UnrealResult`)++```json+{+ "package_url": "...AnyScene_b_xxxx_plugin.zip",+ "uproject_url": "... (optional)",+ "stills": [{"camera": "cam_street", "ue": "...png", "ue_linear": "...exr", "cycles": "...png", "side_by_side": "...png"}],+ "clips": [],+ "look_match": {"rounds": 2, "changes": [{"round": 1, "target": "fx:steam_wok_0", "param": "Opacity", "from": 0.12, "to": 0.18, "why": "transmission 0.71 vs 0.58"}]},+ "fx": [{"id": "steam_wok_0", "type": "steam", "technique": "niagara", "template": "/AnySceneFX/Systems/NS_Steam", "status": "ok"}],+ "perf": {"res": [2560, 1440], "gpu_ms_p50": 0, "gpu_ms_p95": 0, "frame_ms_p95": 0, "gpu_mem_delta_mb": 0, "draw_calls": 0, "verdict": "within budget|over budget"},+ "build_report": "...build_report.json",+ "warnings": [],+ "minutes": {"export": 0, "ue_build": 0, "mrq": 0, "look_match": 0, "total": 0}+}+```++## 4. Time and cost (from the HK run: 627 meshes)++| Stage | HK today (serial) | With §5 sharding | Notes |+|---|---|---|---|+| Blender export (bake + GLB) | ~35 min | ~6-9 min | about 3.3 s per unique mesh; scales with unique meshes, not instances |+| FX bakes (flipbooks / VDB) | n/a | +2-6 min | only for `niagara_flipbook` / `svt` entries; runs in parallel with the mesh shards |+| UE build (import + level) | ~15 min | ~10-15 min | import-bound; Interchange is already batched by 16; FX stage adds < 1 min |+| Shader warm (cold DDC) | ~3-5 min | 0-5 min | ~0 once `/data` DDC is warm for the templates and master materials |+| MRQ stills | ~1 min/still | ~1 min/still | 3 cameras x (1 + rounds) with rounds = 2 → 9 stills ≈ 9 min (or ~45 s each when batched in one process instead of one per camera) |+| Look-match agent | n/a | ~3-5 min/round of thinking + rebuild (`level,fx` stages ≈ 1-2 min) | |+| Perf capture | n/a | ~2 min | 900 frames + startup |+| **Total** | **~55 min + stills** | **~30-40 min** | |++**Cost** = GPU-minutes x the fal machine rate, plus agent tokens.+- GPU time is about 35 GPU-minutes on the parallel path.+- The export shards are CPU-heavy. Bakes can use `--gpu` (OptiX) on the builder's own GPU. Run the export on the+ builder worker that already holds the scene, and hand only `exp/` (GLBs + PNGs, roughly 1-3 GB for HK) to the UE+ app through `/data`.+- Agent tokens apply only to look-match rounds and to low-confidence FX entries: roughly one Claude session of about+ 15-30 tool calls per round.+- With `look_match_rounds = 0` the job is purely deterministic and costs only GPU time.++## 5. Parallelizing the slow export++The export is embarrassingly parallel per unique mesh. Bakes are independent, and existing outputs are skipped+(rerunnable).++1. **Plan pass.** One quick Blender process classifies the objects and writes `export_plan.json`: the list of asset+ keys with estimated bake pixels (area x density). It does no baking.+2. **Shards.** Run *N* Blender processes on copies of the `.blend`, each started with `--shard i/N`. This is a new+ flag: keep `keys[k]` where `k % N == i`, after sorting by estimated cost and dealing round-robin, so shards+ balance. Each shard bakes into the shared `tex/` and `mesh/` directories.+ - Today's `--reverse` and `--only` already show that two processes can share the folder safely.+ - Pick *N* = min(CPU cores ÷ 4, 8) for CPU bakes. With `--gpu`, run 2-3 processes per GPU, since OptiX bakes are+ short and the time goes into Blender overhead.+3. **Merge pass.** One process with `--no-bake`. Every texture and GLB already exists, so it only writes+ `scene.json`, lights, cameras, world, grade and `fx`. This also removes the partial-`scene.json` merge+ (`ONLY`/`LIMIT` branch) from the hot path.+4. **Cache across builds.** Key `tex/` and `mesh/` by a hash of (evaluated mesh data + material node trees + bake+ settings). The same prop library recurs across scenes, and a retry of `/scene2unreal` re-bakes nothing.+5. **FX bakes** (flipbook renders, VDB sampling) are extra shards, scheduled first because they are the longest+ single jobs.++The UE side can overlap with the export. Start texture import of finished shards while the others are still baking:+the `textures` stage is rerunnable and skips assets that exist. Mesh import order does not matter.++## 6. Deterministic vs agent-judged++**Deterministic.** Same input gives the same output, so these steps are cacheable and testable.+- Everything in `export_blend.py`, and the fx classification scores.+- `fx_plan.py` technique and parameter mapping (NIAGARA.md §3-5).+- `build_level.py`.+- Seeds: `RandomSeedOffset = crc32(fx id)`.+- Warm-up counts.+- MRQ settings.+- Packaging.+- Perf numbers (measured, so noisy within ±5%).++**Agent-judged.** Logged as explicit parameter diffs, bounded by `look_match_rounds`.+- Low-confidence fx classification (< 0.6), including `unknown` entries.+- Switching technique when a parameter-only match fails after three rounds (NIAGARA.md §6.5).+- Exposure and fog calibration offsets.+- FX user-parameter tuning.+- Light scale tweaks.+- The final "does it read like the Cycles frame" verdict, which goes into the response next to the side-by-sides.++**Rule.** The agent never edits `build_level.py`, `export_blend.py` or templates during a job. It writes overrides to+`exp/overrides.json`, which `build_level.py` applies on top of `scene.json`. A rerun with the same overrides+reproduces the agent's result exactly.diff --git a/unreal_caustic/agx_view.py b/unreal_caustic/agx_view.pynew file mode 100644index 0000000..870bf9e--- /dev/null+++ b/unreal_caustic/agx_view.py@@ -0,0 +1,19 @@+"""Apply a Blender view transform (default AgX + the scene's look) to Unreal scene-linear EXRs (MRQ_Linear output),+so UE and Cycles frames can be compared through the same tone mapper.+ blender -b --factory-startup --python agx_view.py -- <in.exr> <out.png> [look] [exposure]+"""+import sys+import bpy++a = sys.argv[sys.argv.index("--") + 1:]+src, dst = a[0], a[1]+look = a[2] if len(a) > 2 else "AgX - Medium High Contrast"+expo = float(a[3]) if len(a) > 3 else 0.0+sc = bpy.context.scene+sc.view_settings.view_transform = "AgX"+sc.view_settings.look = look+sc.view_settings.exposure = expo+sc.render.image_settings.file_format = "PNG"+img = bpy.data.images.load(src)+img.save_render(dst, scene=sc)+print("AGX", src, "->", dst, flush=True)diff --git a/unreal_caustic/build_level.py b/unreal_caustic/build_level.pynew file mode 100644index 0000000..7668193--- /dev/null+++ b/unreal_caustic/build_level.py@@ -0,0 +1,1107 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,sequences (default: all)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+MESH_BATCH = int(os.environ.get("ANYSCENE_MESH_BATCH", "16")) # Interchange imports in flight per wait (memory)+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ # 4K bakes: without a GC per chunk the commandlet held every imported texture and ran out of memory+ # (~550 of 796 on a 32 GB box shared with other editors).+ unreal.SystemLibrary.collect_garbage()+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ # A crash inside a chunk leaves imported textures without their settings: re-check the linear channels.+ fixed = 0+ lin = [(ch, tex_path(os.path.splitext(os.path.basename(rel))[0])) for a in ASSETS for ch, rel in a.get("tex", {}).items() if ch in ("orm", "normal")]+ for k, (ch, p) in enumerate(lin):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if not d.is_valid():+ continue+ tx = d.get_asset()+ if tx and tx.get_editor_property("srgb"):+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS if ch == "orm" else unreal.TextureCompressionSettings.TC_NORMALMAP)+ if ch == "normal":+ tx.set_editor_property("flip_green_channel", True)+ EAL.save_loaded_asset(tx, False)+ fixed += 1+ if k % 64 == 63:+ unreal.SystemLibrary.collect_garbage()+ if fixed:+ log(f"textures: fixed settings on {fixed} linear textures")+ stage_light_textures()+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++def gobo_tex_path(rel):+ return f"{DEST}/Gobo/{os.path.splitext(os.path.basename(rel.replace(chr(92), '/')))[0]}"+++def ies_path(rel):+ return f"{DEST}/IES/{os.path.splitext(os.path.basename(rel.replace(chr(92), '/')))[0]}"+++def stage_light_textures():+ """Gobo images (linear grayscale, wrapping) and IES profiles (TextureLightProfile) referenced by the lights."""+ gobos, ies = {}, {}+ for L in scene["lights"]:+ for lay in (L.get("gobo_fx") or {}).get("layers", []):+ gobos[gobo_tex_path(lay["image"])] = lay+ if L.get("ies_file"):+ ies[ies_path(L["ies_file"])] = L["ies_file"]+ todo = [os.path.join(EXPORT, lay["image"]) for p, lay in gobos.items() if not EAL.does_asset_exist(p)]+ if todo:+ import_files(todo, f"{DEST}/Gobo")+ for p, lay in gobos.items():+ tx = EAL.load_asset(p)+ if tx is None:+ warn(f"gobo import failed {lay['image']}")+ continue+ lin = lay.get("colorspace", "Non-Color") in ("Non-Color", "Linear Rec.709", "Raw")+ tx.set_editor_property("srgb", not lin)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_GRAYSCALE)+ wrap = unreal.TextureAddress.TA_WRAP if lay.get("extension", "REPEAT") == "REPEAT" else unreal.TextureAddress.TA_CLAMP+ tx.set_editor_property("address_x", wrap)+ tx.set_editor_property("address_y", wrap)+ tx.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_EFFECTS)+ EAL.save_loaded_asset(tx, False)+ todo = [os.path.join(EXPORT, f) for p, f in ies.items() if not EAL.does_asset_exist(p)]+ if todo:+ import_files(todo, f"{DEST}/IES")+ for p, f in ies.items():+ prof = EAL.load_asset(p) if EAL.does_asset_exist(p) else None+ if prof is None:+ warn(f"IES import failed {f}")+ continue+ EAL.save_loaded_asset(prof, False) # import tasks run with save=False+ log(f"light textures: {len(gobos)} gobo images, {len(ies)} IES profiles")+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % MESH_BATCH == MESH_BATCH - 1 or i == len(todo) - 1:+ flush(a)+ unreal.SystemLibrary.collect_garbage()+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked():+ path = f"{DEST}/Materials/M_AnyBaked"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyBaked", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_glass():+ path = f"{DEST}/Materials/M_AnyGlass"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGlass", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ c = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, -500, 0)+ c.set_editor_property("parameter_name", "Color")+ c.set_editor_property("default_value", unreal.LinearColor(1, 1, 1, 1))+ r = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 200)+ r.set_editor_property("parameter_name", "Roughness")+ r.set_editor_property("default_value", 0.05)+ o = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 350)+ o.set_editor_property("parameter_name", "Opacity")+ o.set_editor_property("default_value", 0.25)+ MEL.connect_material_property(c, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++GOBO_CH = ("LocX", "LocY", "Rot", "ScaleX", "ScaleY")+GOBO_KEYS = {"LocX": "loc_x", "LocY": "loc_y", "Rot": "rot", "ScaleX": "scale_x", "ScaleY": "scale_y"}+++def mpc_time():+ """Material parameter collection holding the gobo clock: GoboUseSeq = 0 -> real time (Time node + per-light+ TimeOffset); 1 -> GoboTime, keyed by the level sequences so MRQ frames land on the exact Blender frame."""+ path = f"{DEST}/Materials/MPC_AnyTime"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("MPC_AnyTime", f"{DEST}/Materials", unreal.MaterialParameterCollection, unreal.MaterialParameterCollectionFactoryNew())+ ps = []+ for n in ("GoboTime", "GoboUseSeq"):+ p = unreal.CollectionScalarParameter()+ p.set_editor_property("parameter_name", n)+ p.set_editor_property("default_value", 0.0)+ ps.append(p)+ m.set_editor_property("scalar_parameters", ps)+ EAL.save_loaded_asset(m, False)+ return m+++def master_gobo():+ """Light-function master for projected-texture (gobo) spots, matching Blender's TexCoord-Normal x/z, y/z+ projector: two texture layers, each with Mapping location / Z rotation / scale animated as+ c0 + v t + A1 sin(2 pi f1 t + p1) + A2 sin(2 pi f2 t + p2) (per channel: vector params <L>_<Ch> = (c0, v, A1, f1)+ and <L>_<Ch>P = (p1, A2, f2, p2)), combined as Gain * (WA a + WB b + Bias)^Gamma, divided by Peak (light+ functions are clamped to 0..1; the light's intensity carries the peak)."""+ path = f"{DEST}/Materials/M_AnyGobo"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGobo", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("material_domain", unreal.MaterialDomain.MD_LIGHT_FUNCTION)+ mpc = mpc_time()+ gobo_default = next((EAL.load_asset(gobo_tex_path(lay["image"])) for L in scene["lights"]+ for lay in (L.get("gobo_fx") or {}).get("layers", []) if EAL.does_asset_exist(gobo_tex_path(lay["image"]))), None)+ if gobo_default is None:+ warn("M_AnyGobo: no imported gobo texture to use as the sampler default")++ def scalar(name, v, x, y):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("default_value", v)+ return n++ def vec(name, v, x, y):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("default_value", unreal.LinearColor(*v))+ return n++ # Clock: lerp(Time + TimeOffset, GoboTime, GoboUseSeq)+ tm = MEL.create_material_expression(m, unreal.MaterialExpressionTime, -2400, -600)+ toff = scalar("TimeOffset", 0.0, -2400, -500)+ add = MEL.create_material_expression(m, unreal.MaterialExpressionAdd, -2200, -560)+ MEL.connect_material_expressions(tm, "", add, "A")+ MEL.connect_material_expressions(toff, "", add, "B")+ cps = []+ for i, n in enumerate(("GoboTime", "GoboUseSeq")):+ c = MEL.create_material_expression(m, unreal.MaterialExpressionCollectionParameter, -2400, -400 + 100 * i)+ c.set_editor_property("collection", mpc)+ c.set_editor_property("parameter_name", n)+ cps.append(c)+ lt = MEL.create_material_expression(m, unreal.MaterialExpressionLinearInterpolate, -2000, -500)+ MEL.connect_material_expressions(add, "", lt, "A")+ MEL.connect_material_expressions(cps[0], "", lt, "B")+ MEL.connect_material_expressions(cps[1], "", lt, "Alpha")+ uv = MEL.create_material_expression(m, unreal.MaterialExpressionTextureCoordinate, -2400, -800)+ tan = scalar("TanOuter", 0.8391, -2400, -700)++ def ch(c):+ return (f"({c}.x + {c}.y*T + {c}.z*sin(6.2831853*{c}.w*T + {c}P.x) + {c}P.y*sin(6.2831853*{c}P.z*T + {c}P.w))")++ code = ("float2 p = (UV * 2.0 - 1.0) * Tan;\n"+ "float2 d = float2(-p.y, -p.x); // Blender light-local (x/z, y/z)\n"+ f"float lx = {ch('LocX')}; float ly = {ch('LocY')}; float r = {ch('Rot')};\n"+ f"float2 s = d * float2({ch('ScaleX')}, {ch('ScaleY')});\n"+ "float c = cos(r); float sn = sin(r);\n"+ "float2 q = float2(s.x * c - s.y * sn, s.x * sn + s.y * c) + float2(lx, ly);\n"+ "return float2(q.x, -q.y); // Blender image v runs bottom-up")+ samples = []+ defaults = {"LocX": (0, 0, 0, 0), "LocY": (0, 0, 0, 0), "Rot": (0, 0, 0, 0), "ScaleX": (1, 0, 0, 0), "ScaleY": (1, 0, 0, 0)}+ camv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -2400, 300)+ lfs = scalar("LFScale", 1024.0, -2400, 400)+ srad = scalar("SourceRadius", 0.0, -2400, 500)+ pbias = scalar("PenumbraBias", -1.0, -2400, 600)+ for li, L in enumerate(("A", "B")):+ y0 = li * 1400+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -1500, y0)+ cu.set_editor_property("code", code)+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ cu.set_editor_property("description", f"GoboUV_{L}")+ names = ["UV", "Tan", "T"] + [n for c in GOBO_CH for n in (c, c + "P")]+ ins = []+ for n in names:+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", n)+ ins.append(ci)+ cu.set_editor_property("inputs", ins)+ MEL.connect_material_expressions(uv, "", cu, "UV")+ MEL.connect_material_expressions(tan, "", cu, "Tan")+ MEL.connect_material_expressions(lt, "", cu, "T")+ vecs = {}+ for k, c in enumerate(GOBO_CH):+ a = vec(f"{L}_{c}", defaults[c], -1900, y0 + k * 220)+ b = vec(f"{L}_{c}P", (0, 0, 0, 0), -1900, y0 + k * 220 + 110)+ MEL.connect_material_expressions(a, "RGBA", cu, c)+ MEL.connect_material_expressions(b, "RGBA", cu, c + "P")+ vecs[c] = a+ # Penumbra: Cycles evaluates the gobo from every point of the light's disk, so the pattern blurs by the+ # angle SourceRadius / distance (tan units), times the mapping scale in texture space. Light functions are+ # point-projected; pick the mip whose texel matches that blur. CameraVector in a light function is the+ # light-space vector divided by LightFunctionScale (LightFunctionPixelShader.usf).+ mipc = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -1500, y0 + 1150)+ # Blur radius R texels = s * r / d * TexSize. A disk of radius R is roughly a Gaussian of sigma R/2, which+ # mip log2(R) - 1 (bilinear) approximates; PenumbraBias (default -1) is the look-match knob.+ mipc.set_editor_property("code", "float d = length(LV) * LFScale; if (d < 1.0) return 0.0;\n"+ "float s = max(abs(SX.x), abs(SY.x));\n"+ "return clamp(log2(max(s * SourceRadius / d * TexSize, 1.0)) + Bias, 0.0, 8.0);")+ mipc.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT1)+ mipc.set_editor_property("description", f"GoboPenumbraMip_{L}")+ ins = []+ for n in ("LV", "LFScale", "SourceRadius", "TexSize", "SX", "SY", "Bias"):+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", n)+ ins.append(ci)+ mipc.set_editor_property("inputs", ins)+ MEL.connect_material_expressions(camv, "", mipc, "LV")+ MEL.connect_material_expressions(lfs, "", mipc, "LFScale")+ MEL.connect_material_expressions(srad, "", mipc, "SourceRadius")+ MEL.connect_material_expressions(scalar(f"TexSize{L}", 2048.0, -1900, y0 + 1250), "", mipc, "TexSize")+ MEL.connect_material_expressions(vecs["ScaleX"], "RGBA", mipc, "SX")+ MEL.connect_material_expressions(vecs["ScaleY"], "RGBA", mipc, "SY")+ MEL.connect_material_expressions(pbias, "", mipc, "Bias")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -1100, y0)+ tx.set_editor_property("parameter_name", f"Tex{L}")+ tx.set_editor_property("mip_value_mode", unreal.TextureMipValueMode.TMVM_MIP_LEVEL)+ if not MEL.connect_material_expressions(mipc, "", tx, "Level"): # pin is "Level" in TMVM_MIP_LEVEL mode+ warn("M_AnyGobo: could not connect the penumbra mip")+ # The default must match the sampler type (linear grayscale), or the master fails to compile and every+ # light function silently does nothing (same trap as the ORM default in M_AnyBaked).+ tx.set_editor_property("texture", gobo_default)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_GRAYSCALE)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ w = scalar(f"W{L}", 0.5, -1100, y0 + 250)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -800, y0)+ MEL.connect_material_expressions(tx, "R", mul, "A")+ MEL.connect_material_expressions(w, "", mul, "B")+ samples.append(mul)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -500, 0)+ cu.set_editor_property("code", "return saturate(Gain * pow(max(A + B + Bias, 0.0), Gamma) * InvPeak);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT1)+ cu.set_editor_property("description", "GoboCombine")+ ins = []+ for n in ("A", "B", "Bias", "Gamma", "Gain", "InvPeak"):+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", n)+ ins.append(ci)+ cu.set_editor_property("inputs", ins)+ MEL.connect_material_expressions(samples[0], "", cu, "A")+ MEL.connect_material_expressions(samples[1], "", cu, "B")+ for n, v, yy in (("Bias", 0.0, 300), ("Gamma", 1.0, 400), ("Gain", 1.0, 500), ("InvPeak", 1.0, 600)):+ MEL.connect_material_expressions(scalar(n, v, -800, yy), "", cu, n)+ MEL.connect_material_property(cu, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def gobo_mi(L):+ """Material instance of M_AnyGobo for one light's gobo_fx entry."""+ g = L["gobo_fx"]+ m = mi("MI_Gobo_" + L["name"], master_gobo())+ lays = g["layers"][:2]+ if len(g["layers"]) > 2:+ warn(f"{L['name']}: {len(g['layers'])} gobo layers, master takes 2")+ if g.get("coord") != "normal_projective":+ warn(f"{L['name']}: gobo coordinates '{g.get('coord')}' approximated as the Normal x/z, y/z projector")+ fps = g.get("fps", 24.0)+ MEL.set_material_instance_scalar_parameter_value(m, "TanOuter", math.tan(math.radians(L["outer_cone"])))+ MEL.set_material_instance_scalar_parameter_value(m, "TimeOffset", scene.get("frame", 0) / fps)+ cb = g["combine"]+ w = list(cb["weights"][:2]) + [0.0] * (2 - len(lays))+ for li, Ln in enumerate(("A", "B")):+ lay = lays[min(li, len(lays) - 1)]+ tx = EAL.load_asset(gobo_tex_path(lay["image"]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, f"Tex{Ln}", tx)+ MEL.set_material_instance_scalar_parameter_value(m, f"W{Ln}", w[li] if li < len(lays) else 0.0)+ mp = lay.get("mapping") or {}+ for c in GOBO_CH:+ e = mp.get(GOBO_KEYS[c]) or {"c0": 1.0 if c.startswith("Scale") else 0.0, "v": 0.0, "sines": []}+ s = (e.get("sines") or []) + [[0.0, 0.0, 0.0]] * 2+ MEL.set_material_instance_vector_parameter_value(m, f"{Ln}_{c}", unreal.LinearColor(e["c0"], e["v"], s[0][0], s[0][1]))+ MEL.set_material_instance_vector_parameter_value(m, f"{Ln}_{c}P", unreal.LinearColor(s[0][2], s[1][0], s[1][1], s[1][2]))+ MEL.set_material_instance_scalar_parameter_value(m, "Bias", cb["bias"])+ MEL.set_material_instance_scalar_parameter_value(m, "Gamma", cb["gamma"])+ MEL.set_material_instance_scalar_parameter_value(m, "Gain", cb["gain"])+ MEL.set_material_instance_scalar_parameter_value(m, "InvPeak", 1.0 / max(g["peak"], 1e-6))+ MEL.set_material_instance_scalar_parameter_value(m, "SourceRadius", L.get("source_radius", 0.0))+ MEL.set_material_instance_scalar_parameter_value(m, "LFScale", 1024.0)+ for li, Ln in enumerate(("A", "B")):+ lay = lays[min(li, len(lays) - 1)]+ MEL.set_material_instance_scalar_parameter_value(m, f"TexSize{Ln}", float(max(lay.get("size") or [2048])))+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], baked)+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ c = g["color"]+ MEL.set_material_instance_vector_parameter_value(gm, "Color", unreal.LinearColor(c[0], c[1], c[2], 1))+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++LFV_BASE_CM = 500.0 # ULocalFogVolumeComponent::GetBaseVolumeSize()+++def lfv_tiles(b, max_aspect=1.5):+ """Cover a box (center, half-extent cm) with spheres: one sphere of radius max(half-extent) when the box is+ roughly cubic, else a row of spheres of radius = the smaller of the two larger half-extents along the long axis+ (a long flat box must not become one giant ball). Returns [(center, radius_cm)]."""+ e = list(b["extent"])+ c = list(b["center"])+ order = sorted(range(3), key=lambda i: -e[i])+ big, mid = e[order[0]], e[order[1]]+ if big <= max_aspect * mid:+ return [(c, max(e))]+ r = mid+ n = max(1, math.ceil(big / r))+ out = []+ for k in range(n):+ p = list(c)+ p[order[0]] = c[order[0]] - big + r + (2 * big - 2 * r) * (k / max(n - 1, 1))+ out.append((p, r))+ return out+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ if L.get("gobo_fx") and L["type"] == "SPOT":+ # Light functions are clamped to 0..1: the material divides the pattern by its peak, the light carries it.+ g = L["gobo_fx"]+ c.set_editor_property("intensity", L["candela"] * g["peak"])+ c.set_editor_property("light_function_material", gobo_mi(L))+ c.set_editor_property("light_function_scale", unreal.Vector(1024, 1024, 1024)) # uniform: x/z ratio intact+ c.set_editor_property("light_function_fade_distance", 1.0e6)+ ec = g.get("emission_color") or [1, 1, 1]+ if max(ec) > 0 and any(abs(x - 1) > 1e-3 for x in ec):+ col = [a * b for a, b in zip(L["color"], ec)]+ mx = max(col)+ c.set_light_color(unreal.LinearColor(*(x / mx for x in col), 1.0), True)+ c.set_editor_property("intensity", L["candela"] * g["peak"] * mx)+ REPORT.setdefault("gobos", {})[L["name"]] = {"peak": g["peak"], "mean": g.get("mean"), "layers": len(g["layers"])}+ elif L.get("gobo_fx"):+ warn(f"{L['name']}: gobo on a {L['type']} light not converted (spot only)")+ if L.get("ies_file"):+ prof = EAL.load_asset(ies_path(L["ies_file"]))+ if prof:+ c.set_editor_property("ies_texture", prof)+ # Cycles' IES node normalises the profile and the light power carries the brightness: keep candela.+ c.set_editor_property("use_ies_brightness", False)+ else:+ warn(f"{L['name']}: IES profile {L['ies_file']} not imported")+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0]:+ continue+ for k, (ctr, r_cm) in enumerate(lfv_tiles(v["bounds_ue"])):+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(ctr), unreal.Rotator(0, 0, 0))+ lf.set_actor_label(f"LFV_{name}" + (f"_{k}" if k else ""))+ lf.set_folder_path("Volumes")+ # LocalFogVolume: base radius 500 cm (GetBaseVolumeSize), the proxy turns the scale into a sphere from+ # the max axis (LocalFogVolumeSceneProxy.cpp:34), so scale uniformly to the wanted radius.+ sc_ = r_cm / LFV_BASE_CM+ lf.set_actor_scale3d(unreal.Vector(sc_, sc_, sc_))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"]) # Blender density = extinction per metre+ emit = max(v["emission"])+ path_m = 2.0 * r_cm / 100.0+ # RadialFogExtinction is the optical depth straight through the centre (LocalFogVolumeCommon.ush),+ # independent of size: sigma (1/m) x path length (m).+ tau = max(dens * path_m, 1e-3) # emissive-only volumes still need a little medium (coverage > 0)+ lc.set_editor_property("radial_fog_extinction", tau)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ # UE adds FogEmissive x coverage (1 - e^-tau) (LocalFogVolumeCommon.ush). Cycles through the centre:+ # 683 x emit x (1 - e^-(sigma p)) / sigma nits (683 x emit x p when sigma -> 0). Match the two.+ lc_nits = 683 * emit * ((1 - math.exp(-dens * path_m)) / dens if dens > 1e-6 else path_m)+ E = lc_nits / (1 - math.exp(-tau))+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * E, ec[1] * E, ec[2] * E, 1))+ REPORT.setdefault("local_fog", []).append({"volume": name, "radius_cm": round(r_cm, 1), "scale": round(sc_, 4),+ "radial_fog_extinction": round(dens * path_m, 5)})+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", min(1.0, ff["vignette_angle_rad"] / (math.pi / 4) * 0.45))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+ hero_name = os.environ.get("ANYSCENE_HERO", "cam_street")+ hero = next((c for c in scene["cameras"] if c["name"] == hero_name), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++def key_gobo_time(seq, n_frames, frame0=None):+ """Drive MPC_AnyTime from the sequence: GoboUseSeq = 1 and GoboTime = (Blender frame0 + f) / fps keyed on every+ frame, so MRQ frame f shows the gobo state of Blender frame frame0 + f (temporal sub-samples interpolate)."""+ if not any(L.get("gobo_fx") for L in scene["lights"]):+ return+ mpc = mpc_time()+ fps = scene["grade"].get("fps", 24)+ frame0 = scene.get("frame", 0) if frame0 is None else frame0+ try:+ tr = seq.add_track(unreal.MovieSceneMaterialParameterCollectionTrack)+ except Exception:+ tr = seq.add_master_track(unreal.MovieSceneMaterialParameterCollectionTrack)+ tr.set_editor_property("mpc", mpc)+ sec = tr.add_section()+ sec.set_range(0, n_frames)+ tick = seq.get_tick_resolution()+ tpf = tick.numerator / tick.denominator / fps+ lin = unreal.MovieSceneKeyInterpolation.LINEAR+ sec.add_scalar_parameter_key("GoboUseSeq", unreal.FrameNumber(0), 1.0, lin)+ for f in range(n_frames + 1):+ sec.add_scalar_parameter_key("GoboTime", unreal.FrameNumber(round(f * tpf)), (frame0 + f) / fps, lin)+++def make_dolly(spec, eas, fps):+ """ANYSCENE_DOLLY="camA>camB:frames[:name]": a CineCamera moving linearly from camera A's transform to camera+ B's (lens from A) over N frames, as SEQ_<name> for an MRQ clip."""+ a, rest = spec.split(">", 1)+ parts = rest.split(":")+ b, n = parts[0], int(parts[1]) if len(parts) > 1 else 96+ name = parts[2] if len(parts) > 2 else f"dolly_{a}"+ ca = next((C for C in scene["cameras"] if C["name"] == a), None)+ if b.startswith("fwd") and ca is not None: # "camA>fwd150": push in 150 cm along camera A's view axis+ d = float(b[3:])+ cb = dict(ca, loc=[ca["loc"][i] + ca["forward"][i] * d for i in range(3)])+ else:+ cb = next((C for C in scene["cameras"] if C["name"] == b), None)+ if ca is None or cb is None:+ warn(f"dolly {spec}: camera missing")+ return+ old = next((x for x in eas.get_all_level_actors() if x.get_actor_label() == name), None)+ if old:+ eas.destroy_actor(old)+ ra, rb = rot_fu(ca["forward"], ca["up"]), rot_fu(cb["forward"], cb["up"])+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(ca["loc"]), ra)+ act.set_actor_label(name)+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", ca["sensor_width_mm"])+ fb.set_editor_property("sensor_height", ca["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", ca["lens_mm"])+ cc.set_editor_property("current_aperture", 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.DISABLE)+ cc.set_editor_property("focus_settings", fs)+ sp = f"{DEST}/Sequences/SEQ_{name}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{name}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(n)+ bnd = seq.add_possessable(act)+ tt = bnd.add_track(unreal.MovieScene3DTransformTrack)+ ts = tt.add_section()+ ts.set_range(0, n)+ chs = ts.get_all_channels()+ lin = unreal.MovieSceneKeyInterpolation.LINEAR++ def unwrap(x, y):+ while y - x > 180:+ y -= 360+ while y - x < -180:+ y += 360+ return y+ va = [ca["loc"][0], ca["loc"][1], ca["loc"][2], ra.roll, ra.pitch, ra.yaw]+ vb = [cb["loc"][0], cb["loc"][1], cb["loc"][2], unwrap(ra.roll, rb.roll), unwrap(ra.pitch, rb.pitch), unwrap(ra.yaw, rb.yaw)]+ for i in range(6):+ chs[i].add_key(unreal.FrameNumber(0), va[i], interpolation=lin)+ chs[i].add_key(unreal.FrameNumber(n), vb[i], interpolation=lin)+ for i in range(6, 9):+ chs[i].add_key(unreal.FrameNumber(0), 1.0)+ try:+ ct = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ ct = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ cs = ct.add_section()+ cs.set_range(0, n)+ cs.set_camera_binding_id(seq.get_binding_id(bnd) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, bnd))+ key_gobo_time(seq, n)+ EAL.save_loaded_asset(seq, False)+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).save_current_level()+ log(f"dolly {name}: {a} -> {b}, {n} frames")+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(48)+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, 48)+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ key_gobo_time(seq, 48)+ EAL.save_loaded_asset(seq, False)+ for spec in [s for s in os.environ.get("ANYSCENE_DOLLY", "").split(";") if s]:+ make_dolly(spec, eas, fps)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = [int(x) for x in os.environ["ANYSCENE_MRQ_RES"].split("x")] if os.environ.get("ANYSCENE_MRQ_RES") else scene["grade"].get("resolution", [1920, 804])+ # MRQ_Clip = MRQ_Still over the sequence's whole playback range (dolly clips).+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True), ("MRQ_Clip", False)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.path.join(EXPORT, "..", "compare", "mrq").replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = name != "MRQ_Clip"+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = 64+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal_caustic/csv_summary.sh b/unreal_caustic/csv_summary.shnew file mode 100644index 0000000..1a3f187--- /dev/null+++ b/unreal_caustic/csv_summary.sh@@ -0,0 +1,16 @@+#!/usr/bin/env bash+# Summarise an Unreal CSV profile: mean / p50 / p95 of frame, game, render, RHI and GPU time plus the top GPU passes.+# bash csv_summary.sh <Profile(...).csv> [skip_first_frames=60]+f="$1"; skip="${2:-60}"+awk -F, -v skip="$skip" '+NR==1 { for (i=1;i<=NF;i++) col[$i]=i; next }+$1 ~ /^\[/ || NF < 10 { next }+{ n++; if (n<=skip) next; m+++ for (k in col) if (k=="FrameTime"||k=="GameThreadTime"||k=="RenderThreadTime"||k=="RHIThreadTime"||k=="GPUTime"||k ~ /^GPU\//) { v=$(col[k])+0; s[k]+=v; a[k,m]=v } }+END {+ printf "frames=%d (after skipping %d)\n", m, skip+ split("FrameTime GameThreadTime RenderThreadTime RHIThreadTime GPUTime", ks, " ")+ for (j=1;j<=5;j++) { k=ks[j]; c=0; for (i=1;i<=m;i++) t[++c]=a[k,i]; asort(t); printf "%-17s mean %6.2f ms p50 %6.2f p95 %6.2f\n", k, s[k]/m, t[int(c*0.5)], t[int(c*0.95)]; delete t }+ printf "fps(mean frame) %.1f\n", 1000/(s["FrameTime"]/m)+ for (k in s) if (k ~ /^GPU\//) printf "%8.3f %s\n", s[k]/m, k | "sort -rn | head -12"+}' "$f"diff --git a/unreal_caustic/export.sh b/unreal_caustic/export.shnew file mode 100644index 0000000..990ac52--- /dev/null+++ b/unreal_caustic/export.sh@@ -0,0 +1,24 @@+#!/usr/bin/env bash+# export_blend.py through the GPU queue, resumed until it finishes. Blender 5.0.1 Cycles bake crashes intermittently+# (EXCEPTION_ACCESS_VIOLATION in OpenImageIO ustring::operator= under ccl::create_mesh, ~1 per 250 bakes, a different+# asset each time); the exporter skips assets whose GLB/texture already exist, so a rerun resumes where it died.+# bash unreal/export.sh <copy.blend> <out_dir> [export_blend.py args...] (log: <out_dir>/export.log)+# EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py"+A="$(cd "$(dirname "$0")/.." && pwd)"+HERE="$(cd "$(dirname "$0")" && (pwd -W 2>/dev/null || pwd))" # this folder's exporter (C:/ form for Windows Blender)+. "$A/pipeline/env.sh"+blend="$1"; out="$2"; shift 2+mkdir -p "$out"+: > "$out/export.log"+pre=()+[ -n "$EXPORT_PRE" ] && pre=(--python "$EXPORT_PRE")+for i in $(seq 1 "${EXPORT_TRIES:-6}"); do+ bash "$A/pipeline/gpu_run.sh" "$BLENDER" -b "$blend" "${pre[@]}" --python "$HERE/export_blend.py" -- --out "$out" "$@" \+ >> "$out/export.log" 2>&1+ rc=$?+ if grep -q "^EXPORT wrote" "$out/export.log"; then echo "export: done after $i run(s)"; exit 0; fi+ # rc 0 without "wrote" is a Python exception (Blender exits 0 on those): retrying will not help.+ [ "$rc" = 0 ] && { echo "export: python error, see $out/export.log"; exit 1; }+ echo "export: run $i exited rc=$rc without finishing; resuming" | tee -a "$out/export.log"+done+echo "export: gave up after ${EXPORT_TRIES:-6} runs"; exit 1diff --git a/unreal_caustic/export_blend.py b/unreal_caustic/export_blend.pynew file mode 100644index 0000000..41fb36b--- /dev/null+++ b/unreal_caustic/export_blend.py@@ -0,0 +1,1293 @@+"""AnyScene -> Unreal export: bake every surface material to PBR textures, export one GLB per unique mesh, and write+scene.json (placements, lights, cameras, world, volumes, grade) in Unreal units and axes.++ blender -b <COPY of scene.blend> --python export_blend.py -- --out <dir> [--frame 60] [--only a,b] [--limit N]+ [--density 1024] [--max-res 4096] [--grade-sh scenes/<id>/scripts/grade.sh] [--ffmpeg path]+ [--dof '{"cam_street": [9.5, 2.8]}'] [--no-bake] [--cpu-threads 0]++Never saves the .blend (it modifies the open file in memory: new UV layers, converted text/curves). Rerunnable:+textures and GLBs that already exist are skipped (delete <out>/tex/<asset>_* or <out>/mesh/<asset>.glb to redo one).++Conventions written to scene.json+ * Space: Unreal (cm, X forward, Y right, Z up, left-handed). Blender (x, y, z) m -> Unreal (x, -y, z) * 100.+ Object transforms are S*M*S with S = diag(1,-1,1), given as location, quaternion (x,y,z,w) and scale.+ * Mesh GLBs are exported in object-local space at identity; the Unreal importer maps glTF to its own axes, so+ build_level.py checks the result against "check_bounds" for the first assets.+ * Photometry: 683 lm/W. Point/spot cd = 683 * P / (4 pi); area cd = 683 * P / pi; sun lux = 683 * S;+ emissive nits = 683 * strength; sky radiance x 683. Exposure: Blender pixel = L_b * 2^exposure, so the Unreal+ manual exposure is EV100 = log2(683 / 1.2) - exposure (written as grade.ev100).+ * Bake: every surface material (procedural or not) is baked per unique mesh into one texture set on a bake UV:+ BaseColor (sRGB png), ORM (R=1, G=roughness, B=metallic, linear png), Normal (tangent, OpenGL +Y, png, only if a+ material perturbs the normal), Emissive (sRGB png + scale, only if emissive). Glass slots (transmission > 0.5)+ are not baked: they keep their own material slot and parameters.+"""+import bmesh # noqa: F401 (kept for hand edits)+import json+import math+import os+import re+import subprocess+import sys+import time++import bpy+import numpy as np+from mathutils import Matrix, Vector++LM_PER_W = 683.0+argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+++def arg(name, default=None):+ return argv[argv.index(name) + 1] if name in argv else default+++OUT = os.path.abspath(arg("--out", "unreal_export"))+FRAME = int(arg("--frame", "60"))+ONLY = set(x for x in arg("--only", "").split(",") if x)+LIMIT = int(arg("--limit", "0"))+DENSITY = float(arg("--density", "1024")) # bake px per metre of sqrt(surface area)+MAX_RES = int(arg("--max-res", "4096"))+NO_BAKE = "--no-bake" in argv+DOF = json.loads(arg("--dof", "{}"))+GRADE_SH = arg("--grade-sh")+FFMPEG = arg("--ffmpeg", os.environ.get("FFMPEG", "ffmpeg")) # pipeline/env.sh exports FFMPEG (ffmpeg is not on PATH here)+THREADS = int(arg("--cpu-threads", "0"))+GPU = "--gpu" in argv # bake with OptiX (run through pipeline/gpu_run.sh)+REVERSE = "--reverse" in argv # walk assets from the end: a second process can share the work++SRC = bpy.data.filepath+if not SRC or os.path.basename(SRC) == "hk.blend" and "scenes" in SRC.replace("\\", "/").split("/"):+ print("export_blend: refusing to run on a scene's own .blend; open a copy", flush=True)+ sys.exit(1)++for d in ("mesh", "tex", "world", "grade"):+ os.makedirs(os.path.join(OUT, d), exist_ok=True)++sc = bpy.context.scene+sc.frame_set(FRAME)+S = Matrix.Diagonal((1.0, -1.0, 1.0, 1.0))+LOG = []+++def log(*a):+ s = " ".join(str(x) for x in a)+ LOG.append(s)+ print("EXPORT", s, flush=True)+++def ue_vec(v, scale=100.0):+ return [v[0] * scale, -v[1] * scale, v[2] * scale]+++def ue_xform(mw):+ t = S @ mw @ S+ loc, rot, scl = t.decompose()+ return {"loc": [loc.x * 100, loc.y * 100, loc.z * 100], "quat": [rot.x, rot.y, rot.z, rot.w], "scale": list(scl)}+++def ue_axes(mw):+ """Forward (-Z local) and up (+Y local) of a Blender camera/light in Unreal axes."""+ r = mw.to_3x3().normalized()+ f = r @ Vector((0, 0, -1))+ u = r @ Vector((0, 1, 0))+ return [f.x, -f.y, f.z], [u.x, -u.y, u.z]+++def safe(name):+ return re.sub(r"[^A-Za-z0-9_]", "_", name)[:60]+++# ------------------------------------------------------------------ material inspection++def output_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ for n in outs:+ if n.is_active_output:+ return n+ return outs[0] if outs else None+++def surface_shader(m):+ if not m or not m.node_tree:+ return None+ o = output_node(m.node_tree)+ if not o or not o.inputs["Surface"].is_linked:+ return None+ return o.inputs["Surface"].links[0].from_node+++def is_volume_only(m):+ if not m or not m.node_tree:+ return False+ o = output_node(m.node_tree)+ return bool(o and o.inputs["Volume"].is_linked and not o.inputs["Surface"].is_linked)+++def find_principled(m):+ sh = surface_shader(m)+ if sh is None:+ return None+ if sh.type == "BSDF_PRINCIPLED":+ return sh+ # Mix shaders etc.: first principled upstream.+ seen, stack = set(), [sh]+ while stack:+ n = stack.pop()+ if n.name in seen:+ continue+ seen.add(n.name)+ if n.type == "BSDF_PRINCIPLED":+ return n+ for i in n.inputs:+ for l in i.links:+ stack.append(l.from_node)+ return None+++def is_glass(m):+ p = find_principled(m)+ if p is not None:+ return (not p.inputs["Transmission Weight"].is_linked) and p.inputs["Transmission Weight"].default_value > 0.5+ sh = surface_shader(m)+ return sh is not None and sh.type in ("BSDF_GLASS", "BSDF_REFRACTION")+++def glass_params(m):+ p = find_principled(m)+ if p is None:+ return {"color": [1, 1, 1], "roughness": 0.0, "ior": 1.45}+ c = p.inputs["Base Color"].default_value+ return {"color": [c[0], c[1], c[2]], "roughness": p.inputs["Roughness"].default_value,+ "ior": p.inputs["IOR"].default_value, "alpha": p.inputs["Alpha"].default_value}+++def emissive(m):+ sh = surface_shader(m)+ if sh is None:+ return False+ if sh.type == "EMISSION":+ return True+ p = find_principled(m)+ if p is None:+ return False+ s = p.inputs["Emission Strength"]+ c = p.inputs["Emission Color"]+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))+++def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+++def uses_object_dependence(m):+ """Nodes whose result depends on the object it sits on (bakes per representative instance)."""+ if not m or not m.node_tree:+ return []+ hits = set()+ def walk(nt):+ for n in nt.nodes:+ if n.type in ("OBJECT_INFO", "AMBIENT_OCCLUSION", "NEW_GEOMETRY", "BEVEL"):+ hits.add(n.type)+ if n.type == "TEX_COORD":+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+ return sorted(hits)+++def animated(m):+ ad = m.node_tree.animation_data if m and m.node_tree else None+ return bool(ad and (ad.drivers or ad.action))+++# ------------------------------------------------------------------ scene classification++def particle_instancers():+ srcs, emitters = set(), set()+ for o in sc.objects:+ for md in o.modifiers:+ if md.type == "PARTICLE_SYSTEM":+ st = md.particle_system.settings+ emitters.add(o.name)+ if st.render_type == "OBJECT" and st.instance_object:+ srcs.add(st.instance_object.name)+ if st.render_type == "COLLECTION" and st.instance_collection:+ srcs.update(x.name for x in st.instance_collection.all_objects)+ return srcs, emitters+++def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+ return "m_" + o.data.name+ return "o_" + o.name+++def tri_count(me):+ me.calc_loop_triangles()+ return len(me.loop_triangles)+++def render_uv(me):+ return next((l for l in me.uv_layers if l.active_render), None) or me.uv_layers.active+++def uv_ok(me):+ """True if the active render UV is a usable non-overlapping atlas inside 0..1 (generated-prop style)."""+ uvl = render_uv(me)+ if uvl is None or len(me.loop_triangles) == 0:+ return False+ n = len(me.loops)+ uv = np.empty(n * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ if uv.min() < -0.01 or uv.max() > 1.01:+ return False+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ total = float(a.sum())+ if total > 1.02 or total < 0.05:+ return False+ # Coarse overlap check: rasterise triangle centroids+vertices into a 512 grid weighted by area.+ g = 512+ idx = np.clip((t.mean(axis=1) * g).astype(np.int32), 0, g - 1)+ occ = np.zeros((g, g), np.float64)+ np.add.at(occ, (idx[:, 1], idx[:, 0]), a)+ return float(occ.max()) < 4.0 / (g * g) + 1e-4 or total < 0.9+++def surface_area(o, me):+ mw = o.matrix_world+ me.calc_loop_triangles()+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3)+ m3 = np.array(mw.to_3x3())+ co = co @ m3.T+ vt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ t = co[vt.reshape(-1, 3)]+ return float(0.5 * np.linalg.norm(np.cross(t[:, 1] - t[:, 0], t[:, 2] - t[:, 0]), axis=1).sum())+++def pow2(x, lo, hi):+ r = lo+ while r < x and r < hi:+ r *= 2+ return min(r, hi)+++# ------------------------------------------------------------------ baking++BAKE_SCENE = None+++def bake_scene():+ global BAKE_SCENE+ if BAKE_SCENE is None:+ bs = bpy.data.scenes.new("__bake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "GPU" if GPU else "CPU"+ bs.cycles.samples = 4+ bs.cycles.use_denoising = False+ bs.render.bake.margin = 8+ bs.render.bake.use_clear = True+ bs.render.bake.target = "IMAGE_TEXTURES"+ if THREADS:+ bs.render.threads_mode = "FIXED"+ bs.render.threads = THREADS+ bs.world = sc.world+ bs.frame_current = FRAME+ BAKE_SCENE = bs+ return BAKE_SCENE+++def run_bake(o, kind):+ bs = bake_scene()+ vl = bs.view_layers[0]+ with bpy.context.temp_override(scene=bs, view_layer=vl, object=o, active_object=o,+ selected_objects=[o], selected_editable_objects=[o]):+ if kind == "NORMAL":+ bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT", margin=8, use_clear=True)+ else:+ bpy.ops.object.bake(type="EMIT", margin=8, use_clear=True)+++def _src(sock):+ return sock.links[0].from_socket if sock.is_linked else None+++class Rewire:+ """Temporarily route one Principled channel into an Emission shader on the material output."""++ def __init__(self, m, channel, img):+ self.m, self.nt = m, m.node_tree+ self.added, self.saved = [], None+ nt = self.nt+ out = output_node(nt)+ p = find_principled(m)+ sh = surface_shader(m)+ em = nt.nodes.new("ShaderNodeEmission")+ self.added.append(em)+ em.inputs["Strength"].default_value = 1.0+ col = em.inputs["Color"]+ if channel == "base":+ if p is not None:+ s = p.inputs["Base Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ elif sh is not None and sh.type == "EMISSION":+ col.default_value = (0, 0, 0, 1)+ elif sh is not None and "Color" in sh.inputs:+ s = sh.inputs["Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+ # R=1 (no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+ else:+ cmb.inputs[i].default_value = p.inputs[k].default_value if p is not None else dv+ nt.links.new(cmb.outputs[0], col)+ elif channel == "emit":+ if sh is not None and sh.type == "EMISSION":+ for k in ("Color", "Strength"):+ s = sh.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[k])+ else:+ em.inputs[k].default_value = s.default_value+ elif p is not None:+ for k, ek in (("Emission Color", "Color"), ("Emission Strength", "Strength")):+ s = p.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[ek])+ else:+ em.inputs[ek].default_value = s.default_value+ else:+ col.default_value = (0, 0, 0, 1)+ if out is not None:+ self.saved = _src(out.inputs["Surface"])+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ self.out = out+ self.tex = nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.added.append(self.tex)+ nt.nodes.active = self.tex++ def restore(self):+ nt = self.nt+ if self.out is not None:+ for l in list(self.out.inputs["Surface"].links):+ nt.links.remove(l)+ if self.saved is not None:+ nt.links.new(self.saved, self.out.inputs["Surface"])+ for n in self.added:+ nt.nodes.remove(n)+++class TargetOnly:+ """For the normal bake: keep the material, just add the active target image node."""++ def __init__(self, m, img):+ self.nt = m.node_tree+ self.tex = self.nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.nt.nodes.active = self.tex++ def restore(self):+ self.nt.nodes.remove(self.tex)+++def new_img(name, res, colorspace, is_float=False):+ old = bpy.data.images.get(name)+ if old:+ bpy.data.images.remove(old)+ w, h = (res, res) if isinstance(res, int) else res+ img = bpy.data.images.new(name, w, h, alpha=False, float_buffer=is_float)+ img.colorspace_settings.name = colorspace+ return img+++def save_png(img, path):+ img.filepath_raw = path+ img.file_format = "PNG"+ img.save()+++def bake_channel(o, mats, channel, res, path):+ cs = {"base": "sRGB", "orm": "Non-Color", "emit": "Linear Rec.709", "normal": "Non-Color"}[channel]+ img = new_img("__bake_" + channel, res, cs, is_float=(channel == "emit"))+ rw = []+ try:+ seen = set()+ for m in mats:+ if m is None or m.name in seen or m.node_tree is None:+ continue+ seen.add(m.name)+ rw.append(TargetOnly(m, img) if channel == "normal" else Rewire(m, channel, img))+ run_bake(o, "NORMAL" if channel == "normal" else "EMIT")+ finally:+ for r in rw:+ r.restore()+ scale = 1.0+ if channel == "emit":+ w, h = (res, res) if isinstance(res, int) else res+ px = np.empty(w * h * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mx = float(np.percentile(px.max(axis=1), 99.95)) if px.size else 0.0+ scale = max(mx, 1e-6)+ out = bpy.data.images.new("__emit_png", w, h, alpha=False)+ out.colorspace_settings.name = "sRGB"+ q = np.ones((w * h, 4), np.float32)+ q[:, :3] = np.clip(px / scale, 0, 1)+ out.pixels.foreach_set(q.ravel())+ save_png(out, path)+ bpy.data.images.remove(out)+ else:+ save_png(img, path)+ bpy.data.images.remove(img)+ return scale+++def uv_stats(me, name):+ """UV coords of a layer and the fraction of the 0..1 square its triangles cover."""+ uvl = me.uv_layers[name]+ uv = np.empty(len(me.loops) * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ me.calc_loop_triangles()+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ return uv, float(a.sum())+++def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+ empty square one. Returns (uv name, kept, aspect w/h, uv coverage)."""+ me = me_owner.data+ if "bake" in me.uv_layers:+ me.uv_layers.active = me.uv_layers["bake"]+ return "bake", False, me_owner.get("_bake_aspect", 1.0), me_owner.get("_bake_cov", 0.5)+ me.calc_loop_triangles()+ if uv_ok(me):+ ar = render_uv(me)+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)+ uvl = me.uv_layers.new(name="bake")+ if ar is not None:+ ar.active_render = True # keep materials reading their original UVs+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ vl.objects.active = me_owner+ me_owner.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ bpy.ops.mesh.select_all(action="SELECT")+ bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=False)+ try:+ bpy.ops.uv.select_all(action="SELECT")+ bpy.ops.uv.pack_islands(rotate=True, margin=0.003, shape_method="AABB", scale=True)+ except Exception as ex: # noqa: BLE001+ log("pack_islands failed", me_owner.name, ex)+ bpy.ops.object.mode_set(mode="OBJECT")+ me_owner.select_set(False)+ uv, _ = uv_stats(me, "bake")+ lo, hi = uv.min(axis=0), uv.max(axis=0)+ span = np.maximum(hi - lo, 1e-6)+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+++def bake_size(area, cov, aspect, kept):+ """Texture W,H so texel density is ~DENSITY px/m over the real surface; power of two, clamped."""+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4 # big architecture: coarser texels+ px = d * d * area / cov+ lo = 1024 if kept else 32+ w = pow2(math.sqrt(px * aspect), lo, MAX_RES)+ h = pow2(math.sqrt(px / aspect), lo, MAX_RES)+ if kept:+ w = h = min(max(w, h), 2048) # generated props: their own atlas, 1-2K+ return w, h+++# ------------------------------------------------------------------ export++def to_mesh_object(o):+ """Text/curve objects -> real mesh objects (evaluated) in a scratch collection; originals hidden."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ n = bpy.data.objects.new(o.name + "__mesh", me)+ c = bpy.data.collections.get("__converted") or bpy.data.collections.new("__converted")+ if c.name not in sc.collection.children:+ sc.collection.children.link(c)+ c.objects.link(n)+ n.matrix_world = o.matrix_world.copy()+ for k in ("visible_shadow", "visible_camera", "visible_glossy", "visible_diffuse"):+ setattr(n, k, getattr(o, k))+ o.hide_render = True+ return n+++def export_glb(o, uv_name, glass_slots, path):+ """Evaluated mesh at identity with only the bake UV; slots: 0 = baked, 1+ = each glass material."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ for l in [l for l in me.uv_layers if l.name != uv_name]:+ me.uv_layers.remove(l)+ if len(me.uv_layers):+ me.uv_layers[0].name = "UVMap"+ gl = list(glass_slots)+ mi = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("material_index", mi)+ remap = np.zeros(max(len(o.material_slots), 1), np.int32)+ for i in range(len(o.material_slots)):+ remap[i] = gl.index(i) + 1 if i in gl else 0+ mi = remap[np.clip(mi, 0, len(remap) - 1)]+ me.polygons.foreach_set("material_index", mi)+ me.materials.clear()+ base = bpy.data.materials.get("BAKED") or bpy.data.materials.new("BAKED")+ me.materials.append(base)+ for k, gi in enumerate(gl):+ gm = bpy.data.materials.get(f"GLASS_{k}") or bpy.data.materials.new(f"GLASS_{k}")+ me.materials.append(gm)+ tmp = bpy.data.objects.new("__export", me)+ sc.collection.objects.link(tmp)+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ tmp.select_set(True)+ vl.objects.active = tmp+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_apply=True,+ export_materials="PLACEHOLDER", export_texcoords=True, export_normals=True,+ export_tangents=True, export_yup=True, export_animations=False,+ export_cameras=False, export_lights=False, export_extras=False)+ bpy.data.objects.remove(tmp)+ bpy.data.meshes.remove(me)+++# ------------------------------------------------------------------ volumes++def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+ m = next((m for m in o.data.materials if m and is_volume_only(m)), None)+ if m is None:+ return None+ pv = next((nd for nd in m.node_tree.nodes if nd.type == "PRINCIPLED_VOLUME"), None)+ if pv is None:+ return None+ me0 = o.data+ xs = [v.co.x for v in me0.vertices]+ ys = [v.co.y for v in me0.vertices]+ zs = [v.co.z for v in me0.vertices]+ lo, hi = Vector((min(xs), min(ys), min(zs))), Vector((max(xs), max(ys), max(zs)))+ res = {"levels": [], "density": [], "emission": [], "emission_color": None}+ for f in levels:+ z = lo.z + f * (hi.z - lo.z)+ me = bpy.data.meshes.new("__slice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__slice", me)+ sc.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ out = output_node(nt)+ for l in list(out.inputs["Volume"].links):+ nt.links.remove(l)+ vals = {}+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ em = nt.nodes.new("ShaderNodeEmission")+ s = pvc.inputs[sock]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ img = new_img("__vol", n, "Non-Color", is_float=True)+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ bs = bake_scene()+ bs.collection.objects.link(sl)+ try:+ run_bake(sl, "EMIT")+ finally:+ bs.collection.objects.unlink(sl)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ vals[key] = float(px.reshape(-1, 4)[:, 0].mean())+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ res["levels"].append(f)+ res["density"].append(vals["density"])+ res["emission"].append(vals["emission"])+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ c = pv.inputs["Color"].default_value+ res["albedo"] = [c[0], c[1], c[2]]+ res["anisotropy"] = pv.inputs["Anisotropy"].default_value+ ec = pv.inputs["Emission Color"]+ if ec.is_linked:+ # Sample the colour ramp if it is one (flame): mid-height colour as a representative.+ n0 = ec.links[0].from_node+ if n0.type == "VALTORGB":+ res["emission_color"] = list(n0.color_ramp.evaluate(0.6))[:3]+ else:+ res["emission_color"] = list(ec.default_value)[:3]+ mw = o.matrix_world+ corners = [mw @ Vector((x, y, z)) for x in (lo.x, hi.x) for y in (lo.y, hi.y) for z in (lo.z, hi.z)]+ wlo = Vector([min(c[i] for c in corners) for i in range(3)])+ whi = Vector([max(c[i] for c in corners) for i in range(3)])+ res["bounds_ue"] = {"center": ue_vec((wlo + whi) / 2), "extent": [(whi.x - wlo.x) * 50, (whi.y - wlo.y) * 50, (whi.z - wlo.z) * 50]}+ res["bounds_m"] = {"lo": list(wlo), "hi": list(whi)}+ res["material"] = m.name+ res["animated"] = animated(m)+ return res+++# ------------------------------------------------------------------ lights / cameras / world / grade++def export_ies(nd, light_name):+ """IES profile -> <OUT>/ies/<name>.ies (external file copied, internal text datablock written). Returns the+ path relative to OUT, or None."""+ d = os.path.join(OUT, "ies")+ os.makedirs(d, exist_ok=True)+ try:+ if nd.mode == "EXTERNAL":+ src = bpy.path.abspath(nd.filepath)+ if not os.path.exists(src):+ log("ies missing", light_name, src)+ return None+ dst = os.path.join(d, safe(os.path.splitext(os.path.basename(src))[0]) + ".ies")+ if not os.path.exists(dst):+ with open(src, "rb") as fi, open(dst, "wb") as fo:+ fo.write(fi.read())+ else:+ if nd.ies is None:+ return None+ dst = os.path.join(d, safe(nd.ies.name.rsplit(".", 1)[0]) + ".ies")+ with open(dst, "w", encoding="utf-8") as fo:+ fo.write(nd.ies.as_string())+ except OSError as ex:+ log("ies export failed", light_name, ex)+ return None+ return os.path.relpath(dst, OUT)+++def export_image_file(img, sub="gobo"):+ """A (possibly packed) image -> <OUT>/<sub>/<name>.<ext>; returns the path relative to OUT."""+ d = os.path.join(OUT, sub)+ os.makedirs(d, exist_ok=True)+ base = os.path.basename(bpy.path.abspath(img.filepath)) or img.name+ stem, ext = os.path.splitext(base)+ ext = ext.lower() if ext.lower() in (".png", ".jpg", ".jpeg", ".tga", ".exr", ".tif", ".tiff") else ".png"+ dst = os.path.join(d, safe(stem) + ext)+ if not os.path.exists(dst):+ if img.packed_file:+ with open(dst, "wb") as fo:+ fo.write(img.packed_file.data)+ elif os.path.exists(bpy.path.abspath(img.filepath)):+ with open(bpy.path.abspath(img.filepath), "rb") as fi, open(dst, "wb") as fo:+ fo.write(fi.read())+ else: # generated / missing on disk: write the pixels+ dst = os.path.join(d, safe(stem) + ".png")+ im2 = img.copy()+ save_png(im2, dst)+ bpy.data.images.remove(im2)+ return os.path.relpath(dst, OUT)+++def _fcurves(idblock):+ """All F-curves of an ID's action (Blender 5 layered actions: layers -> strips -> channelbag(slot))."""+ ad = getattr(idblock, "animation_data", None)+ act = ad.action if ad else None+ if act is None:+ return []+ out = list(getattr(act, "fcurves", []) or [])+ if not out and hasattr(act, "layers"):+ for ly in act.layers:+ for st in ly.strips:+ cb = st.channelbag(ad.action_slot) if ad.action_slot else None+ if cb:+ out += list(cb.fcurves)+ return out+++def fit_channel(t, y, n_sines=2, fmin=0.01, fmax=1.5, step=0.002):+ """y(t) ~ c0 + v t + sum_k A_k sin(2 pi f_k t + phi_k), greedy frequency search + joint linear least squares.+ Returns {"c0", "v", "sines": [[A, f, phi], ...], "rms"} (t in seconds)."""+ t = np.asarray(t, np.float64)+ y = np.asarray(y, np.float64)+ cols = [np.ones_like(t), t]+ freqs = []+ grid = np.arange(fmin, fmax, step)+ for _ in range(n_sines):+ best = None+ for f in grid:+ if any(abs(f - g) < 2 * step for g in freqs):+ continue+ w = 2 * math.pi * f+ A = np.vstack(cols + [np.sin(w * t), np.cos(w * t)]).T+ c, res, *_ = np.linalg.lstsq(A, y, rcond=None)+ r = float(((A @ c - y) ** 2).sum())+ if best is None or r < best[0]:+ best = (r, f)+ if best is None:+ break+ f = best[1]+ freqs.append(f)+ w = 2 * math.pi * f+ cols += [np.sin(w * t), np.cos(w * t)]+ A = np.vstack(cols).T+ c, *_ = np.linalg.lstsq(A, y, rcond=None)+ rms = float(np.sqrt(((A @ c - y) ** 2).mean()))+ sines = []+ for k, f in enumerate(freqs):+ a, b = c[2 + 2 * k], c[3 + 2 * k]+ sines.append([float(math.hypot(a, b)), float(f), float(math.atan2(b, a))]) # A sin(wt+phi) = A cos(phi) sin + A sin(phi) cos+ return {"c0": float(c[0]), "v": float(c[1]), "sines": sines, "rms": rms, "range": [float(y.min()), float(y.max())]}+++def _reduce_strength(sock, layers, light):+ """Reduce the node chain feeding a light's emission Strength to gain * (sum_i w_i * tex_i + bias) ^ gamma.+ Supports Math ADD/SUBTRACT/MULTIPLY/DIVIDE/POWER with constants, Map Range (linear) and Image Texture leaves+ (Color or Alpha output). Returns a dict or raises ValueError."""+ if not sock.is_linked:+ return {"w": {}, "bias": float(sock.default_value), "gamma": 1.0, "gain": 1.0, "clamp": False}+ n = sock.links[0].from_node+ if n.type == "TEX_IMAGE":+ i = next(k for k, l in enumerate(layers) if l["node"] == n.name)+ return {"w": {i: 1.0}, "bias": 0.0, "gamma": 1.0, "gain": 1.0, "clamp": False}+ if n.type == "MAP_RANGE" and n.data_type == "FLOAT" and n.interpolation_type == "LINEAR":+ f = _reduce_strength(n.inputs[0], layers, light)+ a, b, c, d = (n.inputs[k].default_value for k in (1, 2, 3, 4))+ if any(n.inputs[k].is_linked for k in (1, 2, 3, 4)) or abs(a) > 1e-6 or abs(c) > 1e-6:+ raise ValueError(f"{light}: map range other than 0..b -> 0..d")+ f["gain"] *= d / b+ f["clamp"] = f["clamp"] or n.clamp+ return f+ if n.type == "MATH":+ op = n.operation+ lk = [i.is_linked for i in n.inputs[:2]]+ if op in ("ADD", "SUBTRACT") and all(lk):+ fa, fb = _reduce_strength(n.inputs[0], layers, light), _reduce_strength(n.inputs[1], layers, light)+ if fa["gamma"] != 1 or fb["gamma"] != 1:+ raise ValueError(f"{light}: sum of non-linear terms")+ s = -1.0 if op == "SUBTRACT" else 1.0+ w = {k: fa["gain"] * v for k, v in fa["w"].items()}+ for k, v in fb["w"].items():+ w[k] = w.get(k, 0.0) + s * fb["gain"] * v+ return {"w": w, "bias": fa["gain"] * fa["bias"] + s * fb["gain"] * fb["bias"], "gamma": 1.0, "gain": 1.0, "clamp": False}+ if lk[0] and not lk[1] or lk[1] and not lk[0]:+ src = n.inputs[0] if lk[0] else n.inputs[1]+ k = n.inputs[1].default_value if lk[0] else n.inputs[0].default_value+ f = _reduce_strength(src, layers, light)+ if op == "MULTIPLY" or (op == "DIVIDE" and lk[0]):+ m = k if op == "MULTIPLY" else 1.0 / k+ if f["gamma"] == 1.0:+ f["w"] = {i: v * m for i, v in f["w"].items()}+ f["bias"] *= m+ else:+ f["gain"] *= m+ return f+ if op in ("ADD", "SUBTRACT") and f["gamma"] == 1.0 and f["gain"] == 1.0:+ f["bias"] += k if op == "ADD" else (-k if lk[0] else k)+ if op == "SUBTRACT" and lk[1]:+ raise ValueError(f"{light}: const - texture")+ return f+ if op == "POWER" and lk[0]:+ f["gain"] = f["gain"] ** k+ f["gamma"] *= k+ return f+ raise ValueError(f"{light}: unsupported math {op}")+ raise ValueError(f"{light}: unsupported node {n.type} in the strength chain")+++def gobo_entry(o):+ """Projected-texture (gobo) light: the image layers, their Mapping transform and its animation fitted to drift ++ sines, and the strength chain reduced to gain * (sum w_i tex_i + bias)^gamma. None if the light has no image."""+ L = o.data+ nt = L.node_tree+ texs = [n for n in nt.nodes if n.type == "TEX_IMAGE" and n.image]+ if not texs:+ return None+ fcs = {(fc.data_path, fc.array_index): fc for fc in _fcurves(nt)}+ fps = sc.render.fps / sc.render.fps_base+ layers, warns = [], []+ coord = "unknown"+ for tx in texs:+ lay = {"node": tx.name, "image": export_image_file(tx.image), "extension": tx.extension,+ "interpolation": tx.interpolation, "colorspace": tx.image.colorspace_settings.name,+ "size": list(tx.image.size)}+ vin = tx.inputs["Vector"]+ mp = vin.links[0].from_node if vin.is_linked else None+ if mp is not None and mp.type == "MAPPING":+ if mp.vector_type not in ("POINT", "TEXTURE"):+ warns.append(f"mapping type {mp.vector_type}")+ rot = mp.inputs["Rotation"].default_value+ if abs(rot[0]) > 1e-4 or abs(rot[1]) > 1e-4:+ warns.append("mapping X/Y rotation ignored")+ chans = {}+ for key, sock, idx in (("loc_x", "Location", 0), ("loc_y", "Location", 1), ("rot", "Rotation", 2),+ ("scale_x", "Scale", 0), ("scale_y", "Scale", 1)):+ si = list(mp.inputs).index(mp.inputs[sock])+ fc = fcs.get((f'nodes["{mp.name}"].inputs[{si}].default_value', idx))+ if fc is None or len(fc.keyframe_points) < 2:+ chans[key] = {"c0": float(mp.inputs[sock].default_value[idx]), "v": 0.0, "sines": [], "rms": 0.0}+ continue+ k0, k1 = fc.keyframe_points[0].co[0], fc.keyframe_points[-1].co[0]+ frames = np.arange(math.floor(k0), math.ceil(k1) + 1)+ vals = [fc.evaluate(float(f)) for f in frames]+ chans[key] = fit_channel(frames / fps, vals)+ chans[key]["keys"] = len(fc.keyframe_points)+ chans[key]["frames"] = [int(frames[0]), int(frames[-1])]+ if fc.modifiers:+ warns.append(f"{key}: fcurve modifiers {[m.type for m in fc.modifiers]} sampled, not exported")+ if mp.vector_type == "TEXTURE": # inverse transform: not supported by the master material+ warns.append("TEXTURE-type mapping treated as POINT")+ lay["mapping"] = chans+ lay["animated"] = any(c.get("keys") for c in chans.values())+ src = mp.inputs["Vector"].links[0].from_node if mp.inputs["Vector"].is_linked else None+ else:+ lay["mapping"] = None+ src = mp+ # Coordinate source: TexCoord Normal -> x/z, y/z (perspective projector) is the standard spot gobo.+ c = "unknown"+ if src is not None and src.type == "COMBXYZ":+ ins = [src.inputs[i].links[0].from_node if src.inputs[i].is_linked else None for i in (0, 1)]+ if all(n is not None and n.type == "MATH" and n.operation == "DIVIDE" for n in ins):+ seps = {l.from_node.type for n in ins for i in n.inputs[:2] for l in i.links}+ tc = {l.from_node for n in ins for i in n.inputs[:2] for l in i.links if l.from_node.type == "SEPXYZ"}+ if seps == {"SEPXYZ"} and len(tc) == 1:+ sep = next(iter(tc))+ ln = sep.inputs[0].links[0] if sep.inputs[0].is_linked else None+ if ln and ln.from_node.type == "TEX_COORD":+ c = "normal_projective" if ln.from_socket.name == "Normal" else ln.from_socket.name.lower() + "_projective"+ elif src is not None and src.type == "TEX_COORD":+ c = src.outputs[0].name.lower()+ for s in src.outputs:+ if s.is_linked:+ c = s.name.lower() + "_raw"+ coord = c if coord == "unknown" else coord+ if c != coord:+ warns.append(f"layers use different coordinates ({coord} vs {c})")+ layers.append(lay)+ em = next((n for n in nt.nodes if n.type == "EMISSION"), None)+ g = {"coord": coord, "layers": layers, "fps": fps}+ try:+ f = _reduce_strength(em.inputs["Strength"], layers, o.name) if em else None+ except ValueError as ex:+ warns.append(str(ex))+ f = None+ if f is None: # fall back to an equal-weight average of the layers, unit gain+ f = {"w": {i: 1.0 / len(layers) for i in range(len(layers))}, "bias": 0.0, "gamma": 1.0, "gain": 1.0, "clamp": False}+ g["combine"] = {"weights": [f["w"].get(i, 0.0) for i in range(len(layers))], "bias": f["bias"], "gamma": f["gamma"],+ "gain": f["gain"], "clamp": f["clamp"]}+ # Peak (all textures at 1) and mean (layers decorrelated) of the strength pattern.+ w = np.array(g["combine"]["weights"])+ g["peak"] = float(f["gain"] * max(w.clip(0).sum() + f["bias"], 1e-6) ** f["gamma"])+ try:+ rng = np.random.default_rng(0)+ acc = np.full(100000, f["bias"], np.float64)+ for i, tx in enumerate(texs):+ im = tx.image+ px = np.empty(im.size[0] * im.size[1] * im.channels, np.float32)+ im.pixels.foreach_get(px)+ px = px.reshape(-1, im.channels)[:, :3].mean(axis=1)+ acc += w[i] * px[rng.integers(0, px.size, acc.size)]+ g["mean"] = float((f["gain"] * np.clip(acc, 0, None) ** f["gamma"]).mean())+ except Exception as ex: # noqa: BLE001+ g["mean"] = None+ warns.append(f"mean estimate failed: {ex}")+ if em is not None:+ ec = em.inputs["Color"]+ g["emission_color"] = list(ec.default_value)[:3] if not ec.is_linked else [1.0, 1.0, 1.0]+ g["warnings"] = warns+ for wmsg in warns:+ log("gobo", o.name, wmsg)+ return g+++def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+ mx = max(col) or 1.0+ P = L.energy+ e = {"name": o.name, "type": L.type, "color": [c / mx for c in col], "energy_w": P,+ "cast_shadows": bool(getattr(L, "use_shadow", True)),+ "specular": 1.0 if getattr(o, "visible_glossy", True) else 0.0,+ "diffuse": 1.0 if getattr(o, "visible_diffuse", True) else 0.0,+ "volume": 1.0 if getattr(o, "visible_volume_scatter", True) else 0.0,+ "loc": ue_vec(o.matrix_world.translation), "animated": bool(L.animation_data and (L.animation_data.drivers or L.animation_data.action))}+ f, u = ue_axes(o.matrix_world)+ e["forward"], e["up"] = f, u+ k = mx # colour normalisation folds into intensity+ if L.type in ("POINT", "SPOT"):+ e["candela"] = LM_PER_W * P * k / (4 * math.pi)+ e["source_radius"] = L.shadow_soft_size * 100+ e["soft_falloff"] = bool(getattr(L, "use_soft_falloff", True))+ if L.type == "SPOT":+ outer = math.degrees(L.spot_size) / 2+ e["outer_cone"] = min(outer, 80.0)+ e["inner_cone"] = outer * (1 - L.spot_blend)+ if outer > 80:+ e["note"] = f"spot cone {outer * 2:.0f} deg > Unreal max 160: clamped"+ elif L.type == "AREA":+ e["candela"] = LM_PER_W * P * k / math.pi+ e["shape"] = L.shape+ sx = L.size+ sy = L.size_y if L.shape in ("RECTANGLE", "ELLIPSE") else L.size+ sxx, syy, _ = o.matrix_world.to_scale()+ e["width"], e["height"] = sx * sxx * 100, sy * syy * 100+ e["spread_deg"] = math.degrees(getattr(L, "spread", math.pi))+ elif L.type == "SUN":+ e["lux"] = LM_PER_W * P * k+ e["angle_deg"] = math.degrees(L.angle)+ # IES / gobo: node-based light textures.+ if L.use_nodes and L.node_tree:+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")+ f = export_ies(nd, o.name)+ if f:+ e["ies_file"] = f+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)+ em = next((nd for nd in L.node_tree.nodes if nd.type == "EMISSION"), None)+ if em is not None and not em.inputs["Strength"].is_linked and "candela" in e:+ e["candela"] *= em.inputs["Strength"].default_value # a constant node strength scales the light+ g = gobo_entry(o)+ if g:+ e["gobo_fx"] = g+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+++def camera_entry(o):+ c = o.data+ f, u = ue_axes(o.matrix_world)+ rx, ry = sc.render.resolution_x, sc.render.resolution_y+ sw = c.sensor_width if c.sensor_fit in ("AUTO", "HORIZONTAL") else c.sensor_height * rx / ry+ d = {"name": o.name, "type": c.type, "lens_mm": c.lens, "sensor_width_mm": sw, "sensor_height_mm": sw * ry / rx,+ "sensor_fit": c.sensor_fit, "shift": [c.shift_x, c.shift_y], "clip": [c.clip_start * 100, c.clip_end * 100],+ "loc": ue_vec(o.matrix_world.translation), "forward": f, "up": u,+ "dof": {"enabled": c.dof.use_dof, "focus_cm": c.dof.focus_distance * 100, "fstop": c.dof.aperture_fstop,+ "blades": c.dof.aperture_blades, "focus_object": c.dof.focus_object.name if c.dof.focus_object else None}}+ if o.name in DOF:+ fd, fs = DOF[o.name]+ d["dof"].update(enabled=True, focus_cm=fd * 100, fstop=fs, source="--dof override (stills script)")+ return d+++def world_bake(path, w=2048, h=1024, spp=32):+ ws = bpy.data.scenes.new("__world")+ ws.world = sc.world+ ws.render.engine = "CYCLES"+ ws.cycles.device = "CPU"+ ws.cycles.samples = spp+ ws.render.resolution_x, ws.render.resolution_y, ws.render.resolution_percentage = w, h, 100+ ws.view_settings.view_transform = "Standard"+ ws.render.image_settings.file_format = "OPEN_EXR"+ ws.render.image_settings.color_depth = "16"+ cd = bpy.data.cameras.new("__pano")+ cd.type = "PANO"+ try:+ cd.panorama_type = "EQUIRECTANGULAR"+ except Exception:+ cd.cycles.panorama_type = "EQUIRECTANGULAR"+ co = bpy.data.objects.new("__pano", cd)+ ws.collection.objects.link(co)+ co.rotation_euler = (math.radians(90), 0, math.radians(-90)) # looking +X? (equirect centre = -Y in Blender -> fixed below)+ co.rotation_euler = (math.radians(90), 0, 0)+ ws.camera = co+ ws.render.filepath = path+ with bpy.context.temp_override(scene=ws):+ bpy.ops.render.render(write_still=True, scene=ws.name)+ # mean radiance for the sky light estimate+ img = bpy.data.images.load(path)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mean = px.mean(axis=0).tolist()+ bpy.data.images.remove(img)+ return {"equirect_exr": path, "mean_radiance": mean, "camera_note": "equirect centre looks along Blender +Y"}+++def compositor_nodes():+ # 5.0: compositing_node_group; Scene.node_tree is gone (use_nodes can still read True with no tree).+ tree = getattr(sc, "compositing_node_group", None) or getattr(sc, "node_tree", None)+ if tree is None:+ return []+ out = []+ for n in tree.nodes:+ d = {"type": n.bl_idname, "name": n.name, "inputs": {}}+ for i in n.inputs:+ if i.is_linked or not hasattr(i, "default_value"):+ continue+ v = i.default_value+ try:+ v = v if isinstance(v, str) else list(v)+ except TypeError:+ pass+ if isinstance(v, (int, float, str, list, bool)):+ d["inputs"][i.name] = v+ for k in ("glare_type", "quality", "blend_type"):+ if hasattr(n, k):+ d[k] = getattr(n, k)+ out.append(d)+ return out+++def ffmpeg_grade(grade_sh):+ """Pull GRADE="..." out of a scene's grade.sh; split into colour (LUT-able) and spatial filters."""+ txt = open(grade_sh, encoding="utf-8").read()+ m = re.search(r'GRADE="([^"]+)"', txt)+ if not m:+ return None+ filters = [f for f in m.group(1).split(",") if f]+ colour = [f for f in filters if f.split("=")[0] in ("curves", "hue", "eq", "colorbalance", "colorchannelmixer", "lutrgb", "colortemperature")]+ spatial = [f for f in filters if f not in colour]+ g = {"source": grade_sh, "filter": m.group(1), "colour": colour, "spatial": spatial}+ for f in spatial:+ if f.startswith("vignette"):+ a = re.search(r"angle=PI/([\d.]+)", f)+ g["vignette_angle_rad"] = math.pi / float(a.group(1)) if a else math.pi / 5+ if f.startswith("rgbashift"):+ g["chromatic_px"] = 1+ noise = re.search(r"noise=alls=(\d+)", txt)+ if noise:+ g["grain_strength"] = int(noise.group(1))+ return g+++def make_lut(colour_filters, path):+ """UE colour grading LUT (256x16, 16 slices of 16x16; R across a slice, G down, B by slice), with the ffmpeg+ colour filters applied. Unreal applies it after the tone curve, i.e. in display space, like ffmpeg on the PNG."""+ n = 16+ ident = os.path.join(os.path.dirname(path), "lut_identity.png")+ img = bpy.data.images.new("__lut", n * n, n, alpha=False)+ img.colorspace_settings.name = "Non-Color"+ px = np.zeros((n, n * n, 4), np.float32)+ for b in range(n):+ for g in range(n):+ for r in range(n):+ px[g, b * n + r] = (r / (n - 1), g / (n - 1), b / (n - 1), 1)+ # Blender rows go bottom-up; UE LUT row 0 (top) is G=0.+ img.pixels.foreach_set(px[::-1].ravel())+ save_png(img, ident)+ bpy.data.images.remove(img)+ if not colour_filters:+ return ident+ cmd = [FFMPEG, "-v", "error", "-y", "-i", ident, "-vf", ",".join(colour_filters), "-frames:v", "1", path]+ try:+ r = subprocess.run(cmd, capture_output=True, text=True)+ except OSError as ex:+ log("LUT ffmpeg not runnable (pass --ffmpeg or set FFMPEG):", FFMPEG, ex)+ return ident+ if r.returncode != 0:+ log("LUT ffmpeg failed:", r.stderr[:300])+ return ident+ return path+++# ------------------------------------------------------------------ main++def main():+ t0 = time.time()+ srcs, emitters = particle_instancers()+ report = {"skipped": [], "converted": [], "volumes": {}, "fx": [], "warnings": []}+ objs = []+ for o in list(sc.objects):+ if o.hide_render or not o.visible_get():+ if o.type in ("MESH", "FONT", "CURVE") and not o.hide_render:+ pass+ if o.hide_render:+ continue+ if o.name in srcs:+ report["skipped"].append([o.name, "particle instance source (exported as fx note)"])+ continue+ if o.name in emitters:+ st = [md.particle_system.settings for md in o.modifiers if md.type == "PARTICLE_SYSTEM"]+ report["fx"].append({"name": o.name, "kind": "particles", "count": sum(s.count for s in st),+ "instance": [s.instance_object.name if s.instance_object else None for s in st],+ "lifetime": [s.lifetime for s in st], "velocity": [list(s.object_align_factor) for s in st]})+ if not o.show_instancer_for_render:+ continue+ if o.type in ("FONT", "CURVE", "SURFACE", "META"):+ if o.type == "CURVE" and o.data.bevel_depth == 0 and not o.data.bevel_object and o.data.extrude == 0:+ report["skipped"].append([o.name, "curve without geometry"])+ continue+ n = to_mesh_object(o)+ report["converted"].append([o.name, o.type])+ objs.append(n)+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+ log("volume", o.name, [round(x, 4) for x in v["density"]], [round(x, 2) for x in v["emission"]])+ continue+ objs.append(o)+ # Group by unique mesh.+ assets = {}+ for o in objs:+ k = mesh_key(o)+ assets.setdefault(k, []).append(o)+ keys = sorted(assets, key=lambda k: assets[k][0].name, reverse=REVERSE)+ if ONLY:+ keys = [k for k in keys if any(o.name in ONLY or o.name.split("__")[0] in ONLY for o in assets[k])]+ if LIMIT:+ keys = keys[:LIMIT]+ log(f"{len(objs)} mesh objects -> {len(assets)} unique meshes; exporting {len(keys)}")+ entries, placements = [], []+ for ai, k in enumerate(keys):+ group = assets[k]+ rep = group[0]+ an = safe(rep.data.name if k.startswith("m_") else rep.name)+ an = f"{an}_{ai:03d}" if any(e["asset"] == an for e in entries) else an+ mats = [s.material for s in rep.material_slots]+ glass = [i for i, m in enumerate(mats) if m and is_glass(m)]+ bake_mats = [m for i, m in enumerate(mats) if i not in glass]+ dg = bpy.context.evaluated_depsgraph_get()+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+ meta = glb[:-4] + ".json"+ done = os.path.exists(glb) # written after every bake of the asset succeeded+ if done:+ # Resume: skip the UV unwrap (an edit-mode smart_project per asset). Blender 5.0.1's bake crashes+ # (OpenImageIO ustring::operator= in ccl::create_mesh) after a few hundred unwrap+bake cycles in one+ # process; re-unwrapping every finished asset on resume made it crash at the same asset every time.+ m0 = json.load(open(meta)) if os.path.exists(meta) else {}+ uv_name, kept, cov, res = None, m0.get("uv") == "kept", m0.get("uv_coverage", 0.0), m0.get("res", [0, 0])+ else:+ uv_name, kept, aspect, cov = ensure_bake_uv(rep, rep)+ res = bake_size(area, cov, aspect, kept)+ e = {"asset": an, "key": k, "tris": tris, "area_m2": round(area, 3), "uv": "kept" if kept else "smart_project",+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera)}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+ bake_scene().collection.objects.link(rep)+ try:+ bake_channel(rep, bake_mats, "base", res, p["base"])+ bake_channel(rep, bake_mats, "orm", res, p["orm"])+ if any(m and perturbs_normal(m) for m in bake_mats):+ bake_channel(rep, bake_mats, "normal", res, p["normal"])+ if any(m and emissive(m) for m in bake_mats):+ s = bake_channel(rep, bake_mats, "emit", res, p["emit"])+ json.dump({"scale": s}, open(p["emit"] + ".json", "w"))+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+ e["tex"] = {c: os.path.relpath(v, OUT) for c, v in p.items() if os.path.exists(v)}+ if not os.path.exists(glb):+ export_glb(rep, uv_name, glass, glb)+ if not done:+ json.dump({"res": list(res), "uv": e["uv"], "uv_coverage": e["uv_coverage"]}, open(meta, "w"))+ e["glb"] = os.path.relpath(glb, OUT)+ # Local bounds in Unreal axes for the importer orientation check.+ bb = [Vector(c) for c in rep.bound_box]+ e["check_bounds"] = {"min": ue_vec(Vector([min(c[i] for c in bb) for i in range(3)])),+ "max": ue_vec(Vector([max(c[i] for c in bb) for i in range(3)]))}+ e["bake_s"] = round(time.time() - t1, 1)+ entries.append(e)+ for o in group:+ placements.append({"name": o.name, "asset": an, **ue_xform(o.matrix_world),+ "shadow": bool(o.visible_shadow), "camera_visible": bool(o.visible_camera)})+ log(f"[{ai + 1}/{len(keys)}] {an} tris={tris} res={res} uv={e['uv']} inst={len(group)} {e['bake_s']}s")+ # Lights, cameras, world, grade.+ lights = [light_entry(o) for o in sc.objects if o.type == "LIGHT" and not o.hide_render]+ cams = [camera_entry(o) for o in sc.objects if o.type == "CAMERA"]+ world = None+ wpath = os.path.join(OUT, "world", "sky.exr")+ if sc.world:+ world = world_bake(wpath) if not os.path.exists(wpath) or "--rebake-world" in argv else {"equirect_exr": wpath}+ if "mean_radiance" not in world:+ img = bpy.data.images.load(wpath)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ world["mean_radiance"] = px.reshape(-1, 4)[:, :3].mean(axis=0).tolist()+ bpy.data.images.remove(img)+ world["equirect_exr"] = os.path.relpath(wpath, OUT)+ world["nits_scale"] = LM_PER_W+ vs = sc.view_settings+ grade = {"view_transform": vs.view_transform, "look": vs.look, "exposure": vs.exposure, "gamma": vs.gamma,+ "use_curve_mapping": vs.use_curve_mapping,+ "ev100": math.log2(LM_PER_W / 1.2) - vs.exposure,+ "compositor": compositor_nodes(),+ "motion_blur": {"on": sc.render.use_motion_blur, "shutter": sc.render.motion_blur_shutter},+ "resolution": [sc.render.resolution_x, sc.render.resolution_y], "fps": sc.render.fps}+ if vs.use_curve_mapping:+ grade["curves"] = [[(p.location[0], p.location[1]) for p in c.points] for c in vs.curve_mapping.curves]+ if GRADE_SH and os.path.exists(GRADE_SH):+ g = ffmpeg_grade(GRADE_SH)+ if g:+ g["lut"] = os.path.relpath(make_lut(g["colour"], os.path.join(OUT, "grade", "lut_grade.png")), OUT)+ grade["ffmpeg"] = g+ scene = {"source": SRC, "frame": FRAME, "units": "unreal cm, X fwd, Y right, Z up", "lm_per_w": LM_PER_W,+ "assets": entries, "placements": placements, "lights": lights, "cameras": cams, "world": world,+ "volumes": report["volumes"], "fx": report["fx"], "grade": grade,+ "skipped": report["skipped"], "converted": report["converted"], "export_s": round(time.time() - t0)}+ jp = os.path.join(OUT, "scene.json")+ if os.path.exists(jp) and (ONLY or LIMIT):+ old = json.load(open(jp, encoding="utf-8"))+ have = {e["asset"] for e in entries}+ scene["assets"] = [e for e in old.get("assets", []) if e["asset"] not in have] + entries+ scene["placements"] = [p for p in old.get("placements", []) if p["asset"] not in have] + placements+ json.dump(scene, open(jp, "w", encoding="utf-8"), indent=1)+ log(f"wrote {jp}: {len(scene['assets'])} assets, {len(scene['placements'])} placements, {len(lights)} lights, "+ f"{len(cams)} cameras, {len(report['volumes'])} volumes in {time.time() - t0:.0f}s")+++main()diff --git a/unreal_caustic/make_copy.py b/unreal_caustic/make_copy.pynew file mode 100644index 0000000..0a0063e--- /dev/null+++ b/unreal_caustic/make_copy.py@@ -0,0 +1,12 @@+"""Make a working copy of a scene .blend with all external paths absolute (a plain file copy breaks the scene's+//../../refs/... texture paths as soon as it lives in another folder). The source file is only read.+ blender -b scenes/<id>/<scene>.blend --python unreal/make_copy.py -- <out.blend>+"""+import sys+import bpy++out = sys.argv[sys.argv.index("--") + 1]+assert bpy.path.abspath(out) != bpy.data.filepath, "refusing to overwrite the source .blend"+bpy.ops.file.make_paths_absolute()+bpy.ops.wm.save_as_mainfile(filepath=out, copy=True, relative_remap=False, compress=False)+print("COPY", bpy.data.filepath, "->", out, flush=True)diff --git a/unreal_caustic/perf.ps1 b/unreal_caustic/perf.ps1new file mode 100644index 0000000..35d417a--- /dev/null+++ b/unreal_caustic/perf.ps1@@ -0,0 +1,40 @@+# Standalone (-game) real-time performance run of a built AnyScene level, with no window (-RenderOffscreen).+# Captures N frames with the CSV profiler (frame/game/render/GPU times) from the PlayerStart (hero camera), and samples+# total GPU memory with nvidia-smi before and during the run.+# powershell -File perf.ps1 [-Map /Game/AnyScene/HK/L_HK] [-ResX 2560] [-ResY 1440] [-Frames 900] [-Extra "r.Lumen.HardwareRayTracing 0"]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneCaustic\AnySceneCaustic.uproject",+ [string]$Map = "/Game/AnyScene/Chamber/L_Chamber",+ [int]$ResX = 2560, [int]$ResY = 1440, [int]$Frames = 900, [int]$TimeoutS = 600,+ [string]$Tag = "perf", [string]$Extra = ""+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor.exe"+$saved = Join-Path (Split-Path $Project) "Saved"+$csvDir = Join-Path $saved "Profiling\CSV"+$before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+$mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+# The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+$cmds = "r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+if ($Extra) { $cmds = "$Extra,$cmds" }+$args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+$proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+$peak = $mem0+$sw = [Diagnostics.Stopwatch]::StartNew()+$csv = $null+while (-not $proc.HasExited -and $sw.Elapsed.TotalSeconds -lt $TimeoutS) {+ Start-Sleep -Seconds 2+ $m = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ if ($m -gt $peak) { $peak = $m }+ $new = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | Where-Object { $before -notcontains $_.FullName }+ if ($new) {+ $f = $new | Sort-Object LastWriteTime | Select-Object -Last 1+ # The CSV is written when the capture ends; wait until the file stops growing.+ $s1 = $f.Length; Start-Sleep -Seconds 3; $s2 = (Get-Item $f.FullName).Length+ if ($s1 -eq $s2 -and $s2 -gt 0) { $csv = $f.FullName; break }+ }+}+if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force }+"gpu_mem_before_mb=$mem0 gpu_mem_peak_mb=$peak delta_mb=$($peak - $mem0)"+"csv=$csv"diff --git a/unreal_caustic/render_cycles_refs.py b/unreal_caustic/render_cycles_refs.pynew file mode 100644index 0000000..38c9425--- /dev/null+++ b/unreal_caustic/render_cycles_refs.py@@ -0,0 +1,73 @@+"""Cycles reference frames for the Unreal comparison: scene cameras at one frame, plus an optional push-in clip that+matches build_level.py's ANYSCENE_DOLLY="cam>fwdN:frames" (camera moved N cm along its view axis, linearly).+ blender -b <copy.blend> --python render_cycles_refs.py -- --out <dir> --cams a,b,c [--frame 60] [--res 1920x804]+ [--spp 128] [--dolly cam:150:96] [--dolly-res 960x402] [--dolly-spp 32] [--dolly-from F] [--gpu]+Writes <out>/<cam>.png (the scene's view transform, e.g. AgX) and <out>/dolly/<frame>.png. Never saves the .blend.+"""+import os+import sys+import time++import bpy++argv = sys.argv[sys.argv.index("--") + 1:]+++def arg(n, d=None):+ return argv[argv.index(n) + 1] if n in argv else d+++OUT = arg("--out")+CAMS = [c for c in arg("--cams", "").split(",") if c]+FRAME = int(arg("--frame", "60"))+W, H = (int(x) for x in arg("--res", "1920x804").split("x"))+SPP = int(arg("--spp", "128"))+sc = bpy.context.scene+sc.render.engine = "CYCLES"+if "--gpu" in argv:+ prefs = bpy.context.preferences.addons["cycles"].preferences+ prefs.compute_device_type = "OPTIX"+ prefs.get_devices()+ for d in prefs.devices:+ d.use = d.type == "OPTIX"+ sc.cycles.device = "GPU"+sc.cycles.samples = SPP+sc.cycles.use_denoising = True+sc.render.resolution_x, sc.render.resolution_y, sc.render.resolution_percentage = W, H, 100+sc.render.image_settings.file_format = "PNG"+os.makedirs(OUT, exist_ok=True)+sc.frame_set(FRAME)+for c in CAMS:+ t = time.time()+ sc.camera = bpy.data.objects[c]+ sc.render.filepath = os.path.join(OUT, c + ".png")+ bpy.ops.render.render(write_still=True)+ print("REF", c, FRAME, f"{time.time() - t:.1f}s", flush=True)+if arg("--dolly"):+ cam, dist, n = arg("--dolly").split(":")+ src = bpy.data.objects[cam]+ o = src.copy()+ o.data = src.data.copy()+ o.data.dof.use_dof = False # the Unreal dolly camera has DOF off+ o.animation_data_clear()+ sc.collection.objects.link(o)+ mw = src.matrix_world.copy()+ fwd = (mw.to_3x3() @ __import__("mathutils").Vector((0, 0, -1))).normalized()+ p0 = mw.translation.copy()+ dw, dh = (int(x) for x in arg("--dolly-res", "960x402").split("x"))+ sc.render.resolution_x, sc.render.resolution_y = dw, dh+ sc.cycles.samples = int(arg("--dolly-spp", "32"))+ sc.camera = o+ d = os.path.join(OUT, "dolly")+ os.makedirs(d, exist_ok=True)+ n = int(n)+ step = int(arg("--dolly-step", "1"))+ for f in range(int(arg("--dolly-from", "0")), n + 1, step):+ sc.frame_set(FRAME + f)+ m = mw.copy()+ m.translation = p0 + fwd * (float(dist) / 100.0) * f / n+ o.matrix_world = m+ sc.render.filepath = os.path.join(d, f"{f:04d}.png")+ t = time.time()+ bpy.ops.render.render(write_still=True)+ print("DOLLY", f, f"{time.time() - t:.1f}s", flush=True)diff --git a/unreal_caustic/render_mrq.ps1 b/unreal_caustic/render_mrq.ps1new file mode 100644index 0000000..f7b961a--- /dev/null+++ b/unreal_caustic/render_mrq.ps1@@ -0,0 +1,21 @@+# Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+# UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+# powershell -File render_mrq.ps1 [-Cams hero_axial,hero_lounge] [-Config MRQ_Still|MRQ_Linear|MRQ_Clip]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneCaustic\AnySceneCaustic.uproject",+ [string]$Dest = "/Game/AnyScene/Chamber", [string]$Level = "L_Chamber",+ [string]$Cams = "hero_axial,hero_lounge,pv_bench_wall", [string]$Config = "MRQ_Still",+ [int]$ResX = 1920, [int]$ResY = 804+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"+# Async compilation off (props render invisible / placeholder under -RenderOffscreen otherwise), Niagara waits for+# its shaders, no texture streaming (low mips in a short session).+$dp = "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1,r.TextureStreaming=0"+foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed "-resx=$ResX" "-resy=$ResY" -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+ $dp | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+}diff --git a/unreal_caustic/render_shots.py b/unreal_caustic/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal_caustic/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_caustic/run_chamber.sh b/unreal_caustic/run_chamber.shnew file mode 100644index 0000000..ab3a46d--- /dev/null+++ b/unreal_caustic/run_chamber.sh@@ -0,0 +1,34 @@+#!/usr/bin/env bash+# Scene-specific driver for the caustics chamber (AnySceneCaustic project). Stages: export, cycles, build, mrq, sbs.+# bash run_chamber.sh build mrq sbs+set -e+export MSYS_NO_PATHCONV=1+HERE="$(cd "$(dirname "$0")" && (pwd -W 2>/dev/null || pwd))"+R=C:/Users/apek-anna/Developer/anyscene-unreal+W=$R/caustic+EXP=$W/export+B="C:/Program Files/Blender Foundation/Blender 5.0/blender.exe"+UE="C:/Program Files/Epic Games/UE_5.8/Engine/Binaries/Win64/UnrealEditor-Cmd.exe"+PROJ=$R/AnySceneCaustic/AnySceneCaustic.uproject+CAMS=hero_axial,hero_lounge,pv_bench_wall+FF="C:/Users/apek-anna/AppData/Local/CapCut/Apps/9.5.0.4050/ffmpeg.exe"+for st in "$@"; do+ t0=$(date +%s)+ case $st in+ export) bash "$(dirname "$0")/export.sh" "$W/work/chamber_copy.blend" "$EXP" --gpu --frame 60 ;;+ merge) "$B" -b "$W/work/chamber_copy.blend" --python "$HERE/export_blend.py" -- --out "$EXP" --frame 60 --no-bake > "$W/export_merge.log" 2>&1+ grep "^EXPORT wrote\|EXPORT gobo" "$W/export_merge.log" ;;+ cycles) "$B" -b "$W/work/chamber_copy.blend" --python "$HERE/render_cycles_refs.py" -- --out "$W/cycles" --cams $CAMS \+ --frame 60 --res 1920x804 --spp 128 --gpu --dolly hero_axial:150:96 --dolly-res 960x402 --dolly-spp 24 > "$W/cycles.log" 2>&1+ grep "^REF\|^DOLLY 96" "$W/cycles.log" ;;+ build) ANYSCENE_EXPORT=$EXP ANYSCENE_DEST=/Game/AnyScene/Chamber ANYSCENE_LEVEL=L_Chamber ANYSCENE_HERO=hero_axial \+ ANYSCENE_MRQ_RES=1920x804 ANYSCENE_MESH_BATCH=8 ANYSCENE_DOLLY="hero_axial>fwd150:96:dolly_axial" \+ "$UE" "$PROJ" -run=pythonscript -script="$HERE/build_level.py" -unattended -nosplash -nop4 -log=build.log > "$W/build_ue.log" 2>&1+ grep "ANYSCENE" "$W/build_ue.log" | grep -v LogInit | tail -25 ;;+ mrq) powershell -NoProfile -File "$HERE/render_mrq.ps1" -Cams $CAMS -Config MRQ_Still+ powershell -NoProfile -File "$HERE/render_mrq.ps1" -Cams $CAMS -Config MRQ_Linear ;;+ clip) powershell -NoProfile -File "$HERE/render_mrq.ps1" -Cams dolly_axial -Config MRQ_Clip ;;+ *) echo "unknown stage $st"; exit 1 ;;+ esac+ echo "STAGE $st $(( $(date +%s) - t0 ))s"+donediff --git a/unreal_caustic/scene_defaults.patch b/unreal_caustic/scene_defaults.patchnew file mode 100644index 0000000..b4de3e2--- /dev/null+++ b/unreal_caustic/scene_defaults.patch@@ -0,0 +1,58 @@+--- unreal/render_mrq.ps1 2026-11-01 18:37:16.501042600 -0800++++ unreal_caustic/render_mrq.ps1 2026-11-01 20:21:08.228280500 -0800+@@ -1,17 +1,21 @@+ # Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+ # UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+-# powershell -File render_mrq.ps1 [-Cams cam_street,cam_table,cam_wok] [-Config MRQ_Still|MRQ_Linear]++# powershell -File render_mrq.ps1 [-Cams hero_axial,hero_lounge] [-Config MRQ_Still|MRQ_Linear|MRQ_Clip]+ param(+- [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+- [string]$Dest = "/Game/AnyScene/HK", [string]$Level = "L_HK",+- [string]$Cams = "cam_street,cam_table,cam_wok", [string]$Config = "MRQ_Still"++ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneCaustic\AnySceneCaustic.uproject",++ [string]$Dest = "/Game/AnyScene/Chamber", [string]$Level = "L_Chamber",++ [string]$Cams = "hero_axial,hero_lounge,pv_bench_wall", [string]$Config = "MRQ_Still",++ [int]$ResX = 1920, [int]$ResY = 804+ )+ $ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"++# Async compilation off (props render invisible / placeholder under -RenderOffscreen otherwise), Niagara waits for++# its shaders, no texture streaming (low mips in a short session).++$dp = "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1,r.TextureStreaming=0"+ foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+- -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+- "-dpcvars=Editor.AsyncAssetCompilation=0" | Out-Null++ -RenderOffscreen -windowed "-resx=$ResX" "-resy=$ResY" -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `++ $dp | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+ }+--- unreal/perf.ps1 2026-11-01 20:25:28.278341600 -0800++++ unreal_caustic/perf.ps1 2026-11-01 20:21:31.117259300 -0800+@@ -3,8 +3,8 @@+ # total GPU memory with nvidia-smi before and during the run.+ # powershell -File perf.ps1 [-Map /Game/AnyScene/HK/L_HK] [-ResX 2560] [-ResY 1440] [-Frames 900] [-Extra "r.Lumen.HardwareRayTracing 0"]+ param(+- [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+- [string]$Map = "/Game/AnyScene/HK/L_HK",++ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneCaustic\AnySceneCaustic.uproject",++ [string]$Map = "/Game/AnyScene/Chamber/L_Chamber",+ [int]$ResX = 2560, [int]$ResY = 1440, [int]$Frames = 900, [int]$TimeoutS = 600,+ [string]$Tag = "perf", [string]$Extra = ""+ )+@@ -14,12 +14,11 @@+ $before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+ $mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ # The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+-# -resx/-resy are ignored under -RenderOffscreen (the HK run captured 1066x600 until r.setres was passed by hand).+-$cmds = "r.setres ${ResX}x${ResY}w,r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"++$cmds = "r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+ if ($Extra) { $cmds = "$Extra,$cmds" }+ $args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+- "-dpcvars=Editor.AsyncAssetCompilation=0") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items++ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+ $proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+ $peak = $mem0+ $sw = [Diagnostics.Stopwatch]::StartNew()diff --git a/unreal_caustic/side_by_side.py b/unreal_caustic/side_by_side.pynew file mode 100644index 0000000..00cb893--- /dev/null+++ b/unreal_caustic/side_by_side.py@@ -0,0 +1,52 @@+"""Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.+File names are patterns: SBS_CYC="{cam}_graded.png", SBS_UE="cam_{cam}.png" (e.g. SBS_UE="SEQ_{cam}.0000.png" for MRQ).+SBS_CYC_LABEL sets the left label (default "Cycles graded").+"""+import os+import sys++from PIL import Image, ImageDraw, ImageFont++cyc, ue, out = sys.argv[1:4]+cams = (sys.argv[4] if len(sys.argv) > 4 else "street,table,wok").split(",")+os.makedirs(out, exist_ok=True)+H = 804+LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")+CYC_LABEL = os.environ.get("SBS_CYC_LABEL", "Cycles graded")+CYC_FMT = os.environ.get("SBS_CYC", "{cam}_graded.png")+UE_FMT = os.environ.get("SBS_UE", "cam_{cam}.png")+try:+ font = ImageFont.truetype("arial.ttf", 28)+except OSError:+ font = ImageFont.load_default()+++def fit(p):+ im = Image.open(p).convert("RGB")+ return im.resize((round(im.width * H / im.height), H), Image.LANCZOS)+++rows = []+for c in cams:+ a = fit(os.path.join(cyc, CYC_FMT.format(cam=c)))+ up = os.path.join(ue, UE_FMT.format(cam=c))+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+ for x, t in ((12, f"{CYC_LABEL} {c}"), (a.width + 20, f"{LABEL} {c}")):+ d.rectangle([x - 6, 8, x + 12 + int(d.textlength(t, font=font)), 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)+ print("wrote", os.path.join(out, f"{c}.png"))+w = max(r.width for r in rows)+allim = Image.new("RGB", (w, sum(r.height for r in rows) + 8 * (len(rows) - 1)), (255, 255, 255))+y = 0+for r in rows:+ allim.paste(r, (0, y))+ y += r.height + 8+allim.resize((allim.width // 2, allim.height // 2), Image.LANCZOS).save(os.path.join(out, "all.png"))diff --git a/unreal_demo/bake_cams.py b/unreal_demo/bake_cams.pynew file mode 100644index 0000000..90c0787--- /dev/null+++ b/unreal_demo/bake_cams.py@@ -0,0 +1,86 @@+"""Bake camrig shots to per-frame camera JSON in Unreal space (for an exact Cycles <-> Unreal camera match).++ blender -b scenes/hk-dai-pai-dong/hk.blend --python unreal_demo/bake_cams.py -- \+ --shots scenes/hk-dai-pai-dong/shots.json --only h1_walk_in_to_wok,s1_street_crane --out unreal_demo/cams++Builds each rig exactly as the finals were rendered (render_finals.sh calls shoot.py with --only <shot>, so every+shot was built with seed 0), evaluates the camera per frame (base path, Track To aim, handheld noise / walk bake, roll,+lens, f-stop, focus empty) and writes <out>/<shot>.json. Frames 0 and N+1 are included so motion-blur subframes in+Unreal have keys on both sides of the shot. Never saves the .blend.++Conventions are export_blend.py's: Blender (x, y, z) m -> Unreal (x, -y, z) * 100; the camera's forward (-Z local)+and up (+Y local) are flipped the same way and turned into a rotator in Unreal with make_rot_from_xz.+Focus distance is the depth of the focus empty along the view axis (what Blender's DOF uses; Unreal's manual focus+distance is also a plane distance).+"""+import argparse+import json+import math+import os+import sys++import bpy+from mathutils import Vector++ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))+sys.path.insert(0, os.path.join(ROOT, "camera"))+import camrig # noqa: E402++a = argparse.ArgumentParser()+a.add_argument("--shots", required=True)+a.add_argument("--only", required=True)+a.add_argument("--out", required=True)+a.add_argument("--seed", type=int, default=0)+args = a.parse_args(sys.argv[sys.argv.index("--") + 1:])++cfg = json.load(open(args.shots, encoding="utf-8"))+only = [x for x in args.only.split(",") if x]+shots = {s["name"]: camrig.merged(cfg.get("defaults", {}), s) for s in cfg["shots"]}+os.makedirs(args.out, exist_ok=True)+sc = bpy.context.scene+++def flip(v):+ return [v[0], -v[1], v[2]]+++for name in only:+ s = shots[name]+ cam = camrig.build(s, seed=args.seed)+ w, h = camrig.res_for(s)+ n = int(s.get("frames", 120))+ fps = int(s.get("fps", 24))+ cd = cam.data+ sw = cd.sensor_width+ frames = []+ for f in range(0, n + 2):+ sc.frame_set(f)+ dg = bpy.context.evaluated_depsgraph_get()+ ce = cam.evaluated_get(dg)+ mw = ce.matrix_world.copy()+ r = mw.to_3x3().normalized()+ fwd = r @ Vector((0, 0, -1))+ up = r @ Vector((0, 1, 0))+ pos = mw.translation+ cde = ce.data+ foc_cm = None+ if cde.dof.use_dof and cde.dof.focus_object:+ fo = cde.dof.focus_object.evaluated_get(dg)+ foc_cm = abs((fo.matrix_world.translation - pos).dot(fwd)) * 100+ frames.append({+ "blender_frame": f,+ "matrix_world": [list(row) for row in mw],+ "loc": [pos.x * 100, -pos.y * 100, pos.z * 100],+ "forward": flip(fwd), "up": flip(up),+ "lens_mm": cde.lens, "fstop": cde.dof.aperture_fstop if cde.dof.use_dof else 22.0,+ "focus_cm": foc_cm,+ })+ out = {"shot": name, "fps": fps, "frames_n": n, "res": [w, h], "sensor_width_mm": sw,+ "sensor_height_mm": sw * h / w, "dof": bool(cd.dof.use_dof), "seed": args.seed,+ "shutter_deg": float(s.get("shutter", 180)), "frames": frames}+ p = os.path.join(args.out, name + ".json")+ json.dump(out, open(p, "w"), indent=0)+ f1 = frames[1]+ print(f"BAKE {name}: {n} f @ {fps} fps, {w}x{h}, sensor {sw:.2f} mm, lens {f1['lens_mm']:.1f}, "+ f"focus {f1['focus_cm']}, f/{f1['fstop']:.1f} -> {p}", flush=True)+print("BAKE done", flush=True)diff --git a/unreal_demo/cams/h1_walk_in_to_wok.json b/unreal_demo/cams/h1_walk_in_to_wok.jsonnew file mode 100644index 0000000..1205f1e--- /dev/null+++ b/unreal_demo/cams/h1_walk_in_to_wok.json@@ -0,0 +1,22670 @@+{+"shot": "h1_walk_in_to_wok",+"fps": 24,+"frames_n": 480,+"res": [+1920,+804+],+"sensor_width_mm": 24.889999389648438,+"sensor_height_mm": 10.422687244415282,+"dof": true,+"seed": 0,+"shutter_deg": 180.0,+"frames": [+{+"blender_frame": 0,+"matrix_world": [+[+0.8388097882270813,+0.011909877881407738,+0.5442944765090942,+3.8939390182495117+],+[+0.5444228649139404,+-0.015714630484580994,+-0.8386636972427368,+-5.602962493896484+],+[+-0.0014349963748827577,+0.9998055696487427,+-0.019665593281388283,+1.4667081832885742+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+389.3939018249512,+560.2962493896484,+146.67081832885742+],+"forward": [+-0.5442944765090942,+-0.8386636972427368,+0.019665593281388283+],+"up": [+0.011909877881407738,+0.015714630484580994,+0.9998055696487427+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 1048.5509048448876+},+{+"blender_frame": 1,+"matrix_world": [+[+0.8388097882270813,+0.011909877881407738,+0.5442944765090942,+3.8939390182495117+],+[+0.5444228649139404,+-0.015714630484580994,+-0.8386636972427368,+-5.602962493896484+],+[+-0.0014349963748827577,+0.9998055696487427,+-0.019665593281388283,+1.4667081832885742+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+389.3939018249512,+560.2962493896484,+146.67081832885742+],+"forward": [+-0.5442944765090942,+-0.8386636972427368,+0.019665593281388283+],+"up": [+0.011909877881407738,+0.015714630484580994,+0.9998055696487427+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 1048.5509048448876+},+{+"blender_frame": 2,+"matrix_world": [+[+0.8387117385864258,+0.01183476485311985,+0.544447124004364,+3.89300537109375+],+[+0.5445740222930908,+-0.015704326331615448,+-0.8385658264160156,+-5.602740287780762+],+[+-0.00137405248824507,+0.9998065829277039,+-0.01961630955338478,+1.4663150310516357+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+389.300537109375,+560.2740287780762,+146.63150310516357+],+"forward": [+-0.544447124004364,+-0.8385658264160156,+0.01961630955338478+],+"up": [+0.011834766715765,+0.015704328194260597,+0.9998067021369934+],+"lens_mm": 24.00002098083496,+"fstop": 2.799999952316284,+"focus_cm": 1048.4820841113105+},+{+"blender_frame": 3,+"matrix_world": [+[+0.8385993838310242,+0.011750226840376854,+0.5446219444274902,+3.892036199569702+],+[+0.5447471737861633,+-0.01568363606929779,+-0.8384537696838379,+-5.602240085601807+],+[+-0.0013103700475767255,+0.9998080134391785,+-0.019553188234567642,+1.4659314155578613+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+389.2036199569702,+560.2240085601807,+146.59314155578613+],+"forward": [+-0.5446219444274902,+-0.8384537696838379,+0.019553188234567642+],+"up": [+0.011750226840376854,+0.01568363606929779,+0.9998080134391785+],+"lens_mm": 24.000085830688477,+"fstop": 2.799999952316284,+"focus_cm": 1048.3877584338188+},+{+"blender_frame": 4,+"matrix_world": [+[+0.8384731411933899,+0.01165842730551958,+0.5448182821273804,+3.891038179397583+],+[+0.5449416637420654,+-0.015655793249607086,+-0.8383278846740723,+-5.6014604568481445+],+[+-0.001244023093022406,+0.9998095631599426,+-0.01948012225329876,+1.4655646085739136+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+389.1038179397583,+560.1460456848145,+146.55646085739136+],+"forward": [+-0.5448182821273804,+-0.8383278846740723,+0.01948012225329876+],+"up": [+0.011658426374197006,+0.015655791386961937,+0.9998094439506531+],+"lens_mm": 24.000192642211914,+"fstop": 2.799999952316284,+"focus_cm": 1048.2681955909356+},+{+"blender_frame": 5,+"matrix_world": [+[+0.8383331298828125,+0.01156151294708252,+0.5450356006622314,+3.8900179862976074+],+[+0.5451568961143494,+-0.0156240314245224,+-0.8381884098052979,+-5.600401878356934+],+[+-0.0011750732082873583,+0.999811053276062,+-0.019400984048843384,+1.465221881866455+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+389.00179862976074,+560.0401878356934,+146.5221881866455+],+"forward": [+-0.5450356006622314,+-0.8381884098052979,+0.019400984048843384+],+"up": [+0.011561513878405094,+0.01562403328716755,+0.9998111724853516+],+"lens_mm": 24.000343322753906,+"fstop": 2.799999952316284,+"focus_cm": 1048.123734118417+},+{+"blender_frame": 6,+"matrix_world": [+[+0.8381801247596741,+0.01146161649376154,+0.5452730059623718,+3.888981580734253+],+[+0.5453924536705017,+-0.015591580420732498,+-0.8380358219146729,+-5.599063873291016+],+[+-0.0011035772040486336,+0.9998127818107605,+-0.019319629296660423,+1.4649101495742798+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.8981580734253,+559.9063873291016,+146.49101495742798+],+"forward": [+-0.5452730059623718,+-0.8380358219146729,+0.019319629296660423+],+"up": [+0.01146161649376154,+0.015591580420732498,+0.9998127818107605+],+"lens_mm": 24.000537872314453,+"fstop": 2.799999952316284,+"focus_cm": 1047.954594856128+},+{+"blender_frame": 7,+"matrix_world": [+[+0.8380146622657776,+0.011351202614605427,+0.5455296635627747,+3.8879411220550537+],+[+0.5456467270851135,+-0.015566733665764332,+-0.837870717048645,+-5.597442150115967+],+[+-0.0010187256848439574,+0.9998143911361694,+-0.019238900393247604,+1.4646347761154175+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.79411220550537,+559.7442150115967,+146.46347761154175+],+"forward": [+-0.5455296635627747,+-0.837870717048645,+0.019238900393247604+],+"up": [+0.011351202614605427,+0.015566733665764332,+0.9998143911361694+],+"lens_mm": 24.000774383544922,+"fstop": 2.799999952316284,+"focus_cm": 1047.7610061410815+},+{+"blender_frame": 8,+"matrix_world": [+[+0.8378374576568604,+0.011236988939344883,+0.5458042025566101,+3.8868978023529053+],+[+0.5459190011024475,+-0.015547767281532288,+-0.8376936316490173,+-5.595541000366211+],+[+-0.0009271163144148886,+0.9998160004615784,+-0.019160985946655273,+1.4643990993499756+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.6897802352905,+559.5541000366211,+146.43990993499756+],+"forward": [+-0.5458042025566101,+-0.8376936316490173,+0.019160985946655273+],+"up": [+0.011236988939344883,+0.015547767281532288,+0.9998160004615784+],+"lens_mm": 24.001052856445312,+"fstop": 2.799999952316284,+"focus_cm": 1047.5431899540126+},+{+"blender_frame": 9,+"matrix_world": [+[+0.8376492261886597,+0.011119645088911057,+0.5460953116416931,+3.8858563899993896+],+[+0.5462079048156738,+-0.015536930412054062,+-0.8375054597854614,+-5.593358993530273+],+[+-0.0008281196351163089,+0.9998174905776978,+-0.019088134169578552,+1.464207649230957+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.58563899993896,+559.3358993530273,+146.4207649230957+],+"forward": [+-0.5460953712463379,+-0.837505578994751,+0.0190881360322237+],+"up": [+0.011119645088911057,+0.015536930412054062,+0.9998174905776978+],+"lens_mm": 24.00137710571289,+"fstop": 2.799999952316284,+"focus_cm": 1047.3013433860615+},+{+"blender_frame": 10,+"matrix_world": [+[+0.8374512195587158,+0.01099964790046215,+0.5464014410972595,+3.884821891784668+],+[+0.5465116500854492,+-0.015536097809672356,+-0.837307333946228,+-5.590897560119629+],+[+-0.0007211386109702289,+0.9998188018798828,+-0.019022157415747643,+1.4640631675720215+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.4821891784668,+559.0897560119629,+146.40631675720215+],+"forward": [+-0.5464014410972595,+-0.837307333946228,+0.019022157415747643+],+"up": [+0.01099964790046215,+0.015536097809672356,+0.9998188018798828+],+"lens_mm": 24.001741409301758,+"fstop": 2.799999952316284,+"focus_cm": 1047.035706974566+},+{+"blender_frame": 11,+"matrix_world": [+[+0.8372442722320557,+0.010877256281673908,+0.5467208623886108,+3.8837976455688477+],+[+0.5468287467956543,+-0.015546733513474464,+-0.8371002078056335,+-5.5881571769714355+],+[+-0.0006056306301616132,+0.9998199939727783,+-0.018964411690831184,+1.4639688730239868+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.37976455688477,+558.8157176971436,+146.39688730239868+],+"forward": [+-0.5467208623886108,+-0.8371002078056335,+0.018964411690831184+],+"up": [+0.010877256281673908,+0.015546733513474464,+0.9998199939727783+],+"lens_mm": 24.00214958190918,+"fstop": 2.799999952316284,+"focus_cm": 1046.7465840512887+},+{+"blender_frame": 12,+"matrix_world": [+[+0.8370299339294434,+0.010752649046480656,+0.5470514893531799,+3.8827877044677734+],+[+0.547156810760498,+-0.015569961629807949,+-0.8368852138519287,+-5.585139751434326+],+[+-0.0004811626859009266,+0.9998209476470947,+-0.01891590841114521,+1.4639264345169067+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.27877044677734,+558.5139751434326,+146.39264345169067+],+"forward": [+-0.5470514893531799,+-0.8368852138519287,+0.01891590841114521+],+"up": [+0.010752649046480656,+0.015569961629807949,+0.9998209476470947+],+"lens_mm": 24.002601623535156,+"fstop": 2.799999952316284,+"focus_cm": 1046.4341562706977+},+{+"blender_frame": 13,+"matrix_world": [+[+0.8368094563484192,+0.010625917464494705,+0.5473911762237549,+3.8817949295043945+],+[+0.5474941730499268,+-0.015606356784701347,+-0.8366640210151672,+-5.581845283508301+],+[+-0.000347541063092649,+0.9998217821121216,+-0.018877174705266953,+1.4639378786087036+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.17949295043945,+558.1845283508301,+146.39378786087036+],+"forward": [+-0.5473911762237549,+-0.8366640210151672,+0.018877174705266953+],+"up": [+0.010625917464494705,+0.015606356784701347,+0.9998217821121216+],+"lens_mm": 24.003095626831055,+"fstop": 2.799999952316284,+"focus_cm": 1046.0988809121773+},+{+"blender_frame": 14,+"matrix_world": [+[+0.8365846872329712,+0.010497234761714935,+0.5477372407913208,+3.88082218170166+],+[+0.5478377938270569,+-0.015656203031539917,+-0.8364380598068237,+-5.578276634216309+],+[+-0.0002048018795903772,+0.9998222589492798,+-0.018848519772291183,+1.4640051126480103+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+388.082218170166,+557.8276634216309,+146.40051126480103+],+"forward": [+-0.5477372407913208,+-0.8364380598068237,+0.018848519772291183+],+"up": [+0.01049723569303751,+0.015656204894185066,+0.9998223781585693+],+"lens_mm": 24.003633499145508,+"fstop": 2.799999952316284,+"focus_cm": 1045.74075860437+},+{+"blender_frame": 15,+"matrix_world": [+[+0.8363569378852844,+0.010366963222622871,+0.5480872392654419,+3.879870653152466+],+[+0.5481852889060974,+-0.01571960374712944,+-0.8362091183662415,+-5.574434757232666+],+[+-5.3234871302265674e-05,+0.999822735786438,+-0.01883021369576454,+1.4641293287277222+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.9870653152466,+557.4434757232666,+146.41293287277222+],+"forward": [+-0.5480872988700867,+-0.836209237575531,+0.01883021555840969+],+"up": [+0.010366963222622871,+0.01571960374712944,+0.999822735786438+],+"lens_mm": 24.004213333129883,+"fstop": 2.799999952316284,+"focus_cm": 1045.360268233344+},+{+"blender_frame": 16,+"matrix_world": [+[+0.8361284136772156,+0.010235657915472984,+0.5484383702278137,+3.878941059112549+],+[+0.5485337972640991,+-0.015796437859535217,+-0.835979163646698,+-5.570323467254639+],+[+0.00010657520761014894,+0.9998228549957275,+-0.018822453916072845,+1.4643124341964722+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.8941059112549,+557.0323467254639,+146.43124341964722+],+"forward": [+-0.5484383702278137,+-0.835979163646698,+0.018822453916072845+],+"up": [+0.010235657915472984,+0.015796437859535217,+0.9998228549957275+],+"lens_mm": 24.00483512878418,+"fstop": 2.799999952316284,+"focus_cm": 1044.9577187886462+},+{+"blender_frame": 17,+"matrix_world": [+[+0.8359007239341736,+0.010104112327098846,+0.5487877130508423,+3.8780338764190674+],+[+0.5488806366920471,+-0.01588638871908188,+-0.8357498049736023,+-5.565946102142334+],+[+0.00027374475030228496,+0.9998226761817932,+-0.01882539689540863,+1.4645564556121826+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.80338764190674,+556.5946102142334,+146.45564556121826+],+"forward": [+-0.5487877130508423,+-0.8357498049736023,+0.01882539689540863+],+"up": [+0.010104113258421421,+0.015886390581727028,+0.9998227953910828+],+"lens_mm": 24.00550079345703,+"fstop": 2.799999952316284,+"focus_cm": 1044.5333934156224+},+{+"blender_frame": 18,+"matrix_world": [+[+0.8356760144233704,+0.009973465465009212,+0.5491321682929993,+3.8771471977233887+],+[+0.5492226481437683,+-0.015989093109965324,+-0.8355230093002319,+-5.561304092407227+],+[+0.00044706545304507017,+0.9998224377632141,+-0.018839353695511818,+1.4648640155792236+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.71471977233887,+556.1304092407227,+146.48640155792236+],+"forward": [+-0.549132227897644,+-0.8355231285095215,+0.018839355558156967+],+"up": [+0.009973465465009212,+0.015989093109965324,+0.9998224377632141+],+"lens_mm": 24.006208419799805,+"fstop": 2.799999952316284,+"focus_cm": 1044.087243359536+},+{+"blender_frame": 19,+"matrix_world": [+[+0.8354561924934387,+0.009845209307968616,+0.5494688749313354,+3.8762786388397217+],+[+0.5495568513870239,+-0.016104109585285187,+-0.8353011012077332,+-5.556402683258057+],+[+0.0006249931175261736,+0.9998218417167664,+-0.018864775076508522,+1.4652376174926758+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.62786388397217,+555.6402683258057,+146.52376174926758+],+"forward": [+-0.5494689345359802,+-0.8353012204170227,+0.01886477693915367+],+"up": [+0.009845209307968616,+0.016104109585285187,+0.9998218417167664+],+"lens_mm": 24.006959915161133,+"fstop": 2.799999952316284,+"focus_cm": 1043.61979465466+},+{+"blender_frame": 20,+"matrix_world": [+[+0.835243284702301,+0.009721172042191029,+0.5497947335243225,+3.8754255771636963+],+[+0.5498800873756409,+-0.01623089797794819,+-0.835085928440094,+-5.55124568939209+],+[+0.0008056496735662222,+0.9998210072517395,+-0.01890222541987896,+1.4656809568405151+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.54255771636963,+555.124568939209,+146.5680956840515+],+"forward": [+-0.5497947335243225,+-0.835085928440094,+0.01890222541987896+],+"up": [+0.009721172042191029,+0.01623089797794819,+0.9998210072517395+],+"lens_mm": 24.007753372192383,+"fstop": 2.799999952316284,+"focus_cm": 1043.131167627871+},+{+"blender_frame": 21,+"matrix_world": [+[+0.8350392580032349,+0.009603474289178848,+0.5501066446304321,+3.8745832443237305+],+[+0.5501895546913147,+-0.016368769109249115,+-0.8348793387413025,+-5.545837879180908+],+[+0.0009868252091109753,+0.9998199343681335,+-0.018952293321490288,+1.4661974906921387+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.45832443237305,+554.5837879180908,+146.61974906921387+],+"forward": [+-0.5501066446304321,+-0.8348793387413025,+0.018952293321490288+],+"up": [+0.009603474289178848,+0.016368769109249115,+0.9998199343681335+],+"lens_mm": 24.008590698242188,+"fstop": 2.799999952316284,+"focus_cm": 1042.6215296145529+},+{+"blender_frame": 22,+"matrix_world": [+[+0.834846019744873,+0.009494470432400703,+0.5504016876220703,+3.873746395111084+],+[+0.5504822731018066,+-0.016516784206032753,+-0.8346834182739258,+-5.540184020996094+],+[+0.0011659888550639153,+0.9998185634613037,+-0.019015507772564888,+1.4667911529541016+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.3746395111084,+554.0184020996094,+146.67911529541016+],+"forward": [+-0.5504016876220703,+-0.8346834182739258,+0.019015507772564888+],+"up": [+0.009494470432400703,+0.016516784206032753,+0.9998185634613037+],+"lens_mm": 24.009469985961914,+"fstop": 2.799999952316284,+"focus_cm": 1042.0910449698567+},+{+"blender_frame": 23,+"matrix_world": [+[+0.8346657156944275,+0.009396613575518131,+0.5506768226623535,+3.872908115386963+],+[+0.5507553815841675,+-0.016673661768436432,+-0.8345001339912415,+-5.53428840637207+],+[+0.0013403241755440831,+0.9998168349266052,+-0.019092166796326637,+1.4674644470214844+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.2908115386963,+553.428840637207,+146.74644470214844+],+"forward": [+-0.5506768822669983,+-0.834500253200531,+0.019092168658971786+],+"up": [+0.009396613575518131,+0.016673661768436432,+0.9998168349266052+],+"lens_mm": 24.010391235351562,+"fstop": 2.799999952316284,+"focus_cm": 1041.5398520417511+},+{+"blender_frame": 24,+"matrix_world": [+[+0.8344998359680176,+0.009312288835644722,+0.5509294867515564,+3.872061252593994+],+[+0.5510061979293823,+-0.016837550327181816,+-0.8343312740325928,+-5.528156757354736+],+[+0.001506769098341465,+0.9998149275779724,+-0.019182059913873672,+1.468219518661499+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.2061252593994,+552.8156757354736,+146.8219518661499+],+"forward": [+-0.5509295463562012,+-0.8343313932418823,+0.01918206177651882+],+"up": [+0.009312288835644722,+0.016837550327181816,+0.9998149275779724+],+"lens_mm": 24.011356353759766,+"fstop": 2.799999952316284,+"focus_cm": 1040.9677462885156+},+{+"blender_frame": 25,+"matrix_world": [+[+0.8343501091003418,+0.00924357958137989,+0.5511573553085327,+3.8711979389190674+],+[+0.5512323379516602,+-0.017005782574415207,+-0.8341785073280334,+-5.52179479598999+],+[+0.0016620663227513433,+0.9998127222061157,+-0.019284136593341827,+1.4690558910369873+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.11979389190674,+552.179479598999,+146.90558910369873+],+"forward": [+-0.5511573553085327,+-0.8341785073280334,+0.019284136593341827+],+"up": [+0.00924357958137989,+0.017005782574415207,+0.9998127222061157+],+"lens_mm": 24.01236343383789,+"fstop": 2.799999952316284,+"focus_cm": 1040.3750128811225+},+{+"blender_frame": 26,+"matrix_world": [+[+0.8342182040214539,+0.009192023426294327,+0.5513579249382019,+3.8703086376190186+],+[+0.5514315366744995,+-0.017174681648612022,+-0.8340433239936829,+-5.515207290649414+],+[+0.0018028488848358393,+0.9998102784156799,+-0.01939620077610016,+1.4699702262878418+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+387.03086376190186,+551.5207290649414,+146.99702262878418+],+"forward": [+-0.5513579249382019,+-0.8340433239936829,+0.01939620077610016+],+"up": [+0.009192023426294327,+0.017174681648612022,+0.9998102784156799+],+"lens_mm": 24.013412475585938,+"fstop": 2.799999952316284,+"focus_cm": 1039.7614935645834+},+{+"blender_frame": 27,+"matrix_world": [+[+0.8341052532196045,+0.009158327244222164,+0.5515292286872864,+3.8693838119506836+],+[+0.5516018271446228,+-0.0173391904681921,+-0.8339272141456604,+-5.50839900970459+],+[+0.0019256919622421265,+0.9998076558113098,+-0.019514460116624832,+1.4709552526474+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+386.93838119506836,+550.839900970459,+147.09552526474+],+"forward": [+-0.5515292882919312,+-0.83392733335495,+0.01951446197926998+],+"up": [+0.009158328175544739,+0.01733919233083725,+0.9998077750205994+],+"lens_mm": 24.014503479003906,+"fstop": 2.799999952316284,+"focus_cm": 1039.1272959532216+},+{+"blender_frame": 28,+"matrix_world": [+[+0.8340125679969788,+0.009142057970166206,+0.5516696572303772,+3.868412733078003+],+[+0.5517417192459106,+-0.017492705956101418,+-0.8338315486907959,+-5.501375198364258+],+[+0.002027258276939392,+0.999805212020874,+-0.019633188843727112,+1.471998929977417+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+386.8412733078003,+550.1375198364258,+147.1998929977417+],+"forward": [+-0.551669716835022,+-0.8338316679000854,+0.01963319070637226+],+"up": [+0.009142057970166206,+0.017492705956101418,+0.999805212020874+],+"lens_mm": 24.01563835144043,+"fstop": 2.799999952316284,+"focus_cm": 1038.471886049956+},+{+"blender_frame": 29,+"matrix_world": [+[+0.8339409232139587,+0.009141418151557446,+0.5517781376838684,+3.8673853874206543+],+[+0.5518498420715332,+-0.017626913264393806,+-0.8337571024894714,+-5.494141101837158+],+[+0.0021044211462140083,+0.9998028874397278,+-0.019744491204619408,+1.47308349609375+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+386.73853874206543,+549.4141101837158,+147.308349609375+],+"forward": [+-0.5517781972885132,+-0.833757221698761,+0.019744493067264557+],+"up": [+0.009141418151557446,+0.017626913264393806,+0.9998028874397278+],+"lens_mm": 24.016815185546875,+"fstop": 2.799999952316284,+"focus_cm": 1037.795470864512+},+{+"blender_frame": 30,+"matrix_world": [+[+0.8338906764984131,+0.009153079241514206,+0.5518537163734436,+3.8662915229797363+],+[+0.5519254207611084,+-0.01773172616958618,+-0.833704948425293,+-5.486699104309082+],+[+0.0021543526090681553,+0.9998008608818054,+-0.019838139414787292,+1.4741851091384888+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+386.62915229797363,+548.6699104309082,+147.41851091384888+],+"forward": [+-0.5518537163734436,+-0.833704948425293,+0.019838139414787292+],+"up": [+0.009153079241514206,+0.01773172616958618,+0.9998008608818054+],+"lens_mm": 24.018033981323242,+"fstop": 2.799999952316284,+"focus_cm": 1037.0977352606133+},+{+"blender_frame": 31,+"matrix_world": [+[+0.8338626027107239,+0.009172016754746437,+0.5518959164619446,+3.865119457244873+],+[+0.5519677996635437,+-0.017795339226722717,+-0.8336754441261292,+-5.479055404663086+],+[+0.0021746910642832518,+0.9997995495796204,+-0.019901523366570473,+1.4752737283706665+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+386.5119457244873,+547.9055404663086,+147.52737283706665+],+"forward": [+-0.5518959760665894,+-0.8336755633354187,+0.019901525229215622+],+"up": [+0.009172017686069012,+0.017795341089367867,+0.9997996687889099+],+"lens_mm": 24.01929473876953,+"fstop": 2.799999952316284,+"focus_cm": 1036.3786304136738+},+{+"blender_frame": 32,+"matrix_world": [+[+0.8338563442230225,+0.009191575460135937,+0.5519049167633057,+3.8638594150543213+],+[+0.5519772171974182,+-0.017804602161049843,+-0.833669126033783,+-5.471210479736328+],+[+0.0021637151949107647,+0.9997992515563965,+-0.019920021295547485,+1.4763147830963135+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+386.38594150543213,+547.1210479736328,+147.63147830963135+],+"forward": [+-0.5519049167633057,+-0.833669126033783,+0.019920021295547485+],+"up": [+0.009191575460135937,+0.017804602161049843,+0.9997992515563965+],+"lens_mm": 24.020597457885742,+"fstop": 2.799999952316284,+"focus_cm": 1035.63756714575+},+{+"blender_frame": 33,+"matrix_world": [+[+0.8338719010353088,+0.009203704074025154,+0.5518813133239746,+3.862501859664917+],+[+0.5519539713859558,+-0.01774561032652855,+-0.8336856961250305,+-5.463167190551758+],+[+0.0021204741206020117,+0.9998002052307129,+-0.019877584651112556,+1.4772679805755615+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+386.2501859664917,+546.3167190551758,+147.72679805755615+],+"forward": [+-0.5518813729286194,+-0.8336858153343201,+0.019877586513757706+],+"up": [+0.009203704074025154,+0.01774561032652855,+0.9998002052307129+],+"lens_mm": 24.021944046020508,+"fstop": 2.799999952316284,+"focus_cm": 1034.8745981696993+},+{+"blender_frame": 34,+"matrix_world": [+[+0.8339085578918457,+0.009199204854667187,+0.5518260598182678,+3.8610379695892334+],+[+0.5518990159034729,+-0.01760435476899147,+-0.8337251543998718,+-5.45492696762085+],+[+0.002044932683929801,+0.9998027086257935,+-0.019757451489567757,+1.4780919551849365+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+386.10379695892334,+545.492696762085,+147.80919551849365+],+"forward": [+-0.5518261194229126,+-0.8337252736091614,+0.019757453352212906+],+"up": [+0.009199204854667187,+0.01760435476899147,+0.9998027086257935+],+"lens_mm": 24.023330688476562,+"fstop": 2.799999952316284,+"focus_cm": 1034.0894385939464+},+{+"blender_frame": 35,+"matrix_world": [+[+0.8339651823043823,+0.009168395772576332,+0.5517407655715942,+3.859459400177002+],+[+0.5518134832382202,+-0.017367979511618614,+-0.83378666639328,+-5.446490287780762+],+[+0.0019381365273147821,+0.9998071789741516,+-0.019543536007404327,+1.4787458181381226+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+385.9459400177002,+544.6490287780762,+147.87458181381226+],+"forward": [+-0.5517407655715942,+-0.83378666639328,+0.019543536007404327+],+"up": [+0.009168395772576332,+0.017367979511618614,+0.9998071789741516+],+"lens_mm": 24.024761199951172,+"fstop": 2.799999952316284,+"focus_cm": 1033.2814369350672+},+{+"blender_frame": 36,+"matrix_world": [+[+0.8340409994125366,+0.00910169631242752,+0.5516273379325867,+3.857759714126587+],+[+0.5516994595527649,+-0.017025893554091454,+-0.8338690996170044,+-5.437856197357178+],+[+0.001802325015887618,+0.9998136162757874,+-0.01922169327735901,+1.4791923761367798+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+385.7759714126587,+543.7856197357178,+147.91923761367798+],+"forward": [+-0.5516273975372314,+-0.833869218826294,+0.019221695140004158+],+"up": [+0.00910169631242752,+0.017025893554091454,+0.9998136162757874+],+"lens_mm": 24.02623176574707,+"fstop": 2.799999952316284,+"focus_cm": 1032.4506057426333+},+{+"blender_frame": 37,+"matrix_world": [+[+0.8341342210769653,+0.008990528993308544,+0.5514882802963257,+3.8559346199035645+],+[+0.5515592098236084,+-0.01657126285135746,+-0.8339710831642151,+-5.429023742675781+],+[+0.001641015405766666,+0.9998222589492798,+-0.01878146454691887,+1.4794023036956787+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+385.59346199035645,+542.9023742675781,+147.94023036956787+],+"forward": [+-0.5514883399009705,+-0.8339712023735046,+0.018781466409564018+],+"up": [+0.008990528993308544,+0.01657126285135746,+0.9998222589492798+],+"lens_mm": 24.02774429321289,+"fstop": 2.799999952316284,+"focus_cm": 1031.5961827524006+},+{+"blender_frame": 38,+"matrix_world": [+[+0.8342429399490356,+0.008828064426779747,+0.5513263940811157,+3.853980302810669+],+[+0.5513951778411865,+-0.016002291813492775,+-0.8340907692909241,+-5.419990062713623+],+[+0.0014590788632631302,+0.9998329281806946,+-0.018217550590634346,+1.4793576002120972+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+385.3980302810669,+541.9990062713623,+147.93576002120972+],+"forward": [+-0.5513263940811157,+-0.8340907692909241,+0.018217550590634346+],+"up": [+0.008828065358102322,+0.016002293676137924,+0.9998330473899841+],+"lens_mm": 24.029300689697266,+"fstop": 2.799999952316284,+"focus_cm": 1030.7177607668564+},+{+"blender_frame": 39,+"matrix_world": [+[+0.83436518907547,+0.008610089309513569,+0.5511447787284851,+3.851895809173584+],+[+0.5512106418609619,+-0.015323549509048462,+-0.8342253565788269,+-5.410751819610596+],+[+0.0012627402320504189,+0.9998455047607422,+-0.01753140799701214,+1.479055643081665+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+385.1895809173584,+541.0751819610596,+147.9055643081665+],+"forward": [+-0.5511448383331299,+-0.8342254757881165,+0.017531409859657288+],+"up": [+0.008610090240836143,+0.015323551371693611,+0.9998456239700317+],+"lens_mm": 24.03089714050293,+"fstop": 2.799999952316284,+"focus_cm": 1029.8146136803553+},+{+"blender_frame": 40,+"matrix_world": [+[+0.8344985246658325,+0.008335546590387821,+0.5509472489356995,+3.8496811389923096+],+[+0.5510092973709106,+-0.014546755701303482,+-0.834372341632843,+-5.401305675506592+],+[+0.0010595449712127447,+0.9998594522476196,+-0.01673221029341221,+1.478510856628418+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+384.96811389923096,+540.1305675506592,+147.8510856628418+],+"forward": [+-0.5509472489356995,+-0.834372341632843,+0.01673221029341221+],+"up": [+0.008335546590387821,+0.014546755701303482,+0.9998594522476196+],+"lens_mm": 24.032535552978516,+"fstop": 2.799999952316284,+"focus_cm": 1028.8859936408699+},+{+"blender_frame": 41,+"matrix_world": [+[+0.8346402645111084,+0.008006994612514973,+0.5507372617721558,+3.847339391708374+],+[+0.550794780254364,+-0.013691296800971031,+-0.834528386592865,+-5.391645431518555+],+[+0.0008582430309616029,+0.9998742341995239,+-0.015837518498301506,+1.4777567386627197+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+384.7339391708374,+539.1645431518555,+147.77567386627197+],+"forward": [+-0.5507372617721558,+-0.834528386592865,+0.015837518498301506+],+"up": [+0.008006994612514973,+0.013691296800971031,+0.9998742341995239+],+"lens_mm": 24.034215927124023,+"fstop": 2.799999952316284,+"focus_cm": 1027.9311274178326+},+{+"blender_frame": 42,+"matrix_world": [+[+0.8347877860069275,+0.0076304227113723755,+0.5505190491676331,+3.844874620437622+],+[+0.5505715012550354,+-0.012783685699105263,+-0.8346901535987854,+-5.381765842437744+],+[+0.0006686241249553859,+0.9998892545700073,+-0.014872756786644459,+1.476845145225525+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+384.4874620437622,+538.1765842437744,+147.6845145225525+],+"forward": [+-0.5505190491676331,+-0.8346901535987854,+0.014872756786644459+],+"up": [+0.0076304227113723755,+0.012783685699105263,+0.9998892545700073+],+"lens_mm": 24.035938262939453,+"fstop": 2.799999952316284,+"focus_cm": 1026.9494325853884+},+{+"blender_frame": 43,+"matrix_world": [+[+0.8349379897117615,+0.007214931771159172,+0.5502967834472656,+3.8422939777374268+],+[+0.550343930721283,+-0.011856653727591038,+-0.8348539471626282,+-5.37166166305542+],+[+0.0005012645269744098,+0.9999037384986877,+-0.01387026347219944,+1.475842833518982+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+384.2293977737427,+537.166166305542,+147.5842833518982+],+"forward": [+-0.5502967834472656,+-0.8348539471626282,+0.01387026347219944+],+"up": [+0.007214931771159172,+0.011856653727591038,+0.9999037384986877+],+"lens_mm": 24.037700653076172,+"fstop": 2.799999952316284,+"focus_cm": 1025.9405749384314+},+{+"blender_frame": 44,+"matrix_world": [+[+0.8350878953933716,+0.006771671120077372,+0.5500749349594116,+3.839604377746582+],+[+0.5501165986061096,+-0.010946978814899921,+-0.835016131401062,+-5.361325740814209+],+[+0.00036720396019518375,+0.9999171495437622,+-0.012866896577179432,+1.474826455116272+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+383.9604377746582,+536.1325740814209,+147.4826455116272+],+"forward": [+-0.5500749945640564,+-0.8350162506103516,+0.012866898439824581+],+"up": [+0.006771671120077372,+0.010946978814899921,+0.9999171495437622+],+"lens_mm": 24.039505004882812,+"fstop": 2.799999952316284,+"focus_cm": 1024.9040903290734+},+{+"blender_frame": 45,+"matrix_world": [+[+0.8352340459823608,+0.0063125211745500565,+0.5498583316802979,+3.836815357208252+],+[+0.5498945713043213,+-0.010092771612107754,+-0.8351730108261108,+-5.350750923156738+],+[+0.0002775471075437963,+0.9999291896820068,+-0.011901043355464935,+1.4738754034042358+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+383.6815357208252,+535.0750923156738,+147.38754034042358+],+"forward": [+-0.5498583912849426,+-0.8351731300354004,+0.011901045218110085+],+"up": [+0.0063125211745500565,+0.010092771612107754,+0.9999291896820068+],+"lens_mm": 24.041351318359375,+"fstop": 2.799999952316284,+"focus_cm": 1023.839831922669+},+{+"blender_frame": 46,+"matrix_world": [+[+0.8353733420372009,+0.005848386324942112,+0.5496519804000854,+3.833936929702759+],+[+0.5496830344200134,+-0.00933004915714264,+-0.8353212475776672,+-5.339929580688477+],+[+0.00024299928918480873,+0.9999393820762634,+-0.011008833535015583,+1.4730632305145264+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+383.3936929702759,+533.9929580688477,+147.30632305145264+],+"forward": [+-0.5496519804000854,+-0.8353212475776672,+0.011008833535015583+],+"up": [+0.005848386324942112,+0.00933004915714264,+0.9999393820762634+],+"lens_mm": 24.043237686157227,+"fstop": 2.799999952316284,+"focus_cm": 1022.7482026908547+},+{+"blender_frame": 47,+"matrix_world": [+[+0.8355023860931396,+0.005387350916862488,+0.5494604110717773,+3.830979108810425+],+[+0.5494866967201233,+-0.008688999339938164,+-0.8354572653770447,+-5.328855514526367+],+[+0.0002733598812483251,+0.999947726726532,+-0.010219957679510117,+1.4724475145339966+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+383.0979108810425,+532.8855514526367,+147.24475145339966+],+"forward": [+-0.5494604110717773,+-0.8354572653770447,+0.010219957679510117+],+"up": [+0.005387350916862488,+0.008688999339938164,+0.999947726726532+],+"lens_mm": 24.045166015625,+"fstop": 2.799999952316284,+"focus_cm": 1021.6295395395719+},+{+"blender_frame": 48,+"matrix_world": [+[+0.8356180191040039,+0.004933156073093414,+0.5492888689041138,+3.8279523849487305+],+[+0.5493109822273254,+-0.008190633729100227,+-0.8355778455734253,+-5.317520618438721+],+[+0.0003769871545955539,+0.9999542832374573,+-0.009554075077176094,+1.472061038017273+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+382.79523849487305,+531.7520618438721,+147.2061038017273+],+"forward": [+-0.5492889285087585,+-0.8355779647827148,+0.009554076008498669+],+"up": [+0.004933156073093414,+0.008190633729100227,+0.9999542832374573+],+"lens_mm": 24.047136306762695,+"fstop": 2.799999952316284,+"focus_cm": 1020.4842622508295+},+{+"blender_frame": 49,+"matrix_world": [+[+0.8357167840003967,+0.004483858123421669,+0.5491425395011902,+3.82486629486084+],+[+0.5491605997085571,+-0.00784365739673376,+-0.8356800675392151,+-5.305919647216797+],+[+0.0005602145683951676,+0.9999591708183289,+-0.009017433039844036,+1.4719047546386719+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+382.486629486084,+530.5919647216797,+147.1904754638672+],+"forward": [+-0.5491425395011902,+-0.8356800675392151,+0.009017433039844036+],+"up": [+0.004483858589082956,+0.007843658328056335,+0.9999592900276184+],+"lens_mm": 24.04914665222168,+"fstop": 2.799999952316284,+"focus_cm": 1019.31254749652+},+{+"blender_frame": 50,+"matrix_world": [+[+0.8357953429222107,+0.004031493328511715,+0.549026370048523,+3.8217291831970215+],+[+0.5490404367446899,+-0.007642928045243025,+-0.8357608318328857,+-5.294045925140381+],+[+0.00082680449122563,+0.9999626874923706,+-0.008601374924182892,+1.4719436168670654+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+382.17291831970215,+529.4045925140381,+147.19436168670654+],+"forward": [+-0.549026370048523,+-0.8357608318328857,+0.008601374924182892+],+"up": [+0.004031493328511715,+0.007642928045243025,+0.9999626874923706+],+"lens_mm": 24.051197052001953,+"fstop": 2.799999952316284,+"focus_cm": 1018.1148964562453+},+{+"blender_frame": 51,+"matrix_world": [+[+0.8358508348464966,+0.003562577534466982,+0.5489450097084045,+3.8185484409332275+],+[+0.5489553809165955,+-0.007569264154881239,+-0.8358173966407776,+-5.281893253326416+],+[+0.0011774457525461912,+0.9999650716781616,+-0.008282470516860485,+1.4721076488494873+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+381.85484409332275,+528.1893253326416,+147.21076488494873+],+"forward": [+-0.5489450693130493,+-0.8358175158500671,+0.00828247144818306+],+"up": [+0.003562577534466982,+0.007569264154881239,+0.9999650716781616+],+"lens_mm": 24.05328941345215,+"fstop": 2.799999952316284,+"focus_cm": 1016.8913034023717+},+{+"blender_frame": 52,+"matrix_world": [+[+0.8358802795410156,+0.0030598784796893597,+0.5489032864570618,+3.8153293132781982+],+[+0.5489094853401184,+-0.007591344881802797,+-0.8358472585678101,+-5.269461154937744+],+[+0.0016093234298750758,+0.9999665021896362,+-0.008025052025914192,+1.4722977876663208+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+381.5329313278198,+526.9461154937744,+147.22977876663208+],+"forward": [+-0.5489033460617065,+-0.8358473777770996,+0.008025052957236767+],+"up": [+0.0030598784796893597,+0.007591344881802797,+0.9999665021896362+],+"lens_mm": 24.055421829223633,+"fstop": 2.799999952316284,+"focus_cm": 1015.6417305348441+},+{+"blender_frame": 53,+"matrix_world": [+[+0.835880696773529,+0.002505173906683922,+0.5489053726196289,+3.8120744228363037+],+[+0.5489070415496826,+-0.007669330574572086,+-0.8358482122421265,+-5.256744861602783+],+[+0.002115792827680707,+0.9999675750732422,+-0.007785751949995756,+1.4723976850509644+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+381.20744228363037,+525.6744861602783,+147.23976850509644+],+"forward": [+-0.5489054322242737,+-0.835848331451416,+0.007785752881318331+],+"up": [+0.002505173673853278,+0.007669329643249512,+0.9999674558639526+],+"lens_mm": 24.05759620666504,+"fstop": 2.799999952316284,+"focus_cm": 1014.3660378991626+},+{+"blender_frame": 54,+"matrix_world": [+[+0.8358498811721802,+0.0018830187618732452,+0.5489550232887268,+3.8087854385375977+],+[+0.5489516258239746,+-0.007760323118418455,+-0.8358180522918701,+-5.243747234344482+],+[+0.002686206717044115,+0.9999681711196899,+-0.0075201489962637424,+1.4722893238067627+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+380.87854385375977,+524.3747234344482,+147.22893238067627+],+"forward": [+-0.5489550232887268,+-0.8358180522918701,+0.0075201489962637424+],+"up": [+0.0018830187618732452,+0.007760323118418455,+0.9999681711196899+],+"lens_mm": 24.059810638427734,+"fstop": 2.799999952316284,+"focus_cm": 1013.0642929812893+},+{+"blender_frame": 55,+"matrix_world": [+[+0.8357852101325989,+0.0011850143782794476,+0.549055278301239,+3.8054604530334473+],+[+0.5490465760231018,+-0.007824884727597237,+-0.8357551097869873,+-5.230469703674316+],+[+0.003305912483483553,+0.9999686479568481,+-0.007190552540123463,+1.4718713760375977+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+380.5460453033447,+523.0469703674316,+147.18713760375977+],+"forward": [+-0.549055278301239,+-0.8357551097869873,+0.007190552540123463+],+"up": [+0.0011850144946947694,+0.007824885658919811,+0.9999687671661377+],+"lens_mm": 24.06206512451172,+"fstop": 2.799999952316284,+"focus_cm": 1011.736536747776+},+{+"blender_frame": 56,+"matrix_world": [+[+0.8356849551200867,+0.0004138820804655552,+0.54920893907547,+3.8020966053009033+],+[+0.549194872379303,+-0.007833646610379219,+-0.83565753698349,+-5.216919422149658+],+[+0.003956445958465338,+0.9999692440032959,+-0.006773759610950947,+1.471078634262085+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+380.20966053009033,+521.6919422149658,+147.1078634262085+],+"forward": [+-0.5492089986801147,+-0.8356576561927795,+0.006773760542273521+],+"up": [+0.0004138820804655552,+0.007833646610379219,+0.9999692440032959+],+"lens_mm": 24.064359664916992,+"fstop": 2.799999952316284,+"focus_cm": 1010.3830409352668+},+{+"blender_frame": 57,+"matrix_world": [+[+0.8355475664138794,+-0.00041326601058244705,+0.5494179725646973,+3.7986879348754883+],+[+0.5493987798690796,+-0.0077730631455779076,+-0.8355242013931274,+-5.203102111816406+],+[+0.004615954123437405,+0.9999697208404541,+-0.006267717108130455,+1.4698981046676636+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+379.8687934875488,+520.3102111816406,+146.98981046676636+],+"forward": [+-0.5494179725646973,+-0.8355242013931274,+0.006267717108130455+],+"up": [+-0.00041326601058244705,+0.0077730631455779076,+0.9999697208404541+],+"lens_mm": 24.066694259643555,+"fstop": 2.799999952316284,+"focus_cm": 1009.0036741923541+},+{+"blender_frame": 58,+"matrix_world": [+[+0.8353719711303711,+-0.0012631728313863277,+0.5496837496757507,+3.7952280044555664+],+[+0.5496600270271301,+-0.007649207953363657,+-0.8353533744812012,+-5.189032554626465+],+[+0.0052598402835428715,+0.999970018863678,+-0.005695615895092487,+1.4683785438537598+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+379.52280044555664,+518.9032554626465,+146.83785438537598+],+"forward": [+-0.5496838092803955,+-0.8353534936904907,+0.005695616360753775+],+"up": [+-0.0012631728313863277,+0.007649207953363657,+0.999970018863678+],+"lens_mm": 24.069068908691406,+"fstop": 2.799999952316284,+"focus_cm": 1007.599729305366+},+{+"blender_frame": 59,+"matrix_world": [+[+0.8351572751998901,+-0.0020869611762464046,+0.5500073432922363,+3.7917087078094482+],+[+0.549980103969574,+-0.007488437928259373,+-0.8351442217826843,+-5.174722194671631+],+[+0.00586160970851779,+0.9999698400497437,+-0.0051062339916825294,+1.4666317701339722+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+379.1708707809448,+517.4722194671631,+146.66317701339722+],+"forward": [+-0.5500073432922363,+-0.8351442217826843,+0.0051062339916825294+],+"up": [+-0.0020869611762464046,+0.007488437928259373,+0.9999698400497437+],+"lens_mm": 24.071483612060547,+"fstop": 2.799999952316284,+"focus_cm": 1006.1716895375866+},+{+"blender_frame": 60,+"matrix_world": [+[+0.8349032998085022,+-0.0028231139294803143,+0.5503894686698914,+3.788121461868286+],+[+0.5503595471382141,+-0.007334700785577297,+-0.834895670413971,+-5.160187244415283+],+[+0.006393947172909975,+0.9999690651893616,+-0.0045700399205088615,+1.4648230075836182+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+378.8121461868286,+516.0187244415283,+146.48230075836182+],+"forward": [+-0.5503894090652466,+-0.8348955512046814,+0.004570039454847574+],+"up": [+-0.002823114162310958,+0.007334701716899872,+0.9999691843986511+],+"lens_mm": 24.07394027709961,+"fstop": 2.799999952316284,+"focus_cm": 1004.7213814686984+},+{+"blender_frame": 61,+"matrix_world": [+[+0.8346101641654968,+-0.003403095528483391,+0.5508304834365845,+3.784457206726074+],+[+0.5507987141609192,+-0.007243080995976925,+-0.8346066474914551,+-5.145443916320801+],+[+0.006829955615103245,+0.9999679923057556,+-0.004170726053416729,+1.4631516933441162+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+378.4457206726074,+514.5443916320801,+146.31516933441162+],+"forward": [+-0.5508305430412292,+-0.8346067667007446,+0.004170726519078016+],+"up": [+-0.003403095528483391,+0.007243080995976925,+0.9999679923057556+],+"lens_mm": 24.076435089111328,+"fstop": 2.799999952316284,+"focus_cm": 1003.2506603980437+},+{+"blender_frame": 62,+"matrix_world": [+[+0.8342786431312561,+-0.003759058192372322,+0.5513302087783813,+3.780705690383911+],+[+0.5512967705726624,+-0.0072704218327999115,+-0.8342775702476501,+-5.130508899688721+],+[+0.007144501432776451,+0.999966561794281,+-0.003993199206888676,+1.4618219137191772+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+378.0705690383911,+513.0508899688721,+146.18219137191772+],+"forward": [+-0.5513302087783813,+-0.8342775702476501,+0.003993199206888676+],+"up": [+-0.003759058192372322,+0.0072704218327999115,+0.999966561794281+],+"lens_mm": 24.078969955444336,+"fstop": 2.799999952316284,+"focus_cm": 1001.761247694958+},+{+"blender_frame": 63,+"matrix_world": [+[+0.8339095115661621,+-0.003832723945379257,+0.5518879890441895,+3.776860237121582+],+[+0.551852822303772,+-0.007464383728802204,+-0.8339081406593323,+-5.115400314331055+],+[+0.007315642666071653,+0.9999648332595825,+-0.004109520465135574,+1.4610090255737305+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+377.6860237121582,+511.54003143310547,+146.10090255737305+],+"forward": [+-0.5518879890441895,+-0.8339081406593323,+0.004109520465135574+],+"up": [+-0.003832723945379257,+0.007464383728802204,+0.9999648332595825+],+"lens_mm": 24.08154296875,+"fstop": 2.799999952316284,+"focus_cm": 1000.25549614802+},+{+"blender_frame": 64,+"matrix_world": [+[+0.8335040211677551,+-0.0035841548815369606,+0.5525017976760864,+3.7729127407073975+],+[+0.5524649024009705,+-0.007852675393223763,+-0.8334992527961731,+-5.100128173828125+],+[+0.007326008286327124,+0.9999628663063049,+-0.004565116949379444,+1.4608274698257446+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+377.29127407073975,+510.0128173828125,+146.08274698257446+],+"forward": [+-0.5525017976760864,+-0.8334992527961731,+0.004565116949379444+],+"up": [+-0.0035841544158756733,+0.007852674461901188,+0.9999627470970154+],+"lens_mm": 24.084157943725586,+"fstop": 2.799999952316284,+"focus_cm": 998.7337785947602+},+{+"blender_frame": 65,+"matrix_world": [+[+0.8330639004707336,+-0.0029990780167281628,+0.5531686544418335,+3.7688589096069336+],+[+0.5531304478645325,+-0.008434522897005081,+-0.8330519795417786,+-5.084705829620361+],+[+0.007164102513343096,+0.9999600052833557,+-0.005367613397538662,+1.4613033533096313+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+376.88589096069336,+508.47058296203613,+146.13033533096313+],+"forward": [+-0.5531687140464783,+-0.8330520987510681,+0.005367613863199949+],+"up": [+-0.0029990780167281628,+0.008434522897005081,+0.9999600052833557+],+"lens_mm": 24.086811065673828,+"fstop": 2.799999952316284,+"focus_cm": 997.1965952368919+},+{+"blender_frame": 66,+"matrix_world": [+[+0.8325909972190857,+-0.0020931707695126534,+0.5538843274116516,+3.7646942138671875+],+[+0.5538462996482849,+-0.009176504798233509,+-0.8325684070587158,+-5.069141387939453+],+[+0.006825430318713188,+0.9999557733535767,+-0.006480977404862642,+1.4623607397079468+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+376.46942138671875,+506.9141387939453,+146.23607397079468+],+"forward": [+-0.5538843274116516,+-0.8325684070587158,+0.006480977404862642+],+"up": [+-0.0020931707695126534,+0.009176504798233509,+0.9999557733535767+],+"lens_mm": 24.089502334594727,+"fstop": 2.799999952316284,+"focus_cm": 995.6424004398286+},+{+"blender_frame": 67,+"matrix_world": [+[+0.8320873379707336,+-0.0009122872725129128,+0.5546438097953796,+3.7604196071624756+],+[+0.5546086430549622,+-0.010014133527874947,+-0.8320510387420654,+-5.053437232971191+],+[+0.006313348188996315,+0.9999494552612305,+-0.007826671004295349,+1.4638243913650513+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+376.04196071624756,+505.34372329711914,+146.38243913650513+],+"forward": [+-0.5546438694000244,+-0.832051157951355,+0.007826671935617924+],+"up": [+-0.0009122872725129128,+0.010014133527874947,+0.9999494552612305+],+"lens_mm": 24.092235565185547,+"fstop": 2.799999952316284,+"focus_cm": 994.0702446270734+},+{+"blender_frame": 68,+"matrix_world": [+[+0.8315554261207581,+0.00047183758579194546,+0.555441677570343,+3.756037712097168+],+[+0.5554133057594299,+-0.01085965521633625,+-0.8315035700798035,+-5.037593841552734+],+[+0.00563957029953599,+0.9999409914016724,+-0.009292468428611755,+1.4654412269592285+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+375.6037712097168,+503.75938415527344,+146.54412269592285+],+"forward": [+-0.555441677570343,+-0.8315035700798035,+0.009292468428611755+],+"up": [+0.00047183758579194546,+0.01085965521633625,+0.9999409914016724+],+"lens_mm": 24.09500503540039,+"fstop": 2.799999952316284,+"focus_cm": 992.4778719432652+},+{+"blender_frame": 69,+"matrix_world": [+[+0.8309974670410156,+0.001970326993614435,+0.5562727451324463,+3.7515556812286377+],+[+0.5562552809715271,+-0.011615544557571411,+-0.8309303522109985,+-5.021608829498291+],+[+0.0048242066986858845,+0.9999306201934814,+-0.010748493485152721,+1.4669171571731567+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+375.15556812286377,+502.1608829498291,+146.69171571731567+],+"forward": [+-0.5562727451324463,+-0.8309303522109985,+0.010748493485152721+],+"up": [+0.001970326993614435,+0.011615544557571411,+0.9999306201934814+],+"lens_mm": 24.097814559936523,+"fstop": 2.799999952316284,+"focus_cm": 990.8651505131274+},+{+"blender_frame": 70,+"matrix_world": [+[+0.8304164409637451,+0.0034887944348156452,+0.5571322441101074,+3.7469840049743652+],+[+0.5571295619010925,+-0.012191494926810265,+-0.8303360939025879,+-5.005473613739014+],+[+0.0038954035844653845,+0.9999196529388428,+-0.012067725881934166,+1.4679676294326782+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+374.6984004974365,+500.54736137390137,+146.79676294326782+],+"forward": [+-0.5571323037147522,+-0.8303362131118774,+0.012067727744579315+],+"up": [+0.0034887944348156452,+0.012191494926810265,+0.9999196529388428+],+"lens_mm": 24.100664138793945,+"fstop": 2.799999952316284,+"focus_cm": 989.2318123136647+},+{+"blender_frame": 71,+"matrix_world": [+[+0.8298153281211853,+0.004940382670611143,+0.5580161809921265,+3.742337226867676+],+[+0.5580306649208069,+-0.012522277422249317,+-0.8297259211540222,+-4.989181995391846+],+[+0.00288847042247653,+0.9999094009399414,+-0.01314806379377842,+1.468369483947754+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+374.2337226867676,+498.91819953918457,+146.8369483947754+],+"forward": [+-0.5580161809921265,+-0.8297259211540222,+0.01314806379377842+],+"up": [+0.004940382670611143,+0.012522277422249317,+0.9999094009399414+],+"lens_mm": 24.10354995727539,+"fstop": 2.799999952316284,+"focus_cm": 987.5790987047367+},+{+"blender_frame": 72,+"matrix_world": [+[+0.8291972279548645,+0.006257831584662199,+0.5589212775230408,+3.737633228302002+],+[+0.5589532256126404,+-0.012582997791469097,+-0.8291037678718567,+-4.97272253036499+],+[+0.0018445125315338373,+0.9999012351036072,+-0.013931622728705406,+1.4680066108703613+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+373.7633228302002,+497.272253036499,+146.80066108703613+],+"forward": [+-0.5589212775230408,+-0.8291037678718567,+0.013931622728705406+],+"up": [+0.006257832515984774,+0.012582999654114246,+0.9999013543128967+],+"lens_mm": 24.106475830078125,+"fstop": 2.799999952316284,+"focus_cm": 985.9083922812715+},+{+"blender_frame": 73,+"matrix_world": [+[+0.8285653591156006,+0.007401982322335243,+0.5598434209823608,+3.7328920364379883+],+[+0.5598917007446289,+-0.012398036196827888,+-0.8284730315208435,+-4.956085205078125+],+[+0.0008086161687970161,+0.9998957514762878,+-0.014416893944144249,+1.4668991565704346+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+373.2892036437988,+495.6085205078125,+146.68991565704346+],+"forward": [+-0.5598434209823608,+-0.8284730315208435,+0.014416893944144249+],+"up": [+0.007401982322335243,+0.012398036196827888,+0.9998957514762878+],+"lens_mm": 24.109439849853516,+"fstop": 2.799999952316284,+"focus_cm": 984.2207940644585+},+{+"blender_frame": 74,+"matrix_world": [+[+0.8279233574867249,+0.008365049958229065,+0.560778796672821,+3.728135347366333+],+[+0.5608412623405457,+-0.01204142440110445,+-0.8278357982635498,+-4.9392619132995605+],+[+-0.00017231149831786752,+0.9998924732208252,+-0.014660840854048729,+1.4652080535888672+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+372.8135347366333,+493.92619132995605,+146.52080535888672+],+"forward": [+-0.5607788562774658,+-0.8278359174728394,+0.014660842716693878+],+"up": [+0.00836505088955164,+0.0120414262637496,+0.9998925924301147+],+"lens_mm": 24.112443923950195,+"fstop": 2.799999952316284,+"focus_cm": 982.5172332813963+},+{+"blender_frame": 75,+"matrix_world": [+[+0.8272749185562134,+0.009167644195258617,+0.5617226362228394,+3.723383665084839+],+[+0.5617963671684265,+-0.011627443134784698,+-0.8271938562393188,+-4.922242164611816+],+[+-0.0010520205833017826,+0.9998903870582581,+-0.014769441448152065,+1.4632127285003662+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+372.3383665084839,+492.22421646118164,+146.32127285003662+],+"forward": [+-0.5617226362228394,+-0.8271938562393188,+0.014769441448152065+],+"up": [+0.009167644195258617,+0.011627443134784698,+0.9998903870582581+],+"lens_mm": 24.1154842376709,+"fstop": 2.799999952316284,+"focus_cm": 980.7973749237135+},+{+"blender_frame": 76,+"matrix_world": [+[+0.826623260974884,+0.009849817492067814,+0.5626695156097412,+3.7186570167541504+],+[+0.5627528429031372,+-0.011292318813502789,+-0.8265480995178223,+-4.905019760131836+],+[+-0.0017875049961730838,+0.9998878240585327,+-0.014877504669129848,+1.4612616300582886+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+371.86570167541504,+490.5019760131836,+146.12616300582886+],+"forward": [+-0.5626695156097412,+-0.8265480995178223,+0.014877504669129848+],+"up": [+0.00984981656074524,+0.011292317882180214,+0.9998877048492432+],+"lens_mm": 24.118562698364258,+"fstop": 2.799999952316284,+"focus_cm": 979.0614501573145+},+{+"blender_frame": 77,+"matrix_world": [+[+0.8259720802307129,+0.01045786589384079,+0.563614010810852,+3.7139689922332764+],+[+0.5637062191963196,+-0.011169955134391785,+-0.8258998990058899,+-4.887588977813721+],+[+-0.0023416054900735617,+0.9998829960823059,+-0.015121236443519592,+1.4597073793411255+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+371.39689922332764,+488.75889778137207,+145.97073793411255+],+"forward": [+-0.563614010810852,+-0.8258998990058899,+0.015121236443519592+],+"up": [+0.01045786589384079,+0.011169955134391785,+0.9998829960823059+],+"lens_mm": 24.121679306030273,+"fstop": 2.799999952316284,+"focus_cm": 977.3089664755389+},+{+"blender_frame": 78,+"matrix_world": [+[+0.825324296951294,+0.011029381304979324,+0.5645514130592346,+3.7093279361724854+],+[+0.5646528601646423,+-0.011365755461156368,+-0.8252502679824829,+-4.869946479797363+],+[+-0.002685447223484516,+0.9998747110366821,+-0.01560820173472166,+1.4588342905044556+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+370.93279361724854,+486.9946479797363,+145.88342905044556+],+"forward": [+-0.5645514726638794,+-0.8252503871917725,+0.01560820359736681+],+"up": [+0.01102938037365675,+0.011365754529833794,+0.9998745918273926+],+"lens_mm": 24.124834060668945,+"fstop": 2.799999952316284,+"focus_cm": 975.5395722575486+},+{+"blender_frame": 79,+"matrix_world": [+[+0.8246824145317078,+0.011580228805541992,+0.5654775500297546,+3.704735279083252+],+[+0.5655890703201294,+-0.011934247799217701,+-0.8246008157730103,+-4.852090835571289+],+[+-0.0028005167841911316,+0.9998618364334106,+-0.016391616314649582,+1.458795428276062+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+370.4735279083252,+485.2090835571289,+145.8795428276062+],+"forward": [+-0.5654775500297546,+-0.8246008157730103,+0.016391616314649582+],+"up": [+0.011580227874219418,+0.011934245936572552,+0.9998617172241211+],+"lens_mm": 24.12802505493164,+"fstop": 2.799999952316284,+"focus_cm": 973.75236263033+},+{+"blender_frame": 80,+"matrix_world": [+[+0.8240488767623901,+0.01209628488868475,+0.5663896203041077,+3.700183153152466+],+[+0.566512405872345,+-0.01286478340625763,+-0.8239527344703674,+-4.834022521972656+],+[+-0.0026802883949130774,+0.9998441338539124,+-0.017453903332352638,+1.4595752954483032+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+370.0183153152466,+483.4022521972656,+145.95752954483032+],+"forward": [+-0.5663896799087524,+-0.823952853679657,+0.017453905194997787+],+"up": [+0.01209628488868475,+0.01286478340625763,+0.9998441338539124+],+"lens_mm": 24.131254196166992,+"fstop": 2.799999952316284,+"focus_cm": 971.9462026841938+},+{+"blender_frame": 81,+"matrix_world": [+[+0.8234248757362366,+0.01253276877105236,+0.5672868490219116,+3.6956546306610107+],+[+0.567420482635498,+-0.014079531654715538,+-0.8233078122138977,+-4.815743446350098+],+[+-0.0023311935365200043,+0.9998223781585693,+-0.018704786896705627,+1.4609822034835815+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+369.5654630661011,+481.57434463500977,+146.09822034835815+],+"forward": [+-0.5672868490219116,+-0.8233078122138977,+0.018704786896705627+],+"up": [+0.01253276877105236,+0.014079531654715538,+0.9998223781585693+],+"lens_mm": 24.134521484375,+"fstop": 2.799999952316284,+"focus_cm": 970.1196872629225+},+{+"blender_frame": 82,+"matrix_world": [+[+0.8228116035461426,+0.012821651995182037,+0.5681695342063904,+3.69112491607666+],+[+0.5683113932609558,+-0.01544453389942646,+-0.8226686120033264,+-4.797263145446777+],+[+-0.0017728571547195315,+0.9997986555099487,+-0.01999463327229023,+1.4626816511154175+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+369.112491607666,+479.72631454467773,+146.26816511154175+],+"forward": [+-0.5681695342063904,+-0.8226686120033264,+0.01999463327229023+],+"up": [+0.012821650132536888,+0.015444532036781311,+0.9997985363006592+],+"lens_mm": 24.13782501220703,+"fstop": 2.799999952316284,+"focus_cm": 968.2731391862035+},+{+"blender_frame": 83,+"matrix_world": [+[+0.8222094774246216,+0.012886516749858856,+0.5690392255783081,+3.6865599155426025+],+[+0.5691841840744019,+-0.01679258421063423,+-0.8220385909080505,+-4.778589725494385+],+[+-0.0010375739075243473,+0.9997760653495789,+-0.021141821518540382,+1.4642606973648071+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+368.65599155426025,+477.8589725494385,+146.4260697364807+],+"forward": [+-0.5690392255783081,+-0.8220385909080505,+0.021141821518540382+],+"up": [+0.012886514887213707,+0.016792582347989082,+0.9997759461402893+],+"lens_mm": 24.14116668701172,+"fstop": 2.799999952316284,+"focus_cm": 966.4073338033631+},+{+"blender_frame": 84,+"matrix_world": [+[+0.8216181993484497,+0.012661810964345932,+0.5698975920677185,+3.6819217205047607+],+[+0.5700381398200989,+-0.01795366033911705,+-0.8214220404624939,+-4.759737968444824+],+[+-0.0001689436030574143,+0.999758780002594,+-0.021968767046928406,+1.4653122425079346+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+368.1921720504761,+475.9737968444824,+146.53122425079346+],+"forward": [+-0.5698975920677185,+-0.8214220404624939,+0.021968767046928406+],+"up": [+0.012661809101700783,+0.0179536584764719,+0.9997586607933044+],+"lens_mm": 24.14454460144043,+"fstop": 2.799999952316284,+"focus_cm": 964.5246884319931+},+{+"blender_frame": 85,+"matrix_world": [+[+0.8210374712944031,+0.01211237721145153,+0.5707457065582275,+3.6771671772003174+],+[+0.5708737969398499,+-0.018786568194627762,+-0.8208228349685669,+-4.740726470947266+],+[+0.000780238420702517,+0.9997501969337463,+-0.022339116781949997,+1.4655258655548096+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+367.71671772003174,+474.07264709472656,+146.55258655548096+],+"forward": [+-0.5707457661628723,+-0.8208229541778564,+0.022339118644595146+],+"up": [+0.01211237721145153,+0.018786568194627762,+0.9997501969337463+],+"lens_mm": 24.147960662841797,+"fstop": 2.799999952316284,+"focus_cm": 962.6273824367672+},+{+"blender_frame": 86,+"matrix_world": [+[+0.8204666972160339,+0.011248942464590073,+0.5715837478637695,+3.6722521781921387+],+[+0.5716917514801025,+-0.01920565590262413,+-0.8202435970306396,+-4.721576690673828+],+[+0.0017507674638181925,+0.9997522830963135,+-0.022188527509570122,+1.4647597074508667+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+367.22521781921387,+472.1576690673828,+146.47597074508667+],+"forward": [+-0.5715838074684143,+-0.8202437162399292,+0.02218852937221527+],+"up": [+0.011248942464590073,+0.01920565590262413,+0.9997522830963135+],+"lens_mm": 24.151411056518555,+"fstop": 2.799999952316284,+"focus_cm": 960.7164305401966+},+{+"blender_frame": 87,+"matrix_world": [+[+0.8199044466018677,+0.010135105811059475,+0.5724106431007385,+3.667133092880249+],+[+0.5724941492080688,+-0.019195858389139175,+-0.8196840286254883,+-4.702309608459473+],+[+0.0026803298387676477,+0.9997644424438477,+-0.021541059017181396,+1.4630794525146484+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+366.7133092880249,+470.23096084594727,+146.30794525146484+],+"forward": [+-0.5724107027053833,+-0.8196841478347778,+0.021541060879826546+],+"up": [+0.010135105811059475,+0.019195858389139175,+0.9997644424438477+],+"lens_mm": 24.15489959716797,+"fstop": 2.799999952316284,+"focus_cm": 958.7905220687389+},+{+"blender_frame": 88,+"matrix_world": [+[+0.819350004196167,+0.008883681148290634,+0.5732247829437256,+3.6617698669433594+],+[+0.5732829570770264,+-0.018813082948327065,+-0.8191413879394531,+-4.682950973510742+],+[+0.003507134737446904,+0.9997835755348206,+-0.020507361739873886,+1.4607542753219604+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+366.17698669433594,+468.2950973510742,+146.07542753219604+],+"forward": [+-0.5732248425483704,+-0.8191415071487427,+0.020507363602519035+],+"up": [+0.008883681148290634,+0.018813082948327065,+0.9997835755348206+],+"lens_mm": 24.158424377441406,+"fstop": 2.799999952316284,+"focus_cm": 956.84684664011+},+{+"blender_frame": 89,+"matrix_world": [+[+0.8188016414642334,+0.00764205027371645,+0.5740256309509277,+3.656127452850342+],+[+0.574061393737793,+-0.018169142305850983,+-0.8186107277870178,+-4.663521766662598+],+[+0.004173689521849155,+0.9998058080673218,+-0.01926393061876297,+1.458207368850708+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+365.6127452850342,+466.35217666625977,+145.8207368850708+],+"forward": [+-0.5740256309509277,+-0.8186107277870178,+0.01926393061876297+],+"up": [+0.007642049342393875,+0.018169140443205833,+0.9998056888580322+],+"lens_mm": 24.161985397338867,+"fstop": 2.799999952316284,+"focus_cm": 954.8818308394402+},+{+"blender_frame": 90,+"matrix_world": [+[+0.8182581663131714,+0.006568878889083862,+0.5748134255409241,+3.650177478790283+],+[+0.5748322606086731,+-0.01740455813705921,+-0.8180862069129944,+-4.644039630889893+],+[+0.004630465060472488,+0.9998270273208618,+-0.018017426133155823,+1.455929160118103+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+365.0177478790283,+464.40396308898926,+145.5929160118103+],+"forward": [+-0.5748134255409241,+-0.8180862069129944,+0.018017426133155823+],+"up": [+0.006568877957761288,+0.017404556274414062,+0.9998269081115723+],+"lens_mm": 24.16558074951172,+"fstop": 2.799999952316284,+"focus_cm": 952.8923866804689+},+{+"blender_frame": 91,+"matrix_world": [+[+0.8177173137664795,+0.005806599743664265,+0.5755907893180847,+3.6439015865325928+],+[+0.575599730014801,+-0.016654707491397858,+-0.8175619840621948,+-4.624513149261475+],+[+0.0048390403389930725,+0.9998444318771362,+-0.016961120069026947,+1.4543753862380981+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+364.3901586532593,+462.45131492614746,+145.43753862380981+],+"forward": [+-0.5755907893180847,+-0.8175619840621948,+0.016961120069026947+],+"up": [+0.005806600209325552,+0.016654709354043007,+0.9998445510864258+],+"lens_mm": 24.169214248657227,+"fstop": 2.799999952316284,+"focus_cm": 950.8765354286879+},+{+"blender_frame": 92,+"matrix_world": [+[+0.8171769976615906,+0.005455623380839825,+0.5763611197471619,+3.6372880935668945+],+[+0.576367199420929,+-0.016017762944102287,+-0.8170337677001953,+-4.604947566986084+],+[+0.004774587694555521,+0.9998568296432495,+-0.016233786940574646,+1.4538675546646118+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+363.72880935668945,+460.4947566986084,+145.38675546646118+],+"forward": [+-0.5763611793518066,+-0.8170338869094849,+0.016233788803219795+],+"up": [+0.005455623380839825,+0.016017762944102287,+0.9998568296432495+],+"lens_mm": 24.172882080078125,+"fstop": 2.799999952316284,+"focus_cm": 948.8339782808907+},+{+"blender_frame": 93,+"matrix_world": [+[+0.8166342377662659,+0.005555523559451103,+0.5771287679672241,+3.6303369998931885+],+[+0.5771384835243225,+-0.015531462617218494,+-0.8164986371994019,+-4.585334777832031+],+[+0.004427576903253794,+0.9998639822006226,+-0.015889830887317657,+1.4545233249664307+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+363.03369998931885,+458.5334777832031,+145.45233249664307+],+"forward": [+-0.5771287679672241,+-0.8164986371994019,+0.015889830887317657+],+"up": [+0.005555523559451103,+0.015531462617218494,+0.9998639822006226+],+"lens_mm": 24.176586151123047,+"fstop": 2.799999952316284,+"focus_cm": 946.7644428019412+},+{+"blender_frame": 94,+"matrix_world": [+[+0.81608647108078,+0.006077563390135765,+0.5778979063034058,+3.6230576038360596+],+[+0.5779173374176025,+-0.015164585784077644,+-0.8159544467926025,+-4.565657615661621+],+[+0.00380456680431962,+0.9998665452003479,+-0.015887942165136337,+1.456228256225586+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+362.30576038360596,+456.5657615661621,+145.6228256225586+],+"forward": [+-0.5778979063034058,+-0.8159544467926025,+0.015887942165136337+],+"up": [+0.006077563390135765,+0.015164585784077644,+0.9998665452003479+],+"lens_mm": 24.180326461791992,+"fstop": 2.799999952316284,+"focus_cm": 944.6675631450489+},+{+"blender_frame": 95,+"matrix_world": [+[+0.8155301213264465,+0.006930200848728418,+0.5786731243133545,+3.6154696941375732+],+[+0.5787072777748108,+-0.014825141057372093,+-0.8154006004333496,+-4.545890808105469+],+[+0.0029280208982527256,+0.9998660683631897,+-0.01610090583562851,+1.4586604833602905+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+361.5469694137573,+454.5890808105469,+145.86604833602905+],+"forward": [+-0.5786731839179993,+-0.8154007196426392,+0.01610090769827366+],+"up": [+0.006930201780050993,+0.014825142920017242,+0.9998661875724792+],+"lens_mm": 24.184101104736328,+"fstop": 2.799999952316284,+"focus_cm": 942.5432678428479+},+{+"blender_frame": 96,+"matrix_world": [+[+0.8149617910385132,+0.007976653054356575,+0.5794598460197449,+3.607602834701538+],+[+0.579511821269989,+-0.014383764937520027,+-0.814836859703064,+-4.525998592376709+],+[+0.0018351442413404584,+0.9998647570610046,+-0.01634478196501732,+1.4613595008850098+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+360.7602834701538,+452.5998592376709,+146.13595008850098+],+"forward": [+-0.5794599056243896,+-0.8148369789123535,+0.016344783827662468+],+"up": [+0.007976653054356575,+0.014383764937520027,+0.9998647570610046+],+"lens_mm": 24.187910079956055,+"fstop": 2.799999952316284,+"focus_cm": 940.3916249633767+},+{+"blender_frame": 97,+"matrix_world": [+[+0.8143779635429382,+0.009060891345143318,+0.5802642107009888,+3.5994958877563477+],+[+0.5803346633911133,+-0.013707169331610203,+-0.8142627477645874,+-4.505943775177002+],+[+0.0005758327897638083,+0.9998649954795837,+-0.016421165317296982,+1.4638292789459229+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+359.94958877563477,+450.5943775177002,+146.38292789459229+],+"forward": [+-0.5802642107009888,+-0.8142627477645874,+0.016421165317296982+],+"up": [+0.009060891345143318,+0.013707169331610203,+0.9998649954795837+],+"lens_mm": 24.191755294799805,+"fstop": 2.799999952316284,+"focus_cm": 938.21365989279+},+{+"blender_frame": 98,+"matrix_world": [+[+0.8137753009796143,+0.01003656443208456,+0.5810930728912354,+3.591193675994873+],+[+0.5811792612075806,+-0.01269395649433136,+-0.8136765956878662,+-4.48568058013916+],+[+-0.0007901478093117476,+0.9998691082000732,+-0.016163069754838943,+1.4656459093093872+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+359.1193675994873,+448.568058013916,+146.56459093093872+],+"forward": [+-0.5810930728912354,+-0.8136765956878662,+0.016163069754838943+],+"up": [+0.01003656443208456,+0.01269395649433136,+0.9998691082000732+],+"lens_mm": 24.195634841918945,+"fstop": 2.799999952316284,+"focus_cm": 936.0103009152226+},+{+"blender_frame": 99,+"matrix_world": [+[+0.8131508231163025,+0.010792667977511883,+0.5819529891014099,+3.582750082015991+],+[+0.5820490121841431,+-0.011304459534585476,+-0.8130751848220825,+-4.465165138244629+],+[+-0.0021965859923511744,+0.9998779296875,+-0.015474091283977032,+1.4665533304214478+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+358.2750082015991,+446.5165138244629,+146.65533304214478+],+"forward": [+-0.5819530487060547,+-0.8130753040313721,+0.015474093146622181+],+"up": [+0.010792667977511883,+0.011304459534585476,+0.9998779296875+],+"lens_mm": 24.199548721313477,+"fstop": 2.799999952316284,+"focus_cm": 933.7823519366793+},+{+"blender_frame": 100,+"matrix_world": [+[+0.8125019073486328,+0.011270750313997269,+0.5828496813774109,+3.574218988418579+],+[+0.5829476714134216,+-0.009577663615345955,+-0.8124533295631409,+-4.444352149963379+],+[+-0.0035746211651712656,+0.9998905658721924,+-0.014352126978337765,+1.4665195941925049+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+357.4218988418579,+444.4352149963379,+146.6519594192505+],+"forward": [+-0.5828496813774109,+-0.8124533295631409,+0.014352126978337765+],+"up": [+0.011270751245319843,+0.00957766454666853,+0.9998906850814819+],+"lens_mm": 24.2034969329834,+"fstop": 2.799999952316284,+"focus_cm": 931.5281403134577+},+{+"blender_frame": 101,+"matrix_world": [+[+0.8118262887001038,+0.0114701297134161,+0.5837865471839905,+3.565657377243042+],+[+0.5838789939880371,+-0.007630897685885429,+-0.8118048906326294,+-4.4232001304626465+],+[+-0.004856692627072334,+0.9999051094055176,+-0.012892130762338638,+1.465744137763977+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+356.5657377243042,+442.32001304626465,+146.5744137763977+],+"forward": [+-0.5837865471839905,+-0.8118048906326294,+0.012892130762338638+],+"up": [+0.0114701297134161,+0.007630897685885429,+0.9999051094055176+],+"lens_mm": 24.20747947692871,+"fstop": 2.799999952316284,+"focus_cm": 929.2460835771635+},+{+"blender_frame": 102,+"matrix_world": [+[+0.8111220598220825,+0.01144042145460844,+0.5847650766372681,+3.557119131088257+],+[+0.584846556186676,+-0.005641935393214226,+-0.811124324798584,+-4.401671886444092+],+[+-0.005980397574603558,+0.9999186992645264,+-0.01126718707382679,+1.4646128416061401+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+355.7119131088257,+440.1671886444092,+146.461284160614+],+"forward": [+-0.5847651362419128,+-0.8111244440078735,+0.011267188005149364+],+"up": [+0.01144042145460844,+0.005641935393214226,+0.9999186992645264+],+"lens_mm": 24.211496353149414,+"fstop": 2.799999952316284,+"focus_cm": 926.9339118269272+},+{+"blender_frame": 103,+"matrix_world": [+[+0.8103876113891602,+0.011263499036431313,+0.5857858657836914,+3.5486533641815186+],+[+0.585853636264801,+-0.003817103337496519,+-0.8104078769683838,+-4.379733562469482+],+[+-0.006892022676765919,+0.9999292492866516,+-0.009692094288766384,+1.4636123180389404+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+354.86533641815186,+437.97335624694824,+146.36123180389404+],+"forward": [+-0.5857859253883362,+-0.8104079961776733,+0.009692095220088959+],+"up": [+0.011263499967753887,+0.0038171038031578064,+0.9999293684959412+],+"lens_mm": 24.215547561645508,+"fstop": 2.799999952316284,+"focus_cm": 924.59057031665+},+{+"blender_frame": 104,+"matrix_world": [+[+0.8096216917037964,+0.011029317043721676,+0.5868486166000366,+3.54030179977417+],+[+0.5869036912918091,+-0.0023521778639405966,+-0.8096534013748169,+-4.357356548309326+],+[+-0.007549550384283066,+0.9999364018440247,+-0.00837752129882574,+1.4632201194763184+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+354.030179977417,+435.7356548309326,+146.32201194763184+],+"forward": [+-0.5868486166000366,+-0.8096534013748169,+0.00837752129882574+],+"up": [+0.011029317043721676,+0.0023521778639405966,+0.9999364018440247+],+"lens_mm": 24.21963119506836,+"fstop": 2.799999952316284,+"focus_cm": 922.2162078658585+},+{+"blender_frame": 105,+"matrix_world": [+[+0.8088226318359375,+0.010811202228069305,+0.5879532098770142,+3.5320959091186523+],+[+0.5879992246627808,+-0.0013942967634648085,+-0.8088603019714355,+-4.334522247314453+],+[+-0.007924971170723438,+0.9999405741691589,+-0.007484717294573784,+1.4637974500656128+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+353.20959091186523,+433.4522247314453,+146.37974500656128+],+"forward": [+-0.5879532098770142,+-0.8088603019714355,+0.007484717294573784+],+"up": [+0.010811202228069305,+0.0013942967634648085,+0.9999405741691589+],+"lens_mm": 24.2237491607666,+"fstop": 2.799999952316284,+"focus_cm": 919.8125887487549+},+{+"blender_frame": 106,+"matrix_world": [+[+0.8079895377159119,+0.010646479204297066,+0.58910071849823,+3.5240557193756104+],+[+0.5891425609588623,+-0.001013213419355452,+-0.808028519153595,+-4.311214447021484+],+[+-0.008005773648619652,+0.9999428987503052,+-0.007090958300977945,+1.465506911277771+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+352.40557193756104,+431.12144470214844,+146.5506911277771+],+"forward": [+-0.58910071849823,+-0.808028519153595,+0.007090958300977945+],+"up": [+0.010646479204297066,+0.001013213419355452,+0.9999428987503052+],+"lens_mm": 24.227901458740234,+"fstop": 2.799999952316284,+"focus_cm": 917.3806326638442+},+{+"blender_frame": 107,+"matrix_world": [+[+0.8071207404136658,+0.010526738129556179,+0.5902926325798035,+3.5161917209625244+],+[+0.5903350114822388,+-0.0011878609657287598,+-0.8071575164794922,+-4.287426471710205+],+[+-0.007795548997819424,+0.9999439120292664,+-0.007173049729317427,+1.4682739973068237+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+351.61917209625244,+428.7426471710205,+146.82739973068237+],+"forward": [+-0.5902926325798035,+-0.8071575164794922,+0.007173049729317427+],+"up": [+0.010526738129556179,+0.0011878609657287598,+0.9999439120292664+],+"lens_mm": 24.232084274291992,+"fstop": 2.799999952316284,+"focus_cm": 914.9207972572185+},+{+"blender_frame": 108,+"matrix_world": [+[+0.8062149286270142,+0.010400105267763138,+0.5915314555168152,+3.508500337600708+],+[+0.5915776491165161,+-0.0018112104153260589,+-0.8062459826469421,+-4.263156890869141+],+[+-0.007313655689358711,+0.9999443292617798,+-0.0076126945205032825,+1.471799373626709+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+350.8500337600708,+426.31568908691406,+147.1799373626709+],+"forward": [+-0.5915314555168152,+-0.8062459826469421,+0.0076126945205032825+],+"up": [+0.010400105267763138,+0.0018112104153260589,+0.9999443292617798+],+"lens_mm": 24.236303329467773,+"fstop": 2.799999952316284,+"focus_cm": 912.4323732510675+},+{+"blender_frame": 109,+"matrix_world": [+[+0.8052679300308228,+0.010184735991060734,+0.5928236842155457,+3.5009689331054688+],+[+0.5928744077682495,+-0.0027119251899421215,+-0.8052904009819031,+-4.238412380218506+],+[+-0.006593975704163313,+0.9999445080757141,+-0.008222095668315887,+1.4756203889846802+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+350.0968933105469,+423.8412380218506,+147.56203889846802+],+"forward": [+-0.5928236842155457,+-0.8052904009819031,+0.008222095668315887+],+"up": [+0.010184735991060734,+0.0027119251899421215,+0.9999445080757141+],+"lens_mm": 24.24055290222168,+"fstop": 2.799999952316284,+"focus_cm": 909.9150383844972+},+{+"blender_frame": 110,+"matrix_world": [+[+0.8042644262313843,+0.009790865704417229,+0.5941911339759827,+3.493577480316162+],+[+0.5942445397377014,+-0.0036881985142827034,+-0.8042759895324707,+-4.21320915222168+],+[+-0.005683062132447958,+0.9999452829360962,+-0.008784455247223377,+1.47920823097229+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+349.3577480316162,+421.32091522216797,+147.920823097229+],+"forward": [+-0.5941911339759827,+-0.8042759895324707,+0.008784455247223377+],+"up": [+0.009790865704417229,+0.0036881985142827034,+0.9999452829360962+],+"lens_mm": 24.244836807250977,+"fstop": 2.799999952316284,+"focus_cm": 907.3692544276128+},+{+"blender_frame": 111,+"matrix_world": [+[+0.8032017946243286,+0.00914608221501112,+0.5956366658210754,+3.486297130584717+],+[+0.5956888198852539,+-0.004546916112303734,+-0.8032023906707764,+-4.187564373016357+],+[+-0.004637846257537603,+0.9999479055404663,+-0.009100310504436493,+1.4820778369903564+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+348.6297130584717,+418.75643730163574,+148.20778369903564+],+"forward": [+-0.5956367254257202,+-0.8032025098800659,+0.009100311435759068+],+"up": [+0.00914608221501112,+0.004546916112303734,+0.9999479055404663+],+"lens_mm": 24.2491512298584,+"fstop": 2.799999952316284,+"focus_cm": 904.79632136703+},+{+"blender_frame": 112,+"matrix_world": [+[+0.8020816445350647,+0.008218048140406609,+0.5971577763557434,+3.479095697402954+],+[+0.5972040295600891,+-0.005139572080224752,+-0.8020727634429932,+-4.161508560180664+],+[+-0.003522337879985571,+0.9999530911445618,+-0.009030207060277462,+1.4838907718658447+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+347.9095697402954,+416.1508560180664,+148.38907718658447+],+"forward": [+-0.597157895565033,+-0.8020729422569275,+0.009030208922922611+],+"up": [+0.008218048140406609,+0.005139572080224752,+0.9999530911445618+],+"lens_mm": 24.25349998474121,+"fstop": 2.799999952316284,+"focus_cm": 902.1981490543112+},+{+"blender_frame": 113,+"matrix_world": [+[+0.8009046316146851,+0.007029423490166664,+0.5987505912780762,+3.471937417984009+],+[+0.5987870693206787,+-0.005387448705732822,+-0.8008900880813599,+-4.135071277618408+],+[+-0.002404057653620839,+0.9999608993530273,+-0.008523959666490555,+1.4845243692398071+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+347.1937417984009,+413.5071277618408,+148.4524369239807+],+"forward": [+-0.598750650882721,+-0.8008902072906494,+0.00852396059781313+],+"up": [+0.0070294225588440895,+0.005387448240071535,+0.9999607801437378+],+"lens_mm": 24.25787925720215,+"fstop": 2.799999952316284,+"focus_cm": 899.5759668847313+},+{+"blender_frame": 114,+"matrix_world": [+[+0.7996730208396912,+0.005661360919475555,+0.6004091501235962,+3.4647891521453857+],+[+0.6004343628883362,+-0.005291142035275698,+-0.7996566295623779,+-4.108287811279297+],+[+-0.0013502943329513073,+0.999970018863678,+-0.0076304590329527855,+1.4840943813323975+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+346.4789152145386,+410.8287811279297,+148.40943813323975+],+"forward": [+-0.6004091501235962,+-0.7996566295623779,+0.0076304590329527855+],+"up": [+0.005661360919475555,+0.005291142035275698,+0.999970018863678+],+"lens_mm": 24.262292861938477,+"fstop": 2.799999952316284,+"focus_cm": 896.930011943914+},+{+"blender_frame": 115,+"matrix_world": [+[+0.7983893752098083,+0.004243939649313688,+0.6021265387535095,+3.457616090774536+],+[+0.6021413207054138,+-0.004922348074615002,+-0.7983744144439697,+-4.081193447113037+],+[+-0.0004243761068210006,+0.9999788999557495,+-0.006485401652753353,+1.482926607131958+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+345.7616090774536,+408.1193447113037,+148.2926607131958+],+"forward": [+-0.6021265387535095,+-0.7983744144439697,+0.006485401652753353+],+"up": [+0.004243939649313688,+0.004922348074615002,+0.9999788999557495+],+"lens_mm": 24.266735076904297,+"fstop": 2.799999952316284,+"focus_cm": 894.2596271226648+},+{+"blender_frame": 116,+"matrix_world": [+[+0.7970572710037231,+0.0029355438891798258,+0.6038965582847595,+3.450390338897705+],+[+0.6039037108421326,+-0.004400746896862984,+-0.797045111656189,+-4.053822040557861+],+[+0.00031783521990291774,+0.9999860525131226,+-0.005280432291328907,+1.4814822673797607+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+345.0390338897705,+405.38220405578613,+148.14822673797607+],+"forward": [+-0.6038966178894043,+-0.7970452308654785,+0.005280432756990194+],+"up": [+0.0029355438891798258,+0.004400746896862984,+0.9999860525131226+],+"lens_mm": 24.271211624145508,+"fstop": 2.799999952316284,+"focus_cm": 891.564797074534+},+{+"blender_frame": 117,+"matrix_world": [+[+0.7956801652908325,+0.0018947923090308905,+0.605713963508606,+3.443087339401245+],+[+0.605716347694397,+-0.0038610142655670643,+-0.7956712245941162,+-4.026203155517578+],+[+0.000831038283649832,+0.9999907612800598,+-0.004219839349389076,+1.4802546501159668+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+344.3087339401245,+402.6203155517578,+148.02546501159668+],+"forward": [+-0.6057140231132507,+-0.7956713438034058,+0.0042198398150503635+],+"up": [+0.0018947923090308905,+0.0038610142655670643,+0.9999907612800598+],+"lens_mm": 24.27571678161621,+"fstop": 2.799999952316284,+"focus_cm": 888.8460208385368+},+{+"blender_frame": 118,+"matrix_world": [+[+0.7942624092102051,+0.0012507736682891846,+0.6075735092163086,+3.4356894493103027+],+[+0.6075738668441772,+-0.0034175876062363386,+-0.7942558526992798,+-3.9983620643615723+],+[+0.0010830014944076538,+0.9999933838844299,+-0.0034743989817798138,+1.479658842086792+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+343.5689449310303,+399.8362064361572,+147.9658842086792+],+"forward": [+-0.6075735092163086,+-0.7942558526992798,+0.0034743989817798138+],+"up": [+0.0012507736682891846,+0.0034175876062363386,+0.9999933838844299+],+"lens_mm": 24.280256271362305,+"fstop": 2.799999952316284,+"focus_cm": 886.1047150188824+},+{+"blender_frame": 119,+"matrix_world": [+[+0.7928083539009094,+0.0010779364965856075,+0.6094701290130615,+3.428184747695923+],+[+0.6094701290130615,+-0.003135414095595479,+-0.7928028702735901,+-3.9703171253204346+],+[+0.0010563497198745608,+0.9999944567680359,+-0.0031427526846528053,+1.4799399375915527+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+342.8184747695923,+397.03171253204346,+147.99399375915527+],+"forward": [+-0.6094701290130615,+-0.7928028702735901,+0.0031427526846528053+],+"up": [+0.0010779366130009294,+0.0031354145612567663,+0.9999945759773254+],+"lens_mm": 24.28482437133789,+"fstop": 2.799999952316284,+"focus_cm": 883.3424503820424+},+{+"blender_frame": 120,+"matrix_world": [+[+0.7913223505020142,+0.00138078723102808,+0.6113976240158081,+3.4205715656280518+],+[+0.6113987565040588,+-0.0030130422674119473,+-0.7913168668746948,+-3.94208025932312+],+[+0.0007495267782360315,+0.9999945759773254,+-0.003228498622775078,+1.4811168909072876+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+342.0571565628052,+394.208025932312,+148.11168909072876+],+"forward": [+-0.6113976836204529,+-0.7913169860839844,+0.003228499088436365+],+"up": [+0.00138078723102808,+0.0030130422674119473,+0.9999945759773254+],+"lens_mm": 24.2894229888916,+"fstop": 2.799999952316284,+"focus_cm": 880.5602450564038+},+{+"blender_frame": 121,+"matrix_world": [+[+0.7898089289665222,+0.0020916680805385113,+0.613349437713623,+3.412853956222534+],+[+0.6133529543876648,+-0.0029818122275173664,+-0.7898033857345581,+-3.913654327392578+],+[+0.00017688627121970057,+0.9999934434890747,+-0.003637993009760976,+1.4829789400100708+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+341.2853956222534,+391.3654327392578,+148.29789400100708+],+"forward": [+-0.613349437713623,+-0.7898033857345581,+0.003637993009760976+],+"up": [+0.0020916680805385113,+0.0029818122275173664,+0.9999934434890747+],+"lens_mm": 24.29405403137207,+"fstop": 2.799999952316284,+"focus_cm": 877.7583712268097+},+{+"blender_frame": 122,+"matrix_world": [+[+0.7882728576660156,+0.003082391107454896,+0.615318238735199,+3.4050452709198+],+[+0.6153255701065063,+-0.0029214981477707624,+-0.7882676720619202,+-3.8850369453430176+],+[+-0.0006320983520708978,+0.9999909996986389,+-0.004199611954391003,+1.4851300716400146+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+340.50452709198,+388.50369453430176,+148.51300716400146+],+"forward": [+-0.615318238735199,+-0.7882676720619202,+0.004199611954391003+],+"up": [+0.003082391107454896,+0.0029214981477707624,+0.9999909996986389+],+"lens_mm": 24.29871368408203,+"fstop": 2.799999952316284,+"focus_cm": 874.9372632628365+},+{+"blender_frame": 123,+"matrix_world": [+[+0.7867186665534973,+0.004187251441180706,+0.6172974705696106,+3.3971643447875977+],+[+0.6173094511032104,+-0.002688680775463581,+-0.7867158651351929,+-3.8562209606170654+],+[+-0.0016344612231478095,+0.9999876022338867,+-0.004700065590441227,+1.4870760440826416+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+339.71643447875977,+385.62209606170654,+148.70760440826416+],+"forward": [+-0.6172974705696106,+-0.7867158651351929,+0.004700065590441227+],+"up": [+0.004187251906841993,+0.0026886810082942247,+0.9999877214431763+],+"lens_mm": 24.303403854370117,+"fstop": 2.799999952316284,+"focus_cm": 872.0979890822491+},+{+"blender_frame": 124,+"matrix_world": [+[+0.7851513028144836,+0.005232797935605049,+0.6192818284034729,+3.389237642288208+],+[+0.6192977428436279,+-0.0021515758708119392,+-0.785153329372406,+-3.827191114425659+],+[+-0.002776117529720068,+0.9999840259552002,+-0.004929972812533379,+1.488332748413086+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+338.9237642288208,+382.7191114425659,+148.8332748413086+],+"forward": [+-0.6192818284034729,+-0.785153329372406,+0.004929972812533379+],+"up": [+0.005232797935605049,+0.0021515758708119392,+0.9999840259552002+],+"lens_mm": 24.308124542236328,+"fstop": 2.799999952316284,+"focus_cm": 869.242256940197+},+{+"blender_frame": 125,+"matrix_world": [+[+0.7835756540298462,+0.0060682171024382114,+0.6212667226791382,+3.381295680999756+],+[+0.6212834715843201,+-0.0012234902242198586,+-0.7835848927497864,+-3.7979321479797363+],+[+-0.003994849976152182,+0.9999809265136719,+-0.004728780593723059,+1.4885330200195312+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+338.1295680999756,+379.79321479797363,+148.85330200195312+],+"forward": [+-0.621266782283783,+-0.7835850119590759,+0.004728781059384346+],+"up": [+0.0060682171024382114,+0.0012234902242198586,+0.9999809265136719+],+"lens_mm": 24.312875747680664,+"fstop": 2.799999952316284,+"focus_cm": 866.3724085672584+},+{+"blender_frame": 126,+"matrix_world": [+[+0.78199702501297,+0.00659006554633379,+0.6232473254203796,+3.373371124267578+],+[+0.6232603192329407,+0.00011267326772212982,+-0.7820144295692444,+-3.7684266567230225+],+[+-0.005223749205470085,+0.9999783039093018,+-0.004019215703010559,+1.4875092506408691+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+337.3371124267578,+376.84266567230225,+148.7509250640869+],+"forward": [+-0.6232473850250244,+-0.7820145487785339,+0.004019216168671846+],+"up": [+0.00659006554633379,+-0.00011267326772212982,+0.9999783039093018+],+"lens_mm": 24.317655563354492,+"fstop": 2.799999952316284,+"focus_cm": 863.4894544386043+},+{+"blender_frame": 127,+"matrix_world": [+[+0.7804204821586609,+0.006756381131708622,+0.6252185702323914,+3.365496873855591+],+[+0.6252223253250122,+0.0017944639548659325,+-0.7804446816444397,+-3.7386558055877686+],+[+-0.006394913885742426,+0.9999756813049316,+-0.0028238038066774607,+1.4853309392929077+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+336.5496873855591,+373.86558055877686,+148.53309392929077+],+"forward": [+-0.6252185702323914,+-0.7804446816444397,+0.0028238038066774607+],+"up": [+0.006756380200386047,+-0.0017944637220352888,+0.9999755620956421+],+"lens_mm": 24.322463989257812,+"fstop": 2.799999952316284,+"focus_cm": 860.5934162707854+},+{+"blender_frame": 128,+"matrix_world": [+[+0.778851330280304,+0.006587558425962925,+0.6271739602088928,+3.35770583152771+],+[+0.6271644234657288,+0.0036868478637188673,+-0.7788782119750977,+-3.7086026668548584+],+[+-0.0074431998655200005,+0.9999715089797974,+-0.001259975484572351,+1.482293725013733+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+335.770583152771,+370.86026668548584,+148.2293725013733+],+"forward": [+-0.6271739602088928,+-0.7788782119750977,+0.001259975484572351+],+"up": [+0.006587558425962925,+-0.0036868478637188673,+0.9999715089797974+],+"lens_mm": 24.327302932739258,+"fstop": 2.799999952316284,+"focus_cm": 857.683586539406+},+{+"blender_frame": 129,+"matrix_world": [+[+0.7772948741912842,+0.006154005415737629,+0.6291064620018005,+3.3500239849090576+],+[+0.6290817260742188,+0.0056050969287753105,+-0.7773190140724182,+-3.6782519817352295+],+[+-0.008309828117489815,+0.9999654293060303,+0.0004854411818087101,+1.4788572788238525+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+335.00239849090576,+367.82519817352295,+147.88572788238525+],+"forward": [+-0.6291064620018005,+-0.7773190140724182,+-0.0004854411818087101+],+"up": [+0.006154005415737629,+-0.0056050969287753105,+0.9999654293060303+],+"lens_mm": 24.332170486450195,+"fstop": 2.799999952316284,+"focus_cm": 854.7593829125617+},+{+"blender_frame": 130,+"matrix_world": [+[+0.7757558226585388,+0.005553947761654854,+0.6310088634490967,+3.342472791671753+],+[+0.6309700012207031,+0.007348581682890654,+-0.7757725119590759,+-3.6475911140441895+],+[+-0.008945620618760586,+0.9999576210975647,+0.0021963303443044424,+1.4755489826202393+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+334.2472791671753,+364.75911140441895,+147.55489826202393+],+"forward": [+-0.6310088634490967,+-0.7757725119590759,+-0.0021963303443044424+],+"up": [+0.005553947761654854,+-0.007348581682890654,+0.9999576210975647+],+"lens_mm": 24.337066650390625,+"fstop": 2.799999952316284,+"focus_cm": 851.8214449744846+},+{+"blender_frame": 131,+"matrix_world": [+[+0.7742385268211365,+0.004886194132268429,+0.6328750252723694,+3.3350658416748047+],+[+0.6328254342079163,+0.008738884702324867,+-0.7742451429367065,+-3.6166138648986816+],+[+-0.00931373331695795,+0.9999498724937439,+0.0036738731432706118,+1.4728529453277588+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+333.50658416748047,+361.66138648986816,+147.28529453277588+],+"forward": [+-0.6328750848770142,+-0.7742452621459961,+-0.003673873608931899+],+"up": [+0.004886194132268429,+-0.008738884702324867,+0.9999498724937439+],+"lens_mm": 24.341991424560547,+"fstop": 2.799999952316284,+"focus_cm": 848.8722499143478+},+{+"blender_frame": 132,+"matrix_world": [+[+0.7727466821670532,+0.004224643111228943,+0.6347004771232605,+3.327806234359741+],+[+0.6346449851989746,+0.009653558023273945,+-0.7727435827255249,+-3.5853159427642822+],+[+-0.009391682222485542,+0.9999444484710693,+0.004778606351464987,+1.471107840538025+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+332.7806234359741,+358.5315942764282,+147.1107840538025+],+"forward": [+-0.6347004175186157,+-0.7727434635162354,+-0.0047786058858036995+],+"up": [+0.00422464357689023,+-0.00965355895459652,+0.9999445676803589+],+"lens_mm": 24.346942901611328,+"fstop": 2.799999952316284,+"focus_cm": 845.9142338593665+},+{+"blender_frame": 133,+"matrix_world": [+[+0.7712836265563965,+0.0035998853854835033,+0.6364814639091492,+3.3206892013549805+],+[+0.6364256143569946,+0.01004914753139019,+-0.7712726593017578,+-3.5537006855010986+],+[+-0.009172589518129826,+0.9999430179595947,+0.0054596830159425735,+1.47043776512146+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+332.06892013549805,+355.37006855010986,+147.043776512146+],+"forward": [+-0.6364814639091492,+-0.7712726593017578,+-0.0054596830159425735+],+"up": [+0.0035998853854835033,+-0.01004914753139019,+0.9999430179595947+],+"lens_mm": 24.351924896240234,+"fstop": 2.799999952316284,+"focus_cm": 842.9495549557032+},+{+"blender_frame": 134,+"matrix_world": [+[+0.7698513269424438,+0.002992598805576563,+0.6382163166999817,+3.3137004375457764+],+[+0.6381644606590271,+0.009968018159270287,+-0.7698355317115784,+-3.5217769145965576+],+[+-0.00866556167602539,+0.999945878982544,+0.00576412258669734,+1.4707285165786743+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+331.37004375457764,+352.17769145965576,+147.07285165786743+],+"forward": [+-0.6382163763046265,+-0.7698356509208679,+-0.005764123052358627+],+"up": [+0.002992598805576563,+-0.009968018159270287,+0.999945878982544+],+"lens_mm": 24.35693359375,+"fstop": 2.799999952316284,+"focus_cm": 839.9790338160528+},+{+"blender_frame": 135,+"matrix_world": [+[+0.7684511542320251,+0.0023396986071020365,+0.6399042010307312,+3.306816339492798+],+[+0.6398597955703735,+0.009528448805212975,+-0.7684326767921448,+-3.489558696746826+],+[+-0.007895194925367832,+0.9999518990516663,+0.005825067404657602,+1.4716578722000122+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+330.6816339492798,+348.9558696746826,+147.16578722000122+],+"forward": [+-0.6399042010307312,+-0.7684326767921448,+-0.005825067404657602+],+"up": [+0.0023396986071020365,+-0.009528448805212975,+0.9999518990516663+],+"lens_mm": 24.361968994140625,+"fstop": 2.799999952316284,+"focus_cm": 837.0015750835591+},+{+"blender_frame": 136,+"matrix_world": [+[+0.7670839428901672,+0.0015527151990681887,+0.6415448188781738,+3.300006628036499+],+[+0.6415095925331116,+0.008899129927158356,+-0.7670633792877197,+-3.4570677280426025+],+[+-0.006900222040712833,+0.9999592304229736,+0.005830297712236643,+1.4727685451507568+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+330.0006628036499,+345.70677280426025,+147.27685451507568+],+"forward": [+-0.6415448188781738,+-0.7670633792877197,+-0.005830297712236643+],+"up": [+0.0015527151990681887,+-0.008899129927158356,+0.9999592304229736+],+"lens_mm": 24.367033004760742,+"fstop": 2.799999952316284,+"focus_cm": 834.015982951405+},+{+"blender_frame": 137,+"matrix_world": [+[+0.765749990940094,+0.0005432735197246075,+0.6431381106376648,+3.2932348251342773+],+[+0.6431128978729248,+0.008264749310910702,+-0.7657268047332764,+-3.424327850341797+],+[+-0.0057313754223287106,+0.9999657869338989,+0.005979346111416817,+1.473572015762329+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+329.32348251342773,+342.4327850341797,+147.3572015762329+],+"forward": [+-0.6431381106376648,+-0.7657268047332764,+-0.005979346111416817+],+"up": [+0.0005432735197246075,+-0.008264749310910702,+0.9999657869338989+],+"lens_mm": 24.37212562561035,+"fstop": 2.799999952316284,+"focus_cm": 831.0206803536857+},+{+"blender_frame": 138,+"matrix_world": [+[+0.764448881149292,+-0.0007494110614061356,+0.6446838974952698,+3.2864596843719482+],+[+0.6446689963340759,+0.007789018098264933,+-0.7644221186637878,+-3.3913681507110596+],+[+-0.004448588006198406,+0.999969482421875,+0.006437428295612335,+1.473658800125122+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+328.6459684371948,+339.13681507110596,+147.3658800125122+],+"forward": [+-0.6446839570999146,+-0.7644222378730774,+-0.00643742922693491+],+"up": [+-0.0007494109449908137,+-0.007789017166942358,+0.9999693632125854+],+"lens_mm": 24.377243041992188,+"fstop": 2.799999952316284,+"focus_cm": 828.0146740720738+},+{+"blender_frame": 139,+"matrix_world": [+[+0.763180136680603,+-0.002335900440812111,+0.6461816430091858,+3.279639720916748+],+[+0.6461783647537231,+0.0075835250318050385,+-0.7631487846374512,+-3.3582186698913574+],+[+-0.003117694752290845,+0.9999685883522034,+0.0072970036417245865,+1.4727905988693237+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+327.9639720916748,+335.82186698913574,+147.27905988693237+],+"forward": [+-0.6461816430091858,+-0.7631487846374512,+-0.0072970036417245865+],+"up": [+-0.002335900440812111,+-0.0075835250318050385,+0.9999685883522034+],+"lens_mm": 24.382387161254883,+"fstop": 2.799999952316284,+"focus_cm": 824.9967685067531+},+{+"blender_frame": 140,+"matrix_world": [+[+0.7619427442550659,+-0.00416399072855711,+0.647631049156189,+3.272730827331543+],+[+0.6476419568061829,+0.007688587997108698,+-0.7619060277938843,+-3.324908971786499+],+[+-0.001806798274628818,+0.999961793422699,+0.008555038832128048,+1.4709546566009521+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+327.2730827331543,+332.4908971786499,+147.09546566009521+],+"forward": [+-0.6476311087608337,+-0.7619061470031738,+-0.008555039763450623+],+"up": [+-0.00416399072855711,+-0.007688587997108698,+0.999961793422699+],+"lens_mm": 24.38755989074707,+"fstop": 2.799999952316284,+"focus_cm": 821.9658519814402+},+{+"blender_frame": 141,+"matrix_world": [+[+0.760735809803009,+-0.006119712721556425,+0.6490328311920166,+3.265692710876465+],+[+0.6490615010261536,+0.008070066571235657,+-0.7606931924819946,+-3.291466474533081+],+[+-0.0005825142725370824,+0.9999487400054932,+0.010111258365213871,+1.4683698415756226+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+326.5692710876465,+329.1466474533081,+146.83698415756226+],+"forward": [+-0.6490328907966614,+-0.7606933116912842,+-0.010111259296536446+],+"up": [+-0.006119712721556425,+-0.008070066571235657,+0.9999487400054932+],+"lens_mm": 24.392757415771484,+"fstop": 2.799999952316284,+"focus_cm": 818.9208721349132+},+{+"blender_frame": 142,+"matrix_world": [+[+0.7595579624176025,+-0.008042099885642529,+0.6503899097442627,+3.2584877014160156+],+[+0.6504395008087158,+0.008632279932498932,+-0.7595090270042419,+-3.2579140663146973+],+[+0.0004936993354931474,+0.9999304413795471,+0.011787617579102516,+1.465440273284912+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+325.84877014160156,+325.7914066314697,+146.5440273284912+],+"forward": [+-0.6503899693489075,+-0.7595091462135315,+-0.011787619441747665+],+"up": [+-0.008042099885642529,+-0.008632279932498932,+0.9999304413795471+],+"lens_mm": 24.397981643676758,+"fstop": 2.799999952316284,+"focus_cm": 815.8619518857449+},+{+"blender_frame": 143,+"matrix_world": [+[+0.7584075331687927,+-0.009748999960720539,+0.6517078280448914,+3.251084566116333+],+[+0.6517793536186218,+0.009243778884410858,+-0.7583523392677307,+-3.224268674850464+],+[+0.0013689337065443397,+0.9999097585678101,+0.01336474809795618,+1.4626686573028564+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+325.1084566116333,+322.4268674850464,+146.26686573028564+],+"forward": [+-0.6517078280448914,+-0.7583523392677307,+-0.01336474809795618+],+"up": [+-0.009748999960720539,+-0.009243778884410858,+0.9999097585678101+],+"lens_mm": 24.403230667114258,+"fstop": 2.799999952316284,+"focus_cm": 812.790540480637+},+{+"blender_frame": 144,+"matrix_world": [+[+0.7572824358940125,+-0.011069022119045258,+0.6529937982559204,+3.2434592247009277+],+[+0.6530845761299133,+0.009770335629582405,+-0.7572219967842102,+-3.190540075302124+],+[+0.0020017388742417097,+0.9998911023139954,+0.014627909287810326,+1.4605474472045898+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+324.3459224700928,+319.0540075302124,+146.05474472045898+],+"forward": [+-0.6529937982559204,+-0.7572219967842102,+-0.014627909287810326+],+"up": [+-0.011069021187722683,+-0.00977033469825983,+0.9998909831047058+],+"lens_mm": 24.408506393432617,+"fstop": 2.799999952316284,+"focus_cm": 809.7096637255163+},+{+"blender_frame": 145,+"matrix_world": [+[+0.7561801075935364,+-0.011872687377035618,+0.6542558073997498,+3.2355966567993164+],+[+0.6543593406677246,+0.010107249021530151,+-0.7561162114143372,+-3.156729221343994+],+[+0.002364404732361436,+0.9998784065246582,+0.015411904081702232,+1.4594528675079346+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+323.55966567993164,+315.6729221343994,+145.94528675079346+],+"forward": [+-0.6542558670043945,+-0.7561163306236267,+-0.015411905944347382+],+"up": [+-0.011872689239680767,+-0.010107249952852726,+0.9998785257339478+],+"lens_mm": 24.413806915283203,+"fstop": 2.799999952316284,+"focus_cm": 806.6219280437508+},+{+"blender_frame": 146,+"matrix_world": [+[+0.7550973296165466,+-0.012096596881747246,+0.6555010676383972,+3.227492570877075+],+[+0.6556081175804138,+0.010204168036580086,+-0.7550323009490967,+-3.1228296756744385+],+[+0.0024444786831736565,+0.9998748302459717,+0.015635767951607704,+1.4595615863800049+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+322.7492570877075,+312.28296756744385,+145.9561586380005+],+"forward": [+-0.655501127243042,+-0.7550324201583862,+-0.015635769814252853+],+"up": [+-0.012096596881747246,+-0.010204168036580086,+0.9998748302459717+],+"lens_mm": 24.41913414001465,+"fstop": 2.799999952316284,+"focus_cm": 803.5286640093545+},+{+"blender_frame": 147,+"matrix_world": [+[+0.7540305256843567,+-0.011755142360925674,+0.6567342281341553,+3.219151496887207+],+[+0.656835675239563,+0.010076433420181274,+-0.7539663910865784,+-3.0888257026672363+],+[+0.002245443407446146,+0.9998801946640015,+0.015319135040044785,+1.4608128070831299+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+321.9151496887207,+308.88257026672363,+146.081280708313+],+"forward": [+-0.6567342877388,+-0.7539665102958679,+-0.015319136902689934+],+"up": [+-0.011755142360925674,+-0.010076433420181274,+0.9998801946640015+],+"lens_mm": 24.424484252929688,+"fstop": 2.799999952316284,+"focus_cm": 800.4284887560061+},+{+"blender_frame": 148,+"matrix_world": [+[+0.7529751062393188,+-0.01093757152557373,+0.6579582095146179,+3.210590362548828+],+[+0.6580466628074646,+0.009800824336707592,+-0.7529133558273315,+-3.0546934604644775+],+[+0.0017865117406472564,+0.9998921751976013,+0.014577209018170834,+1.4629199504852295+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+321.0590362548828,+305.46934604644775,+146.29199504852295+],+"forward": [+-0.6579582095146179,+-0.7529133558273315,+-0.014577209018170834+],+"up": [+-0.01093757152557373,+-0.009800824336707592,+0.9998921751976013+],+"lens_mm": 24.429861068725586,+"fstop": 2.799999952316284,+"focus_cm": 797.3181154346094+},+{+"blender_frame": 149,+"matrix_world": [+[+0.7519262433052063,+-0.009790850803256035,+0.6591745018959045,+3.2018349170684814+],+[+0.6592462658882141,+0.009496523067355156,+-0.7518671751022339,+-3.0204031467437744+],+[+0.0011015543714165688,+0.9999070167541504,+0.01359526813030243,+1.4654319286346436+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+320.18349170684814,+302.04031467437744,+146.54319286346436+],+"forward": [+-0.6591745018959045,+-0.7518671751022339,+-0.01359526813030243+],+"up": [+-0.009790850803256035,+-0.009496523067355156,+0.9999070167541504+],+"lens_mm": 24.435260772705078,+"fstop": 2.799999952316284,+"focus_cm": 794.1933219583007+},+{+"blender_frame": 150,+"matrix_world": [+[+0.7508791089057922,+-0.008491943590342999,+0.6603851914405823,+3.1929192543029785+],+[+0.6604397296905518,+0.009295675903558731,+-0.7508215308189392,+-2.985917568206787+],+[+0.000237208281760104,+0.9999208450317383,+0.012588344514369965,+1.4678295850753784+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+319.29192543029785,+298.5917568206787,+146.78295850753784+],+"forward": [+-0.6603851914405823,+-0.7508215308189392,+-0.012588344514369965+],+"up": [+-0.008491942659020424,+-0.009295674972236156,+0.9999207258224487+],+"lens_mm": 24.44068717956543,+"fstop": 2.799999952316284,+"focus_cm": 791.0503017628798+},+{+"blender_frame": 151,+"matrix_world": [+[+0.7498279809951782,+-0.007215133868157864,+0.661593496799469,+3.1838836669921875+],+[+0.6616323590278625,+0.009309951215982437,+-0.7497705221176147,+-2.951193332672119+],+[+-0.0007497078040614724,+0.9999306797981262,+0.011754628270864487,+1.4696375131607056+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+318.38836669921875,+295.1193332672119,+146.96375131607056+],+"forward": [+-0.661593496799469,+-0.7497705221176147,+-0.011754628270864487+],+"up": [+-0.007215133868157864,+-0.009309951215982437,+0.9999306797981262+],+"lens_mm": 24.446134567260742,+"fstop": 2.799999952316284,+"focus_cm": 787.8868621162837+},+{+"blender_frame": 152,+"matrix_world": [+[+0.7488173246383667,+-0.006101035512983799,+0.6627483367919922,+3.174773693084717+],+[+0.6627739071846008,+0.009601124562323093,+-0.7487580180168152,+-2.916184186935425+],+[+-0.001794930431060493,+0.9999353885650635,+0.01123309601098299,+1.4705243110656738+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+317.4773693084717,+291.6184186935425,+147.05243110656738+],+"forward": [+-0.6627483367919922,+-0.7487580180168152,+-0.01123309601098299+],+"up": [+-0.006101034581661224,+-0.009601123631000519,+0.9999352693557739+],+"lens_mm": 24.451608657836914,+"fstop": 2.799999952316284,+"focus_cm": 784.7032730060164+},+{+"blender_frame": 153,+"matrix_world": [+[+0.7482024431228638,+-0.005232863128185272,+0.6634498238563538,+3.165634870529175+],+[+0.6634644269943237,+0.010163120925426483,+-0.7481388449668884,+-2.88084077835083+],+[+-0.002827812684699893,+0.9999346733093262,+0.011075889691710472,+1.4703733921051025+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+316.5634870529175,+288.084077835083,+147.03733921051025+],+"forward": [+-0.6634498238563538,+-0.7481388449668884,+-0.011075889691710472+],+"up": [+-0.005232863128185272,+-0.010163120925426483,+0.9999346733093262+],+"lens_mm": 24.457103729248047,+"fstop": 2.799999952316284,+"focus_cm": 781.5034113504225+},+{+"blender_frame": 154,+"matrix_world": [+[+0.7479358315467834,+-0.004630785435438156,+0.663754940032959,+3.1565120220184326+],+[+0.6637604236602783,+0.010914018377661705,+-0.747865617275238,+-2.8451123237609863+],+[+-0.0037810280919075012,+0.9999297261238098,+0.01123671606183052,+1.4693052768707275+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+315.65120220184326,+284.51123237609863,+146.93052768707275+],+"forward": [+-0.6637549996376038,+-0.7478656768798828,+-0.011236716993153095+],+"up": [+-0.004630785435438156,+-0.010914018377661705,+0.9999297261238098+],+"lens_mm": 24.462623596191406,+"fstop": 2.799999952316284,+"focus_cm": 778.2850115268957+},+{+"blender_frame": 155,+"matrix_world": [+[+0.7478709816932678,+-0.004254282917827368,+0.6638306379318237,+3.1474461555480957+],+[+0.6638283729553223,+0.011710251681506634,+-0.7477933764457703,+-2.808948278427124+],+[+-0.0045922985300421715,+0.9999223947525024,+0.011581869795918465,+1.467648983001709+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+314.74461555480957,+280.8948278427124,+146.7648983001709+],+"forward": [+-0.6638306379318237,+-0.7477933764457703,+-0.011581869795918465+],+"up": [+-0.004254282917827368,+-0.011710251681506634,+0.9999223947525024+],+"lens_mm": 24.46816635131836,+"fstop": 2.799999952316284,+"focus_cm": 775.0448850682005+},+{+"blender_frame": 156,+"matrix_world": [+[+0.7478617429733276,+-0.004020052030682564,+0.6638423204421997,+3.138471841812134+],+[+0.6638340950012207,+0.012372277677059174,+-0.74777752161026,+-2.7723026275634766+],+[+-0.005207137670367956,+0.9999154210090637,+0.01192140020430088,+1.465867280960083+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+313.8471841812134,+277.23026275634766,+146.5867280960083+],+"forward": [+-0.6638423800468445,+-0.7477775812149048,+-0.01192140206694603+],+"up": [+-0.004020052030682564,+-0.012372277677059174,+0.9999154210090637+],+"lens_mm": 24.473731994628906,+"fstop": 2.799999952316284,+"focus_cm": 771.7809513094835+},+{+"blender_frame": 157,+"matrix_world": [+[+0.7477619647979736,+-0.003828828688710928,+0.6639559864997864,+3.12961745262146+],+[+0.6639435291290283,+0.012718752026557922,+-0.7476745843887329,+-2.7351317405700684+],+[+-0.005581972189247608,+0.9999117851257324,+0.01205272413790226,+1.4644534587860107+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+312.961745262146,+273.51317405700684,+146.44534587860107+],+"forward": [+-0.6639559864997864,+-0.7476745843887329,+-0.01205272413790226+],+"up": [+-0.003828828688710928,+-0.012718752026557922,+0.9999117851257324+],+"lens_mm": 24.479320526123047,+"fstop": 2.799999952316284,+"focus_cm": 768.4933824115433+},+{+"blender_frame": 158,+"matrix_world": [+[+0.747425377368927,+-0.003593993140384555,+0.664336085319519,+3.1209018230438232+],+[+0.6643214821815491,+0.012602964416146278,+-0.747340738773346,+-2.697401523590088+],+[+-0.005686665419489145,+0.9999141097068787,+0.011807341128587723,+1.463822364807129+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+312.0901823043823,+269.7401523590088,+146.3822364807129+],+"forward": [+-0.664336085319519,+-0.747340738773346,+-0.011807341128587723+],+"up": [+-0.003593993140384555,+-0.012602964416146278,+0.9999141097068787+],+"lens_mm": 24.48493003845215,+"fstop": 2.799999952316284,+"focus_cm": 765.1833627431188+},+{+"blender_frame": 159,+"matrix_world": [+[+0.7467054724693298,+-0.003265161532908678,+0.6651468276977539,+3.1123368740081787+],+[+0.6651321053504944,+0.011943499557673931,+-0.7466301918029785,+-2.659085750579834+],+[+-0.005506312474608421,+0.9999234080314636,+0.011090039275586605,+1.4642157554626465+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+311.23368740081787,+265.9085750579834,+146.42157554626465+],+"forward": [+-0.6651468873023987,+-0.7466302514076233,+-0.01109004020690918+],+"up": [+-0.003265161532908678,+-0.011943499557673931,+0.9999234080314636+],+"lens_mm": 24.490564346313477,+"fstop": 2.799999952316284,+"focus_cm": 761.8529328203294+},+{+"blender_frame": 160,+"matrix_world": [+[+0.7454547882080078,+-0.002842104993760586,+0.6665501594543457,+3.1039235591888428+],+[+0.6665371656417847,+0.010742898099124432,+-0.7453944087028503,+-2.6201677322387695+],+[+-0.005042192060500383,+0.9999383091926575,+0.0099027119576931,+1.4656494855880737+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+310.3923559188843,+262.01677322387695,+146.56494855880737+],+"forward": [+-0.6665502190589905,+-0.7453944683074951,+-0.009902712889015675+],+"up": [+-0.002842104993760586,+-0.010742898099124432,+0.9999383091926575+],+"lens_mm": 24.496217727661133,+"fstop": 2.799999952316284,+"focus_cm": 758.5030036047101+},+{+"blender_frame": 161,+"matrix_world": [+[+0.743860125541687,+-0.00237622344866395,+0.6683311462402344,+3.0956640243530273+],+[+0.6683215498924255,+0.009089358150959015,+-0.7438169717788696,+-2.580620050430298+],+[+-0.0043072267435491085,+0.999955952167511,+0.008349291048943996,+1.4679079055786133+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+309.56640243530273,+258.0620050430298,+146.79079055786133+],+"forward": [+-0.6683312058448792,+-0.7438170313835144,+-0.008349291980266571+],+"up": [+-0.00237622344866395,+-0.009089358150959015,+0.999955952167511+],+"lens_mm": 24.501893997192383,+"fstop": 2.799999952316284,+"focus_cm": 755.1304532040376+},+{+"blender_frame": 162,+"matrix_world": [+[+0.7421495318412781,+-0.0019618647638708353,+0.6702314615249634,+3.087660551071167+],+[+0.6702261567115784,+0.007137888111174107,+-0.7421226501464844,+-2.540147304534912+],+[+-0.0033280933275818825,+0.9999726414680481,+0.006612271070480347,+1.4705829620361328+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+308.7660551071167,+254.0147304534912,+147.05829620361328+],+"forward": [+-0.6702314615249634,+-0.7421226501464844,+-0.006612271070480347+],+"up": [+-0.0019618647638708353,+-0.007137888111174107,+0.9999726414680481+],+"lens_mm": 24.507593154907227,+"fstop": 2.799999952316284,+"focus_cm": 751.7178781039547+},+{+"blender_frame": 163,+"matrix_world": [+[+0.7403111457824707,+-0.0017139208503067493,+0.6722621917724609,+3.079923391342163+],+[+0.672261118888855,+0.005082876421511173,+-0.7402966618537903,+-2.498687982559204+],+[+-0.0021482163574546576,+0.9999856352806091,+0.0049151103012263775,+1.4731725454330444+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+307.9923391342163,+249.8687982559204,+147.31725454330444+],+"forward": [+-0.6722623705863953,+-0.7402968406677246,+-0.004915111698210239+],+"up": [+-0.0017139208503067493,+-0.005082876421511173,+0.9999856352806091+],+"lens_mm": 24.5133113861084,+"fstop": 2.799999952316284,+"focus_cm": 748.2620310591301+},+{+"blender_frame": 164,+"matrix_world": [+[+0.7383415102958679,+-0.0017387913540005684,+0.6744248270988464,+3.0724198818206787+],+[+0.6744266152381897,+0.003122589085251093,+-0.7383352518081665,+-2.456284761428833+],+[+-0.0008221400785259902,+0.999993622303009,+0.0034782220609486103,+1.4751852750778198+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+307.24198818206787,+245.6284761428833,+147.51852750778198+],+"forward": [+-0.6744248867034912,+-0.7383353114128113,+-0.0034782225266098976+],+"up": [+-0.0017387913540005684,+-0.003122589085251093,+0.999993622303009+],+"lens_mm": 24.51905059814453,+"fstop": 2.799999952316284,+"focus_cm": 744.7660828212975+},+{+"blender_frame": 165,+"matrix_world": [+[+0.7362378239631653,+-0.0021065999753773212,+0.676719605922699,+3.0651140213012695+],+[+0.6767227053642273,+0.0014237877912819386,+-0.7362366318702698,+-2.4129865169525146+],+[+0.0005874508060514927,+0.9999967813491821,+0.0024738293141126633,+1.47624671459198+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+306.51140213012695,+241.29865169525146,+147.624671459198+],+"forward": [+-0.6767196655273438,+-0.7362366914749146,+-0.002473829546943307+],+"up": [+-0.0021065999753773212,+-0.0014237877912819386,+0.9999967813491821+],+"lens_mm": 24.524812698364258,+"fstop": 2.799999952316284,+"focus_cm": 741.2351173101342+},+{+"blender_frame": 166,+"matrix_world": [+[+0.7339985370635986,+-0.002829949837177992,+0.6791452169418335,+3.0579633712768555+],+[+0.6791481375694275,+9.424425661563873e-05,+-0.7340012192726135,+-2.3688461780548096+],+[+0.0020131804049015045,+0.9999960064888,+0.0019911304116249084,+1.4761799573898315+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+305.79633712768555,+236.88461780548096,+147.61799573898315+],+"forward": [+-0.6791452169418335,+-0.7340012192726135,+-0.0019911304116249084+],+"up": [+-0.002829949837177992,+-9.424425661563873e-05,+0.9999960064888+],+"lens_mm": 24.53059196472168,+"fstop": 2.799999952316284,+"focus_cm": 737.6734364268486+},+{+"blender_frame": 167,+"matrix_world": [+[+0.7316223382949829,+-0.0038547609001398087,+0.6816992163658142,+3.050924777984619+],+[+0.6817017197608948,+-0.0008308985270559788,+-0.7316296696662903,+-2.3239176273345947+],+[+0.0033866805024445057,+0.9999922513961792,+0.0020198924466967583,+1.4750465154647827+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+305.0924777984619,+232.39176273345947,+147.50465154647827+],+"forward": [+-0.681699275970459,+-0.7316297292709351,+-0.002019892679527402+],+"up": [+-0.0038547609001398087,+0.0008308985270559788,+0.9999922513961792+],+"lens_mm": 24.536394119262695,+"fstop": 2.799999952316284,+"focus_cm": 734.0845756407361+},+{+"blender_frame": 168,+"matrix_world": [+[+0.7291093468666077,+-0.005064977332949638,+0.684378445148468,+3.0439531803131104+],+[+0.684381365776062,+-0.001387171447277069,+-0.7291228771209717,+-2.278254508972168+],+[+0.004642341751605272,+0.9999862909317017,+0.0024549756199121475,+1.473132848739624+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+304.39531803131104,+227.8254508972168,+147.3132848739624+],+"forward": [+-0.684378445148468,+-0.7291228771209717,+-0.0024549756199121475+],+"up": [+-0.005064977332949638,+0.001387171447277069,+0.9999862909317017+],+"lens_mm": 24.54221534729004,+"fstop": 2.799999952316284,+"focus_cm": 730.4698824271327+},+{+"blender_frame": 169,+"matrix_world": [+[+0.7264600396156311,+-0.006301322486251593,+0.6871797442436218,+3.037006378173828+],+[+0.6871848702430725,+-0.00166351068764925,+-0.7264806628227234,+-2.231907606124878+],+[+0.00572091992944479,+0.99997878074646,+0.0031216973438858986,+1.4708894491195679+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+303.7006378173828,+223.1907606124878,+147.0889449119568+],+"forward": [+-0.6871798038482666,+-0.7264807224273682,+-0.003121697809547186+],+"up": [+-0.006301322486251593,+0.00166351068764925,+0.99997878074646+],+"lens_mm": 24.54805564880371,+"fstop": 2.799999952316284,+"focus_cm": 726.8298421578947+},+{+"blender_frame": 170,+"matrix_world": [+[+0.7236757874488831,+-0.0073902481235563755,+0.6901005506515503,+3.0300445556640625+],+[+0.6901088356971741,+-0.0017743008211255074,+-0.7237034440040588,+-2.184924602508545+],+[+0.006572794169187546,+0.9999711513519287,+0.0038160542026162148,+1.4688347578048706+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+303.00445556640625,+218.4924602508545,+146.88347578048706+],+"forward": [+-0.6901005506515503,+-0.7237034440040588,+-0.0038160542026162148+],+"up": [+-0.0073902481235563755,+0.0017743008211255074,+0.9999711513519287+],+"lens_mm": 24.553916931152344,+"fstop": 2.799999952316284,+"focus_cm": 723.1649501249194+},+{+"blender_frame": 171,+"matrix_world": [+[+0.7207576036453247,+-0.008177103474736214,+0.6931389570236206,+3.0230355262756348+],+[+0.6931501030921936,+-0.001827468629926443,+-0.7207909226417542,+-2.1373472213745117+],+[+0.007160671520978212,+0.9999648928642273,+0.004350799135863781,+1.467443585395813+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+302.3035526275635,+213.73472213745117,+146.7443585395813+],+"forward": [+-0.6931389570236206,+-0.7207909226417542,+-0.004350799135863781+],+"up": [+-0.008177103474736214,+0.001827468629926443,+0.9999648928642273+],+"lens_mm": 24.559795379638672,+"fstop": 2.799999952316284,+"focus_cm": 719.4760080543347+},+{+"blender_frame": 172,+"matrix_world": [+[+0.7177075147628784,+-0.008557035587728024,+0.6962921023368835,+3.0159547328948975+],+[+0.6963046789169312,+-0.0018955864943563938,+-0.7177438139915466,+-2.089214324951172+],+[+0.0074616409838199615,+0.9999615550041199,+0.004597827792167664,+1.4670459032058716+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+301.59547328948975,+208.9214324951172,+146.70459032058716+],+"forward": [+-0.6962921023368835,+-0.7177438139915466,+-0.004597827792167664+],+"up": [+-0.008557036519050598,+0.0018955867271870375,+0.9999616742134094+],+"lens_mm": 24.56569480895996,+"fstop": 2.799999952316284,+"focus_cm": 715.7645836268784+},+{+"blender_frame": 173,+"matrix_world": [+[+0.714527428150177,+-0.008496562018990517,+0.6995558738708496,+3.0087883472442627+],+[+0.6995676755905151,+-0.0019970927387475967,+-0.7145636081695557,+-2.0405595302581787+],+[+0.007468412630259991,+0.9999619722366333,+0.00451694056391716,+1.4677568674087524+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+300.87883472442627,+204.05595302581787,+146.77568674087524+],+"forward": [+-0.6995558738708496,+-0.7145636081695557,+-0.00451694056391716+],+"up": [+-0.008496562018990517,+0.0019970927387475967,+0.9999619722366333+],+"lens_mm": 24.571611404418945,+"fstop": 2.799999952316284,+"focus_cm": 712.0324429182801+},+{+"blender_frame": 174,+"matrix_world": [+[+0.7112189531326294,+-0.00804166030138731,+0.7029246091842651,+3.001533031463623+],+[+0.7029338479042053,+-0.002091330010443926,+-0.7112521529197693,+-1.9914109706878662+],+[+0.0071896957233548164,+0.9999655485153198,+0.00416535884141922,+1.4694544076919556+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+300.1533031463623,+199.14109706878662,+146.94544076919556+],+"forward": [+-0.7029246091842651,+-0.7112521529197693,+-0.00416535884141922+],+"up": [+-0.00804166030138731,+0.002091330010443926,+0.9999655485153198+],+"lens_mm": 24.577547073364258,+"fstop": 2.799999952316284,+"focus_cm": 708.2818875438534+},+{+"blender_frame": 175,+"matrix_world": [+[+0.7077839374542236,+-0.0073103103786706924,+0.7063910961151123,+2.9941961765289307+],+[+0.7063976526260376,+-0.0020886226557195187,+-0.7078121304512024,+-1.9417927265167236+],+[+0.006649712100625038,+0.9999711513519287,+0.0036856895312666893,+1.4718084335327148+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+299.41961765289307,+194.17927265167236,+147.18084335327148+],+"forward": [+-0.7063910961151123,+-0.7078121304512024,+-0.0036856895312666893+],+"up": [+-0.0073103103786706924,+0.0020886226557195187,+0.9999711513519287+],+"lens_mm": 24.583499908447266,+"fstop": 2.799999952316284,+"focus_cm": 704.5158017397625+},+{+"blender_frame": 176,+"matrix_world": [+[+0.7042242288589478,+-0.006470369175076485,+0.7099480628967285,+2.9867944717407227+],+[+0.7099533081054688,+-0.001873508095741272,+-0.7042463421821594,+-1.8917235136032104+],+[+0.005886828061193228,+0.9999772906303406,+0.003274288959801197,+1.4743536710739136+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+298.67944717407227,+189.17235136032104,+147.43536710739136+],+"forward": [+-0.7099481225013733,+-0.7042464017868042,+-0.0032742894254624844+],+"up": [+-0.006470370106399059,+0.0018735083285719156,+0.9999774098396301+],+"lens_mm": 24.5894718170166,+"fstop": 2.799999952316284,+"focus_cm": 700.7382235082332+},+{+"blender_frame": 177,+"matrix_world": [+[+0.7005416750907898,+-0.005708291195333004,+0.7135885953903198,+2.97935152053833+],+[+0.713594377040863,+-0.0013347221538424492,+-0.7005578875541687,+-1.841216802597046+],+[+0.0049514309503138065,+0.9999828338623047,+0.0031383726745843887,+1.4765949249267578+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+297.935152053833,+184.1216802597046,+147.65949249267578+],+"forward": [+-0.7135886549949646,+-0.7005579471588135,+-0.003138373140245676+],+"up": [+-0.005708291195333004,+0.0013347221538424492,+0.9999828338623047+],+"lens_mm": 24.595460891723633,+"fstop": 2.799999952316284,+"focus_cm": 696.953822139767+},+{+"blender_frame": 178,+"matrix_world": [+[+0.6967381238937378,+-0.005194041877985001,+0.7173067331314087,+2.971895694732666+],+[+0.7173149585723877,+-0.000396176241338253,+-0.6967489719390869,+-1.7902805805206299+],+[+0.0039031237829476595,+0.999986469745636,+0.0034497305750846863,+1.4781157970428467+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+297.1895694732666,+179.028058052063,+147.81157970428467+],+"forward": [+-0.7173067331314087,+-0.6967489719390869,+-0.0034497305750846863+],+"up": [+-0.005194041877985001,+0.000396176241338253,+0.999986469745636+],+"lens_mm": 24.601469039916992,+"fstop": 2.799999952316284,+"focus_cm": 693.1675487430766+},+{+"blender_frame": 179,+"matrix_world": [+[+0.6928160786628723,+-0.005050156265497208,+0.7210966944694519,+2.96445631980896+],+[+0.7211089730262756,+0.0009588664397597313,+-0.6928209662437439,+-1.7389181852340698+],+[+0.002807418815791607,+0.9999868273735046,+0.0043060267344117165,+1.4786715507507324+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+296.445631980896,+173.89181852340698,+147.86715507507324+],+"forward": [+-0.7210967540740967,+-0.6928210258483887,+-0.004306027200073004+],+"up": [+-0.005050156265497208,+-0.0009588664397597313,+0.9999868273735046+],+"lens_mm": 24.607492446899414,+"fstop": 2.799999952316284,+"focus_cm": 689.3832366069546+},+{+"blender_frame": 180,+"matrix_world": [+[+0.6887774467468262,+-0.005331323482096195,+0.7249532341957092,+2.957062244415283+],+[+0.7249708771705627,+0.0026759905740618706,+-0.6887744069099426,+-1.6871283054351807+],+[+0.0017321108607575297,+0.9999822378158569,+0.005708212964236736,+1.4782439470291138+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+295.7062244415283,+168.71283054351807,+147.82439470291138+],+"forward": [+-0.7249532341957092,+-0.6887744069099426,+-0.005708212964236736+],+"up": [+-0.005331323482096195,+-0.0026759905740618706,+0.9999822378158569+],+"lens_mm": 24.61353302001953,+"fstop": 2.799999952316284,+"focus_cm": 685.6026168097742+},+{+"blender_frame": 181,+"matrix_world": [+[+0.6846253275871277,+-0.006018186919391155,+0.7288702726364136,+2.9497363567352295+],+[+0.7288947701454163,+0.00463265273720026,+-0.6846099495887756,+-1.6349071264266968+],+[+0.0007435076986439526,+0.9999711513519287,+0.007558252662420273,+1.477046012878418+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+294.97363567352295,+163.49071264266968,+147.7046012878418+],+"forward": [+-0.7288703322410583,+-0.6846100091934204,+-0.0075582535937428474+],+"up": [+-0.006018186919391155,+-0.00463265273720026,+0.9999711513519287+],+"lens_mm": 24.619590759277344,+"fstop": 2.799999952316284,+"focus_cm": 681.825741234934+},+{+"blender_frame": 182,+"matrix_world": [+[+0.6803622841835022,+-0.0070271180011332035,+0.7328422665596008,+2.942497968673706+],+[+0.7328759431838989,+0.006656265817582607,+-0.6803297400474548,+-1.5822501182556152+],+[+-9.723644325276837e-05,+0.9999530911445618,+0.009678678587079048,+1.475476622581482+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+294.2497968673706,+158.22501182556152,+147.5476622581482+],+"forward": [+-0.7328422665596008,+-0.6803297400474548,+-0.009678678587079048+],+"up": [+-0.007027118932455778,+-0.006656266748905182,+0.9999532103538513+],+"lens_mm": 24.62566375732422,+"fstop": 2.799999952316284,+"focus_cm": 678.0520478845574+},+{+"blender_frame": 183,+"matrix_world": [+[+0.6759915947914124,+-0.008233023807406425,+0.7368633151054382,+2.935359001159668+],+[+0.7369089722633362,+0.008553178049623966,+-0.6759379506111145,+-1.529154658317566+],+[+-0.0007375115528702736,+0.9999294877052307,+0.011848867870867252,+1.474032998085022+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+293.5359001159668,+152.9154658317566,+147.4032998085022+],+"forward": [+-0.7368633151054382,+-0.6759379506111145,+-0.011848867870867252+],+"up": [+-0.008233024738729,+-0.00855317898094654,+0.9999296069145203+],+"lens_mm": 24.63175392150879,+"fstop": 2.799999952316284,+"focus_cm": 674.2814745637588+},+{+"blender_frame": 184,+"matrix_world": [+[+0.6715161800384521,+-0.00950046069920063,+0.7409290075302124,+2.9283244609832764+],+[+0.7409890294075012,+0.010142900981009007,+-0.671440601348877,+-1.4756230115890503+],+[+-0.00113617570605129,+0.9999034404754639,+0.013850858435034752,+1.4732030630111694+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+292.83244609832764,+147.56230115890503,+147.32030630111694+],+"forward": [+-0.7409290075302124,+-0.671440601348877,+-0.013850858435034752+],+"up": [+-0.00950046069920063,+-0.010142900981009007,+0.9999034404754639+],+"lens_mm": 24.637859344482422,+"fstop": 2.799999952316284,+"focus_cm": 670.5153621151112+},+{+"blender_frame": 185,+"matrix_world": [+[+0.6669390797615051,+-0.010715926997363567,+0.7450352311134338,+2.921393871307373+],+[+0.7451112270355225,+0.011290318332612514,+-0.6668446660041809,+-1.421664834022522+],+[+-0.001265826285816729,+0.9998789429664612,+0.015514509752392769,+1.473358154296875+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+292.1393871307373,+142.1664834022522,+147.3358154296875+],+"forward": [+-0.7450352311134338,+-0.6668446660041809,+-0.015514509752392769+],+"up": [+-0.010715926066040993,+-0.01129031740128994,+0.9998788237571716+],+"lens_mm": 24.643980026245117,+"fstop": 2.799999952316284,+"focus_cm": 666.7565062525682+},+{+"blender_frame": 186,+"matrix_world": [+[+0.6622630953788757,+-0.01181380171328783,+0.7491783499717712,+2.9145615100860596+],+[+0.7492706179618835,+0.011928947642445564,+-0.6621565818786621,+-1.3672994375228882+],+[+-0.0011143224546685815,+0.9998591542243958,+0.016751836985349655,+1.474670648574829+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.45615100860596,+136.72994375228882,+147.4670648574829+],+"forward": [+-0.7491782903671265,+-0.6621565222740173,+-0.016751835122704506+],+"up": [+-0.01181380171328783,+-0.011928947642445564,+0.9998591542243958+],+"lens_mm": 24.650115966796875,+"fstop": 2.799999952316284,+"focus_cm": 663.0082016577944+},+{+"blender_frame": 187,+"matrix_world": [+[+0.6574910879135132,+-0.012790536507964134,+0.7533537745475769,+2.9078171253204346+],+[+0.7534621953964233,+0.012070989236235619,+-0.6573806405067444,+-1.3125574588775635+],+[+-0.0006854732055217028,+0.9998453259468079,+0.017573751509189606,+1.4770748615264893+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.78171253204346,+131.25574588775635,+147.70748615264893+],+"forward": [+-0.7533537745475769,+-0.6573806405067444,+-0.017573751509189606+],+"up": [+-0.012790538370609283,+-0.012070991098880768,+0.9998454451560974+],+"lens_mm": 24.656269073486328,+"fstop": 2.799999952316284,+"focus_cm": 659.2732766643167+},+{+"blender_frame": 188,+"matrix_world": [+[+0.6526256799697876,+-0.013703515753149986,+0.7575565576553345,+2.9011480808258057+],+[+0.7576804161071777,+0.011801918037235737,+-0.6525190472602844,+-1.2574795484542847+],+[+1.184220309369266e-06,+0.9998364448547363,+0.018085122108459473,+1.4802803993225098+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.11480808258057,+125.74795484542847,+148.02803993225098+],+"forward": [+-0.7575565576553345,+-0.6525190472602844,+-0.018085122108459473+],+"up": [+-0.013703517615795135,+-0.011801919899880886,+0.9998365640640259+],+"lens_mm": 24.66243553161621,+"fstop": 2.799999952316284,+"focus_cm": 655.554402503185+},+{+"blender_frame": 189,+"matrix_world": [+[+0.6476697325706482,+-0.014654844999313354,+0.7617802619934082,+2.894537925720215+],+[+0.7619207501411438,+0.011261283420026302,+-0.64757239818573,+-1.2021170854568481+],+[+0.0009114502463489771,+0.999829113483429,+0.018459422513842583,+1.4838314056396484+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.4537925720215,+120.21170854568481,+148.38314056396484+],+"forward": [+-0.7617803812026978,+-0.6475724577903748,+-0.018459424376487732+],+"up": [+-0.014654846861958504,+-0.011261284351348877,+0.9998292326927185+],+"lens_mm": 24.668615341186523,+"fstop": 2.799999952316284,+"focus_cm": 651.8537009134889+},+{+"blender_frame": 190,+"matrix_world": [+[+0.6426255702972412,+-0.01576378382742405,+0.766018271446228,+2.8879668712615967+],+[+0.7661778926849365,+0.01061401516199112,+-0.6425409913063049,+-1.1465286016464233+],+[+0.0019983460661023855,+0.9998193383216858,+0.018898699432611465,+1.4872047901153564+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.79668712615967,+114.65286016464233,+148.72047901153564+],+"forward": [+-0.766018271446228,+-0.6425409913063049,+-0.018898699432611465+],+"up": [+-0.0157637856900692,+-0.010614016093313694,+0.9998194575309753+],+"lens_mm": 24.6748104095459,+"fstop": 2.799999952316284,+"focus_cm": 648.173616011627+},+{+"blender_frame": 191,+"matrix_world": [+[+0.6374960541725159,+-0.01713363453745842,+0.7702630162239075,+2.881411552429199+],+[+0.7704470753669739,+0.010018272325396538,+-0.6374253034591675,+-1.0907776355743408+],+[+0.0032047072891145945,+0.9998030662536621,+0.019587164744734764,+1.489920735359192+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.1411552429199,+109.07776355743408,+148.9920735359192+],+"forward": [+-0.770263135433197,+-0.6374253630638123,+-0.019587166607379913+],+"up": [+-0.01713363453745842,+-0.010018272325396538,+0.9998030662536621+],+"lens_mm": 24.681020736694336,+"fstop": 2.799999952316284,+"focus_cm": 644.5166855119169+},+{+"blender_frame": 192,+"matrix_world": [+[+0.6322837471961975,+-0.018821118399500847,+0.7745082378387451,+2.874845504760742+],+[+0.7747240662574768,+0.009596874937415123,+-0.6322266459465027,+-1.0349289178848267+],+[+0.0044663529843091965,+0.9997768402099609,+0.020649120211601257,+1.4916433095932007+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.4845504760742,+103.49289178848267,+149.16433095932007+],+"forward": [+-0.7745083570480347,+-0.6322267055511475,+-0.020649122074246407+],+"up": [+-0.018821118399500847,+-0.009596874937415123,+0.9997768402099609+],+"lens_mm": 24.68724250793457,+"fstop": 2.799999952316284,+"focus_cm": 640.8851262414828+},+{+"blender_frame": 193,+"matrix_world": [+[+0.6269915103912354,+-0.02081497199833393,+0.7787479162216187,+2.868238687515259+],+[+0.779005229473114,+0.009418031200766563,+-0.6269466876983643,+-0.9790460467338562+],+[+0.005715607665479183,+0.9997389316558838,+0.022119995206594467,+1.4922515153884888+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.8238687515259,+97.90460467338562,+149.22515153884888+],+"forward": [+-0.778748095035553,+-0.6269468665122986,+-0.022120000794529915+],+"up": [+-0.02081497386097908,+-0.009418032132089138,+0.9997390508651733+],+"lens_mm": 24.693479537963867,+"fstop": 2.799999952316284,+"focus_cm": 637.280077394098+},+{+"blender_frame": 194,+"matrix_world": [+[+0.6216219067573547,+-0.023029286414384842,+0.7829788327217102,+2.8615572452545166+],+[+0.7832871675491333,+0.009488974697887897,+-0.6215876340866089,+-0.9231874942779541+],+[+0.006885054055601358,+0.9996896982192993,+0.023937100544571877,+1.4918612241744995+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.15572452545166,+92.31874942779541,+149.18612241744995+],+"forward": [+-0.7829788327217102,+-0.6215876340866089,+-0.023937100544571877+],+"up": [+-0.02302928827702999,+-0.009488975629210472,+0.9996898174285889+],+"lens_mm": 24.69972801208496,+"fstop": 2.799999952316284,+"focus_cm": 633.7018435355276+},+{+"blender_frame": 195,+"matrix_world": [+[+0.6161776781082153,+-0.025313468649983406,+0.7872003316879272,+2.854768753051758+],+[+0.7875673770904541,+0.009763289242982864,+-0.6161512732505798,+-0.8674056529998779+],+[+0.00791126023977995,+0.9996318221092224,+0.025951987132430077,+1.4907969236373901+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.4768753051758,+86.7405652999878,+149.079692363739+],+"forward": [+-0.7872002124786377,+-0.6161512136459351,+-0.025951983407139778+],+"up": [+-0.025313472375273705,+-0.009763290174305439,+0.999631941318512+],+"lens_mm": 24.705991744995117,+"fstop": 2.799999952316284,+"focus_cm": 630.1508909091353+},+{+"blender_frame": 196,+"matrix_world": [+[+0.6106612682342529,+-0.027477242052555084,+0.7914151549339294,+2.847838878631592+],+[+0.7918437123298645,+0.010159533470869064,+-0.6106391549110413,+-0.811745822429657+],+[+0.008738272823393345,+0.9995707869529724,+0.027961716055870056,+1.4895169734954834+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.7838878631592,+81.1745822429657,+148.95169734954834+],+"forward": [+-0.791415274143219,+-0.610639214515686,+-0.027961719781160355+],+"up": [+-0.027477245777845383,+-0.010159534402191639,+0.999570906162262+],+"lens_mm": 24.71226692199707,+"fstop": 2.799999952316284,+"focus_cm": 626.6279835253954+},+{+"blender_frame": 197,+"matrix_world": [+[+0.6050742864608765,+-0.029325921088457108,+0.7956289052963257,+2.840740203857422+],+[+0.7961145639419556,+0.010586649179458618,+-0.6050534248352051,+-0.756244421005249+],+[+0.009320704266428947,+0.9995138049125671,+0.02975250408053398,+1.488510012626648+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.0740203857422,+75.6244421005249,+148.8510012626648+],+"forward": [+-0.7956287860870361,+-0.6050533652305603,+-0.029752500355243683+],+"up": [+-0.029325924813747406,+-0.010586650110781193,+0.9995139241218567+],+"lens_mm": 24.71855354309082,+"fstop": 2.799999952316284,+"focus_cm": 623.1345866806805+},+{+"blender_frame": 198,+"matrix_world": [+[+0.5994181036949158,+-0.030698319897055626,+0.7998471856117249,+2.833451271057129+],+[+0.8003783822059631,+0.010969795286655426,+-0.5993949770927429,+-0.7009308934211731+],+[+0.009626258164644241,+0.9994683861732483,+0.031145760789513588,+1.4881856441497803+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.3451271057129,+70.09308934211731,+148.81856441497803+],+"forward": [+-0.7998473048210144,+-0.5993950366973877,+-0.031145764514803886+],+"up": [+-0.030698323622345924,+-0.010969796217978,+0.9994685053825378+],+"lens_mm": 24.724853515625,+"fstop": 2.799999952316284,+"focus_cm": 619.6735795587301+},+{+"blender_frame": 199,+"matrix_world": [+[+0.5936934351921082,+-0.03149944171309471,+0.8040746450424194,+2.825960874557495+],+[+0.8046337366104126,+0.011270874179899693,+-0.5936646461486816,+-0.6458263993263245+],+[+0.009637480601668358,+0.9994402527809143,+0.03203694894909859,+1.4887824058532715+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.5960874557495,+64.58263993263245,+148.87824058532715+],+"forward": [+-0.8040746450424194,+-0.5936646461486816,+-0.03203694894909859+],+"up": [+-0.03149944171309471,+-0.011270874179899693,+0.9994402527809143+],+"lens_mm": 24.731164932250977,+"fstop": 2.799999952316284,+"focus_cm": 616.2468403112143+},+{+"blender_frame": 200,+"matrix_world": [+[+0.5879000425338745,+-0.03172072023153305,+0.808311402797699,+2.8182692527770996+],+[+0.808879554271698,+0.011498861014842987,+-0.587861955165863,+-0.5909458994865417+],+[+0.009352745488286018,+0.9994305968284607,+0.032418422400951385,+1.4903122186660767+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.82692527770996,+59.094589948654175,+149.03122186660767+],+"forward": [+-0.808311402797699,+-0.587861955165863,+-0.032418422400951385+],+"up": [+-0.03172072395682335,+-0.011498861946165562,+0.9994307160377502+],+"lens_mm": 24.73748779296875,+"fstop": 2.799999952316284,+"focus_cm": 612.85554850474+},+{+"blender_frame": 201,+"matrix_world": [+[+0.5820369124412537,+-0.031443431973457336,+0.8125541806221008,+2.8103885650634766+],+[+0.8131150007247925,+0.011707885190844536,+-0.5819854140281677,+-0.5362967252731323+],+[+0.008786327205598354,+0.9994369149208069,+0.03238154202699661,+1.492555856704712+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.03885650634766,+53.62967252731323,+149.2555856704712+],+"forward": [+-0.8125542998313904,+-0.5819854736328125,+-0.03238154575228691+],+"up": [+-0.031443435698747635,+-0.01170788612216711,+0.9994370341300964+],+"lens_mm": 24.74382209777832,+"fstop": 2.799999952316284,+"focus_cm": 609.4997338019311+},+{+"blender_frame": 202,+"matrix_world": [+[+0.576102614402771,+-0.030824067071080208,+0.8167958855628967,+2.8023407459259033+],+[+0.8173386454582214,+0.011983469128608704,+-0.5760329961776733,+-0.48187941312789917+],+[+0.0079676304012537,+0.9994529485702515,+0.032097406685352325,+1.495108723640442+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.23407459259033,+48.18794131278992,+149.5108723640442+],+"forward": [+-0.8167960047721863,+-0.5760330557823181,+-0.032097410410642624+],+"up": [+-0.030824070796370506,+-0.011983470991253853,+0.999453067779541+],+"lens_mm": 24.750165939331055,+"fstop": 2.799999952316284,+"focus_cm": 606.1784890946001+},+{+"blender_frame": 203,+"matrix_world": [+[+0.5700950026512146,+-0.030064858496189117,+0.8210285902023315,+2.794156074523926+],+[+0.8215494751930237,+0.012420383282005787,+-0.5700019598007202,+-0.4276876151561737+],+[+0.006939536891877651,+0.9994706511497498,+0.03178057074546814,+1.4974679946899414+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+279.4156074523926,+42.76876151561737,+149.74679946899414+],+"forward": [+-0.821028470993042,+-0.5700019001960754,+-0.03178056702017784+],+"up": [+-0.030064862221479416,+-0.012420385144650936,+0.9994707703590393+],+"lens_mm": 24.75652313232422,+"fstop": 2.799999952316284,+"focus_cm": 602.8912481386214+},+{+"blender_frame": 204,+"matrix_world": [+[+0.5640113353729248,+-0.029375076293945312,+0.8252443671226501,+2.7858686447143555+],+[+0.825747013092041,+0.013096986338496208,+-0.5638885498046875,+-0.37370604276657104+],+[+0.005756055936217308,+0.9994826316833496,+0.031643226742744446,+1.4991408586502075+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+278.58686447143555,+37.370604276657104,+149.91408586502075+],+"forward": [+-0.8252444863319397,+-0.5638886094093323,+-0.031643230468034744+],+"up": [+-0.02937508001923561,+-0.013096988201141357,+0.9994827508926392+],+"lens_mm": 24.762889862060547,+"fstop": 2.799999952316284,+"focus_cm": 599.6384274680167+},+{+"blender_frame": 205,+"matrix_world": [+[+0.5578492283821106,+-0.028931815177202225,+0.8294379711151123,+2.777513027191162+],+[+0.829930305480957,+0.014052470214664936,+-0.5576901435852051,+-0.319913774728775+],+[+0.0044793360866606236,+0.9994826316833496,+0.03185054287314415,+1.499751329421997+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+277.7513027191162,+31.991377472877502,+149.9751329421997+],+"forward": [+-0.8294379711151123,+-0.5576901435852051,+-0.03185054287314415+],+"up": [+-0.028931815177202225,+-0.014052470214664936,+0.9994826316833496+],+"lens_mm": 24.76926612854004,+"fstop": 2.799999952316284,+"focus_cm": 596.4204164687544+},+{+"blender_frame": 206,+"matrix_world": [+[+0.5516058206558228,+-0.028847718611359596,+0.833605945110321,+2.769118070602417+],+[+0.8340989351272583,+0.015271625481545925,+-0.5514035820960999,+-0.2662818133831024+],+[+0.0031762183643877506,+0.9994670748710632,+0.03248576819896698,+1.499123215675354+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.9118070602417,+26.62818133831024,+149.9123215675354+],+"forward": [+-0.833605945110321,+-0.5514035820960999,+-0.03248576819896698+],+"up": [+-0.028847722336649895,+-0.015271627344191074,+0.9994671940803528+],+"lens_mm": 24.775651931762695,+"fstop": 2.799999952316284,+"focus_cm": 593.2376763317734+},+{+"blender_frame": 207,+"matrix_world": [+[+0.5452790856361389,+-0.029153326526284218,+0.8377474546432495,+2.7607054710388184+],+[+0.8382524847984314,+0.01668139174580574,+-0.5450271964073181,+-0.21277694404125214+],+[+0.0019145619589835405,+0.9994357824325562,+0.03353385627269745,+1.4973186254501343+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.07054710388184,+21.277694404125214,+149.73186254501343+],+"forward": [+-0.8377475738525391,+-0.5450272560119629,+-0.03353385999798775+],+"up": [+-0.029153326526284218,+-0.01668139174580574,+0.9994357824325562+],+"lens_mm": 24.78204917907715,+"fstop": 2.799999952316284,+"focus_cm": 590.089996252209+},+{+"blender_frame": 208,+"matrix_world": [+[+0.5388664603233337,+-0.029796862974762917,+0.8418640494346619,+2.7522873878479004+],+[+0.8423908948898315,+0.018159648403525352,+-0.5385609269142151,+-0.15936413407325745+],+[+0.0007594723138026893,+0.9993910789489746,+0.03488622605800629,+1.4946253299713135+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+275.22873878479004,+15.936413407325745,+149.46253299713135+],+"forward": [+-0.8418640494346619,+-0.5385609269142151,+-0.03488622605800629+],+"up": [+-0.029796862974762917,+-0.018159648403525352,+0.9993910789489746+],+"lens_mm": 24.788454055786133,+"fstop": 2.799999952316284,+"focus_cm": 586.9766348507255+},+{+"blender_frame": 209,+"matrix_world": [+[+0.5323668122291565,+-0.030662043020129204,+0.8459581732749939,+2.743865728378296+],+[+0.8465137481689453,+0.01955500990152359,+-0.53200763463974,+-0.10600924491882324+],+[+-0.00023027975112199783,+0.9993385076522827,+0.03636628016829491,+1.4914969205856323+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.3865728378296,+10.600924491882324,+149.14969205856323+],+"forward": [+-0.8459582924842834,+-0.5320076942443848,+-0.036366283893585205+],+"up": [+-0.030662043020129204,+-0.01955500990152359,+0.9993385076522827+],+"lens_mm": 24.79486846923828,+"fstop": 2.799999952316284,+"focus_cm": 583.8972747791559+},+{+"blender_frame": 210,+"matrix_world": [+[+0.5257791876792908,+-0.03159913048148155,+0.8500339984893799,+2.7354319095611572+],+[+0.8506205677986145,+0.020713072270154953,+-0.5253720283508301,+-0.0526837557554245+],+[+-0.0010055185994133353,+0.9992859959602356,+0.0377693772315979,+1.4884552955627441+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+273.5431909561157,+5.26837557554245,+148.8455295562744+],+"forward": [+-0.8500339984893799,+-0.5253720283508301,+-0.0377693772315979+],+"up": [+-0.03159913048148155,+-0.020713072270154953,+0.9992859959602356+],+"lens_mm": 24.801292419433594,+"fstop": 2.799999952316284,+"focus_cm": 580.8517558034509+},+{+"blender_frame": 211,+"matrix_world": [+[+0.5191033482551575,+-0.0324629470705986,+0.8540948033332825,+2.726971387863159+],+[+0.8547101616859436,+0.021504167467355728,+-0.5186600089073181,+0.0006308853626251221+],+[+-0.001529366010800004,+0.9992415308952332,+0.038909297436475754,+1.4859797954559326+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+272.6971387863159,+-0.06308853626251221,+148.59797954559326+],+"forward": [+-0.8540948033332825,+-0.5186600089073181,+-0.038909297436475754+],+"up": [+-0.0324629507958889,+-0.021504169330000877,+0.9992416501045227+],+"lens_mm": 24.807723999023438,+"fstop": 2.799999952316284,+"focus_cm": 577.8408905491233+},+{+"blender_frame": 212,+"matrix_world": [+[+0.5123398900032043,+-0.0331486240029335,+0.8581427931785583,+2.7184648513793945+],+[+0.8587809801101685,+0.02184637077152729,+-0.5118770003318787,+0.05394063517451286+],+[+-0.0017792877042666078,+0.9992115497589111,+0.039660174399614334,+1.4844067096710205+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+271.84648513793945,+-5.394063517451286,+148.44067096710205+],+"forward": [+-0.8581427931785583,+-0.5118770003318787,+-0.039660174399614334+],+"up": [+-0.0331486277282238,+-0.02184637263417244,+0.9992116689682007+],+"lens_mm": 24.814165115356445,+"fstop": 2.799999952316284,+"focus_cm": 574.8653736431152+},+{+"blender_frame": 213,+"matrix_world": [+[+0.5054904222488403,+-0.0336177721619606,+0.8621770739555359,+2.7098910808563232+],+[+0.8628305792808533,+0.02171965502202511,+-0.5050265789031982,+0.10723508149385452+],+[+-0.001748317270539701,+0.9991986155509949,+0.03998551890254021,+1.483858346939087+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+270.9891080856323,+-10.723508149385452,+148.3858346939087+],+"forward": [+-0.8621770739555359,+-0.5050265789031982,+-0.03998551890254021+],+"up": [+-0.0336177758872509,+-0.021719656884670258,+0.9991987347602844+],+"lens_mm": 24.820613861083984,+"fstop": 2.799999952316284,+"focus_cm": 571.9252683222294+},+{+"blender_frame": 214,+"matrix_world": [+[+0.4985576272010803,+-0.033908698707818985,+0.8661931157112122,+2.7012276649475098+],+[+0.8668554425239563,+0.021168161183595657,+-0.4981101155281067,+0.16048726439476013+],+[+-0.001445448724552989,+0.9992006421089172,+0.03994748741388321,+1.48422110080719+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+270.122766494751,+-16.048726439476013,+148.422110080719+],+"forward": [+-0.8661931157112122,+-0.4981101155281067,+-0.03994748741388321+],+"up": [+-0.03390870243310928,+-0.021168163046240807,+0.9992007613182068+],+"lens_mm": 24.827070236206055,+"fstop": 2.799999952316284,+"focus_cm": 569.0195470117033+},+{+"blender_frame": 215,+"matrix_world": [+[+0.4915448725223541,+-0.03412832319736481,+0.8701832890510559,+2.6924540996551514+],+[+0.8708518147468567,+0.02029050886631012,+-0.4911267161369324,+0.21365395188331604+],+[+-0.0008951288182288408,+0.9992114901542664,+0.039694398641586304,+1.485174298286438+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+269.24540996551514,+-21.365395188331604,+148.5174298286438+],+"forward": [+-0.8701832890510559,+-0.4911267161369324,+-0.039694398641586304+],+"up": [+-0.03412832319736481,+-0.02029050886631012,+0.9992114901542664+],+"lens_mm": 24.833532333374023,+"fstop": 2.799999952316284,+"focus_cm": 566.1466457881033+},+{+"blender_frame": 216,+"matrix_world": [+[+0.48445746302604675,+-0.034427568316459656,+0.8741371035575867,+2.68354868888855+],+[+0.8748148083686829,+0.019220620393753052,+-0.48407605290412903,+0.26667699217796326+],+[+-0.0001358966255793348,+0.9992222785949707,+0.03942932188510895,+1.4862637519836426+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+268.354868888855,+-26.667699217796326,+148.62637519836426+],+"forward": [+-0.8741371035575867,+-0.48407605290412903,+-0.03942932188510895+],+"up": [+-0.034427572041749954,+-0.0192206222563982,+0.9992223978042603+],+"lens_mm": 24.840003967285156,+"fstop": 2.799999952316284,+"focus_cm": 563.3049326017499+},+{+"blender_frame": 217,+"matrix_world": [+[+0.4773016571998596,+-0.03496597334742546,+0.8780435919761658,+2.6744883060455322+],+[+0.8787392973899841,+0.01810339279472828,+-0.4769588112831116,+0.31948643922805786+],+[+0.0007817592122592032,+0.9992245435714722,+0.03936674818396568,+1.4870060682296753+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+267.4488306045532,+-31.948643922805786,+148.70060682296753+],+"forward": [+-0.8780435919761658,+-0.4769588112831116,+-0.03936674818396568+],+"up": [+-0.03496597334742546,+-0.01810339279472828,+0.9992245435714722+],+"lens_mm": 24.846481323242188,+"fstop": 2.799999952316284,+"focus_cm": 560.4934794828296+},+{+"blender_frame": 218,+"matrix_world": [+[+0.47008514404296875,+-0.035872455686330795,+0.8818917870521545,+2.665245532989502+],+[+0.882619321346283,+0.01707002893090248,+-0.46977856755256653,+0.3720044493675232+],+[+0.0017981923883780837,+0.9992105960845947,+0.039686091244220734,+1.486997365951538+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+266.5245532989502,+-37.20044493675232,+148.6997365951538+],+"forward": [+-0.8818917870521545,+-0.46977856755256653,+-0.039686091244220734+],+"up": [+-0.035872455686330795,+-0.01707002893090248,+0.9992105960845947+],+"lens_mm": 24.85296630859375,+"fstop": 2.799999952316284,+"focus_cm": 557.7117389068007+},+{+"blender_frame": 219,+"matrix_world": [+[+0.46281713247299194,+-0.03721226006746292,+0.885672390460968,+2.655787706375122+],+[+0.8864491581916809,+0.016218524426221848,+-0.4625416398048401,+0.42414987087249756+],+[+0.0028479204047471285,+0.9991757869720459,+0.040492989122867584,+1.486006259918213+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+265.5787706375122,+-42.414987087249756,+148.6006259918213+],+"forward": [+-0.885672390460968,+-0.4625416398048401,+-0.040492989122867584+],+"up": [+-0.03721226006746292,+-0.016218524426221848,+0.9991757869720459+],+"lens_mm": 24.859455108642578,+"fstop": 2.799999952316284,+"focus_cm": 554.9591313116252+},+{+"blender_frame": 220,+"matrix_world": [+[+0.4555079936981201,+-0.03896655514836311,+0.8893784284591675,+2.6460752487182617+],+[+0.8902233242988586,+0.015602528117597103,+-0.4552570879459381,+0.4758395254611969+],+[+0.003863247809931636,+0.9991186857223511,+0.0417960099875927,+1.4840283393859863+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+264.6075248718262,+-47.58395254611969,+148.40283393859863+],+"forward": [+-0.889378547668457,+-0.4552571475505829,+-0.041796013712882996+],+"up": [+-0.03896655514836311,+-0.015602528117597103,+0.9991186857223511+],+"lens_mm": 24.865951538085938,+"fstop": 2.799999952316284,+"focus_cm": 552.234766446054+},+{+"blender_frame": 221,+"matrix_world": [+[+0.4481692612171173,+-0.041030604392290115,+0.8930066227912903,+2.6360628604888916+],+[+0.8939360976219177,+0.015230627730488777,+-0.4479357898235321,+0.5269941091537476+],+[+0.004778022412210703,+0.9990418553352356,+0.04350462555885315,+1.4812906980514526+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+263.60628604888916,+-52.699410915374756,+148.12906980514526+],+"forward": [+-0.8930067420005798,+-0.4479358494281769,+-0.04350462928414345+],+"up": [+-0.041030604392290115,+-0.015230627730488777,+0.9990418553352356+],+"lens_mm": 24.872455596923828,+"fstop": 2.799999952316284,+"focus_cm": 549.5371975935996+},+{+"blender_frame": 222,+"matrix_world": [+[+0.44081372022628784,+-0.0432305671274662,+0.8965569138526917,+2.625699996948242+],+[+0.8975815176963806,+0.01507506426423788,+-0.4405905604362488,+0.5775367617607117+],+[+0.005531327333301306,+0.9989513158798218,+0.04544825479388237,+1.4782062768936157+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+262.5699996948242,+-57.75367617607117,+147.82062768936157+],+"forward": [+-0.8965570330619812,+-0.44059062004089355,+-0.04544825851917267+],+"up": [+-0.0432305708527565,+-0.01507506612688303,+0.9989514350891113+],+"lens_mm": 24.87896156311035,+"fstop": 2.799999952316284,+"focus_cm": 546.8653035350144+},+{+"blender_frame": 223,+"matrix_world": [+[+0.4334547221660614,+-0.04535626247525215,+0.9000332355499268,+2.614936113357544+],+[+0.9011548757553101,+0.01508728601038456,+-0.4332346022129059,+0.6273972392082214+],+[+0.006070844363421202,+0.9988569021224976,+0.04741267114877701,+1.4752870798110962+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+261.4936113357544,+-62.739723920822144,+147.52870798110962+],+"forward": [+-0.9000332355499268,+-0.4332346022129059,+-0.04741267114877701+],+"up": [+-0.04535626620054245,+-0.015087287873029709,+0.9988570213317871+],+"lens_mm": 24.885475158691406,+"fstop": 2.799999952316284,+"focus_cm": 544.218747317791+},+{+"blender_frame": 224,+"matrix_world": [+[+0.4261062741279602,+-0.04720262438058853,+0.9034408330917358,+2.6037259101867676+],+[+0.9046507477760315,+0.01521623507142067,+-0.42588192224502563,+0.6765098571777344+],+[+0.006355775520205498,+0.9987694025039673,+0.0491856224834919,+1.4730355739593506+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+260.37259101867676,+-67.65098571777344,+147.30355739593506+],+"forward": [+-0.9034408330917358,+-0.42588192224502563,+-0.0491856224834919+],+"up": [+-0.04720263183116913,+-0.015216236934065819,+0.9987695217132568+],+"lens_mm": 24.891992568969727,+"fstop": 2.799999952316284,+"focus_cm": 541.5984500199556+},+{+"blender_frame": 225,+"matrix_world": [+[+0.41878268122673035,+-0.04861118271946907,+0.9067844748497009,+2.592031240463257+],+[+0.9080642461776733,+0.015424753539264202,+-0.4185468554496765,+0.7248154282569885+],+[+0.006359129212796688,+0.9986985921859741,+0.05060169845819473,+1.471836805343628+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+259.2031240463257,+-72.48154282569885,+147.1836805343628+],+"forward": [+-0.9067844748497009,+-0.4185468554496765,+-0.05060169845819473+],+"up": [+-0.04861119017004967,+-0.015424755401909351,+0.9986987113952637+],+"lens_mm": 24.898515701293945,+"fstop": 2.799999952316284,+"focus_cm": 539.0056209638715+},+{+"blender_frame": 226,+"matrix_world": [+[+0.4114983379840851,+-0.049502547830343246,+0.9100651144981384,+2.5798275470733643+],+[+0.9113903045654297,+0.015700388699769974,+-0.4112434387207031,+0.7722587585449219+],+[+0.006069219671189785,+0.9986504912376404,+0.051576822996139526,+1.4718772172927856+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+257.9827547073364,+-77.22587585449219,+147.18772172927856+],+"forward": [+-0.910065233707428,+-0.4112434983253479,+-0.05157683044672012+],+"up": [+-0.04950255528092384,+-0.015700390562415123,+0.9986506104469299+],+"lens_mm": 24.90504264831543,+"fstop": 2.799999952316284,+"focus_cm": 536.4407975226641+},+{+"blender_frame": 227,+"matrix_world": [+[+0.4042678475379944,+-0.049892839044332504,+0.9132788181304932,+2.567106008529663+],+[+0.9146241545677185,+0.016058247536420822,+-0.4039860963821411,+0.8187916278839111+],+[+0.005490357056260109,+0.9986255168914795,+0.052125025540590286,+1.4731051921844482+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+256.7106008529663,+-81.87916278839111,+147.31051921844482+],+"forward": [+-0.9132788181304932,+-0.4039860963821411,+-0.052125025540590286+],+"up": [+-0.049892839044332504,+-0.016058247536420822,+0.9986255168914795+],+"lens_mm": 24.91157341003418,+"fstop": 2.799999952316284,+"focus_cm": 533.9033151045442+},+{+"blender_frame": 228,+"matrix_world": [+[+0.39710524678230286,+-0.049890004098415375,+0.9164159893989563,+2.553872585296631+],+[+0.9177613258361816,+0.01653522066771984,+-0.39678794145584106,+0.8643714785575867+],+[+0.004642611835151911,+0.9986178874969482,+0.05235334113240242,+1.4752427339553833+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+255.3872585296631,+-86.43714785575867,+147.52427339553833+],+"forward": [+-0.9164161086082458,+-0.39678800106048584,+-0.05235334858298302+],+"up": [+-0.049890004098415375,+-0.01653522066771984,+0.9986178874969482+],+"lens_mm": 24.918107986450195,+"fstop": 2.799999952316284,+"focus_cm": 531.3913119956851+},+{+"blender_frame": 229,+"matrix_world": [+[+0.3900248110294342,+-0.04967135190963745,+0.919463574886322,+2.5401451587677+],+[+0.9207974672317505,+0.017177728936076164,+-0.3896625339984894,+0.908962070941925+],+[+0.003560767974704504,+0.9986178278923035,+0.05243699997663498,+1.4778473377227783+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+254.01451587677002,+-90.8962070941925,+147.78473377227783+],+"forward": [+-0.9194636940956116,+-0.38966259360313416,+-0.052437007427215576+],+"up": [+-0.04967135936021805,+-0.017177730798721313,+0.998617947101593+],+"lens_mm": 24.924646377563477,+"fstop": 2.799999952316284,+"focus_cm": 528.9022658020258+},+{+"blender_frame": 230,+"matrix_world": [+[+0.383040189743042,+-0.04944582283496857,+0.9224073886871338,+2.5259528160095215+],+[+0.9237287044525146,+0.018025316298007965,+-0.38262274861335754,+0.9525355100631714+],+[+0.002292410936206579,+0.9986141920089722,+0.05257895961403847,+1.4804065227508545+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+252.59528160095215,+-95.25355100631714,+148.04065227508545+],+"forward": [+-0.9224073886871338,+-0.38262274861335754,+-0.05257895961403847+],+"up": [+-0.04944582283496857,+-0.018025316298007965,+0.9986141920089722+],+"lens_mm": 24.931188583374023,+"fstop": 2.799999952316284,+"focus_cm": 526.4339642599225+},+{+"blender_frame": 231,+"matrix_world": [+[+0.3761656582355499,+-0.04941049590706825,+0.9252340793609619,+2.511324882507324+],+[+0.9265519976615906,+0.01909494213759899,+-0.3756817877292633,+0.9950717091560364+],+[+0.0008953339420258999,+0.9985959529876709,+0.05296425521373749,+1.482451319694519+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+251.13248825073242,+-99.50717091560364,+148.2451319694519+],+"forward": [+-0.9252340793609619,+-0.3756817877292633,+-0.05296425521373749+],+"up": [+-0.04941050335764885,+-0.01909494400024414,+0.9985960721969604+],+"lens_mm": 24.937732696533203,+"fstop": 2.799999952316284,+"focus_cm": 523.9847586490214+},+{+"blender_frame": 232,+"matrix_world": [+[+0.3694145977497101,+-0.04970927909016609,+0.9279341697692871,+2.4962899684906006+],+[+0.9292645454406738,+0.02036893554031849,+-0.36885303258895874,+1.036559820175171+],+[+-0.0005656161811202765,+0.9985559582710266,+0.05371764674782753,+1.4836550951004028+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+249.62899684906006,+-103.65598201751709,+148.36550951004028+],+"forward": [+-0.9279342889785767,+-0.36885306239128113,+-0.05371765419840813+],+"up": [+-0.04970928654074669,+-0.02036893740296364,+0.9985560774803162+],+"lens_mm": 24.94428062438965,+"fstop": 2.799999952316284,+"focus_cm": 521.5536775067449+},+{+"blender_frame": 233,+"matrix_world": [+[+0.3628005087375641,+-0.050403695553541183,+0.9305028319358826,+2.480868101119995+],+[+0.9318646192550659,+0.021790210157632828,+-0.36215120553970337,+1.0769954919815063+],+[+-0.0020220899023115635,+0.9984911680221558,+0.054874926805496216,+1.4839043617248535+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+248.0868101119995,+-107.69954919815063,+148.39043617248535+],+"forward": [+-0.930502712726593,+-0.362151175737381,+-0.05487491935491562+],+"up": [+-0.05040370300412178,+-0.021790212020277977,+0.9984912872314453+],+"lens_mm": 24.950830459594727,+"fstop": 2.799999952316284,+"focus_cm": 519.1398118622601+},+{+"blender_frame": 234,+"matrix_world": [+[+0.3563373386859894,+-0.05146172270178795,+0.9329390525817871,+2.4650681018829346+],+[+0.9343512654304504,+0.02326563186943531,+-0.3555932939052582,+1.1163796186447144+],+[+-0.00340597378090024,+0.9984039068222046,+0.056373726576566696,+1.483320713043213+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+246.50681018829346,+-111.63796186447144,+148.3320713043213+],+"forward": [+-0.9329391717910767,+-0.35559332370758057,+-0.05637373402714729+],+"up": [+-0.05146172270178795,+-0.02326563186943531,+0.9984039068222046+],+"lens_mm": 24.957382202148438,+"fstop": 2.799999952316284,+"focus_cm": 516.7426985688508+},+{+"blender_frame": 235,+"matrix_world": [+[+0.3500384986400604,+-0.05276668816804886,+0.9352480173110962,+2.4488885402679443+],+[+0.9367238283157349,+0.02467706799507141,+-0.349198579788208,+1.1547163724899292+],+[+-0.004653124138712883,+0.9983019232749939,+0.058065738528966904,+1.4822331666946411+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+244.88885402679443,+-115.47163724899292,+148.2233166694641+],+"forward": [+-0.9352480173110962,+-0.349198579788208,+-0.058065738528966904+],+"up": [+-0.05276668816804886,+-0.02467706799507141,+0.9983019232749939+],+"lens_mm": 24.96393585205078,+"fstop": 2.799999952316284,+"focus_cm": 514.3618837930262+},+{+"blender_frame": 236,+"matrix_world": [+[+0.3439177870750427,+-0.054145123809576035,+0.9374373555183411,+2.4323172569274902+],+[+0.9389824867248535,+0.025898311287164688,+-0.3429887294769287,+1.192008376121521+],+[+-0.005706873256713152,+0.9981971979141235,+0.05974821001291275,+1.4811019897460938+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+243.23172569274902,+-119.2008376121521,+148.11019897460938+],+"forward": [+-0.9374374747276306,+-0.3429887592792511,+-0.05974821746349335+],+"up": [+-0.054145123809576035,+-0.025898311287164688,+0.9981971979141235+],+"lens_mm": 24.970489501953125,+"fstop": 2.799999952316284,+"focus_cm": 511.99769116938114+},+{+"blender_frame": 237,+"matrix_world": [+[+0.3379891514778137,+-0.05540643632411957,+0.9395177960395813,+2.4153361320495605+],+[+0.9411274194717407,+0.026814140379428864,+-0.3369869589805603,+1.2282527685165405+],+[+-0.0065211160108447075,+0.9981037974357605,+0.06120740622282028,+1.4804171323776245+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+241.53361320495605,+-122.82527685165405,+148.04171323776245+],+"forward": [+-0.9395176768302917,+-0.3369869291782379,+-0.061207398772239685+],+"up": [+-0.05540643632411957,+-0.026814140379428864,+0.9981037974357605+],+"lens_mm": 24.977046966552734,+"fstop": 2.799999952316284,+"focus_cm": 509.65091697871685+},+{+"blender_frame": 238,+"matrix_world": [+[+0.33226653933525085,+-0.0563860721886158,+0.9414985179901123,+2.3979270458221436+],+[+0.9431591629981995,+0.027338052168488503,+-0.3312152326107025,+1.2634373903274536+],+[+-0.007062812335789204,+0.998034656047821,+0.06226454675197601,+1.4805874824523926+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+239.79270458221436,+-126.34373903274536,+148.05874824523926+],+"forward": [+-0.9414986371994019,+-0.3312152624130249,+-0.06226455420255661+],+"up": [+-0.056386079639196396,+-0.0273380558937788,+0.9980347752571106+],+"lens_mm": 24.983604431152344,+"fstop": 2.799999952316284,+"focus_cm": 507.32279270887375+},+{+"blender_frame": 239,+"matrix_world": [+[+0.32676398754119873,+-0.05698282644152641,+0.9433866143226624,+2.380074977874756+],+[+0.9450777173042297,+0.027425341308116913,+-0.32569316029548645,+1.297539234161377+],+[+-0.00731378560885787,+0.9979983568191528,+0.06281481683254242,+1.4818490743637085+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+238.0074977874756,+-129.7539234161377,+148.18490743637085+],+"forward": [+-0.9433866143226624,+-0.32569316029548645,+-0.06281481683254242+],+"up": [+-0.05698283389210701,+-0.02742534503340721,+0.9979984760284424+],+"lens_mm": 24.990161895751953,+"fstop": 2.799999952316284,+"focus_cm": 505.0132567062974+},+{+"blender_frame": 240,+"matrix_world": [+[+0.3214957118034363,+-0.05718150734901428,+0.9451829195022583,+2.3617730140686035+],+[+0.9468830823898315,+0.027079064399003983,+-0.32043585181236267,+1.3305208683013916+],+[+-0.0072716642171144485,+0.9979963898658752,+0.06285000592470169,+1.4842103719711304+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+236.17730140686035,+-133.05208683013916,+148.42103719711304+],+"forward": [+-0.9451829195022583,+-0.32043585181236267,+-0.06285000592470169+],+"up": [+-0.05718151479959488,+-0.02707906812429428,+0.9979965090751648+],+"lens_mm": 24.996721267700195,+"fstop": 2.799999952316284,+"focus_cm": 502.7209369465709+},+{+"blender_frame": 241,+"matrix_world": [+[+0.31638723611831665,+-0.057068947702646255,+0.9469119310379028,+2.3426482677459717+],+[+0.9486046433448792,+0.026346353814005852,+-0.3153649568557739,+1.3629568815231323+],+[+-0.006950130686163902,+0.9980225563049316,+0.06247151643037796,+1.487467885017395+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+234.26482677459717,+-136.29568815231323,+148.7467885017395+],+"forward": [+-0.9469120502471924,+-0.3153649866580963,+-0.06247152388095856+],+"up": [+-0.057068947702646255,+-0.026346353814005852,+0.9980225563049316+],+"lens_mm": 25.003278732299805,+"fstop": 2.799999952316284,+"focus_cm": 500.38766860961914+},+{+"blender_frame": 242,+"matrix_world": [+[+0.31144824624061584,+-0.05680028349161148,+0.9485640525817871,+2.322718858718872+],+[+0.9502416849136353,+0.02531561627984047,+-0.3104831576347351,+1.3947850465774536+],+[+-0.006377950310707092,+0.9980645179748535,+0.06185850873589516,+1.4912488460540771+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+232.2718858718872,+-139.47850465774536,+149.12488460540771+],+"forward": [+-0.9485640525817871,+-0.3104831576347351,+-0.06185850873589516+],+"up": [+-0.05680029094219208,+-0.025315620005130768,+0.9980646371841431+],+"lens_mm": 25.009838104248047,+"fstop": 2.799999952316284,+"focus_cm": 498.01263101398945+},+{+"blender_frame": 243,+"matrix_world": [+[+0.3067705035209656,+-0.05655309557914734,+0.950101912021637,+2.3023924827575684+],+[+0.9517672061920166,+0.024097755551338196,+-0.3058737516403198,+1.4253560304641724+],+[+-0.005597217008471489,+0.9981087446212769,+0.06121785193681717,+1.495033860206604+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+230.23924827575684,+-142.53560304641724,+149.5033860206604+],+"forward": [+-0.950101912021637,+-0.3058737516403198,+-0.06121785193681717+],+"up": [+-0.05655309557914734,+-0.024097755551338196,+0.9981087446212769+],+"lens_mm": 25.016395568847656,+"fstop": 2.799999952316284,+"focus_cm": 495.6507779657841+},+{+"blender_frame": 244,+"matrix_world": [+[+0.30235642194747925,+-0.05651167035102844,+0.9515182971954346,+2.2817013263702393+],+[+0.9531835317611694,+0.022806955501437187,+-0.3015310764312744,+1.4546486139297485+],+[+-0.004661210346966982,+0.998141348361969,+0.06076182797551155,+1.498319149017334+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+228.17013263702393,+-145.46486139297485,+149.8319149017334+],+"forward": [+-0.9515182971954346,+-0.3015310764312744,+-0.06076182797551155+],+"up": [+-0.05651167780160904,+-0.022806957364082336,+0.9981414675712585+],+"lens_mm": 25.022953033447266,+"fstop": 2.799999952316284,+"focus_cm": 493.30168906599283+},+{+"blender_frame": 245,+"matrix_world": [+[+0.29820847511291504,+-0.05681556463241577,+0.9528082609176636,+2.2606725692749023+],+[+0.9544938802719116,+0.021548103541135788,+-0.29745107889175415,+1.4826390743255615+],+[+-0.003631363622844219,+0.9981521964073181,+0.060655929148197174,+1.500717282295227+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+226.06725692749023,+-148.26390743255615,+150.0717282295227+],+"forward": [+-0.9528083801269531,+-0.29745110869407654,+-0.06065593659877777+],+"up": [+-0.05681556463241577,+-0.021548103541135788,+0.9981521964073181+],+"lens_mm": 25.029510498046875,+"fstop": 2.799999952316284,+"focus_cm": 490.9659465774894+},+{+"blender_frame": 246,+"matrix_world": [+[+0.2943289577960968,+-0.057527218014001846,+0.9539712071418762,+2.239321708679199+],+[+0.9557008147239685,+0.020404871553182602,+-0.29363206028938293,+1.509305715560913+],+[+-0.0025738247204571962,+0.9981353282928467,+0.06098455563187599,+1.5020393133163452+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+223.93217086791992,+-150.9305715560913,+150.20393133163452+],+"forward": [+-0.9539713263511658,+-0.2936320900917053,+-0.06098456308245659+],+"up": [+-0.05752722546458244,+-0.02040487341582775,+0.9981354475021362+],+"lens_mm": 25.03606414794922,+"fstop": 2.799999952316284,+"focus_cm": 488.6446412652731+},+{+"blender_frame": 247,+"matrix_world": [+[+0.2907194197177887,+-0.058616429567337036,+0.9550110697746277,+2.217653751373291+],+[+0.9568071365356445,+0.019433096051216125,+-0.29007336497306824,+1.5346328020095825+],+[+-0.001555758062750101,+0.998091459274292,+0.06173418462276459,+1.5023328065872192+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+221.7653751373291,+-153.46328020095825,+150.23328065872192+],+"forward": [+-0.9550111889839172,+-0.2900733947753906,+-0.061734192073345184+],+"up": [+-0.058616429567337036,+-0.019433096051216125,+0.998091459274292+],+"lens_mm": 25.042617797851562,+"fstop": 2.799999952316284,+"focus_cm": 486.3381577655673+},+{+"blender_frame": 248,+"matrix_world": [+[+0.2873814105987549,+-0.0599658377468586,+0.9559372663497925,+2.1956570148468018+],+[+0.9578160643577576,+0.01866059936583042,+-0.2867756485939026,+1.5586116313934326+],+[+-0.0006416207761503756,+0.9980260133743286,+0.06279895454645157,+1.5018715858459473+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+219.56570148468018,+-155.86116313934326,+150.18715858459473+],+"forward": [+-0.9559372663497925,+-0.2867756485939026,+-0.06279895454645157+],+"up": [+-0.0599658377468586,+-0.01866059936583042,+0.9980260133743286+],+"lens_mm": 25.049169540405273,+"fstop": 2.799999952316284,+"focus_cm": 484.04650669544935+},+{+"blender_frame": 249,+"matrix_world": [+[+0.2843150198459625,+-0.06139557063579559,+0.9567630290985107,+2.1733126640319824+],+[+0.958730936050415,+0.018092120066285133,+-0.2837388515472412,+1.5812435150146484+],+[+0.00011043576523661613,+0.997949481010437,+0.06400569528341293,+1.5010932683944702+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+217.33126640319824,+-158.12435150146484,+150.10932683944702+],+"forward": [+-0.9567630290985107,+-0.2837388515472412,+-0.06400569528341293+],+"up": [+-0.06139557808637619,+-0.018092121928930283,+0.9979496002197266+],+"lens_mm": 25.05571937561035,+"fstop": 2.799999952316284,+"focus_cm": 481.76872096955776+},+{+"blender_frame": 250,+"matrix_world": [+[+0.2815195620059967,+-0.06270227581262589,+0.9575046896934509,+2.1505961418151855+],+[+0.9595552682876587,+0.017718104645609856,+-0.2809622287750244,+1.6025397777557373+],+[+0.0006518044392578304,+0.9978750348091125,+0.0651542991399765,+1.5005035400390625+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+215.05961418151855,+-160.25397777557373,+150.05035400390625+],+"forward": [+-0.9575046896934509,+-0.2809622287750244,+-0.0651542991399765+],+"up": [+-0.06270227581262589,+-0.017718104645609856,+0.9978750348091125+],+"lens_mm": 25.062267303466797,+"fstop": 2.799999952316284,+"focus_cm": 479.5044207945466+},+{+"blender_frame": 251,+"matrix_world": [+[+0.2789926826953888,+-0.06370425224304199,+0.958177924156189,+2.1274850368499756+],+[+0.9602927565574646,+0.0175248421728611,+-0.2784433364868164,+1.622521162033081+],+[+0.0009461068548262119,+0.9978148937225342,+0.06606403738260269,+1.5005658864974976+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+212.74850368499756,+-162.2521162033081,+150.05658864974976+],+"forward": [+-0.958177924156189,+-0.2784433364868164,+-0.06606403738260269+],+"up": [+-0.06370425969362259,+-0.01752484403550625,+0.9978150129318237+],+"lens_mm": 25.068811416625977,+"fstop": 2.799999952316284,+"focus_cm": 477.25237403064966+},+{+"blender_frame": 252,+"matrix_world": [+[+0.27673056721687317,+-0.06428215652704239,+0.9587951302528381,+2.1039669513702393+],+[+0.9609470963478088,+0.017503295093774796,+-0.27617815136909485,+1.641217589378357+],+[+0.0009712538449093699,+0.9977781176567078,+0.06661545485258102,+1.5016002655029297+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+210.39669513702393,+-164.1217589378357,+150.16002655029297+],+"forward": [+-0.9587951302528381,+-0.27617815136909485,+-0.06661545485258102+],+"up": [+-0.06428216397762299,+-0.017503296956419945,+0.9977782368659973+],+"lens_mm": 25.075353622436523,+"fstop": 2.799999952316284,+"focus_cm": 475.01163724809885+},+{+"blender_frame": 253,+"matrix_world": [+[+0.274727463722229,+-0.06440725177526474,+0.9593625664710999,+2.080045223236084+],+[+0.9615219235420227,+0.017654722556471825,+-0.27416056394577026,+1.6586674451828003+],+[+0.000720646174158901,+0.9977675080299377,+0.06677921116352081,+1.503713846206665+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+208.0045223236084,+-165.86674451828003,+150.3713846206665+],+"forward": [+-0.9593625664710999,+-0.27416056394577026,+-0.06677921116352081+],+"up": [+-0.06440725177526474,+-0.017654722556471825,+0.9977675080299377+],+"lens_mm": 25.081892013549805,+"fstop": 2.799999952316284,+"focus_cm": 472.78070226311684+},+{+"blender_frame": 254,+"matrix_world": [+[+0.27297595143318176,+-0.06415018439292908,+0.9598795771598816,+2.055741786956787+],+[+0.9620208740234375,+0.017991652712225914,+-0.2723824977874756,+1.674916386604309+],+[+0.0002035681391134858,+0.997778058052063,+0.06662511825561523,+1.5067778825759888+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+205.5741786956787,+-167.4916386604309,+150.67778825759888+],+"forward": [+-0.9598796963691711,+-0.272382527589798,+-0.06662512570619583+],+"up": [+-0.06415018439292908,+-0.017991652712225914,+0.997778058052063+],+"lens_mm": 25.08842658996582,+"fstop": 2.799999952316284,+"focus_cm": 470.55799905210733+},+{+"blender_frame": 255,+"matrix_world": [+[+0.27146655321121216,+-0.06366905570030212,+0.9603396058082581,+2.031094551086426+],+[+0.9624478220939636,+0.01853412576019764,+-0.27083367109298706,+1.6900181770324707+],+[+-0.0005553319933824241,+0.9977989196777344,+0.06630953401327133,+1.5104573965072632+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+203.10945510864258,+-169.00181770324707,+151.04573965072632+],+"forward": [+-0.9603396058082581,+-0.27083367109298706,+-0.06630953401327133+],+"up": [+-0.06366906315088272,+-0.01853412762284279,+0.9977990388870239+],+"lens_mm": 25.09495735168457,+"fstop": 2.799999952316284,+"focus_cm": 468.34201980382204+},+{+"blender_frame": 256,+"matrix_world": [+[+0.27018800377845764,+-0.06317883729934692,+0.9607324600219727,+2.006157398223877+],+[+0.9628064632415771,+0.019302165135741234,+-0.2695019543170929,+1.7040332555770874+],+[+-0.0015173970023170114,+0.9978155493736267,+0.06604420393705368,+1.5142855644226074+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+200.6157398223877,+-170.40332555770874,+151.42855644226074+],+"forward": [+-0.9607325792312622,+-0.2695019841194153,+-0.06604421138763428+],+"up": [+-0.06317883729934692,+-0.019302165135741234,+0.9978155493736267+],+"lens_mm": 25.101484298706055,+"fstop": 2.799999952316284,+"focus_cm": 466.13285541534424+},+{+"blender_frame": 257,+"matrix_world": [+[+0.26912736892700195,+-0.062908835709095,+0.9610478281974792,+1.980987548828125+],+[+0.9631010293960571,+0.020306117832660675,+-0.26837316155433655,+1.717030644416809+],+[+-0.002632106887176633,+0.9978126883506775,+0.06605249643325806,+1.5177667140960693+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+198.0987548828125,+-171.7030644416809,+151.77667140960693+],+"forward": [+-0.9610478281974792,+-0.26837316155433655,+-0.06605249643325806+],+"up": [+-0.062908835709095,+-0.020306117832660675,+0.9978126883506775+],+"lens_mm": 25.108007431030273,+"fstop": 2.799999952316284,+"focus_cm": 463.93102426081896+},+{+"blender_frame": 258,+"matrix_world": [+[+0.26827019453048706,+-0.06305664777755737,+0.9612778425216675,+1.9556418657302856+],+[+0.9633360505104065,+0.021537188440561295,+-0.2674318552017212,+1.729086995124817+],+[+-0.003839863231405616,+0.9977775812149048,+0.066522516310215,+1.520485281944275+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+195.56418657302856,+-172.9086995124817,+152.0485281944275+],+"forward": [+-0.9612778425216675,+-0.2674318552017212,+-0.066522516310215+],+"up": [+-0.06305664777755737,+-0.021537188440561295,+0.9977775812149048+],+"lens_mm": 25.114524841308594,+"fstop": 2.799999952316284,+"focus_cm": 461.73867881298065+},+{+"blender_frame": 259,+"matrix_world": [+[+0.2676011621952057,+-0.06375028938055038,+0.9614184498786926,+1.9301650524139404+],+[+0.9635164141654968,+0.02296099252998829,+-0.2666625678539276,+1.7402855157852173+],+[+-0.005075303837656975,+0.9977018237113953,+0.067568838596344,+1.5221987962722778+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+193.01650524139404,+-174.02855157852173,+152.21987962722778+],+"forward": [+-0.9614185690879822,+-0.26666259765625,+-0.06756884604692459+],+"up": [+-0.06375028192996979,+-0.02296099066734314,+0.9977017045021057+],+"lens_mm": 25.12103843688965,+"fstop": 2.799999952316284,+"focus_cm": 459.5567649230361+},+{+"blender_frame": 260,+"matrix_world": [+[+0.267103910446167,+-0.06502430140972137,+0.9614715576171875,+1.9045851230621338+],+[+0.9636474251747131,+0.02451520413160324,+-0.26605045795440674,+1.750715970993042+],+[+-0.006270925980061293,+0.9975824356079102,+0.06920861452817917,+1.522891879081726+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+190.45851230621338,+-175.0715970993042,+152.2891879081726+],+"forward": [+-0.961471438407898,+-0.26605042815208435,+-0.06920860707759857+],+"up": [+-0.06502430886030197,+-0.02451520785689354,+0.9975825548171997+],+"lens_mm": 25.127544403076172,+"fstop": 2.799999952316284,+"focus_cm": 457.38512724637985+},+{+"blender_frame": 261,+"matrix_world": [+[+0.2667616903781891,+-0.06681675463914871,+0.9614436030387878,+1.8789105415344238+],+[+0.9637344479560852,+0.02611301839351654,+-0.26558253169059753,+1.760470986366272+],+[+-0.007360831368714571,+0.997423529624939,+0.07135957479476929,+1.5227808952331543+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+187.89105415344238,+-176.0470986366272,+152.27808952331543+],+"forward": [+-0.9614436030387878,+-0.26558253169059753,+-0.07135957479476929+],+"up": [+-0.06681675463914871,+-0.02611301839351654,+0.997423529624939+],+"lens_mm": 25.134048461914062,+"fstop": 2.799999952316284,+"focus_cm": 455.22194262593985+},+{+"blender_frame": 262,+"matrix_world": [+[+0.2665577828884125,+-0.06898656487464905,+0.9613468050956726,+1.853129506111145+],+[+0.963783323764801,+0.02765183337032795,+-0.2652490437030792,+1.76964271068573+],+[+-0.008284381590783596,+0.9972342252731323,+0.07385890930891037,+1.5222684144973755+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+185.3129506111145,+-176.964271068573,+152.22684144973755+],+"forward": [+-0.9613469243049622,+-0.2652490735054016,+-0.07385891675949097+],+"up": [+-0.06898657232522964,+-0.027651837095618248,+0.9972343444824219+],+"lens_mm": 25.140544891357422,+"fstop": 2.799999952316284,+"focus_cm": 453.0640833079815+},+{+"blender_frame": 263,+"matrix_world": [+[+0.26647570729255676,+-0.07134775072336197,+0.9611972570419312,+1.8272185325622559+],+[+0.9637998938560486,+0.029026072472333908,+-0.26504260301589966,+1.7783193588256836+],+[+-0.008989588357508183,+0.9970291256904602,+0.07649967819452286,+1.521856427192688+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+182.7218532562256,+-177.83193588256836,+152.1856427192688+],+"forward": [+-0.9611972570419312,+-0.26504260301589966,+-0.07649967819452286+],+"up": [+-0.07134775072336197,+-0.029026072472333908,+0.9970291256904602+],+"lens_mm": 25.14703369140625,+"fstop": 2.799999952316284,+"focus_cm": 450.90861953794956+},+{+"blender_frame": 264,+"matrix_world": [+[+0.26649948954582214,+-0.07371239364147186,+0.9610123038291931,+1.8011469841003418+],+[+0.9637888669967651,+0.030141783878207207,+-0.2649575471878052,+1.7865787744522095+],+[+-0.009435967542231083,+0.9968239665031433,+0.07907593995332718,+1.522037148475647+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.11469841003418,+-178.65787744522095,+152.2037148475647+],+"forward": [+-0.9610123038291931,+-0.2649575471878052,+-0.07907593995332718+],+"up": [+-0.07371239364147186,+-0.030141783878207207,+0.9968239665031433+],+"lens_mm": 25.153518676757812,+"fstop": 2.799999952316284,+"focus_cm": 448.75330217182636+},+{+"blender_frame": 265,+"matrix_world": [+[+0.26661446690559387,+-0.07593341916799545,+0.9608073830604553,+1.7748883962631226+],+[+0.9637555480003357,+0.0309305377304554,+-0.2649880647659302,+1.7944859266281128+],+[+-0.009596840478479862,+0.9966329336166382,+0.08142778277397156,+1.5231873989105225+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+177.48883962631226,+-179.44859266281128,+152.31873989105225+],+"forward": [+-0.9608073830604553,+-0.2649880647659302,+-0.08142778277397156+],+"up": [+-0.07593342661857605,+-0.030930541455745697,+0.9966330528259277+],+"lens_mm": 25.159996032714844,+"fstop": 2.799999952316284,+"focus_cm": 446.59643582999706+},+{+"blender_frame": 266,+"matrix_world": [+[+0.26680704951286316,+-0.0779373049736023,+0.9605934023857117,+1.7484276294708252+],+[+0.9637035131454468,+0.03135981783270836,+-0.2651265263557434,+1.802087664604187+],+[+-0.009460791945457458,+0.9964649677276611,+0.08347546309232712,+1.525485634803772+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+174.84276294708252,+-180.2087664604187,+152.5485634803772+],+"forward": [+-0.9605935215950012,+-0.2651265561580658,+-0.08347547054290771+],+"up": [+-0.0779373049736023,+-0.03135981783270836,+0.9964649677276611+],+"lens_mm": 25.166467666625977,+"fstop": 2.799999952316284,+"focus_cm": 444.4374293088913+},+{+"blender_frame": 267,+"matrix_world": [+[+0.26706546545028687,+-0.07973957806825638,+0.9603736996650696,+1.7217663526535034+],+[+0.9636361598968506,+0.03143800050020218,+-0.26536238193511963,+1.8094134330749512+],+[+-0.009032349102199078,+0.9963198900222778,+0.08523595333099365,+1.5288738012313843+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+172.17663526535034,+-180.94134330749512,+152.88738012313843+],+"forward": [+-0.9603738188743591,+-0.265362411737442,+-0.08523596078157425+],+"up": [+-0.07973957806825638,+-0.03143800050020218,+0.9963198900222778+],+"lens_mm": 25.172929763793945,+"fstop": 2.799999952316284,+"focus_cm": 442.2755531966686+},+{+"blender_frame": 268,+"matrix_world": [+[+0.2673792243003845,+-0.08144016563892365,+0.9601436257362366,+1.6949243545532227+],+[+0.9635553956031799,+0.031212935224175453,+-0.26568180322647095,+1.8164719343185425+],+[+-0.008331730961799622,+0.9961893558502197,+0.08681780099868774,+1.5330692529678345+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+169.49243545532227,+-181.64719343185425,+153.30692529678345+],+"forward": [+-0.9601437449455261,+-0.26568183302879333,+-0.08681780844926834+],+"up": [+-0.08144016563892365,+-0.031212935224175453,+0.9961893558502197+],+"lens_mm": 25.179386138916016,+"fstop": 2.799999952316284,+"focus_cm": 440.11081233620644+},+{+"blender_frame": 269,+"matrix_world": [+[+0.2677401304244995,+-0.08319907635450363,+0.9598923325538635,+1.6679351329803467+],+[+0.9634628295898438,+0.030764412134885788,+-0.26606956124305725,+1.8232556581497192+],+[+-0.007393782027065754,+0.9960579872131348,+0.0883960947394371,+1.5376253128051758+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+166.79351329803467,+-182.32556581497192,+153.76253128051758+],+"forward": [+-0.9598923325538635,+-0.26606956124305725,+-0.0883960947394371+],+"up": [+-0.08319907635450363,+-0.030764412134885788,+0.9960579872131348+],+"lens_mm": 25.185834884643555,+"fstop": 2.799999952316284,+"focus_cm": 437.9435397684574+},+{+"blender_frame": 270,+"matrix_world": [+[+0.26814186573028564,+-0.08519817888736725,+0.9596046805381775,+1.6408402919769287+],+[+0.9633590579032898,+0.030191846191883087,+-0.26651036739349365,+1.829742670059204+],+[+-0.006266042590141296,+0.9959065318107605,+0.09017213433980942,+1.5420278310775757+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+164.08402919769287,+-182.9742670059204,+154.20278310775757+],+"forward": [+-0.959604799747467,+-0.26651039719581604,+-0.09017214179039001+],+"up": [+-0.08519817888736725,+-0.030191846191883087,+0.9959065318107605+],+"lens_mm": 25.192276000976562,+"fstop": 2.799999952316284,+"focus_cm": 435.77457033097744+},+{+"blender_frame": 271,+"matrix_world": [+[+0.2685800790786743,+-0.0875973030924797,+0.9592661261558533,+1.6136771440505981+],+[+0.9632444381713867,+0.02959955483675003,+-0.26699092984199524,+1.8359020948410034+],+[+-0.005006161984056234,+0.9957160949707031,+0.09232746064662933,+1.5458041429519653+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+161.36771440505981,+-183.59020948410034,+154.58041429519653+],+"forward": [+-0.9592661261558533,+-0.26699092984199524,+-0.09232746064662933+],+"up": [+-0.0875973105430603,+-0.02959955856204033,+0.9957162141799927+],+"lens_mm": 25.198707580566406,+"fstop": 2.799999952316284,+"focus_cm": 433.6046826094389+},+{+"blender_frame": 272,+"matrix_world": [+[+0.269051730632782,+-0.09049496799707413,+0.9588649272918701,+1.586472511291504+],+[+0.9631187319755554,+0.029082512483000755,+-0.2675006091594696,+1.8416999578475952+],+[+-0.0036787413991987705,+0.9954721331596375,+0.09498211741447449,+1.54862642288208+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+158.6472511291504,+-184.16999578475952,+154.862642288208+],+"forward": [+-0.9588649272918701,+-0.2675006091594696,+-0.09498211741447449+],+"up": [+-0.09049497544765472,+-0.029082516208291054,+0.995472252368927+],+"lens_mm": 25.20513153076172,+"fstop": 2.799999952316284,+"focus_cm": 431.43452890217304+},+{+"blender_frame": 273,+"matrix_world": [+[+0.2695558965206146,+-0.09390129148960114,+0.9583956003189087,+1.559232234954834+],+[+0.9629819989204407,+0.02871500514447689,+-0.2680323123931885,+1.847102403640747+],+[+-0.002351757138967514,+0.9951673150062561,+0.09816552698612213,+1.5503782033920288+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+155.9232234954834,+-184.7102403640747,+155.03782033920288+],+"forward": [+-0.9583957195281982,+-0.26803234219551086,+-0.09816554188728333+],+"up": [+-0.09390129148960114,+-0.02871500514447689,+0.9951673150062561+],+"lens_mm": 25.211545944213867,+"fstop": 2.799999952316284,+"focus_cm": 429.26338128745556+},+{+"blender_frame": 274,+"matrix_world": [+[+0.27009260654449463,+-0.0977301076054573,+0.9578615427017212,+1.5319386720657349+],+[+0.9628337621688843,+0.028544258326292038,+-0.2685822546482086,+1.8520814180374146+],+[+-0.0010928739793598652,+0.9948035478591919,+0.10180744528770447,+1.551178216934204+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+153.1938672065735,+-185.20814180374146,+155.1178216934204+],+"forward": [+-0.9578616619110107,+-0.268582284450531,+-0.10180746018886566+],+"up": [+-0.0977301076054573,+-0.028544258326292038,+0.9948035478591919+],+"lens_mm": 25.21795082092285,+"fstop": 2.799999952316284,+"focus_cm": 427.0893059670925+},+{+"blender_frame": 275,+"matrix_world": [+[+0.2706628739833832,+-0.1018126904964447,+0.9572752118110657,+1.504552960395813+],+[+0.9626743197441101,+0.028589928522706032,+-0.2691486179828644,+1.856616735458374+],+[+3.4319120459258556e-05,+0.9943927526473999,+0.1057506799697876,+1.551350712776184+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+150.4552960395813,+-185.6616735458374,+155.1350712776184+],+"forward": [+-0.9572752118110657,+-0.2691486179828644,+-0.1057506799697876+],+"up": [+-0.1018126904964447,+-0.028589928522706032,+0.9943927526473999+],+"lens_mm": 25.224348068237305,+"fstop": 2.799999952316284,+"focus_cm": 424.91003200411797+},+{+"blender_frame": 276,+"matrix_world": [+[+0.27126798033714294,+-0.10592849552631378,+0.9566571116447449,+1.4770210981369019+],+[+0.9625034928321838,+0.028848866000771523,+-0.2697313129901886,+1.8606971502304077+],+[+0.0009737597429193556,+0.9939550757408142,+0.10978231579065323,+1.5513513088226318+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+147.70210981369019,+-186.06971502304077,+155.13513088226318+],+"forward": [+-0.9566571116447449,+-0.2697313129901886,+-0.10978231579065323+],+"up": [+-0.10592851042747498,+-0.02884886972606182,+0.9939551949501038+],+"lens_mm": 25.23073387145996,+"fstop": 2.799999952316284,+"focus_cm": 422.7240849286318+},+{+"blender_frame": 277,+"matrix_world": [+[+0.27190929651260376,+-0.10984834283590317,+0.9560328125953674,+1.4492840766906738+],+[+0.9623214602470398,+0.0293037761002779,+-0.27033087611198425,+1.8643198013305664+],+[+0.001680026645772159,+0.9935162663459778,+0.11367738246917725,+1.5516648292541504+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+144.92840766906738,+-186.43198013305664,+155.16648292541504+],+"forward": [+-0.9560328125953674,+-0.27033087611198425,+-0.11367738246917725+],+"up": [+-0.10984835773706436,+-0.0293037798255682,+0.9935163855552673+],+"lens_mm": 25.237110137939453,+"fstop": 2.799999952316284,+"focus_cm": 420.5308858305216+},+{+"blender_frame": 278,+"matrix_world": [+[+0.2725878953933716,+-0.11337944120168686,+0.9554271697998047,+1.4212921857833862+],+[+0.9621286988258362,+0.029933325946331024,+-0.27094766497612,+1.8674896955490112+],+[+0.0021207882091403008,+0.993100643157959,+0.11724507808685303,+1.5526952743530273+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+142.12921857833862,+-186.74896955490112,+155.26952743530273+],+"forward": [+-0.9554271697998047,+-0.27094766497612,+-0.11724507808685303+],+"up": [+-0.11337945610284805,+-0.029933329671621323,+0.9931007623672485+],+"lens_mm": 25.24347686767578,+"fstop": 2.799999952316284,+"focus_cm": 418.33138056099415+},+{+"blender_frame": 279,+"matrix_world": [+[+0.2733035385608673,+-0.11640287935733795,+0.9548588991165161,+1.393014907836914+],+[+0.961925208568573,+0.030720997601747513,+-0.2715810239315033,+1.8702181577682495+],+[+0.0022785940673202276,+0.9927268028259277,+0.12036702036857605,+1.5546746253967285+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+139.3014907836914,+-187.02181577682495,+155.46746253967285+],+"forward": [+-0.9548588991165161,+-0.2715810239315033,+-0.12036702036857605+],+"up": [+-0.11640289425849915,+-0.03072100132703781,+0.9927269220352173+],+"lens_mm": 25.249834060668945,+"fstop": 2.799999952316284,+"focus_cm": 416.1268126219511+},+{+"blender_frame": 280,+"matrix_world": [+[+0.27405524253845215,+-0.1188959851861,+0.9543362259864807,+1.3644495010375977+],+[+0.9617116451263428,+0.031660858541727066,+-0.27222877740859985,+1.8725208044052124+],+[+0.0021518005523830652,+0.9924018383026123,+0.1230204775929451,+1.5576083660125732+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+136.44495010375977,+-187.25208044052124,+155.76083660125732+],+"forward": [+-0.9543361067771912,+-0.27222874760627747,+-0.1230204626917839+],+"up": [+-0.1188959851861,+-0.031660858541727066,+0.9924018383026123+],+"lens_mm": 25.25617790222168,+"fstop": 2.799999952316284,+"focus_cm": 413.9181900769472+},+{+"blender_frame": 281,+"matrix_world": [+[+0.2748362123966217,+-0.12093444913625717,+0.9538552165031433,+1.3356252908706665+],+[+0.9614895582199097,+0.03275845944881439,+-0.27288252115249634,+1.874416708946228+],+[+0.001754076685756445,+0.9921197891235352,+0.12528041005134583,+1.5612714290618896+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+133.56252908706665,+-187.4416708946228,+156.12714290618896+],+"forward": [+-0.9538553357124329,+-0.2728825509548187,+-0.12528042495250702+],+"up": [+-0.12093446403741837,+-0.03275846317410469,+0.9921199083328247+],+"lens_mm": 25.26251220703125,+"fstop": 2.799999952316284,+"focus_cm": 411.7059424519539+},+{+"blender_frame": 282,+"matrix_world": [+[+0.2756187915802002,+-0.12267395853996277,+0.953407347202301,+1.3065974712371826+],+[+0.9612663388252258,+0.03402656689286232,+-0.2735126316547394,+1.8759311437606812+],+[+0.00111169065348804,+0.9918636083602905,+0.12730072438716888,+1.5652538537979126+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+130.65974712371826,+-187.59311437606812,+156.52538537979126+],+"forward": [+-0.953407347202301,+-0.2735126316547394,+-0.12730072438716888+],+"up": [+-0.12267395853996277,+-0.03402656689286232,+0.9918636083602905+],+"lens_mm": 25.268835067749023,+"fstop": 2.799999952316284,+"focus_cm": 409.4897635281086+},+{+"blender_frame": 283,+"matrix_world": [+[+0.2763959765434265,+-0.12431490421295166,+0.9529695510864258,+1.277442216873169+],+[+0.9610438346862793,+0.03547746315598488,+-0.27410972118377686,+1.877092719078064+],+[+0.0002669839304871857,+0.9916083812713623,+0.12927789986133575,+1.569047212600708+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+127.7442216873169,+-187.7092719078064,+156.9047212600708+],+"forward": [+-0.9529696702957153,+-0.27410975098609924,+-0.12927791476249695+],+"up": [+-0.12431490421295166,+-0.03547746315598488,+0.9916083812713623+],+"lens_mm": 25.275146484375,+"fstop": 2.799999952316284,+"focus_cm": 407.2694428265095+},+{+"blender_frame": 284,+"matrix_world": [+[+0.2771625220775604,+-0.12605905532836914,+0.9525177478790283,+1.2482396364212036+],+[+0.9608228206634521,+0.03711269795894623,+-0.2746674716472626,+1.8779397010803223+],+[+-0.0007261839346028864,+0.9913282990455627,+0.13140666484832764,+1.5721524953842163+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+124.82396364212036,+-187.79397010803223,+157.21524953842163+],+"forward": [+-0.9525178670883179,+-0.27466750144958496,+-0.13140667974948883+],+"up": [+-0.12605905532836914,+-0.03711269795894623,+0.9913282990455627+],+"lens_mm": 25.28144645690918,+"fstop": 2.799999952316284,+"focus_cm": 405.044773966074+},+{+"blender_frame": 285,+"matrix_world": [+[+0.2779121398925781,+-0.12806589901447296,+0.9520314931869507,+1.219063401222229+],+[+0.9606049060821533,+0.03891368955373764,+-0.2751801908016205,+1.878517985343933+],+[+-0.0018058555433526635,+0.9910019636154175,+0.1338353008031845,+1.5741876363754272+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.9063401222229,+-187.8517985343933,+157.41876363754272+],+"forward": [+-0.9520314931869507,+-0.2751801908016205,+-0.1338353008031845+],+"up": [+-0.12806589901447296,+-0.03891368955373764,+0.9910019636154175+],+"lens_mm": 25.28773307800293,+"fstop": 2.799999952316284,+"focus_cm": 402.81592831015587+},+{+"blender_frame": 286,+"matrix_world": [+[+0.2786377966403961,+-0.13041952252388,+0.9514998197555542,+1.1899659633636475+],+[+0.9603918790817261,+0.040835343301296234,+-0.27564460039138794,+1.8788851499557495+],+[+-0.002905379980802536,+0.990617573261261,+0.13663214445114136,+1.5749675035476685+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+118.99659633636475,+-187.88851499557495,+157.49675035476685+],+"forward": [+-0.9514998197555542,+-0.27564460039138794,+-0.13663214445114136+],+"up": [+-0.1304195374250412,+-0.04083534702658653,+0.9906176924705505+],+"lens_mm": 25.294008255004883,+"fstop": 2.799999952316284,+"focus_cm": 400.5829028785229+},+{+"blender_frame": 287,+"matrix_world": [+[+0.2793322205543518,+-0.13311196863651276,+0.9509231448173523,+1.1609725952148438+],+[+0.9601863026618958,+0.042804960161447525,+-0.27606138586997986,+1.879106879234314+],+[+-0.003957152366638184,+0.990176260471344,+0.13976909220218658,+1.5745433568954468+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+116.09725952148438,+-187.9106879234314,+157.45433568954468+],+"forward": [+-0.9509231448173523,+-0.27606138586997986,+-0.13976909220218658+],+"up": [+-0.13311196863651276,+-0.042804960161447525,+0.990176260471344+],+"lens_mm": 25.30027198791504,+"fstop": 2.799999952316284,+"focus_cm": 398.34543988108635+},+{+"blender_frame": 288,+"matrix_world": [+[+0.27998748421669006,+-0.13604754209518433,+0.9503147602081299,+1.1320786476135254+],+[+0.9599912166595459,+0.044726863503456116,+-0.2764352858066559,+1.8792576789855957+],+[+-0.004896253347396851,+0.9896921515464783,+0.1431274265050888,+1.5731911659240723+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+113.20786476135254,+-187.92576789855957,+157.31911659240723+],+"forward": [+-0.9503147602081299,+-0.2764352858066559,+-0.1431274265050888+],+"up": [+-0.13604754209518433,+-0.044726863503456116,+0.9896921515464783+],+"lens_mm": 25.306520462036133,+"fstop": 2.799999952316284,+"focus_cm": 396.1034953594208+},+{+"blender_frame": 289,+"matrix_world": [+[+0.28059637546539307,+-0.13906611502170563,+0.9496980309486389,+1.1032546758651733+],+[+0.9598092436790466,+0.04649292677640915,+-0.2767757177352905,+1.8794147968292236+],+[+-0.005664116702973843,+0.9891910552978516,+0.14652268588542938,+1.571349859237671+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+110.32546758651733,+-187.94147968292236,+157.1349859237671+],+"forward": [+-0.9496980309486389,+-0.2767757177352905,+-0.14652268588542938+],+"up": [+-0.13906612992286682,+-0.04649293050169945,+0.9891911745071411+],+"lens_mm": 25.31275749206543,+"fstop": 2.799999952316284,+"focus_cm": 393.85761618614197+},+{+"blender_frame": 290,+"matrix_world": [+[+0.28115227818489075,+-0.1419808715581894,+0.9491021633148193,+1.0744575262069702+],+[+0.9596430659294128,+0.047996774315834045,+-0.2770947217941284,+1.8796545267105103+],+[+-0.006211694795638323,+0.988705039024353,+0.14974536001682281,+1.56952702999115+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+107.44575262069702,+-187.96545267105103,+156.952702999115+],+"forward": [+-0.9491021633148193,+-0.2770947217941284,+-0.14974536001682281+],+"up": [+-0.14198088645935059,+-0.04799678176641464,+0.9887051582336426+],+"lens_mm": 25.318979263305664,+"fstop": 2.799999952316284,+"focus_cm": 391.60926416516304+},+{+"blender_frame": 291,+"matrix_world": [+[+0.28164973855018616,+-0.14462144672870636,+0.9485558271408081,+1.0456440448760986+],+[+0.9594952464103699,+0.04914923757314682,+-0.27740442752838135,+1.8800432682037354+],+[+-0.006502165924757719,+0.9882656335830688,+0.15260647237300873,+1.5681875944137573+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+104.56440448760986,+-188.00432682037354,+156.81875944137573+],+"forward": [+-0.9485558271408081,+-0.27740442752838135,+-0.15260647237300873+],+"up": [+-0.14462146162986755,+-0.04914924502372742,+0.9882657527923584+],+"lens_mm": 25.3251895904541,+"fstop": 2.799999952316284,+"focus_cm": 389.3606163561344+},+{+"blender_frame": 292,+"matrix_world": [+[+0.28208470344543457,+-0.14687304198741913,+0.9480804204940796,+1.0167845487594604+],+[+0.9593674540519714,+0.04989199712872505,+-0.2777138650417328,+1.88063645362854+],+[+-0.006512945983558893,+0.9878963232040405,+0.15497896075248718,+1.567655086517334+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+101.67845487594604,+-188.063645362854,+156.7655086517334+],+"forward": [+-0.9480805397033691,+-0.2777138948440552,+-0.15497897565364838+],+"up": [+-0.14687304198741913,+-0.04989199712872505,+0.9878963232040405+],+"lens_mm": 25.331384658813477,+"fstop": 2.799999952316284,+"focus_cm": 387.11381405591965+},+{+"blender_frame": 293,+"matrix_world": [+[+0.28245463967323303,+-0.14870335161685944,+0.9476849436759949,+0.9878740906715393+],+[+0.9592604041099548,+0.0502069890499115,+-0.27802661061286926,+1.8814693689346313+],+[+-0.00623692199587822,+0.9876065254211426,+0.156826451420784,+1.5680423974990845+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+98.78740906715393,+-188.14693689346313,+156.80423974990845+],+"forward": [+-0.9476849436759949,+-0.27802661061286926,+-0.156826451420784+],+"up": [+-0.14870335161685944,+-0.0502069890499115,+0.9876065254211426+],+"lens_mm": 25.33756446838379,+"fstop": 2.799999952316284,+"focus_cm": 384.870083630085+},+{+"blender_frame": 294,+"matrix_world": [+[+0.2827584445476532,+-0.1501709222793579,+0.9473628401756287,+0.9589378833770752+],+[+0.959174394607544,+0.05011938884854317,+-0.2783391773700714,+1.8825592994689941+],+[+-0.005682795774191618,+0.9873889684677124,+0.15821176767349243,+1.5692296028137207+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+95.89378833770752,+-188.2559299468994,+156.92296028137207+],+"forward": [+-0.9473628401756287,+-0.2783391773700714,+-0.15821176767349243+],+"up": [+-0.15017090737819672,+-0.05011938139796257,+0.9873888492584229+],+"lens_mm": 25.343730926513672,+"fstop": 2.799999952316284,+"focus_cm": 382.62943625450134+},+{+"blender_frame": 295,+"matrix_world": [+[+0.28299713134765625,+-0.15141315758228302,+0.9470937252044678,+0.9300292730331421+],+[+0.9591084122657776,+0.049693845212459564,+-0.278642475605011,+1.8839032649993896+],+[+-0.004874595440924168,+0.9872207045555115,+0.1592848002910614,+1.5708932876586914+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+93.00292730331421,+-188.39032649993896,+157.08932876586914+],+"forward": [+-0.9470938444137573,+-0.2786425054073334,+-0.1592848151922226+],+"up": [+-0.15141315758228302,+-0.049693845212459564,+0.9872207045555115+],+"lens_mm": 25.349884033203125,+"fstop": 2.799999952316284,+"focus_cm": 380.3910791873932+},+{+"blender_frame": 296,+"matrix_world": [+[+0.2831731140613556,+-0.15261660516262054,+0.9468479156494141,+0.9012208580970764+],+[+0.9590611457824707,+0.04902445524930954,+-0.27892372012138367,+1.885482907295227+],+[+-0.0038503133691847324,+0.987068772315979,+0.16025108098983765,+1.5725798606872559+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+90.12208580970764,+-188.5482907295227,+157.2579860687256+],+"forward": [+-0.9468480348587036,+-0.27892374992370605,+-0.16025109589099884+],+"up": [+-0.15261662006378174,+-0.04902446269989014,+0.9870688915252686+],+"lens_mm": 25.356019973754883,+"fstop": 2.799999952316284,+"focus_cm": 378.1540744006634+},+{+"blender_frame": 297,+"matrix_world": [+[+0.28329044580459595,+-0.15397684276103973,+0.9465926289558411,+0.8725910186767578+],+[+0.9590304493904114,+0.04822070896625519,+-0.2791689932346344,+1.8872705698013306+],+[+-0.0026598055846989155,+0.9868971109390259,+0.16132895648479462,+1.573809027671814+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+87.25910186767578,+-188.72705698013306,+157.3809027671814+],+"forward": [+-0.9465927481651306,+-0.2791690230369568,+-0.1613289713859558+],+"up": [+-0.15397684276103973,+-0.04822070896625519,+0.9868971109390259+],+"lens_mm": 25.362140655517578,+"fstop": 2.799999952316284,+"focus_cm": 375.91815665364265+},+{+"blender_frame": 298,+"matrix_world": [+[+0.28335481882095337,+-0.155654639005661,+0.9462989568710327,+0.844207763671875+],+[+0.9590142965316772,+0.04739171266555786,+-0.2793668210506439,+1.8892334699630737+],+[+-0.0013619972160086036,+0.9866741299629211,+0.16270366311073303,+1.5741808414459229+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+84.4207763671875,+-188.92334699630737,+157.41808414459229+],+"forward": [+-0.9462989568710327,+-0.2793668210506439,+-0.16270366311073303+],+"up": [+-0.155654639005661,+-0.04739171266555786,+0.9866741299629211+],+"lens_mm": 25.36824607849121,+"fstop": 2.799999952316284,+"focus_cm": 373.68358746171+},+{+"blender_frame": 299,+"matrix_world": [+[+0.28337153792381287,+-0.15774032473564148,+0.945948600769043,+0.8161147236824036+],+[+0.9590101838111877,+0.04663184657692909,+-0.2795083522796631,+1.8913456201553345+],+[+-2.1589130483334884e-05,+0.9863790273666382,+0.16448870301246643,+1.5734682083129883+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+81.61147236824036,+-189.13456201553345,+157.34682083129883+],+"forward": [+-0.9459484815597534,+-0.2795083224773407,+-0.16448868811130524+],+"up": [+-0.15774032473564148,+-0.04663184657692909,+0.9863790273666382+],+"lens_mm": 25.37433624267578,+"fstop": 2.799999952316284,+"focus_cm": 371.4510880410671+},+{+"blender_frame": 300,+"matrix_world": [+[+0.2833477854728699,+-0.160232812166214,+0.945536732673645,+0.7883209586143494+],+[+0.9590163826942444,+0.046010956168174744,+-0.2795901596546173,+1.8935863971710205+],+[+0.001294465851970017,+0.9860063195228577,+0.1667029857635498,+1.5716694593429565+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+78.83209586143494,+-189.35863971710205,+157.16694593429565+],+"forward": [+-0.9455366134643555,+-0.2795901298522949,+-0.1667029708623886+],+"up": [+-0.160232812166214,+-0.046010956168174744,+0.9860063195228577+],+"lens_mm": 25.380409240722656,+"fstop": 2.799999952316284,+"focus_cm": 369.22136545181274+},+{+"blender_frame": 301,+"matrix_world": [+[+0.28328949213027954,+-0.16303859651088715,+0.9450743198394775,+0.7607989311218262+],+[+0.9590312242507935,+0.04556968808174133,+-0.27961164712905884,+1.8959505558013916+],+[+0.0025207442231476307,+0.9855666756629944,+0.16926851868629456,+1.569012999534607+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+76.07989311218262,+-189.59505558013916,+156.9012999534607+],+"forward": [+-0.9450743198394775,+-0.27961164712905884,+-0.16926851868629456+],+"up": [+-0.16303861141204834,+-0.04556969180703163,+0.9855667948722839+],+"lens_mm": 25.38646697998047,+"fstop": 2.799999952316284,+"focus_cm": 366.9948183000088+},+{+"blender_frame": 302,+"matrix_world": [+[+0.28320175409317017,+-0.16599106788635254,+0.9445865750312805,+0.7334901094436646+],+[+0.9590535759925842,+0.04532143473625183,+-0.2795749604701996,+1.8984464406967163+],+[+0.0035969309974461794,+0.9850851893424988,+0.17202948033809662,+1.5659116506576538+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+73.34901094436646,+-189.84464406967163,+156.59116506576538+],+"forward": [+-0.9445865750312805,+-0.2795749604701996,+-0.17202948033809662+],+"up": [+-0.16599108278751373,+-0.04532143846154213,+0.9850853085517883+],+"lens_mm": 25.392507553100586,+"fstop": 2.799999952316284,+"focus_cm": 364.7720344364643+},+{+"blender_frame": 303,+"matrix_world": [+[+0.2830885648727417,+-0.16888569295406342,+0.9441072344779968,+0.7063177227973938+],+[+0.9590833783149719,+0.045259200036525726,+-0.2794829308986664,+1.901094675064087+],+[+0.00447113486006856,+0.9845959544181824,+0.17478780448436737,+1.5628767013549805+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+70.63177227973938,+-190.1094675064087,+156.28767013549805+],+"forward": [+-0.9441073536872864,+-0.27948296070098877,+-0.17478781938552856+],+"up": [+-0.1688857078552246,+-0.045259203761816025,+0.9845960736274719+],+"lens_mm": 25.398530960083008,+"fstop": 2.799999952316284,+"focus_cm": 362.5540316104889+},+{+"blender_frame": 304,+"matrix_world": [+[+0.2829514145851135,+-0.1715235859155655,+0.9436727166175842,+0.6792035102844238+],+[+0.9591208100318909,+0.04536554962396622,+-0.279337614774704,+1.9039267301559448+],+[+0.005102758761495352,+0.9841350317001343,+0.1773480474948883,+1.5604090690612793+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+67.92035102844238,+-190.39267301559448,+156.04090690612793+],+"forward": [+-0.9436727166175842,+-0.279337614774704,+-0.1773480474948883+],+"up": [+-0.1715235859155655,+-0.04536554962396622,+0.9841350317001343+],+"lens_mm": 25.404539108276367,+"fstop": 2.799999952316284,+"focus_cm": 360.3421628475189+},+{+"blender_frame": 305,+"matrix_world": [+[+0.28278931975364685,+-0.17375481128692627,+0.9433130621910095,+0.652087390422821+],+[+0.9591665863990784,+0.04562312737107277,+-0.2791382968425751,+1.906977653503418+],+[+0.005464721936732531,+0.9837316274642944,+0.1795615404844284,+1.5588958263397217+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+65.2087390422821,+-190.6977653503418,+155.88958263397217+],+"forward": [+-0.9433130621910095,+-0.2791382968425751,+-0.1795615404844284+],+"up": [+-0.17375481128692627,+-0.04562312737107277,+0.9837316274642944+],+"lens_mm": 25.4105281829834,+"fstop": 2.799999952316284,+"focus_cm": 358.138008415699+},+{+"blender_frame": 306,+"matrix_world": [+[+0.2825978994369507,+-0.17551039159297943,+0.943045437335968,+0.624941885471344+],+[+0.9592225551605225,+0.046022649854421616,+-0.2788802981376648,+1.9102870225906372+],+[+0.005544945597648621,+0.9834012389183044,+0.1813594251871109,+1.5585271120071411+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+62.4941885471344,+-191.02870225906372,+155.8527112007141+],+"forward": [+-0.943045437335968,+-0.2788802981376648,+-0.1813594251871109+],+"up": [+-0.17551040649414062,+-0.046022653579711914,+0.983401358127594+],+"lens_mm": 25.416500091552734,+"fstop": 2.799999952316284,+"focus_cm": 355.9422418475151+},+{+"blender_frame": 307,+"matrix_world": [+[+0.2823699712753296,+-0.1768179088830948,+0.9428693056106567,+0.5977809429168701+],+[+0.9592906832695007,+0.046566981822252274,+-0.2785550057888031,+1.9138917922973633+],+[+0.005346940364688635,+0.9831414222717285,+0.18276888132095337,+1.5592583417892456+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+59.77809429168701,+-191.38917922973633,+155.92583417892456+],+"forward": [+-0.9428694248199463,+-0.2785550355911255,+-0.18276889622211456+],+"up": [+-0.1768179088830948,+-0.046566981822252274,+0.9831414222717285+],+"lens_mm": 25.422452926635742,+"fstop": 2.799999952316284,+"focus_cm": 353.7546820938587+},+{+"blender_frame": 308,+"matrix_world": [+[+0.2820946276187897,+-0.17779673635959625,+0.9427676796913147,+0.5706607699394226+],+[+0.959374189376831,+0.04726971313357353,+-0.27814897894859314,+1.9178295135498047+],+[+0.004889613017439842,+0.9829313158988953,+0.1839081048965454,+1.560823678970337+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+57.06607699394226,+-191.78295135498047,+156.0823678970337+],+"forward": [+-0.9427677989006042,+-0.2781490087509155,+-0.1839081197977066+],+"up": [+-0.17779673635959625,+-0.04726971313357353,+0.9829313158988953+],+"lens_mm": 25.428388595581055,+"fstop": 2.799999952316284,+"focus_cm": 351.5741556882858+},+{+"blender_frame": 309,+"matrix_world": [+[+0.2817575931549072,+-0.17863306403160095,+0.9427103400230408,+0.5436712503433228+],+[+0.9594764113426208,+0.04814882576465607,+-0.27764496207237244,+1.9221371412277222+],+[+0.004206171724945307,+0.9827370047569275,+0.1849604845046997,+1.5627937316894531+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+54.367125034332275,+-192.21371412277222,+156.2793731689453+],+"forward": [+-0.9427104592323303,+-0.2776449918746948,+-0.1849604994058609+],+"up": [+-0.17863306403160095,+-0.04814882576465607,+0.9827370047569275+],+"lens_mm": 25.43430519104004,+"fstop": 2.799999952316284,+"focus_cm": 349.39932376146317+},+{+"blender_frame": 310,+"matrix_world": [+[+0.2813414931297302,+-0.17954187095165253,+0.9426620602607727,+0.5169198513031006+],+[+0.959601879119873,+0.04921702295541763,+-0.2770232558250427,+1.9268568754196167+],+[+0.003342253854498267,+0.9825183153152466,+0.18613551557064056,+1.5646724700927734+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+51.69198513031006,+-192.68568754196167,+156.46724700927734+],+"forward": [+-0.9426620602607727,+-0.2770232558250427,+-0.18613551557064056+],+"up": [+-0.17954188585281372,+-0.04921703040599823,+0.9825184345245361+],+"lens_mm": 25.440204620361328,+"fstop": 2.799999952316284,+"focus_cm": 347.22935408353806+},+{+"blender_frame": 311,+"matrix_world": [+[+0.28082677721977234,+-0.180722177028656,+0.9425899386405945,+0.49051162600517273+],+[+0.9597556591033936,+0.05047128349542618,+-0.27626413106918335,+1.9320354461669922+],+[+0.0023533329367637634,+0.9822383522987366,+0.1876228004693985,+1.5660051107406616+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+49.05116260051727,+-193.20354461669922,+156.60051107406616+],+"forward": [+-0.942590057849884,+-0.27626416087150574,+-0.1876228302717209+],+"up": [+-0.180722177028656,+-0.05047128349542618,+0.9822383522987366+],+"lens_mm": 25.446083068847656,+"fstop": 2.799999952316284,+"focus_cm": 345.064128190279+},+{+"blender_frame": 312,+"matrix_world": [+[+0.2801913917064667,+-0.1823161542415619,+0.9424720406532288,+0.4645306468009949+],+[+0.9599433541297913,+0.05188366398215294,+-0.27534884214401245,+1.9377326965332031+],+[+0.0013016369193792343,+0.981870174407959,+0.1895505040884018,+1.5664780139923096+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+46.45306468009949,+-193.7732696533203,+156.64780139923096+],+"forward": [+-0.9424721598625183,+-0.27534887194633484,+-0.18955053389072418+],+"up": [+-0.1823161542415619,+-0.05188366398215294,+0.981870174407959+],+"lens_mm": 25.45194435119629,+"fstop": 2.799999952316284,+"focus_cm": 342.9036855697632+},+{+"blender_frame": 313,+"matrix_world": [+[+0.27941182255744934,+-0.184380903840065,+0.9423017501831055,+0.4390234649181366+],+[+0.9601714015007019,+0.05339698866009712,+-0.2742622196674347,+1.9440197944641113+],+[+0.0002526427269913256,+0.9814033508300781,+0.1919569969177246,+1.5659857988357544+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+43.90234649181366,+-194.40197944641113,+156.59857988357544+],+"forward": [+-0.942301869392395,+-0.2742622494697571,+-0.191957026720047+],+"up": [+-0.184380903840065,+-0.05339698866009712,+0.9814033508300781+],+"lens_mm": 25.45778465270996,+"fstop": 2.799999952316284,+"focus_cm": 340.7480627298355+},+{+"blender_frame": 314,+"matrix_world": [+[+0.27846428751945496,+-0.18687841296195984,+0.9420903325080872,+0.4139927923679352+],+[+0.9604464173316956,+0.054926082491874695,+-0.2729944884777069,+1.9509780406951904+],+[+-0.0007285618921741843,+0.9808462858200073,+0.1947816014289856,+1.5646538734436035+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+41.39927923679352,+-195.09780406951904,+156.46538734436035+],+"forward": [+-0.9420903325080872,+-0.2729944884777069,+-0.1947816014289856+],+"up": [+-0.18687842786312103,+-0.05492608994245529,+0.9808464050292969+],+"lens_mm": 25.463605880737305,+"fstop": 2.799999952316284,+"focus_cm": 338.596972823143+},+{+"blender_frame": 315,+"matrix_world": [+[+0.2773247957229614,+-0.1896861344575882,+0.9418652653694153,+0.3893986642360687+],+[+0.9607750177383423,+0.05636531487107277,+-0.27154093980789185,+1.9586960077285767+],+[+-0.0015809754841029644,+0.9802256226539612,+0.1978771835565567,+1.5628085136413574+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+38.93986642360687,+-195.86960077285767,+156.28085136413574+],+"forward": [+-0.9418652653694153,+-0.27154093980789185,+-0.1978771835565567+],+"up": [+-0.1896861344575882,+-0.05636531487107277,+0.9802256226539612+],+"lens_mm": 25.46940803527832,+"fstop": 2.799999952316284,+"focus_cm": 336.44986003637314+},+{+"blender_frame": 316,+"matrix_world": [+[+0.2759701609611511,+-0.1926257163286209,+0.9416664838790894,+0.3651704788208008+],+[+0.9611636400222778,+0.05760101601481438,+-0.2699012756347656,+1.9672640562057495+],+[+-0.0022510194685310125,+0.9795801043510437,+0.20104098320007324,+1.5609041452407837+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.51704788208008,+-196.72640562057495,+156.09041452407837+],+"forward": [+-0.9416666030883789,+-0.269901305437088,+-0.20104101300239563+],+"up": [+-0.1926257461309433,+-0.057601023465394974,+0.9795802235603333+],+"lens_mm": 25.475187301635742,+"fstop": 2.799999952316284,+"focus_cm": 334.3068465590477+},+{+"blender_frame": 317,+"matrix_world": [+[+0.2743953466415405,+-0.19548457860946655,+0.9415374994277954,+0.3415360748767853+],+[+0.9616132378578186,+0.05852548032999039,+-0.2680947780609131,+1.9766156673431396+],+[+-0.002695542760193348,+0.9789588451385498,+0.20403964817523956,+1.5594295263290405+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.15360748767853,+-197.66156673431396,+155.94295263290405+],+"forward": [+-0.941537618637085,+-0.2680948078632355,+-0.20403967797756195+],+"up": [+-0.19548460841178894,+-0.058525487780570984,+0.9789589643478394+],+"lens_mm": 25.48094940185547,+"fstop": 2.799999952316284,+"focus_cm": 332.2017177939415+},+{+"blender_frame": 318,+"matrix_world": [+[+0.2727421820163727,+-0.1980166733264923,+0.9414888024330139,+0.31957879662513733+],+[+0.9620828628540039,+0.05906911939382553,+-0.2662845551967621,+1.9859273433685303+],+[+-0.002884137909859419,+0.9784172177314758,+0.20661911368370056,+1.5588266849517822+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.957879662513733,+-198.59273433685303,+155.88266849517822+],+"forward": [+-0.9414888024330139,+-0.2662845551967621,+-0.20661911368370056+],+"up": [+-0.1980166733264923,+-0.05906911939382553,+0.9784172177314758+],+"lens_mm": 25.4866886138916,+"fstop": 2.799999952316284,+"focus_cm": 330.269119143486+},+{+"blender_frame": 319,+"matrix_world": [+[+0.27098748087882996,+-0.20020638406276703,+0.9415323734283447,+0.2975861132144928+],+[+0.9625788331031799,+0.05920867249369621,+-0.2644548714160919,+1.9957654476165771+],+[+-0.002801331225782633,+0.9779630899429321,+0.20875923335552216,+1.5592942237854004+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.75861132144928,+-199.57654476165771,+155.92942237854004+],+"forward": [+-0.9415323734283447,+-0.2644548714160919,+-0.20875923335552216+],+"up": [+-0.20020638406276703,+-0.05920867249369621,+0.9779630899429321+],+"lens_mm": 25.492406845092773,+"fstop": 2.799999952316284,+"focus_cm": 328.3366158604622+},+{+"blender_frame": 320,+"matrix_world": [+[+0.2691268026828766,+-0.20203419029712677,+0.9416754841804504,+0.27554282546043396+],+[+0.9631016254425049,+0.05893969163298607,+-0.26260489225387573,+2.006131649017334+],+[+-0.002446894533932209,+0.9776033163070679,+0.2104417085647583,+1.5608364343643188+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.554282546043396,+-200.6131649017334,+156.08364343643188+],+"forward": [+-0.94167560338974,+-0.2626049220561981,+-0.2104417383670807+],+"up": [+-0.20203419029712677,+-0.05893969163298607,+0.9776033163070679+],+"lens_mm": 25.498106002807617,+"fstop": 2.799999952316284,+"focus_cm": 326.40313655138016+},+{+"blender_frame": 321,+"matrix_world": [+[+0.26715919375419617,+-0.203569233417511,+0.9419052600860596,+0.25347623229026794+],+[+0.9636507034301758,+0.058299001306295395,+-0.2607271075248718,+2.0169992446899414+],+[+-0.001836112467572093,+0.9773232936859131,+0.2117447406053543,+1.5632290840148926+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+25.347623229026794,+-201.69992446899414,+156.32290840148926+],+"forward": [+-0.9419052600860596,+-0.2607271075248718,+-0.2117447406053543+],+"up": [+-0.203569233417511,+-0.058299001306295395,+0.9773232936859131+],+"lens_mm": 25.503782272338867,+"fstop": 2.799999952316284,+"focus_cm": 324.4669631123543+},+{+"blender_frame": 322,+"matrix_world": [+[+0.26508691906929016,+-0.20495112240314484,+0.9421910047531128,+0.23144987225532532+],+[+0.9642240405082703,+0.057357922196388245,+-0.25880908966064453,+2.0283172130584717+],+[+-0.0009989060927182436,+0.9770901203155518,+0.21282359957695007,+1.5660640001296997+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+23.14498722553253,+-202.83172130584717,+156.60640001296997+],+"forward": [+-0.9421911239624023,+-0.2588091194629669,+-0.21282362937927246+],+"up": [+-0.20495112240314484,+-0.057357922196388245,+0.9770901203155518+],+"lens_mm": 25.509435653686523,+"fstop": 2.799999952316284,+"focus_cm": 322.5263223052025+},+{+"blender_frame": 323,+"matrix_world": [+[+0.2629152834415436,+-0.2063569873571396,+0.9424926042556763,+0.2095481902360916+],+[+0.9648189544677734,+0.056210681796073914,+-0.2568361461162567,+2.04001784324646+],+[+2.177403075620532e-05,+0.9768608808517456,+0.21387577056884766,+1.5688347816467285+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+20.95481902360916,+-204.001784324646,+156.88347816467285+],+"forward": [+-0.9424926042556763,+-0.2568361461162567,+-0.21387577056884766+],+"up": [+-0.2063569873571396,+-0.056210681796073914,+0.9768608808517456+],+"lens_mm": 25.51506996154785,+"fstop": 2.799999952316284,+"focus_cm": 320.57979106903076+},+{+"blender_frame": 324,+"matrix_world": [+[+0.2607240080833435,+-0.2079593688249588,+0.9427491426467896,+0.18785563111305237+],+[+0.9654125571250916,+0.054960187524557114,+-0.25486817955970764,+2.0520236492156982+],+[+0.0011885614367201924,+0.9765922427177429,+0.21509604156017303,+1.5710431337356567+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+18.785563111305237,+-205.20236492156982,+157.10431337356567+],+"forward": [+-0.9427491426467896,+-0.25486817955970764,+-0.21509604156017303+],+"up": [+-0.2079593688249588,+-0.054960187524557114,+0.9765922427177429+],+"lens_mm": 25.520679473876953,+"fstop": 2.799999952316284,+"focus_cm": 318.6274141073227+},+{+"blender_frame": 325,+"matrix_world": [+[+0.2590363621711731,+-0.20988503098487854,+0.9427875876426697,+0.16643483936786652+],+[+0.9658642411231995,+0.05370377376675606,+-0.2534211277961731,+2.0642542839050293+],+[+0.0025580511428415775,+0.9762499928474426,+0.2166316658258438,+1.572304368019104+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+16.64348393678665,+-206.42542839050293,+157.2304368019104+],+"forward": [+-0.9427875876426697,+-0.2534211277961731,+-0.2166316658258438+],+"up": [+-0.20988506078720093,+-0.053703781217336655,+0.9762501120567322+],+"lens_mm": 25.526268005371094,+"fstop": 2.799999952316284,+"focus_cm": 316.67108088731766+},+{+"blender_frame": 326,+"matrix_world": [+[+0.25780177116394043,+-0.2121836096048355,+0.9426113963127136,+0.14530929923057556+],+[+0.966189444065094,+0.05252143740653992,+-0.25242751836776733,+2.0766375064849854+],+[+0.00405367836356163,+0.9758174419403076,+0.21854965388774872,+1.5724269151687622+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+14.530929923057556,+-207.66375064849854,+157.24269151687622+],+"forward": [+-0.9426115155220032,+-0.2524275481700897,+-0.2185496836900711+],+"up": [+-0.2121836096048355,+-0.05252143740653992,+0.9758174419403076+],+"lens_mm": 25.53183364868164,+"fstop": 2.799999952316284,+"focus_cm": 314.7104814648628+},+{+"blender_frame": 327,+"matrix_world": [+[+0.25683391094207764,+-0.21481241285800934,+0.9422801733016968,+0.12445349991321564+],+[+0.9664396643638611,+0.051470618695020676,+-0.25168508291244507,+2.089110851287842+],+[+0.005565335042774677,+0.9752980470657349,+0.22082260251045227,+1.5714510679244995+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+12.445349991321564,+-208.91108512878418,+157.14510679244995+],+"forward": [+-0.9422802925109863,+-0.25168511271476746,+-0.22082263231277466+],+"up": [+-0.21481244266033173,+-0.05147062614560127,+0.9752981662750244+],+"lens_mm": 25.537376403808594,+"fstop": 2.799999952316284,+"focus_cm": 312.74462044239044+},+{+"blender_frame": 328,+"matrix_world": [+[+0.2559468448162079,+-0.2176428586244583,+0.9418719410896301,+0.10379412025213242+],+[+0.9666656255722046,+0.05058354139328003,+-0.25099578499794006,+2.1016266345977783+],+[+0.006984223145991564,+0.97471684217453,+0.22333456575870514,+1.569636583328247+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+10.379412025213242,+-210.16266345977783,+156.9636583328247+],+"forward": [+-0.9418719410896301,+-0.25099578499794006,+-0.22333456575870514+],+"up": [+-0.2176428586244583,+-0.05058354139328003,+0.97471684217453+],+"lens_mm": 25.542896270751953,+"fstop": 2.799999952316284,+"focus_cm": 310.7724368572235+},+{+"blender_frame": 329,+"matrix_world": [+[+0.2549551725387573,+-0.22048573195934296,+0.9414795637130737,+0.08322189748287201+],+[+0.9669180512428284,+0.049869831651449203,+-0.25016486644744873,+2.114149570465088+],+[+0.008206360042095184,+0.9741144776344299,+0.22590619325637817,+1.5674028396606445+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+8.322189748287201,+-211.4149570465088,+156.74028396606445+],+"forward": [+-0.9414796829223633,+-0.2501648962497711,+-0.22590622305870056+],+"up": [+-0.22048573195934296,+-0.049869831651449203,+0.9741144776344299+],+"lens_mm": 25.548391342163086,+"fstop": 2.799999952316284,+"focus_cm": 308.7936609983444+},+{+"blender_frame": 330,+"matrix_world": [+[+0.25367221236228943,+-0.22313030064105988,+0.9412031173706055,+0.06261155754327774+],+[+0.9672471880912781,+0.049323439598083496,+-0.2489984929561615,+2.1266558170318604+],+[+0.009135734289884567,+0.9735399484634399,+0.22833412885665894,+1.5652356147766113+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+6.261155754327774,+-212.66558170318604,+156.52356147766113+],+"forward": [+-0.9412031173706055,+-0.2489984929561615,+-0.22833412885665894+],+"up": [+-0.22313033044338226,+-0.04932344704866409,+0.9735400676727295+],+"lens_mm": 25.553865432739258,+"fstop": 2.799999952316284,+"focus_cm": 306.8086013197899+},+{+"blender_frame": 331,+"matrix_world": [+[+0.25191062688827515,+-0.22538824379444122,+0.9411383271217346,+0.041846152395009995+],+[+0.9677019119262695,+0.04893230274319649,+-0.2473023384809494,+2.1391263008117676+],+[+0.009686966426670551,+0.9730393290519714,+0.23043528199195862,+1.5635782480239868+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+4.1846152395009995,+-213.91263008117676,+156.35782480239868+],+"forward": [+-0.9411382079124451,+-0.24730230867862701,+-0.23043525218963623+],+"up": [+-0.2253882735967636,+-0.048932310193777084,+0.973039448261261+],+"lens_mm": 25.55931282043457,+"fstop": 2.799999952316284,+"focus_cm": 304.8183351755142+},+{+"blender_frame": 332,+"matrix_world": [+[+0.24948032200336456,+-0.22713381052017212,+0.9413658976554871,+0.020840514451265335+],+[+0.9683303833007812,+0.04868775233626366,+-0.24487900733947754,+2.151545286178589+],+[+0.009787309914827347,+0.9726457595825195,+0.23208722472190857,+1.5627340078353882+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+2.0840514451265335,+-215.1545286178589,+156.27340078353882+],+"forward": [+-0.9413660168647766,+-0.24487903714179993,+-0.23208725452423096+],+"up": [+-0.22713381052017212,+-0.04868775233626366,+0.9726457595825195+],+"lens_mm": 25.564739227294922,+"fstop": 2.799999952316284,+"focus_cm": 302.823668718338+},+{+"blender_frame": 333,+"matrix_world": [+[+0.24666757881641388,+-0.22833050787448883,+0.9418176412582397,+-0.0004413297865539789+],+[+0.9690537452697754,+0.048592060804367065,+-0.2420203685760498,+2.1638948917388916+],+[+0.009495771490037441,+0.9723702669143677,+0.23325058817863464,+1.5627995729446411+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-0.04413297865539789,+-216.38948917388916,+156.2799572944641+],+"forward": [+-0.9418176412582397,+-0.2420203685760498,+-0.23325058817863464+],+"up": [+-0.22833053767681122,+-0.04859206825494766,+0.9723703861236572+],+"lens_mm": 25.570138931274414,+"fstop": 2.799999952316284,+"focus_cm": 300.8245661854744+},+{+"blender_frame": 334,+"matrix_world": [+[+0.2438410222530365,+-0.22904008626937866,+0.9423810839653015,+-0.021979045122861862+],+[+0.9697743654251099,+0.04865686222910881,+-0.23910322785377502,+2.1761560440063477+],+[+0.008910918608307838,+0.9722001552581787,+0.23398172855377197,+1.5636415481567383+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-2.197904512286186,+-217.61560440063477,+156.36415481567383+],+"forward": [+-0.9423812031745911,+-0.2391032576560974,+-0.23398175835609436+],+"up": [+-0.22904008626937866,+-0.04865686222910881,+0.9722001552581787+],+"lens_mm": 25.575515747070312,+"fstop": 2.799999952316284,+"focus_cm": 298.8203227519989+},+{+"blender_frame": 335,+"matrix_world": [+[+0.24100206792354584,+-0.22941191494464874,+0.9430207014083862,+-0.04370010271668434+],+[+0.9704911708831787,+0.04889850690960884,+-0.23612678050994873,+2.18830943107605+],+[+0.008057994768023491,+0.9721003174781799,+0.23442688584327698,+1.5649280548095703+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-4.370010271668434,+-218.83094310760498,+156.49280548095703+],+"forward": [+-0.9430208206176758,+-0.23612681031227112,+-0.23442691564559937+],+"up": [+-0.22941194474697113,+-0.04889851436018944,+0.9721004366874695+],+"lens_mm": 25.58086585998535,+"fstop": 2.799999952316284,+"focus_cm": 296.81003391742706+},+{+"blender_frame": 336,+"matrix_world": [+[+0.23814831674098969,+-0.2296527475118637,+0.9436869025230408,+-0.06549539417028427+],+[+0.9712038636207581,+0.04933100566267967,+-0.23308739066123962,+2.2003390789031982+],+[+0.006976129021495581,+0.9720216393470764,+0.2347876876592636,+1.566199779510498+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-6.549539417028427,+-220.03390789031982,+156.6199779510498+],+"forward": [+-0.9436870217323303,+-0.233087420463562,+-0.234787717461586+],+"up": [+-0.2296527475118637,+-0.04933100566267967,+0.9720216393470764+],+"lens_mm": 25.586193084716797,+"fstop": 2.799999952316284,+"focus_cm": 294.7933405637741+},+{+"blender_frame": 337,+"matrix_world": [+[+0.23527520895004272,+-0.22998486459255219,+0.9443264603614807,+-0.08724218606948853+],+[+0.9719120860099792,+0.049957290291786194,+-0.2299812287092209,+2.2122368812561035+],+[+0.005716209765523672,+0.9719112515449524,+0.23527872562408447,+1.5669713020324707+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-8.724218606948853,+-221.22368812561035,+156.69713020324707+],+"forward": [+-0.9443265795707703,+-0.22998125851154327,+-0.23527875542640686+],+"up": [+-0.2299848347902298,+-0.0499572828412056,+0.9719111323356628+],+"lens_mm": 25.591493606567383,+"fstop": 2.799999952316284,+"focus_cm": 292.77088195085526+},+{+"blender_frame": 338,+"matrix_world": [+[+0.23237623274326324,+-0.23060229420661926,+0.9448935985565186,+-0.10883048921823502+],+[+0.9726163148880005,+0.05076108127832413,+-0.22680573165416718,+2.2240076065063477+],+[+0.0043381028808653355,+0.971723198890686,+0.2360832244157791,+1.5668386220932007+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-10.883048921823502,+-222.40076065063477,+156.68386220932007+],+"forward": [+-0.9448935985565186,+-0.22680573165416718,+-0.2360832244157791+],+"up": [+-0.23060229420661926,+-0.05076108127832413,+0.971723198890686+],+"lens_mm": 25.596769332885742,+"fstop": 2.799999952316284,+"focus_cm": 290.7440707087517+},+{+"blender_frame": 339,+"matrix_world": [+[+0.22944292426109314,+-0.23163238167762756,+0.9453582763671875,+-0.13018637895584106+],+[+0.9733178019523621,+0.05170154571533203,+-0.22356083989143372,+2.235671281814575+],+[+0.0029074482154101133,+0.9714285135269165,+0.23731446266174316,+1.5655677318572998+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-13.018637895584106,+-223.56712818145752,+156.55677318572998+],+"forward": [+-0.945358395576477,+-0.2235608696937561,+-0.23731449246406555+],+"up": [+-0.23163238167762756,+-0.05170154571533203,+0.9714285135269165+],+"lens_mm": 25.602018356323242,+"fstop": 2.799999952316284,+"focus_cm": 288.71457427740097+},+{+"blender_frame": 340,+"matrix_world": [+[+0.22646644711494446,+-0.23311272263526917,+0.945712149143219,+-0.15128767490386963+],+[+0.9740179181098938,+0.05271298438310623,+-0.22025126218795776,+2.247265100479126+],+[+0.0014920555986464024,+0.9710199236869812,+0.23899370431900024,+1.5631479024887085+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-15.128767490386963,+-224.7265100479126,+156.31479024887085+],+"forward": [+-0.945712149143219,+-0.22025126218795776,+-0.23899370431900024+],+"up": [+-0.23311275243759155,+-0.05271299183368683,+0.9710200428962708+],+"lens_mm": 25.607242584228516,+"fstop": 2.799999952316284,+"focus_cm": 286.68330162763596+},+{+"blender_frame": 341,+"matrix_world": [+[+0.22343775629997253,+-0.23498785495758057,+0.9459683895111084,+-0.1721683293581009+],+[+0.9747182726860046,+0.05370941385626793,+-0.21688644587993622,+2.258838415145874+],+[+0.00015827640891075134,+0.9705132842063904,+0.24104763567447662,+1.5597959756851196+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-17.21683293581009,+-225.8838415145874,+155.97959756851196+],+"forward": [+-0.945968508720398,+-0.2168864756822586,+-0.241047665476799+],+"up": [+-0.23498785495758057,+-0.05370941385626793,+0.9705132842063904+],+"lens_mm": 25.61244010925293,+"fstop": 2.799999952316284,+"focus_cm": 284.6505880355835+},+{+"blender_frame": 342,+"matrix_world": [+[+0.22034868597984314,+-0.23712579905986786,+0.9461596012115479,+-0.19291019439697266+],+[+0.9754205942153931,+0.05459382385015488,+-0.21348099410533905,+2.2704498767852783+],+[+-0.001032620551995933,+0.9699438810348511,+0.2433270812034607,+1.5559101104736328+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-19.291019439697266,+-227.04498767852783,+155.59101104736328+],+"forward": [+-0.9461594820022583,+-0.21348096430301666,+-0.2433270514011383+],+"up": [+-0.23712576925754547,+-0.05459381639957428,+0.9699437618255615+],+"lens_mm": 25.617612838745117,+"fstop": 2.799999952316284,+"focus_cm": 282.6161727309227+},+{+"blender_frame": 343,+"matrix_world": [+[+0.21719296276569366,+-0.2393520623445511,+0.9463286995887756,+-0.21362435817718506+],+[+0.9761266708374023,+0.055270642042160034,+-0.2100524753332138,+2.282158851623535+],+[+-0.0020277025178074837,+0.9693583846092224,+0.24564234912395477,+1.5519869327545166+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-21.362435817718506,+-228.21588516235352,+155.19869327545166+],+"forward": [+-0.9463285803794861,+-0.21005244553089142,+-0.24564231932163239+],+"up": [+-0.23935209214687347,+-0.05527064949274063,+0.969358503818512+],+"lens_mm": 25.622756958007812,+"fstop": 2.799999952316284,+"focus_cm": 280.5795505642891+},+{+"blender_frame": 344,+"matrix_world": [+[+0.21396614611148834,+-0.2414914220571518,+0.9465200901031494,+-0.23442573845386505+],+[+0.9768370985984802,+0.05565852299332619,+-0.20661893486976624,+2.2940170764923096+],+[+-0.0027852123603224754,+0.9688054323196411,+0.24780681729316711,+1.5485137701034546+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-23.442573845386505,+-229.40170764923096,+154.85137701034546+],+"forward": [+-0.946520209312439,+-0.20661896467208862,+-0.2478068470954895+],+"up": [+-0.24149145185947418,+-0.055658530443906784,+0.9688055515289307+],+"lens_mm": 25.62787437438965,+"fstop": 2.799999952316284,+"focus_cm": 278.5408206284046+},+{+"blender_frame": 345,+"matrix_world": [+[+0.21066726744174957,+-0.2434099167585373,+0.9467686414718628,+-0.2554062306880951+],+[+0.9775524735450745,+0.055701836943626404,+-0.20319628715515137,+2.3060598373413086+],+[+-0.003276768373325467,+0.96832275390625,+0.24968047440052032,+1.545867681503296+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-25.54062306880951,+-230.60598373413086,+154.5867681503296+],+"forward": [+-0.9467687606811523,+-0.20319631695747375,+-0.2496805042028427+],+"up": [+-0.2434099167585373,+-0.055701836943626404,+0.96832275390625+],+"lens_mm": 25.632966995239258,+"fstop": 2.799999952316284,+"focus_cm": 276.5004098415375+},+{+"blender_frame": 346,+"matrix_world": [+[+0.20729823410511017,+-0.24504701793193817,+0.9470899701118469,+-0.27661335468292236+],+[+0.9782716035842896,+0.055378008633852005,+-0.19979488849639893,+2.3183021545410156+],+[+-0.0034888144582509995,+0.9679281711578369,+0.2512023448944092,+1.5442330837249756+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-27.661335468292236,+-231.83021545410156,+154.42330837249756+],+"forward": [+-0.9470899701118469,+-0.19979488849639893,+-0.2512023448944092+],+"up": [+-0.24504707753658295,+-0.0553780235350132,+0.967928409576416+],+"lens_mm": 25.638031005859375,+"fstop": 2.799999952316284,+"focus_cm": 274.45881739258766+},+{+"blender_frame": 347,+"matrix_world": [+[+0.20386432111263275,+-0.24643120169639587,+0.9474761486053467,+-0.2980373501777649+],+[+0.9789931774139404,+0.05470000207424164,+-0.1964186429977417,+2.330735445022583+],+[+-0.003423272166401148,+0.9676153063774109,+0.25240588188171387,+1.5435664653778076+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-29.80373501777649,+-233.0735445022583,+154.35664653778076+],+"forward": [+-0.9474761486053467,+-0.1964186429977417,+-0.25240588188171387+],+"up": [+-0.24643123149871826,+-0.054700009524822235,+0.9676154255867004+],+"lens_mm": 25.64306640625,+"fstop": 2.799999952316284,+"focus_cm": 272.4168427288532+},+{+"blender_frame": 348,+"matrix_world": [+[+0.20037460327148438,+-0.24767526984214783,+0.9478961229324341,+-0.31961220502853394+],+[+0.9797145128250122,+0.05371358245611191,+-0.19306586682796478,+2.3433279991149902+],+[+-0.0030972540844231844,+0.9673529863357544,+0.2534138560295105,+1.5436077117919922+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-31.961220502853394,+-234.33279991149902,+154.36077117919922+],+"forward": [+-0.9478961229324341,+-0.19306586682796478,+-0.2534138560295105+],+"up": [+-0.24767526984214783,+-0.05371358245611191,+0.9673529863357544+],+"lens_mm": 25.648075103759766,+"fstop": 2.799999952316284,+"focus_cm": 270.37525698542595+},+{+"blender_frame": 349,+"matrix_world": [+[+0.19684180617332458,+-0.24895252287387848,+0.9483016729354858,+-0.3412281274795532+],+[+0.9804319739341736,+0.05248986557126045,+-0.18973132967948914,+2.356029510498047+],+[+-0.002542137634009123,+0.9670923352241516,+0.2544131875038147,+1.543938159942627+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-34.12281274795532,+-235.6029510498047,+154.3938159942627+],+"forward": [+-0.9483016729354858,+-0.18973132967948914,+-0.2544131875038147+],+"up": [+-0.24895252287387848,+-0.05248986557126045,+0.9670923352241516+],+"lens_mm": 25.653057098388672,+"fstop": 2.799999952316284,+"focus_cm": 268.3356173336506+},+{+"blender_frame": 350,+"matrix_world": [+[+0.1932816356420517,+-0.25045958161354065,+0.9486370086669922,+-0.3627550005912781+],+[+0.9811417460441589,+0.05111497640609741,+-0.18640892207622528,+2.3687779903411865+],+[+-0.0018016549292951822,+0.9667766690254211,+0.25561589002609253,+1.5440754890441895+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-36.27550005912781,+-236.87779903411865,+154.40754890441895+],+"forward": [+-0.9486371278762817,+-0.18640893697738647,+-0.2556159198284149+],+"up": [+-0.25045961141586304,+-0.05111498385667801,+0.9667767882347107+],+"lens_mm": 25.658008575439453,+"fstop": 2.799999952316284,+"focus_cm": 266.30023643374443+},+{+"blender_frame": 351,+"matrix_world": [+[+0.18971198797225952,+-0.2523724138736725,+0.9488506317138672,+-0.3840698301792145+],+[+0.9818394184112549,+0.049678415060043335,+-0.18309438228607178,+2.3815088272094727+],+[+-0.0009294301271438599,+0.9663540124893188,+0.2572137415409088,+1.5435800552368164+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-38.40698301792145,+-238.15088272094727,+154.35800552368164+],+"forward": [+-0.9488506317138672,+-0.18309438228607178,+-0.2572137415409088+],+"up": [+-0.2523724436759949,+-0.04967842251062393,+0.9663541316986084+],+"lens_mm": 25.662933349609375,+"fstop": 2.799999952316284,+"focus_cm": 264.27173241972923+},+{+"blender_frame": 352,+"matrix_world": [+[+0.18615299463272095,+-0.2548065483570099,+0.9489050507545471,+-0.40508410334587097+],+[+0.9825207591056824,+0.04826298728585243,+-0.17978769540786743,+2.394160509109497+],+[+1.4089047908782959e-05,+0.9657869338989258,+0.2593369483947754,+1.5421513319015503+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-40.5084103345871,+-239.4160509109497,+154.21513319015503+],+"forward": [+-0.9489050507545471,+-0.17978769540786743,+-0.2593369483947754+],+"up": [+-0.2548065483570099,+-0.04826298728585243,+0.9657869338989258+],+"lens_mm": 25.667829513549805,+"fstop": 2.799999952316284,+"focus_cm": 262.25271821022034+},+{+"blender_frame": 353,+"matrix_world": [+[+0.18262502551078796,+-0.257790207862854,+0.9487846493721008,+-0.42576318979263306+],+[+0.9831821322441101,+0.04693695530295372,+-0.17649294435977936,+2.4066834449768066+],+[+0.0009650830179452896,+0.9650602340698242,+0.2620265781879425,+1.5396945476531982+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-42.576318979263306,+-240.66834449768066,+153.96945476531982+],+"forward": [+-0.9487846493721008,+-0.17649294435977936,+-0.2620265781879425+],+"up": [+-0.257790207862854,+-0.04693695530295372,+0.9650602340698242+],+"lens_mm": 25.672697067260742,+"fstop": 2.799999952316284,+"focus_cm": 260.24444699287415+},+{+"blender_frame": 354,+"matrix_world": [+[+0.1791488528251648,+-0.26125621795654297,+0.9484992027282715,+-0.44613438844680786+],+[+0.9838201999664307,+0.04575056955218315,+-0.1732185035943985,+2.4190399646759033+],+[+0.0018600381445139647,+0.9641846418380737,+0.26522529125213623,+1.5363426208496094+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-44.613438844680786,+-241.90399646759033,+153.63426208496094+],+"forward": [+-0.948499321937561,+-0.1732185184955597,+-0.2652253210544586+],+"up": [+-0.26125624775886536,+-0.04575057327747345,+0.9641847610473633+],+"lens_mm": 25.677536010742188,+"fstop": 2.799999952316284,+"focus_cm": 258.24718326330185+},+{+"blender_frame": 355,+"matrix_world": [+[+0.17574384808540344,+-0.26505452394485474,+0.9480823874473572,+-0.46628138422966003+],+[+0.9844323992729187,+0.04473600909113884,+-0.1699751615524292,+2.4312071800231934+],+[+0.0026392689906060696,+0.9631950855255127,+0.2687903046607971,+1.5324254035949707+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-46.628138422966,+-243.12071800231934,+153.24254035949707+],+"forward": [+-0.9480823874473572,+-0.1699751615524292,+-0.2687903046607971+],+"up": [+-0.2650545537471771,+-0.04473601281642914,+0.9631952047348022+],+"lens_mm": 25.682344436645508,+"fstop": 2.799999952316284,+"focus_cm": 256.26023411750793+},+{+"blender_frame": 356,+"matrix_world": [+[+0.1724269539117813,+-0.268982470035553,+0.9475850462913513,+-0.486325204372406+],+[+0.9850170016288757,+0.043910399079322815,+-0.16677379608154297,+2.443176746368408+],+[+0.0032503968104720116,+0.9621437191963196,+0.2725236117839813,+1.528398036956787+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-48.6325204372406,+-244.31767463684082,+152.8398036956787+],+"forward": [+-0.9475850462913513,+-0.16677379608154297,+-0.2725236117839813+],+"up": [+-0.2689824402332306,+-0.043910395354032516,+0.96214359998703+],+"lens_mm": 25.687124252319336,+"fstop": 2.799999952316284,+"focus_cm": 254.28296253085136+},+{+"blender_frame": 357,+"matrix_world": [+[+0.16921161115169525,+-0.27282780408859253,+0.9470651149749756,+-0.5063968300819397+],+[+0.9855729937553406,+0.043280813843011856,+-0.16362357139587402,+2.454946756362915+],+[+0.003651311155408621,+0.9610887169837952,+0.2762153446674347,+1.5247397422790527+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-50.63968300819397,+-245.4946756362915,+152.47397422790527+],+"forward": [+-0.9470652341842651,+-0.16362358629703522,+-0.2762153744697571+],+"up": [+-0.2728278338909149,+-0.043280817568302155,+0.9610888361930847+],+"lens_mm": 25.691875457763672,+"fstop": 2.799999952316284,+"focus_cm": 252.3154854774475+},+{+"blender_frame": 358,+"matrix_world": [+[+0.16610778868198395,+-0.2764121890068054,+0.9465751647949219,+-0.5266066193580627+],+[+0.9861001968383789,+0.042849477380514145,+-0.1605311781167984,+2.4665210247039795+],+[+0.0038125254213809967,+0.9600834250450134,+0.279687762260437,+1.521849274635315+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-52.660661935806274,+-246.65210247039795,+152.1849274635315+],+"forward": [+-0.9465751647949219,+-0.1605311781167984,+-0.279687762260437+],+"up": [+-0.2764121890068054,+-0.042849477380514145,+0.9600834250450134+],+"lens_mm": 25.696596145629883,+"fstop": 2.799999952316284,+"focus_cm": 250.35862624645233+},+{+"blender_frame": 359,+"matrix_world": [+[+0.16311995685100555,+-0.2796279788017273,+0.9461501240730286,+-0.5470176339149475+],+[+0.986599326133728,+0.042617011815309525,+-0.15749835968017578,+2.477905750274658+],+[+0.0037188592832535505,+0.9591621160507202,+0.28283244371414185,+1.5199565887451172+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-54.70176339149475,+-247.79057502746582,+151.99565887451172+],+"forward": [+-0.9461501240730286,+-0.15749835968017578,+-0.28283244371414185+],+"up": [+-0.2796279788017273,+-0.042617011815309525,+0.9591621160507202+],+"lens_mm": 25.70128631591797,+"fstop": 2.799999952316284,+"focus_cm": 248.41388911008835+},+{+"blender_frame": 360,+"matrix_world": [+[+0.1602478176355362,+-0.2824593484401703,+0.9457998275756836,+-0.5676283836364746+],+[+0.9870710968971252,+0.04258422553539276,+-0.1545228511095047,+2.4891042709350586+],+[+0.0033702689688652754,+0.9583335518836975,+0.2856314778327942,+1.5190718173980713+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-56.76283836364746,+-248.91042709350586,+151.90718173980713+],+"forward": [+-0.9457998275756836,+-0.1545228511095047,+-0.2856314778327942+],+"up": [+-0.2824593782424927,+-0.04258422926068306,+0.9583336710929871+],+"lens_mm": 25.70594596862793,+"fstop": 2.799999952316284,+"focus_cm": 246.48276902735233+},+{+"blender_frame": 361,+"matrix_world": [+[+0.15748527646064758,+-0.2849835157394409,+0.9455065727233887,+-0.5883688926696777+],+[+0.9875175356864929,+0.04275057092308998,+-0.1515972763299942,+2.5001230239868164+],+[+0.0027817762456834316,+0.9575785994529724,+0.28815874457359314,+1.518984317779541+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-58.83688926696777,+-250.01230239868164,+151.8984317779541+],+"forward": [+-0.9455066919326782,+-0.1515972912311554,+-0.2881587743759155+],+"up": [+-0.2849835157394409,+-0.04275057092308998,+0.9575785994529724+],+"lens_mm": 25.7105770111084,+"fstop": 2.799999952316284,+"focus_cm": 244.56672184169292+},+{+"blender_frame": 362,+"matrix_world": [+[+0.15482141077518463,+-0.2873513996601105,+0.9452298879623413,+-0.6091134548187256+],+[+0.9879405498504639,+0.04311102628707886,+-0.14871124923229218,+2.510967493057251+],+[+0.001982556190341711,+0.9568544626235962,+0.29056066274642944,+1.5193055868148804+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-60.91134548187256,+-251.0967493057251,+151.93055868148804+],+"forward": [+-0.9452298879623413,+-0.14871124923229218,+-0.29056066274642944+],+"up": [+-0.28735142946243286,+-0.043111030012369156,+0.9568545818328857+],+"lens_mm": 25.71517562866211,+"fstop": 2.799999952316284,+"focus_cm": 242.66683235764503+},+{+"blender_frame": 363,+"matrix_world": [+[+0.15224005281925201,+-0.289754182100296,+0.9449155926704407,+-0.6297031044960022+],+[+0.9883430600166321,+0.04365134984254837,+-0.14585135877132416,+2.521651029586792+],+[+0.001014199573546648,+0.9561051726341248,+0.2930220067501068,+1.5195566415786743+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-62.97031044960022,+-252.1651029586792,+151.95566415786743+],+"forward": [+-0.9449155926704407,+-0.14585135877132416,+-0.2930220067501068+],+"up": [+-0.289754182100296,+-0.04365134984254837,+0.9561051726341248+],+"lens_mm": 25.719743728637695,+"fstop": 2.799999952316284,+"focus_cm": 240.7843455672264+},+{+"blender_frame": 364,+"matrix_world": [+[+0.14972145855426788,+-0.2923782467842102,+0.9445096254348755,+-0.6499769687652588+],+[+0.9887282848358154,+0.04434369504451752,+-0.14300401508808136,+2.532193899154663+],+[+-7.1775633841753e-05,+0.9552741050720215,+0.29572179913520813,+1.5192687511444092+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-64.99769687652588,+-253.2193899154663,+151.92687511444092+],+"forward": [+-0.9445096254348755,+-0.14300401508808136,+-0.29572179913520813+],+"up": [+-0.2923782467842102,+-0.04434369504451752,+0.9552741050720215+],+"lens_mm": 25.72428321838379,+"fstop": 2.799999952316284,+"focus_cm": 238.92049565911293+},+{+"blender_frame": 365,+"matrix_world": [+[+0.14724208414554596,+-0.2953651249408722,+0.9439700245857239,+-0.6698043346405029+],+[+0.9890998005867004,+0.04514358565211296,+-0.14015623927116394,+2.5426294803619385+],+[+-0.0012169351102784276,+0.9543173313140869,+0.2987925708293915,+1.5180840492248535+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-66.9804334640503,+-254.26294803619385,+151.80840492248535+],+"forward": [+-0.9439699053764343,+-0.14015622437000275,+-0.2987925410270691+],+"up": [+-0.2953651249408722,+-0.04514358565211296,+0.9543173313140869+],+"lens_mm": 25.728788375854492,+"fstop": 2.799999952316284,+"focus_cm": 237.0762176811695+},+{+"blender_frame": 366,+"matrix_world": [+[+0.14477656781673431,+-0.29877927899360657,+0.943276584148407,+-0.6891099214553833+],+[+0.9894615411758423,+0.045989878475666046,+-0.13729803264141083,+2.553002119064331+],+[+-0.002359372330829501,+0.9532134532928467,+0.30228886008262634,+1.5158312320709229+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-68.91099214553833,+-255.3002119064331,+151.58312320709229+],+"forward": [+-0.943276584148407,+-0.13729803264141083,+-0.30228886008262634+],+"up": [+-0.29877927899360657,+-0.045989878475666046,+0.9532134532928467+],+"lens_mm": 25.733264923095703,+"fstop": 2.799999952316284,+"focus_cm": 235.2518443018198+},+{+"blender_frame": 367,+"matrix_world": [+[+0.14229831099510193,+-0.3025939166545868,+0.9424372315406799,+-0.7078878283500671+],+[+0.9898178577423096,+0.0468074306845665,+-0.13442353904247284,+2.5633671283721924+],+[+-0.0034373251255601645,+0.951969563961029,+0.30617350339889526,+1.5125566720962524+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-70.78878283500671,+-256.33671283721924,+151.25566720962524+],+"forward": [+-0.9424373507499695,+-0.13442355394363403,+-0.30617353320121765+],+"up": [+-0.3025939166545868,+-0.0468074306845665,+0.951969563961029+],+"lens_mm": 25.737707138061523,+"fstop": 2.799999952316284,+"focus_cm": 233.4469810128212+},+{+"blender_frame": 368,+"matrix_world": [+[+0.13978078961372375,+-0.3066967725753784,+0.941487193107605,+-0.7262001037597656+],+[+0.9901727437973022,+0.047513097524642944,+-0.1315312385559082,+2.5737850666046143+],+[+-0.004392771515995264,+0.9506205916404724,+0.31032419204711914,+1.50851309299469+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-72.62001037597656,+-257.3785066604614,+150.851309299469+],+"forward": [+-0.9414874315261841,+-0.1315312683582306,+-0.3103242516517639+],+"up": [+-0.3066968023777008,+-0.04751310497522354,+0.950620710849762+],+"lens_mm": 25.74212074279785,+"fstop": 2.799999952316284,+"focus_cm": 231.6611658781767+},+{+"blender_frame": 369,+"matrix_world": [+[+0.13719947636127472,+-0.3109142780303955,+0.9404832124710083,+-0.744161069393158+],+[+0.9905299544334412,+0.048024050891399384,+-0.12862412631511688,+2.5843160152435303+],+[+-0.005174737423658371,+0.9492238759994507,+0.3145587742328644,+1.5040982961654663+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-74.4161069393158,+-258.431601524353,+150.40982961654663+],+"forward": [+-0.9404832124710083,+-0.12862412631511688,+-0.3145587742328644+],+"up": [+-0.3109143078327179,+-0.04802405834197998,+0.9492239952087402+],+"lens_mm": 25.74650001525879,+"fstop": 2.799999952316284,+"focus_cm": 229.89404015243053+},+{+"blender_frame": 370,+"matrix_world": [+[+0.13453170657157898,+-0.3150482773780823,+0.9394923448562622,+-0.7619120478630066+],+[+0.9908926486968994,+0.048266224563121796,+-0.1257065087556839,+2.5950124263763428+],+[+-0.005742126144468784,+0.9478474855422974,+0.31867238879203796,+1.4997689723968506+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-76.19120478630066,+-259.5012426376343,+149.97689723968506+],+"forward": [+-0.9394923448562622,+-0.1257065087556839,+-0.31867238879203796+],+"up": [+-0.31504830718040466,+-0.04826623201370239,+0.9478476047515869+],+"lens_mm": 25.7508487701416,+"fstop": 2.799999952316284,+"focus_cm": 228.14614921808243+},+{+"blender_frame": 371,+"matrix_world": [+[+0.1317586600780487,+-0.3189171254634857,+0.9385795593261719,+-0.7795878648757935+],+[+0.9912633299827576,+0.04818284884095192,+-0.12278255075216293,+2.6059131622314453+],+[+-0.006065974477678537,+0.9465569257736206,+0.32247939705848694,+1.4959405660629272+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-77.95878648757935,+-260.59131622314453,+149.59405660629272+],+"forward": [+-0.9385795593261719,+-0.12278255075216293,+-0.32247939705848694+],+"up": [+-0.3189172148704529,+-0.048182860016822815,+0.9465571641921997+],+"lens_mm": 25.755163192749023,+"fstop": 2.799999952316284,+"focus_cm": 226.41878351569176+},+{+"blender_frame": 372,+"matrix_world": [+[+0.12886594235897064,+-0.32239222526550293,+0.9377935528755188,+-0.7972897291183472+],+[+0.9916430711746216,+0.047740526497364044,+-0.11985350400209427,+2.6170363426208496+],+[+-0.006130922585725784,+0.9454016089439392,+0.32585009932518005,+1.4929009675979614+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-79.72897291183472,+-261.70363426208496,+149.29009675979614+],+"forward": [+-0.9377936720848083,+-0.11985351890325546,+-0.32585012912750244+],+"up": [+-0.32239222526550293,+-0.047740526497364044,+0.9454016089439392+],+"lens_mm": 25.75944709777832,+"fstop": 2.799999952316284,+"focus_cm": 224.71335902810097+},+{+"blender_frame": 373,+"matrix_world": [+[+0.12584295868873596,+-0.3254213333129883,+0.9371576309204102,+-0.8150618076324463+],+[+0.992032527923584,+0.046931762248277664,+-0.11691487580537796,+2.62838077545166+],+[+-0.005935863126069307,+0.9444037079811096,+0.32873454689979553,+1.4907512664794922+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-81.50618076324463,+-262.838077545166,+149.07512664794922+],+"forward": [+-0.9371577501296997,+-0.11691489070653915,+-0.3287345767021179+],+"up": [+-0.3254213333129883,+-0.046931762248277664,+0.9444037079811096+],+"lens_mm": 25.763696670532227,+"fstop": 2.799999952316284,+"focus_cm": 223.03092367947102+},+{+"blender_frame": 374,+"matrix_world": [+[+0.1226847693324089,+-0.32803651690483093,+0.9366645216941833,+-0.8328842520713806+],+[+0.9924305081367493,+0.045775312930345535,+-0.11395768821239471,+2.639920949935913+],+[+-0.0054938276298344135,+0.9435553550720215,+0.33116939663887024,+1.4893909692764282+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-83.28842520713806,+-263.9920949935913,+148.93909692764282+],+"forward": [+-0.9366645216941833,+-0.11395768821239471,+-0.33116939663887024+],+"up": [+-0.32803651690483093,+-0.045775312930345535,+0.9435553550720215+],+"lens_mm": 25.767915725708008,+"fstop": 2.799999952316284,+"focus_cm": 221.3714588433504+},+{+"blender_frame": 375,+"matrix_world": [+[+0.1193917766213417,+-0.3303426504135132,+0.9362796545028687,+-0.8506783843040466+],+[+0.9928354620933533,+0.04431242495775223,+-0.11096914112567902,+2.65161395072937+],+[+-0.004830979276448488,+0.9428203701972961,+0.3332664668560028,+1.4885436296463013+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-85.06783843040466,+-265.161395072937,+148.85436296463013+],+"forward": [+-0.9362795352935791,+-0.11096912622451782,+-0.3332664370536804+],+"up": [+-0.3303426504135132,+-0.04431242495775223,+0.9428203701972961+],+"lens_mm": 25.772098541259766,+"fstop": 2.799999952316284,+"focus_cm": 219.73424926400185+},+{+"blender_frame": 376,+"matrix_world": [+[+0.11596845835447311,+-0.33249250054359436,+0.9359486699104309,+-0.8683255314826965+],+[+0.9932450652122498,+0.04260074347257614,+-0.10793393105268478,+2.663402795791626+],+[+-0.003984883893281221,+0.9421432614326477,+0.33518680930137634,+1.4878228902816772+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-86.83255314826965,+-266.3402795791626,+148.78228902816772+],+"forward": [+-0.9359487891197205,+-0.10793394595384598,+-0.33518683910369873+],+"up": [+-0.33249250054359436,+-0.04260074347257614,+0.9421432614326477+],+"lens_mm": 25.7762508392334,+"fstop": 2.799999952316284,+"focus_cm": 218.11801865696907+},+{+"blender_frame": 377,+"matrix_world": [+[+0.1124228835105896,+-0.334651380777359,+0.93561190366745,+-0.8856948614120483+],+[+0.9936559796333313,+0.04070722684264183,+-0.10483720898628235,+2.6752233505249023+],+[+-0.003002243349328637,+0.9414623379707336,+0.33710479736328125,+1.4868156909942627+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-88.56948614120483,+-267.52233505249023,+148.68156909942627+],+"forward": [+-0.93561190366745,+-0.10483720898628235,+-0.33710479736328125+],+"up": [+-0.334651380777359,+-0.04070722684264183,+0.9414623379707336+],+"lens_mm": 25.78036880493164,+"fstop": 2.799999952316284,+"focus_cm": 216.52153506875038+},+{+"blender_frame": 378,+"matrix_world": [+[+0.10876752436161041,+-0.336961567401886,+0.9352146983146667,+-0.902672529220581+],+[+0.9940652847290039,+0.038701482117176056,+-0.10166769474744797,+2.687007427215576+],+[+-0.00193608901463449,+0.9407227039337158,+0.33917126059532166,+1.4851714372634888+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-90.2672529220581,+-268.7007427215576,+148.51714372634888+],+"forward": [+-0.9352146983146667,+-0.10166769474744797,+-0.33917126059532166+],+"up": [+-0.336961567401886,+-0.038701482117176056,+0.9407227039337158+],+"lens_mm": 25.784452438354492,+"fstop": 2.799999952316284,+"focus_cm": 214.94394037872553+},+{+"blender_frame": 379,+"matrix_world": [+[+0.10501720011234283,+-0.3395119309425354,+0.9347208142280579,+-0.9191879630088806+],+[+0.9944700598716736,+0.036649368703365326,+-0.0984182134270668,+2.6986920833587646+],+[+-0.0008427686989307404,+0.9398874044418335,+0.3414832353591919,+1.4826748371124268+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-91.91879630088806,+-269.86920833587646,+148.26748371124268+],+"forward": [+-0.9347208142280579,+-0.0984182134270668,+-0.3414832353591919+],+"up": [+-0.3395119607448578,+-0.036649372428655624,+0.939887523651123+],+"lens_mm": 25.788503646850586,+"fstop": 2.799999952316284,+"focus_cm": 213.3846839889884+},+{+"blender_frame": 380,+"matrix_world": [+[+0.10118791460990906,+-0.3423214256763458,+0.9341182708740234,+-0.935230553150177+],+[+0.9948673248291016,+0.03460872918367386,+-0.09508562088012695,+2.7102200984954834+],+[+0.00022119963250588626,+0.9389452934265137,+0.3440663516521454,+1.4792873859405518+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-93.5230553150177,+-271.02200984954834,+147.92873859405518+],+"forward": [+-0.934118390083313,+-0.09508563578128815,+-0.3440663814544678+],+"up": [+-0.3423214256763458,+-0.03460872918367386,+0.9389452934265137+],+"lens_mm": 25.79252052307129,+"fstop": 2.799999952316284,+"focus_cm": 211.84326857328415+},+{+"blender_frame": 381,+"matrix_world": [+[+0.09729601442813873,+-0.3453361690044403,+0.9334219098091125,+-0.9508528709411621+],+[+0.9952547550201416,+0.03262710943818092,+-0.09167023003101349,+2.7215421199798584+],+[+0.0012021870352327824,+0.9379116892814636,+0.34687191247940063,+1.4751522541046143+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-95.08528709411621,+-272.15421199798584,+147.51522541046143+],+"forward": [+-0.9334219098091125,+-0.09167023003101349,+-0.34687191247940063+],+"up": [+-0.3453361988067627,+-0.03262711316347122,+0.9379118084907532+],+"lens_mm": 25.7965030670166,+"fstop": 2.799999952316284,+"focus_cm": 210.3193286806345+},+{+"blender_frame": 382,+"matrix_world": [+[+0.09335776418447495,+-0.34844353795051575,+0.9326689839363098,+-0.9661625623703003+],+[+0.9956305623054504,+0.03074169158935547,+-0.08817499876022339,+2.732618570327759+],+[+0.002052188850939274,+0.9368254542350769,+0.349791020154953,+1.47056245803833+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-96.61625623703003,+-273.2618570327759,+147.056245803833+],+"forward": [+-0.9326689839363098,+-0.08817499876022339,+-0.349791020154953+],+"up": [+-0.34844356775283813,+-0.030741695314645767,+0.9368255734443665+],+"lens_mm": 25.800451278686523,+"fstop": 2.799999952316284,+"focus_cm": 208.81280517205596+},+{+"blender_frame": 383,+"matrix_world": [+[+0.08938799053430557,+-0.3514969050884247,+0.9319117665290833,+-0.9813005924224854+],+[+0.9959931373596191,+0.028980029746890068,+-0.0846039354801178,+2.7434170246124268+],+[+0.0027311951853334904,+0.9357403516769409,+0.35267898440361023,+1.4658986330032349+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-98.13005924224854,+-274.3417024612427,+146.5898633003235+],+"forward": [+-0.9319118857383728,+-0.0846039429306984,+-0.3526790142059326+],+"up": [+-0.35149693489074707,+-0.028980033472180367,+0.9357404708862305+],+"lens_mm": 25.804365158081055,+"fstop": 2.799999952316284,+"focus_cm": 207.3241145350039+},+{+"blender_frame": 384,+"matrix_world": [+[+0.08539847284555435,+-0.3543470501899719,+0.9312064051628113,+-0.9964163899421692+],+[+0.9963417053222656,+0.027361281216144562,+-0.0809602215886116,+2.7539122104644775+],+[+0.003209015354514122,+0.9347136616706848,+0.3553873598575592,+1.461553931236267+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-99.64163899421692,+-275.39122104644775,+146.1553931236267+],+"forward": [+-0.9312064051628113,+-0.0809602215886116,+-0.3553873598575592+],+"up": [+-0.3543470501899719,+-0.027361281216144562,+0.9347136616706848+],+"lens_mm": 25.808244705200195,+"fstop": 2.799999952316284,+"focus_cm": 205.85392201319337+},+{+"blender_frame": 385,+"matrix_world": [+[+0.0813988447189331,+-0.3568727374076843,+0.9305998682975769,+-1.0116394758224487+],+[+0.9966755509376526,+0.025898152962327003,+-0.07724682241678238,+2.7640843391418457+],+[+0.003466467373073101,+0.9337939023971558,+0.3577944338321686,+1.4578591585159302+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-101.16394758224487,+-276.40843391418457,+145.78591585159302+],+"forward": [+-0.9305998682975769,+-0.07724682241678238,+-0.3577944338321686+],+"up": [+-0.3568727672100067,+-0.025898156687617302,+0.9337940216064453+],+"lens_mm": 25.812089920043945,+"fstop": 2.799999952316284,+"focus_cm": 204.4029250741005+},+{+"blender_frame": 386,+"matrix_world": [+[+0.07739552110433578,+-0.3590046465396881,+0.9301213026046753,+-1.027056097984314+],+[+0.9969944357872009,+0.024597520008683205,+-0.0734659805893898,+2.7739179134368896+],+[+0.0034959521144628525,+0.933011531829834,+0.3598293364048004,+1.4550237655639648+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-102.7056097984314,+-277.39179134368896,+145.50237655639648+],+"forward": [+-0.9301213026046753,+-0.0734659805893898,+-0.3598293364048004+],+"up": [+-0.3590046763420105,+-0.024597523733973503,+0.9330116510391235+],+"lens_mm": 25.815898895263672,+"fstop": 2.799999952316284,+"focus_cm": 202.97151878476143+},+{+"blender_frame": 387,+"matrix_world": [+[+0.07339149713516235,+-0.3607380986213684,+0.9297751188278198,+-1.0426968336105347+],+[+0.9972977638244629,+0.02346040867269039,+-0.06961910426616669,+2.783402919769287+],+[+0.0033013583160936832,+0.9323720335960388,+0.3614851236343384,+1.4531035423278809+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-104.26968336105347,+-278.3402919769287,+145.3103542327881+],+"forward": [+-0.9297751188278198,+-0.06961910426616669,+-0.3614851236343384+],+"up": [+-0.3607381284236908,+-0.02346041239798069,+0.9323721528053284+],+"lens_mm": 25.819673538208008,+"fstop": 2.799999952316284,+"focus_cm": 201.55925527215004+},+{+"blender_frame": 388,+"matrix_world": [+[+0.069385826587677,+-0.3621329069137573,+0.9295403957366943,+-1.0585323572158813+],+[+0.9975857138633728,+0.022481249645352364,+-0.0657067820429802,+2.7925350666046143+],+[+0.002897359896451235,+0.931855320930481,+0.36281847953796387,+1.4519990682601929+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-105.85323572158813,+-279.2535066604614,+145.1999068260193+],+"forward": [+-0.9295403957366943,+-0.0657067820429802,+-0.36281847953796387+],+"up": [+-0.3621329069137573,+-0.022481249645352364,+0.931855320930481+],+"lens_mm": 25.823413848876953,+"fstop": 2.799999952316284,+"focus_cm": 200.16506840474904+},+{+"blender_frame": 389,+"matrix_world": [+[+0.06537515670061111,+-0.3633013963699341,+0.9293752312660217,+-1.0744833946228027+],+[+0.9978580474853516,+0.021647369489073753,+-0.06173030659556389,+2.8013157844543457+],+[+0.0023081786930561066,+0.9314201474189758,+0.36393842101097107,+1.4514851570129395+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-107.44833946228027,+-280.13157844543457,+145.14851570129395+],+"forward": [+-0.9293752312660217,+-0.06173030659556389,+-0.36393842101097107+],+"up": [+-0.3633013963699341,+-0.021647369489073753,+0.9314201474189758+],+"lens_mm": 25.827117919921875,+"fstop": 2.799999952316284,+"focus_cm": 198.78751882351935+},+{+"blender_frame": 390,+"matrix_world": [+[+0.06135283410549164,+-0.3643869161605835,+0.9292243123054504,+-1.090437412261963+],+[+0.998114824295044,+0.020937738940119743,+-0.057690832763910294,+2.8097548484802246+],+[+0.001565931481309235,+0.9310122728347778,+0.36498457193374634,+1.4512604475021362+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-109.04374122619629,+-280.97548484802246,+145.12604475021362+],+"forward": [+-0.92922443151474,+-0.05769084021449089,+-0.3649846017360687+],+"up": [+-0.3643869161605835,+-0.020937738940119743,+0.9310122728347778+],+"lens_mm": 25.830785751342773,+"fstop": 2.799999952316284,+"focus_cm": 197.42514304816723+},+{+"blender_frame": 391,+"matrix_world": [+[+0.057310640811920166,+-0.3655382990837097,+0.929030179977417,+-1.1062718629837036+],+[+0.9983561635017395,+0.02032320573925972,+-0.053590837866067886,+2.8178699016571045+],+[+0.0007086303667165339,+0.9305744171142578,+0.3661021292209625,+1.4510084390640259+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-110.62718629837036,+-281.78699016571045,+145.1008439064026+],+"forward": [+-0.9290302991867065,+-0.05359084531664848,+-0.3661021590232849+],+"up": [+-0.3655382990837097,+-0.02032320573925972,+0.9305744171142578+],+"lens_mm": 25.83441925048828,+"fstop": 2.799999952316284,+"focus_cm": 196.07699140906334+},+{+"blender_frame": 392,+"matrix_world": [+[+0.053238995373249054,+-0.3668838441371918,+0.9287421107292175,+-1.1218777894973755+],+[+0.9985818862915039,+0.01976701244711876,+-0.04943384230136871,+2.825685739517212+],+[+-0.00022197689395397902,+0.9300567507743835,+0.3674158751964569,+1.4504576921463013+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-112.18777894973755,+-282.5685739517212,+145.04576921463013+],+"forward": [+-0.9287421107292175,+-0.04943384230136871,+-0.3674158751964569+],+"up": [+-0.3668838441371918,+-0.01976701244711876,+0.9300567507743835+],+"lens_mm": 25.838014602661133,+"fstop": 2.799999952316284,+"focus_cm": 194.74255091045052+},+{+"blender_frame": 393,+"matrix_world": [+[+0.04912702739238739,+-0.3685113191604614,+0.9283242225646973,+-1.1371784210205078+],+[+0.9987919330596924,+0.01922628842294216,+-0.045224033296108246,+2.8332338333129883+],+[+-0.001182662439532578,+0.9294244647026062,+0.3690105974674225,+1.449428677558899+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-113.71784210205078,+-283.3233833312988,+144.9428677558899+],+"forward": [+-0.9283243417739868,+-0.045224037021398544,+-0.3690106272697449+],+"up": [+-0.3685113191604614,+-0.01922628842294216,+0.9294244647026062+],+"lens_mm": 25.841575622558594,+"fstop": 2.799999952316284,+"focus_cm": 193.4218359645456+},+{+"blender_frame": 394,+"matrix_world": [+[+0.04496460780501366,+-0.3704564571380615,+0.9277608394622803,+-1.15214204788208+],+[+0.9989863038063049,+0.01865517906844616,+-0.04096755012869835,+2.8405508995056152+],+[+-0.0021308506838977337,+0.9286625385284424,+0.37091973423957825,+1.447860836982727+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-115.21420478820801,+-284.0550899505615,+144.7860836982727+],+"forward": [+-0.9277608394622803,+-0.04096755012869835,+-0.37091973423957825+],+"up": [+-0.3704564571380615,+-0.01865517906844616,+0.9286625385284424+],+"lens_mm": 25.84510040283203,+"fstop": 2.799999952316284,+"focus_cm": 192.11496459320188+},+{+"blender_frame": 395,+"matrix_world": [+[+0.04074202477931976,+-0.3727010488510132,+0.9270566701889038,+-1.1667850017547607+],+[+0.9991651773452759,+0.018007660284638405,+-0.0366714708507061,+2.847674608230591+],+[+-0.003026624210178852,+0.9277766346931458,+0.3731235861778259,+1.4458154439926147+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-116.67850017547607,+-284.7674608230591,+144.58154439926147+],+"forward": [+-0.9270566701889038,+-0.0366714708507061,+-0.3731235861778259+],+"up": [+-0.37270107865333557,+-0.018007662147283554,+0.9277767539024353+],+"lens_mm": 25.848588943481445,+"fstop": 2.799999952316284,+"focus_cm": 190.82218272378668+},+{+"blender_frame": 396,+"matrix_world": [+[+0.03645114600658417,+-0.3751804232597351,+0.9262348413467407,+-1.181166172027588+],+[+0.9993281364440918,+0.01724107377231121,+-0.03234400227665901,+2.854642629623413+],+[+-0.0038344482891261578,+0.9267914295196533,+0.3755567669868469,+1.4434568881988525+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-118.11661720275879,+-285.4642629623413,+144.34568881988525+],+"forward": [+-0.9262348413467407,+-0.03234400227665901,+-0.3755567669868469+],+"up": [+-0.3751804828643799,+-0.01724107563495636,+0.9267915487289429+],+"lens_mm": 25.852039337158203,+"fstop": 2.799999952316284,+"focus_cm": 189.54361733049154+},+{+"blender_frame": 397,+"matrix_world": [+[+0.03208598494529724,+-0.3777990937232971,+0.9253315925598145,+-1.19537353515625+],+[+0.9994747638702393,+0.01631917618215084,+-0.02799404039978981,+2.861489772796631+],+[+-0.0045245252549648285,+0.925743818283081,+0.37812432646751404,+1.4410158395767212+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-119.537353515625,+-286.1489772796631,+144.10158395767212+],+"forward": [+-0.9253314733505249,+-0.02799403667449951,+-0.37812426686286926+],+"up": [+-0.3777990937232971,+-0.01631917618215084,+0.925743818283081+],+"lens_mm": 25.85545539855957,+"fstop": 2.799999952316284,+"focus_cm": 188.27945231460035+},+{+"blender_frame": 398,+"matrix_world": [+[+0.027642639353871346,+-0.38044947385787964,+0.9243885278701782,+-1.2095063924789429+],+[+0.9996050596237183,+0.015214266255497932,+-0.0236301738768816,+2.868244171142578+],+[+-0.005073804873973131,+0.9246765971183777,+0.38071978092193604,+1.4387450218200684+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-120.95063924789429,+-286.8244171142578,+143.87450218200684+],+"forward": [+-0.9243885278701782,+-0.0236301738768816,+-0.38071978092193604+],+"up": [+-0.38044947385787964,+-0.015214266255497932,+0.9246765971183777+],+"lens_mm": 25.85883331298828,+"fstop": 2.799999952316284,+"focus_cm": 187.0300754380878+},+{+"blender_frame": 399,+"matrix_world": [+[+0.023119866847991943,+-0.38303160667419434,+0.9234458208084106,+-1.2236576080322266+],+[+0.9997177720069885,+0.013908653520047665,+-0.01926034688949585,+2.874929189682007+],+[+-0.005466568283736706,+0.9236305952072144,+0.38324499130249023,+1.436872959136963+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-122.36576080322266,+-287.4929189682007,+143.6872959136963+],+"forward": [+-0.9234459400177002,+-0.019260348752141,+-0.383245050907135+],+"up": [+-0.38303160667419434,+-0.013908653520047665,+0.9236305952072144+],+"lens_mm": 25.86217498779297,+"fstop": 2.799999952316284,+"focus_cm": 185.79581763769966+},+{+"blender_frame": 400,+"matrix_world": [+[+0.018519015982747078,+-0.38546863198280334,+0.9225350618362427,+-1.23789644241333+],+[+0.9998123645782471,+0.012394879944622517,+-0.014891250059008598,+2.881561040878296+],+[+-0.005694601219147444,+0.9226377010345459,+0.38562577962875366,+1.4355661869049072+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-123.78964424133301,+-288.1561040878296,+143.55661869049072+],+"forward": [+-0.9225351810455322,+-0.014891251921653748,+-0.38562583923339844+],+"up": [+-0.38546863198280334,+-0.012394879944622517,+0.9226377010345459+],+"lens_mm": 25.865478515625,+"fstop": 2.799999952316284,+"focus_cm": 184.57724342297297+},+{+"blender_frame": 401,+"matrix_world": [+[+0.013844721019268036,+-0.38771820068359375,+0.9216740131378174,+-1.2522581815719604+],+[+0.9998875856399536,+0.010675392113626003,+-0.010528800077736378,+2.888148546218872+],+[+-0.0057570235803723335,+0.921716034412384,+0.3878224790096283,+1.4349045753479004+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-125.22581815719604,+-288.8148546218872,+143.49045753479004+],+"forward": [+-0.9216740131378174,+-0.010528800077736378,+-0.3878224790096283+],+"up": [+-0.3877182602882385,+-0.010675393044948578,+0.9217161536216736+],+"lens_mm": 25.868745803833008,+"fstop": 2.799999952316284,+"focus_cm": 183.37463809293695+},+{+"blender_frame": 402,+"matrix_world": [+[+0.009103305637836456,+-0.3897761404514313,+0.9208645820617676,+-1.266737937927246+],+[+0.9999426603317261,+0.008760642260313034,+-0.0061769066378474236,+2.8946969509124756+],+[+-0.005659753922373056,+0.9208679795265198,+0.3898334801197052,+1.4348723888397217+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-126.67379379272461,+-289.46969509124756,+143.48723888397217+],+"forward": [+-0.9208647012710571,+-0.006176907569169998,+-0.38983353972435+],+"up": [+-0.3897761404514313,+-0.008760642260313034,+0.9208679795265198+],+"lens_mm": 25.87197494506836,+"fstop": 2.799999952316284,+"focus_cm": 182.18830302103015+},+{+"blender_frame": 403,+"matrix_world": [+[+0.004304176662117243,+-0.39167332649230957,+0.9200943112373352,+-1.2812931537628174+],+[+0.9999760389328003,+0.0066679599694907665,+-0.0018393893260508776,+2.901205539703369+],+[+-0.005414712242782116,+0.9200801849365234,+0.3916926980018616,+1.4353673458099365+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-128.12931537628174,+-290.1205539703369,+143.53673458099365+],+"forward": [+-0.9200943112373352,+-0.0018393893260508776,+-0.3916926980018616+],+"up": [+-0.39167332649230957,+-0.0066679599694907665,+0.9200801849365234+],+"lens_mm": 25.875165939331055,+"fstop": 2.799999952316284,+"focus_cm": 181.01835565744295+},+{+"blender_frame": 404,+"matrix_world": [+[+-0.0005419845692813396,+-0.39346784353256226,+0.9193382859230042,+-1.295851230621338+],+[+0.9999871253967285,+0.004419124685227871,+0.0024808733724057674,+2.9076731204986572+],+[+-0.005038813687860966,+0.9193277359008789,+0.39346033334732056,+1.4362194538116455+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-129.5851230621338,+-290.7673120498657,+143.62194538116455+],+"forward": [+-0.9193382859230042,+0.0024808733724057674,+-0.39346033334732056+],+"up": [+-0.39346790313720703,+-0.004419125150889158,+0.9193278551101685+],+"lens_mm": 25.878320693969727,+"fstop": 2.799999952316284,+"focus_cm": 179.8649423149982+},+{+"blender_frame": 405,+"matrix_world": [+[+-0.005422972142696381,+-0.3952324390411377,+0.9185651540756226,+-1.3103201389312744+],+[+0.9999750852584839,+0.0020388448610901833,+0.006780850235372782,+2.914095878601074+],+[+-0.00455282349139452,+0.9185788631439209,+0.39521148800849915,+1.4372227191925049+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-131.03201389312744,+-291.4095878601074,+143.7222719192505+],+"forward": [+-0.9185651540756226,+0.006780850235372782,+-0.39521148800849915+],+"up": [+-0.3952324390411377,+-0.0020388448610901833,+0.9185788631439209+],+"lens_mm": 25.881437301635742,+"fstop": 2.799999952316284,+"focus_cm": 178.72853801163728+},+{+"blender_frame": 406,+"matrix_world": [+[+-0.010326016694307327,+-0.3970426023006439,+0.9177420735359192,+-1.3246043920516968+],+[+0.9999387860298157,+-0.00044693381641991436,+0.011057497933506966,+2.9204704761505127+],+[+-0.003980128560215235,+0.9178001880645752,+0.3970228135585785,+1.4381654262542725+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-132.46043920516968,+-292.04704761505127,+143.81654262542725+],+"forward": [+-0.9177421927452087,+0.01105749886482954,+-0.39702287316322327+],+"up": [+-0.39704254269599915,+0.00044693375821225345,+0.9178000688552856+],+"lens_mm": 25.8845157623291,+"fstop": 2.799999952316284,+"focus_cm": 177.6094915374415+},+{+"blender_frame": 407,+"matrix_world": [+[+-0.015237134881317616,+-0.3989626169204712,+0.9168406128883362,+-1.3386152982711792+],+[+0.9998782873153687,+-0.003011696506291628,+0.015306618995964527,+2.926793098449707+],+[+-0.003345522563904524,+0.916962206363678,+0.3989599943161011,+1.4388619661331177+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-133.86152982711792,+-292.6793098449707,+143.88619661331177+],+"forward": [+-0.9168406128883362,+0.015306618995964527,+-0.3989599943161011+],+"up": [+-0.39896267652511597,+0.003011696971952915,+0.9169623255729675+],+"lens_mm": 25.887556076049805,+"fstop": 2.799999952316284,+"focus_cm": 176.50855175743345+},+{+"blender_frame": 408,+"matrix_world": [+[+-0.02014368586242199,+-0.401037335395813,+0.915840208530426,+-1.3522839546203613+],+[+0.9997935891151428,+-0.005629978142678738,+0.01952490396797657,+2.9330615997314453+],+[+-0.0026740552857518196,+0.9160444140434265,+0.40106797218322754,+1.4391748905181885+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-135.22839546203613,+-293.30615997314453,+143.91748905181885+],+"forward": [+-0.915840208530426,+0.01952490396797657,+-0.40106797218322754+],+"up": [+-0.401037335395813,+0.005629978142678738,+0.9160444140434265+],+"lens_mm": 25.890560150146484,+"fstop": 2.799999952316284,+"focus_cm": 175.42652087286115+},+{+"blender_frame": 409,+"matrix_world": [+[+-0.02503323182463646,+-0.403285950422287,+0.9147315621376038,+-1.365566372871399+],+[+0.999684751033783,+-0.008277293294668198,+0.02370883710682392,+2.939274787902832+],+[+-0.0019899383187294006,+0.9150364995002747,+0.40336599946022034,+1.4390294551849365+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-136.5566372871399,+-293.9274787902832,+143.90294551849365+],+"forward": [+-0.9147315621376038,+0.02370883710682392,+-0.40336599946022034+],+"up": [+-0.40328601002693176,+0.008277294225990772,+0.9150366187095642+],+"lens_mm": 25.893524169921875,+"fstop": 2.799999952316284,+"focus_cm": 174.36424212064594+},+{+"blender_frame": 410,+"matrix_world": [+[+-0.029894016683101654,+-0.40570083260536194,+0.9135169386863708,+-1.378448486328125+],+[+0.999552309513092,+-0.010930479504168034,+0.027855122461915016,+2.9454307556152344+],+[+-0.0013156670611351728,+0.9139405488967896,+0.40584596991539,+1.4384171962738037+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-137.8448486328125,+-294.54307556152344,+143.84171962738037+],+"forward": [+-0.9135169386863708,+0.027855122461915016,+-0.40584596991539+],+"up": [+-0.40570083260536194,+0.010930479504168034,+0.9139405488967896+],+"lens_mm": 25.89645004272461,+"fstop": 2.799999952316284,+"focus_cm": 173.32226807484403+},+{+"blender_frame": 411,+"matrix_world": [+[+-0.0347164049744606,+-0.408250093460083,+0.9122097492218018,+-1.3909423351287842+],+[+0.9993969202041626,+-0.0135684534907341,+0.031962111592292786,+2.9515299797058105+],+[+-0.0006712573813274503,+0.9127692580223083,+0.40847495198249817,+1.43738853931427+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-139.09423351287842,+-295.15299797058105,+143.738853931427+],+"forward": [+-0.9122097492218018,+0.031962111592292786,+-0.40847495198249817+],+"up": [+-0.4082501530647278,+0.01356845535337925,+0.9127693772315979+],+"lens_mm": 25.899335861206055,+"fstop": 2.799999952316284,+"focus_cm": 172.30115256970748+},+{+"blender_frame": 412,+"matrix_world": [+[+-0.039492376148700714,+-0.41088423132896423,+0.9108317494392395,+-1.403082013130188+],+[+0.9992199540138245,+-0.01617223396897316,+0.03602932021021843,+2.957571506500244+],+[+-7.369357626885176e-05,+0.9115440249443054,+0.4112023711204529,+1.4360414743423462+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-140.3082013130188,+-295.7571506500244,+143.60414743423462+],+"forward": [+-0.9108317494392395,+0.03602932021021843,+-0.4112023711204529+],+"up": [+-0.410884290933609,+0.01617223583161831,+0.911544144153595+],+"lens_mm": 25.902185440063477,+"fstop": 2.799999952316284,+"focus_cm": 171.30126792471856+},+{+"blender_frame": 413,+"matrix_world": [+[+-0.044215019792318344,+-0.4135432541370392,+0.909410297870636,+-1.414915680885315+],+[+0.9990220069885254,+-0.018724989145994186,+0.040056925266981125,+2.9635558128356934+],+[+0.0004634273936972022,+0.9102919697761536,+0.41396665573120117,+1.4345004558563232+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-141.4915680885315,+-296.35558128356934,+143.45004558563232+],+"forward": [+-0.909410297870636,+0.040056925266981125,+-0.41396665573120117+],+"up": [+-0.4135432541370392,+0.018724989145994186,+0.9102919697761536+],+"lens_mm": 25.90499496459961,+"fstop": 2.799999952316284,+"focus_cm": 170.3229021979496+},+{+"blender_frame": 414,+"matrix_world": [+[+-0.048880405724048615,+-0.4161648750305176,+0.9079744219779968,+-1.426497220993042+],+[+0.9988041520118713,+-0.02121315337717533,+0.044047266244888306,+2.9694836139678955+],+[+0.0009300753008574247,+0.909041702747345,+0.4167040288448334,+1.432898759841919+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-142.6497220993042,+-296.94836139678955,+143.2898759841919+],+"forward": [+-0.9079744219779968,+0.044047266244888306,+-0.4167040288448334+],+"up": [+-0.4161648750305176,+0.02121315337717533,+0.909041702747345+],+"lens_mm": 25.907764434814453,+"fstop": 2.799999952316284,+"focus_cm": 169.36642611399293+},+{+"blender_frame": 415,+"matrix_world": [+[+-0.053485941141843796,+-0.4186931848526001,+0.9065513610839844,+-1.4378780126571655+],+[+0.9985677003860474,+-0.023626169189810753,+0.04800304025411606,+2.975356340408325+],+[+0.0013197887456044555,+0.9078204035758972,+0.41935715079307556,+1.4313586950302124+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-143.78780126571655,+-297.5356340408325,+143.13586950302124+],+"forward": [+-0.9065513610839844,+0.04800304025411606,+-0.41935715079307556+],+"up": [+-0.4186931848526001,+0.023626169189810753,+0.9078204035758972+],+"lens_mm": 25.910497665405273,+"fstop": 2.799999952316284,+"focus_cm": 168.43214430846274+},+{+"blender_frame": 416,+"matrix_world": [+[+-0.05803147330880165,+-0.42108410596847534,+0.9051632881164551,+-1.4490991830825806+],+[+0.9983134865760803,+-0.025957316160202026,+0.0519280731678009,+2.9811761379241943+],+[+0.0016295230016112328,+0.9066501259803772,+0.421880304813385,+1.429978370666504+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-144.90991830825806,+-298.11761379241943,+142.9978370666504+],+"forward": [+-0.9051632881164551,+0.0519280731678009,+-0.421880304813385+],+"up": [+-0.42108410596847534,+0.025957316160202026,+0.9066501259803772+],+"lens_mm": 25.913188934326172,+"fstop": 2.799999952316284,+"focus_cm": 167.5204231403768+},+{+"blender_frame": 417,+"matrix_world": [+[+-0.0625181570649147,+-0.42330923676490784,+0.9038256406784058,+-1.4601882696151733+],+[+0.9980421662330627,+-0.028203489258885384,+0.05582598224282265,+2.986947536468506+],+[+0.001859382027760148,+0.9055461287498474,+0.42424362897872925,+1.428820252418518+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-146.01882696151733,+-298.6947536468506,+142.8820252418518+],+"forward": [+-0.9038256406784058,+0.05582598224282265,+-0.42424362897872925+],+"up": [+-0.4233092963695526,+0.028203492984175682,+0.905546247959137+],+"lens_mm": 25.915842056274414,+"fstop": 2.799999952316284,+"focus_cm": 166.63154908455908+},+{+"blender_frame": 418,+"matrix_world": [+[+-0.06694906949996948,+-0.4253573715686798,+0.9025457501411438,+-1.471156358718872+],+[+0.9977543354034424,+-0.030365578830242157,+0.059700578451156616,+2.992675304412842+],+[+0.002012240933254361,+0.9045159220695496,+0.42643511295318604,+1.4279099702835083+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-147.1156358718872,+-299.2675304412842,+142.79099702835083+],+"forward": [+-0.9025458693504333,+0.05970058590173721,+-0.4264351725578308+],+"up": [+-0.4253573715686798,+0.030365578830242157,+0.9045159220695496+],+"lens_mm": 25.91845703125,+"fstop": 2.799999952316284,+"focus_cm": 165.76580083929002+},+{+"blender_frame": 419,+"matrix_world": [+[+-0.07132831960916519,+-0.4272341728210449,+0.9013230204582214,+-1.4819979667663574+],+[+0.9974507093429565,+-0.032448045909404755,+0.06355497986078262,+2.998366594314575+],+[+0.0020933132618665695,+0.9035584926605225,+0.4284594655036926,+1.427236557006836+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-148.19979667663574,+-299.8366594314575,+142.7236557006836+],+"forward": [+-0.901323139667511,+0.06355498731136322,+-0.4284595251083374+],+"up": [+-0.4272342324256897,+0.03244804963469505,+0.903558611869812+],+"lens_mm": 25.921030044555664,+"fstop": 2.799999952316284,+"focus_cm": 164.92324145510793+},+{+"blender_frame": 420,+"matrix_world": [+[+-0.0756613239645958,+-0.4289587438106537,+0.9001498818397522,+-1.4926939010620117+],+[+0.9971312880516052,+-0.03445873036980629,+0.06739199906587601,+3.0040295124053955+],+[+0.002109631197527051,+0.9026666283607483,+0.43033546209335327,+1.4267579317092896+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-149.26939010620117,+-300.40295124053955,+142.67579317092896+],+"forward": [+-0.9001498818397522,+0.06739199906587601,+-0.43033546209335327+],+"up": [+-0.4289587438106537,+0.03445873036980629,+0.9026666283607483+],+"lens_mm": 25.923564910888672,+"fstop": 2.799999952316284,+"focus_cm": 164.10395288839936+},+{+"blender_frame": 421,+"matrix_world": [+[+-0.07995448261499405,+-0.4305606484413147,+0.8990132808685303,+-1.5032154321670532+],+[+0.9967964291572571,+-0.03640829771757126,+0.07121403515338898,+3.0096726417541504+],+[+0.0020695829298347235,+0.9018269777297974,+0.4320922791957855,+1.4264116287231445+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-150.32154321670532,+-300.96726417541504,+142.64116287231445+],+"forward": [+-0.8990132808685303,+0.07121403515338898,+-0.4320922791957855+],+"up": [+-0.4305607080459595,+0.03640830144286156,+0.9018270969390869+],+"lens_mm": 25.92605972290039,+"fstop": 2.799999952316284,+"focus_cm": 163.3079015649855+},+{+"blender_frame": 422,+"matrix_world": [+[+-0.08421383798122406,+-0.43207448720932007,+0.8978973627090454,+-1.5135283470153809+],+[+0.9964457154273987,+-0.03830902650952339,+0.0750221312046051,+3.0153043270111084+],+[+0.0019824234768748283,+0.9010237455368042,+0.4337649941444397,+1.426124095916748+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-151.3528347015381,+-301.53043270111084,+142.6124095916748+],+"forward": [+-0.8978973627090454,+0.0750221312046051,+-0.4337649941444397+],+"up": [+-0.43207454681396484,+0.03830903023481369,+0.9010238647460938+],+"lens_mm": 25.928516387939453,+"fstop": 2.799999952316284,+"focus_cm": 162.53506187349558+},+{+"blender_frame": 423,+"matrix_world": [+[+-0.08844690769910812,+-0.43353620171546936,+0.8967850804328918,+-1.5235979557037354+],+[+0.99607914686203,+-0.04017488285899162,+0.07881804555654526,+3.0209343433380127+],+[+0.001857756869867444,+0.9002400636672974,+0.4353897273540497,+1.4258208274841309+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-152.35979557037354,+-302.09343433380127,+142.5820827484131+],+"forward": [+-0.8967850804328918,+0.07881804555654526,+-0.4353897273540497+],+"up": [+-0.43353626132011414,+0.04017488658428192,+0.9002401828765869+],+"lens_mm": 25.930931091308594,+"fstop": 2.799999952316284,+"focus_cm": 161.78530314937234+},+{+"blender_frame": 424,+"matrix_world": [+[+-0.09266016632318497,+-0.43497902154922485,+0.8956602215766907,+-1.5333938598632812+],+[+0.9956963062286377,+-0.042019814252853394,+0.08260233700275421,+3.0265700817108154+],+[+0.0017051899340003729,+0.8994595408439636,+0.4370006322860718,+1.4254364967346191+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-153.33938598632812,+-302.65700817108154,+142.5436496734619+],+"forward": [+-0.8956603407859802,+0.08260234445333481,+-0.43700069189071655+],+"up": [+-0.43497908115386963,+0.04201981797814369,+0.8994596600532532+],+"lens_mm": 25.933305740356445,+"fstop": 2.799999952316284,+"focus_cm": 161.0585485585034+},+{+"blender_frame": 425,+"matrix_world": [+[+-0.09685952961444855,+-0.43643009662628174,+0.8945093154907227,+-1.5428932905197144+],+[+0.9952970147132874,+-0.043857160955667496,+0.0863751545548439,+3.032216787338257+],+[+0.0015339194796979427,+0.8986685872077942,+0.4386255145072937,+1.4249207973480225+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-154.28932905197144,+-303.2216787338257,+142.49207973480225+],+"forward": [+-0.8945094347000122,+0.0863751620054245,+-0.4386255741119385+],+"up": [+-0.4364301562309265,+0.043857164680957794,+0.8986687064170837+],+"lens_mm": 25.935640335083008,+"fstop": 2.799999952316284,+"focus_cm": 160.35460233688354+},+{+"blender_frame": 426,+"matrix_world": [+[+-0.1010512188076973,+-0.43790915608406067,+0.8933220505714417,+-1.5520830154418945+],+[+0.9948803186416626,+-0.045699529349803925,+0.09013728052377701,+3.0378777980804443+],+[+0.0013524563983082771,+0.8978568911552429,+0.44028523564338684,+1.424243450164795+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-155.20830154418945,+-303.78777980804443,+142.4243450164795+],+"forward": [+-0.8933220505714417,+0.09013728052377701,+-0.44028523564338684+],+"up": [+-0.43790921568870544,+0.04569953307509422,+0.8978570103645325+],+"lens_mm": 25.93793487548828,+"fstop": 2.799999952316284,+"focus_cm": 159.67323873192072+},+{+"blender_frame": 427,+"matrix_world": [+[+-0.10524053871631622,+-0.43942728638648987,+0.8920920491218567,+-1.5609596967697144+],+[+0.9944460988044739,+-0.04755774885416031,+0.0938892811536789,+3.043553590774536+],+[+0.0011683760676532984,+0.8970184326171875,+0.44199180603027344,+1.4233946800231934+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-156.09596967697144,+-304.3553590774536,+142.33946800231934+],+"forward": [+-0.8920920491218567,+0.0938892811536789,+-0.44199180603027344+],+"up": [+-0.43942728638648987,+0.04755774885416031,+0.8970184326171875+],+"lens_mm": 25.940189361572266,+"fstop": 2.799999952316284,+"focus_cm": 159.01423720642924+},+{+"blender_frame": 428,+"matrix_world": [+[+-0.10943163931369781,+-0.44098755717277527,+0.890816867351532,+-1.5695316791534424+],+[+0.993993878364563,+-0.04944049194455147,+0.09763142466545105,+3.049243211746216+],+[+0.0009881778387352824,+0.8961504697799683,+0.44374924898147583,+1.4223849773406982+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-156.95316791534424,+-304.9243211746216,+142.23849773406982+],+"forward": [+-0.890816867351532,+0.09763142466545105,+-0.44374924898147583+],+"up": [+-0.44098755717277527,+0.04944049194455147,+0.8961504697799683+],+"lens_mm": 25.94240379333496,+"fstop": 2.799999952316284,+"focus_cm": 158.37707230821252+},+{+"blender_frame": 429,+"matrix_world": [+[+-0.11362767219543457,+-0.44258567690849304,+0.8894979357719421,+-1.5778154134750366+],+[+0.993523120880127,+-0.05135416239500046,+0.10136403143405914,+3.0549404621124268+],+[+0.0008171574445441365,+0.8952545523643494,+0.44555434584617615,+1.4212417602539062+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-157.78154134750366,+-305.4940462112427,+142.12417602539062+],+"forward": [+-0.8894980549812317,+0.10136404633522034,+-0.4455544054508209+],+"up": [+-0.44258567690849304,+0.05135416239500046,+0.8952545523643494+],+"lens_mm": 25.944578170776367,+"fstop": 2.799999952316284,+"focus_cm": 157.76138585060835+},+{+"blender_frame": 430,+"matrix_world": [+[+-0.11783038079738617,+-0.4442124366760254,+0.8881392478942871,+-1.5858339071273804+],+[+0.9930335283279419,+-0.05330277234315872,+0.10508685559034348,+3.0606369972229004+],+[+0.0006593931466341019,+0.8943344354629517,+0.44739851355552673,+1.420005440711975+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-158.58339071273804,+-306.06369972229004,+142.0005440711975+],+"forward": [+-0.8881392478942871,+0.10508685559034348,+-0.44739851355552673+],+"up": [+-0.44421249628067017,+0.05330277979373932,+0.8943345546722412+],+"lens_mm": 25.94671058654785,+"fstop": 2.799999952316284,+"focus_cm": 157.16658905148506+},+{+"blender_frame": 431,+"matrix_world": [+[+-0.1220412477850914,+-0.445854514837265,+0.8867466449737549,+-1.5936154127120972+],+[+0.9925248622894287,+-0.055288493633270264,+0.10880036652088165,+3.0663228034973145+],+[+0.0005177534185349941,+0.8933961987495422,+0.44926920533180237,+1.4187235832214355+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-159.36154127120972,+-306.63228034973145,+141.87235832214355+],+"forward": [+-0.8867466449737549,+0.10880036652088165,+-0.44926920533180237+],+"up": [+-0.4458545744419098,+0.05528850108385086,+0.8933963179588318+],+"lens_mm": 25.948802947998047,+"fstop": 2.799999952316284,+"focus_cm": 156.5920889377594+},+{+"blender_frame": 432,+"matrix_world": [+[+-0.12626011669635773,+-0.44749775528907776,+0.885327160358429,+-1.6011896133422852+],+[+0.9919971227645874,+-0.057311348617076874,+0.11250413209199905,+3.0719854831695557+],+[+0.0003939412999898195,+0.8924466371536255,+0.45115262269973755,+1.4174461364746094+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-160.11896133422852,+-307.19854831695557,+141.74461364746094+],+"forward": [+-0.885327160358429,+0.11250413209199905,+-0.45115262269973755+],+"up": [+-0.44749781489372253,+0.05731135606765747,+0.892446756362915+],+"lens_mm": 25.95085334777832,+"fstop": 2.799999952316284,+"focus_cm": 156.03722762316465+},+{+"blender_frame": 433,+"matrix_world": [+[+-0.1304859220981598,+-0.4491278827190399,+0.8838878273963928,+-1.6085854768753052+],+[+0.9914501905441284,+-0.0593697689473629,+0.1161976307630539,+3.077611207962036+],+[+0.0002886208239942789,+0.8914927840232849,+0.45303481817245483,+1.4162205457687378+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-160.85854768753052,+-307.7611207962036,+141.62205457687378+],+"forward": [+-0.8838878273963928,+0.1161976307630539,+-0.45303481817245483+],+"up": [+-0.4491278827190399,+0.0593697689473629,+0.8914927840232849+],+"lens_mm": 25.952863693237305,+"fstop": 2.799999952316284,+"focus_cm": 155.50129432231188+},+{+"blender_frame": 434,+"matrix_world": [+[+-0.13471625745296478,+-0.450732946395874,+0.8824349045753479,+-1.6158291101455688+],+[+0.9908842444419861,+-0.06146075576543808,+0.11987944692373276,+3.0831851959228516+],+[+0.00020149885676801205,+0.890540599822998,+0.45490387082099915,+1.4150890111923218+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-161.58291101455688,+-308.31851959228516,+141.50890111923218+],+"forward": [+-0.8824349045753479,+0.11987944692373276,+-0.45490387082099915+],+"up": [+-0.45073288679122925,+0.06146074831485748,+0.8905404806137085+],+"lens_mm": 25.954833984375,+"fstop": 2.799999952316284,+"focus_cm": 154.98365443199873+},+{+"blender_frame": 435,+"matrix_world": [+[+-0.13894811272621155,+-0.45230337977409363,+0.8809739351272583,+-1.6229430437088013+],+[+0.9902997612953186,+-0.06358044594526291,+0.12354804575443268,+3.0886926651000977+],+[+0.0001315162517130375,+0.8895948529243469,+0.45675036311149597,+1.41408371925354+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-162.29430437088013,+-308.86926651000977,+141.408371925354+],+"forward": [+-0.8809739351272583,+0.12354804575443268,+-0.45675036311149597+],+"up": [+-0.4523034393787384,+0.0635804533958435,+0.8895949721336365+],+"lens_mm": 25.956762313842773,+"fstop": 2.799999952316284,+"focus_cm": 154.48357164859772+},+{+"blender_frame": 436,+"matrix_world": [+[+-0.14317743480205536,+-0.45383408665657043,+0.8795081973075867,+-1.629943609237671+],+[+0.9896971583366394,+-0.06572432816028595,+0.12720097601413727,+3.094118356704712+],+[+7.694493979215622e-05,+0.8886589407920837,+0.4585685133934021,+1.4132269620895386+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-162.9943609237671,+-309.4118356704712,+141.32269620895386+],+"forward": [+-0.8795083165168762,+0.12720099091529846,+-0.4585685729980469+],+"up": [+-0.4538341462612152,+0.06572433561086655,+0.8886590600013733+],+"lens_mm": 25.958648681640625,+"fstop": 2.799999952316284,+"focus_cm": 154.0002916008234+},+{+"blender_frame": 437,+"matrix_world": [+[+-0.14739906787872314,+-0.45532283186912537,+0.8780401945114136,+-1.6368423700332642+],+[+0.9890771508216858,+-0.06788729876279831,+0.13083499670028687,+3.0994484424591064+],+[+3.561191260814667e-05,+0.8877345323562622,+0.4603559076786041,+1.412529468536377+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-163.68423700332642,+-309.94484424591064,+141.2529468536377+],+"forward": [+-0.8780401945114136,+0.13083499670028687,+-0.4603559076786041+],+"up": [+-0.45532283186912537,+0.06788729876279831,+0.8877345323562622+],+"lens_mm": 25.960494995117188,+"fstop": 2.799999952316284,+"focus_cm": 153.5331565886736+},+{+"blender_frame": 438,+"matrix_world": [+[+-0.15160755813121796,+-0.45677050948143005,+0.876570463180542,+-1.6436442136764526+],+[+0.9884408116340637,+-0.07006418704986572,+0.13444648683071136,+3.1046700477600098+],+[+5.000736564397812e-06,+0.8868211507797241,+0.46211281418800354,+1.4119914770126343+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-164.36442136764526,+-310.467004776001,+141.19914770126343+],+"forward": [+-0.8765705823898315,+0.13444650173187256,+-0.4621128737926483+],+"up": [+-0.45677050948143005,+0.07006418704986572,+0.8868211507797241+],+"lens_mm": 25.962299346923828,+"fstop": 2.799999952316284,+"focus_cm": 153.08154076337814+},+{+"blender_frame": 439,+"matrix_world": [+[+-0.1557968258857727,+-0.458181768655777,+0.8750982284545898,+-1.6503499746322632+],+[+0.9877892136573792,+-0.07224992662668228,+0.13803115487098694,+3.1097710132598877+],+[+-1.7571263015270233e-05,+0.8859173655509949,+0.46384331583976746,+1.411603331565857+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-165.03499746322632,+-310.97710132598877,+141.1603331565857+],+"forward": [+-0.8750982284545898,+0.13803115487098694,+-0.46384331583976746+],+"up": [+-0.4581817090511322,+0.07224991917610168,+0.8859172463417053+],+"lens_mm": 25.964061737060547,+"fstop": 2.799999952316284,+"focus_cm": 152.64461375772953+},+{+"blender_frame": 440,+"matrix_world": [+[+-0.1599603146314621,+-0.45956283807754517,+0.8736216425895691,+-1.6569557189941406+],+[+0.9871234893798828,+-0.07443950325250626,+0.141584113240242,+3.114741086959839+],+[+-3.483856562525034e-05,+0.8850202560424805,+0.46555259823799133,+1.4113483428955078+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-165.69557189941406,+-311.4741086959839,+141.13483428955078+],+"forward": [+-0.8736216425895691,+0.141584113240242,+-0.46555259823799133+],+"up": [+-0.45956283807754517,+0.07443950325250626,+0.8850202560424805+],+"lens_mm": 25.965784072875977,+"fstop": 2.799999952316284,+"focus_cm": 152.22174618393183+},+{+"blender_frame": 441,+"matrix_world": [+[+-0.1640910804271698,+-0.4609210789203644,+0.8721386194229126,+-1.6634533405303955+],+[+0.9864451885223389,+-0.07662799209356308,+0.14510008692741394,+3.1195719242095947+],+[+-4.945660475641489e-05,+0.884126603603363,+0.46724733710289,+1.4112036228179932+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-166.34533405303955,+-311.9571924209595,+141.12036228179932+],+"forward": [+-0.8721387386322021,+0.14510010182857513,+-0.4672473967075348+],+"up": [+-0.46092113852500916,+0.07662799954414368,+0.8841267228126526+],+"lens_mm": 25.967464447021484,+"fstop": 2.799999952316284,+"focus_cm": 151.81239359080791+},+{+"blender_frame": 442,+"matrix_world": [+[+-0.16818168759346008,+-0.46226486563682556,+0.8706469535827637,+-1.6698338985443115+],+[+0.9857560396194458,+-0.07881063967943192,+0.1485731303691864,+3.124255895614624+],+[+-6.389687769114971e-05,+0.8832327127456665,+0.46893495321273804,+1.4111428260803223+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-166.98338985443115,+-312.4255895614624,+141.11428260803223+],+"forward": [+-0.8706469535827637,+0.1485731303691864,+-0.46893495321273804+],+"up": [+-0.46226486563682556,+0.07881063967943192,+0.8832327127456665+],+"lens_mm": 25.96910285949707,+"fstop": 2.799999952316284,+"focus_cm": 151.41577571630478+},+{+"blender_frame": 443,+"matrix_world": [+[+-0.17222486436367035,+-0.4636020064353943,+0.8691443204879761,+-1.6760863065719604+],+[+0.9850577116012573,+-0.08098293840885162,+0.15199726819992065,+3.1287877559661865+],+[+-8.037511724978685e-05,+0.8823350071907043,+0.4706219732761383,+1.4111380577087402+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-167.60863065719604,+-312.87877559661865,+141.11380577087402+],+"forward": [+-0.8691443204879761,+0.15199726819992065,+-0.4706219732761383+],+"up": [+-0.4636020064353943,+0.08098293840885162,+0.8823350071907043+],+"lens_mm": 25.970699310302734,+"fstop": 2.799999952316284,+"focus_cm": 151.03133395314217+},+{+"blender_frame": 444,+"matrix_world": [+[+-0.17621324956417084,+-0.4649389684200287,+0.8676292896270752,+-1.682199478149414+],+[+0.9843520522117615,+-0.08314055949449539,+0.15536653995513916,+3.1331632137298584+],+[+-0.00010077992919832468,+0.8814303278923035,+0.4723140597343445,+1.4111621379852295+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-168.2199478149414,+-313.31632137298584,+141.11621379852295+],+"forward": [+-0.8676294088363647,+0.15536655485630035,+-0.47231411933898926+],+"up": [+-0.4649389684200287,+0.08314055949449539,+0.8814303278923035+],+"lens_mm": 25.97225570678711,+"fstop": 2.799999952316284,+"focus_cm": 150.65853744745255+},+{+"blender_frame": 445,+"matrix_world": [+[+-0.18013939261436462,+-0.46628066897392273,+0.8661017417907715,+-1.6881626844406128+],+[+0.9836410284042358,+-0.08527909964323044,+0.15867482125759125,+3.1373791694641113+],+[+-0.0001266357721760869,+0.880516767501831,+0.47401493787765503,+1.4111887216567993+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-168.81626844406128,+-313.73791694641113,+141.11887216567993+],+"forward": [+-0.8661017417907715,+0.15867482125759125,+-0.47401493787765503+],+"up": [+-0.46628066897392273,+0.08527909964323044,+0.880516767501831+],+"lens_mm": 25.97376823425293,+"fstop": 2.799999952316284,+"focus_cm": 150.29676966369152+},+{+"blender_frame": 446,+"matrix_world": [+[+-0.1839962899684906,+-0.4676307737827301,+0.8645616173744202,+-1.6939672231674194+],+[+0.9829269647598267,+-0.08739453554153442,+0.16191622614860535,+3.141434907913208+],+[+-0.000159048693603836,+0.8795928359031677,+0.4757271707057953,+1.4111956357955933+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-169.39672231674194,+-314.1434907913208,+141.11956357955933+],+"forward": [+-0.8645616173744202,+0.16191622614860535,+-0.4757271707057953+],+"up": [+-0.4676308333873749,+0.08739454299211502,+0.8795929551124573+],+"lens_mm": 25.975238800048828,+"fstop": 2.799999952316284,+"focus_cm": 149.9455228447914+},+{+"blender_frame": 447,+"matrix_world": [+[+-0.18777622282505035,+-0.468990296125412,+0.8630111217498779,+-1.6996045112609863+],+[+0.9822118282318115,+-0.08948232978582382,+0.16508440673351288,+3.145328998565674+],+[+-0.00019873210112564266,+0.878658652305603,+0.47745054960250854,+1.4111636877059937+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-169.96045112609863,+-314.5328998565674,+141.11636877059937+],+"forward": [+-0.8630111217498779,+0.16508440673351288,+-0.47745054960250854+],+"up": [+-0.468990296125412,+0.08948232978582382,+0.878658652305603+],+"lens_mm": 25.976669311523438,+"fstop": 2.799999952316284,+"focus_cm": 149.60438087582588+},+{+"blender_frame": 448,+"matrix_world": [+[+-0.19147378206253052,+-0.4703581929206848,+0.8614527583122253,+-1.7050693035125732+],+[+0.9814977049827576,+-0.09153903275728226,+0.16817514598369598,+3.1490633487701416+],+[+-0.00024599977768957615,+0.877714991569519,+0.4791828989982605,+1.4110780954360962+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-170.50693035125732,+-314.90633487701416,+141.10780954360962+],+"forward": [+-0.8614527583122253,+0.16817514598369598,+-0.4791828989982605+],+"up": [+-0.4703582525253296,+0.09153904020786285,+0.8777151107788086+],+"lens_mm": 25.978055953979492,+"fstop": 2.799999952316284,+"focus_cm": 149.2728490382433+},+{+"blender_frame": 449,+"matrix_world": [+[+-0.19508080184459686,+-0.4717317521572113,+0.8598909378051758,+-1.710357427597046+],+[+0.9807872176170349,+-0.0935596451163292,+0.17118176817893982,+3.1526381969451904+],+[+-0.0003007920167874545,+0.8767642974853516,+0.48092010617256165,+1.4109283685684204+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-171.0357427597046,+-315.26381969451904,+141.09283685684204+],+"forward": [+-0.8598910570144653,+0.171181783080101,+-0.4809201657772064+],+"up": [+-0.4717318117618561,+0.09355965256690979,+0.8767644166946411+],+"lens_mm": 25.979402542114258,+"fstop": 2.799999952316284,+"focus_cm": 148.95056076347828+},+{+"blender_frame": 450,+"matrix_world": [+[+-0.19859221577644348,+-0.4731062352657318,+0.8583307862281799,+-1.715466856956482+],+[+0.980082094669342,+-0.0955406054854393,+0.17410056293010712,+3.1560568809509277+],+[+-0.00036262351204641163,+0.8758096694946289,+0.4826565682888031,+1.4107078313827515+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-171.5466856956482,+-315.6056880950928,+141.07078313827515+],+"forward": [+-0.8583307862281799,+0.17410056293010712,+-0.4826565682888031+],+"up": [+-0.4731062352657318,+0.0955406054854393,+0.8758096694946289+],+"lens_mm": 25.98070526123047,+"fstop": 2.799999952316284,+"focus_cm": 148.63710701465607+},+{+"blender_frame": 451,+"matrix_world": [+[+-0.20200225710868835,+-0.47447526454925537,+0.8567778468132019,+-1.7203975915908813+],+[+0.9793850779533386,+-0.0974777489900589,+0.17692707479000092,+3.159322500228882+],+[+-0.00043074972927570343,+0.874855101108551,+0.4843846261501312,+1.410413384437561+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-172.03975915908813,+-315.9322500228882,+141.0413384437561+],+"forward": [+-0.8567779660224915,+0.1769270896911621,+-0.484384685754776+],+"up": [+-0.47447526454925537,+0.0974777489900589,+0.874855101108551+],+"lens_mm": 25.981966018676758,+"fstop": 2.799999952316284,+"focus_cm": 148.33219349384308+},+{+"blender_frame": 452,+"matrix_world": [+[+-0.2053050845861435,+-0.4758317172527313,+0.8552390933036804,+-1.725150227546692+],+[+0.9786979556083679,+-0.09936683624982834,+0.17965705692768097,+3.16243839263916+],+[+-0.0005041283438913524,+0.8739052414894104,+0.486096054315567,+1.4100457429885864+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-172.5150227546692,+-316.243839263916,+141.00457429885864+],+"forward": [+-0.85523921251297,+0.17965707182884216,+-0.4860961139202118+],+"up": [+-0.4758317172527313,+0.09936683624982834,+0.8739052414894104+],+"lens_mm": 25.983184814453125,+"fstop": 2.799999952316284,+"focus_cm": 148.03561605513096+},+{+"blender_frame": 453,+"matrix_world": [+[+-0.20849648118019104,+-0.4771678149700165,+0.8537213802337646,+-1.729727864265442+],+[+0.9780229330062866,+-0.10120437294244766,+0.18228769302368164,+3.1654088497161865+],+[+-0.0005814734613522887,+0.8729653358459473,+0.4877818524837494,+1.4096077680587769+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-172.9727864265442,+-316.54088497161865,+140.96077680587769+],+"forward": [+-0.8537213802337646,+0.18228769302368164,+-0.4877818524837494+],+"up": [+-0.47716787457466125,+0.10120438784360886,+0.8729654550552368+],+"lens_mm": 25.98436164855957,+"fstop": 2.799999952316284,+"focus_cm": 147.7470524609089+},+{+"blender_frame": 454,+"matrix_world": [+[+-0.21157164871692657,+-0.4784747064113617,+0.852232038974762,+-1.7341331243515015+],+[+0.9773622751235962,+-0.10298638045787811,+0.18481560051441193,+3.168238639831543+],+[+-0.0006612950237467885,+0.8720411658287048,+0.489432156085968,+1.409104824066162+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-173.41331243515015,+-316.8238639831543,+140.9104824066162+],+"forward": [+-0.852232038974762,+0.18481560051441193,+-0.489432156085968+],+"up": [+-0.4784747064113617,+0.10298638045787811,+0.8720411658287048+],+"lens_mm": 25.985496520996094,+"fstop": 2.799999952316284,+"focus_cm": 147.46651276946068+},+{+"blender_frame": 455,+"matrix_world": [+[+-0.21452651917934418,+-0.4797443449497223,+0.8507784008979797,+-1.738370418548584+],+[+0.9767178297042847,+-0.10470936447381973,+0.1872381865978241,+3.1709327697753906+],+[+-0.0007419915637001395,+0.8711379766464233,+0.4910378158092499,+1.4085432291030884+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-173.8370418548584,+-317.09327697753906,+140.85432291030884+],+"forward": [+-0.8507782816886902,+0.1872381716966629,+-0.4910377562046051+],+"up": [+-0.4797443449497223,+0.10470936447381973,+0.8711379766464233+],+"lens_mm": 25.986587524414062,+"fstop": 2.799999952316284,+"focus_cm": 147.19375148415565+},+{+"blender_frame": 456,+"matrix_world": [+[+-0.21735820174217224,+-0.48096778988838196,+0.8493677377700806,+-1.742443561553955+],+[+0.9760916829109192,+-0.10637018829584122,+0.18955378234386444,+3.173496723175049+],+[+-0.0008218556176871061,+0.8702617287635803,+0.4925890564918518,+1.407930850982666+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-174.2443561553955,+-317.3496723175049,+140.7930850982666+],+"forward": [+-0.8493677377700806,+0.18955378234386444,+-0.4925890564918518+],+"up": [+-0.48096778988838196,+0.10637018829584122,+0.8702617287635803+],+"lens_mm": 25.98763656616211,+"fstop": 2.799999952316284,+"focus_cm": 146.92888595163822+},+{+"blender_frame": 457,+"matrix_world": [+[+-0.22006292641162872,+-0.4821380376815796,+0.8480066657066345,+-1.7463572025299072+],+[+0.9754853248596191,+-0.10796570032835007,+0.19176003336906433,+3.175935983657837+],+[+-0.000899176113307476,+0.8694171905517578,+0.49407777190208435,+1.4072762727737427+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-174.63572025299072,+-317.5935983657837,+140.72762727737427+],+"forward": [+-0.8480066657066345,+0.19176003336906433,+-0.49407777190208435+],+"up": [+-0.48213809728622437,+0.10796571522951126,+0.8694173097610474+],+"lens_mm": 25.988643646240234,+"fstop": 2.799999952316284,+"focus_cm": 146.67176231741905+},+{+"blender_frame": 458,+"matrix_world": [+[+-0.22263941168785095,+-0.4832474887371063,+0.8467016816139221,+-1.750114917755127+],+[+0.9749003648757935,+-0.10949373245239258,+0.1938566118478775,+3.1782562732696533+],+[+-0.0009721980895847082,+0.8686099052429199,+0.4954957067966461,+1.4065876007080078+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-175.0114917755127,+-317.82562732696533,+140.65876007080078+],+"forward": [+-0.8467016816139221,+0.1938566118478775,+-0.4954957067966461+],+"up": [+-0.48324742913246155,+0.10949371755123138,+0.8686097860336304+],+"lens_mm": 25.989608764648438,+"fstop": 2.799999952316284,+"focus_cm": 146.422566100955+},+{+"blender_frame": 459,+"matrix_world": [+[+-0.22508426010608673,+-0.4842899441719055,+0.8454586267471313,+-1.753720998764038+],+[+0.9743387699127197,+-0.11095128953456879,+0.19584129750728607,+3.1804630756378174+],+[+-0.0010392483090981841,+0.8678439259529114,+0.4968358874320984,+1.4058738946914673+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-175.3720998764038,+-318.04630756378174,+140.58738946914673+],+"forward": [+-0.8454586267471313,+0.19584129750728607,+-0.4968358874320984+],+"up": [+-0.4842899441719055,+0.11095128953456879,+0.8678439259529114+],+"lens_mm": 25.990530014038086,+"fstop": 2.799999952316284,+"focus_cm": 146.18130438029766+},+{+"blender_frame": 460,+"matrix_world": [+[+-0.22739601135253906,+-0.4852604866027832,+0.8442826867103577,+-1.757178783416748+],+[+0.9738017916679382,+-0.11233658343553543,+0.19771353900432587,+3.1825618743896484+],+[+-0.0010987326968461275,+0.8671232461929321,+0.4980924725532532,+1.4051437377929688+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-175.7178783416748,+-318.25618743896484,+140.51437377929688+],+"forward": [+-0.8442826867103577,+0.19771353900432587,+-0.4980924725532532+],+"up": [+-0.485260546207428,+0.11233659833669662,+0.8671233654022217+],+"lens_mm": 25.991409301757812,+"fstop": 2.799999952316284,+"focus_cm": 145.94818651676178+},+{+"blender_frame": 461,+"matrix_world": [+[+-0.22957433760166168,+-0.4861544072628021,+0.8431782126426697,+-1.7604914903640747+],+[+0.9732905030250549,+-0.11364836245775223,+0.19947367906570435,+3.1845579147338867+],+[+-0.0011491808108985424,+0.8664513826370239,+0.4992601275444031,+1.404404640197754+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-176.04914903640747,+-318.4557914733887,+140.4404640197754+],+"forward": [+-0.8431783318519592,+0.19947370886802673,+-0.49926018714904785+],+"up": [+-0.4861544072628021,+0.11364836245775223,+0.8664513826370239+],+"lens_mm": 25.992246627807617,+"fstop": 2.799999952316284,+"focus_cm": 145.72337418794632+},+{+"blender_frame": 462,+"matrix_world": [+[+-0.23161767423152924,+-0.4869685173034668,+0.842149019241333,+-1.763661503791809+],+[+0.9728061556816101,+-0.11488498747348785,+0.20112085342407227,+3.1864569187164307+],+[+-0.0011892430484294891,+0.8658308386802673,+0.5003353953361511,+1.4036647081375122+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-176.3661503791809,+-318.64569187164307,+140.36647081375122+],+"forward": [+-0.842149019241333,+0.20112085342407227,+-0.5003353953361511+],+"up": [+-0.4869685769081116,+0.11488500237464905,+0.8658309578895569+],+"lens_mm": 25.993040084838867,+"fstop": 2.799999952316284,+"focus_cm": 145.5070573836565+},+{+"blender_frame": 463,+"matrix_world": [+[+-0.23352502286434174,+-0.4877009689807892,+0.8411979079246521,+-1.7666910886764526+],+[+0.972350001335144,+-0.11604531109333038,+0.2026546150445938,+3.188263416290283+],+[+-0.0012177863391116261,+0.8652637004852295,+0.5013155341148376,+1.4029313325881958+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-176.66910886764526,+-318.8263416290283,+140.29313325881958+],+"forward": [+-0.8411979079246521,+0.2026546150445938,+-0.5013155341148376+],+"up": [+-0.4877009689807892,+0.11604531109333038,+0.8652637004852295+],+"lens_mm": 25.993791580200195,+"fstop": 2.799999952316284,+"focus_cm": 145.29947377741337+},+{+"blender_frame": 464,+"matrix_world": [+[+-0.2352970391511917,+-0.48834988474845886,+0.8403272032737732,+-1.7695815563201904+],+[+0.9719228148460388,+-0.11712896823883057,+0.20407600700855255,+3.189981698989868+],+[+-0.001233842340297997,+0.8647515177726746,+0.5021984577178955,+1.40221107006073+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-176.95815563201904,+-318.9981698989868,+140.221107006073+],+"forward": [+-0.8403272032737732,+0.20407600700855255,+-0.5021984577178955+],+"up": [+-0.48834988474845886,+0.11712896823883057,+0.8647515177726746+],+"lens_mm": 25.99449920654297,+"fstop": 2.799999952316284,+"focus_cm": 145.1008964329958+},+{+"blender_frame": 465,+"matrix_world": [+[+-0.23693424463272095,+-0.48891520500183105,+0.8395380973815918,+-1.772334337234497+],+[+0.9715250134468079,+-0.11813585460186005,+0.20538568496704102,+3.191615343093872+],+[+-0.0012366273440420628,+0.8642950057983398,+0.5029836893081665,+1.4015107154846191+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-177.2334337234497,+-319.1615343093872,+140.1510715484619+],+"forward": [+-0.8395380973815918,+0.20538568496704102,+-0.5029836893081665+],+"up": [+-0.48891520500183105,+0.11813585460186005,+0.8642950057983398+],+"lens_mm": 25.99516487121582,+"fstop": 2.799999952316284,+"focus_cm": 144.91155073046684+},+{+"blender_frame": 466,+"matrix_world": [+[+-0.238436758518219,+-0.48939719796180725,+0.8388315439224243,+-1.7749500274658203+],+[+0.9711573123931885,+-0.11906564235687256,+0.20658403635025024,+3.1931686401367188+],+[+-0.0012256207410246134,+0.8638945817947388,+0.5036712884902954,+1.40083646774292+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-177.49500274658203,+-319.3168640136719,+140.083646774292+],+"forward": [+-0.8388315439224243,+0.20658403635025024,+-0.5036712884902954+],+"up": [+-0.48939719796180725,+0.11906564235687256,+0.8638945817947388+],+"lens_mm": 25.995786666870117,+"fstop": 2.799999952316284,+"focus_cm": 144.731729850173+},+{+"blender_frame": 467,+"matrix_world": [+[+-0.23980499804019928,+-0.4897976815700531,+0.838207483291626,+-1.777429223060608+],+[+0.970820426940918,+-0.11991844326257706,+0.20767147839069366,+3.194643497467041+],+[+-0.0012004664167761803,+0.8635494709014893,+0.5042626261711121,+1.4001944065093994+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-177.7429223060608,+-319.4643497467041,+140.01944065093994+],+"forward": [+-0.838207483291626,+0.20767147839069366,+-0.5042626261711121+],+"up": [+-0.4897977411746979,+0.11991845816373825,+0.8635495901107788+],+"lens_mm": 25.996366500854492,+"fstop": 2.799999952316284,+"focus_cm": 144.56163756549358+},+{+"blender_frame": 468,+"matrix_world": [+[+-0.24103985726833344,+-0.49011802673339844,+0.837665855884552,+-1.7797714471817017+],+[+0.9705145359039307,+-0.12069440633058548,+0.20864902436733246,+3.19604229927063+],+[+-0.0011610689107328653,+0.8632596135139465,+0.5047588348388672,+1.3995897769927979+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-177.97714471817017,+-319.604229927063,+139.95897769927979+],+"forward": [+-0.8376659750938416,+0.20864905416965485,+-0.504758894443512+],+"up": [+-0.49011802673339844,+0.12069440633058548,+0.8632596135139465+],+"lens_mm": 25.996904373168945,+"fstop": 2.799999952316284,+"focus_cm": 144.40166428685188+},+{+"blender_frame": 469,+"matrix_world": [+[+-0.24214273691177368,+-0.49036136269569397,+0.8372052907943726,+-1.7819769382476807+],+[+0.97024005651474,+-0.12139430642127991,+0.2095179259777069,+3.197366237640381+],+[+-0.0011075395159423351,+0.8630232810974121,+0.5051628947257996,+1.3990285396575928+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-178.19769382476807,+-319.7366237640381,+139.90285396575928+],+"forward": [+-0.8372052907943726,+0.2095179259777069,+-0.5051628947257996+],+"up": [+-0.49036136269569397,+0.12139430642127991,+0.8630232810974121+],+"lens_mm": 25.997398376464844,+"fstop": 2.799999952316284,+"focus_cm": 144.25196796655655+},+{+"blender_frame": 470,+"matrix_world": [+[+-0.24311569333076477,+-0.49052974581718445,+0.8368244767189026,+-1.784044861793518+],+[+0.9699967503547668,+-0.12201894074678421,+0.21028003096580505,+3.1986162662506104+],+[+-0.001040167873725295,+0.8628395199775696,+0.5054770112037659,+1.3985153436660767+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-178.4044861793518,+-319.86162662506104,+139.85153436660767+],+"forward": [+-0.8368245959281921,+0.21028006076812744,+-0.5054770708084106+],+"up": [+-0.49052974581718445,+0.12201894074678421,+0.8628395199775696+],+"lens_mm": 25.99785041809082,+"fstop": 2.799999952316284,+"focus_cm": 144.11287233233452+},+{+"blender_frame": 471,+"matrix_world": [+[+-0.24396079778671265,+-0.4906269609928131,+0.8365216255187988,+-1.785974144935608+],+[+0.969784677028656,+-0.12256946414709091,+0.2109372317790985,+3.1997928619384766+],+[+-0.0009594832081347704,+0.8627061247825623,+0.5057046413421631,+1.3980555534362793+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-178.5974144935608,+-319.97928619384766,+139.80555534362793+],+"forward": [+-0.8365216255187988,+0.2109372317790985,+-0.5057046413421631+],+"up": [+-0.4906270205974579,+0.1225694790482521,+0.8627062439918518+],+"lens_mm": 25.998258590698242,+"fstop": 2.799999952316284,+"focus_cm": 143.98472383618355+},+{+"blender_frame": 472,+"matrix_world": [+[+-0.24467894434928894,+-0.4906570017337799,+0.8362941741943359,+-1.787764549255371+],+[+0.9696037769317627,+-0.12304633110761642,+0.21149027347564697,+3.200894832611084+],+[+-0.000866258516907692,+0.8626211285591125,+0.5058497190475464,+1.3976540565490723+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-178.7764549255371,+-320.0894832611084,+139.76540565490723+],+"forward": [+-0.8362941741943359,+0.21149027347564697,+-0.5058497190475464+],+"up": [+-0.4906570613384247,+0.12304634600877762,+0.8626212477684021+],+"lens_mm": 25.99862289428711,+"fstop": 2.799999952316284,+"focus_cm": 143.86760219931602+},+{+"blender_frame": 473,+"matrix_world": [+[+-0.24527229368686676,+-0.4906257390975952,+0.8361387848854065,+-1.7894105911254883+],+[+0.9694539308547974,+-0.12345273047685623,+0.21193987131118774,+3.201923370361328+],+[+-0.0007595380302518606,+0.8625810146331787,+0.505918562412262,+1.3973078727722168+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-178.94105911254883,+-320.1923370361328,+139.73078727722168+],+"forward": [+-0.8361387848854065,+0.21193987131118774,+-0.505918562412262+],+"up": [+-0.49062567949295044,+0.12345271557569504,+0.8625808954238892+],+"lens_mm": 25.998947143554688,+"fstop": 2.799999952316284,+"focus_cm": 143.76191347837448+},+{+"blender_frame": 474,+"matrix_world": [+[+-0.24574163556098938,+-0.4905349612236023,+0.8360540866851807,+-1.7909153699874878+],+[+0.96933513879776,+-0.12378647923469543,+0.21228820085525513,+3.2028729915618896+],+[+-0.0006425834726542234,+0.86258465051651,+0.5059123039245605,+1.3970297574996948+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.09153699874878,+-320.28729915618896,+139.70297574996948+],+"forward": [+-0.8360540866851807,+0.21228820085525513,+-0.5059123039245605+],+"up": [+-0.49053502082824707,+0.12378649413585663,+0.8625847697257996+],+"lens_mm": 25.999225616455078,+"fstop": 2.799999952316284,+"focus_cm": 143.6677061021328+},+{+"blender_frame": 475,+"matrix_world": [+[+-0.24608905613422394,+-0.49038833379745483,+0.8360378742218018,+-1.7922770977020264+],+[+0.9692471623420715,+-0.12404818832874298,+0.21253734827041626,+3.2037417888641357+],+[+-0.0005168601637706161,+0.8626304864883423,+0.5058343410491943,+1.396823525428772+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.22770977020264,+-320.3741788864136,+139.6823525428772+],+"forward": [+-0.8360379934310913,+0.21253737807273865,+-0.5058344006538391+],+"up": [+-0.49038833379745483,+0.12404818832874298,+0.8626304864883423+],+"lens_mm": 25.999462127685547,+"fstop": 2.799999952316284,+"focus_cm": 143.58538910746574+},+{+"blender_frame": 476,+"matrix_world": [+[+-0.24631647765636444,+-0.4901910126209259,+0.8360867500305176,+-1.7934941053390503+],+[+0.9691894054412842,+-0.12423884868621826,+0.2126891016960144,+3.2045254707336426+],+[+-0.0003838468110188842,+0.8627151846885681,+0.5056899785995483,+1.396693229675293+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.34941053390503,+-320.45254707336426,+139.6693229675293+],+"forward": [+-0.8360867500305176,+0.2126891016960144,+-0.5056899785995483+],+"up": [+-0.4901910126209259,+0.12423884868621826,+0.8627151846885681+],+"lens_mm": 25.999656677246094,+"fstop": 2.799999952316284,+"focus_cm": 143.51500272750854+},+{+"blender_frame": 477,+"matrix_world": [+[+-0.2464257925748825,+-0.48994702100753784,+0.8361974358558655,+-1.7945632934570312+],+[+0.9691616296768188,+-0.1243591457605362,+0.21274524927139282,+3.2052206993103027+],+[+-0.00024509301874786615,+0.862836480140686,+0.5054831504821777,+1.3966405391693115+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.45632934570312,+-320.5220699310303,+139.66405391693115+],+"forward": [+-0.836197555065155,+0.2127452790737152,+-0.5054832100868225+],+"up": [+-0.48994702100753784,+0.1243591457605362,+0.862836480140686+],+"lens_mm": 25.999807357788086,+"fstop": 2.799999952316284,+"focus_cm": 143.4569090604782+},+{+"blender_frame": 478,+"matrix_world": [+[+-0.24641910195350647,+-0.4896615445613861,+0.8363667130470276,+-1.7954821586608887+],+[+0.9691633582115173,+-0.12441015988588333,+0.2127075344324112,+3.205822706222534+],+[+-0.00010218156967312098,+0.8629910945892334,+0.5052191615104675,+1.3966667652130127+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.54821586608887,+-320.5822706222534,+139.66667652130127+],+"forward": [+-0.836366593837738,+0.2127075046300888,+-0.5052191019058228+],+"up": [+-0.4896615445613861,+0.12441015988588333,+0.8629910945892334+],+"lens_mm": 25.999914169311523,+"fstop": 2.799999952316284,+"focus_cm": 143.41107830405235+},+{+"blender_frame": 479,+"matrix_world": [+[+-0.24629896879196167,+-0.48933929204940796,+0.8365906476974487,+-1.7962464094161987+],+[+0.9691939353942871,+-0.12439317256212234,+0.21257826685905457,+3.206327438354492+],+[+4.3264939449727535e-05,+0.8631762862205505,+0.5049025416374207,+1.3967725038528442+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.62464094161987,+-320.6327438354492,+139.67725038528442+],+"forward": [+-0.8365906476974487,+0.21257826685905457,+-0.5049025416374207+],+"up": [+-0.48933935165405273,+0.12439318746328354,+0.8631764054298401+],+"lens_mm": 25.99997901916504,+"fstop": 2.799999952316284,+"focus_cm": 143.37785840034485+},+{+"blender_frame": 480,+"matrix_world": [+[+-0.2460673600435257,+-0.488985151052475,+0.8368657827377319,+-1.7968522310256958+],+[+0.9692528247833252,+-0.12430916726589203,+0.21235911548137665,+3.2067298889160156+],+[+0.00018963671755045652,+0.8633890748023987,+0.5045386552810669,+1.3969565629959106+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.68522310256958,+-320.67298889160156,+139.69565629959106+],+"forward": [+-0.8368657827377319,+0.21235911548137665,+-0.5045386552810669+],+"up": [+-0.488985151052475,+0.12430916726589203,+0.8633890748023987+],+"lens_mm": 26.0,+"fstop": 2.799999952316284,+"focus_cm": 143.3573454618454+},+{+"blender_frame": 481,+"matrix_world": [+[+-0.2460673600435257,+-0.488985151052475,+0.8368657827377319,+-1.7968522310256958+],+[+0.9692528247833252,+-0.12430916726589203,+0.21235911548137665,+3.2067298889160156+],+[+0.00018963671755045652,+0.8633890748023987,+0.5045386552810669,+1.3969565629959106+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.68522310256958,+-320.67298889160156,+139.69565629959106+],+"forward": [+-0.8368657827377319,+0.21235911548137665,+-0.5045386552810669+],+"up": [+-0.488985151052475,+0.12430916726589203,+0.8633890748023987+],+"lens_mm": 26.0,+"fstop": 2.799999952316284,+"focus_cm": 143.3573454618454+}+]+}\ No newline at end of filediff --git a/unreal_demo/cams/h2_walk_tables_neon.json b/unreal_demo/cams/h2_walk_tables_neon.jsonnew file mode 100644index 0000000..acd347c--- /dev/null+++ b/unreal_demo/cams/h2_walk_tables_neon.json@@ -0,0 +1,19286 @@+{+"shot": "h2_walk_tables_neon",+"fps": 24,+"frames_n": 408,+"res": [+1920,+804+],+"sensor_width_mm": 24.889999389648438,+"sensor_height_mm": 10.422687244415282,+"dof": true,+"seed": 0,+"shutter_deg": 180.0,+"frames": [+{+"blender_frame": 0,+"matrix_world": [+[+-0.8678900003433228,+-0.010800412856042385,+0.4966390132904053,+2.905494213104248+],+[+0.4967542588710785,+-0.01589914970099926,+0.8677456378936768,+9.796061515808105+],+[+-0.0014758720062673092,+0.9998151659965515,+0.019163863733410835,+1.4666657447814941+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.5494213104248,+-979.6061515808105,+146.6665744781494+],+"forward": [+-0.4966390132904053,+0.8677456378936768,+-0.019163863733410835+],+"up": [+-0.01080041378736496,+0.01589915156364441,+0.9998152852058411+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 784.0067253448069+},+{+"blender_frame": 1,+"matrix_world": [+[+-0.8678900003433228,+-0.010800412856042385,+0.4966390132904053,+2.905494213104248+],+[+0.4967542588710785,+-0.01589914970099926,+0.8677456378936768,+9.796061515808105+],+[+-0.0014758720062673092,+0.9998151659965515,+0.019163863733410835,+1.4666657447814941+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.5494213104248,+-979.6061515808105,+146.6665744781494+],+"forward": [+-0.4966390132904053,+0.8677456378936768,+-0.019163863733410835+],+"up": [+-0.01080041378736496,+0.01589915156364441,+0.9998152852058411+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 784.0067253448069+},+{+"blender_frame": 2,+"matrix_world": [+[+-0.8679747581481934,+-0.010774324648082256,+0.49649158120155334,+2.9058327674865723+],+[+0.4966064691543579,+-0.01596556417644024,+0.8678289651870728,+9.795055389404297+],+[+-0.0014235017588362098,+0.9998143911361694,+0.019208306446671486,+1.4662436246871948+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.5832767486572,+-979.5055389404297,+146.62436246871948+],+"forward": [+-0.4964916408061981,+0.8678290843963623,+-0.019208308309316635+],+"up": [+-0.010774325579404831,+0.015965566039085388,+0.999814510345459+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 783.9352727402002+},+{+"blender_frame": 3,+"matrix_world": [+[+-0.8680582046508789,+-0.010753685608506203,+0.49634599685668945,+2.9061245918273926+],+[+0.4964606463909149,+-0.01604517549276352,+0.8679108619689941,+9.793725967407227+],+[+-0.001369281206279993,+0.9998133778572083,+0.019266927614808083,+1.4658282995224+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.61245918273926,+-979.3725967407227,+146.58282995224+],+"forward": [+-0.49634605646133423,+0.8679109811782837,+-0.019266929477453232+],+"up": [+-0.010753686539828777,+0.01604517735540867,+0.9998134970664978+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 783.8329883059487+},+{+"blender_frame": 4,+"matrix_world": [+[+-0.8681394457817078,+-0.010728998109698296,+0.49620455503463745,+2.906360149383545+],+[+0.49631884694099426,+-0.016139570623636246,+0.8679903745651245,+9.792085647583008+],+[+-0.001304136705584824,+0.999812126159668,+0.0193364005535841,+1.4654252529144287+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.6360149383545,+-979.2085647583008,+146.54252529144287+],+"forward": [+-0.49620455503463745,+0.8679903745651245,+-0.0193364005535841+],+"up": [+-0.01072899904102087,+0.016139572486281395,+0.9998122453689575+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 783.7002441287041+},+{+"blender_frame": 5,+"matrix_world": [+[+-0.8682166337966919,+-0.010702928528189659,+0.49606984853744507,+2.9065396785736084+],+[+0.4961838722229004,+-0.01624414697289467,+0.8680654168128967,+9.79013442993164+],+[+-0.0012326105497777462,+0.9998106956481934,+0.019414056092500687,+1.465038537979126+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.65396785736084,+-979.0134429931641,+146.5038537979126+],+"forward": [+-0.49606990814208984,+0.8680655360221863,+-0.019414057955145836+],+"up": [+-0.010702929459512234,+0.016244148835539818,+0.9998108148574829+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 783.5366239305586+},+{+"blender_frame": 6,+"matrix_world": [+[+-0.8682881593704224,+-0.010673332028090954,+0.49594536423683167,+2.90665864944458+],+[+0.49605894088745117,+-0.016356931999325752,+0.8681346774101257,+9.787878036499023+],+[+-0.0011537455720826983,+0.9998091459274292,+0.019497130066156387,+1.4646724462509155+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.665864944458,+-978.7878036499023,+146.46724462509155+],+"forward": [+-0.49594542384147644,+0.8681347966194153,+-0.019497131928801537+],+"up": [+-0.010673332959413528,+0.0163569338619709,+0.9998092651367188+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 783.3418057532981+},+{+"blender_frame": 7,+"matrix_world": [+[+-0.8683518171310425,+-0.010638242587447166,+0.495834618806839,+2.9067139625549316+],+[+0.49594762921333313,+-0.016476286575198174,+0.8681961297988892,+9.785322189331055+],+[+-0.0010665666777640581,+0.999807596206665,+0.01958322525024414,+1.4643313884735107+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.67139625549316,+-978.5322189331055,+146.43313884735107+],+"forward": [+-0.495834618806839,+0.8681961297988892,+-0.01958322525024414+],+"up": [+-0.010638243518769741,+0.016476288437843323,+0.9998077154159546+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 783.1157139502466+},+{+"blender_frame": 8,+"matrix_world": [+[+-0.8684056997299194,+-0.010595842264592648,+0.4957412779331207,+2.9067025184631348+],+[+0.4958535432815552,+-0.01660078763961792,+0.8682475686073303,+9.782470703125+],+[+-0.0009701181552372873,+0.9998060464859009,+0.019670207053422928,+1.464018702507019+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.6702518463135,+-978.2470703125,+146.4018702507019+],+"forward": [+-0.49574121832847595,+0.8682474493980408,+-0.01967020519077778+],+"up": [+-0.010595842264592648,+0.01660078763961792,+0.9998060464859009+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 782.8578575514257+},+{+"blender_frame": 9,+"matrix_world": [+[+-0.8684476017951965,+-0.01054449938237667,+0.49566876888275146,+2.906621217727661+],+[+0.49578016996383667,+-0.0167292021214962,+0.8682869076728821,+9.779329299926758+],+[+-0.0008635080303065479,+0.9998043179512024,+0.019756194204092026,+1.4637377262115479+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.6621217727661,+-977.9329299926758,+146.37377262115479+],+"forward": [+-0.49566876888275146,+0.8682869076728821,+-0.019756194204092026+],+"up": [+-0.010544500313699245,+0.01672920398414135,+0.9998044371604919+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 782.5682980474085+},+{+"blender_frame": 10,+"matrix_world": [+[+-0.8684756755828857,+-0.010482843033969402,+0.4956209063529968,+2.906468152999878+],+[+0.4957311451435089,+-0.016860539093613625,+0.8683122992515564,+9.775901794433594+],+[+-0.0007459472399204969,+0.999802827835083,+0.019839638844132423,+1.4634913206100464+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.6468152999878,+-977.5901794433594,+146.34913206100464+],+"forward": [+-0.4956209063529968,+0.8683122992515564,+-0.019839638844132423+],+"up": [+-0.010482843965291977,+0.016860540956258774,+0.9998029470443726+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 782.2467571124434+},+{+"blender_frame": 11,+"matrix_world": [+[+-0.8684878349304199,+-0.010409672744572163,+0.49560126662254333,+2.9062399864196777+],+[+0.49571019411087036,+-0.016993774101138115,+0.8683217763900757,+9.772191047668457+],+[+-0.0006168105755932629,+0.9998013377189636,+0.019919071346521378,+1.463282823562622+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.6239986419678,+-977.2191047668457,+146.3282823562622+],+"forward": [+-0.49560126662254333,+0.8683217763900757,+-0.019919071346521378+],+"up": [+-0.010409673675894737,+0.016993775963783264,+0.9998014569282532+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 781.8930290872231+},+{+"blender_frame": 12,+"matrix_world": [+[+-0.8684820532798767,+-0.010324109345674515,+0.4956132173538208,+2.9059360027313232+],+[+0.4957205355167389,+-0.017127851024270058,+0.8683132529258728,+9.76820182800293+],+[+-0.0004757725400850177,+0.999799907207489,+0.01999310404062271,+1.4631154537200928+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.5936002731323,+-976.820182800293,+146.31154537200928+],+"forward": [+-0.4956132173538208,+0.8683132529258728,+-0.01999310404062271+],+"up": [+-0.01032411027699709,+0.017127852886915207,+0.9998000264167786+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 781.5071240998805+},+{+"blender_frame": 13,+"matrix_world": [+[+-0.8684561252593994,+-0.010225662961602211,+0.49566054344177246,+2.905555248260498+],+[+0.49576592445373535,+-0.017261359840631485,+0.8682845830917358,+9.763938903808594+],+[+-0.00032301092869602144,+0.9997987151145935,+0.020060265436768532,+1.4629948139190674+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.5555248260498,+-976.3938903808594,+146.29948139190674+],+"forward": [+-0.49566060304641724,+0.8682847023010254,+-0.02006026729941368+],+"up": [+-0.010225662961602211,+0.017261359840631485,+0.9997987151145935+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 781.0893415706232+},+{+"blender_frame": 14,+"matrix_world": [+[+-0.868408203125,+-0.010114040225744247,+0.49574699997901917,+2.9050962924957275+],+[+0.495850145816803,+-0.017392367124557495,+0.8682339191436768,+9.759405136108398+],+[+-0.00015913850802462548,+0.9997974634170532,+0.020118726417422295,+1.4629266262054443+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.50962924957275,+-975.9405136108398,+146.29266262054443+],+"forward": [+-0.49574699997901917,+0.8682339191436768,+-0.020118726417422295+],+"up": [+-0.010114041157066822,+0.017392368987202644,+0.9997975826263428+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 780.6395346531644+},+{+"blender_frame": 15,+"matrix_world": [+[+-0.8683358430862427,+-0.009989120066165924,+0.4958762526512146,+2.904559850692749+],+[+0.49597686529159546,+-0.017518239095807076,+0.8681589961051941,+9.754603385925293+],+[+1.4732708223164082e-05,+0.9997965693473816,+0.02016608789563179,+1.462918996810913+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.4559850692749,+-975.4603385925293,+146.2918996810913+],+"forward": [+-0.4958763122558594,+0.8681591153144836,+-0.02016608975827694+],+"up": [+-0.009989120997488499,+0.017518240958452225,+0.9997966885566711+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 780.1581943174824+},+{+"blender_frame": 16,+"matrix_world": [+[+-0.8682369589805603,+-0.00985097698867321,+0.4960521161556244,+2.9039478302001953+],+[+0.4961499273777008,+-0.017635583877563477,+0.8680577278137207,+9.749536514282227+],+[+0.00019695251830853522,+0.9997958540916443,+0.020199425518512726,+1.462981104850769+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.39478302001953,+-974.9536514282227,+146.2981104850769+],+"forward": [+-0.49605217576026917,+0.8680578470230103,+-0.020199427381157875+],+"up": [+-0.009850977919995785,+0.017635585740208626,+0.9997959733009338+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 779.6452924376354+},+{+"blender_frame": 17,+"matrix_world": [+[+-0.8681094646453857,+-0.0096998680382967,+0.49627819657325745,+2.903261661529541+],+[+0.49637284874916077,+-0.017740247771143913,+0.867928147315979,+9.744208335876465+],+[+0.0003853095113299787,+0.9997954964637756,+0.0202152281999588,+1.4631237983703613+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.3261661529541,+-974.4208335876465,+146.31237983703613+],+"forward": [+-0.49627819657325745,+0.867928147315979,+-0.0202152281999588+],+"up": [+-0.009699868969619274,+0.017740249633789062,+0.9997956156730652+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 779.1012347210199+},+{+"blender_frame": 18,+"matrix_world": [+[+-0.8679509162902832,+-0.00953632965683937,+0.49655845761299133,+2.9025049209594727+],+[+0.49664977192878723,+-0.017827384173870087,+0.8677679300308228,+9.738615989685059+],+[+0.000577016151510179,+0.9997956156730652,+0.020209506154060364,+1.4633594751358032+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.25049209594727,+-973.8615989685059,+146.33594751358032+],+"forward": [+-0.4965585172176361,+0.8677680492401123,+-0.020209508016705513+],+"up": [+-0.00953632965683937,+0.017827384173870087,+0.9997956156730652+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 778.5263016121462+},+{+"blender_frame": 19,+"matrix_world": [+[+-0.8677591681480408,+-0.009361254051327705,+0.49689677357673645,+2.9016826152801514+],+[+0.49698445200920105,+-0.017891624942421913,+0.86757493019104,+9.73276424407959+],+[+0.0007687017787247896,+0.9997960329055786,+0.020178016275167465,+1.4637013673782349+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.16826152801514,+-973.276424407959,+146.3701367378235+],+"forward": [+-0.4968968331813812,+0.8675750494003296,+-0.020178018137812614+],+"up": [+-0.00936125498265028,+0.017891626805067062,+0.9997961521148682+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 777.9209362342954+},+{+"blender_frame": 20,+"matrix_world": [+[+-0.8675318360328674,+-0.009176010265946388,+0.497297078371048,+2.9007997512817383+],+[+0.4973808526992798,+-0.01792742870748043,+0.8673470616340637,+9.726649284362793+],+[+0.0009564713109284639,+0.9997971057891846,+0.020116588100790977,+1.4641624689102173+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.0799751281738,+-972.6649284362793,+146.41624689102173+],+"forward": [+-0.49729713797569275,+0.8673471808433533,+-0.020116589963436127+],+"up": [+-0.009176011197268963,+0.01792743057012558,+0.9997972249984741+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 777.2852576337755+},+{+"blender_frame": 21,+"matrix_world": [+[+-0.8672665357589722,+-0.008982724510133266,+0.49776315689086914,+2.8998634815216064+],+[+0.497842937707901,+-0.017929568886756897,+0.867081880569458,+9.720270156860352+],+[+0.0011359220370650291,+0.9997988939285278,+0.020021701231598854,+1.464754581451416+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.98634815216064,+-972.0270156860352,+146.4754581451416+],+"forward": [+-0.49776315689086914,+0.867081880569458,+-0.020021701231598854+],+"up": [+-0.008982724510133266,+0.017929568886756897,+0.9997988939285278+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 776.6194981988519+},+{+"blender_frame": 22,+"matrix_world": [+[+-0.8669608235359192,+-0.008784400299191475,+0.4982988238334656,+2.8988804817199707+],+[+0.49837449193000793,+-0.01789364591240883,+0.8667771220207214,+9.713624954223633+],+[+0.0013022645143792033,+0.9998012185096741,+0.01989101432263851,+1.4654865264892578+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.88804817199707,+-971.3624954223633,+146.54865264892578+],+"forward": [+-0.4982988238334656,+0.8667771220207214,+-0.01989101432263851+],+"up": [+-0.00878440123051405,+0.017893647775053978,+0.9998013377189636+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 775.9240179788321+},+{+"blender_frame": 23,+"matrix_world": [+[+-0.8666125535964966,+-0.008585263043642044,+0.49890783429145813,+2.897860288619995+],+[+0.4989795982837677,+-0.017816830426454544,+0.8664305806159973,+9.706710815429688+],+[+0.001450421754270792,+0.9998043775558472,+0.019724160432815552,+1.466362476348877+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.7860288619995,+-970.6710815429688,+146.6362476348877+],+"forward": [+-0.49890783429145813,+0.8664305806159973,+-0.019724160432815552+],+"up": [+-0.008585263974964619,+0.017816832289099693,+0.9998044967651367+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 775.1990649849176+},+{+"blender_frame": 24,+"matrix_world": [+[+-0.8662191033363342,+-0.008391103707253933,+0.4995938837528229,+2.8968114852905273+],+[+0.499661922454834,+-0.01769877038896084,+0.8660396933555603,+9.6995210647583+],+[+0.001575168687850237,+0.999808132648468,+0.019523726776242256,+1.4673798084259033+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.68114852905273,+-969.9521064758301,+146.73798084259033+],+"forward": [+-0.49959394335746765,+0.8660398125648499,+-0.019523728638887405+],+"up": [+-0.008391103707253933,+0.01769877038896084,+0.999808132648468+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 774.4445164920762+},+{+"blender_frame": 25,+"matrix_world": [+[+-0.865778386592865,+-0.008209377527236938,+0.5003602504730225,+2.8957440853118896+],+[+0.5004249215126038,+-0.017542202025651932,+0.8656021952629089,+9.69205379486084+],+[+0.0016713675577193499,+0.9998124837875366,+0.019295834004878998,+1.4685266017913818+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.57440853118896,+-969.205379486084,+146.85266017913818+],+"forward": [+-0.5003603100776672,+0.8656023144721985,+-0.019295835867524147+],+"up": [+-0.008209377527236938,+0.017542202025651932,+0.9998124837875366+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 773.660657950677+},+{+"blender_frame": 26,+"matrix_world": [+[+-0.8652881383895874,+-0.008049462921917439,+0.5012102127075195,+2.8946685791015625+],+[+0.5012718439102173,+-0.017353825271129608,+0.8651158809661865,+9.684300422668457+],+[+0.0017341956263408065,+0.9998170733451843,+0.019051026552915573,+1.4697810411453247+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.46685791015625,+-968.4300422668457,+146.97810411453247+],+"forward": [+-0.5012102127075195,+0.8651158809661865,+-0.019051026552915573+],+"up": [+-0.008049462921917439,+0.017353825271129608,+0.9998170733451843+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 772.847370035015+},+{+"blender_frame": 27,+"matrix_world": [+[+-0.8647463321685791,+-0.007922620512545109,+0.5021464228630066,+2.89359450340271+],+[+0.5022057890892029,+-0.017144683748483658,+0.8645781874656677,+9.676257133483887+],+[+0.0017594153760001063,+0.999821662902832,+0.018804587423801422,+1.4711090326309204+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.359450340271,+-967.6257133483887,+147.11090326309204+],+"forward": [+-0.5021464228630066,+0.8645781874656677,+-0.018804587423801422+],+"up": [+-0.007922620512545109,+0.017144683748483658,+0.999821662902832+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 772.0047899521887+},+{+"blender_frame": 28,+"matrix_world": [+[+-0.8641510605812073,+-0.007841751910746098,+0.503171443939209,+2.8925328254699707+],+[+0.5032293796539307,+-0.016930270940065384,+0.8639869689941406,+9.66791820526123+],+[+0.0017436555353924632,+0.9998259544372559,+0.01857651397585869,+1.47246515750885+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.25328254699707,+-966.791820526123,+147.246515750885+],+"forward": [+-0.503171443939209,+0.8639869689941406,+-0.01857651397585869+],+"up": [+-0.007841751910746098,+0.016930270940065384,+0.9998259544372559+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 771.1329848039895+},+{+"blender_frame": 29,+"matrix_world": [+[+-0.8635005950927734,+-0.007820899598300457,+0.5042871236801147,+2.8914923667907715+],+[+0.5043449997901917,+-0.01673024147748947,+0.8633400797843933,+9.65927791595459+],+[+0.001684749498963356,+0.9998295307159424,+0.01839100383222103,+1.473793625831604+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.14923667907715,+-965.927791595459,+147.3793625831604+],+"forward": [+-0.5042871832847595,+0.8633401989936829,+-0.01839100569486618+],+"up": [+-0.007820899598300457,+0.01673024147748947,+0.9998295307159424+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 770.2319274423644+},+{+"blender_frame": 30,+"matrix_world": [+[+-0.8627934455871582,+-0.007874331437051296,+0.5054951906204224,+2.8904809951782227+],+[+0.5055540800094604,+-0.01656741462647915,+0.8626358509063721,+9.6503267288208+],+[+0.0015820679254829884,+0.9998317956924438,+0.018275154754519463,+1.475030779838562+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.04809951782227,+-965.0326728820801,+147.5030779838562+],+"forward": [+-0.5054952502250671,+0.8626359701156616,+-0.018275156617164612+],+"up": [+-0.007874331437051296,+0.01656741462647915,+0.9998317956924438+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 769.301300891675+},+{+"blender_frame": 31,+"matrix_world": [+[+-0.8620285987854004,+-0.00801532156765461,+0.5067964196205139,+2.889507293701172+],+[+0.5068577527999878,+-0.016466204077005386,+0.8618724942207336,+9.641064643859863+],+[+0.001436826540157199,+0.9998323917388916,+0.018256966024637222,+1.4761106967926025+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.9507293701172,+-964.1064643859863,+147.61106967926025+],+"forward": [+-0.5067964196205139,+0.8618724942207336,+-0.018256966024637222+],+"up": [+-0.00801532156765461,+0.016466204077005386,+0.9998323917388916+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 768.3415200095624+},+{+"blender_frame": 32,+"matrix_world": [+[+-0.8612046837806702,+-0.008254645392298698,+0.5081912875175476,+2.8885765075683594+],+[+0.5082567930221558,+-0.016450541093945503,+0.8610484600067139,+9.631479263305664+],+[+0.0012523730983957648,+0.9998307228088379,+0.01836276240646839,+1.4769703149795532+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.85765075683594,+-963.1479263305664,+147.69703149795532+],+"forward": [+-0.5081912875175476,+0.8610484600067139,+-0.01836276240646839+],+"up": [+-0.008254644460976124,+0.016450539231300354,+0.9998306035995483+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 767.3519699834287+},+{+"blender_frame": 33,+"matrix_world": [+[+-0.8603213429450989,+-0.008598718792200089,+0.5096794962882996,+2.887691020965576+],+[+0.50975102186203,+-0.01654120907187462,+0.8601629137992859,+9.621572494506836+],+[+0.001034415210597217,+0.9998262524604797,+0.01861395686864853,+1.47755765914917+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.7691020965576,+-962.1572494506836,+147.755765914917+],+"forward": [+-0.5096795558929443,+0.8601630330085754,+-0.01861395873129368+],+"up": [+-0.008598718792200089,+0.01654120907187462,+0.9998262524604797+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 766.3327974965796+},+{+"blender_frame": 34,+"matrix_world": [+[+-0.8593783378601074,+-0.00904783420264721,+0.5112603306770325,+2.886852979660034+],+[+0.5113397836685181,+-0.016753127798438072,+0.8592153787612915,+9.611334800720215+],+[+0.0007911713910289109,+0.9998188018798828,+0.01902378909289837,+1.4778392314910889+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.6852979660034,+-961.1334800720215,+147.7839231491089+],+"forward": [+-0.5112603306770325,+0.8592153787612915,+-0.01902378909289837+],+"up": [+-0.009047833271324635,+0.016753125935792923,+0.9998186826705933+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 765.2832302032039+},+{+"blender_frame": 35,+"matrix_world": [+[+-0.8583757281303406,+-0.009594498202204704,+0.5129318237304688,+2.886059284210205+],+[+0.5130212306976318,+-0.017092835158109665,+0.8582056760787964,+9.6007661819458+],+[+0.0005334074376150966,+0.9998078942298889,+0.019594255834817886,+1.4778071641921997+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.6059284210205,+-960.0766181945801,+147.78071641921997+],+"forward": [+-0.5129318833351135,+0.8582057952880859,+-0.019594257697463036+],+"up": [+-0.009594498202204704,+0.017092835158109665,+0.9998078942298889+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 764.2031357856467+},+{+"blender_frame": 36,+"matrix_world": [+[+-0.8573140501976013,+-0.010222315788269043,+0.5146921873092651,+2.8853063583374023+],+[+0.5147936344146729,+-0.017556587234139442,+0.8571344017982483,+9.589860916137695+],+[+0.00027433823561295867,+0.9997935891151428,+0.020313892513513565,+1.4774847030639648+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.53063583374023,+-958.9860916137695,+147.74847030639648+],+"forward": [+-0.5146921873092651,+0.8571344017982483,+-0.020313892513513565+],+"up": [+-0.010222316719591618,+0.01755658909678459,+0.9997937083244324+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 763.0913821980357+},+{+"blender_frame": 37,+"matrix_world": [+[+-0.8561944365501404,+-0.01090564951300621,+0.5165387988090515,+2.8845865726470947+],+[+0.5166538953781128,+-0.018129581585526466,+0.8560023307800293,+9.57861614227295+],+[+2.9369170079007745e-05,+0.9997761249542236,+0.02115689218044281,+1.4769282341003418+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.4586572647095,+-957.8616142272949,+147.69282341003418+],+"forward": [+-0.5165388584136963,+0.8560024499893188,+-0.02115689404308796+],+"up": [+-0.010905650444328785,+0.018129583448171616,+0.9997762441635132+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 761.9473425671458+},+{+"blender_frame": 38,+"matrix_world": [+[+-0.8550177812576294,+-0.011610413901507854,+0.5184687376022339,+2.883889675140381+],+[+0.518598735332489,+-0.01878683641552925,+0.8548113703727722,+9.56702995300293+],+[+-0.00018432605429552495,+0.9997560977935791,+0.022084224969148636,+1.4762241840362549+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.3889675140381,+-956.702995300293,+147.6224184036255+],+"forward": [+-0.5184687376022339,+0.8548113703727722,+-0.022084224969148636+],+"up": [+-0.011610413901507854,+0.01878683641552925,+0.9997560977935791+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 760.7700281776488+},+{+"blender_frame": 39,+"matrix_world": [+[+-0.8537861108779907,+-0.012296173721551895,+0.5204787850379944,+2.883204936981201+],+[+0.5206238627433777,+-0.01949576660990715,+0.8535635471343994,+9.555103302001953+],+[+-0.00034843242610804737,+0.9997343420982361,+0.02304689772427082,+1.4754815101623535+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.3204936981201,+-955.5103302001953,+147.54815101623535+],+"forward": [+-0.5204787850379944,+0.8535635471343994,+-0.02304689772427082+],+"up": [+-0.012296173721551895,+0.01949576660990715,+0.9997343420982361+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 759.5591139513999+},+{+"blender_frame": 40,+"matrix_world": [+[+-0.8525012731552124,+-0.01291955728083849,+0.5225655436515808,+2.8825180530548096+],+[+0.5227251052856445,+-0.02022053487598896,+0.8522615432739258,+9.542830467224121+],+[+-0.0004442872595973313,+0.9997121095657349,+0.023991405963897705,+1.474818229675293+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.25180530548096,+-954.2830467224121,+147.4818229675293+],+"forward": [+-0.5225655436515808,+0.8522615432739258,+-0.023991405963897705+],+"up": [+-0.01291955728083849,+0.02022053487598896,+0.9997121095657349+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 758.3135228138417+},+{+"blender_frame": 41,+"matrix_world": [+[+-0.8511658310890198,+-0.013438800349831581,+0.5247248411178589,+2.88181471824646+],+[+0.5248966217041016,+-0.02092783898115158,+0.8509087562561035,+9.530216217041016+],+[+-0.00045383686665445566,+0.9996906518936157,+0.024867042899131775,+1.4743446111679077+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.181471824646,+-953.0216217041016,+147.43446111679077+],+"forward": [+-0.5247247815132141,+0.850908637046814,+-0.024867039173841476+],+"up": [+-0.013438800349831581,+0.02092783898115158,+0.9996906518936157+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 757.0333098992705+},+{+"blender_frame": 42,+"matrix_world": [+[+-0.8497825860977173,+-0.013819030486047268,+0.5269523859024048,+2.8810818195343018+],+[+0.5271334052085876,+-0.021593285724520683,+0.8495081663131714,+9.517258644104004+],+[+-0.00036074494710192084,+0.9996713399887085,+0.02563406713306904,+1.474143147468567+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.1081819534302,+-951.7258644104004,+147.4143147468567+],+"forward": [+-0.5269523859024048,+0.8495081663131714,+-0.02563406713306904+],+"up": [+-0.013819030486047268,+0.021593285724520683,+0.9996713399887085+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 755.7183584664017+},+{+"blender_frame": 43,+"matrix_world": [+[+-0.848353922367096,+-0.0140375392511487,+0.5292433500289917,+2.8803062438964844+],+[+0.5294294953346252,+-0.02220740169286728,+0.8480632305145264,+9.503962516784668+],+[+-0.0001516013144282624,+0.9996548891067505,+0.026271620765328407,+1.4742501974105835+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.03062438964844,+-950.3962516784668,+147.42501974105835+],+"forward": [+-0.5292433500289917,+0.8480632305145264,+-0.026271620765328407+],+"up": [+-0.0140375392511487,+0.02220740169286728,+0.9996548891067505+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 754.3684704229236+},+{+"blender_frame": 44,+"matrix_world": [+[+-0.8468834757804871,+-0.014088147319853306,+0.5315920114517212,+2.879478693008423+],+[+0.5317786931991577,+-0.02277989685535431,+0.8465769290924072,+9.490326881408691+],+[+0.00018291102605871856,+0.9996411800384521,+0.026783693581819534,+1.4746416807174683+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.9478693008423,+-949.0326881408691,+147.46416807174683+],+"forward": [+-0.531592071056366,+0.8465770483016968,+-0.026783697307109833+],+"up": [+-0.014088149182498455,+0.02277989871799946,+0.9996412992477417+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 752.9836500063539+},+{+"blender_frame": 45,+"matrix_world": [+[+-0.8453739285469055,+-0.01398373581469059,+0.5339918732643127,+2.878591299057007+],+[+0.5341745615005493,+-0.023340830579400063,+0.8450518250465393,+9.476358413696289+],+[+0.0006468321080319583,+0.9996296763420105,+0.027201484888792038,+1.4752272367477417+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.8591299057007,+-947.6358413696289,+147.52272367477417+],+"forward": [+-0.5339919328689575,+0.8450519442558289,+-0.027201488614082336+],+"up": [+-0.01398373767733574,+0.023340832442045212,+0.9996297955513+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 751.5637366101146+},+{+"blender_frame": 46,+"matrix_world": [+[+-0.8438286185264587,+-0.013756215572357178,+0.5364364385604858,+2.877641439437866+],+[+0.5366113781929016,+-0.02393794059753418,+0.8434898853302002,+9.462057113647461+],+[+0.0012379524996504188,+0.9996187686920166,+0.027581263333559036,+1.4758561849594116+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.7641439437866,+-946.2057113647461,+147.58561849594116+],+"forward": [+-0.5364364981651306,+0.8434900045394897,+-0.027581267058849335+],+"up": [+-0.013756217435002327,+0.023937944322824478,+0.9996188879013062+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 750.108440592885+},+{+"blender_frame": 47,+"matrix_world": [+[+-0.8422507643699646,+-0.01345344353467226,+0.5389180183410645,+2.8766303062438965+],+[+0.539082407951355,+-0.024629643186926842,+0.8418928980827332,+9.447426795959473+],+[+0.0019469987601041794,+0.999606192111969,+0.02799684926867485,+1.4763352870941162+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.66303062438965,+-944.7426795959473,+147.63352870941162+],+"forward": [+-0.5389180183410645,+0.8418928980827332,+-0.02799684926867485+],+"up": [+-0.01345344353467226,+0.024629643186926842,+0.999606192111969+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 748.6173619516194+},+{+"blender_frame": 48,+"matrix_world": [+[+-0.8406434655189514,+-0.013133009895682335,+0.541429877281189,+2.8755645751953125+],+[+0.5415821075439453,+-0.025474045425653458,+0.8402617573738098,+9.432467460632324+],+[+0.0027572426479309797,+0.9995892643928528,+0.028527189046144485,+1.4764587879180908+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.55645751953125,+-943.2467460632324,+147.64587879180908+],+"forward": [+-0.5414299368858337,+0.8402618765830994,+-0.028527192771434784+],+"up": [+-0.013133009895682335,+0.025474045425653458,+0.9995892643928528+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 747.0905555412173+},+{+"blender_frame": 49,+"matrix_world": [+[+-0.8390094041824341,+-0.012853696942329407,+0.5439650416374207,+2.87445330619812+],+[+0.5441046953201294,+-0.026515614241361618,+0.8385981321334839,+9.4171781539917+],+[+0.0036444817669689655,+0.9995657205581665,+0.029240604490041733,+1.4760469198226929+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.445330619812,+-941.7178153991699,+147.6046919822693+],+"forward": [+-0.5439651012420654,+0.8385982513427734,+-0.02924060821533203+],+"up": [+-0.012853698804974556,+0.026515617966651917,+0.999565839767456+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 745.5273618455976+},+{+"blender_frame": 50,+"matrix_world": [+[+-0.8373517990112305,+-0.012665978632867336,+0.5465176701545715,+2.87330961227417+],+[+0.5466452240943909,+-0.027771661058068275,+0.8369036912918091,+9.401554107666016+],+[+0.004577499348670244,+0.999534010887146,+0.03017844632267952,+1.4749841690063477+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.330961227417,+-940.1554107666016,+147.49841690063477+],+"forward": [+-0.5465176701545715,+0.8369036912918091,+-0.03017844632267952+],+"up": [+-0.012665980495512486,+0.027771664783358574,+0.9995341300964355+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 743.9277464523911+},+{+"blender_frame": 51,+"matrix_world": [+[+-0.8356733918190002,+-0.012603117153048515,+0.5490822196006775,+2.8721487522125244+],+[+0.5491991639137268,+-0.029221445322036743,+0.8351805806159973,+9.385586738586426+],+[+0.005519095808267593,+0.9994934797286987,+0.031341202557086945,+1.4732532501220703+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.21487522125244,+-938.5586738586426,+147.32532501220703+],+"forward": [+-0.5490822196006775,+0.8351805806159973,+-0.031341202557086945+],+"up": [+-0.012603119015693665,+0.02922144904732704,+0.9994935989379883+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 742.2912949696183+},+{+"blender_frame": 52,+"matrix_world": [+[+-0.8339767456054688,+-0.012675024569034576,+0.551654040813446,+2.870988368988037+],+[+0.5517622232437134,+-0.03080078959465027,+0.8334325551986694,+9.36926555633545+],+[+0.00642760144546628,+0.9994451403617859,+0.03268074244260788,+1.4709545373916626+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.0988368988037,+-936.9265556335449,+147.09545373916626+],+"forward": [+-0.551654040813446,+0.8334325551986694,+-0.03268074244260788+],+"up": [+-0.012675026431679726,+0.030800793319940567,+0.9994452595710754+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 740.618169028312+},+{+"blender_frame": 53,+"matrix_world": [+[+-0.8322641849517822,+-0.012866530567407608,+0.5542297959327698,+2.869845151901245+],+[+0.5543316006660461,+-0.03240451589226723,+0.8316648006439209,+9.352572441101074+],+[+0.007258908823132515,+0.9993919730186462,+0.034101445227861404,+1.4683022499084473+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.9845151901245,+-935.2572441101074,+146.83022499084473+],+"forward": [+-0.5542298555374146,+0.8316649198532104,+-0.0341014489531517+],+"up": [+-0.012866532430052757,+0.032404519617557526,+0.9993920922279358+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 738.9088785741478+},+{+"blender_frame": 54,+"matrix_world": [+[+-0.8305382132530212,+-0.01314084418118,+0.5568066239356995,+2.8687350749969482+],+[+0.556904673576355,+-0.03389733284711838,+0.82988440990448,+9.335494995117188+],+[+0.007968875579535961,+0.9993389844894409,+0.035471223294734955,+1.4655994176864624+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.8735074996948,+-933.5494995117188,+146.55994176864624+],+"forward": [+-0.5568066835403442,+0.8298845291137695,+-0.03547122702002525+],+"up": [+-0.01314084418118,+0.03389733284711838,+0.9993389844894409+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 737.1654025744647+},+{+"blender_frame": 55,+"matrix_world": [+[+-0.8288005590438843,+-0.013448279350996017,+0.559382438659668,+2.867671489715576+],+[+0.5594793558120728,+-0.035132575780153275,+0.8280993700027466,+9.318014144897461+],+[+0.008516035042703152,+0.999292254447937,+0.036641933023929596,+1.4631890058517456+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.7671489715576,+-931.8014144897461,+146.31890058517456+],+"forward": [+-0.5593824982643127,+0.8280994892120361,+-0.036641936749219894+],+"up": [+-0.013448279350996017,+0.035132575780153275,+0.999292254447937+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 735.3902969043702+},+{+"blender_frame": 56,+"matrix_world": [+[+-0.8270528316497803,+-0.013738710433244705,+0.5619562268257141,+2.866666555404663+],+[+0.5620542168617249,+-0.035976067185401917,+0.8263176083564758,+9.300119400024414+],+[+0.008864435367286205,+0.9992582201957703,+0.03747601434588432,+1.4613903760910034+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.6666555404663,+-930.0119400024414,+146.13903760910034+],+"forward": [+-0.5619562268257141,+0.8263176083564758,+-0.03747601434588432+],+"up": [+-0.013738710433244705,+0.035976067185401917,+0.9992582201957703+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 733.5870644077659+},+{+"blender_frame": 57,+"matrix_world": [+[+-0.82529616355896,+-0.013975142501294613,+0.5645272135734558,+2.8657286167144775+],+[+0.5646287202835083,+-0.03633039444684982,+0.8245449662208557,+9.281804084777832+],+[+0.008986364118754864,+0.9992421269416809,+0.03787409886717796,+1.4604336023330688+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.57286167144775,+-928.1804084777832,+146.04336023330688+],+"forward": [+-0.5645272731781006,+0.8245450854301453,+-0.03787410259246826+],+"up": [+-0.013975142501294613,+0.03633039444684982,+0.9992421269416809+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 731.7590892780572+},+{+"blender_frame": 58,+"matrix_world": [+[+-0.8235306143760681,+-0.01414530724287033,+0.5670953989028931,+2.864861488342285+],+[+0.5672025084495544,+-0.03615487366914749,+0.8227843046188354,+9.263062477111816+],+[+0.008864725939929485,+0.9992461204528809,+0.03779790177941322,+1.4604041576385498+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.4861488342285,+-926.3062477111816,+146.04041576385498+],+"forward": [+-0.5670954585075378,+0.822784423828125,+-0.03779790550470352+],+"up": [+-0.01414530724287033,+0.03615487366914749,+0.9992461204528809+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 729.9077508505434+},+{+"blender_frame": 59,+"matrix_world": [+[+-0.8217565417289734,+-0.01426791213452816,+0.5696601867675781,+2.864065170288086+],+[+0.5697754621505737,+-0.03547634556889534,+0.8210343718528748,+9.24390697479248+],+[+0.00849501509219408,+0.9992687106132507,+0.037282418459653854,+1.4612147808074951+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.4065170288086,+-924.390697479248,+146.1214780807495+],+"forward": [+-0.5696601867675781,+0.8210343718528748,+-0.037282418459653854+],+"up": [+-0.01426791213452816,+0.03547634556889534,+0.9992687106132507+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 728.0336105730385+},+{+"blender_frame": 60,+"matrix_world": [+[+-0.8199728727340698,+-0.014391284435987473,+0.5722214579582214,+2.863335371017456+],+[+0.5723479390144348,+-0.03438723087310791,+0.81928950548172,+9.224352836608887+],+[+0.007886482402682304,+0.9993049502372742,+0.03643341735005379,+1.4626108407974243+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.3335371017456,+-922.4352836608887,+146.26108407974243+],+"forward": [+-0.5722214579582214,+0.81928950548172,+-0.03643341735005379+],+"up": [+-0.014391286298632622,+0.03438723459839821,+0.9993050694465637+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 726.1353766079992+},+{+"blender_frame": 61,+"matrix_world": [+[+-0.818178653717041,+-0.014583751559257507,+0.5747791528701782,+2.862661600112915+],+[+0.5749207139015198,+-0.03303059935569763,+0.8175421953201294,+9.204427719116211+],+[+0.007062465418130159,+0.999347984790802,+0.035409435629844666,+1.4642139673233032+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.2661600112915,+-920.4427719116211,+146.42139673233032+],+"forward": [+-0.5747791528701782,+0.8175421953201294,+-0.035409435629844666+],+"up": [+-0.014583751559257507,+0.03303059935569763,+0.999347984790802+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 724.2116532288492+},+{+"blender_frame": 62,+"matrix_world": [+[+-0.8163718581199646,+-0.014916922897100449,+0.5773339867591858,+2.8620269298553467+],+[+0.5774948000907898,+-0.031573981046676636,+0.8157835602760315,+9.184157371520996+],+[+0.006059752311557531,+0.9993901252746582,+0.03439055383205414,+1.4655969142913818+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.20269298553467,+-918.4157371520996,+146.55969142913818+],+"forward": [+-0.5773339867591858,+0.8157835602760315,+-0.03439055383205414+],+"up": [+-0.014916922897100449,+0.031573981046676636,+0.9993901252746582+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 722.2606841474771+},+{+"blender_frame": 63,+"matrix_world": [+[+-0.8145505785942078,+-0.015445293858647346,+0.5798869729042053,+2.8614094257354736+],+[+0.5800716876983643,+-0.030177563428878784,+0.8140063881874084,+9.163583755493164+],+[+0.004927007481455803,+0.9994251728057861,+0.03354053199291229,+1.4663736820220947+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.14094257354736,+-916.3583755493164,+146.63736820220947+],+"forward": [+-0.5798869132995605,+0.8140062689781189,+-0.033540528267621994+],+"up": [+-0.015445295721292496,+0.030177567154169083,+0.9994252920150757+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 720.2827396336943+},+{+"blender_frame": 64,+"matrix_world": [+[+-0.8127120733261108,+-0.016187161207199097,+0.5824407935142517,+2.860781669616699+],+[+0.582653820514679,+-0.028963301330804825,+0.8122043013572693,+9.142735481262207+],+[+0.0037221270613372326,+0.9994494318962097,+0.032970331609249115,+1.466287612915039+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.0781669616699,+-914.2735481262207,+146.6287612915039+],+"forward": [+-0.5824407935142517,+0.8122043013572693,+-0.032970331609249115+],+"up": [+-0.016187161207199097,+0.028963301330804825,+0.9994494318962097+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 718.278303463012+},+{+"blender_frame": 65,+"matrix_world": [+[+-0.8108537793159485,+-0.017111435532569885,+0.584998607635498,+2.8601105213165283+],+[+0.5852434635162354,+-0.027992025017738342,+0.8103743195533752,+9.12165355682373+],+[+0.0025086274836212397,+0.9994615912437439,+0.03271179646253586,+1.4652737379074097+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.01105213165283,+-912.165355682373,+146.52737379074097+],+"forward": [+-0.5849986672401428,+0.8103744387626648,+-0.03271180018782616+],+"up": [+-0.017111437395215034,+0.02799202874302864,+0.9994617104530334+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 716.249207733199+},+{+"blender_frame": 66,+"matrix_world": [+[+-0.8089726567268372,+-0.018134713172912598,+0.5875664353370667,+2.859360933303833+],+[+0.5878446698188782,+-0.027254708111286163,+0.8085146546363831,+9.100360870361328+],+[+0.0013517721090465784,+0.9994639754295349,+0.03270871192216873,+1.46347975730896+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.9360933303833,+-910.0360870361328,+146.347975730896+],+"forward": [+-0.5875664353370667,+0.8085146546363831,+-0.03270871192216873+],+"up": [+-0.018134715035557747,+0.027254711836576462,+0.9994640946388245+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 714.1965205781162+},+{+"blender_frame": 67,+"matrix_world": [+[+-0.8070662021636963,+-0.019129883497953415,+0.5901511311531067,+2.8584978580474854+],+[+0.590461015701294,+-0.026679877191781998,+0.8066250681877136,+9.078886032104492+],+[+0.000314515084028244,+0.9994608759880066,+0.03282787650823593,+1.461240291595459+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.84978580474854,+-907.8886032104492,+146.1240291595459+],+"forward": [+-0.5901511311531067,+0.8066250681877136,+-0.03282787650823593+],+"up": [+-0.019129885360598564,+0.026679880917072296,+0.9994609951972961+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 712.1226648800075+},+{+"blender_frame": 68,+"matrix_world": [+[+-0.805130660533905,+-0.019945945590734482,+0.5927619338035583,+2.857490301132202+],+[+0.5930973291397095,+-0.026155680418014526,+0.804705798625946,+9.057241439819336+],+[+-0.0005465259891934693,+0.9994589686393738,+0.03288862481713295,+1.4590059518814087+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.7490301132202,+-905.7241439819336,+145.90059518814087+],+"forward": [+-0.5927619934082031,+0.8047059178352356,+-0.03288862854242325+],+"up": [+-0.019945943728089333,+0.026155676692724228,+0.9994588494300842+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 710.0295593962073+},+{+"blender_frame": 69,+"matrix_world": [+[+-0.8031628727912903,+-0.02043488435447216,+0.5954089760780334,+2.8563129901885986+],+[+0.595758318901062,+-0.02556145191192627,+0.8027569651603699,+9.035440444946289+],+[+-0.001184727530926466,+0.9994643926620483,+0.03270426392555237,+1.457243800163269+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.63129901885986,+-903.5440444946289,+145.7243800163269+],+"forward": [+-0.5954089760780334,+0.8027569651603699,+-0.03270426392555237+],+"up": [+-0.02043488435447216,+0.02556145191192627,+0.9994643926620483+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 707.9197898041457+},+{+"blender_frame": 70,+"matrix_world": [+[+-0.8011590242385864,+-0.020480608567595482,+0.5981009602546692,+2.8549516201019287+],+[+0.5984495282173157,+-0.02480166219174862,+0.8007765412330627,+9.013490676879883+],+[+-0.0015664934180676937,+0.9994825720787048,+0.03212668374180794,+1.4563319683074951+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.49516201019287,+-901.3490676879883,+145.6331968307495+],+"forward": [+-0.598101019859314,+0.8007766604423523,+-0.032126687467098236+],+"up": [+-0.02048061043024063,+0.024801665917038918,+0.9994826912879944+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 705.7951300404966+},+{+"blender_frame": 71,+"matrix_world": [+[+-0.7991145849227905,+-0.02002311497926712,+0.6008453369140625,+2.8534045219421387+],+[+0.6011765003204346,+-0.023833464831113815,+0.7987607717514038,+8.991393089294434+],+[+-0.0016734553501009941,+0.9995154738426208,+0.03108309581875801,+1.4564698934555054+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.34045219421387,+-899.1393089294434,+145.64698934555054+],+"forward": [+-0.6008453369140625,+0.7987607717514038,+-0.03108309581875801+],+"up": [+-0.02002311497926712,+0.023833464831113815,+0.9995154738426208+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 703.6560611333698+},+{+"blender_frame": 72,+"matrix_world": [+[+-0.7970244884490967,+-0.01907281018793583,+0.6036457419395447,+2.8516838550567627+],+[+0.6039451360702515,+-0.022681569680571556,+0.796703040599823,+8.969147682189941+],+[+-0.0015037341509014368,+0.9995608329772949,+0.02959669567644596,+1.4576294422149658+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.16838550567627,+-896.9147682189941,+145.76294422149658+],+"forward": [+-0.6036458015441895,+0.7967031598091125,+-0.02959669940173626+],+"up": [+-0.01907281018793583,+0.022681569680571556,+0.9995608329772949+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 701.5021280851215+},+{+"blender_frame": 73,+"matrix_world": [+[+-0.7948837876319885,+-0.017711516469717026,+0.6065031886100769,+2.8498153686523438+],+[+0.6067608594894409,+-0.021436629816889763,+0.7945953011512756,+8.946749687194824+],+[+-0.0010721016442403197,+0.9996132850646973,+0.02778627723455429,+1.4595558643341064+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.9815368652344,+-894.6749687194824,+145.95558643341064+],+"forward": [+-0.6065032482147217,+0.7945954203605652,+-0.02778628095984459+],+"up": [+-0.017711516469717026,+0.021436629816889763,+0.9996132850646973+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 699.3316936306655+},+{+"blender_frame": 74,+"matrix_world": [+[+-0.7926863431930542,+-0.01607932150363922,+0.6094176769256592,+2.8478379249572754+],+[+0.6096296906471252,+-0.02023666724562645,+0.7924280166625977,+8.924187660217285+],+[+-0.0004091234877705574,+0.9996659159660339,+0.025843758136034012,+1.4618195295333862+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.78379249572754,+-892.4187660217285,+146.18195295333862+],+"forward": [+-0.6094176769256592,+0.7924280166625977,+-0.025843758136034012+],+"up": [+-0.01607932150363922,+0.02023666724562645,+0.9996659159660339+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 697.1435157582164+},+{+"blender_frame": 75,+"matrix_world": [+[+-0.7904261946678162,+-0.014350359328091145,+0.6123891472816467,+2.845799207687378+],+[+0.6125571131706238,+-0.019236568361520767,+0.7901922464370728,+8.901446342468262+],+[+0.00044072401942685246,+0.9997118711471558,+0.02399550750851631,+1.4639092683792114+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.5799207687378,+-890.1446342468262,+146.39092683792114+],+"forward": [+-0.6123891472816467,+0.7901922464370728,+-0.02399550750851631+],+"up": [+-0.014350361190736294,+0.019236570224165916,+0.9997119903564453+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 694.9383994098753+},+{+"blender_frame": 76,+"matrix_world": [+[+-0.7880975604057312,+-0.012702063657343388,+0.615419328212738,+2.8437535762786865+],+[+0.6155487298965454,+-0.01857180707156658,+0.787880003452301,+8.878506660461426+],+[+0.001421745982952416,+0.9997468590736389,+0.022455133497714996,+1.465343952178955+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.37535762786865,+-887.8506660461426,+146.5343952178955+],+"forward": [+-0.615419328212738,+0.787880003452301,+-0.022455133497714996+],+"up": [+-0.012702063657343388,+0.01857180707156658,+0.9997468590736389+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 692.7186273038387+},+{+"blender_frame": 77,+"matrix_world": [+[+-0.7856944799423218,+-0.01128491759300232,+0.6185117363929749,+2.8417563438415527+],+[+0.6186096668243408,+-0.01832546666264534,+0.7854847311973572,+8.85533618927002+],+[+0.0024703845847398043,+0.9997684359550476,+0.02137918211519718,+1.4657777547836304+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.1756343841553,+-885.533618927002,+146.57777547836304+],+"forward": [+-0.6185117363929749,+0.7854847311973572,+-0.02137918211519718+],+"up": [+-0.01128491759300232,+0.01832546666264534,+0.9997684359550476+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 690.4871806502342+},+{+"blender_frame": 78,+"matrix_world": [+[+-0.7832115292549133,+-0.010198650881648064,+0.6216716766357422,+2.839860200881958+],+[+0.6217452883720398,+-0.01850585825741291,+0.7830008268356323,+8.831896781921387+],+[+0.00351901538670063,+0.9997767806053162,+0.020834965631365776,+1.4650763273239136+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.9860200881958,+-883.1896781921387,+146.50763273239136+],+"forward": [+-0.6216716766357422,+0.7830008268356323,+-0.020834965631365776+],+"up": [+-0.010198650881648064,+0.01850585825741291,+0.9997767806053162+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 688.246626034379+},+{+"blender_frame": 79,+"matrix_world": [+[+-0.7806437611579895,+-0.009479973465204239,+0.6249043345451355,+2.8381118774414062+],+[+0.6249600052833557,+-0.019040197134017944,+0.7804245948791504,+8.808149337768555+],+[+0.004499897360801697,+0.9997737407684326,+0.020788218826055527,+1.4633457660675049+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.8111877441406,+-880.8149337768555,+146.3345766067505+],+"forward": [+-0.6249043345451355,+0.7804245948791504,+-0.020788218826055527+],+"up": [+-0.009479974396526814,+0.019040198996663094,+0.9997738599777222+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 685.9985201852396+},+{+"blender_frame": 80,+"matrix_world": [+[+-0.7779868245124817,+-0.009104001335799694,+0.6282146573066711,+2.8365514278411865+],+[+0.6282577514648438,+-0.019785825163125992,+0.7777535319328308,+8.78404426574707+],+[+0.005349075887352228,+0.999762773513794,+0.021112771704792976,+1.4609098434448242+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.65514278411865,+-878.404426574707,+146.09098434448242+],+"forward": [+-0.6282147169113159,+0.7777536511421204,+-0.021112773567438126+],+"up": [+-0.009104002267122269,+0.01978582702577114,+0.9997628927230835+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 683.7427761871368+},+{+"blender_frame": 81,+"matrix_world": [+[+-0.7752364873886108,+-0.008998580276966095,+0.6316070556640625,+2.83520770072937+],+[+0.6316426396369934,+-0.020556706935167313,+0.7749871611595154,+8.759532928466797+],+[+0.006009975448250771,+0.999748170375824,+0.021620197221636772,+1.4582383632659912+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.520770072937,+-875.9532928466797,+145.82383632659912+],+"forward": [+-0.6316070556640625,+0.7749871611595154,+-0.021620197221636772+],+"up": [+-0.00899858120828867,+0.020556708797812462,+0.9997482895851135+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 681.4779384527355+},+{+"blender_frame": 82,+"matrix_world": [+[+-0.7723894715309143,+-0.00906793400645256,+0.6350845098495483,+2.834101915359497+],+[+0.6351166367530823,+-0.021159380674362183,+0.7721264362335205,+8.734572410583496+],+[+0.006436402443796396,+0.9997349381446838,+0.022102484479546547,+1.4558457136154175+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.4101915359497,+-873.4572410583496,+145.58457136154175+],+"forward": [+-0.6350845098495483,+0.7721264362335205,+-0.022102484479546547+],+"up": [+-0.009067934937775135,+0.021159382537007332,+0.9997350573539734+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 679.2037902399898+},+{+"blender_frame": 83,+"matrix_world": [+[+-0.7694428563117981,+-0.009220176376402378,+0.6386491656303406,+2.833244800567627+],+[+0.6386815905570984,+-0.02143080160021782,+0.7691726684570312,+8.709121704101562+],+[+0.006594853475689888,+0.999727725982666,+0.02237853780388832,+1.4541802406311035+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.3244800567627,+-870.9121704101562,+145.41802406311035+],+"forward": [+-0.6386491656303406,+0.7691726684570312,+-0.02237853780388832+],+"up": [+-0.009220177307724953,+0.02143080346286297,+0.9997278451919556+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 676.9196400418878+},+{+"blender_frame": 84,+"matrix_world": [+[+-0.7663944959640503,+-0.009391944855451584,+0.642301619052887,+2.8326406478881836+],+[+0.6423377990722656,+-0.021270236000418663,+0.7661264538764954,+8.683160781860352+],+[+0.0064664906822144985,+0.9997296929359436,+0.022334188222885132,+1.4535280466079712+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.26406478881836,+-868.3160781860352,+145.35280466079712+],+"forward": [+-0.6423016786575317,+0.7661265730857849,+-0.02233419008553028+],+"up": [+-0.009391944855451584,+0.021270236000418663,+0.9997296929359436+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 674.6259907260537+},+{+"blender_frame": 85,+"matrix_world": [+[+-0.7632420063018799,+-0.009565138258039951,+0.6460418701171875,+2.8322856426239014+],+[+0.6460842490196228,+-0.020658554509282112,+0.762986421585083,+8.656672477722168+],+[+0.00604822114109993,+0.9997409582138062,+0.021947355940937996,+1.4539523124694824+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.22856426239014,+-865.6672477722168,+145.39523124694824+],+"forward": [+-0.6460418701171875,+0.762986421585083,+-0.021947355940937996+],+"up": [+-0.009565137326717377,+0.020658552646636963,+0.9997408390045166+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 672.3226669244468+},+{+"blender_frame": 86,+"matrix_world": [+[+-0.7599841356277466,+-0.009771878831088543,+0.6498681306838989,+2.8321688175201416+],+[+0.6499195098876953,+-0.019660985097289085,+0.7597486972808838,+8.629657745361328+],+[+0.005352875217795372,+0.9997589588165283,+0.021292975172400475,+1.4552820920944214+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.21688175201416,+-862.9657745361328,+145.52820920944214+],+"forward": [+-0.6498681306838989,+0.7597486972808838,+-0.021292975172400475+],+"up": [+-0.009771878831088543,+0.019660985097289085,+0.9997589588165283+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 670.0099444016814+},+{+"blender_frame": 87,+"matrix_world": [+[+-0.7566195726394653,+-0.010086230002343655,+0.6537774801254272,+2.83227276802063+],+[+0.6538404226303101,+-0.01841275580227375,+0.7564083933830261,+8.602128982543945+],+[+0.004408533684909344,+0.9997795820236206,+0.020526234060525894,+1.4571518898010254+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.227276802063,+-860.2128982543945,+145.71518898010254+],+"forward": [+-0.653777539730072,+0.7564085125923157,+-0.020526235923171043+],+"up": [+-0.010086230002343655,+0.01841275580227375,+0.9997795820236206+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 667.6885242573917+},+{+"blender_frame": 88,+"matrix_world": [+[+-0.7531483769416809,+-0.010604562237858772,+0.6577652096748352,+2.8325741291046143+],+[+0.6578426957130432,+-0.01709090918302536,+0.7529614567756653,+8.574114799499512+],+[+0.003256977302953601,+0.9997977614402771,+0.01984812133014202,+1.4590836763381958+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.2574129104614,+-857.4114799499512,+145.90836763381958+],+"forward": [+-0.65776526927948,+0.7529615759849548,+-0.01984812319278717+],+"up": [+-0.010604562237858772,+0.01709090918302536,+0.9997977614402771+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 665.3601540252566+},+{+"blender_frame": 89,+"matrix_world": [+[+-0.7495706677436829,+-0.011419057846069336,+0.6618258953094482,+2.833040714263916+],+[+0.661921501159668,+-0.01587865874171257,+0.7494049668312073,+8.545645713806152+],+[+0.001951409736648202,+0.999808669090271,+0.01946069672703743,+1.4605939388275146+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.3040714263916,+-854.5645713806152,+146.05939388275146+],+"forward": [+-0.6618258953094482,+0.7494049668312073,+-0.01946069672703743+],+"up": [+-0.01141905877739191,+0.01587866060435772,+0.9998087882995605+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 663.0270366789773+},+{+"blender_frame": 90,+"matrix_world": [+[+-0.7458873391151428,+-0.012590067461133003,+0.6659530997276306,+2.8336341381073+],+[+0.6660720109939575,+-0.014929613098502159,+0.7457379698753357,+8.516756057739258+],+[+0.0005535310483537614,+0.999809205532074,+0.019521694630384445,+1.461301565170288+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.36341381073,+-851.6756057739258,+146.1301565170288+],+"forward": [+-0.6659531593322754,+0.7457380294799805,+-0.019521696493029594+],+"up": [+-0.012590069323778152,+0.014929614961147308,+0.9998093247413635+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 660.6915237382054+},+{+"blender_frame": 91,+"matrix_world": [+[+-0.7421007752418518,+-0.014124033972620964,+0.6701395511627197,+2.834308624267578+],+[+0.6702877879142761,+-0.014339782297611237,+0.741962730884552,+8.487486839294434+],+[+-0.000869851908646524,+0.9997974038124084,+0.02010873332619667,+1.4610137939453125+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.4308624267578,+-848.7486839294434,+146.10137939453125+],+"forward": [+-0.6701395511627197,+0.741962730884552,+-0.02010873332619667+],+"up": [+-0.014124033972620964,+0.014339782297611237,+0.9997974038124084+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 658.3554345881566+},+{+"blender_frame": 92,+"matrix_world": [+[+-0.7382133603096008,+-0.015962202101945877,+0.6743783354759216,+2.8350112438201904+],+[+0.674563467502594,+-0.01413285918533802,+0.7380814552307129,+8.457870483398438+],+[+-0.002250511199235916,+0.9997726082801819,+0.02120058611035347,+1.4597703218460083+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.50112438201904,+-845.7870483398438,+145.97703218460083+],+"forward": [+-0.6743783950805664,+0.7380815148353577,+-0.02120058797299862+],+"up": [+-0.015962203964591026,+0.01413286104798317,+0.9997727274894714+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 656.0180452186614+},+{+"blender_frame": 93,+"matrix_world": [+[+-0.734235942363739,+-0.017983272671699524,+0.6786561012268066,+2.8356869220733643+],+[+0.6788851618766785,+-0.014261634089052677,+0.7341058850288391,+8.427937507629395+],+[+-0.003522881306707859,+0.999736487865448,+0.022679980844259262,+1.4578375816345215+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.5686922073364,+-842.7937507629395,+145.78375816345215+],+"forward": [+-0.6786561608314514,+0.7341059446334839,+-0.02267998270690441+],+"up": [+-0.017983274534344673,+0.014261635951697826,+0.9997366070747375+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 653.6779319867492+},+{+"blender_frame": 94,+"matrix_world": [+[+-0.7301943898200989,+-0.020019929856061935,+0.6829462051391602,+2.8362791538238525+],+[+0.6832237839698792,+-0.014624552801251411,+0.7300626039505005,+8.397716522216797+],+[+-0.0046280184760689735,+0.9996925592422485,+0.024356862530112267,+1.4556519985198975+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.62791538238525,+-839.7716522216797,+145.56519985198975+],+"forward": [+-0.6829461455345154,+0.7300625443458557,+-0.024356858804821968+],+"up": [+-0.020019931718707085,+0.01462455466389656,+0.9996926784515381+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 651.3335156720132+},+{+"blender_frame": 95,+"matrix_world": [+[+-0.7260928750038147,+-0.021886343136429787,+0.6872483491897583,+2.8367342948913574+],+[+0.687574565410614,+-0.015093943104147911,+0.7259568572044373,+8.367229461669922+],+[+-0.005515254568308592,+0.9996466040611267,+0.02600809559226036,+1.4537270069122314+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.67342948913574,+-836.7229461669922,+145.37270069122314+],+"forward": [+-0.6872483491897583,+0.7259568572044373,+-0.02600809559226036+],+"up": [+-0.021886343136429787,+0.015093943104147911,+0.9996466040611267+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 648.9840171765536+},+{+"blender_frame": 96,+"matrix_world": [+[+-0.7219339609146118,+-0.023411517962813377,+0.6915658712387085,+2.837006092071533+],+[+0.6919347047805786,+-0.01554788462817669,+0.7217927575111389,+8.336491584777832+],+[+-0.006145877297967672,+0.9996050596237183,+0.027423787862062454,+1.4525426626205444+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.7006092071533,+-833.6491584777832,+145.25426626205444+],+"forward": [+-0.6915658116340637,+0.7217926979064941,+-0.027423784136772156+],+"up": [+-0.023411517962813377,+0.01554788462817669,+0.9996050596237183+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 646.6295836027712+},+{+"blender_frame": 97,+"matrix_world": [+[+-0.7177205681800842,+-0.024471277371048927,+0.6959011554718018,+2.8370580673217773+],+[+0.6963010430335999,+-0.0158996619284153,+0.7175737619400024,+8.305524826049805+],+[+-0.006495352368801832,+0.9995740056037903,+0.02845088578760624,+1.4524415731430054+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.70580673217773,+-830.5524826049805,+145.24415731430054+],+"forward": [+-0.6959011554718018,+0.7175737619400024,+-0.02845088578760624+],+"up": [+-0.024471281096339226,+0.015899663791060448,+0.9995741248130798+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 644.2721137776971+},+{+"blender_frame": 98,+"matrix_world": [+[+-0.7134546637535095,+-0.02501199208199978,+0.7002549171447754,+2.8368680477142334+],+[+0.7006707787513733,+-0.016117678955197334,+0.7133026719093323,+8.274341583251953+],+[+-0.006554637104272842,+0.9995571374893188,+0.029024409130215645,+1.4535551071166992+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.68680477142334,+-827.4341583251953,+145.35551071166992+],+"forward": [+-0.7002549171447754,+0.7133026719093323,+-0.029024409130215645+],+"up": [+-0.025011995807290077,+0.016117680817842484,+0.9995572566986084+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 641.91317348741+},+{+"blender_frame": 99,+"matrix_world": [+[+-0.7091377377510071,+-0.025061089545488358,+0.7046244740486145,+2.836427688598633+],+[+0.7050415277481079,+-0.016231555491685867,+0.7089802622795105,+8.24295711517334+],+[+-0.0063306670635938644,+0.9995541572570801,+0.029179517179727554,+1.4557746648788452+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.6427688598633,+-824.295711517334,+145.57746648788452+],+"forward": [+-0.7046244740486145,+0.7089802622795105,+-0.029179517179727554+],+"up": [+-0.025061089545488358,+0.016231555491685867,+0.9995541572570801+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 639.5540399476886+},+{+"blender_frame": 100,+"matrix_world": [+[+-0.7047707438468933,+-0.02472168579697609,+0.7090043425559998,+2.8357417583465576+],+[+0.7094111442565918,+-0.016322998329997063,+0.7046059370040894,+8.211379051208496+],+[+-0.005845970474183559,+0.9995611310005188,+0.02904180996119976,+1.458775281906128+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.57417583465576,+-821.1379051208496,+145.8775281906128+],+"forward": [+-0.7090043425559998,+0.7046059370040894,+-0.02904180996119976+],+"up": [+-0.02472168579697609,+0.016322998329997063,+0.9995611310005188+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 637.1952962130308+},+{+"blender_frame": 101,+"matrix_world": [+[+-0.7003536820411682,+-0.02415275201201439,+0.7133871912956238,+2.8348286151885986+],+[+0.7137774229049683,+-0.016504133120179176,+0.7001780867576599,+8.179617881774902+],+[+-0.005137390922755003,+0.9995720386505127,+0.028798416256904602,+1.4620850086212158+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.48286151885986,+-817.9617881774902,+146.20850086212158+],+"forward": [+-0.7133871912956238,+0.7001780867576599,+-0.028798416256904602+],+"up": [+-0.02415275201201439,+0.016504133120179176,+0.9995720386505127+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 634.8381643183529+},+{+"blender_frame": 102,+"matrix_world": [+[+-0.6958867311477661,+-0.023538025096058846,+0.717765748500824,+2.8337137699127197+],+[+0.7181389331817627,+-0.016887446865439415,+0.6956948041915894,+8.147677421569824+],+[+-0.004254050087183714,+0.9995803833007812,+0.028655318543314934,+1.4651868343353271+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.371376991272,+-814.7677421569824,+146.51868343353271+],+"forward": [+-0.717765748500824,+0.6956948041915894,+-0.028655318543314934+],+"up": [+-0.023538025096058846,+0.016887446865439415,+0.9995803833007812+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 632.4844538699836+},+{+"blender_frame": 103,+"matrix_world": [+[+-0.6913687586784363,+-0.02305106446146965,+0.7221343517303467,+2.832428216934204+],+[+0.722494900226593,+-0.017555205151438713,+0.6911534667015076,+8.115550994873047+],+[+-0.0032546077854931355,+0.9995802044868469,+0.028791386634111404,+1.467629313468933+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.2428216934204,+-811.5550994873047,+146.7629313468933+],+"forward": [+-0.7221343517303467,+0.6911534667015076,+-0.028791386634111404+],+"up": [+-0.02305106446146965,+0.017555205151438713,+0.9995802044868469+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 630.1359368488193+},+{+"blender_frame": 104,+"matrix_world": [+[+-0.6867988109588623,+-0.02282283827662468,+0.7264891862869263,+2.8310036659240723+],+[+0.7268442511558533,+-0.018534421920776367,+0.6865521669387817,+8.08322811126709+],+[+-0.0022040109615772963,+0.9995676279067993,+0.02931806445121765,+1.4691230058670044+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.1003665924072,+-808.322811126709,+146.91230058670044+],+"forward": [+-0.7264891862869263,+0.6865521669387817,+-0.02931806445121765+],+"up": [+-0.02282284013926983,+0.018534423783421516,+0.9995677471160889+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 627.7948648668826+},+{+"blender_frame": 105,+"matrix_world": [+[+-0.6821755766868591,+-0.02291915938258171,+0.730829119682312,+2.8294670581817627+],+[+0.7311874628067017,+-0.019783617928624153,+0.6818896532058716,+8.050690650939941+],+[+-0.001169893192127347,+0.9995415210723877,+0.03025410696864128,+1.4696000814437866+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.94670581817627,+-805.0690650939941,+146.96000814437866+],+"forward": [+-0.730829119682312,+0.6818896532058716,+-0.03025410696864128+],+"up": [+-0.02291916124522686,+0.019783619791269302,+0.9995416402816772+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 625.4624481312931+},+{+"blender_frame": 106,+"matrix_world": [+[+-0.6774978041648865,+-0.02333254925906658,+0.7351547479629517,+2.8278417587280273+],+[+0.7355248928070068,+-0.021194465458393097,+0.677166223526001,+8.017916679382324+],+[+-0.00021880300482735038,+0.9995030760765076,+0.03152087330818176,+1.4692264795303345+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.78417587280273,+-801.7916679382324,+146.92264795303345+],+"forward": [+-0.7351547479629517,+0.677166223526001,+-0.03152087330818176+],+"up": [+-0.02333254925906658,+0.021194465458393097,+0.9995030760765076+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 623.1394969858229+},+{+"blender_frame": 107,+"matrix_world": [+[+-0.6727632880210876,+-0.023990120738744736,+0.7394686937332153,+2.826143741607666+],+[+0.7398574948310852,+-0.02260817214846611,+0.6723835468292236,+7.984877109527588+],+[+0.000587474787607789,+0.9994564652442932,+0.0329592190682888,+1.4683624505996704+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.6143741607666,+-798.4877109527588,+146.83624505996704+],+"forward": [+-0.7394687533378601,+0.6723836064338684,+-0.0329592227935791+],+"up": [+-0.023990124464035034,+0.02260817401111126,+0.9994565844535828+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 620.8264578599483+},+{+"blender_frame": 108,+"matrix_world": [+[+-0.6679702997207642,+-0.024775192141532898,+0.7437754273414612,+2.824381113052368+],+[+0.7441869378089905,+-0.02384311519563198,+0.6675457954406738,+7.951547622680664+],+[+0.0011953531065955758,+0.9994085431098938,+0.034363873302936554,+1.4674797058105469+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.4381113052368,+-795.1547622680664,+146.7479705810547+],+"forward": [+-0.7437754273414612,+0.6675457954406738,+-0.034363873302936554+],+"up": [+-0.024775195866823196,+0.02384311892092228,+0.9994086623191833+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 618.5244330205023+},+{+"blender_frame": 109,+"matrix_world": [+[+-0.6631168723106384,+-0.02555808797478676,+0.7480794787406921,+2.8225576877593994+],+[+0.7485143542289734,+-0.024728236719965935,+0.6626574397087097,+7.91790771484375+],+[+0.0015624293591827154,+0.9993674755096436,+0.03552830219268799,+1.4670552015304565+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.25576877593994,+-791.790771484375,+146.70552015304565+],+"forward": [+-0.7480794787406921,+0.6626574397087097,+-0.03552830219268799+],+"up": [+-0.02555808797478676,+0.024728236719965935,+0.9993674755096436+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 616.2353445310146+},+{+"blender_frame": 110,+"matrix_world": [+[+-0.6582002639770508,+-0.0262290071696043,+0.7523857951164246,+2.820674419403076+],+[+0.7528411149978638,+-0.025135040283203125,+0.6577221751213074,+7.883945941925049+],+[+0.0016598461661487818,+0.9993399977684021,+0.036290157586336136,+1.4674625396728516+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.0674419403076,+-788.3945941925049,+146.74625396728516+],+"forward": [+-0.7523859143257141,+0.6577222347259521,+-0.036290161311626434+],+"up": [+-0.0262290071696043,+0.025135040283203125,+0.9993399977684021+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 613.9620144851506+},+{+"blender_frame": 111,+"matrix_world": [+[+-0.6532180905342102,+-0.026725484058260918,+0.756697952747345,+2.8187286853790283+],+[+0.7571684718132019,+-0.02500167116522789,+0.652741014957428,+7.8496623039245605+],+[+0.001473895157687366,+0.9993301630020142,+0.03656722605228424,+1.468887209892273+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.87286853790283,+-784.966230392456,+146.8887209892273+],+"forward": [+-0.7566980719566345,+0.6527410745620728,+-0.03656722977757454+],+"up": [+-0.026725484058260918,+0.02500167116522789,+0.9993301630020142+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 611.7066013626754+},+{+"blender_frame": 112,+"matrix_world": [+[+-0.6481672525405884,+-0.027048183605074883,+0.7610174417495728,+2.816720724105835+],+[+0.7614973783493042,+-0.02434398978948593,+0.6477107405662537,+7.815074443817139+],+[+0.0010068034753203392,+0.9993376135826111,+0.03637610748410225,+1.4712810516357422+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.6720724105835,+-781.5074443817139,+147.12810516357422+],+"forward": [+-0.7610175609588623,+0.6477108001708984,+-0.03637611120939255+],+"up": [+-0.02704818733036518,+0.02434399351477623,+0.9993377327919006+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 609.4711981713772+},+{+"blender_frame": 113,+"matrix_world": [+[+-0.6430447101593018,+-0.02726147137582302,+0.7653432488441467,+2.8146488666534424+],+[+0.7658286094665527,+-0.023251663893461227,+0.6426242589950562,+7.780207633972168+],+[+0.0002766197721939534,+0.9993578195571899,+0.03582947701215744,+1.4743696451187134+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.46488666534424,+-778.0207633972168,+147.43696451187134+],+"forward": [+-0.7653432488441467,+0.6426242589950562,+-0.03582947701215744+],+"up": [+-0.02726147510111332,+0.023251665756106377,+0.9993579387664795+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 607.2565733455122+},+{+"blender_frame": 114,+"matrix_world": [+[+-0.6378471255302429,+-0.027478568255901337,+0.7696725130081177,+2.8125131130218506+],+[+0.7701626420021057,+-0.02187044732272625,+0.6374724507331848,+7.7451019287109375+],+[+-0.000683745602145791,+0.9993831515312195,+0.03511296585202217,+1.477707862854004+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.25131130218506,+-774.5101928710938,+147.7707862854004+],+"forward": [+-0.7696726322174072,+0.6374725103378296,+-0.03511296957731247+],+"up": [+-0.027478568255901337,+0.02187044732272625,+0.9993831515312195+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 605.0643779337406+},+{+"blender_frame": 115,+"matrix_world": [+[+-0.6325715780258179,+-0.02783426083624363,+0.7740015983581543,+2.810312509536743+],+[+0.774499773979187,+-0.020374329760670662,+0.6322459578514099,+7.7098069190979+],+[+-0.0018283349927514791,+0.9994048476219177,+0.03444584831595421,+1.4807734489440918+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.0312509536743,+-770.98069190979,+148.07734489440918+],+"forward": [+-0.7740017175674438,+0.6322460174560547,+-0.03444585204124451+],+"up": [+-0.027834264561533928,+0.02037433162331581,+0.9994049668312073+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 602.8968525119126+},+{+"blender_frame": 116,+"matrix_world": [+[+-0.6272143125534058,+-0.028451699763536453,+0.7783268690109253,+2.808042526245117+],+[+0.7788405418395996,+-0.018933871760964394,+0.6269360780715942,+7.674374580383301+],+[+-0.003100653877481818,+0.9994158744812012,+0.03403493016958237,+1.4830777645111084+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.8042526245117,+-767.4374580383301,+148.30777645111084+],+"forward": [+-0.7783269882202148,+0.626936137676239,+-0.034034933894872665+],+"up": [+-0.028451699763536453,+0.018933871760964394,+0.9994158744812012+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 600.7569874636829+},+{+"blender_frame": 117,+"matrix_world": [+[+-0.6217724084854126,+-0.029410110786557198,+0.7826456427574158,+2.8056962490081787+],+[+0.7831855416297913,+-0.017687033861875534,+0.6215366721153259,+7.638859272003174+],+[+-0.004436778835952282,+0.99941086769104,+0.03403088077902794,+1.4842690229415894+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.56962490081787,+-763.8859272003174,+148.42690229415894+],+"forward": [+-0.7826456427574158,+0.6215366721153259,+-0.03403088077902794+],+"up": [+-0.029410114511847496,+0.017687035724520683,+0.9994109869003296+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 598.6483993008733+},+{+"blender_frame": 118,+"matrix_world": [+[+-0.6162426471710205,+-0.03072161227464676,+0.786956787109375,+2.8032610416412354+],+[+0.7875353097915649,+-0.016718793660402298,+0.6160427927970886,+7.603311061859131+],+[+-0.005768859758973122,+0.9993880987167358,+0.034497182816267014,+1.4842069149017334+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.32610416412354,+-760.3311061859131,+148.42069149017334+],+"forward": [+-0.7869569063186646,+0.6160428524017334,+-0.03449718654155731+],+"up": [+-0.030721615999937057,+0.016718795523047447,+0.9993882179260254+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 596.5740770101547+},+{+"blender_frame": 119,+"matrix_world": [+[+-0.6106219291687012,+-0.03232193738222122,+0.7912623286247253,+2.800719976425171+],+[+0.7918910980224609,+-0.0160529762506485,+0.610451340675354,+7.567774772644043+],+[+-0.007028854452073574,+0.9993486404418945,+0.03539774566888809,+1.482991337776184+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.0719976425171,+-756.7774772644043,+148.2991337776184+],+"forward": [+-0.7912624478340149,+0.6104514002799988,+-0.03539774939417839+],+"up": [+-0.03232193738222122,+0.0160529762506485,+0.9993486404418945+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 594.5359245873988+},+{+"blender_frame": 120,+"matrix_world": [+[+-0.6049071550369263,+-0.034078434109687805,+0.7955664396286011,+2.798053741455078+],+[+0.7962543964385986,+-0.015657998621463776,+0.6047592759132385,+7.532286167144775+],+[+-0.008152267895638943,+0.9992964863777161,+0.03660673275589943,+1.4809386730194092+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+279.8053741455078,+-753.2286167144775,+148.09386730194092+],+"forward": [+-0.7955665588378906,+0.6047593355178833,+-0.03660673648118973+],+"up": [+-0.034078437834978104,+0.015658000484108925,+0.9992966055870056+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 592.5351959653199+},+{+"blender_frame": 121,+"matrix_world": [+[+-0.599094569683075,+-0.035813238471746445,+0.7998769283294678,+2.795243263244629+],+[+0.800626814365387,+-0.015463802963495255,+0.5989637970924377,+7.496875286102295+],+[+-0.009081692434847355,+0.9992387890815735,+0.03793731704354286,+1.4785128831863403+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+279.5243263244629,+-749.6875286102295,+147.85128831863403+],+"forward": [+-0.7998769283294678,+0.5989637970924377,+-0.03793731704354286+],+"up": [+-0.03581324219703674,+0.015463804826140404,+0.999238908290863+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 590.5731019563973+},+{+"blender_frame": 122,+"matrix_world": [+[+-0.5931807160377502,+-0.03733785077929497,+0.8042030334472656,+2.792274236679077+],+[+0.8050101399421692,+-0.015386269427835941,+0.5930615663528442,+7.461562156677246+],+[+-0.009769960306584835,+0.9991843700408936,+0.03918417915701866,+1.4762227535247803+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+279.2274236679077,+-746.1562156677246,+147.62227535247803+],+"forward": [+-0.8042030334472656,+0.5930615663528442,+-0.03918417915701866+],+"up": [+-0.03733784705400467,+0.015386267565190792,+0.999184250831604+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 588.6518469080329+},+{+"blender_frame": 123,+"matrix_world": [+[+-0.5871610641479492,+-0.038490988314151764,+0.808554470539093,+2.789139986038208+],+[+0.8094059824943542,+-0.015352544374763966,+0.5870486497879028,+7.4263596534729+],+[+-0.010182715952396393,+0.9991410374641418,+0.040169257670640945,+1.4745126962661743+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+278.9139986038208,+-742.63596534729,+147.45126962661743+],+"forward": [+-0.808554470539093,+0.5870486497879028,+-0.040169257670640945+],+"up": [+-0.038490988314151764,+0.015352544374763966,+0.9991410374641418+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 586.774006485939+},+{+"blender_frame": 124,+"matrix_world": [+[+-0.5810308456420898,+-0.03917264565825462,+0.8129383325576782,+2.785846471786499+],+[+0.813816487789154,+-0.015322043560445309,+0.5809201002120972,+7.391274452209473+],+[+-0.010300299152731895,+0.9991149306297302,+0.04078193008899689,+1.473665714263916+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+278.5846471786499,+-739.1274452209473,+147.3665714263916+],+"forward": [+-0.8129383325576782,+0.5809201002120972,+-0.04078193008899689+],+"up": [+-0.03917264938354492,+0.015322045423090458,+0.9991150498390198+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 584.9424242042005+},+{+"blender_frame": 125,+"matrix_world": [+[+-0.574784517288208,+-0.03936588019132614,+0.8173573613166809,+2.7824137210845947+],+[+0.8182423710823059,+-0.015297574922442436,+0.5746700763702393,+7.356307506561279+],+[+-0.01011880487203598,+0.9991077780723572,+0.04100363329052925,+1.4737434387207031+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+278.2413721084595,+-735.6307506561279,+147.3743438720703+],+"forward": [+-0.8173573613166809,+0.5746700763702393,+-0.04100363329052925+],+"up": [+-0.03936588019132614,+0.015297574922442436,+0.9991077780723572+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 583.1597739830613+},+{+"blender_frame": 126,+"matrix_world": [+[+-0.5684159398078918,+-0.0391424335539341,+0.8218096494674683,+2.778874158859253+],+[+0.8226847648620605,+-0.015324762091040611,+0.5682912468910217,+7.3214521408081055+],+[+-0.00965026579797268,+0.9991161823272705,+0.04091272130608559,+1.4745750427246094+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+277.8874158859253,+-732.1452140808105,+147.45750427246094+],+"forward": [+-0.8218097686767578,+0.5682913064956665,+-0.040912725031375885+],+"up": [+-0.0391424335539341,+0.015324762091040611,+0.9991161823272705+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 581.4276786521077+},+{+"blender_frame": 127,+"matrix_world": [+[+-0.561918318271637,+-0.038649968802928925,+0.8262892365455627,+2.775275230407715+],+[+0.8271445035934448,+-0.015479606576263905,+0.5617759823799133,+7.286696434020996+],+[+-0.008921990171074867,+0.9991328716278076,+0.04066738486289978,+1.4757962226867676+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+277.5275230407715,+-728.6696434020996,+147.57962226867676+],+"forward": [+-0.8262892365455627,+0.5617759823799133,+-0.04066738486289978+],+"up": [+-0.03864997252821922,+0.015479608438909054,+0.9991329908370972+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 579.7474302351475+},+{+"blender_frame": 128,+"matrix_world": [+[+-0.5552851557731628,+-0.038083676248788834,+0.8307875394821167,+2.7716712951660156+],+[+0.8316217660903931,+-0.015847457572817802,+0.5551162958145142,+7.252018451690674+],+[+-0.007975000888109207,+0.9991488456726074,+0.04047108069062233,+1.4769320487976074+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+277.16712951660156,+-725.2018451690674,+147.69320487976074+],+"forward": [+-0.8307875394821167,+0.5551162958145142,+-0.04047108069062233+],+"up": [+-0.03808367997407913,+0.01584745943546295,+0.999148964881897+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 578.1206424348056+},+{+"blender_frame": 129,+"matrix_world": [+[+-0.5485082268714905,+-0.03764826059341431,+0.8352972269058228,+2.768120765686035+],+[+0.8361169695854187,+-0.016498250886797905,+0.548302948474884,+7.217390060424805+],+[+-0.006861711386591196,+0.9991549253463745,+0.04052777588367462,+1.4775031805038452+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.8120765686035,+-721.7390060424805,+147.75031805038452+],+"forward": [+-0.8352972269058228,+0.548302948474884,+-0.04052777588367462+],+"up": [+-0.03764826059341431,+0.016498250886797905,+0.9991549253463745+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 576.5488506294787+},+{+"blender_frame": 130,+"matrix_world": [+[+-0.541222333908081,+-0.03751786798238754,+0.8400420546531677,+2.7646806240081787+],+[+0.8408607244491577,+-0.017463600262999535,+0.540969729423523,+7.182770252227783+],+[+-0.0056258756667375565,+0.9991433024406433,+0.040998999029397964,+1.4771345853805542+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.46806240081787,+-718.2770252227783,+147.71345853805542+],+"forward": [+-0.8400421738624573,+0.5409697890281677,+-0.04099900275468826+],+"up": [+-0.03751787170767784,+0.017463602125644684,+0.9991434216499329+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 575.0392032787204+},+{+"blender_frame": 131,+"matrix_world": [+[+-0.533255934715271,+-0.0378030501306057,+0.8451088666915894,+2.761402130126953+],+[+0.8459429740905762,+-0.018721122294664383,+0.5329446792602539,+7.148111343383789+],+[+-0.00432555191218853,+0.9991097450256348,+0.04196237400174141,+1.4756406545639038+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.1402130126953,+-714.8111343383789,+147.56406545639038+],+"forward": [+-0.8451089859008789,+0.5329447388648987,+-0.04196237772703171+],+"up": [+-0.037803053855895996,+0.018721124157309532,+0.9991098642349243+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 573.5944077372551+},+{+"blender_frame": 132,+"matrix_world": [+[+-0.5247765779495239,+-0.03853088989853859,+0.850367546081543,+2.758324384689331+],+[+0.8512346148490906,+-0.020189980044960976,+0.5243968963623047,+7.113360404968262+],+[+-0.00303657166659832,+0.9990534782409668,+0.0433940514922142,+1.4730697870254517+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+275.8324384689331,+-711.3360404968262,+147.30697870254517+],+"forward": [+-0.850367546081543,+0.5243968963623047,+-0.0433940514922142+],+"up": [+-0.03853088989853859,+0.020189980044960976,+0.9990534782409668+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 572.2104868851602+},+{+"blender_frame": 133,+"matrix_world": [+[+-0.5159568190574646,+-0.039642464369535446,+0.8556967973709106,+2.7554759979248047+],+[+0.8566127419471741,+-0.02174014411866665,+0.5155017971992493,+7.078455924987793+],+[+-0.0018327876459807158,+0.9989774227142334,+0.045175209641456604,+1.4696979522705078+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+275.54759979248047,+-707.8455924987793,+146.96979522705078+],+"forward": [+-0.8556969165802002,+0.515501856803894,+-0.0451752133667469+],+"up": [+-0.039642464369535446,+0.02174014411866665,+0.9989774227142334+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 570.8831002935767+},+{+"blender_frame": 134,+"matrix_world": [+[+-0.5069742202758789,+-0.04100830852985382,+0.8609852194786072,+2.7528717517852783+],+[+0.8619608283042908,+-0.02321288175880909,+0.5064431428909302,+7.043338298797607+],+[+-0.000782428658567369,+0.998889148235321,+0.04711589217185974,+1.4659727811813354+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+275.28717517852783,+-704.3338298797607,+146.59727811813354+],+"forward": [+-0.8609852194786072,+0.5064431428909302,+-0.04711589217185974+],+"up": [+-0.04100830852985382,+0.02321288175880909,+0.998889148235321+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 569.608889054507+},+{+"blender_frame": 135,+"matrix_world": [+[+-0.49801257252693176,+-0.04245849698781967,+0.8661298155784607,+2.7505178451538086+],+[+0.8671699166297913,+-0.024447331205010414,+0.49741214513778687,+7.007953643798828+],+[+5.518976831808686e-05,+0.9987991452217102,+0.048993803560733795,+1.4624195098876953+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+275.05178451538086,+-700.7953643798828,+146.24195098876953+],+"forward": [+-0.8661298155784607,+0.49741214513778687,+-0.048993803560733795+],+"up": [+-0.04245849698781967,+0.024447331205010414,+0.9987991452217102+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 568.3872589841485+},+{+"blender_frame": 136,+"matrix_world": [+[+-0.4892609417438507,+-0.043821584433317184,+0.8710358738899231,+2.748412609100342+],+[+0.872137188911438,+-0.025307759642601013,+0.48860642313957214,+6.972256183624268+],+[+0.000632459472399205,+0.9987188577651978,+0.050600532442331314,+1.459531307220459+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.8412609100342,+-697.2256183624268,+145.9531307220459+],+"forward": [+-0.8710358738899231,+0.48860642313957214,+-0.050600532442331314+],+"up": [+-0.043821580708026886,+0.025307755917310715,+0.9987187385559082+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 567.219378054142+},+{+"blender_frame": 137,+"matrix_world": [+[+-0.4809143543243408,+-0.04496295005083084,+0.8756139278411865,+2.746549606323242+],+[+0.8767670392990112,+-0.02570548839867115,+0.4802277088165283,+6.936213493347168+],+[+0.0009156308369711041,+0.9986578822135925,+0.051784172654151917,+1.457664966583252+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.6549606323242,+-693.6213493347168,+145.7664966583252+],+"forward": [+-0.8756139278411865,+0.4802277088165283,+-0.051784172654151917+],+"up": [+-0.04496295005083084,+0.02570548839867115,+0.9986578822135925+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 566.1074552685022+},+{+"blender_frame": 138,+"matrix_world": [+[+-0.4729922115802765,+-0.04581548646092415,+0.8798747062683105,+2.744924306869507+],+[+0.8810662031173706,+-0.025609908625483513,+0.4722992777824402,+6.89980936050415+],+[+0.0008948886534199119,+0.9986217021942139,+0.052479758858680725,+1.4569662809371948+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.4924306869507,+-689.980936050415,+145.69662809371948+],+"forward": [+-0.879874587059021,+0.4722992181777954,+-0.05247975140810013+],+"up": [+-0.04581548273563385,+0.025609904900193214,+0.9986215829849243+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 565.0542818009853+},+{+"blender_frame": 139,+"matrix_world": [+[+-0.4650092124938965,+-0.04639466479420662,+0.8840894103050232,+2.7435312271118164+],+[+0.8853057026863098,+-0.025046929717063904,+0.46433451771736145,+6.863042831420898+],+[+0.0006010811193846166,+0.998609185218811,+0.052720509469509125,+1.457342267036438+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.35312271118164,+-686.3042831420898,+145.7342267036438+],+"forward": [+-0.8840894103050232,+0.46433451771736145,+-0.052720509469509125+],+"up": [+-0.04639466479420662,+0.025046929717063904,+0.998609185218811+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 564.0637882053852+},+{+"blender_frame": 140,+"matrix_world": [+[+-0.4569281041622162,+-0.04678766429424286,+0.8882722854614258,+2.742368221282959+],+[+0.8895035982131958,+-0.02410040609538555,+0.4562920928001404,+6.825930118560791+],+[+5.8877922128885984e-05,+0.9986141920089722,+0.052629951387643814,+1.4584835767745972+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.2368221282959,+-682.5930118560791,+145.84835767745972+],+"forward": [+-0.8882722854614258,+0.4562920928001404,+-0.052629951387643814+],+"up": [+-0.04678766056895256,+0.024100402370095253,+0.9986140727996826+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 563.1346422247589+},+{+"blender_frame": 141,+"matrix_world": [+[+-0.44875791668891907,+-0.04713231325149536,+0.8924095630645752,+2.7414331436157227+],+[+0.8936530947685242,+-0.022891473025083542,+0.44817423820495605,+6.788502216339111+],+[+-0.0006949197268113494,+0.9986263513565063,+0.052392661571502686,+1.4599344730377197+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.14331436157227,+-678.8502216339111,+145.99344730377197+],+"forward": [+-0.8924096822738647,+0.44817429780960083,+-0.05239266902208328+],+"up": [+-0.04713231325149536,+0.022891473025083542,+0.9986263513565063+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 562.2648938558996+},+{+"blender_frame": 142,+"matrix_world": [+[+-0.44050851464271545,+-0.047582052648067474,+0.8964866399765015,+2.7407212257385254+],+[+0.8977470993995667,+-0.02155528962612152,+0.4399837553501129,+6.7508015632629395+],+[+-0.0016113042365759611,+0.9986346960067749,+0.0522119365632534,+1.4611939191818237+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.07212257385254,+-675.080156326294,+146.11939191818237+],+"forward": [+-0.8964866399765015,+0.4399837553501129,+-0.0522119365632534+],+"up": [+-0.04758206009864807,+0.02155529148876667,+0.9986348152160645+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 561.4519310183823+},+{+"blender_frame": 143,+"matrix_world": [+[+-0.43219122290611267,+-0.04826623201370239,+0.900489330291748,+2.7402238845825195+],+[+0.9017782807350159,+-0.02021791972219944,+0.43172603845596313,+6.712874889373779+],+[+-0.00263176835142076,+0.9986298680305481,+0.05226344242691994,+1.4618264436721802+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.02238845825195,+-671.2874889373779,+146.18264436721802+],+"forward": [+-0.9004894495010376,+0.4317260980606079,+-0.052263449877500534+],+"up": [+-0.04826623201370239,+0.02021791972219944,+0.9986298680305481+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 560.6939814053476+},+{+"blender_frame": 144,+"matrix_world": [+[+-0.4238189160823822,+-0.04925505816936493,+0.904406726360321,+2.7399227619171143+],+[+0.9057394862174988,+-0.01897764764726162,+0.42340990900993347,+6.674774646759033+],+[+-0.0036915678065270185,+0.9986059069633484,+0.052655335515737534,+1.4615577459335327+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+273.9922761917114,+-667.4774646759033,+146.15577459335327+],+"forward": [+-0.904406726360321,+0.42340990900993347,+-0.052655335515737534+],+"up": [+-0.04925505816936493,+0.01897764764726162,+0.9986059069633484+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 559.9895065650344+},+{+"blender_frame": 145,+"matrix_world": [+[+-0.4154057800769806,+-0.050537098199129105,+0.9082313776016235,+2.739793062210083+],+[+0.9096239805221558,+-0.017894072458148003,+0.4150471091270447,+6.636553764343262+],+[+-0.004723316058516502,+0.9985619187355042,+0.05340305343270302,+1.4603348970413208+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+273.9793062210083,+-663.6553764343262,+146.03348970413208+],+"forward": [+-0.908231258392334,+0.4150470495223999,+-0.05340304598212242+],+"up": [+-0.050537098199129105,+0.017894072458148003,+0.9985619187355042+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 559.3374470248818+},+{+"blender_frame": 146,+"matrix_world": [+[+-0.40696629881858826,+-0.0520147979259491,+0.9119610786437988,+2.739799976348877+],+[+0.913425862789154,+-0.016986604779958725,+0.40665096044540405,+6.598259449005127+],+[+-0.005660743918269873,+0.9985017776489258,+0.05442463234066963,+1.4583377838134766+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+273.9799976348877,+-659.8259449005127,+145.83377838134766+],+"forward": [+-0.9119610786437988,+0.40665096044540405,+-0.05442463234066963+],+"up": [+-0.052014805376529694,+0.016986606642603874,+0.9985018968582153+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 558.7366798892617+},+{+"blender_frame": 147,+"matrix_world": [+[+-0.39851585030555725,+-0.053519584238529205,+0.9155986309051514,+2.739903211593628+],+[+0.9171388149261475,+-0.016241952776908875,+0.3982369005680084,+6.559937477111816+],+[+-0.006442362908273935,+0.9984346628189087,+0.05555756390094757,+1.4559396505355835+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+273.9903211593628,+-655.9937477111816,+145.59396505355835+],+"forward": [+-0.9155986309051514,+0.3982369005680084,+-0.05555756390094757+],+"up": [+-0.0535195916891098,+0.016241954639554024,+0.9984347820281982+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 558.1868842244148+},+{+"blender_frame": 148,+"matrix_world": [+[+-0.3900707960128784,+-0.05484351888298988,+0.9191500544548035,+2.7400598526000977+],+[+0.9207581877708435,+-0.01562771201133728,+0.3898206949234009,+6.5216240882873535+],+[+-0.007014922797679901,+0.998372495174408,+0.056593529880046844,+1.45362389087677+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.00598526000977,+-652.1624088287354,+145.362389087677+],+"forward": [+-0.919150173664093,+0.38982075452804565,+-0.05659353733062744+],+"up": [+-0.05484353378415108,+0.01562771573662758,+0.9983727335929871+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 557.6882749795914+},+{+"blender_frame": 149,+"matrix_world": [+[+-0.3816468119621277,+-0.05578091740608215,+0.9226235151290894,+2.7402312755584717+],+[+0.9242792129516602,+-0.015108542516827583,+0.3814181685447693,+6.483354568481445+],+[+-0.007336359471082687,+0.9983288049697876,+0.05732326582074165,+1.4518781900405884+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.02312755584717,+-648.3354568481445,+145.18781900405884+],+"forward": [+-0.9226236343383789,+0.38141822814941406,+-0.05732327327132225+],+"up": [+-0.055780909955501556,+0.015108540654182434,+0.998328685760498+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 557.2420747950673+},+{+"blender_frame": 150,+"matrix_world": [+[+-0.37325963377952576,+-0.05617101490497589,+0.926024854183197,+2.740384817123413+],+[+0.9276975393295288,+-0.014660660177469254,+0.37304461002349854,+6.445154666900635+],+[+-0.007378158159554005,+0.9983134269714355,+0.05758195370435715,+1.4510858058929443+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.0384817123413,+-644.5154666900635,+145.10858058929443+],+"forward": [+-0.926024854183197,+0.37304461002349854,+-0.05758195370435715+],+"up": [+-0.05617102235555649,+0.014660662040114403,+0.9983135461807251+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 556.8484631367028+},+{+"blender_frame": 151,+"matrix_world": [+[+-0.3649246394634247,+-0.05593249201774597,+0.9293554425239563,+2.7405035495758057+],+[+0.931009829044342,+-0.014281341806054115,+0.36471474170684814,+6.407046794891357+],+[+-0.0071269613690674305,+0.9983323812484741,+0.057285308837890625,+1.4514403343200684+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.05035495758057,+-640.7046794891357,+145.14403343200684+],+"forward": [+-0.9293555617332458,+0.36471477150917053,+-0.05728531628847122+],+"up": [+-0.05593249946832657,+0.014281343668699265,+0.9983325004577637+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 556.5070865675807+},+{+"blender_frame": 152,+"matrix_world": [+[+-0.3556564152240753,+-0.05511586368083954,+0.9329901933670044,+2.740626335144043+],+[+0.9345936179161072,+-0.013939314521849155,+0.35544419288635254,+6.362725257873535+],+[+-0.006585368886590004,+0.9983826279640198,+0.05646853148937225,+1.4529006481170654+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.0626335144043,+-636.2725257873535,+145.29006481170654+],+"forward": [+-0.932990312576294,+0.3554442226886749,+-0.05646853893995285+],+"up": [+-0.055115871131420135,+0.013939316384494305,+0.9983827471733093+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 555.9998851269484+},+{+"blender_frame": 153,+"matrix_world": [+[+-0.3461591303348541,+-0.053811296820640564,+0.9366313815116882,+2.740978479385376+],+[+0.9381580352783203,+-0.01371248159557581,+0.3459356129169464,+6.316797733306885+],+[+-0.00577170355245471,+0.9984568953514099,+0.055230215191841125,+1.4551976919174194+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.0978479385376,+-631.6797733306885,+145.51976919174194+],+"forward": [+-0.9366313815116882,+0.3459356129169464,+-0.055230215191841125+],+"up": [+-0.05381130427122116,+0.013712483458220959,+0.9984570145606995+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 555.5263451300561+},+{+"blender_frame": 154,+"matrix_world": [+[+-0.3366697430610657,+-0.05220383405685425,+0.9401746392250061,+2.7415876388549805+],+[+0.9416110515594482,+-0.013660792261362076,+0.3364255726337433,+6.270695209503174+],+[+-0.004719174467027187,+0.9985430836677551,+0.05375487357378006,+1.4578907489776611+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.15876388549805,+-627.0695209503174,+145.7890748977661+],+"forward": [+-0.9401746392250061,+0.3364255726337433,+-0.05375487357378006+],+"up": [+-0.05220383405685425,+0.013660792261362076,+0.9985430836677551+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 555.1427665166557+},+{+"blender_frame": 155,+"matrix_world": [+[+-0.3272063732147217,+-0.050524648278951645,+0.9436012506484985,+2.7424728870391846+],+[+0.9449465274810791,+-0.013823771849274635,+0.3269326984882355,+6.224417686462402+],+[+-0.0034740306437015533,+0.9986270666122437,+0.05226631462574005,+1.4604603052139282+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.24728870391846,+-622.4417686462402,+146.04603052139282+],+"forward": [+-0.9436012506484985,+0.3269326984882355,+-0.05226631462574005+],+"up": [+-0.05052465572953224,+0.013823773711919785,+0.9986271858215332+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 554.8509621992707+},+{+"blender_frame": 156,+"matrix_world": [+[+-0.31778913736343384,+-0.04899849370121956,+0.9468944668769836,+2.743655204772949+],+[+0.9481591582298279,+-0.014217957854270935,+0.317477822303772,+6.177953720092773+],+[+-0.0020930273458361626,+0.9986976385116577,+0.05097667872905731,+1.462419033050537+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.3655204772949,+-617.7953720092773,+146.2419033050537+],+"forward": [+-0.9468945860862732,+0.31747785210609436,+-0.05097668617963791+],+"up": [+-0.048998501151800156,+0.014217959716916084,+0.9986977577209473+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 554.6521912328899+},+{+"blender_frame": 157,+"matrix_world": [+[+-0.30843809247016907,+-0.04780026152729988,+0.9500426054000854,+2.7451512813568115+],+[+0.9512442946434021,+-0.014826791360974312,+0.3080821633338928,+6.131283760070801+],+[+-0.0006403254810720682,+0.9987468719482422,+0.05004286393523216,+1.4634150266647339+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.51512813568115,+-613.1283760070801,+146.3415026664734+],+"forward": [+-0.950042724609375,+0.3080821931362152,+-0.05004287138581276+],+"up": [+-0.04780026152729988,+0.014826791360974312,+0.9987468719482422+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 554.5469988137484+},+{+"blender_frame": 158,+"matrix_world": [+[+-0.2991732954978943,+-0.04702268913388252,+0.9530394673347473,+2.7469680309295654+],+[+0.9541985392570496,+-0.015597325749695301,+0.2987675368785858,+6.084381103515625+],+[+0.0008160143624991179,+0.9987720251083374,+0.04953527823090553,+1.4633064270019531+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.69680309295654,+-608.4381103515625,+146.3306427001953+],+"forward": [+-0.9530394673347473,+0.2987675368785858,+-0.04953527823090553+],+"up": [+-0.04702269658446312,+0.01559732761234045,+0.998772144317627+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 554.5348883606493+},+{+"blender_frame": 159,+"matrix_world": [+[+-0.29001384973526,+-0.04666176438331604,+0.9558841586112976,+2.749101161956787+],+[+0.9570199251174927,+-0.01644439436495304,+0.2895556688308716,+6.037215709686279+],+[+0.002207760000601411,+0.9987753033638,+0.04942534491419792,+1.4621901512145996+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.9101161956787,+-603.7215709686279,+146.21901512145996+],+"forward": [+-0.9558842778205872,+0.28955569863319397,+-0.04942535236477852+],+"up": [+-0.04666176810860634,+0.01644439622759819,+0.9987754225730896+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 554.6142154373229+},+{+"blender_frame": 160,+"matrix_world": [+[+-0.2809770107269287,+-0.04662378877401352,+0.958581268787384,+2.7515335083007812+],+[+0.9597082734107971,+-0.017261667177081108,+0.280467689037323,+5.989753723144531+],+[+0.0034702448174357414,+0.998763382434845,+0.04959535598754883,+1.4603784084320068+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+275.1533508300781,+-598.9753723144531,+146.03784084320068+],+"forward": [+-0.9585813879966736,+0.2804677188396454,+-0.049595363438129425+],+"up": [+-0.04662378877401352,+0.017261667177081108,+0.998763382434845+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 554.7812498174608+},+{+"blender_frame": 161,+"matrix_world": [+[+-0.27207884192466736,+-0.0467509999871254,+0.9611386060714722,+2.754237651824951+],+[+0.9622642397880554,+-0.017937030643224716,+0.27152496576309204,+5.941965579986572+],+[+0.004545908421278,+0.9987455010414124,+0.04986709728837013,+1.4583293199539185+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+275.4237651824951,+-594.1965579986572,+145.83293199539185+],+"forward": [+-0.9611387252807617,+0.27152499556541443,+-0.04986710473895073+],+"up": [+-0.046751003712415695,+0.017937032505869865,+0.9987456202507019+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 555.0317383371294+},+{+"blender_frame": 162,+"matrix_world": [+[+-0.26333314180374146,+-0.046861737966537476,+0.9635660648345947,+2.757181167602539+],+[+0.9646899700164795,+-0.018369480967521667,+0.2627468705177307,+5.893826484680176+],+[+0.005387434270232916,+0.9987323880195618,+0.050044335424900055,+1.4565455913543701+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+275.7181167602539,+-589.3826484680176,+145.654559135437+],+"forward": [+-0.9635661840438843,+0.2627469003200531,+-0.05004434287548065+],+"up": [+-0.046861741691827774,+0.018369482830166817,+0.9987325072288513+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 555.3606590256095+},+{+"blender_frame": 163,+"matrix_world": [+[+-0.2547520101070404,+-0.04679453745484352,+0.9658735990524292,+2.760331392288208+],+[+0.9669880270957947,+-0.018484001979231834,+0.25415048003196716,+5.8453240394592285+],+[+0.005960353184491396,+0.9987334609031677,+0.049958594143390656,+1.4554641246795654+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.0331392288208,+-584.5324039459229,+145.54641246795654+],+"forward": [+-0.9658735990524292,+0.25415048003196716,+-0.049958594143390656+],+"up": [+-0.04679454118013382,+0.018484003841876984,+0.9987335801124573+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 555.7628471404314+},+{+"blender_frame": 164,+"matrix_world": [+[+-0.2463456094264984,+-0.04644783213734627,+0.9680683612823486,+2.763657808303833+],+[+0.9691619277000427,+-0.018241869285702705,+0.2457486242055893,+5.796453952789307+],+[+0.006244887597858906,+0.9987542629241943,+0.049509260803461075,+1.4553600549697876+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.3657808303833,+-579.6453952789307,+145.53600549697876+],+"forward": [+-0.9680684804916382,+0.24574865400791168,+-0.04950926825404167+],+"up": [+-0.04644782841205597,+0.018241867423057556,+0.9987541437149048+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 556.2323951162398+},+{+"blender_frame": 165,+"matrix_world": [+[+-0.2381218820810318,+-0.045805178582668304,+0.9701545238494873,+2.7671403884887695+],+[+0.9712153077125549,+-0.017644625157117844,+0.23754911124706268,+5.747228622436523+],+[+0.00623703096061945,+0.9987946152687073,+0.04868825152516365,+1.4562865495681763+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.71403884887695,+-574.7228622436523,+145.62865495681763+],+"forward": [+-0.9701546430587769,+0.23754914104938507,+-0.04868825897574425+],+"up": [+-0.045805178582668304,+0.017644625157117844,+0.9987946152687073+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 556.7630976438522+},+{+"blender_frame": 166,+"matrix_world": [+[+-0.23008781671524048,+-0.044941604137420654,+0.9721315503120422,+2.7707679271698+],+[+0.9731516242027283,+-0.01673162542283535,+0.22955574095249176,+5.697673797607422+],+[+0.005948738660663366,+0.9988495111465454,+0.047584738582372665,+1.458064079284668+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+277.07679271698,+-569.7673797607422,+145.8064079284668+],+"forward": [+-0.9721316695213318,+0.22955577075481415,+-0.04758474603295326+],+"up": [+-0.044941604137420654,+0.01673162542283535,+0.9988495111465454+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 557.3486655950546+},+{+"blender_frame": 167,+"matrix_world": [+[+-0.22224876284599304,+-0.04400882124900818,+0.9739962816238403,+2.7745392322540283+],+[+0.9749751091003418,+-0.015571932308375835,+0.22176848351955414,+5.6478271484375+],+[+0.005407233722507954,+0.9989097714424133,+0.04636834189295769,+1.4603193998336792+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+277.45392322540283,+-564.78271484375,+146.03193998336792+],+"forward": [+-0.9739962816238403,+0.22176848351955414,+-0.04636834189295769+],+"up": [+-0.04400882124900818,+0.015571932308375835,+0.9989097714424133+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 557.9835311509669+},+{+"blender_frame": 168,+"matrix_world": [+[+-0.21460869908332825,+-0.04320254176855087,+0.9757441282272339,+2.7784576416015625+],+[+0.9766890406608582,+-0.014252550899982452,+0.2141854614019394,+5.597736358642578+],+[+0.004653486888855696,+0.9989646077156067,+0.0452541708946228,+1.4625685214996338+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+277.84576416015625,+-559.7736358642578,+146.25685214996338+],+"forward": [+-0.9757441282272339,+0.2141854614019394,+-0.0452541708946228+],+"up": [+-0.04320254549384117,+0.014252552762627602,+0.9989647269248962+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 558.6637832224369+},+{+"blender_frame": 169,+"matrix_world": [+[+-0.20717063546180725,+-0.042719896882772446,+0.9773716330528259,+2.7825303077697754+],+[+0.9782977104187012,+-0.012865718454122543,+0.206804558634758,+5.54745626449585+],+[+0.003739918814972043,+0.9990042448043823,+0.04445817321538925,+1.4643231630325317+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+278.25303077697754,+-554.745626449585,+146.43231630325317+],+"forward": [+-0.9773716330528259,+0.206804558634758,+-0.04445817321538925+],+"up": [+-0.042719896882772446,+0.012865718454122543,+0.9990042448043823+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 559.3871601857245+},+{+"blender_frame": 170,+"matrix_world": [+[+-0.19993697106838226,+-0.04271544888615608,+0.9788773059844971,+2.786757707595825+],+[+0.979805052280426,+-0.011497408151626587,+0.19962474703788757,+5.497046947479248+],+[+0.0027274913154542446,+0.9990209937095642,+0.044151585549116135,+1.4651991128921509+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+278.6757707595825,+-549.7046947479248,+146.5199112892151+],+"forward": [+-0.9788773059844971,+0.19962474703788757,+-0.044151585549116135+],+"up": [+-0.04271545261144638,+0.011497409082949162,+0.9990211129188538+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 560.1523586548865+},+{+"blender_frame": 171,+"matrix_world": [+[+-0.19290858507156372,+-0.04326615110039711,+0.9802623391151428,+2.7911343574523926+],+[+0.9812152981758118,+-0.010219021700322628,+0.19264504313468933,+5.4465651512146+],+[+0.0016823109472170472,+0.9990112781524658,+0.044424742460250854,+1.4650019407272339+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+279.11343574523926,+-544.65651512146,+146.5001940727234+],+"forward": [+-0.9802624583244324,+0.19264507293701172,+-0.04442474618554115+],+"up": [+-0.04326615482568741,+0.010219022631645203,+0.9990113973617554+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 560.9573721885681+},+{+"blender_frame": 172,+"matrix_world": [+[+-0.186086043715477,+-0.04435281828045845,+0.9815319180488586,+2.795642852783203+],+[+0.9825333952903748,+-0.009083380922675133,+0.18586541712284088,+5.3960700035095215+],+[+0.0006719728116877377,+0.9989745616912842,+0.04526841267943382,+1.4637712240219116+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+279.5642852783203,+-539.6070003509521,+146.37712240219116+],+"forward": [+-0.9815319180488586,+0.18586541712284088,+-0.04526841267943382+],+"up": [+-0.04435282200574875,+0.009083381853997707,+0.9989746809005737+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 561.7992333136499+},+{+"blender_frame": 173,+"matrix_world": [+[+-0.17946849763393402,+-0.04586277902126312,+0.982694149017334,+2.80025315284729+],+[+0.9837637543678284,+-0.008124887943267822,+0.17928463220596313,+5.345611095428467+],+[+-0.00023821310605853796,+0.9989145994186401,+0.046576306223869324,+1.4617739915847778+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.025315284729,+-534.5611095428467,+146.17739915847778+],+"forward": [+-0.982694149017334,+0.17928463220596313,+-0.046576306223869324+],+"up": [+-0.04586278274655342,+0.008124888874590397,+0.9989147186279297+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 562.6732593402267+},+{+"blender_frame": 174,+"matrix_world": [+[+-0.17305457592010498,+-0.047612641006708145,+0.9837607741355896,+2.804928779602051+],+[+0.9849117994308472,+-0.0073630064725875854,+0.1729007214307785,+5.2952351570129395+],+[+-0.0009888226632028818,+0.9988387823104858,+0.048168450593948364,+1.459449052810669+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.4928779602051,+-529.523515701294,+145.9449052810669+],+"forward": [+-0.9837607741355896,+0.1729007214307785,+-0.048168450593948364+],+"up": [+-0.047612641006708145,+0.0073630064725875854,+0.9988387823104858+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 563.5740958154202+},+{+"blender_frame": 175,+"matrix_world": [+[+-0.1668413132429123,+-0.049386780709028244,+0.9847460389137268,+2.8096275329589844+],+[+0.9859825968742371,+-0.006807457190006971,+0.16670937836170197,+5.244978427886963+],+[+-0.0015296230558305979,+0.9987565875053406,+0.04983026161789894,+1.4573136568069458+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.96275329589844,+-524.4978427886963,+145.73136568069458+],+"forward": [+-0.9847461581230164,+0.16670939326286316,+-0.04983026906847954+],+"up": [+-0.049386780709028244,+0.006807457190006971,+0.9987565875053406+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 564.4966173917055+},+{+"blender_frame": 176,+"matrix_world": [+[+-0.1608249843120575,+-0.05098319798707962,+0.9856653213500977,+2.8143105506896973+],+[+0.9869813323020935,+-0.006463566794991493,+0.1607053577899933,+5.1948699951171875+],+[+-0.0018223586957901716,+0.9986786246299744,+0.05135896056890488,+1.45585298538208+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.4310550689697,+-519.4869995117188,+145.585298538208+],+"forward": [+-0.9856653213500977,+0.1607053577899933,+-0.05135896056890488+],+"up": [+-0.05098319798707962,+0.006463566794991493,+0.9986786246299744+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 565.436727553606+},+{+"blender_frame": 177,+"matrix_world": [+[+-0.15500038862228394,+-0.052256204187870026,+0.9865314364433289,+2.8189477920532227+],+[+0.9879127144813538,+-0.006336008198559284,+0.1548818051815033,+5.144929885864258+],+[+-0.0018428643234074116,+0.9986135363578796,+0.05260665714740753,+1.4554160833358765+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+281.89477920532227,+-514.4929885864258,+145.54160833358765+],+"forward": [+-0.9865314364433289,+0.1548818051815033,+-0.05260665714740753+],+"up": [+-0.05225621163845062,+0.006336009129881859,+0.9986136555671692+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 566.3912042975426+},+{+"blender_frame": 178,+"matrix_world": [+[+-0.14936122298240662,+-0.05314742773771286,+0.9873533248901367,+2.8235230445861816+],+[+0.9887815117835999,+-0.006430157460272312,+0.14923110604286194,+5.095168590545654+],+[+-0.0015824134461581707,+0.9985659718513489,+0.0535116009414196,+1.4561420679092407+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.35230445861816,+-509.51685905456543,+145.61420679092407+],+"forward": [+-0.9873534440994263,+0.14923112094402313,+-0.0535116083920002+],+"up": [+-0.05314742773771286,+0.006430157460272312,+0.9985659718513489+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 567.3577358946204+},+{+"blender_frame": 179,+"matrix_world": [+[+-0.14389967918395996,+-0.05369757488369942,+0.9881343245506287,+2.8280341625213623+],+[+0.9895917773246765,+-0.006750669330358505,+0.1437450647354126,+5.045586585998535+],+[+-0.0010481930803507566,+0.9985344409942627,+0.0541100949048996,+1.4579318761825562+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.80341625213623,+-504.5586585998535,+145.79318761825562+],+"forward": [+-0.9881343245506287,+0.1437450647354126,+-0.0541100949048996+],+"up": [+-0.05369757488369942,+0.006750669330358505,+0.9985344409942627+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 568.3337969705462+},+{+"blender_frame": 180,+"matrix_world": [+[+-0.13860684633255005,+-0.054036855697631836,+0.988872230052948,+2.832496404647827+],+[+0.9903475046157837,+-0.0072977920062839985,+0.13841484487056732,+4.996175289154053+],+[+-0.0002629197551868856,+0.9985122680664062,+0.05452679470181465,+1.4604707956314087+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.2496404647827,+-499.6175289154053,+146.04707956314087+],+"forward": [+-0.988872230052948,+0.13841484487056732,+-0.05452679470181465+],+"up": [+-0.054036855697631836,+0.0072977920062839985,+0.9985122680664062+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 569.3178497254848+},+{+"blender_frame": 181,+"matrix_world": [+[+-0.1334727257490158,+-0.05435575544834137,+0.9895607829093933,+2.8369343280792236+],+[+0.9910522103309631,+-0.008062465116381645,+0.1332310438156128,+4.946916103363037+],+[+0.0007364272023551166,+0.9984891414642334,+0.054945509880781174,+1.463297724723816+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.69343280792236,+-494.6916103363037,+146.3297724723816+],+"forward": [+-0.9895607829093933,+0.1332310438156128,+-0.054945509880781174+],+"up": [+-0.05435575544834137,+0.008062465116381645,+0.9984891414642334+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 570.3082904219627+},+{+"blender_frame": 182,+"matrix_world": [+[+-0.12848655879497528,+-0.05486263334751129,+0.9901924729347229,+2.841376304626465+],+[+0.9917094707489014,+-0.009021603502333164,+0.1281835287809372,+4.8977837562561035+],+[+0.001900639501400292,+0.9984530806541443,+0.0555669441819191,+1.4659075736999512+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.1376304626465,+-489.77837562561035,+146.59075736999512+],+"forward": [+-0.9901925921440125,+0.1281835436820984,+-0.055566951632499695+],+"up": [+-0.05486264079809189,+0.009021604433655739,+0.9984531998634338+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 571.3043846189976+},+{+"blender_frame": 183,+"matrix_world": [+[+-0.12363667786121368,+-0.055737465620040894,+0.9907610416412354,+2.84584903717041+],+[+0.992322564125061,+-0.010134920477867126,+0.12326138466596603,+4.8487420082092285+],+[+0.003171007614582777,+0.9983940124511719,+0.056562572717666626,+1.4678605794906616+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.584903717041,+-484.87420082092285,+146.78605794906616+],+"forward": [+-0.9907610416412354,+0.12326138466596603,+-0.056562572717666626+],+"up": [+-0.05573747307062149,+0.010134921409189701,+0.9983941316604614+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 572.3053600639105+},+{+"blender_frame": 184,+"matrix_world": [+[+-0.1189115047454834,+-0.057091183960437775,+0.9912621378898621,+2.850367307662964+],+[+0.9928947687149048,+-0.0113443648442626,+0.11845395714044571,+4.799753189086914+],+[+0.004482562653720379,+0.9983044862747192,+0.058034498244524,+1.4688782691955566+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.0367307662964,+-479.9753189086914,+146.88782691955566+],+"forward": [+-0.9912621378898621,+0.11845395714044571,+-0.058034498244524+],+"up": [+-0.05709119141101837,+0.011344365775585175,+0.9983046054840088+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 573.3095243573189+},+{+"blender_frame": 185,+"matrix_world": [+[+-0.11429857462644577,+-0.058940425515174866,+0.9916964769363403,+2.854930877685547+],+[+0.9934298396110535,+-0.012576630339026451,+0.11375085264444351,+4.750772953033447+],+[+0.005767677444964647,+0.9981822371482849,+0.05999066308140755,+1.46890389919281+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.4930877685547,+-475.0772953033447,+146.890389919281+],+"forward": [+-0.9916964769363403,+0.11375085264444351,+-0.05999066308140755+],+"up": [+-0.05894043296575546,+0.0125766322016716,+0.9981823563575745+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 574.3139792233706+},+{+"blender_frame": 186,+"matrix_world": [+[+-0.10978623479604721,+-0.06120223179459572,+0.9920692443847656,+2.85952091217041+],+[+0.9939309358596802,+-0.013748700730502605,+0.10914407670497894,+4.701760768890381+],+[+0.006959801539778709,+0.9980306625366211,+0.06234022229909897,+1.468112587928772+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.952091217041,+-470.1760768890381,+146.8112587928772+],+"forward": [+-0.9920692443847656,+0.10914407670497894,+-0.06234022229909897+],+"up": [+-0.061202239245176315,+0.013748702593147755,+0.9980307817459106+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 575.3143643960357+},+{+"blender_frame": 187,+"matrix_world": [+[+-0.10536295175552368,+-0.063710518181324,+0.9923908114433289,+2.8641037940979004+],+[+0.9944016933441162,+-0.014775465242564678,+0.10462786257266998,+4.652675628662109+],+[+0.007997140288352966,+0.9978591203689575,+0.0649106353521347,+1.466873049736023+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.41037940979004,+-465.26756286621094,+146.6873049736023+],+"forward": [+-0.9923909306526184,+0.10462787747383118,+-0.0649106428027153+],+"up": [+-0.063710518181324,+0.014775465242564678,+0.9978591203689575+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 576.306052133441+},+{+"blender_frame": 188,+"matrix_world": [+[+-0.10101836174726486,+-0.06625024974346161,+0.992676317691803,+2.8686330318450928+],+[+0.994845449924469,+-0.015578405931591988,+0.10019941627979279,+4.603488445281982+],+[+0.008826078847050667,+0.9976814389228821,+0.06748246401548386,+1.465664267539978+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.8633031845093,+-460.34884452819824,+146.5664267539978+],+"forward": [+-0.992676317691803,+0.10019941627979279,+-0.06748246401548386+],+"up": [+-0.06625024974346161,+0.015578405931591988,+0.9976814389228821+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 577.2850818932056+},+{+"blender_frame": 189,+"matrix_world": [+[+-0.09674326330423355,+-0.06860236823558807,+0.9929422736167908,+2.8730597496032715+],+[+0.995265007019043,+-0.0160937812179327,+0.09585762023925781,+4.554178237915039+],+[+0.009404136799275875,+0.9975143074989319,+0.06983447819948196,+1.4649688005447388+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.30597496032715,+-455.4178237915039,+146.49688005447388+],+"forward": [+-0.9929423928260803,+0.095857635140419,+-0.06983448565006256+],+"up": [+-0.06860236823558807,+0.0160937812179327,+0.9975143074989319+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 578.2487254589796+},+{+"blender_frame": 190,+"matrix_world": [+[+-0.09252950549125671,+-0.07058906555175781,+0.993204653263092,+2.877336025238037+],+[+0.9956626296043396,+-0.016279011964797974,+0.09160152077674866,+4.504737854003906+],+[+0.009702323004603386,+0.9973726868629456,+0.07178919017314911,+1.4651652574539185+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.7336025238037,+-450.4737854003906,+146.51652574539185+],+"forward": [+-0.993204653263092,+0.09160152077674866,+-0.07178919017314911+],+"up": [+-0.07058906555175781,+0.016279011964797974,+0.9973726868629456+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 579.1952766478062+},+{+"blender_frame": 191,+"matrix_world": [+[+-0.08837063610553741,+-0.0721103623509407,+0.993474006652832,+2.8814280033111572+],+[+0.9960404634475708,+-0.016116445884108543,+0.08742910623550415,+4.455175399780273+],+[+0.009706724435091019,+0.9972664713859558,+0.07324904203414917,+1.4664422273635864+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.1428003311157,+-445.51753997802734,+146.64422273635864+],+"forward": [+-0.9934741258621216,+0.08742911368608475,+-0.07324904948472977+],+"up": [+-0.0721103623509407,+0.016116445884108543,+0.9972664713859558+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 580.1235435530543+},+{+"blender_frame": 192,+"matrix_world": [+[+-0.08426187932491302,+-0.07316286861896515,+0.9937541484832764,+2.885312795639038+],+[+0.9963991641998291,+-0.015613951720297337,+0.08333662152290344,+4.405514717102051+],+[+0.009419281966984272,+0.9971978068351746,+0.07421508431434631,+1.4687542915344238+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.5312795639038,+-440.5514717102051,+146.87542915344238+],+"forward": [+-0.9937541484832764,+0.08333662152290344,+-0.07421508431434631+],+"up": [+-0.07316286861896515,+0.015613951720297337,+0.9971978068351746+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 581.031172722578+},+{+"blender_frame": 193,+"matrix_world": [+[+-0.08020000904798508,+-0.0738382488489151,+0.9940401911735535,+2.8889851570129395+],+[+0.9967395067214966,+-0.014802618883550167,+0.07931823283433914,+4.355793476104736+],+[+0.00885767862200737,+0.9971603751182556,+0.07478465884923935,+1.4718282222747803+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.89851570129395,+-435.57934761047363,+147.18282222747803+],+"forward": [+-0.9940401911735535,+0.07931823283433914,+-0.07478465884923935+],+"up": [+-0.0738382488489151,+0.014802618883550167,+0.9971603751182556+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 581.9152683019638+},+{+"blender_frame": 194,+"matrix_world": [+[+-0.07618402689695358,+-0.07430034130811691,+0.9943215847015381,+2.8924522399902344+],+[+0.9970613121986389,+-0.01373218558728695,+0.07536779344081879,+4.306065559387207+],+[+0.008054355159401894,+0.9971413612365723,+0.07512816786766052,+1.475219488143921+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.24522399902344,+-430.6065559387207,+147.5219488143921+],+"forward": [+-0.9943215847015381,+0.07536779344081879,+-0.07512816786766052+],+"up": [+-0.07430034130811691,+0.01373218558728695,+0.9971413612365723+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 582.7729411423206+},+{+"blender_frame": 195,+"matrix_world": [+[+-0.07221420109272003,+-0.07474732398986816,+0.994584321975708,+2.895725727081299+],+[+0.9973642230033875,+-0.012465103529393673,+0.07147922366857529,+4.25639533996582+],+[+0.007054714951664209,+0.9971245527267456,+0.07545047253370285,+1.4784044027328491+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.5725727081299,+-425.63953399658203,+147.8404402732849+],+"forward": [+-0.994584321975708,+0.07147922366857529,+-0.07545047253370285+],+"up": [+-0.07474733144044876,+0.012465105392038822,+0.9971246719360352+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 583.6009476333857+},+{+"blender_frame": 196,+"matrix_world": [+[+-0.06829264760017395,+-0.07536580413579941,+0.9948146343231201,+2.8988170623779297+],+[+0.9976478815078735,+-0.011070404201745987,+0.06764846295118332,+4.206856727600098+],+[+0.005914616398513317,+0.9970945119857788,+0.07594455778598785,+1.4808918237686157+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.88170623779297,+-420.68567276000977,+148.08918237686157+],+"forward": [+-0.9948146343231201,+0.06764846295118332,+-0.07594455778598785+],+"up": [+-0.07536580413579941,+0.011070404201745987,+0.9970945119857788+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 584.3964517116547+},+{+"blender_frame": 197,+"matrix_world": [+[+-0.06442270427942276,+-0.07628832012414932,+0.9950024485588074,+2.9017281532287598+],+[+0.9979116916656494,+-0.009618154726922512,+0.06387363374233246,+4.157528877258301+],+[+0.004697275348007679,+0.9970393776893616,+0.07674862444400787,+1.4823260307312012+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.172815322876,+-415.7528877258301,+148.23260307312012+],+"forward": [+-0.9950024485588074,+0.06387363374233246,+-0.07674862444400787+],+"up": [+-0.07628832757472992,+0.009618155658245087,+0.9970394968986511+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 585.15705447644+},+{+"blender_frame": 198,+"matrix_world": [+[+-0.06060858070850372,+-0.0775625929236412,+0.9951435327529907,+2.904444932937622+],+[+0.9981556534767151,+-0.008175230585038662,+0.060154832899570465,+4.108494281768799+],+[+0.0034697630908340216,+0.9969540238380432,+0.0779150053858757,+1.482560634613037+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.4444932937622,+-410.8494281768799,+148.2560634613037+],+"forward": [+-0.9951435327529907,+0.060154832899570465,+-0.0779150053858757+],+"up": [+-0.0775625929236412,+0.008175230585038662,+0.9969540238380432+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 585.8798258006573+},+{+"blender_frame": 199,+"matrix_world": [+[+-0.056855205446481705,+-0.07913967967033386,+0.9952409267425537,+2.9069361686706543+],+[+0.9983797073364258,+-0.0068025607615709305,+0.056493598967790604,+4.059834003448486+],+[+0.002299301326274872,+0.9968404173851013,+0.07939820736646652,+1.4816877841949463+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.69361686706543,+-405.98340034484863,+148.16877841949463+],+"forward": [+-0.9952409267425537,+0.056493598967790604,+-0.07939820736646652+],+"up": [+-0.07913967967033386,+0.0068025607615709305,+0.9968404173851013+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 586.5611106157303+},+{+"blender_frame": 200,+"matrix_world": [+[+-0.053168267011642456,+-0.08088398724794388,+0.995304524898529,+2.909153461456299+],+[+0.9985848069190979,+-0.005553734954446554,+0.052892185747623444,+4.011630535125732+],+[+0.0012495267437770963,+0.9967080950737,+0.08106479793787003,+1.4800153970718384+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.9153461456299,+-401.16305351257324,+148.00153970718384+],+"forward": [+-0.9953044056892395,+0.05289217829704285,+-0.08106479048728943+],+"up": [+-0.08088398724794388,+0.005553734954446554,+0.9967080950737+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 587.1973546221852+},+{+"blender_frame": 201,+"matrix_world": [+[+-0.049553025513887405,+-0.08260218054056168,+0.9953498244285583,+2.9110357761383057+],+[+0.9987714290618896,+-0.004474368877708912,+0.04935203865170479,+3.9639570713043213+],+[+0.00037697554216720164,+0.9965725541114807,+0.08272241055965424,+1.477996587753296+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.10357761383057,+-396.39570713043213,+147.7996587753296+],+"forward": [+-0.9953499436378479,+0.049352046102285385,+-0.08272241801023483+],+"up": [+-0.08260218054056168,+0.004474368877708912,+0.9965725541114807+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 587.7852459438145+},+{+"blender_frame": 202,+"matrix_world": [+[+-0.04601438343524933,+-0.08408551663160324,+0.9953954815864563,+2.91252064704895+],+[+0.9989407658576965,+-0.0036018674727529287,+0.045873988419771194,+3.916881561279297+],+[+-0.00027205562219023705,+0.9964520931243896,+0.0841621607542038,+1.4761298894882202+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.252064704895,+-391.6881561279297,+147.61298894882202+],+"forward": [+-0.9953956007957458,+0.04587399214506149,+-0.0841621682047844+],+"up": [+-0.08408551663160324,+0.0036018674727529287,+0.9964520931243896+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 588.3226657286286+},+{+"blender_frame": 203,+"matrix_world": [+[+-0.04255663976073265,+-0.08515575528144836,+0.9954583644866943,+2.9135489463806152+],+[+0.9990938305854797,+-0.0029649725183844566,+0.0424584224820137,+3.8704628944396973+],+[+-0.0006640720530413091,+0.9963631629943848,+0.08520476520061493,+1.4748479127883911+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.3548946380615,+-387.0462894439697,+147.4847912788391+],+"forward": [+-0.9954584836959839,+0.042458426207304,+-0.08520477265119553+],+"up": [+-0.08515576273202896,+0.002964972984045744,+0.9963632822036743+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 588.80779678002+},+{+"blender_frame": 204,+"matrix_world": [+[+-0.03918306156992912,+-0.0857049971818924,+0.995549738407135,+2.9140737056732178+],+[+0.99923175573349,+-0.002582796150818467,+0.039105627685785294,+3.8247504234313965+],+[+-0.0007802456966601312,+0.9963172078132629,+0.0857403501868248,+1.4744231700897217+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.4073705673218,+-382.47504234313965,+147.44231700897217+],+"forward": [+-0.9955498576164246,+0.03910563141107559,+-0.0857403576374054+],+"up": [+-0.0857049971818924,+0.002582796150818467,+0.9963172078132629+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 589.2388674430549+},+{+"blender_frame": 205,+"matrix_world": [+[+-0.03589554876089096,+-0.08572016656398773,+0.9956725239753723,+2.914067268371582+],+[+0.9993553757667542,+-0.0024633770808577538,+0.0358162485063076,+3.779780626296997+],+[+-0.0006174579029902816,+0.9963161945343018,+0.08575333654880524,+1.4749071598052979+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.4067268371582,+-377.9780626296997,+147.49071598052979+],+"forward": [+-0.9956724047660828,+0.0358162447810173,+-0.08575332909822464+],+"up": [+-0.08572016656398773,+0.0024633770808577538,+0.9963161945343018+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 589.613170363009+},+{+"blender_frame": 206,+"matrix_world": [+[+-0.03269496560096741,+-0.08528754860162735,+0.9958196878433228,+2.9135212898254395+],+[+0.9994653463363647,+-0.0026020673103630543,+0.032591793686151505,+3.735579252243042+],+[+-0.00018848449690267444,+0.996353030204773,+0.08532702922821045,+1.4761195182800293+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.35212898254395,+-373.5579252243042,+147.61195182800293+],+"forward": [+-0.9958198070526123,+0.0325917974114418,+-0.08532703667879105+],+"up": [+-0.08528754860162735,+0.0026020673103630543,+0.996353030204773+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 589.927167352289+},+{+"blender_frame": 207,+"matrix_world": [+[+-0.029580749571323395,+-0.0845755934715271,+0.9959778189659119,+2.9124436378479004+],+[+0.9995622634887695,+-0.002980100689455867,+0.029434140771627426,+3.6921603679656982+],+[+0.0004787046345882118,+0.9964125752449036,+0.08462671935558319,+1.4776875972747803+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.24436378479004,+-369.2160367965698,+147.76875972747803+],+"forward": [+-0.9959779381752014,+0.029434144496917725,+-0.08462672680616379+],+"up": [+-0.0845756009221077,+0.002980101155117154,+0.9964126944541931+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 590.17682261765+},+{+"blender_frame": 208,+"matrix_world": [+[+-0.02655068412423134,+-0.08380015194416046,+0.9961287379264832,+2.910851001739502+],+[+0.9996466040611267,+-0.0035639614798128605,+0.026344619691371918,+3.6495249271392822+],+[+0.0013424813514575362,+0.9964761734008789,+0.08386516571044922,+1.479129672050476+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+291.0851001739502,+-364.9524927139282,+147.9129672050476+],+"forward": [+-0.9961288571357727,+0.026344623416662216,+-0.08386517316102982+],+"up": [+-0.08380015939474106,+0.003563961945474148,+0.9964762926101685+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 590.358168957755+},+{+"blender_frame": 209,+"matrix_world": [+[+-0.02360142581164837,+-0.08317933231592178,+0.9962549805641174,+2.9087626934051514+],+[+0.9997187256813049,+-0.004306050017476082,+0.02332395315170288,+3.6076643466949463+],+[+0.0023498532827943563,+0.9965253472328186,+0.08325754851102829,+1.4799599647521973+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.87626934051514,+-360.76643466949463,+147.99599647521973+],+"forward": [+-0.996255099773407,+0.02332395501434803,+-0.08325755596160889+],+"up": [+-0.08317933231592178,+0.004306050017476082,+0.9965253472328186+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 590.4684888198972+},+{+"blender_frame": 210,+"matrix_world": [+[+-0.020728806033730507,+-0.0828876718878746,+0.9963432550430298,+2.906189203262329+],+[+0.9997791647911072,+-0.0051468051970005035,+0.020372120663523674,+3.5665621757507324+],+[+0.0034393873065710068,+0.996545672416687,+0.08297604322433472,+1.4797985553741455+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.6189203262329,+-356.65621757507324,+147.97985553741455+],+"forward": [+-0.9963433742523193,+0.020372122526168823,+-0.08297605067491531+],+"up": [+-0.0828876718878746,+0.0051468051970005035,+0.996545672416687+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 590.5056277755648+},+{+"blender_frame": 211,+"matrix_world": [+[+-0.017927438020706177,+-0.08301988989114761,+0.9963865876197815,+2.9031260013580322+],+[+0.9998289942741394,+-0.006018191576004028,+0.017487933859229088,+3.5261948108673096+],+[+0.004544598516076803,+0.9965296387672424,+0.08311358839273453,+1.4784551858901978+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+290.3126001358032,+-352.61948108673096,+147.84551858901978+],+"forward": [+-0.996386706829071,+0.017487935721874237,+-0.08311359584331512+],+"up": [+-0.08301989734172821,+0.006018192507326603,+0.996529757976532+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 590.4675352037884+},+{+"blender_frame": 212,+"matrix_world": [+[+-0.015191391110420227,+-0.08357183635234833,+0.9963859915733337,+2.8995492458343506+],+[+0.9998690485954285,+-0.006848383694887161,+0.014670086093246937,+3.4865353107452393+],+[+0.005597625859081745,+0.9964781999588013,+0.0836649164557457,+1.475974440574646+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.95492458343506,+-348.6535310745239,+147.5974440574646+],+"forward": [+-0.9963859915733337,+0.014670086093246937,+-0.0836649164557457+],+"up": [+-0.08357184380292892,+0.006848384626209736,+0.9964783191680908+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 590.3515850077383+},+{+"blender_frame": 213,+"matrix_world": [+[+-0.012514324858784676,+-0.08444257080554962,+0.9963498115539551,+2.895415782928467+],+[+0.9999003410339355,+-0.007566953077912331,+0.011917607858777046,+3.447556734085083+],+[+0.0065329778008162975,+0.9963995814323425,+0.084528848528862,+1.4726300239562988+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.5415782928467,+-344.7556734085083,+147.26300239562988+],+"forward": [+-0.9963498115539551,+0.011917607858777046,+-0.084528848528862+],+"up": [+-0.08444257825613022,+0.007566954009234905,+0.9963997006416321+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 590.1546546607278+},+{+"blender_frame": 214,+"matrix_world": [+[+-0.009889781475067139,+-0.08545763790607452,+0.9962926506996155,+2.890667200088501+],+[+0.9999246001243591,+-0.008110014721751213,+0.00923018716275692,+3.4092342853546143+],+[+0.0072911581955850124,+0.9963088631629944,+0.08553138375282288,+1.4688671827316284+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+289.0667200088501,+-340.9234285354614,+146.88671827316284+],+"forward": [+-0.996292769908905,+0.009230188094079494,+-0.08553139120340347+],+"up": [+-0.08545763790607452,+0.008110014721751213,+0.9963088631629944+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 589.8740923963487+},+{+"blender_frame": 215,+"matrix_world": [+[+-0.007311454974114895,+-0.08640781790018082,+0.9962329268455505,+2.885240316390991+],+[+0.9999427795410156,+-0.008424671366810799,+0.006607966963201761,+3.371549129486084+],+[+0.007821954786777496,+0.9962241649627686,+0.08646444976329803,+1.465211272239685+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+288.5240316390991,+-337.1549129486084,+146.5211272239685+],+"forward": [+-0.9962330460548401,+0.006607967894524336,+-0.08646445721387863+],+"up": [+-0.08640782535076141,+0.008424672298133373,+0.9962242841720581+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 589.5079451409401+},+{+"blender_frame": 216,+"matrix_world": [+[+-0.0047733839601278305,+-0.0870952382683754,+0.9961886405944824,+2.8790740966796875+],+[+0.9999558925628662,+-0.008472318761050701,+0.004050714895129204,+3.334489345550537+],+[+0.008087228052318096,+0.9961638450622559,+0.08713185787200928,+1.4621566534042358+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.90740966796875,+-333.4489345550537,+146.21566534042358+],+"forward": [+-0.9961886405944824,+0.004050714895129204,+-0.08713185787200928+],+"up": [+-0.087095245718956,+0.008472319692373276,+0.9961639642715454+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 589.0553555283986+},+{+"blender_frame": 217,+"matrix_world": [+[+-0.0022700137924402952,+-0.08737664669752121,+0.9961727261543274,+2.8721187114715576+],+[+0.9999650120735168,+-0.008230547420680523,+0.0015567336231470108,+3.2980527877807617+],+[+0.008063023909926414,+0.9961413741111755,+0.08739226311445236,+1.4600627422332764+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+287.21187114715576,+-329.8052787780762,+146.00627422332764+],+"forward": [+-0.9961728453636169,+0.0015567338559776545,+-0.08739227056503296+],+"up": [+-0.08737664669752121,+0.008230547420680523,+0.9961413741111755+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 588.5157912993236+},+{+"blender_frame": 218,+"matrix_world": [+[+0.0004800967872142792,+-0.08720207959413528,+0.9961904883384705,+2.8639400005340576+],+[+0.999970018863678,+-0.007669579703360796,+-0.0011532794451341033,+3.260594606399536+],+[+0.007740930188447237,+0.9961610436439514,+0.08719578385353088,+1.459081768989563+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+286.39400005340576,+-326.0594606399536,+145.9081768989563+],+"forward": [+-0.99619060754776,+-0.0011532795615494251,+-0.08719579130411148+],+"up": [+-0.08720208704471588,+0.007669580634683371,+0.996161162853241+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 587.8481114681563+},+{+"blender_frame": 219,+"matrix_world": [+[+0.0034583210945129395,+-0.08661632984876633,+0.996235728263855,+2.854412078857422+],+[+0.9999685883522034,+-0.006802246440201998,+-0.0040626912377774715,+3.222151756286621+],+[+0.007128535769879818,+0.9962185621261597,+0.08659007400274277,+1.4591314792633057+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+285.4412078857422,+-322.2151756286621,+145.91314792633057+],+"forward": [+-0.996235728263855,+-0.0040626912377774715,+-0.08659007400274277+],+"up": [+-0.08661632984876633,+0.006802246440201998,+0.9962185621261597+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 587.0395584097423+},+{+"blender_frame": 220,+"matrix_world": [+[+0.0063843196257948875,+-0.08574981987476349,+0.9962962865829468,+2.843899965286255+],+[+0.9999601244926453,+-0.005678694229573011,+-0.006896554958075285,+3.184204578399658+],+[+0.006249039899557829,+0.9963005781173706,+0.08571013808250427,+1.4599113464355469+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+284.3899965286255,+-318.4204578399658,+145.9911346435547+],+"forward": [+-0.9962962865829468,+-0.006896554958075285,+-0.08571013808250427+],+"up": [+-0.08574981987476349,+0.005678694229573011,+0.9963005781173706+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 586.1212551011704+},+{+"blender_frame": 221,+"matrix_world": [+[+0.00921905692666769,+-0.08480356633663177,+0.9963549971580505,+2.8324685096740723+],+[+0.9999443292617798,+-0.004339869599789381,+-0.009621649980545044,+3.146772623062134+],+[+0.005140000954270363,+0.9963882565498352,+0.08475881814956665,+1.460975170135498+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+283.2468509674072,+-314.6772623062134,+146.0975170135498+],+"forward": [+-0.9963551163673401,+-0.009621650911867619,+-0.08475882560014725+],+"up": [+-0.08480356633663177,+0.004339869599789381,+0.9963882565498352+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 585.0914292037487+},+{+"blender_frame": 222,+"matrix_world": [+[+0.011919810436666012,+-0.08399885147809982,+0.9963945150375366,+2.8201887607574463+],+[+0.9999215602874756,+-0.002836621832102537,+-0.012201136909425259,+3.109884023666382+],+[+0.003851275658234954,+0.996461808681488,+0.08395843952894211,+1.4618332386016846+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+282.01887607574463,+-310.9884023666382,+146.18332386016846+],+"forward": [+-0.9963946342468262,+-0.012201138772070408,+-0.0839584469795227+],+"up": [+-0.08399885147809982,+0.002836621832102537,+0.996461808681488+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 583.9482796494849+},+{+"blender_frame": 223,+"matrix_world": [+[+0.01444393489509821,+-0.08352938294410706,+0.9964006543159485,+2.80712628364563+],+[+0.9998927116394043,+-0.001227380009368062,+-0.014597450383007526,+3.0735714435577393+],+[+0.0024422784335911274,+0.996504545211792,+0.08350269496440887,+1.4620600938796997+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+280.712628364563,+-307.3571443557739,+146.20600938796997+],+"forward": [+-0.9964006543159485,+-0.014597450383007526,+-0.08350269496440887+],+"up": [+-0.08352938294410706,+0.001227380009368062,+0.996504545211792+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 582.6901430729777+},+{+"blender_frame": 224,+"matrix_world": [+[+0.016752243041992188,+-0.08352018892765045,+0.9963652491569519,+2.793334484100342+],+[+0.9998593330383301,+0.0004239031986799091,+-0.016775453463196754,+3.037870168685913+],+[+0.0009787266608327627,+0.9965059757232666,+0.08351553231477737,+1.4613925218582153+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+279.3334484100342,+-303.7870168685913,+146.13925218582153+],+"forward": [+-0.9963653683662415,+-0.016775455325841904,+-0.08351553976535797+],+"up": [+-0.08352018892765045,+-0.0004239031986799091,+0.9965059757232666+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 581.3156625721604+},+{+"blender_frame": 225,+"matrix_world": [+[+0.01881071925163269,+-0.08400137722492218,+0.996288001537323,+2.778850555419922+],+[+0.9998230338096619,+0.0020497802179306746,+-0.01870463415980339,+3.002817153930664+],+[+-0.0004709567001555115,+0.996463418006897,+0.0840250700712204,+1.4597876071929932+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+277.8850555419922,+-300.2817153930664,+145.97876071929932+],+"forward": [+-0.9962881207466125,+-0.01870463602244854,+-0.084025077521801+],+"up": [+-0.08400138467550278,+-0.002049780450761318,+0.9964635372161865+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 579.823577683419+},+{+"blender_frame": 226,+"matrix_world": [+[+0.020592115819454193,+-0.0849030390381813,+0.9961763620376587,+2.7636938095092773+],+[+0.9997863173484802,+0.003581841243430972,+-0.020361455157399178,+2.968446731567383+],+[+-0.0018393961945548654,+0.9963828325271606,+0.08495865017175674,+1.457435131072998+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+276.36938095092773,+-296.8446731567383,+145.7435131072998+],+"forward": [+-0.9961764812469482,+-0.020361457020044327,+-0.08495865762233734+],+"up": [+-0.0849030390381813,+-0.003581841243430972,+0.9963828325271606+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 578.2130444189534+},+{+"blender_frame": 227,+"matrix_world": [+[+0.022076742723584175,+-0.08607100695371628,+0.996044397354126,+2.7478690147399902+],+[+0.999751627445221,+0.004953938070684671,+-0.021730827167630196,+2.934788942337036+],+[+-0.003063947893679142,+0.9962766766548157,+0.08615899085998535,+1.4547163248062134+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+274.786901473999,+-293.4788942337036,+145.47163248062134+],+"forward": [+-0.996044397354126,+-0.021730827167630196,+-0.08615899085998535+],+"up": [+-0.08607100695371628,+-0.004953938070684671,+0.9962766766548157+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 576.4842867385596+},+{+"blender_frame": 228,+"matrix_world": [+[+0.02325260639190674,+-0.08730128407478333,+0.9959105849266052,+2.731372594833374+],+[+0.9997212886810303,+0.006106115877628326,+-0.022806316614151,+2.901867628097534+],+[+-0.004090124275535345,+0.9961633086204529,+0.08741892874240875,+1.4521228075027466+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+273.1372594833374,+-290.1867628097534,+145.21228075027466+],+"forward": [+-0.9959105849266052,+-0.022806316614151,+-0.08741892874240875+],+"up": [+-0.08730128407478333,+-0.006106115877628326,+0.9961633086204529+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 574.6392094762996+},+{+"blender_frame": 229,+"matrix_world": [+[+0.02411496825516224,+-0.08838454633951187,+0.9957945346832275,+2.7142012119293213+],+[+0.9996972680091858,+0.006988869979977608,+-0.02358916588127613,+2.869697332382202+],+[+-0.0048745605163276196,+0.9960619211196899,+0.08852633833885193,+1.4501487016677856+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+271.42012119293213,+-286.9697332382202,+145.01487016677856+],+"forward": [+-0.9957945346832275,+-0.02358916588127613,+-0.08852633833885193+],+"up": [+-0.08838454633951187,+-0.006988869979977608,+0.9960619211196899+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 572.681919997558+},+{+"blender_frame": 230,+"matrix_world": [+[+0.024666694924235344,+-0.08915137499570847,+0.9957125782966614,+2.696359157562256+],+[+0.9996812343597412,+0.007567241787910461,+-0.024087470024824142,+2.8382813930511475+],+[+-0.0053873672150075436,+0.9959893226623535,+0.08930960297584534,+1.4491832256317139+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+269.6359157562256,+-283.82813930511475,+144.9183225631714+],+"forward": [+-0.9957126975059509,+-0.02408747375011444,+-0.08930961042642593+],+"up": [+-0.08915138244628906,+-0.007567242719233036,+0.9959894418716431+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 570.6173232756555+},+{+"blender_frame": 231,+"matrix_world": [+[+0.02491666004061699,+-0.08950818330049515,+0.9956744909286499,+2.6778647899627686+],+[+0.9996737241744995,+0.007823825813829899,+-0.024313412606716156,+2.8076112270355225+],+[+-0.0056137340143322945,+0.9959554076194763,+0.08967392891645432,+1.4494248628616333+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+267.78647899627686,+-280.76112270355225,+144.94248628616333+],+"forward": [+-0.9956743717193604,+-0.024313408881425858,+-0.08967392146587372+],+"up": [+-0.08950818330049515,+-0.007823825813829899,+0.9959554076194763+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 568.4504809323698+},+{+"blender_frame": 232,+"matrix_world": [+[+0.024879850447177887,+-0.08945617079734802,+0.995680034160614,+2.658755302429199+],+[+0.9996750354766846,+0.007760435342788696,+-0.02428244799375534,+2.777665376663208+],+[+-0.00555469561368227,+0.9959605932235718,+0.08962017297744751,+1.4508370161056519+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+265.8755302429199,+-277.7665376663208,+145.08370161056519+],+"forward": [+-0.995680034160614,+-0.02428244799375534,+-0.08962017297744751+],+"up": [+-0.08945617079734802,+-0.007760435342788696,+0.9959605932235718+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 566.1858419887722+},+{+"blender_frame": 233,+"matrix_world": [+[+0.02457575500011444,+-0.0890892744064331,+0.995720386505127,+2.639084815979004+],+[+0.9996842741966248,+0.007397867739200592,+-0.024011682718992233,+2.7484099864959717+],+[+-0.005227024666965008,+0.9959961771965027,+0.08924295753240585,+1.4531537294387817+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+263.9084815979004,+-274.84099864959717,+145.31537294387817+],+"forward": [+-0.9957205057144165,+-0.024011686444282532,+-0.08924296498298645+],+"up": [+-0.0890892744064331,+-0.007397867739200592,+0.9959961771965027+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 563.8265324290842+},+{+"blender_frame": 234,+"matrix_world": [+[+0.0240283515304327,+-0.0885714665055275,+0.9957799911499023,+2.618922472000122+],+[+0.9997004866600037,+0.006774080451577902,+-0.023520413786172867,+2.719799757003784+],+[+-0.004662256222218275,+0.9960468411445618,+0.08870770782232285,+1.4559365510940552+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+261.8922472000122,+-271.9799757003784,+145.59365510940552+],+"forward": [+-0.9957799911499023,+-0.023520413786172867,+-0.08870770782232285+],+"up": [+-0.0885714665055275,+-0.006774080451577902,+0.9960468411445618+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 561.3756055478007+},+{+"blender_frame": 235,+"matrix_world": [+[+0.023264553397893906,+-0.08809865266084671,+0.9958400726318359,+2.5983428955078125+],+[+0.9997217059135437,+0.005940865725278854,+-0.02282966673374176,+2.691779613494873+],+[+-0.003904889104887843,+0.9960939884185791,+0.08821234852075577,+1.4586669206619263+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+259.83428955078125,+-269.1779613494873,+145.86669206619263+],+"forward": [+-0.9958400726318359,+-0.02282966673374176,+-0.08821234852075577+],+"up": [+-0.08809866011142731,+-0.005940866656601429,+0.9960941076278687+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 558.8368619326502+},+{+"blender_frame": 236,+"matrix_world": [+[+0.02231382206082344,+-0.0878530815243721,+0.9958834648132324,+2.5774195194244385+],+[+0.9997465014457703,+0.004959794692695141,+-0.021962836384773254,+2.664287805557251+],+[+-0.0030098743736743927,+0.9961211085319519,+0.087941475212574,+1.4608561992645264+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+257.74195194244385,+-266.4287805557251,+146.08561992645264+],+"forward": [+-0.995883584022522,+-0.021962838247418404,+-0.0879414826631546+],+"up": [+-0.0878530815243721,+-0.004959794692695141,+0.9961211085319519+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 556.2152857426554+},+{+"blender_frame": 237,+"matrix_world": [+[+0.021207034587860107,+-0.08796130865812302,+0.9958980679512024,+2.55621600151062+],+[+0.9997730255126953,+0.003897896269336343,+-0.020945269614458084,+2.637258529663086+],+[+-0.0020395340397953987,+0.9961162209510803,+0.08802400529384613,+1.4621502161026+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+255.621600151062,+-263.7258529663086,+146.21502161026+],+"forward": [+-0.9958981871604919,+-0.020945271477103233,+-0.08802401274442673+],+"up": [+-0.08796131610870361,+-0.00389789673499763,+0.9961163401603699+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 553.5168466623873+},+{+"blender_frame": 238,+"matrix_world": [+[+0.01997605711221695,+-0.08846334367990494,+0.995879054069519,+2.5347800254821777+],+[+0.999799907207489,+0.0028236135840415955,+-0.01980387605726719,+2.6106250286102295+],+[+-0.0010600604582577944,+0.9960753917694092,+0.08850203454494476,+1.4624031782150269+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+253.47800254821777,+-261.06250286102295,+146.24031782150269+],+"forward": [+-0.9958791732788086,+-0.019803877919912338,+-0.08850204199552536+],+"up": [+-0.08846335113048553,+-0.002823613816872239,+0.9960755109786987+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 550.7479498395696+},+{+"blender_frame": 239,+"matrix_world": [+[+0.01864592172205448,+-0.08930160105228424,+0.9958300590515137,+2.5131375789642334+],+[+0.999826192855835,+0.0018032732186838984,+-0.018559034913778305,+2.584322452545166+],+[+-0.00013840221799910069,+0.9960029721260071,+0.08931969106197357,+1.4617054462432861+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+251.31375789642334,+-258.4322452545166,+146.1705446243286+],+"forward": [+-0.9958300590515137,+-0.018559034913778305,+-0.08931969106197357+],+"up": [+-0.08930160850286484,+-0.001803273451514542,+0.9960030913352966+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 547.9150375816971+},+{+"blender_frame": 240,+"matrix_world": [+[+0.017214642837643623,+-0.09033103287220001,+0.9957630634307861,+2.4912989139556885+],+[+0.9998515844345093,+0.0008981230785138905,+-0.01720385253429413,+2.55829119682312+],+[+0.0006597237661480904,+0.9959114193916321,+0.09033310413360596,+1.4603614807128906+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+249.12989139556885,+-255.829119682312,+146.03614807128906+],+"forward": [+-0.9957630634307861,+-0.01720385253429413,+-0.09033310413360596+],+"up": [+-0.09033103287220001,+-0.0008981230785138905,+0.9959114193916321+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 545.0245943153277+},+{+"blender_frame": 241,+"matrix_world": [+[+0.01571011357009411,+-0.09134846180677414,+0.9956950545310974,+2.469259738922119+],+[+0.9998757839202881,+0.0001621801347937435,+-0.015761196613311768,+2.5324790477752686+],+[+0.0012782788835465908,+0.9958189725875854,+0.09133967012166977,+1.45881986618042+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+246.9259738922119,+-253.24790477752686,+145.881986618042+],+"forward": [+-0.9956950545310974,+-0.015761196613311768,+-0.09133967012166977+],+"up": [+-0.09134846180677414,+-0.0001621801347937435,+0.9958189725875854+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 542.0829441165552+},+{+"blender_frame": 242,+"matrix_world": [+[+0.01416361890733242,+-0.09213551133871078,+0.9956457018852234,+2.4470109939575195+],+[+0.9998983144760132,+-0.00035977386869490147,+-0.014257404953241348,+2.506843328475952+],+[+0.0016718205297365785,+0.995746374130249,+0.09212104231119156,+1.457573652267456+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+244.70109939575195,+-250.68433284759521,+145.7573652267456+],+"forward": [+-0.9956458210945129,+-0.014257406815886497,+-0.09212104976177216+],+"up": [+-0.09213551878929138,+0.0003597738977987319,+0.9957464933395386+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 539.0973711851984+},+{+"blender_frame": 243,+"matrix_world": [+[+0.012604308314621449,+-0.09250428527593613,+0.995632529258728,+2.424548625946045+],+[+0.999919056892395,+-0.0006340011605061591,+-0.012717477045953274,+2.4813525676727295+],+[+0.0018076531123369932,+0.9957120418548584,+0.09248879551887512,+1.457047700881958+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+242.4548625946045,+-248.13525676727295,+145.7047700881958+],+"forward": [+-0.995632529258728,+-0.012717477045953274,+-0.09248879551887512+],+"up": [+-0.09250429272651672,+0.00063400121871382,+0.995712161064148+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 536.0742776188999+},+{+"blender_frame": 244,+"matrix_world": [+[+0.011059090495109558,+-0.09233763068914413,+0.9956663250923157,+2.401881456375122+],+[+0.9999375939369202,+-0.0006394166266545653,+-0.011165826581418514,+2.4559884071350098+],+[+0.001667671138420701,+0.9957275390625,+0.09232478588819504,+1.457506775856018+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+240.1881456375122,+-245.59884071350098,+145.7506775856018+],+"forward": [+-0.9956663250923157,+-0.011165826581418514,+-0.09232478588819504+],+"up": [+-0.09233763813972473,+0.0006394166848622262,+0.9957276582717896+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 533.0195200396702+},+{+"blender_frame": 245,+"matrix_world": [+[+0.00955210067331791,+-0.09161396324634552,+0.99574875831604,+2.379038095474243+],+[+0.9999536871910095,+-0.0003690622397698462,+-0.009626386687159538,+2.4307444095611572+],+[+0.0012494046241044998,+0.9957944750785828,+0.09160618484020233,+1.4589933156967163+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+237.90380954742432,+-243.07444095611572,+145.89933156967163+],+"forward": [+-0.9957488775253296,+-0.009626387618482113,+-0.09160619229078293+],+"up": [+-0.09161397069692612,+0.0003690622979775071,+0.9957945942878723+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 529.9377627670765+},+{+"blender_frame": 246,+"matrix_world": [+[+0.008104929700493813,+-0.09041158854961395,+0.9958715438842773,+2.3560662269592285+],+[+0.9999670386314392,+0.00016891756968107074,+-0.008122924715280533,+2.4056291580200195+],+[+0.0005661861505359411,+0.9959043860435486,+0.09040997922420502,+1.4613169431686401+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+235.60662269592285,+-240.56291580200195,+146.131694316864+],+"forward": [+-0.9958715438842773,+-0.008122924715280533,+-0.09040997922420502+],+"up": [+-0.09041159600019455,+-0.00016891758423298597,+0.9959045052528381+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 526.8319927854463+},+{+"blender_frame": 247,+"matrix_world": [+[+0.006736567243933678,+-0.08889204263687134,+0.9960184693336487,+2.3330326080322266+],+[+0.9999772310256958,+0.000950994435697794,+-0.006678466685116291,+2.3806631565093994+],+[+-0.0003535453579388559,+0.9960408210754395,+0.08889641612768173,+1.4640954732894897+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+233.30326080322266,+-238.06631565093994,+146.40954732894897+],+"forward": [+-0.9960185885429382,+-0.006678467616438866,+-0.08889642357826233+],+"up": [+-0.08889204263687134,+-0.000950994435697794,+0.9960408210754395+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 523.7053642631508+},+{+"blender_frame": 248,+"matrix_world": [+[+0.005463210865855217,+-0.08726509660482407,+0.996170163154602,+2.31001353263855+],+[+0.9999839663505554,+0.00193896540440619,+-0.00531427189707756,+2.355879783630371+],+[+-0.0014677890576422215,+0.9961832165718079,+0.08727429807186127,+1.4668357372283936+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+231.00135326385498,+-235.5879783630371,+146.68357372283936+],+"forward": [+-0.996170163154602,+-0.00531427189707756,+-0.08727429807186127+],+"up": [+-0.08726510405540466,+-0.0019389656372368336,+0.9961833357810974+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 520.5616905295756+},+{+"blender_frame": 249,+"matrix_world": [+[+0.004299280233681202,+-0.08574387431144714,+0.9963078498840332,+2.287083864212036+],+[+0.9999870657920837,+0.0030819030944257975,+-0.004049921408295631,+2.3313207626342773+],+[+-0.0027232684660702944,+0.9963124990463257,+0.08575599640607834,+1.4690412282943726+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+228.7083864212036,+-233.13207626342773,+146.90412282943726+],+"forward": [+-0.9963079690933228,+-0.004049921873956919,+-0.08575600385665894+],+"up": [+-0.08574387431144714,+-0.0030819030944257975,+0.9963124990463257+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 517.4062233476434+},+{+"blender_frame": 250,+"matrix_world": [+[+0.00325712189078331,+-0.08449921011924744,+0.9964182376861572,+2.264310359954834+],+[+0.999986469745636,+0.0043190838769078255,+-0.0029025133699178696,+2.307037830352783+],+[+-0.0040583536028862,+0.9964142441749573,+0.0845121294260025,+1.470320463180542+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+226.4310359954834,+-230.70378303527832,+147.0320463180542+],+"forward": [+-0.9964182376861572,+-0.0029025133699178696,+-0.0845121294260025+],+"up": [+-0.08449921011924744,+-0.0043190838769078255,+0.9964142441749573+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 514.2449520644732+},+{+"blender_frame": 251,+"matrix_world": [+[+0.0023475661873817444,+-0.08362334966659546,+0.9964946508407593,+2.2417397499084473+],+[+0.9999826550483704,+0.005583827383816242,+-0.0018872013315558434,+2.283087730407715+],+[+-0.005406439304351807,+0.9964817762374878,+0.08363499492406845,+1.4704713821411133+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+224.17397499084473,+-228.30877304077148,+147.04713821411133+],+"forward": [+-0.9964947700500488,+-0.001887201564386487,+-0.08363500237464905+],+"up": [+-0.08362334966659546,+-0.005583827383816242,+0.9964817762374878+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 511.0839991248213+},+{+"blender_frame": 252,+"matrix_world": [+[+0.0015802793204784393,+-0.08311067521572113,+0.9965390563011169,+2.2193961143493652+],+[+0.9999763369560242,+0.006807774771004915,+-0.001017967239022255,+2.2595293521881104+],+[+-0.006699608638882637,+0.9965170621871948,+0.0831194669008255,+1.4695262908935547+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+221.93961143493652,+-225.95293521881104,+146.95262908935547+],+"forward": [+-0.9965391755104065,+-0.0010179673554375768,+-0.0831194743514061+],+"up": [+-0.08311067521572113,+-0.006807774771004915,+0.9965170621871948+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 507.9283605955425+},+{+"blender_frame": 253,+"matrix_world": [+[+0.0009649349376559258,+-0.08286035060882568,+0.9965606331825256,+2.197279214859009+],+[+0.9999685287475586,+0.007925249636173248,+-0.00030927732586860657,+2.236419200897217+],+[+-0.007872365415096283,+0.9965296983718872,+0.0828653872013092,+1.4677464962005615+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+219.72792148590088,+-223.64192008972168,+146.77464962005615+],+"forward": [+-0.9965607523918152,+-0.000309277354972437,+-0.0828653946518898+],+"up": [+-0.08286035060882568,+-0.007925249636173248,+0.9965296983718872+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 504.7814817402468+},+{+"blender_frame": 254,+"matrix_world": [+[+0.000510592944920063,+-0.08269887417554855,+0.9965744614601135,+2.175372838973999+],+[+0.9999606013298035,+0.008877098560333252,+0.000224321149289608,+2.2138125896453857+],+[+-0.008865240029990673,+0.9965350031852722,+0.08270014077425003,+1.4655653238296509+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+217.5372838973999,+-221.38125896453857,+146.5565323829651+],+"forward": [+-0.9965744614601135,+0.000224321149289608,+-0.08270014077425003+],+"up": [+-0.08269888162612915,+-0.008877099491655827,+0.9965351223945618+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 501.64621164913115+},+{+"blender_frame": 255,+"matrix_world": [+[+0.0002272985875606537,+-0.0824190005660057,+0.9965977072715759,+2.1536507606506348+],+[+0.9999537467956543,+0.009614042937755585,+0.0005670255050063133,+2.191755533218384+],+[+-0.00962806772440672,+0.9965514540672302,+0.08241735398769379,+1.4634958505630493+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+215.36507606506348,+-219.17555332183838,+146.34958505630493+],+"forward": [+-0.9965978264808655,+0.0005670255632139742,+-0.08241736143827438+],+"up": [+-0.0824190005660057,+-0.009614042937755585,+0.9965514540672302+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 498.5248416316608+},+{+"blender_frame": 256,+"matrix_world": [+[+0.00012562330812215805,+-0.08182579278945923,+0.9966466426849365,+2.132089138031006+],+[+0.9999486804008484,+0.010099079459905624,+0.0007031038403511047,+2.1702842712402344+],+[+-0.010122746229171753,+0.996595561504364,+0.08182285726070404,+1.462020993232727+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+213.2089138031006,+-217.02842712402344,+146.2020993232727+],+"forward": [+-0.9966466426849365,+0.0007031038403511047,+-0.08182285726070404+],+"up": [+-0.08182579278945923,+-0.010099079459905624,+0.996595561504364+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 495.41982060873124+},+{+"blender_frame": 257,+"matrix_world": [+[+0.00021747872233390808,+-0.08077938109636307,+0.9967319965362549,+2.110675573348999+],+[+0.9999467134475708,+0.010309169068932533,+0.000617319718003273,+2.149426221847534+],+[+-0.01032534521073103,+0.9966787099838257,+0.08077730983495712,+1.4614893198013306+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+211.0675573348999,+-214.94262218475342,+146.14893198013306+],+"forward": [+-0.9967319965362549,+0.000617319718003273,+-0.08077730983495712+],+"up": [+-0.08077938109636307,+-0.010309169068932533,+0.9966787099838257+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 492.33358735364163+},+{+"blender_frame": 258,+"matrix_world": [+[+0.0005161985754966736,+-0.07922616600990295,+0.9968565106391907,+2.0894174575805664+],+[+0.9999474883079529,+0.01023617759346962,+0.00029573123902082443,+2.1291935443878174+],+[+-0.010227429680526257,+0.9968041181564331,+0.07922728359699249,+1.4620420932769775+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+208.94174575805664,+-212.91935443878174,+146.20420932769775+],+"forward": [+-0.9968566298484802,+0.0002957312681246549,+-0.07922729104757309+],+"up": [+-0.07922616600990295,+-0.01023617759346962,+0.9968041181564331+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 489.2689246507871+},+{+"blender_frame": 259,+"matrix_world": [+[+0.00103661697357893,+-0.07721012830734253,+0.9970142841339111,+2.068342924118042+],+[+0.999951183795929,+0.009887208230793476,+-0.00027398858219385147,+2.1095871925354004+],+[+-0.009836532175540924,+0.996965765953064,+0.07721660286188126,+1.4635834693908691+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+206.8342924118042,+-210.95871925354004,+146.3583469390869+],+"forward": [+-0.9970142841339111,+-0.00027398858219385147,+-0.07721660286188126+],+"up": [+-0.07721013575792313,+-0.00988720916211605,+0.9969658851623535+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 486.22837632028677+},+{+"blender_frame": 260,+"matrix_world": [+[+0.0017949789762496948,+-0.07486339658498764,+0.9971922039985657,+2.0474984645843506+],+[+0.9999563097953796,+0.009284387342631817,+-0.0011029364541172981,+2.0905935764312744+],+[+-0.009175747632980347,+0.9971505403518677,+0.07487679272890091,+1.465804100036621+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+204.74984645843506,+-209.05935764312744,+146.5804100036621+],+"forward": [+-0.9971922039985657,+-0.0011029364541172981,+-0.07487679272890091+],+"up": [+-0.07486340403556824,+-0.009284388273954391,+0.9971506595611572+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 483.21535722352564+},+{+"blender_frame": 261,+"matrix_world": [+[+0.00280909426510334,+-0.07237707078456879,+0.9973734021186829,+2.0269410610198975+],+[+0.9999618530273438,+0.008464103564620018,+-0.0022021615877747536,+2.072188138961792+],+[+-0.008282485418021679,+0.9973414540290833,+0.07239808142185211,+1.468250036239624+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+202.69410610198975,+-207.2188138961792,+146.8250036239624+],+"forward": [+-0.9973734021186829,+-0.0022021615877747536,+-0.07239808142185211+],+"up": [+-0.07237707078456879,+-0.008464103564620018,+0.9973414540290833+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 480.2340797148645+},+{+"blender_frame": 262,+"matrix_world": [+[+0.004097766242921352,+-0.06995854526758194,+0.9975415468215942,+2.006730318069458+],+[+0.9999657273292542,+0.007475478108972311,+-0.0035834619775414467,+2.0543346405029297+],+[+-0.00720640504732728,+0.9975218772888184,+0.06998679041862488,+1.4704238176345825+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+200.6730318069458,+-205.43346405029297,+147.04238176345825+],+"forward": [+-0.9975415468215942,+-0.0035834619775414467,+-0.06998679041862488+],+"up": [+-0.06995854526758194,+-0.007475478108972311,+0.9975218772888184+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 477.29000660183374+},+{+"blender_frame": 263,+"matrix_world": [+[+0.005680776201188564,+-0.06778624653816223,+0.9976837038993835,+1.986915946006775+],+[+0.9999657869338989,+0.00637781573459506,+-0.0052604395896196365,+2.0369889736175537+],+[+-0.006006456911563873,+0.9976794123649597,+0.06782016903162003,+1.4718937873840332+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+198.6915946006775,+-203.69889736175537,+147.18937873840332+],+"forward": [+-0.9976837038993835,+-0.0052604395896196365,+-0.06782016903162003+],+"up": [+-0.06778625398874283,+-0.006377816665917635,+0.9976795315742493+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 474.38868452445604+},+{+"blender_frame": 264,+"matrix_world": [+[+0.007578146643936634,+-0.06596871465444565,+0.9977928996086121,+1.9675307273864746+],+[+0.9999600648880005,+0.005238151643425226,+-0.007248285226523876,+2.020099639892578+],+[+-0.004748431034386158,+0.9978079795837402,+0.06600576639175415,+1.4723899364471436+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+196.75307273864746,+-202.0099639892578,+147.23899364471436+],+"forward": [+-0.9977930188179016,+-0.007248286157846451,+-0.06600577384233475+],+"up": [+-0.06596871465444565,+-0.005238151643425226,+0.9978079795837402+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 471.53552749659866+},+{+"blender_frame": 265,+"matrix_world": [+[+0.00980980135500431,+-0.06451766937971115,+0.9978684186935425,+1.9485870599746704+],+[+0.9999457597732544,+0.0041275061666965485,+-0.00956336036324501,+2.0036094188690186+],+[+-0.003501701867207885,+0.9979079961776733,+0.06455466896295547,+1.4718660116195679+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+194.85870599746704,+-200.36094188690186,+147.1866011619568+],+"forward": [+-0.9978684186935425,+-0.00956336036324501,+-0.06455466896295547+],+"up": [+-0.06451767683029175,+-0.004127506632357836,+0.9979081153869629+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 468.73417556635104+},+{+"blender_frame": 266,+"matrix_world": [+[+0.012394803576171398,+-0.0633428692817688,+0.9979149103164673,+1.9300748109817505+],+[+0.9999204277992249,+0.0031157461926341057,+-0.012221945449709892,+1.9874621629714966+],+[+-0.00233507645316422,+0.9979870319366455,+0.06337644159793854,+1.4705114364624023+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+193.00748109817505,+-198.74621629714966,+147.05114364624023+],+"forward": [+-0.9979149103164673,+-0.012221945449709892,+-0.06337644159793854+],+"up": [+-0.0633428692817688,+-0.0031157461926341057,+0.9979870319366455+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 465.9869476337917+},+{+"blender_frame": 267,+"matrix_world": [+[+0.015351055189967155,+-0.06226911023259163,+0.9979413747787476,+1.9119715690612793+],+[+0.9998813271522522,+0.0022660375107079744,+-0.015239502303302288,+1.9716025590896606+],+[+-0.0013124222168698907,+0.9980567693710327,+0.062296509742736816,+1.4687092304229736+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+191.19715690612793,+-197.16025590896606,+146.87092304229736+],+"forward": [+-0.9979413747787476,+-0.015239502303302288,+-0.062296509742736816+],+"up": [+-0.062269117683172226,+-0.002266037743538618,+0.9980568885803223+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 463.2953075109981+},+{+"blender_frame": 268,+"matrix_world": [+[+0.01869511604309082,+-0.061072904616594315,+0.9979581832885742,+1.8942478895187378+],+[+0.9998251795768738,+0.0016295614186674356,+-0.018630364909768105,+1.955981731414795+],+[+-0.000488423858769238,+0.9981319904327393,+0.061092693358659744,+1.4669500589370728+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+189.42478895187378,+-195.5981731414795,+146.69500589370728+],+"forward": [+-0.9979583024978638,+-0.018630366772413254,+-0.06109270080924034+],+"up": [+-0.061072904616594315,+-0.0016295614186674356,+0.9981319904327393+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 460.6613885378465+},+{+"blender_frame": 269,+"matrix_world": [+[+0.022441832348704338,+-0.059529565274715424,+0.9979742169380188,+1.876879334449768+],+[+0.9997482299804688,+0.0012412607902660966,+-0.02240767516195774,+1.9405579566955566+],+[+9.517263970337808e-05,+0.998225748538971,+0.05954241752624512,+1.465719223022461+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+187.6879334449768,+-194.05579566955566,+146.5719223022461+],+"forward": [+-0.9979743361473083,+-0.02240767702460289,+-0.059542424976825714+],+"up": [+-0.05952957272529602,+-0.0012412609066814184,+0.9982258677482605+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 458.0882781650871+},+{+"blender_frame": 270,+"matrix_world": [+[+0.026604190468788147,+-0.057459913194179535,+0.9979933500289917,+1.8598546981811523+],+[+0.999646008014679,+0.001117277075536549,+-0.026583923026919365,+1.9253013134002686+],+[+0.0004124745901208371,+0.9983471035957336,+0.057469308376312256,+1.465385913848877+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+185.98546981811523,+-192.53013134002686,+146.5385913848877+],+"forward": [+-0.9979932308197021,+-0.026583919301629066,+-0.05746930092573166+],+"up": [+-0.05745992064476013,+-0.001117277191951871,+0.9983472228050232+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 455.58074929285794+},+{+"blender_frame": 271,+"matrix_world": [+[+0.031193697825074196,+-0.05476533621549606,+0.9980118870735168,+1.8431810140609741+],+[+0.9995132684707642,+0.001254396396689117,+-0.03117178939282894,+1.9101921319961548+],+[+0.00045523111475631595,+0.9984985589981079,+0.054777808487415314,+1.4661216735839844+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+184.3181014060974,+-191.01921319961548,+146.61216735839844+],+"forward": [+-0.9980118870735168,+-0.03117178939282894,+-0.054777808487415314+],+"up": [+-0.054765328764915466,+-0.0012543962802737951,+0.9984984397888184+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 453.14496220089495+},+{+"blender_frame": 272,+"matrix_world": [+[+0.036220986396074295,+-0.05144184082746506,+0.9980189204216003,+1.8268795013427734+],+[+0.9993438124656677,+0.001630242564715445,+-0.03618503734469414,+1.8952277898788452+],+[+0.00023441185476258397,+0.9986746311187744,+0.051467131823301315,+1.4678616523742676+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+182.68795013427734,+-189.52277898788452,+146.78616523742676+],+"forward": [+-0.9980189204216003,+-0.03618503734469414,+-0.051467131823301315+],+"up": [+-0.051441848278045654,+-0.0016302427975460887,+0.998674750328064+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 450.786935351789+},+{+"blender_frame": 273,+"matrix_world": [+[+0.041696470230817795,+-0.047572679817676544,+0.9979971647262573,+1.81098473072052+],+[+0.9991303086280823,+0.0022086594253778458,+-0.04163853079080582,+1.8804155588150024+],+[+-0.00022337902919389307,+0.9988653659820557,+0.047623395919799805,+1.4703336954116821+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+181.098473072052,+-188.04155588150024,+147.0333695411682+],+"forward": [+-0.9979971647262573,+-0.04163853079080582,+-0.047623395919799805+],+"up": [+-0.047572679817676544,+-0.0022086594253778458,+0.9988653659820557+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 448.5132960602641+},+{+"blender_frame": 274,+"matrix_world": [+[+0.047627486288547516,+-0.04330355301499367,+0.9979261159896851,+1.7955378293991089+],+[+0.9988648295402527,+0.0029451081063598394,+-0.04754449427127838,+1.8657625913619995+],+[+-0.0008801547810435295,+0.9990576505661011,+0.04339466616511345,+1.473126769065857+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.5537829399109,+-186.57625913619995,+147.3126769065857+],+"forward": [+-0.9979261159896851,+-0.04754449427127838,+-0.04339466616511345+],+"up": [+-0.04330355301499367,+-0.0029451081063598394,+0.9990576505661011+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 446.3315745815635+},+{+"blender_frame": 275,+"matrix_world": [+[+0.054020341485738754,+-0.03880304470658302,+0.9977855682373047,+1.780575156211853+],+[+0.9985384941101074,+0.0037854304537177086,+-0.05391387641429901,+1.8512845039367676+],+[+-0.0016850255196914077,+0.9992396831512451,+0.03895081952214241,+1.4757721424102783+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+178.0575156211853,+-185.12845039367676,+147.57721424102783+],+"forward": [+-0.9977856874465942,+-0.05391388386487961,+-0.03895082324743271+],+"up": [+-0.03880304843187332,+-0.003785430919378996,+0.9992398023605347+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 444.2494499962777+},+{+"blender_frame": 276,+"matrix_world": [+[+0.061207935214042664,+-0.03421904146671295,+0.9975382685661316,+1.7661235332489014+],+[+0.9981217980384827,+0.004666951019316912,+-0.06108364462852478,+1.8370064496994019+],+[+-0.002565238857641816,+0.9994035363197327,+0.03444041684269905,+1.4778493642807007+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+176.61235332489014,+-183.70064496994019,+147.78493642807007+],+"forward": [+-0.9975383877754211,+-0.06108365207910538,+-0.03444042056798935+],+"up": [+-0.03421904146671295,+-0.004666951019316912,+0.9994035363197327+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 442.27547412738204+},+{+"blender_frame": 277,+"matrix_world": [+[+0.06951576471328735,+-0.029644671827554703,+0.9971403479576111,+1.752194881439209+],+[+0.9975748658180237,+0.005524691194295883,+-0.06938181072473526,+1.8229572772979736+],+[+-0.003452091244980693,+0.9995453357696533,+0.029956834390759468,+1.479074478149414+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+175.2194881439209,+-182.29572772979736,+147.9074478149414+],+"forward": [+-0.9971403479576111,+-0.06938181072473526,+-0.029956834390759468+],+"up": [+-0.029644668102264404,+-0.005524690728634596,+0.9995452165603638+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 440.41765071451664+},+{+"blender_frame": 278,+"matrix_world": [+[+0.07874135673046112,+-0.025099288672208786,+0.9965789914131165,+1.738790512084961+],+[+0.9968858361244202,+0.006295498926192522,+-0.07860702276229858,+1.8091645240783691+],+[+-0.004300981294363737,+0.9996650815010071,+0.02551683597266674,+1.4793481826782227+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+173.8790512084961,+-180.9164524078369,+147.93481826782227+],+"forward": [+-0.996579110622406,+-0.07860703021287918,+-0.02551683969795704+],+"up": [+-0.025099292397499084,+-0.006295499857515097,+0.9996652007102966+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 438.68334915023297+},+{+"blender_frame": 279,+"matrix_world": [+[+0.08867991715669632,+-0.02052825689315796,+0.9958486557006836,+1.725905418395996+],+[+0.9960473775863647,+0.006916379556059837,+-0.08855503052473068,+1.7956531047821045+],+[+-0.005069785751402378,+0.9997652173042297,+0.021060461178421974,+1.4787577390670776+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+172.5905418395996,+-179.56531047821045,+147.87577390670776+],+"forward": [+-0.9958486557006836,+-0.08855503052473068,+-0.021060461178421974+],+"up": [+-0.020528258755803108,+-0.006916380487382412,+0.9997653365135193+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 437.0804511010647+},+{+"blender_frame": 280,+"matrix_world": [+[+0.09912759810686111,+-0.015820365399122238,+0.9949489235877991,+1.7135322093963623+],+[+0.9950584173202515,+0.007325256243348122,+-0.09902200102806091,+1.7824416160583496+],+[+-0.0057216910645365715,+0.9998480677604675,+0.016468320041894913,+1.4775367975234985+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+171.35322093963623,+-178.24416160583496,+147.75367975234985+],+"forward": [+-0.9949490427970886,+-0.0990220159292221,+-0.016468321904540062+],+"up": [+-0.015820365399122238,+-0.007325256243348122,+0.9998480677604675+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 435.6175763416104+},+{+"blender_frame": 281,+"matrix_world": [+[+0.1098809763789177,+-0.010836114175617695,+0.9938855767250061,+1.7016685009002686+],+[+0.9939253330230713,+0.007462560664862394,+-0.10980397462844849,+1.7695417404174805+],+[+-0.006227083038538694,+0.9999134540557861,+0.011590280570089817,+1.4760006666183472+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+170.16685009002686,+-176.95417404174805,+147.60006666183472+],+"forward": [+-0.9938856959342957,+-0.10980398952960968,+-0.011590281501412392+],+"up": [+-0.010836114175617695,+-0.007462560664862394,+0.9999134540557861+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 434.3049152463209+},+{+"blender_frame": 282,+"matrix_world": [+[+0.12080594897270203,+-0.005433100741356611,+0.9926612973213196,+1.6900341510772705+],+[+0.9926544427871704,+0.007274429313838482,+-0.1207653060555458,+1.7567166090011597+],+[+-0.0065649147145450115,+0.9999587535858154,+0.006271985359489918,+1.4744670391082764+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+169.00341510772705,+-175.67166090011597,+147.44670391082764+],+"forward": [+-0.9926612973213196,+-0.1207653060555458,+-0.006271985359489918+],+"up": [+-0.0054331012070178986,+-0.0072744302451610565,+0.999958872795105+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 433.1289518348058+},+{+"blender_frame": 283,+"matrix_world": [+[+0.13166740536689758,+0.0005089179612696171,+0.9912937879562378,+1.678464412689209+],+[+0.9912711381912231,+0.006713541690260172,+-0.1316678375005722,+1.744209885597229+],+[+-0.0067221010103821754,+0.9999773502349854,+0.00037947995588183403,+1.473196268081665+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+167.8464412689209,+-174.4209885597229,+147.3196268081665+],+"forward": [+-0.9912939071655273,+-0.1316678524017334,+-0.00037948001408949494+],+"up": [+0.0005089179612696171,+-0.006713541690260172,+0.9999773502349854+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 432.08342857765274+},+{+"blender_frame": 284,+"matrix_world": [+[+0.1423274278640747,+0.007062774151563644,+0.9897944331169128,+1.6671953201293945+],+[+0.989797055721283,+0.005745717789977789,+-0.14236879348754883,+1.7323222160339355+],+[+-0.006692598108202219,+0.9999585747718811,+-0.0061729406006634235,+1.4723519086837769+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+166.71953201293945,+-173.23222160339355,+147.23519086837769+],+"forward": [+-0.9897945523262024,+-0.14236880838871002,+0.006172941531985998+],+"up": [+0.007062774151563644,+-0.005745717789977789,+0.9999585747718811+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 431.1990000831429+},+{+"blender_frame": 285,+"matrix_world": [+[+0.153367817401886,+0.014246318489313126,+0.9880664944648743,+1.6562296152114868+],+[+0.9881479740142822,+0.004355737008154392,+-0.15344324707984924,+1.7210187911987305+],+[+-0.006489757914096117,+0.9998890161514282,+-0.013409441336989403,+1.4719804525375366+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+165.62296152114868,+-172.10187911987305,+147.19804525375366+],+"forward": [+-0.9880664944648743,+-0.15344324707984924,+0.013409441336989403+],+"up": [+0.014246320351958275,+-0.0043557374738156796,+0.9998891353607178+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 430.48369091702625+},+{+"blender_frame": 286,+"matrix_world": [+[+0.1649015098810196,+0.022025708109140396,+0.986064076423645,+1.6455682516098022+],+[+0.9862909913063049,+0.0025396188721060753,+-0.1649961769580841,+1.7102601528167725+],+[+-0.006138384807854891,+0.9997541904449463,+-0.021304968744516373,+1.4720256328582764+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+164.55682516098022,+-171.02601528167725,+147.20256328582764+],+"forward": [+-0.986064076423645,+-0.1649961769580841,+0.021304968744516373+],+"up": [+0.022025708109140396,+-0.0025396188721060753,+0.9997541904449463+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 429.9470827449113+},+{+"blender_frame": 287,+"matrix_world": [+[+0.17693230509757996,+0.03032837063074112,+0.9837556481361389,+1.6352083683013916+],+[+0.9842067360877991,+0.0003036081325262785,+-0.177022784948349,+1.7000062465667725+],+[+-0.005667488090693951,+0.999539852142334,+-0.02979567088186741,+1.4723587036132812+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+163.52083683013916,+-170.00062465667725,+147.23587036132812+],+"forward": [+-0.9837556481361389,+-0.177022784948349,+0.02979567088186741+],+"up": [+0.030328374356031418,+-0.00030360816163010895,+0.9995399713516235+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 429.59877722896636+},+{+"blender_frame": 288,+"matrix_world": [+[+0.18945500254631042,+0.03905850276350975,+0.9811121821403503,+1.62514066696167+],+[+0.9818761944770813,+-0.0023379973135888577,+-0.18950940668582916,+1.6902174949645996+],+[+-0.005108115263283253,+0.9992341995239258,+-0.03879355266690254,+1.4728139638900757+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+162.514066696167,+-169.02174949645996,+147.28139638900757+],+"forward": [+-0.9811123013496399,+-0.18950943648815155,+0.03879355639219284+],+"up": [+0.03905850276350975,+0.0023379973135888577,+0.9992341995239258+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 429.4479856733233+},+{+"blender_frame": 289,+"matrix_world": [+[+0.20245511829853058,+0.04811278358101845,+0.9781090021133423,+1.615349292755127+],+[+0.9792813062667847,+-0.005366090219467878,+-0.20243380963802338,+1.6808584928512573+],+[+-0.004491033498197794,+0.9988275170326233,+-0.04820234701037407,+1.4732245206832886+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+161.5349292755127,+-168.08584928512573,+147.32245206832886+],+"forward": [+-0.9781090021133423,+-0.20243380963802338,+0.04820234701037407+],+"up": [+0.04811278358101845,+0.005366090219467878,+0.9988275170326233+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 429.50381161645055+},+{+"blender_frame": 290,+"matrix_world": [+[+0.21591036021709442,+0.057392667979002,+0.974725067615509,+1.6058142185211182+],+[+0.9764056205749512,+-0.008759916760027409,+-0.21576683223247528,+1.6718984842300415+],+[+-0.0038449231069535017,+0.998313307762146,+-0.057929877191782,+1.4734488725662231+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+160.58142185211182,+-167.18984842300415,+147.34488725662231+],+"forward": [+-0.9747249484062195,+-0.2157668024301529,+0.0579298697412014+],+"up": [+0.057392667979002,+0.008759916760027409,+0.998313307762146+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 429.7747620381415+},+{+"blender_frame": 291,+"matrix_world": [+[+0.2297898828983307,+0.06681283563375473,+0.9709441661834717,+1.5965137481689453+],+[+0.9732351303100586,+-0.01250138133764267,+-0.22947175800800323,+1.6633073091506958+],+[+-0.003193514421582222,+0.9976872205734253,+-0.06789727509021759,+1.4733867645263672+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+159.65137481689453,+-166.33073091506958,+147.33867645263672+],+"forward": [+-0.9709442853927612,+-0.22947178781032562,+0.06789728254079819+],+"up": [+0.06681283563375473,+0.01250138133764267,+0.9976872205734253+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 430.2697265520692+},+{+"blender_frame": 292,+"matrix_world": [+[+0.24405662715435028,+0.07630378007888794,+0.9667544364929199,+1.587425708770752+],+[+0.969757616519928,+-0.016573213040828705,+-0.24350665509700775,+1.6550606489181519+],+[+-0.0025582488160580397,+0.9969468712806702,+-0.0780409723520279,+1.4729852676391602+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+158.7425708770752,+-165.50606489181519,+147.29852676391602+],+"forward": [+-0.9667544364929199,+-0.24350665509700775,+0.0780409723520279+],+"up": [+0.07630378007888794,+0.016573213040828705,+0.9969468712806702+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 430.99617809057236+},+{+"blender_frame": 293,+"matrix_world": [+[+0.25867146253585815,+0.0858106017112732,+0.9621464014053345,+1.5785282850265503+],+[+0.9659633636474609,+-0.020958388224244118,+-0.2578284442424774,+1.647146463394165+],+[+-0.001959373941645026,+0.9960909485816956,+-0.08831124752759933,+1.4722435474395752+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+157.85282850265503,+-164.7146463394165,+147.22435474395752+],+"forward": [+-0.9621464014053345,+-0.2578284442424774,+0.08831124752759933+],+"up": [+0.08581060916185379,+0.020958390086889267,+0.9960910677909851+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 431.9609824568033+},+{+"blender_frame": 294,+"matrix_world": [+[+0.27359116077423096,+0.09529272466897964,+0.957114040851593,+1.5698041915893555+],+[+0.9618450999259949,+-0.025646265596151352,+-0.27239009737968445,+1.6395576000213623+],+[+-0.0014103947905823588,+0.9951188564300537,+-0.09867343306541443,+1.4711995124816895+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+156.98041915893555,+-163.95576000213623,+147.11995124816895+],+"forward": [+-0.957114040851593,+-0.27239009737968445,+0.09867343306541443+],+"up": [+0.09529272466897964,+0.025646265596151352,+0.9951188564300537+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 433.16978961229324+},+{+"blender_frame": 295,+"matrix_world": [+[+0.2887685000896454,+0.10471978038549423,+0.9516546130180359,+1.5612419843673706+],+[+0.9573985934257507,+-0.03063155896961689,+-0.28714072704315186,+1.6322853565216064+],+[+-0.0009186464594677091,+0.9940298795700073,+-0.10910400748252869,+1.4699156284332275+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+156.12419843673706,+-163.22853565216064,+146.99156284332275+],+"forward": [+-0.9516546130180359,+-0.28714072704315186,+0.10910400748252869+],+"up": [+0.10471979528665543,+0.03063156269490719,+0.9940299987792969+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 434.62751992046833+},+{+"blender_frame": 296,+"matrix_world": [+[+0.3041549324989319,+0.11406616121530533,+0.9457689523696899,+1.55283522605896+],+[+0.9526224136352539,+-0.035910818725824356,+-0.30202794075012207,+1.625322937965393+],+[+-0.00048782691010273993,+0.9928238987922668,+-0.11958445608615875,+1.4684661626815796+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+155.283522605896,+-162.5322937965393,+146.84661626815796+],+"forward": [+-0.9457688331604004,+-0.3020279109477997,+0.11958444118499756+],+"up": [+0.11406616121530533,+0.035910818725824356,+0.9928238987922668+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 436.33793219923973+},+{+"blender_frame": 297,+"matrix_world": [+[+0.31970134377479553,+0.12330833822488785,+0.9394605159759521,+1.5445820093154907+],+[+0.9475184082984924,+-0.04148118570446968,+-0.31699883937835693,+1.6186654567718506+],+[+-0.00011866548447869718,+0.9915010929107666,+-0.13009849190711975,+1.4669278860092163+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+154.45820093154907,+-161.86654567718506,+146.69278860092163+],+"forward": [+-0.9394606351852417,+-0.3169988691806793,+0.13009850680828094+],+"up": [+0.12330833822488785,+0.04148118570446968,+0.9915010929107666+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 438.3038327097893+},+{+"blender_frame": 298,+"matrix_world": [+[+0.33535876870155334,+0.13242186605930328,+0.932737410068512,+1.5364844799041748+],+[+0.9420903921127319,+-0.047338664531707764,+-0.3320009112358093,+1.6123071908950806+],+[+0.00019036006415262818,+0.9900624752044678,+-0.14062878489494324,+1.46537184715271+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+153.64844799041748,+-161.23071908950806,+146.537184715271+],+"forward": [+-0.932737410068512,+-0.3320009112358093,+0.14062878489494324+],+"up": [+0.1324218511581421,+0.04733865708112717,+0.9900623559951782+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 440.5268132686615+},+{+"blender_frame": 299,+"matrix_world": [+[+0.35107964277267456,+0.14138036966323853,+0.9256104230880737,+1.52854585647583+],+[+0.9363455772399902,+-0.0534772090613842,+-0.3469831049442291,+1.6062440872192383+],+[+0.0004424657963681966,+0.9885098934173584,+-0.15115563571453094,+1.463858962059021+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+152.854585647583,+-160.62440872192383,+146.3858962059021+],+"forward": [+-0.9256105422973633,+-0.3469831347465515,+0.15115565061569214+],+"up": [+0.14138036966323853,+0.0534772090613842,+0.9885098934173584+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 443.0073730647564+},+{+"blender_frame": 300,+"matrix_world": [+[+0.36681753396987915,+0.15015581250190735,+0.9180948734283447,+1.5207716226577759+],+[+0.9302927255630493,+-0.05988793075084686,+-0.3618963658809662,+1.6004706621170044+],+[+0.0006419663550332189,+0.9868468642234802,+-0.16165679693222046,+1.4624369144439697+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+152.0771622657776,+-160.04706621170044,+146.24369144439697+],+"forward": [+-0.9180948734283447,+-0.3618963658809662,+0.16165679693222046+],+"up": [+0.15015581250190735,+0.05988793075084686,+0.9868468642234802+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 445.7450345158577+},+{+"blender_frame": 301,+"matrix_world": [+[+0.3825286030769348,+0.15871840715408325,+0.9102089405059814,+1.5131679773330688+],+[+0.923943281173706,+-0.06655857712030411,+-0.3766944408416748,+1.5949817895889282+],+[+0.0007938710041344166,+0.9850779175758362,+-0.17210736870765686,+1.461139440536499+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+151.31679773330688,+-159.49817895889282,+146.1139440536499+],+"forward": [+-0.910209059715271,+-0.3766945004463196,+0.17210738360881805+],+"up": [+0.15871840715408325,+0.06655857712030411,+0.9850779175758362+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 448.7381473183632+},+{+"blender_frame": 302,+"matrix_world": [+[+0.39817091822624207,+0.1670374572277069,+0.9019747972488403,+1.5057399272918701+],+[+0.9173108339309692,+-0.0734732374548912,+-0.3913343846797943,+1.5897713899612427+],+[+0.000903504784218967,+0.9832090735435486,+-0.18248018622398376,+1.4599878787994385+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+150.573992729187,+-158.97713899612427,+145.99878787994385+],+"forward": [+-0.9019747972488403,+-0.3913343846797943,+0.18248018622398376+],+"up": [+0.1670374721288681,+0.0734732449054718,+0.9832091927528381+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 451.9841194152832+},+{+"blender_frame": 303,+"matrix_world": [+[+0.41370540857315063,+0.17508277297019958,+0.8934169411659241,+1.49849271774292+],+[+0.9104102849960327,+-0.08061271160840988,+-0.40577661991119385,+1.5848336219787598+],+[+0.000976266514044255,+0.9812479019165039,+-0.1927470713853836,+1.4589923620224+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+149.849271774292,+-158.48336219787598,+145.89923620224+],+"forward": [+-0.8934170603752136,+-0.4057766795158386,+0.192747101187706+],+"up": [+0.17508278787136078,+0.08061271905899048,+0.9812480211257935+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 455.4795414209366+},+{+"blender_frame": 304,+"matrix_world": [+[+0.42909568548202515,+0.18282583355903625,+0.8845629692077637,+1.4914301633834839+],+[+0.9032585024833679,+-0.08795489370822906,+-0.4199858605861664,+1.5801619291305542+],+[+0.0010173730552196503,+0.9792029857635498,+-0.20288006961345673,+1.4581538438796997+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+149.1430163383484,+-158.01619291305542,+145.81538438796997+],+"forward": [+-0.8845629692077637,+-0.4199858605861664,+0.20288006961345673+],+"up": [+0.18282584846019745,+0.08795490115880966,+0.9792031049728394+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 459.2198833823204+},+{+"blender_frame": 305,+"matrix_world": [+[+0.444308340549469,+0.1902405321598053,+0.8754420280456543,+1.4845551252365112+],+[+0.8958733677864075,+-0.09547514468431473,+-0.43393030762672424,+1.5757499933242798+],+[+0.0010318169370293617,+0.9770839810371399,+-0.21285183727741241,+1.4574668407440186+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+148.45551252365112,+-157.57499933242798,+145.74668407440186+],+"forward": [+-0.8754420280456543,+-0.43393030762672424,+0.21285183727741241+],+"up": [+0.1902405321598053,+0.09547514468431473,+0.9770839810371399+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 463.20012509822845+},+{+"blender_frame": 306,+"matrix_world": [+[+0.4593130350112915,+0.1973041146993637,+0.8660846948623657,+1.4778695106506348+],+[+0.8882738351821899,+-0.10314708203077316,+-0.4475826323032379,+1.571590542793274+],+[+0.0010242071002721786,+0.9749008417129517,+-0.22263690829277039,+1.456920862197876+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+147.78695106506348,+-157.1590542793274,+145.6920862197876+],+"forward": [+-0.8660846948623657,+-0.4475826323032379,+0.22263690829277039+],+"up": [+0.1973041445016861,+0.10314709693193436,+0.9749009609222412+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 467.41430312395096+},+{+"blender_frame": 307,+"matrix_world": [+[+0.4740821123123169,+0.2039979100227356,+0.8565226197242737,+1.471374273300171+],+[+0.8804801106452942,+-0.11094314604997635,+-0.4609191417694092,+1.5676765441894531+],+[+0.000998773379251361,+0.9726646542549133,+-0.23221223056316376,+1.45650315284729+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+147.1374273300171,+-156.7676544189453,+145.650315284729+],+"forward": [+-0.8565226197242737,+-0.4609191417694092,+0.23221223056316376+],+"up": [+0.2039979100227356,+0.11094314604997635,+0.9726646542549133+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 471.8559116125107+},+{+"blender_frame": 308,+"matrix_world": [+[+0.48859089612960815,+0.21030735969543457,+0.8467878699302673,+1.4650689363479614+],+[+0.8725125193595886,+-0.1188352033495903,+-0.47391995787620544,+1.5640010833740234+],+[+0.0009593485738150775,+0.9703859686851501,+-0.24155761301517487,+1.4561989307403564+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+146.50689363479614,+-156.40010833740234,+145.61989307403564+],+"forward": [+-0.8467879891395569,+-0.4739200174808502,+0.24155764281749725+],+"up": [+0.21030738949775696,+0.1188352182507515,+0.9703860878944397+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 476.51788890361786+},+{+"blender_frame": 309,+"matrix_world": [+[+0.5028178095817566,+0.2162228524684906,+0.8369121551513672,+1.4589530229568481+],+[+0.864392101764679,+-0.12679551541805267,+-0.48656901717185974,+1.560556411743164+],+[+0.0009093765402212739,+0.968075692653656,+-0.2506563365459442,+1.4559928178787231+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+145.89530229568481,+-156.0556411743164,+145.59928178787231+],+"forward": [+-0.8369122743606567,+-0.4865690767765045,+0.2506563663482666+],+"up": [+0.2162228524684906,+0.12679551541805267,+0.968075692653656+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 481.3926190137863+},+{+"blender_frame": 310,+"matrix_world": [+[+0.5167436599731445,+0.22173872590065002,+0.8269267678260803,+1.4530251026153564+],+[+0.8561398386955261,+-0.13479666411876678,+-0.4988531470298767,+1.5573351383209229+],+[+0.0008519092225469649,+0.9657440781593323,+-0.2594946622848511,+1.455870509147644+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+145.30251026153564,+-155.73351383209229,+145.5870509147644+],+"forward": [+-0.8269268870353699,+-0.4988532066345215,+0.25949469208717346+],+"up": [+0.2217387557029724,+0.13479667901992798,+0.9657441973686218+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 486.47186756134033+},+{+"blender_frame": 311,+"matrix_world": [+[+0.5303522348403931,+0.2268541008234024,+0.8168622255325317,+1.4472829103469849+],+[+0.847777247428894,+-0.14281275868415833,+-0.5107626914978027,+1.554329514503479+],+[+0.0007897411123849452,+0.9634010791778564,+-0.2680628001689911,+1.4558175802230835+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+144.7282910346985,+-155.4329514503479,+145.58175802230835+],+"forward": [+-0.8168622255325317,+-0.5107626914978027,+0.2680628001689911+],+"up": [+0.2268541306257248,+0.14281277358531952,+0.963401198387146+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 491.7472153902054+},+{+"blender_frame": 312,+"matrix_world": [+[+0.5436297059059143,+0.23157164454460144,+0.8067473769187927,+1.4417239427566528+],+[+0.839324951171875,+-0.15081913769245148,+-0.5222904086112976,+1.5515315532684326+],+[+0.0007252912619151175,+0.9610557556152344,+-0.2763535976409912,+1.4558217525482178+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+144.17239427566528,+-155.15315532684326,+145.58217525482178+],+"forward": [+-0.8067474961280823,+-0.5222904682159424,+0.2763536274433136+],+"up": [+0.23157164454460144,+0.15081913769245148,+0.9610557556152344+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 497.20989763736725+},+{+"blender_frame": 313,+"matrix_world": [+[+0.556564450263977,+0.23589782416820526,+0.7966105341911316,+1.4363452196121216+],+[+0.830804169178009,+-0.15879297256469727,+-0.5334315896034241,+1.548933982849121+],+[+0.0006608053809031844,+0.9587162733078003,+-0.28436344861984253,+1.4558712244033813+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+143.63452196121216,+-154.8933982849121,+145.58712244033813+],+"forward": [+-0.7966105341911316,+-0.5334315896034241,+0.28436344861984253+],+"up": [+0.23589785397052765,+0.15879298746585846,+0.9587163925170898+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 502.8507709503174+},+{+"blender_frame": 314,+"matrix_world": [+[+0.5691479444503784,+0.23984216153621674,+0.7864772081375122,+1.431143045425415+],+[+0.8222349286079407,+-0.1667136400938034,+-0.5441839694976807,+1.5465281009674072+],+[+0.000598191050812602,+0.9563903212547302,+-0.2920913100242615,+1.4559558629989624+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+143.1143045425415,+-154.65281009674072,+145.59558629989624+],+"forward": [+-0.7864773273468018,+-0.5441840291023254,+0.29209133982658386+],+"up": [+0.23984216153621674,+0.1667136400938034,+0.9563903212547302+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 508.66043865680695+},+{+"blender_frame": 315,+"matrix_world": [+[+0.5813727378845215,+0.24341705441474915,+0.7763723731040955,+1.4261133670806885+],+[+0.8136371970176697,+-0.1745624989271164,+-0.5545470714569092,+1.5443065166473389+],+[+0.0005392793100327253,+0.9540839791297913,+-0.2995390295982361,+1.456066608428955+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+142.61133670806885,+-154.4306516647339,+145.6066608428955+],+"forward": [+-0.7763723731040955,+-0.5545470714569092,+0.2995390295982361+],+"up": [+0.24341705441474915,+0.1745624989271164,+0.9540839791297913+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 514.6293431520462+},+{+"blender_frame": 316,+"matrix_world": [+[+0.593234121799469,+0.24663673341274261,+0.7663182616233826,+1.421251893043518+],+[+0.8050298094749451,+-0.1823231726884842,+-0.5645220875740051,+1.5422606468200684+],+[+0.0004856664454564452,+0.9518029093742371,+-0.30671024322509766,+1.4561952352523804+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+142.1251893043518,+-154.22606468200684,+145.61952352523804+],+"forward": [+-0.7663182616233826,+-0.5645220875740051,+0.30671024322509766+],+"up": [+0.24663670361042023,+0.182323157787323,+0.9518027901649475+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 520.747920870781+},+{+"blender_frame": 317,+"matrix_world": [+[+0.604729413986206,+0.2495175153017044,+0.7563354969024658,+1.4165533781051636+],+[+0.7964310050010681,+-0.1899816244840622,+-0.5741121172904968,+1.5403825044631958+],+[+0.00043880753219127655,+0.9495514035224915,+-0.31361091136932373,+1.4563344717025757+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+141.65533781051636,+-154.03825044631958,+145.63344717025757+],+"forward": [+-0.7563356161117554,+-0.5741121768951416,+0.3136109411716461+],+"up": [+0.2495175451040268,+0.18998165428638458,+0.949551522731781+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 527.0064055919647+},+{+"blender_frame": 318,+"matrix_world": [+[+0.6158570051193237,+0.2520767152309418,+0.7464432716369629,+1.4120118618011475+],+[+0.7878579497337341,+-0.19752566516399384,+-0.5833211541175842,+1.5386643409729004+],+[+0.00040002097375690937,+0.9473336338996887,+-0.32024815678596497,+1.456478476524353+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+141.20118618011475,+-153.86643409729004,+145.6478476524353+],+"forward": [+-0.7464432716369629,+-0.5833211541175842,+0.32024815678596497+],+"up": [+0.2520767152309418,+0.19752566516399384,+0.9473336338996887+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 533.3948612213135+},+{+"blender_frame": 319,+"matrix_world": [+[+0.6266172528266907,+0.25433284044265747,+0.7366583943367004,+1.4076218605041504+],+[+0.7793270945549011,+-0.20494545996189117,+-0.592154324054718,+1.5370982885360718+],+[+0.0003705080598592758,+0.9451519250869751,+-0.3266308307647705,+1.4566212892532349+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+140.76218605041504,+-153.70982885360718,+145.6621289253235+],+"forward": [+-0.7366583943367004,+-0.592154324054718,+0.3266308307647705+],+"up": [+0.25433284044265747,+0.20494545996189117,+0.9451519250869751+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 539.9035453796387+},+{+"blender_frame": 320,+"matrix_world": [+[+0.6370124220848083,+0.2563048303127289,+0.7269959449768066,+1.4033763408660889+],+[+0.770853579044342,+-0.2122330665588379,+-0.6006180047988892,+1.535676121711731+],+[+0.00035126879811286926,+0.9430084228515625,+-0.3327685296535492,+1.45675790309906+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+140.3376340866089,+-153.5676121711731,+145.675790309906+],+"forward": [+-0.7269960045814514,+-0.6006180644035339,+0.3327685594558716+],+"up": [+0.25630486011505127,+0.21223309636116028,+0.943008542060852+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 546.5228796005249+},+{+"blender_frame": 321,+"matrix_world": [+[+0.6470450162887573,+0.25801175832748413,+0.7174695730209351,+1.3992680311203003+],+[+0.762451708316803,+-0.2193821370601654,+-0.6087190508842468,+1.5343900918960571+],+[+0.00034331122878938913,+0.9409045577049255,+-0.33867162466049194,+1.4568842649459839+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+139.92680311203003,+-153.4390091896057,+145.6884264945984+],+"forward": [+-0.7174696326255798,+-0.6087191104888916,+0.33867165446281433+],+"up": [+0.25801175832748413,+0.2193821370601654,+0.9409045577049255+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 553.242826461792+},+{+"blender_frame": 322,+"matrix_world": [+[+0.6567199230194092,+0.25947263836860657,+0.7080910205841064,+1.3952893018722534+],+[+0.7541345953941345,+-0.22638800740242004,+-0.6164653897285461,+1.5332330465316772+],+[+0.0003474245313555002,+0.9388409852981567,+-0.34435075521469116,+1.4569963216781616+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+139.52893018722534,+-153.32330465316772,+145.69963216781616+],+"forward": [+-0.7080910801887512,+-0.6164654493331909,+0.34435078501701355+],+"up": [+0.25947263836860657,+0.22638800740242004,+0.9388409852981567+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 560.0539147853851+},+{+"blender_frame": 323,+"matrix_world": [+[+0.6660420298576355,+0.26070624589920044,+0.6988706588745117,+1.3914321660995483+],+[+0.7459140419960022,+-0.23324750363826752,+-0.6238652467727661,+1.5321969985961914+],+[+0.00036424840800464153,+0.9368179440498352,+-0.34981709718704224,+1.457090973854065+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+139.14321660995483,+-153.21969985961914,+145.7090973854065+],+"forward": [+-0.6988706588745117,+-0.6238652467727661,+0.34981709718704224+],+"up": [+0.26070624589920044,+0.23324750363826752,+0.9368179440498352+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 566.9466018676758+},+{+"blender_frame": 324,+"matrix_world": [+[+0.6750183701515198,+0.2617306113243103,+0.689816951751709,+1.3876880407333374+],+[+0.7378009557723999,+-0.2399584800004959,+-0.6309277415275574,+1.5312743186950684+],+[+0.0003943279152736068,+0.9348353147506714,+-0.3550814390182495,+1.457165002822876+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+138.76880407333374,+-153.12743186950684,+145.7165002822876+],+"forward": [+-0.689816951751709,+-0.6309277415275574,+0.3550814390182495+],+"up": [+0.2617306113243103,+0.2399584800004959,+0.9348353147506714+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 573.9116907119751+},+{+"blender_frame": 325,+"matrix_world": [+[+0.6836556792259216,+0.26256313920021057,+0.6809372901916504,+1.3840477466583252+],+[+0.7298045754432678,+-0.24651996791362762,+-0.6376621723175049,+1.5304582118988037+],+[+0.0004380587488412857,+0.9328925013542175,+-0.36015453934669495,+1.4572162628173828+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+138.40477466583252,+-153.04582118988037,+145.72162628173828+],+"forward": [+-0.6809373497962952,+-0.6376622319221497,+0.36015456914901733+],+"up": [+0.26256316900253296,+0.24651999771595,+0.9328926205635071+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 580.9399604797363+},+{+"blender_frame": 326,+"matrix_world": [+[+0.6919618844985962,+0.26322072744369507,+0.672237753868103,+1.3805023431777954+],+[+0.7219339609146118,+-0.2529319226741791,+-0.6440783739089966,+1.5297412872314453+],+[+0.0004956207703799009,+0.9309889078140259,+-0.3650471866130829,+1.4572430849075317+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+138.05023431777954,+-152.97412872314453,+145.72430849075317+],+"forward": [+-0.672237753868103,+-0.6440783739089966,+0.3650471866130829+],+"up": [+0.26322072744369507,+0.2529319226741791,+0.9309889078140259+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 588.0222916603088+},+{+"blender_frame": 327,+"matrix_world": [+[+0.6999457478523254,+0.2637186646461487,+0.6637231707572937,+1.3770430088043213+],+[+0.7141958475112915,+-0.25919464230537415,+-0.6501865983009338,+1.5291166305541992+],+[+0.0005671399412676692,+0.92912358045578,+-0.3697689473628998,+1.4572440385818481+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+137.70430088043213,+-152.91166305541992,+145.72440385818481+],+"forward": [+-0.6637231707572937,+-0.6501865983009338,+0.3697689473628998+],+"up": [+0.2637186646461487,+0.25919464230537415,+0.92912358045578+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 595.150238275528+},+{+"blender_frame": 328,+"matrix_world": [+[+0.7076161503791809,+0.2640717625617981,+0.6553971767425537,+1.373659610748291+],+[+0.7065967321395874,+-0.26530900597572327,+-0.655997097492218,+1.5285773277282715+],+[+0.0006524523487314582,+0.9272956252098083,+-0.374329149723053,+1.4572185277938843+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+137.3659610748291,+-152.85773277282715,+145.72185277938843+],+"forward": [+-0.6553972363471985,+-0.6559971570968628,+0.37432917952537537+],+"up": [+0.2640717923641205,+0.26530903577804565,+0.9272957444190979+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 602.3149907588959+},+{+"blender_frame": 329,+"matrix_world": [+[+0.7149828672409058,+0.26429325342178345,+0.647262454032898,+1.3703434467315674+],+[+0.6991416215896606,+-0.27127617597579956,+-0.6615211367607117,+1.528116226196289+],+[+0.0007512990850955248,+0.9255044460296631,+-0.3787361979484558,+1.4571665525436401+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+137.03434467315674,+-152.8116226196289,+145.716655254364+],+"forward": [+-0.647262454032898,+-0.6615211367607117,+0.3787361979484558+],+"up": [+0.26429322361946106,+0.2712761461734772,+0.9255043268203735+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 609.5084428787231+},+{+"blender_frame": 330,+"matrix_world": [+[+0.7220553755760193,+0.2643956243991852,+0.6393207311630249,+1.3670849800109863+],+[+0.6918347477912903,+-0.2770976424217224,+-0.6667695045471191,+1.5277271270751953+],+[+0.0008633369579911232,+0.9237487316131592,+-0.38299787044525146,+1.4570883512496948+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+136.70849800109863,+-152.77271270751953,+145.70883512496948+],+"forward": [+-0.6393207907676697,+-0.6667695641517639,+0.38299793004989624+],+"up": [+0.26439565420150757,+0.2770976722240448,+0.9237488508224487+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 616.7226195335388+},+{+"blender_frame": 331,+"matrix_world": [+[+0.7288439273834229,+0.26439014077186584,+0.6315729022026062,+1.3638752698898315+],+[+0.6846790909767151,+-0.2827746272087097,+-0.6717537045478821,+1.5274029970169067+],+[+0.0009877653792500496,+0.9220284819602966,+-0.38712093234062195,+1.456985354423523+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+136.38752698898315,+-152.74029970169067,+145.6985354423523+],+"forward": [+-0.6315729022026062,+-0.6717537045478821,+0.38712093234062195+],+"up": [+0.26439014077186584,+0.2827746272087097,+0.9220284819602966+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 623.9496290683746+},+{+"blender_frame": 332,+"matrix_world": [+[+0.7353588342666626,+0.26428669691085815,+0.6240193247795105,+1.3607057332992554+],+[+0.6776770353317261,+-0.288308322429657,+-0.6764851808547974,+1.5271375179290771+],+[+0.0011239261366426945,+0.920342743396759,+-0.3911111056804657,+1.456858515739441+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+136.07057332992554,+-152.71375179290771,+145.6858515739441+],+"forward": [+-0.6240192651748657,+-0.6764851212501526,+0.3911110460758209+],+"up": [+0.26428672671318054,+0.28830835223197937,+0.9203428626060486+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 631.1822414398193+},+{+"blender_frame": 333,+"matrix_world": [+[+0.7416102290153503,+0.2640944719314575,+0.6166590452194214,+1.3575680255889893+],+[+0.6708297729492188,+-0.29369986057281494,+-0.6809755563735962,+1.5269242525100708+],+[+0.001270785927772522,+0.9186916351318359,+-0.3949732780456543,+1.4567097425460815+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+135.75680255889893,+-152.69242525100708,+145.67097425460815+],+"forward": [+-0.6166591048240662,+-0.680975615978241,+0.3949733376502991+],+"up": [+0.2640945017337799,+0.29369989037513733,+0.9186917543411255+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 638.4132623672485+},+{+"blender_frame": 334,+"matrix_world": [+[+0.7476088404655457,+0.26382142305374146,+0.6094911098480225,+1.3544546365737915+],+[+0.6641378998756409,+-0.2989501655101776,+-0.6852370500564575,+1.526756763458252+],+[+0.0014272703556343913,+0.9170752763748169,+-0.39871156215667725,+1.4565423727035522+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+135.44546365737915,+-152.6756763458252,+145.65423727035522+],+"forward": [+-0.6094911098480225,+-0.6852370500564575,+0.39871156215667725+],+"up": [+0.26382142305374146,+0.2989501655101776,+0.9170752763748169+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 645.6356406211853+},+{+"blender_frame": 335,+"matrix_world": [+[+0.7533646821975708,+0.26347458362579346,+0.6025137901306152,+1.3513576984405518+],+[+0.6576010584831238,+-0.3040596544742584,+-0.689281165599823,+1.526629090309143+],+[+0.0015920805744826794,+0.9154937863349915,+-0.4023290276527405,+1.456358551979065+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+135.13576984405518,+-152.6629090309143,+145.6358551979065+],+"forward": [+-0.6025137901306152,+-0.689281165599823,+0.4023290276527405+],+"up": [+0.26347458362579346,+0.3040596544742584,+0.9154937863349915+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 652.8427600860596+},+{+"blender_frame": 336,+"matrix_world": [+[+0.7588884830474854,+0.26305994391441345,+0.5957247018814087,+1.348271131515503+],+[+0.6512182950973511,+-0.3090287446975708,+-0.6931204199790955,+1.526535153388977+],+[+0.0017638385761529207,+0.9139478206634521,+-0.4058278203010559,+1.4561622142791748+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+134.8271131515503,+-152.6535153388977,+145.61622142791748+],+"forward": [+-0.5957247018814087,+-0.6931204199790955,+0.4058278203010559+],+"up": [+0.26305997371673584,+0.3090287744998932,+0.9139479398727417+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 660.0284934043884+},+{+"blender_frame": 337,+"matrix_world": [+[+0.7641900777816772,+0.2625828981399536,+0.5891212224960327,+1.345188856124878+],+[+0.6449882388114929,+-0.3138572871685028,+-0.6967666149139404,+1.5264689922332764+],+[+0.0019409985980018973,+0.9124383926391602,+-0.40920954942703247,+1.455956220626831+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+134.5188856124878,+-152.64689922332764,+145.5956220626831+],+"forward": [+-0.5891212224960327,+-0.6967666149139404,+0.40920954942703247+],+"up": [+0.2625828981399536,+0.3138572871685028,+0.9124383926391602+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 667.186713218689+},+{+"blender_frame": 338,+"matrix_world": [+[+0.7692797183990479,+0.2620479166507721,+0.5827003121376038,+1.3421059846878052+],+[+0.6389086842536926,+-0.31854501366615295,+-0.7002319693565369,+1.5264251232147217+],+[+0.002121921395882964,+0.9109666347503662,+-0.4124748408794403,+1.455744981765747+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+134.21059846878052,+-152.64251232147217,+145.5744981765747+],+"forward": [+-0.5827003121376038,+-0.7002319693565369,+0.4124748408794403+],+"up": [+0.2620478868484497,+0.31854498386383057,+0.9109665155410767+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 674.3118166923523+},+{+"blender_frame": 339,+"matrix_world": [+[+0.7741672396659851,+0.26145875453948975,+0.5764585137367249,+1.3390178680419922+],+[+0.6329769492149353,+-0.3230911195278168,+-0.7035285830497742,+1.526397943496704+],+[+0.002304905792698264,+0.909533679485321,+-0.4156239628791809,+1.4555319547653198+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+133.90178680419922,+-152.6397943496704,+145.55319547653198+],+"forward": [+-0.5764584541320801,+-0.7035285234451294,+0.41562390327453613+],+"up": [+0.26145875453948975,+0.3230911195278168,+0.909533679485321+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 681.3982605934143+},+{+"blender_frame": 340,+"matrix_world": [+[+0.7788625359535217,+0.2608186602592468,+0.5703918933868408,+1.335921287536621+],+[+0.6271898746490479,+-0.3274947702884674,+-0.7066683769226074,+1.5263822078704834+],+[+0.002488075289875269,+0.9081414341926575,+-0.41865622997283936,+1.4553217887878418+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+133.5921287536621,+-152.63822078704834,+145.53217887878418+],+"forward": [+-0.5703918933868408,+-0.7066683769226074,+0.41865622997283936+],+"up": [+0.2608186602592468,+0.3274947702884674,+0.9081414341926575+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 688.4412527084351+},+{+"blender_frame": 341,+"matrix_world": [+[+0.783374547958374,+0.26013055443763733,+0.5644966959953308,+1.3328132629394531+],+[+0.6215443015098572,+-0.33175504207611084,+-0.709662914276123,+1.5263729095458984+],+[+0.0026696226559579372,+0.9067915081977844,+-0.42157110571861267,+1.4551180601119995+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+133.2813262939453,+-152.63729095458984,+145.51180601119995+],+"forward": [+-0.564496636390686,+-0.7096628546714783,+0.4215710461139679+],+"up": [+0.26013055443763733,+0.33175504207611084,+0.9067915081977844+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 695.4354882240295+},+{+"blender_frame": 342,+"matrix_world": [+[+0.787712574005127,+0.2593967318534851,+0.5587685108184814,+1.3296926021575928+],+[+0.6160364151000977,+-0.33587077260017395,+-0.7125236392021179,+1.5263652801513672+],+[+0.002847694093361497,+0.9054855704307556,+-0.4243674576282501,+1.4549243450164795+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+132.96926021575928,+-152.63652801513672,+145.49243450164795+],+"forward": [+-0.5587685704231262,+-0.7125236988067627,+0.4243675172328949+],+"up": [+0.2593967616558075,+0.33587080240249634,+0.9054856896400452+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 702.3767828941345+},+{+"blender_frame": 343,+"matrix_world": [+[+0.7918853163719177,+0.2586194574832916,+0.5532031059265137,+1.326557993888855+],+[+0.6106624603271484,+-0.3398407995700836,+-0.7152619361877441,+1.5263550281524658+],+[+0.003020370379090309,+0.904225766658783,+-0.4270441234111786,+1.4547449350357056+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+132.6557993888855,+-152.63550281524658,+145.47449350357056+],+"forward": [+-0.5532031059265137,+-0.7152619361877441,+0.4270441234111786+],+"up": [+0.2586194574832916,+0.3398407995700836,+0.904225766658783+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 709.2607021331787+},+{+"blender_frame": 344,+"matrix_world": [+[+0.7959011793136597,+0.25780045986175537,+0.5477959513664246,+1.3234095573425293+],+[+0.6054182648658752,+-0.34366393089294434,+-0.7178884744644165,+1.5263382196426392+],+[+0.003185730893164873,+0.9030138254165649,+-0.4295996129512787,+1.454582929611206+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+132.34095573425293,+-152.63382196426392,+145.4582929611206+],+"forward": [+-0.5477959513664246,+-0.7178884744644165,+0.4295996129512787+],+"up": [+0.25780048966407776,+0.3436639606952667,+0.9030139446258545+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 716.0833716392517+},+{+"blender_frame": 345,+"matrix_world": [+[+0.7997681498527527,+0.2569414973258972,+0.542542040348053,+1.320248007774353+],+[+0.600299596786499,+-0.34733936190605164,+-0.7204136848449707,+1.5263111591339111+],+[+0.003342026611790061,+0.9018517732620239,+-0.43203288316726685,+1.4544415473937988+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+132.0248007774353,+-152.6311159133911,+145.44415473937988+],+"forward": [+-0.542542040348053,+-0.7204136848449707,+0.43203288316726685+],+"up": [+0.25694146752357483,+0.34733933210372925,+0.9018516540527344+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 722.8410124778748+},+{+"blender_frame": 346,+"matrix_world": [+[+0.8034941554069519,+0.2560444176197052,+0.5374369025230408,+1.3170747756958008+],+[+0.595302402973175,+-0.3508661687374115,+-0.7228472232818604,+1.5262705087661743+],+[+0.003487402806058526,+0.900740921497345,+-0.4343428313732147,+1.4543228149414062+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+131.70747756958008,+-152.62705087661743,+145.43228149414062+],+"forward": [+-0.537436842918396,+-0.7228471636772156,+0.43434277176856995+],+"up": [+0.2560444176197052,+0.3508661687374115,+0.900740921497345+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 729.5300006866455+},+{+"blender_frame": 347,+"matrix_world": [+[+0.8070864677429199,+0.25511083006858826,+0.5324752330780029,+1.3138923645019531+],+[+0.5904221534729004,+-0.3542441129684448,+-0.7251984477043152,+1.5262134075164795+],+[+0.0036202343180775642,+0.8996829986572266,+-0.43652868270874023,+1.4542292356491089+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+131.3892364501953,+-152.62134075164795,+145.4229235649109+],+"forward": [+-0.5324752926826477,+-0.72519850730896,+0.436528742313385+],+"up": [+0.25511085987091064,+0.3542441427707672,+0.8996831178665161+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 736.14741563797+},+{+"blender_frame": 348,+"matrix_world": [+[+0.8105520009994507,+0.2541426122188568,+0.527652382850647,+1.3107037544250488+],+[+0.5856548547744751,+-0.3574730157852173,+-0.7274760603904724,+1.5261372327804565+],+[+0.0037388340570032597,+0.8986793756484985,+-0.43859025835990906,+1.4541621208190918+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+131.07037544250488,+-152.61372327804565,+145.41621208190918+],+"forward": [+-0.5276524424552917,+-0.7274761199951172,+0.43859031796455383+],+"up": [+0.2541426122188568,+0.3574730157852173,+0.8986793756484985+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 742.6898956298828+},+{+"blender_frame": 349,+"matrix_world": [+[+0.8138970136642456,+0.25314152240753174,+0.5229636430740356,+1.3075125217437744+],+[+0.5809963941574097,+-0.3605530560016632,+-0.7296881079673767,+1.5260404348373413+],+[+0.0038417663890868425,+0.8977309465408325,+-0.44052737951278687,+1.4541223049163818+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+130.75125217437744,+-152.60404348373413,+145.41223049163818+],+"forward": [+-0.5229636430740356,+-0.7296881079673767,+0.44052737951278687+],+"up": [+0.25314152240753174,+0.3605530560016632,+0.8977309465408325+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 749.154806137085+},+{+"blender_frame": 350,+"matrix_world": [+[+0.8171280026435852,+0.2521098256111145,+0.5184038281440735,+1.3043228387832642+],+[+0.5764429569244385,+-0.36348530650138855,+-0.731841504573822,+1.5259212255477905+],+[+0.003927722107619047,+0.896838366985321,+-0.4423409104347229,+1.4541099071502686+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+130.43228387832642,+-152.59212255477905,+145.41099071502686+],+"forward": [+-0.5184038281440735,+-0.731841504573822,+0.4423409104347229+],+"up": [+0.2521098256111145,+0.36348530650138855,+0.896838366985321+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 755.5393934249878+},+{+"blender_frame": 351,+"matrix_world": [+[+0.8202504515647888,+0.251049667596817,+0.5139681100845337,+1.3011394739151+],+[+0.5719906091690063,+-0.3662710189819336,+-0.733942985534668,+1.525778889656067+],+[+0.0039954702369868755,+0.8960019946098328,+-0.44403210282325745,+1.4541245698928833+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+130.11394739151,+-152.5778889656067,+145.41245698928833+],+"forward": [+-0.5139681100845337,+-0.733942985534668,+0.44403210282325745+],+"up": [+0.2510496973991394,+0.366271048784256,+0.8960021138191223+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 761.8415713310242+},+{+"blender_frame": 352,+"matrix_world": [+[+0.8232699036598206,+0.24996374547481537,+0.5096516609191895,+1.2979673147201538+],+[+0.5676357746124268,+-0.3689124882221222,+-0.7359981536865234,+1.5256123542785645+],+[+0.004044024273753166,+0.8952215909957886,+-0.4456028342247009,+1.4541651010513306+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+129.79673147201538,+-152.56123542785645,+145.41651010513306+],+"forward": [+-0.5096516609191895,+-0.7359981536865234,+0.4456028342247009+],+"up": [+0.24996374547481537,+0.3689124882221222,+0.8952215909957886+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 768.0588364601135+},+{+"blender_frame": 353,+"matrix_world": [+[+0.8261911273002625,+0.24885468184947968,+0.5054498910903931,+1.2948116064071655+],+[+0.5633752942085266,+-0.3714120388031006,+-0.7380117177963257,+1.5254217386245728+],+[+0.004072489682585001,+0.894496738910675,+-0.4470558762550354,+1.4542289972305298+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+129.48116064071655,+-152.54217386245728,+145.42289972305298+],+"forward": [+-0.5054499506950378,+-0.7380117774009705,+0.4470559358596802+],+"up": [+0.24885468184947968,+0.3714120388031006,+0.894496738910675+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 774.1892457008362+},+{+"blender_frame": 354,+"matrix_world": [+[+0.8290188312530518,+0.2477254718542099,+0.501358151435852,+1.2916783094406128+],+[+0.5592060089111328,+-0.37377312779426575,+-0.7399880886077881,+1.525207281112671+],+[+0.004080311860889196,+0.8938264846801758,+-0.44839441776275635,+1.4543143510818481+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+129.16783094406128,+-152.5207281112671,+145.43143510818481+],+"forward": [+-0.5013582110404968,+-0.7399881482124329,+0.4483944773674011+],+"up": [+0.2477254718542099,+0.37377312779426575,+0.8938264846801758+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 780.2308559417725+},+{+"blender_frame": 355,+"matrix_world": [+[+0.8317570090293884,+0.24657927453517914,+0.4973721206188202,+1.2885725498199463+],+[+0.5551250576972961,+-0.37599942088127136,+-0.741930365562439,+1.5249699354171753+],+[+0.004066972993314266,+0.8932093381881714,+-0.44962260127067566,+1.4544175863265991+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+128.85725498199463,+-152.49699354171753,+145.4417586326599+],+"forward": [+-0.4973720610141754,+-0.7419303059577942,+0.4496225416660309+],+"up": [+0.24657930433750153,+0.37599948048591614,+0.8932094573974609+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 786.1818313598633+},+{+"blender_frame": 356,+"matrix_world": [+[+0.8344095945358276,+0.2454196661710739,+0.49348732829093933,+1.285500407218933+],+[+0.5511299967765808,+-0.3780957758426666,+-0.7438408732414246,+1.5247102975845337+],+[+0.004032294265925884,+0.8926436901092529,+-0.4507449269294739,+1.454534888267517+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+128.5500407218933,+-152.47102975845337,+145.4534888267517+],+"forward": [+-0.49348732829093933,+-0.7438408732414246,+0.4507449269294739+],+"up": [+0.2454196661710739,+0.3780957758426666,+0.8926436901092529+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 792.0407056808472+},+{+"blender_frame": 357,+"matrix_world": [+[+0.8369802236557007,+0.24425028264522552,+0.48969995975494385,+1.2824673652648926+],+[+0.547218918800354,+-0.38006719946861267,+-0.7457213997840881,+1.5244303941726685+],+[+0.003976203501224518,+0.8921271562576294,+-0.4517669975757599,+1.4546619653701782+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+128.24673652648926,+-152.44303941726685,+145.46619653701782+],+"forward": [+-0.4897000193595886,+-0.7457214593887329,+0.45176705718040466+],+"up": [+0.24425028264522552,+0.38006719946861267,+0.8921271562576294+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 797.8058457374573+},+{+"blender_frame": 358,+"matrix_world": [+[+0.8394715785980225,+0.24307478964328766,+0.4860062599182129,+1.2794791460037231+],+[+0.5433895587921143,+-0.38191908597946167,+-0.74757319688797,+1.5241317749023438+],+[+0.0038988925516605377,+0.8916570544242859,+-0.4526945650577545,+1.4547935724258423+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+127.94791460037231,+-152.41317749023438,+145.47935724258423+],+"forward": [+-0.4860062599182129,+-0.74757319688797,+0.4526945650577545+],+"up": [+0.24307481944561005,+0.38191914558410645,+0.8916571736335754+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 803.4758925437927+},+{+"blender_frame": 359,+"matrix_world": [+[+0.8418869376182556,+0.24189728498458862,+0.4824025332927704,+1.276540756225586+],+[+0.5396406650543213,+-0.38365811109542847,+-0.7493960857391357,+1.5238163471221924+],+[+0.0038007646799087524,+0.8912307620048523,+-0.4535343647003174,+1.4549249410629272+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+127.6540756225586,+-152.38163471221924,+145.49249410629272+],+"forward": [+-0.4824025332927704,+-0.7493960857391357,+0.4535343647003174+],+"up": [+0.24189728498458862,+0.38365811109542847,+0.8912307620048523+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 809.0495944023132+},+{+"blender_frame": 360,+"matrix_world": [+[+0.8442285656929016,+0.24072185158729553,+0.4788854420185089,+1.273656964302063+],+[+0.53597092628479,+-0.38529083132743835,+-0.7511898875236511,+1.5234862565994263+],+[+0.0036823779810220003,+0.8908446431159973,+-0.4542933404445648,+1.4550503492355347+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+127.3656964302063,+-152.34862565994263,+145.50503492355347+],+"forward": [+-0.4788855016231537,+-0.7511900067329407,+0.4542934000492096+],+"up": [+0.24072182178497314,+0.3852907717227936,+0.8908445239067078+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 814.5258188247681+},+{+"blender_frame": 361,+"matrix_world": [+[+0.8464986085891724,+0.23955246806144714,+0.4754522740840912,+1.270832896232605+],+[+0.5323792099952698,+-0.38682425022125244,+-0.7529537677764893,+1.5231441259384155+],+[+0.0035445326939225197,+0.8904951214790344,+-0.45497894287109375,+1.4551644325256348+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+127.0832896232605,+-152.31441259384155,+145.51644325256348+],+"forward": [+-0.4754522740840912,+-0.7529537677764893,+0.45497894287109375+],+"up": [+0.23955249786376953,+0.3868243098258972,+0.890495240688324+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 819.9032068252563+},+{+"blender_frame": 362,+"matrix_world": [+[+0.8486990928649902,+0.23839342594146729,+0.47210007905960083,+1.2680723667144775+],+[+0.5288652777671814,+-0.3882659375667572,+-0.7546861171722412,+1.522792100906372+],+[+0.0033881976269185543,+0.8901785612106323,+-0.45559895038604736,+1.4552611112594604+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+126.80723667144775,+-152.2792100906372,+145.52611112594604+],+"forward": [+-0.47210007905960083,+-0.7546861171722412,+0.45559895038604736+],+"up": [+0.23839345574378967,+0.388265997171402,+0.8901786804199219+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 825.1811265945435+},+{+"blender_frame": 363,+"matrix_world": [+[+0.8508317470550537,+0.2372487634420395,+0.46882665157318115,+1.2653789520263672+],+[+0.5254285335540771,+-0.38962358236312866,+-0.756385087966919,+1.5224332809448242+],+[+0.0032145038712769747,+0.8898912072181702,+-0.45616140961647034,+1.4553346633911133+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+126.53789520263672,+-152.24332809448242,+145.53346633911133+],+"forward": [+-0.46882665157318115,+-0.756385087966919,+0.45616140961647034+],+"up": [+0.23724879324436188,+0.38962364196777344,+0.8898913264274597+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 830.3585290908813+},+{+"blender_frame": 364,+"matrix_world": [+[+0.8528980016708374,+0.2361225038766861,+0.4656299352645874,+1.2627557516098022+],+[+0.5220689177513123,+-0.3909050226211548,+-0.7580483555793762,+1.5220698118209839+],+[+0.0030247699469327927,+0.8896287679672241,+-0.45667436718940735,+1.4553802013397217+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+126.27557516098022,+-152.2069811820984,+145.53802013397217+],+"forward": [+-0.4656299352645874,+-0.7580483555793762,+0.45667436718940735+],+"up": [+0.23612253367900848,+0.39090508222579956,+0.8896288871765137+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 835.4345321655273+},+{+"blender_frame": 365,+"matrix_world": [+[+0.8548991680145264,+0.23501844704151154,+0.46250808238983154,+1.2602055072784424+],+[+0.5187864899635315,+-0.39211809635162354,+-0.7596735954284668,+1.521704077720642+],+[+0.0028204750269651413,+0.889387309551239,+-0.4571458101272583,+1.4553923606872559+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+126.02055072784424,+-152.1704077720642,+145.5392360687256+],+"forward": [+-0.46250808238983154,+-0.7596735954284668,+0.4571458101272583+],+"up": [+0.23501844704151154,+0.39211809635162354,+0.889387309551239+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 840.4085040092468+},+{+"blender_frame": 366,+"matrix_world": [+[+0.8568364381790161,+0.2339402139186859,+0.45945969223976135,+1.2577300071716309+],+[+0.5155817270278931,+-0.3932706415653229,+-0.7612580060958862,+1.5213382244110107+],+[+0.0026031523011624813,+0.8891626596450806,+-0.4575839042663574,+1.4553662538528442+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+125.77300071716309,+-152.13382244110107,+145.53662538528442+],+"forward": [+-0.45945975184440613,+-0.7612581253051758,+0.4575839638710022+],+"up": [+0.2339402139186859,+0.3932706415653229,+0.8891626596450806+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 845.2800393104553+},+{+"blender_frame": 367,+"matrix_world": [+[+0.8587108254432678,+0.2328912913799286,+0.4564836323261261,+1.2553300857543945+],+[+0.5124549865722656,+-0.3943704068660736,+-0.7627986073493958,+1.52097487449646+],+[+0.002374500734731555,+0.8889508843421936,+-0.4579964578151703,+1.4552979469299316+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+125.53300857543945,+-152.097487449646,+145.52979469299316+],+"forward": [+-0.4564836919307709,+-0.7627987265586853,+0.45799651741981506+],+"up": [+0.2328912913799286,+0.3943704068660736,+0.8889508843421936+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 850.0479817390442+},+{+"blender_frame": 368,+"matrix_world": [+[+0.8605231642723083,+0.23187477886676788,+0.4535791575908661,+1.253006935119629+],+[+0.5094069242477417,+-0.3954249918460846,+-0.7642929553985596,+1.5206152200698853+],+[+0.0021362784318625927,+0.8887481093406677,+-0.4583909511566162,+1.455183982849121+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+125.30069351196289,+-152.06152200698853,+145.5183982849121+],+"forward": [+-0.4535791575908661,+-0.7642929553985596,+0.4583909511566162+],+"up": [+0.23187477886676788,+0.3954249918460846,+0.8887481093406677+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 854.712450504303+},+{+"blender_frame": 369,+"matrix_world": [+[+0.862274169921875,+0.23089347779750824,+0.45074552297592163,+1.2507601976394653+],+[+0.5064383149147034,+-0.3964415490627289,+-0.765737771987915,+1.5202611684799194+],+[+0.0018903814489021897,+0.8885505795478821,+-0.4587745666503906,+1.455021858215332+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+125.07601976394653,+-152.02611684799194,+145.5021858215332+],+"forward": [+-0.45074552297592163,+-0.765737771987915,+0.4587745666503906+],+"up": [+0.23089350759983063,+0.39644160866737366,+0.8885506987571716+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 859.2725396156311+},+{+"blender_frame": 370,+"matrix_world": [+[+0.8639643788337708,+0.22995002567768097,+0.44798266887664795,+1.2485895156860352+],+[+0.5035501718521118,+-0.3974267542362213,+-0.7671305537223816,+1.519913911819458+],+[+0.0016386196948587894,+0.8883551955223083,+-0.4591539800167084,+1.454809546470642+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+124.85895156860352,+-151.9913911819458,+145.4809546470642+],+"forward": [+-0.44798266887664795,+-0.7671305537223816,+0.4591539800167084+],+"up": [+0.22995002567768097,+0.3974267542362213,+0.8883551955223083+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 863.7282133102417+},+{+"blender_frame": 371,+"matrix_world": [+[+0.8655948042869568,+0.2290465235710144,+0.44529029726982117,+1.2464932203292847+],+[+0.5007433295249939,+-0.3983871638774872,+-0.7684683799743652,+1.5195741653442383+],+[+0.0013829130912199616,+0.8881585001945496,+-0.45953530073165894,+1.4545460939407349+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+124.64932203292847,+-151.95741653442383,+145.4546093940735+],+"forward": [+-0.44529035687446594,+-0.7684684991836548,+0.4595353603363037+],+"up": [+0.2290465235710144,+0.3983871638774872,+0.8881585001945496+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 868.0788159370422+},+{+"blender_frame": 372,+"matrix_world": [+[+0.8671656250953674,+0.22818464040756226,+0.44266876578330994,+1.2444701194763184+],+[+0.49801871180534363,+-0.3993283212184906,+-0.7697494626045227,+1.5192421674728394+],+[+0.0011251788819208741,+0.8879575729370117,+-0.45992398262023926,+1.454231858253479+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+124.44701194763184,+-151.92421674728394,+145.4231858253479+],+"forward": [+-0.4426688253879547,+-0.7697495818138123,+0.45992404222488403+],+"up": [+0.22818464040756226,+0.3993283212184906,+0.8879575729370117+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 872.3241925239563+},+{+"blender_frame": 373,+"matrix_world": [+[+0.86867755651474,+0.22736570239067078,+0.44011831283569336,+1.2425174713134766+],+[+0.49537715315818787,+-0.4002555310726166,+-0.7709714770317078,+1.518918514251709+],+[+0.0008673284319229424,+0.8877501487731934,+-0.46032479405403137,+1.4538676738739014+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+124.25174713134766,+-151.8918514251709,+145.38676738739014+],+"forward": [+-0.44011831283569336,+-0.7709714770317078,+0.46032479405403137+],+"up": [+0.22736573219299316,+0.40025559067726135,+0.8877502679824829+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 876.4641165733337+},+{+"blender_frame": 374,+"matrix_world": [+[+0.870131254196167,+0.22659067809581757,+0.43763938546180725,+1.2406330108642578+],+[+0.4928196668624878,+-0.4011732339859009,+-0.7721325755119324,+1.5186021327972412+],+[+0.0006111517432145774,+0.8875340819358826,+-0.46074172854423523,+1.453456163406372+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+124.06330108642578,+-151.86021327972412,+145.3456163406372+],+"forward": [+-0.437639445066452,+-0.7721326947212219,+0.46074178814888+],+"up": [+0.22659067809581757,+0.4011732339859009,+0.8875340819358826+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 880.4983615875244+},+{+"blender_frame": 375,+"matrix_world": [+[+0.8715271949768066,+0.22586019337177277,+0.43523266911506653,+1.2388129234313965+],+[+0.4903469681739807,+-0.4020853638648987,+-0.7732316255569458,+1.5182925462722778+],+[+0.00035843229852616787,+0.8873074650764465,+-0.4611782133579254,+1.4530003070831299+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+123.88129234313965,+-151.82925462722778,+145.300030708313+],+"forward": [+-0.43523266911506653,+-0.7732316255569458,+0.4611782133579254+],+"up": [+0.22586019337177277,+0.4020853638648987,+0.8873074650764465+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 884.4266891479492+},+{+"blender_frame": 376,+"matrix_world": [+[+0.8728662133216858,+0.2251741588115692,+0.43289870023727417,+1.2370541095733643+],+[+0.48795968294143677,+-0.402994841337204,+-0.7742677330970764,+1.5179882049560547+],+[+0.00011085228470619768,+0.8870692253112793,+-0.4616365134716034,+1.45250403881073+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+123.70541095733643,+-151.79882049560547,+145.250403881073+],+"forward": [+-0.43289870023727417,+-0.7742677330970764,+0.4616365134716034+],+"up": [+0.2251741588115692,+0.402994841337204,+0.8870692253112793+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 888.2492899894714+},+{+"blender_frame": 377,+"matrix_world": [+[+0.8741487264633179,+0.22453249990940094,+0.43063828349113464,+1.2353525161743164+],+[+0.48565852642059326,+-0.40390416979789734,+-0.7752401232719421,+1.517688274383545+],+[+-0.00013001050683669746,+0.8868181705474854,+-0.46211835741996765,+1.4519731998443604+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+123.53525161743164,+-151.7688274383545,+145.19731998443604+],+"forward": [+-0.4306383430957794,+-0.7752402424812317,+0.4621184170246124+],+"up": [+0.22453252971172333,+0.4039042294025421,+0.8868182897567749+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 891.9657230377197+},+{+"blender_frame": 378,+"matrix_world": [+[+0.8753753900527954,+0.223934605717659,+0.42845219373703003,+1.2337042093276978+],+[+0.4834437072277069,+-0.4048149883747101,+-0.7761488556861877,+1.5173895359039307+],+[+-0.0003627160913310945,+0.8865540027618408,+-0.4626249372959137,+1.4514133930206299+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+123.37042093276978,+-151.73895359039307,+145.141339302063+],+"forward": [+-0.42845219373703003,+-0.7761488556861877,+0.4626249372959137+],+"up": [+0.22393463551998138,+0.40481504797935486,+0.8865541219711304+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 895.5759644508362+},+{+"blender_frame": 379,+"matrix_world": [+[+0.8765472173690796,+0.22337943315505981,+0.4263409674167633,+1.2321048974990845+],+[+0.4813155233860016,+-0.4057283401489258,+-0.7769941687583923,+1.5170906782150269+],+[+-0.0005859013763256371,+0.8862766027450562,+-0.4631560444831848,+1.4508320093154907+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+123.21048974990845,+-151.70906782150269,+145.08320093154907+],+"forward": [+-0.4263409674167633,+-0.7769941687583923,+0.4631560444831848+],+"up": [+0.22337943315505981,+0.4057283401489258,+0.8862766027450562+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 899.0800499916077+},+{+"blender_frame": 380,+"matrix_world": [+[+0.8776660561561584,+0.2228582799434662,+0.4243069291114807,+1.2305501699447632+],+[+0.47927188873291016,+-0.4066416621208191,+-0.7777794599533081,+1.516797423362732+],+[+-0.0007937040645629168,+0.8859891891479492,+-0.4637052118778229,+1.450222134590149+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+123.05501699447632,+-151.6797423362732,+145.0222134590149+],+"forward": [+-0.4243069887161255,+-0.7777795791625977,+0.46370527148246765+],+"up": [+0.2228582799434662,+0.4066416621208191,+0.8859891891479492+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 902.4776935577393+},+{+"blender_frame": 381,+"matrix_world": [+[+0.8787317276000977,+0.22237733006477356,+0.4223491847515106,+1.2290363311767578+],+[+0.47731488943099976,+-0.4075574576854706,+-0.7785032987594604,+1.5164978504180908+],+[+-0.0009899141732603312,+0.8856891393661499,+-0.4642776846885681,+1.4496076107025146+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+122.90363311767578,+-151.64978504180908,+144.96076107025146+],+"forward": [+-0.4223492443561554,+-0.77850341796875,+0.4642777442932129+],+"up": [+0.22237733006477356,+0.4075574576854706,+0.8856891393661499+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 905.7690978050232+},+{+"blender_frame": 382,+"matrix_world": [+[+0.8797451257705688,+0.22193501889705658,+0.4204680025577545,+1.2275588512420654+],+[+0.47544410824775696,+-0.40847501158714294,+-0.7791669368743896,+1.5161892175674438+],+[+-0.0011737763416022062,+0.8853772878646851,+-0.46487167477607727,+1.4489973783493042+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+122.75588512420654,+-151.61892175674438,+144.89973783493042+],+"forward": [+-0.4204680025577545,+-0.7791669368743896,+0.46487167477607727+],+"up": [+0.22193504869937897,+0.4084750711917877,+0.8853774070739746+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 908.9539647102356+},+{+"blender_frame": 383,+"matrix_world": [+[+0.880707323551178,+0.22152958810329437,+0.4186636805534363,+1.2261136770248413+],+[+0.4736590087413788,+-0.4093928039073944,+-0.779772162437439,+1.5158681869506836+],+[+-0.001344701973721385,+0.885054886341095,+-0.4654846489429474,+1.448400855064392+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+122.61136770248413,+-151.58681869506836,+144.8400855064392+],+"forward": [+-0.41866374015808105,+-0.7797722816467285,+0.46548470854759216+],+"up": [+0.22152958810329437,+0.4093928039073944,+0.885054886341095+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 912.0324373245239+},+{+"blender_frame": 384,+"matrix_world": [+[+0.8816193342208862,+0.22115880250930786,+0.4169365167617798,+1.2246968746185303+],+[+0.4719586968421936,+-0.4103085994720459,+-0.7803215980529785,+1.5155318975448608+],+[+-0.0015023762825876474,+0.8847234845161438,+-0.4661138653755188,+1.4478271007537842+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+122.46968746185303,+-151.55318975448608,+144.78271007537842+],+"forward": [+-0.4169365167617798,+-0.7803215980529785,+0.4661138653755188+],+"up": [+0.22115880250930786,+0.4103085994720459,+0.8847234845161438+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 915.0044560432434+},+{+"blender_frame": 385,+"matrix_world": [+[+0.8824825882911682,+0.2208206206560135,+0.41528651118278503,+1.2233049869537354+],+[+0.47034239768981934,+-0.4112200438976288,+-0.7808175683021545,+1.5151772499084473+],+[+-0.0016464904183521867,+0.88438481092453,+-0.466755747795105,+1.4472852945327759+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+122.33049869537354,+-151.51772499084473,+144.7285294532776+],+"forward": [+-0.4152865707874298,+-0.7808176875114441,+0.46675580739974976+],+"up": [+0.2208205908536911,+0.411219984292984,+0.8843846917152405+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 917.8703665733337+},+{+"blender_frame": 386,+"matrix_world": [+[+0.8832980394363403,+0.2205125391483307,+0.4137134850025177,+1.2219340801239014+],+[+0.4688085913658142,+-0.4121241569519043,+-0.7812632322311401,+1.514802098274231+],+[+-0.0017770214471966028,+0.8840406537055969,+-0.46740657091140747,+1.4467843770980835+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+122.19340801239014,+-151.4802098274231,+144.67843770980835+],+"forward": [+-0.4137134850025177,+-0.7812632322311401,+0.46740657091140747+],+"up": [+0.2205125391483307,+0.4121241569519043,+0.8840406537055969+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 920.6296801567078+},+{+"blender_frame": 387,+"matrix_world": [+[+0.8840672373771667,+0.22023224830627441,+0.4122171103954315,+1.2205815315246582+],+[+0.46735602617263794,+-0.4130176305770874,+-0.7816615700721741,+1.514404058456421+],+[+-0.0018941396847367287,+0.883693516254425,+-0.468062162399292,+1.4463324546813965+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+122.05815315246582,+-151.4404058456421,+144.63324546813965+],+"forward": [+-0.4122171700000763,+-0.7816616892814636,+0.46806222200393677+],+"up": [+0.22023224830627441,+0.4130176305770874,+0.883693516254425+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 923.2828140258789+},+{+"blender_frame": 388,+"matrix_world": [+[+0.8847914338111877,+0.2199772149324417,+0.4107969105243683,+1.2192444801330566+],+[+0.46598297357559204,+-0.4138970673084259,+-0.7820160388946533,+1.5139813423156738+],+[+-0.0019980655051767826,+0.8833454847335815,+-0.46871817111968994,+1.4459372758865356+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.92444801330566,+-151.39813423156738,+144.59372758865356+],+"forward": [+-0.41079697012901306,+-0.7820161581039429,+0.4687182307243347+],+"up": [+0.2199772149324417,+0.4138970673084259,+0.8833454847335815+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 925.829803943634+},+{+"blender_frame": 389,+"matrix_world": [+[+0.8854722380638123,+0.21974483132362366,+0.4094521403312683,+1.2179207801818848+],+[+0.4646874964237213,+-0.4147587716579437,+-0.7823302745819092,+1.5135325193405151+],+[+-0.002089183311909437,+0.8829991221427917,+-0.469370037317276,+1.4456056356430054+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.79207801818848,+-151.3532519340515,+144.56056356430054+],+"forward": [+-0.4094521999359131,+-0.7823303937911987,+0.4693700969219208+],+"up": [+0.21974483132362366,+0.4147587716579437,+0.8829991221427917+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 928.270697593689+},+{+"blender_frame": 390,+"matrix_world": [+[+0.8861112594604492,+0.2195328027009964,+0.4081818461418152,+1.2166084051132202+],+[+0.4634678363800049,+-0.41559910774230957,+-0.782607913017273,+1.513056993484497+],+[+-0.0021681024227291346,+0.8826566338539124,+-0.4700133502483368,+1.4453428983688354+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.66084051132202,+-151.3056993484497,+144.53428983688354+],+"forward": [+-0.4081818461418152,+-0.782607913017273,+0.4700133502483368+],+"up": [+0.2195328027009964,+0.41559910774230957,+0.8826566338539124+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 930.6055307388306+},+{+"blender_frame": 391,+"matrix_world": [+[+0.8867095112800598,+0.21933874487876892,+0.40698492527008057,+1.215306282043457+],+[+0.46232160925865173,+-0.41641440987586975,+-0.782852292060852,+1.5125545263290405+],+[+-0.0022354377433657646,+0.8823204636573792,+-0.47064366936683655,+1.4451545476913452+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.5306282043457,+-151.25545263290405,+144.51545476913452+],+"forward": [+-0.40698498487472534,+-0.7828524112701416,+0.4706437289714813+],+"up": [+0.2193387746810913,+0.4164144694805145,+0.8823205828666687+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 932.8344702720642+},+{+"blender_frame": 392,+"matrix_world": [+[+0.8872691988945007,+0.21916021406650543,+0.40585991740226746,+1.2140140533447266+],+[+0.46124643087387085,+-0.4172011911869049,+-0.7830675840377808,+1.512024998664856+],+[+-0.0022920186165720224,+0.8819931745529175,+-0.4712565541267395,+1.4450441598892212+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.40140533447266,+-151.2024998664856,+144.50441598892212+],+"forward": [+-0.40585997700691223,+-0.7830677032470703,+0.4712566137313843+],+"up": [+0.21916021406650543,+0.4172011911869049,+0.8819931745529175+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 934.9580407142639+},+{+"blender_frame": 393,+"matrix_world": [+[+0.8877913951873779,+0.21899530291557312,+0.4048055112361908,+1.2127314805984497+],+[+0.4602401852607727,+-0.41795605421066284,+-0.7832571268081665,+1.5114699602127075+],+[+-0.002338710706681013,+0.8816767334938049,+-0.47184813022613525,+1.4450138807296753+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.27314805984497,+-151.14699602127075,+144.50138807296753+],+"forward": [+-0.40480557084083557,+-0.783257246017456,+0.47184818983078003+],+"up": [+0.21899530291557312,+0.41795605421066284,+0.8816767334938049+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 936.9761109352112+},+{+"blender_frame": 394,+"matrix_world": [+[+0.8882780075073242,+0.2188417762517929,+0.4038197994232178,+1.2114589214324951+],+[+0.4592999815940857,+-0.4186757504940033,+-0.7834246754646301,+1.5108908414840698+],+[+-0.002376474440097809,+0.881373405456543,+-0.472414493560791,+1.4450651407241821+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.14589214324951,+-151.08908414840698,+144.5065140724182+],+"forward": [+-0.4038197994232178,+-0.7834246754646301,+0.472414493560791+],+"up": [+0.2188417762517929,+0.4186757504940033,+0.881373405456543+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 938.8890385627747+},+{+"blender_frame": 395,+"matrix_world": [+[+0.8887305855751038,+0.21869796514511108,+0.4029010236263275,+1.2101973295211792+],+[+0.4584237337112427,+-0.41935744881629944,+-0.7835732698440552,+1.5102897882461548+],+[+-0.0024063317105174065,+0.8810847997665405,+-0.47295209765434265,+1.4451978206634521+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+121.01973295211792,+-151.02897882461548,+144.51978206634521+],+"forward": [+-0.4029010236263275,+-0.7835732698440552,+0.47295209765434265+],+"up": [+0.21869799494743347,+0.4193575084209442,+0.8810849189758301+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 940.697193145752+},+{+"blender_frame": 396,+"matrix_world": [+[+0.8891505002975464,+0.2185622751712799,+0.40204715728759766,+1.2089488506317139+],+[+0.4576084315776825,+-0.41999873518943787,+-0.7837063670158386,+1.5096696615219116+],+[+-0.0024293495807796717,+0.8808130025863647,+-0.47345802187919617,+1.4454104900360107+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+120.89488506317139,+-150.96696615219116,+144.54104900360107+],+"forward": [+-0.40204715728759766,+-0.7837063670158386,+0.47345802187919617+],+"up": [+0.2185623049736023,+0.41999879479408264,+0.8808131217956543+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 942.4009799957275+},+{+"blender_frame": 397,+"matrix_world": [+[+0.8895395398139954,+0.21843327581882477,+0.4012559652328491,+1.2077155113220215+],+[+0.45685169100761414,+-0.4205973744392395,+-0.7838267683982849,+1.5090346336364746+],+[+-0.002446637721732259,+0.8805592060089111,+-0.47392967343330383,+1.4457008838653564+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+120.77155113220215,+-150.90346336364746,+144.57008838653564+],+"forward": [+-0.4012559652328491,+-0.7838267683982849,+0.47392967343330383+],+"up": [+0.21843330562114716,+0.4205974340438843,+0.8805593252182007+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 944.0006494522095+},+{+"blender_frame": 398,+"matrix_world": [+[+0.8898990154266357,+0.21830999851226807,+0.40052536129951477,+1.2065001726150513+],+[+0.4561510384082794,+-0.4211519658565521,+-0.7839370965957642,+1.5083872079849243+],+[+-0.002459239214658737,+0.8803248405456543,+-0.4743650257587433,+1.446065068244934+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+120.65001726150513,+-150.83872079849243,+144.6065068244934+],+"forward": [+-0.40052536129951477,+-0.7839370965957642,+0.4743650257587433+],+"up": [+0.21830999851226807,+0.4211519658565521,+0.8803248405456543+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 945.4965710639954+},+{+"blender_frame": 399,+"matrix_world": [+[+0.8902303576469421,+0.2181914895772934,+0.3998529613018036,+1.205306053161621+],+[+0.4555039405822754,+-0.4216610789299011,+-0.7840396165847778,+1.5077333450317383+],+[+-0.0024683375377207994,+0.8801103234291077,+-0.4747626781463623,+1.4464976787567139+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+120.53060531616211,+-150.77333450317383,+144.6497678756714+],+"forward": [+-0.3998529613018036,+-0.7840396165847778,+0.4747626781463623+],+"up": [+0.21819151937961578,+0.4216611385345459,+0.8801104426383972+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 946.8891382217407+},+{+"blender_frame": 400,+"matrix_world": [+[+0.8905349969863892,+0.21807730197906494,+0.39923644065856934,+1.2041375637054443+],+[+0.45490801334381104,+-0.4221242368221283,+-0.7841363549232483,+1.5070772171020508+],+[+-0.0024749566800892353,+0.8799166679382324,+-0.47512149810791016,+1.446993350982666+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+120.41375637054443,+-150.70772171020508,+144.6993350982666+],+"forward": [+-0.39923644065856934,+-0.7841363549232483,+0.47512149810791016+],+"up": [+0.21807733178138733,+0.42212429642677307,+0.879916787147522+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 948.1788039207458+},+{+"blender_frame": 401,+"matrix_world": [+[+0.8908141851425171,+0.2179669737815857,+0.3986733853816986,+1.2029987573623657+],+[+0.45436105132102966,+-0.4225411117076874,+-0.7842289209365845,+1.5064244270324707+],+[+-0.002480094088241458,+0.8797439336776733,+-0.4754413664340973,+1.447545051574707+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+120.29987573623657,+-150.64244270324707,+144.7545051574707+],+"forward": [+-0.3986734449863434,+-0.784229040145874,+0.47544142603874207+],+"up": [+0.2179669737815857,+0.4225411117076874,+0.8797439336776733+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 949.3661642074585+},+{+"blender_frame": 402,+"matrix_world": [+[+0.8910690546035767,+0.21786066889762878,+0.3981616497039795,+1.2018945217132568+],+[+0.4538609981536865,+-0.4229121804237366,+-0.7843185067176819,+1.5057799816131592+],+[+-0.002484760945662856,+0.8795919418334961,+-0.47572240233421326,+1.4481450319290161+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+120.18945217132568,+-150.57799816131592,+144.8145031929016+],+"forward": [+-0.3981616497039795,+-0.7843185067176819,+0.47572240233421326+],+"up": [+0.21786066889762878,+0.4229121804237366,+0.8795919418334961+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 950.4513382911682+},+{+"blender_frame": 403,+"matrix_world": [+[+0.8913009166717529,+0.2177583873271942,+0.3976985812187195,+1.200830340385437+],+[+0.4534056782722473,+-0.42323800921440125,+-0.7844060659408569,+1.5051499605178833+],+[+-0.0024898345582187176,+0.8794605135917664,+-0.4759652316570282,+1.4487849473953247+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+120.0830340385437,+-150.51499605178833,+144.87849473953247+],+"forward": [+-0.39769864082336426,+-0.7844061851501465,+0.475965291261673+],+"up": [+0.2177584171295166,+0.423238068819046,+0.8794606328010559+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 951.4352798461914+},+{+"blender_frame": 404,+"matrix_world": [+[+0.8915103077888489,+0.21766069531440735,+0.3972823917865753,+1.1998118162155151+],+[+0.4529936611652374,+-0.4235198199748993,+-0.784492015838623,+1.5045403242111206+],+[+-0.002496088622137904,+0.8793491125106812,+-0.47617119550704956,+1.4494556188583374+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+119.98118162155151,+-150.45403242111206,+144.94556188583374+],+"forward": [+-0.3972823917865753,+-0.784492015838623,+0.47617119550704956+],+"up": [+0.21766069531440735,+0.4235198199748993,+0.8793491125106812+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 952.3179888725281+},+{+"blender_frame": 405,+"matrix_world": [+[+0.8916983008384705,+0.2175682634115219,+0.39691075682640076,+1.1988449096679688+],+[+0.45262324810028076,+-0.4237593412399292,+-0.7845765352249146,+1.5039567947387695+],+[+-0.002504328964278102,+0.8792566061019897,+-0.47634196281433105,+1.4501479864120483+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+119.88449096679688,+-150.39567947387695,+145.01479864120483+],+"forward": [+-0.39691075682640076,+-0.7845765352249146,+0.47634196281433105+],+"up": [+0.2175682634115219,+0.4237593412399292,+0.8792566061019897+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 953.100311756134+},+{+"blender_frame": 406,+"matrix_world": [+[+0.8918658494949341,+0.21748194098472595,+0.3965817987918854,+1.1979360580444336+],+[+0.452293336391449,+-0.4239584803581238,+-0.784659206867218,+1.503404974937439+],+[+-0.002514994703233242,+0.8791819214820862,+-0.4764796197414398,+1.4508525133132935+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+119.79360580444336,+-150.3404974937439,+145.08525133132935+],+"forward": [+-0.3965817987918854,+-0.784659206867218,+0.4764796197414398+],+"up": [+0.21748194098472595,+0.4239584803581238,+0.8791819214820862+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 953.7824511528015+},+{+"blender_frame": 407,+"matrix_world": [+[+0.8920130729675293,+0.21740281581878662,+0.39629384875297546,+1.1970915794372559+],+[+0.45200270414352417,+-0.4241194427013397,+-0.7847396731376648,+1.5028904676437378+],+[+-0.002528687473386526,+0.8791238069534302,+-0.4765867292881012,+1.4515595436096191+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+119.70915794372559,+-150.28904676437378,+145.1559543609619+],+"forward": [+-0.39629384875297546,+-0.7847396731376648,+0.4765867292881012+],+"up": [+0.217402845621109,+0.4241195023059845,+0.8791239261627197+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 954.3650269508362+},+{+"blender_frame": 408,+"matrix_world": [+[+0.8921406865119934,+0.21733203530311584,+0.3960453271865845,+1.1963179111480713+],+[+0.45175057649612427,+-0.4242449402809143,+-0.7848169803619385,+1.502419114112854+],+[+-0.0025456235744059086,+0.8790807723999023,+-0.47666606307029724,+1.4522594213485718+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+119.63179111480713,+-150.2419114112854,+145.22594213485718+],+"forward": [+-0.3960453271865845,+-0.7848169803619385,+0.47666606307029724+],+"up": [+0.21733206510543823,+0.4242449998855591,+0.8790808916091919+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 954.8486232757568+},+{+"blender_frame": 409,+"matrix_world": [+[+0.8921406865119934,+0.21733203530311584,+0.3960453271865845,+1.1963179111480713+],+[+0.45175057649612427,+-0.4242449402809143,+-0.7848169803619385,+1.502419114112854+],+[+-0.0025456235744059086,+0.8790807723999023,+-0.47666606307029724,+1.4522594213485718+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+119.63179111480713,+-150.2419114112854,+145.22594213485718+],+"forward": [+-0.3960453271865845,+-0.7848169803619385,+0.47666606307029724+],+"up": [+0.21733206510543823,+0.4242449998855591,+0.8790808916091919+],+"lens_mm": 24.0,+"fstop": 2.799999952316284,+"focus_cm": 954.8486232757568+}+]+}\ No newline at end of filediff --git a/unreal_demo/cams/s1_street_crane.json b/unreal_demo/cams/s1_street_crane.jsonnew file mode 100644index 0000000..fd6c9f2--- /dev/null+++ b/unreal_demo/cams/s1_street_crane.json@@ -0,0 +1,5750 @@+{+"shot": "s1_street_crane",+"fps": 24,+"frames_n": 120,+"res": [+1920,+804+],+"sensor_width_mm": 24.889999389648438,+"sensor_height_mm": 10.422687244415282,+"dof": true,+"seed": 0,+"shutter_deg": 180.0,+"frames": [+{+"blender_frame": 0,+"matrix_world": [+[+0.8943456411361694,+-0.022099921479821205,+0.4468306005001068,+5.59986686706543+],+[+0.4473767578601837,+0.04448337107896805,+-0.8932387232780457,+-11.00001049041748+],+[+-0.00013602514809463173,+0.9987657070159912,+0.0496704988181591,+3.3999171257019043+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+559.986686706543,+1100.001049041748,+339.99171257019043+],+"forward": [+-0.4468306005001068,+-0.8932387232780457,+-0.0496704988181591+],+"up": [+-0.022099921479821205,+-0.04448337107896805,+0.9987657070159912+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1390.128257125616+},+{+"blender_frame": 1,+"matrix_world": [+[+0.8943489789962769,+-0.02209782414138317,+0.44682401418685913,+5.599895477294922+],+[+0.44737008213996887,+0.04447467252612114,+-0.8932424783706665,+-10.999974250793457+],+[+-0.00013363584002945572,+0.9987661242485046,+0.0496617816388607,+3.3998970985412598+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+559.9895477294922,+1099.9974250793457,+339.989709854126+],+"forward": [+-0.44682401418685913,+-0.8932424783706665,+-0.0496617816388607+],+"up": [+-0.02209782414138317,+-0.04447467252612114,+0.9987661242485046+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1390.124387294054+},+{+"blender_frame": 2,+"matrix_world": [+[+0.8943555355072021,+-0.022103456780314445,+0.44681063294410706,+5.599700927734375+],+[+0.44735705852508545,+0.044466011226177216,+-0.8932494521141052,+-10.999329566955566+],+[+-0.00012398559192661196,+0.998766303062439,+0.04965656250715256,+3.3995778560638428+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+559.9700927734375,+1099.9329566955566,+339.9577856063843+],+"forward": [+-0.44681063294410706,+-0.8932494521141052,+-0.04965656250715256+],+"up": [+-0.022103458642959595,+-0.044466014951467514,+0.9987664222717285+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1390.0546200573444+},+{+"blender_frame": 3,+"matrix_world": [+[+0.894355058670044,+-0.0221056267619133,+0.4468115270137787,+5.599033355712891+],+[+0.44735801219940186,+0.044477447867393494,+-0.8932483792304993,+-10.9974365234375+],+[+-0.00012721933308057487,+0.9987658262252808,+0.049667757004499435,+3.3986093997955322+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+559.9033355712891,+1099.74365234375,+339.8609399795532+],+"forward": [+-0.4468115270137787,+-0.8932483792304993,+-0.049667757004499435+],+"up": [+-0.0221056267619133,+-0.044477447867393494,+0.9987658262252808+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1389.8525156080723+},+{+"blender_frame": 4,+"matrix_world": [+[+0.894352376461029,+-0.022104760631918907,+0.44681671261787415,+5.597871780395508+],+[+0.44736307859420776,+0.04450291022658348,+-0.8932445645332336,+-10.994282722473145+],+[+-0.0001396861916873604,+0.9987646341323853,+0.04969014227390289,+3.3969500064849854+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+559.7871780395508,+1099.4282722473145,+339.69500064849854+],+"forward": [+-0.44681671261787415,+-0.8932445645332336,+-0.04969014227390289+],+"up": [+-0.022104762494564056,+-0.04450291395187378,+0.9987647533416748+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1389.514123648405+},+{+"blender_frame": 5,+"matrix_world": [+[+0.8943467140197754,+-0.02211102843284607,+0.44682785868644714,+5.596252918243408+],+[+0.4473745822906494,+0.044499076902866364,+-0.8932390213012695,+-10.98987865447998+],+[+-0.00013299655984155834,+0.9987647533416748,+0.04968951642513275,+3.3946115970611572+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+559.6252918243408,+1098.987865447998,+339.4611597061157+],+"forward": [+-0.44682785868644714,+-0.8932390213012695,+-0.04968951642513275+],+"up": [+-0.02211102843284607,+-0.044499076902866364,+0.9987647533416748+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1389.0376538038254+},+{+"blender_frame": 6,+"matrix_world": [+[+0.8943299651145935,+-0.022121671587228775,+0.4468609094619751,+5.594202518463135+],+[+0.44740816950798035,+0.044456277042627335,+-0.89322429895401,+-10.984224319458008+],+[+-0.00010615700739435852,+0.9987664222717285,+0.04965599253773689,+3.391636610031128+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+559.4202518463135,+1098.4224319458008,+339.1636610031128+],+"forward": [+-0.4468609094619751,+-0.89322429895401,+-0.04965599253773689+],+"up": [+-0.022121671587228775,+-0.044456277042627335,+0.9987664222717285+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1388.4246543049812+},+{+"blender_frame": 7,+"matrix_world": [+[+0.8942958116531372,+-0.022132067009806633,+0.44692859053611755,+5.591748237609863+],+[+0.44747626781463623,+0.04440847411751747,+-0.8931924700737,+-10.977326393127441+],+[+-7.92196806287393e-05,+0.9987683296203613,+0.04961788281798363,+3.388033628463745+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+559.1748237609863,+1097.7326393127441,+338.8033628463745+],+"forward": [+-0.44692865014076233,+-0.8931925892829895,+-0.049617890268564224+],+"up": [+-0.022132067009806633,+-0.04440847411751747,+0.9987683296203613+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1387.6820966601372+},+{+"blender_frame": 8,+"matrix_world": [+[+0.8942492604255676,+-0.022124821320176125,+0.44702208042144775,+5.588863849639893+],+[+0.4475692808628082,+0.04436725005507469,+-0.8931479454040527,+-10.969213485717773+],+[+-7.24020428606309e-05,+0.9987702369689941,+0.04957776889204979,+3.3837499618530273+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+558.8863849639893,+1096.9213485717773,+338.37499618530273+],+"forward": [+-0.44702208042144775,+-0.8931479454040527,+-0.04957776889204979+],+"up": [+-0.022124823182821274,+-0.04436725378036499,+0.9987703561782837+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1386.81021630764+},+{+"blender_frame": 9,+"matrix_world": [+[+0.8942015171051025,+-0.02208572067320347,+0.4471196234226227,+5.585514068603516+],+[+0.4476648271083832,+0.04430830478668213,+-0.8931029438972473,+-10.95987606048584+],+[+-8.62886881805025e-05,+0.9987736940383911,+0.04950754716992378,+3.3787739276885986+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+558.5514068603516,+1095.987606048584,+337.87739276885986+],+"forward": [+-0.44711968302726746,+-0.8931030631065369,+-0.04950755462050438+],+"up": [+-0.022085722535848618,+-0.04430830851197243,+0.9987738132476807+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1385.801550745964+},+{+"blender_frame": 10,+"matrix_world": [+[+0.8941481113433838,+-0.02202608436346054,+0.44722938537597656,+5.581705570220947+],+[+0.44777145981788635,+0.04421098157763481,+-0.8930543661117554,+-10.949299812316895+],+[+-0.00010196046787314117,+0.9987793564796448,+0.04939381405711174,+3.373138666152954+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+558.1705570220947,+1094.9299812316895,+337.3138666152954+],+"forward": [+-0.44722944498062134,+-0.8930544853210449,+-0.04939382150769234+],+"up": [+-0.02202608622610569,+-0.04421098530292511,+0.9987794756889343+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1384.6538417041302+},+{+"blender_frame": 11,+"matrix_world": [+[+0.8940731883049011,+-0.021950650960206985,+0.44738268852233887,+5.5774407386779785+],+[+0.4479208290576935,+0.04407702386379242,+-0.8929861187934875,+-10.937512397766113+],+[+-0.00011767062096623704,+0.9987869262695312,+0.04924023896455765,+3.3668720722198486+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+557.7440738677979,+1093.7512397766113,+336.68720722198486+],+"forward": [+-0.44738268852233887,+-0.8929861187934875,+-0.04924023896455765+],+"up": [+-0.021950652822852135,+-0.04407702758908272,+0.9987870454788208+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1383.3730272948742+},+{+"blender_frame": 12,+"matrix_world": [+[+0.8939734697341919,+-0.0218751672655344,+0.4475857615470886,+5.572744846343994+],+[+0.4481200575828552,+0.04392414167523384,+-0.8928936719894409,+-10.924539566040039+],+[+-0.00012762361438944936,+0.9987953305244446,+0.049069713801145554,+3.3599441051483154+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+557.2744846343994,+1092.453956604004,+335.99441051483154+],+"forward": [+-0.4475858211517334,+-0.8928937911987305,+-0.04906972125172615+],+"up": [+-0.02187516912817955,+-0.04392414540052414,+0.9987954497337341+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1381.9664388895035+},+{+"blender_frame": 13,+"matrix_world": [+[+0.8938618898391724,+-0.021809736266732216,+0.44781172275543213,+5.567615509033203+],+[+0.4483424723148346,+0.04377755895256996,+-0.8927891850471497,+-10.910353660583496+],+[+-0.00013260765990708023,+0.9988031983375549,+0.048909321427345276,+3.3523595333099365+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+556.7615509033203,+1091.0353660583496,+335.23595333099365+],+"forward": [+-0.44781172275543213,+-0.8927891850471497,+-0.048909321427345276+],+"up": [+-0.021809738129377365,+-0.04377756267786026,+0.9988033175468445+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1380.4322749376297+},+{+"blender_frame": 14,+"matrix_world": [+[+0.8937463164329529,+-0.02174745686352253,+0.44804540276527405,+5.562049865722656+],+[+0.44857293367385864,+0.04363124072551727,+-0.8926805853843689,+-10.8949613571167+],+[+-0.00013524439418688416,+0.9988110065460205,+0.04875056818127632,+3.344116687774658+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+556.2049865722656,+1089.49613571167,+334.4116687774658+],+"forward": [+-0.4480454623699188,+-0.8926807045936584,+-0.04875057563185692+],+"up": [+-0.02174745686352253,+-0.04363124072551727,+0.9988110065460205+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1378.7689626216888+},+{+"blender_frame": 15,+"matrix_world": [+[+0.8936156034469604,+-0.021695567294955254,+0.4483085572719574,+5.5560455322265625+],+[+0.4488331973552704,+0.043463464826345444,+-0.8925579190254211,+-10.878401756286621+],+[+-0.00012049007636960596,+0.9988195300102234,+0.048577308654785156,+3.3352227210998535+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+555.6045532226562,+1087.840175628662,+333.52227210998535+],+"forward": [+-0.4483086168766022,+-0.8925580382347107,+-0.04857731610536575+],+"up": [+-0.021695565432310104,+-0.043463461101055145,+0.9988194108009338+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1376.979561150074+},+{+"blender_frame": 16,+"matrix_world": [+[+0.8934723734855652,+-0.021647073328495026,+0.44859617948532104,+5.549609661102295+],+[+0.44911816716194153,+0.04328009486198425,+-0.8924234509468079,+-10.860687255859375+],+[+-9.692522144177929e-05,+0.9988283514976501,+0.04839165881276131,+3.325709104537964+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+554.9609661102295,+1086.0687255859375,+332.5709104537964+],+"forward": [+-0.4485962390899658,+-0.8924235701560974,+-0.048391666263341904+],+"up": [+-0.021647075191140175,+-0.04328009858727455,+0.9988284707069397+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1375.0654205679893+},+{+"blender_frame": 17,+"matrix_world": [+[+0.893327534198761,+-0.021590132266283035,+0.44888755679130554,+5.542745113372803+],+[+0.4494065046310425,+0.04310326278209686,+-0.8922869563102722,+-10.841806411743164+],+[+-8.39254935272038e-05,+0.9988372921943665,+0.0482080802321434,+3.3155975341796875+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+554.2745113372803,+1084.1806411743164,+331.55975341796875+],+"forward": [+-0.44888755679130554,+-0.8922869563102722,+-0.0482080802321434+],+"up": [+-0.021590132266283035,+-0.04310326278209686,+0.9988372921943665+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1373.025931417942+},+{+"blender_frame": 18,+"matrix_world": [+[+0.8931819200515747,+-0.0215278472751379,+0.44918009638786316,+5.535507678985596+],+[+0.4496956467628479,+0.042933933436870575,+-0.8921494483947754,+-10.82177448272705+],+[+-7.901108619989827e-05,+0.9988460540771484,+0.048028793185949326,+3.3048665523529053+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+553.5507678985596,+1082.177448272705,+330.4866552352905+],+"forward": [+-0.4491800367832184,+-0.8921493291854858,+-0.04802878573536873+],+"up": [+-0.021527845412492752,+-0.042933929711580276,+0.9988459348678589+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1370.8650179207325+},+{+"blender_frame": 19,+"matrix_world": [+[+0.8930228352546692,+-0.021469706669449806,+0.4494990110397339,+5.527904033660889+],+[+0.4500114619731903,+0.042756613343954086,+-0.8919985890388489,+-10.800620079040527+],+[+-6.810494960518554e-05,+0.9988548159599304,+0.047844238579273224,+3.293511152267456+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+552.7904033660889,+1080.0620079040527,+329.3511152267456+],+"forward": [+-0.44949907064437866,+-0.8919987082481384,+-0.04784424602985382+],+"up": [+-0.021469706669449806,+-0.042756613343954086,+0.9988548159599304+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1368.5868300497532+},+{+"blender_frame": 20,+"matrix_world": [+[+0.8928478956222534,+-0.021417072042822838,+0.44984886050224304,+5.519918918609619+],+[+0.45035842061042786,+0.04253632575273514,+-0.891834020614624,+-10.778353691101074+],+[+-3.44441577908583e-05,+0.9988653659820557,+0.04762382060289383,+3.2815678119659424+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+551.9918918609619,+1077.8353691101074,+328.15678119659424+],+"forward": [+-0.4498489201068878,+-0.8918341398239136,+-0.047623828053474426+],+"up": [+-0.021417072042822838,+-0.04253632575273514,+0.9988653659820557+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1366.1878809332848+},+{+"blender_frame": 21,+"matrix_world": [+[+0.8926659226417542,+-0.021354522556066513,+0.45021289587020874,+5.511518478393555+],+[+0.45071908831596375,+0.04227013513445854,+-0.8916645646095276,+-10.754976272583008+],+[+1.051037270372035e-05,+0.998878002166748,+0.04735800251364708,+3.2690792083740234+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+551.1518478393555,+1075.4976272583008,+326.90792083740234+],+"forward": [+-0.45021289587020874,+-0.8916645646095276,+-0.04735800251364708+],+"up": [+-0.021354522556066513,+-0.04227013513445854,+0.998878002166748+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1363.6645175516605+},+{+"blender_frame": 22,+"matrix_world": [+[+0.8924798369407654,+-0.021272482350468636,+0.45058542490005493,+5.5026984214782715+],+[+0.45108720660209656,+0.04198623448610306,+-0.891491711139679,+-10.730500221252441+],+[+4.5856693759560585e-05,+0.9988917112350464,+0.047067612409591675,+3.2560465335845947+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+550.2698421478271,+1073.0500221252441,+325.6046533584595+],+"forward": [+-0.45058542490005493,+-0.891491711139679,+-0.047067612409591675+],+"up": [+-0.021272482350468636,+-0.04198623448610306,+0.9988917112350464+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1361.0199704766273+},+{+"blender_frame": 23,+"matrix_world": [+[+0.8922791481018066,+-0.021165061742067337,+0.45098796486854553,+5.493499755859375+],+[+0.45148441195487976,+0.041676416993141174,+-0.8913052082061768,+-10.70495319366455+],+[+6.896722334204242e-05,+0.9989069700241089,+0.04674268141388893,+3.2424442768096924+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+549.3499755859375,+1070.495319366455,+324.24442768096924+],+"forward": [+-0.45098796486854553,+-0.8913052082061768,+-0.04674268141388893+],+"up": [+-0.021165061742067337,+-0.041676416993141174,+0.9989069700241089+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1358.2593381404877+},+{+"blender_frame": 24,+"matrix_world": [+[+0.8920706510543823,+-0.021037014201283455,+0.4514060616493225,+5.48392391204834+],+[+0.45189598202705383,+0.04136866331100464,+-0.8911110162734985,+-10.67835807800293+],+[+7.224987348308787e-05,+0.9989224672317505,+0.04641031473875046,+3.228281021118164+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+548.392391204834,+1067.835807800293,+322.8281021118164+],+"forward": [+-0.4514060616493225,+-0.8911110162734985,+-0.04641031473875046+],+"up": [+-0.021037014201283455,+-0.04136866331100464,+0.9989224672317505+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1355.386908352375+},+{+"blender_frame": 25,+"matrix_world": [+[+0.8918691277503967,+-0.020909899845719337,+0.45180997252464294,+5.473991394042969+],+[+0.4522935748100281,+0.04107776656746864,+-0.8909226655960083,+-10.650711059570312+],+[+6.975785072427243e-05,+0.9989371299743652,+0.0460934080183506,+3.2135396003723145+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+547.3991394042969,+1065.0711059570312,+321.35396003723145+],+"forward": [+-0.45180997252464294,+-0.8909226655960083,+-0.0460934080183506+],+"up": [+-0.020909899845719337,+-0.04107776656746864,+0.9989371299743652+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1352.4031922221184+},+{+"blender_frame": 26,+"matrix_world": [+[+0.8916725516319275,+-0.020787270739674568,+0.45220354199409485,+5.46367883682251+],+[+0.4526810944080353,+0.04078514128923416,+-0.8907392621040344,+-10.622036933898926+],+[+7.285221363417804e-05,+0.9989516735076904,+0.04577699676156044,+3.198245048522949+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+546.367883682251,+1062.2036933898926,+319.8245048522949+],+"forward": [+-0.45220354199409485,+-0.8907392621040344,+-0.04577699676156044+],+"up": [+-0.020787272602319717,+-0.04078514501452446,+0.99895179271698+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1349.3082001805305+},+{+"blender_frame": 27,+"matrix_world": [+[+0.8914629220962524,+-0.020673297345638275,+0.4526219069957733,+5.452974796295166+],+[+0.4530937969684601,+0.040496669709682465,+-0.8905425071716309,+-10.59237003326416+],+[+8.077240636339411e-05,+0.998965859413147,+0.04546821117401123,+3.182410955429077+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+545.2974796295166,+1059.237003326416,+318.2410955429077+],+"forward": [+-0.4526219666004181,+-0.8905426263809204,+-0.04546821489930153+],+"up": [+-0.020673297345638275,+-0.040496669709682465,+0.998965859413147+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1346.1087264120579+},+{+"blender_frame": 28,+"matrix_world": [+[+0.8912400603294373,+-0.020557207986712456,+0.45306578278541565,+5.441886901855469+],+[+0.4535319209098816,+0.040203627198934555,+-0.8903327584266663,+-10.561745643615723+],+[+8.786829130258411e-05,+0.9989799857139587,+0.04515443369746208,+3.1660704612731934+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+544.1886901855469,+1056.1745643615723,+316.60704612731934+],+"forward": [+-0.4530658423900604,+-0.8903328776359558,+-0.04515443742275238+],+"up": [+-0.020557209849357605,+-0.040203630924224854,+0.9989801049232483+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1342.806687951088+},+{+"blender_frame": 29,+"matrix_world": [+[+0.8910197019577026,+-0.020419688895344734,+0.45350518822669983,+5.430468559265137+],+[+0.4539646804332733,+0.039897821843624115,+-0.8901259899139404,+-10.530189514160156+],+[+8.222937321988866e-05,+0.9989951252937317,+0.04481956362724304,+3.1492528915405273+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+543.0468559265137,+1053.0189514160156,+314.92528915405273+],+"forward": [+-0.45350518822669983,+-0.8901259899139404,+-0.04481956362724304+],+"up": [+-0.020419688895344734,+-0.039897821843624115,+0.9989951252937317+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1339.4024275243282+},+{+"blender_frame": 30,+"matrix_world": [+[+0.8908032774925232,+-0.020269712433218956,+0.45393693447113037,+5.418724536895752+],+[+0.4543892741203308,+0.039587631821632385,+-0.8899231553077698,+-10.497703552246094+],+[+6.819705595262349e-05,+0.9990105628967285,+0.04447512328624725,+3.1319334506988525+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+541.8724536895752,+1049.7703552246094,+313.19334506988525+],+"forward": [+-0.45393693447113037,+-0.8899231553077698,+-0.04447512328624725+],+"up": [+-0.020269712433218956,+-0.039587631821632385,+0.9990105628967285+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1335.897795110941+},+{+"blender_frame": 31,+"matrix_world": [+[+0.8905779123306274,+-0.020118897780776024,+0.4543856382369995,+5.406639575958252+],+[+0.4548307955265045,+0.03927729278802872,+-0.8897112607955933,+-10.46429443359375+],+[+5.297338429954834e-05,+0.999025821685791,+0.04413018003106117,+3.114093780517578+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+540.6639575958252,+1046.429443359375,+311.4093780517578+],+"forward": [+-0.4543856978416443,+-0.8897113800048828,+-0.04413018375635147+],+"up": [+-0.020118897780776024,+-0.03927729278802872,+0.999025821685791+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1332.2957247495651+},+{+"blender_frame": 32,+"matrix_world": [+[+0.8903312087059021,+-0.019977262243628502,+0.45487499237060547,+5.394216537475586+],+[+0.4553135335445404,+0.038955990225076675,+-0.8894785046577454,+-10.430018424987793+],+[+4.923805681755766e-05,+0.9990411996841431,+0.0437796488404274,+3.0957791805267334+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+539.4216537475586,+1043.0018424987793,+309.57791805267334+],+"forward": [+-0.45487505197525024,+-0.8894786238670349,+-0.0437796525657177+],+"up": [+-0.01997726410627365,+-0.038955993950366974,+0.9990413188934326+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1328.6029517650604+},+{+"blender_frame": 33,+"matrix_world": [+[+0.8900653719902039,+-0.01983995921909809,+0.45540088415145874,+5.381497383117676+],+[+0.455832839012146,+0.038620106875896454,+-0.8892272114753723,+-10.394916534423828+],+[+5.460045940708369e-05,+0.9990571141242981,+0.043418120592832565,+3.0770468711853027+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+538.1497383117676,+1039.4916534423828,+307.7046871185303+],+"forward": [+-0.45540088415145874,+-0.8892272114753723,+-0.043418120592832565+],+"up": [+-0.019839957356452942,+-0.038620103150606155,+0.9990569949150085+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1324.8243570327759+},+{+"blender_frame": 34,+"matrix_world": [+[+0.8897925019264221,+-0.01969141699373722,+0.4559403359889984,+5.368499755859375+],+[+0.45636534690856934,+0.03827551007270813,+-0.8889688849449158,+-10.35898494720459+],+[+5.3705432947026566e-05,+0.9990732073783875,+0.04304374009370804,+3.0578668117523193+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+536.8499755859375,+1035.898494720459,+305.78668117523193+],+"forward": [+-0.4559403359889984,+-0.8889688849449158,+-0.04304374009370804+],+"up": [+-0.01969141699373722,+-0.03827551007270813,+0.9990732073783875+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1320.958300679922+},+{+"blender_frame": 35,+"matrix_world": [+[+0.8895130753517151,+-0.01953136920928955,+0.456492155790329,+5.355228424072266+],+[+0.45690980553627014,+0.03792572394013405,+-0.8887041211128235,+-10.322239875793457+],+[+4.481276118895039e-05,+0.9990897178649902,+0.042659495025873184,+3.038236618041992+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+535.5228424072266,+1032.2239875793457,+303.8236618041992+],+"forward": [+-0.456492155790329,+-0.8887041211128235,+-0.042659495025873184+],+"up": [+-0.01953136920928955,+-0.03792572394013405,+0.9990897178649902+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1317.0067451894283+},+{+"blender_frame": 36,+"matrix_world": [+[+0.8892253637313843,+-0.01935661770403385,+0.457059770822525,+5.341685771942139+],+[+0.45746946334838867,+0.037559330463409424,+-0.8884317874908447,+-10.284719467163086+],+[+3.0176510335877538e-05,+0.9991068840026855,+0.0422537736594677,+3.0182206630706787+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+534.1685771942139,+1028.4719467163086,+301.82206630706787+],+"forward": [+-0.457059770822525,+-0.8884317874908447,+-0.0422537736594677+],+"up": [+-0.019356619566679,+-0.03755933418869972,+0.9991070032119751+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1312.9726514220238+},+{+"blender_frame": 37,+"matrix_world": [+[+0.8889211416244507,+-0.01917440816760063,+0.4576587677001953,+5.327879428863525+],+[+0.45806023478507996,+0.03716644272208214,+-0.8881438374519348,+-10.246435165405273+],+[+2.0086234144400805e-05,+0.9991251230239868,+0.04182107001543045,+2.9978315830230713+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+532.7879428863525,+1024.6435165405273,+299.78315830230713+],+"forward": [+-0.4576587677001953,+-0.8881438374519348,+-0.04182107001543045+],+"up": [+-0.01917440816760063,+-0.03716644272208214,+0.9991251230239868+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1308.8582061231136+},+{+"blender_frame": 38,+"matrix_world": [+[+0.8885993957519531,+-0.018993016332387924,+0.458290696144104,+5.3138298988342285+],+[+0.4586840867996216,+0.03675023466348648,+-0.887839138507843,+-10.20737361907959+],+[+2.0450615920708515e-05,+0.9991440176963806,+0.0413680300116539,+2.9770302772521973+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+531.3829898834229,+1020.737361907959,+297.7030277252197+],+"forward": [+-0.458290696144104,+-0.887839138507843,+-0.0413680300116539+],+"up": [+-0.018993016332387924,+-0.03675023466348648,+0.9991440176963806+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1304.6640321612358+},+{+"blender_frame": 39,+"matrix_world": [+[+0.8882633447647095,+-0.018810074776411057,+0.4589495360851288,+5.299533843994141+],+[+0.4593348205089569,+0.03631139174103737,+-0.8875207901000977,+-10.167601585388184+],+[+2.9235188776510768e-05,+0.9991633892059326,+0.04089420288801193,+2.955843210220337+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+529.9533843994141,+1016.7601585388184,+295.5843210220337+],+"forward": [+-0.458949476480484,+-0.8875206708908081,+-0.040894199162721634+],+"up": [+-0.018810076639056206,+-0.03631139546632767,+0.9991635084152222+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1300.3954753279686+},+{+"blender_frame": 40,+"matrix_world": [+[+0.8879275321960449,+-0.01863030344247818,+0.4596060514450073,+5.284977436065674+],+[+0.4599834680557251,+0.0358835868537426,+-0.8872022032737732,+-10.127189636230469+],+[+3.6531313526211306e-05,+0.9991822838783264,+0.040431659668684006,+2.9343221187591553+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+528.4977436065674,+1012.7189636230469,+293.4322118759155+],+"forward": [+-0.45960599184036255,+-0.8872020840644836,+-0.04043165594339371+],+"up": [+-0.01863030530512333,+-0.0358835905790329,+0.999182403087616+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1296.0595708340406+},+{+"blender_frame": 41,+"matrix_world": [+[+0.8875991702079773,+-0.018453458324074745,+0.4602470397949219,+5.270187854766846+],+[+0.4606168270111084,+0.03547056019306183,+-0.886890172958374,+-10.086127281188965+],+[+4.096863267477602e-05,+0.9992002844810486,+0.03998361527919769,+2.9124531745910645+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+527.0187854766846,+1008.6127281188965,+291.24531745910645+],+"forward": [+-0.4602469801902771,+-0.8868900537490845,+-0.039983611553907394+],+"up": [+-0.018453460186719894,+-0.03547056391835213,+0.9992004036903381+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1291.6558641940355+},+{+"blender_frame": 42,+"matrix_world": [+[+0.8872680068016052,+-0.018275147303938866,+0.4608921408653259,+5.255166530609131+],+[+0.46125438809394836,+0.03504312410950661,+-0.8865756392478943,+-10.044408798217773+],+[+5.1200640882598236e-05,+0.9992187023162842,+0.03952213004231453,+2.8902342319488525+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+525.5166530609131,+1004.4408798217773,+289.02342319488525+],+"forward": [+-0.4608922004699707,+-0.8865757584571838,+-0.03952213376760483+],+"up": [+-0.018275147303938866,+-0.03504312410950661,+0.9992187023162842+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1287.1827345341444+},+{+"blender_frame": 43,+"matrix_world": [+[+0.8869314789772034,+-0.01809515245258808,+0.4615465998649597,+5.239893436431885+],+[+0.4619012773036957,+0.034598469734191895,+-0.8862561583518982,+-10.002092361450195+],+[+6.81341698509641e-05,+0.9992374181747437,+0.03904463350772858,+2.867703676223755+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+523.9893436431885,+1000.2092361450195,+286.7703676223755+],+"forward": [+-0.4615466594696045,+-0.8862562775611877,+-0.039044637233018875+],+"up": [+-0.01809515431523323,+-0.03459847345948219,+0.9992375373840332+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1282.6445009559393+},+{+"blender_frame": 44,+"matrix_world": [+[+0.8865770101547241,+-0.017900904640555382,+0.46223461627960205,+5.224387168884277+],+[+0.4625810980796814,+0.034122493118047714,+-0.8859200477600098,+-9.959248542785645+],+[+8.617051935289055e-05,+0.9992572665214539,+0.038532841950654984,+2.8448848724365234+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+522.4387168884277,+995.9248542785645,+284.48848724365234+],+"forward": [+-0.4622346758842468,+-0.8859201669692993,+-0.03853284567594528+],+"up": [+-0.01790090650320053,+-0.03412249684333801,+0.9992573857307434+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1278.0493278056383+},+{+"blender_frame": 45,+"matrix_world": [+[+0.8862053155899048,+-0.017692791298031807,+0.46295464038848877,+5.208682537078857+],+[+0.46329259872436523,+0.033633481711149216,+-0.8855669498443604,+-9.915900230407715+],+[+9.737519576447085e-05,+0.9992777109146118,+0.0380031056702137,+2.821786642074585+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+520.8682537078857,+991.5900230407715,+282.1786642074585+],+"forward": [+-0.46295464038848877,+-0.8855669498443604,+-0.0380031056702137+],+"up": [+-0.017692789435386658,+-0.03363347798585892,+0.9992775917053223+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1273.4017353504896+},+{+"blender_frame": 46,+"matrix_world": [+[+0.8858271837234497,+-0.01748332940042019,+0.46368592977523804,+5.192826747894287+],+[+0.4640154540538788,+0.03316080942749977,+-0.8852062225341797,+-9.872075080871582+],+[+0.0001001516793621704,+0.9992971420288086,+0.037487275898456573,+2.798389196395874+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+519.2826747894287,+987.2075080871582,+279.8389196395874+],+"forward": [+-0.46368592977523804,+-0.8852062225341797,+-0.037487275898456573+],+"up": [+-0.01748332940042019,+-0.03316080942749977,+0.9992971420288086+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1268.7082283198833+},+{+"blender_frame": 47,+"matrix_world": [+[+0.8854426741600037,+-0.01728660613298416,+0.46442708373069763,+5.176811695098877+],+[+0.46474865078926086,+0.03271395340561867,+-0.8848381638526917,+-9.827778816223145+],+[+0.00010260120325256139,+0.9993153214454651,+0.037000253796577454,+2.774729013442993+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+517.6811695098877,+982.7778816223145,+277.4729013442993+],+"forward": [+-0.46442708373069763,+-0.8848381638526917,+-0.037000253796577454+],+"up": [+-0.01728660613298416,+-0.03271395340561867,+0.9993153214454651+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1263.9703422784805+},+{+"blender_frame": 48,+"matrix_world": [+[+0.8850511312484741,+-0.017092274501919746,+0.4651801288127899,+5.1606292724609375+],+[+0.4654940664768219,+0.032281067222356796,+-0.8844620585441589,+-9.783059120178223+],+[+0.00010095818288391456,+0.99933260679245,+0.036526743322610855,+2.7508420944213867+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+516.0629272460938,+978.3059120178223,+275.0842094421387+],+"forward": [+-0.4651801884174347,+-0.8844621777534485,+-0.036526747047901154+],+"up": [+-0.017092276364564896,+-0.032281070947647095,+0.9993327260017395+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1259.1906260699034+},+{+"blender_frame": 49,+"matrix_world": [+[+0.8846451640129089,+-0.01687309518456459,+0.46595942974090576,+5.144272327423096+],+[+0.4662647843360901,+0.03183165192604065,+-0.8840723633766174,+-9.737929344177246+],+[+8.477880328428e-05,+0.999350905418396,+0.03602704778313637,+2.7267696857452393+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+514.4272327423096,+973.7929344177246,+272.6769685745239+],+"forward": [+-0.46595942974090576,+-0.8840723633766174,+-0.03602704778313637+],+"up": [+-0.01687309332191944,+-0.03183164820075035,+0.9993507862091064+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1254.3675668537617+},+{+"blender_frame": 50,+"matrix_world": [+[+0.8842261433601379,+-0.016632525250315666,+0.4667627811431885,+5.127783298492432+],+[+0.46705910563468933,+0.0313672199845314,+-0.8836694955825806,+-9.692392349243164+],+[+5.6605760619277135e-05,+0.9993695020675659,+0.03550408408045769,+2.702514410018921+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+512.7783298492432,+969.2392349243164,+270.2514410018921+],+"forward": [+-0.46676284074783325,+-0.8836696147918701,+-0.035504087805747986+],+"up": [+-0.016632527112960815,+-0.0313672237098217,+0.9993696212768555+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1249.5037522166967+},+{+"blender_frame": 51,+"matrix_world": [+[+0.8838064074516296,+-0.016392935067415237,+0.46756574511528015,+5.1111907958984375+],+[+0.4678530693054199,+0.030904894694685936,+-0.8832657933235168,+-9.646506309509277+],+[+2.9250919396872632e-05,+0.9993878602981567,+0.03498343005776405,+2.678063154220581+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+511.11907958984375,+964.6506309509277,+267.8063154220581+],+"forward": [+-0.46756574511528015,+-0.8832657933235168,+-0.03498343005776405+],+"up": [+-0.016392936930060387,+-0.030904898419976234,+0.9993879795074463+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1244.605938717723+},+{+"blender_frame": 52,+"matrix_world": [+[+0.8833869099617004,+-0.016174951568245888,+0.468365341424942,+5.094480991363525+],+[+0.4686445891857147,+0.030437229201197624,+-0.8828623294830322,+-9.600332260131836+],+[+2.4510563889634795e-05,+0.9994059205055237,+0.0344681479036808,+2.6534509658813477+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+509.44809913635254,+960.0332260131836,+265.34509658813477+],+"forward": [+-0.468365341424942,+-0.8828623294830322,+-0.0344681479036808+],+"up": [+-0.01617494970560074,+-0.030437225475907326,+0.9994058012962341+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1239.6791283041239+},+{+"blender_frame": 53,+"matrix_world": [+[+0.8829604387283325,+-0.015966376289725304,+0.4691758155822754,+5.077662467956543+],+[+0.46944746375083923,+0.02995157800614834,+-0.8824522495269775,+-9.5538969039917+],+[+3.700986417243257e-05,+0.9994238018989563,+0.03394143283367157,+2.6286613941192627+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+507.7662467956543,+955.3896903991699,+262.86613941192627+],+"forward": [+-0.4691758155822754,+-0.8824522495269775,+-0.03394143283367157+],+"up": [+-0.015966376289725304,+-0.02995157800614834,+0.9994238018989563+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1234.7257394343615+},+{+"blender_frame": 54,+"matrix_world": [+[+0.8825270533561707,+-0.015743302181363106,+0.46999815106391907,+5.060764789581299+],+[+0.47026172280311584,+0.029445290565490723,+-0.8820356726646423,+-9.507187843322754+],+[+4.692270886152983e-05,+0.9994423985481262,+0.03338973596692085,+2.6037325859069824+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+506.0764789581299,+950.7187843322754,+260.37325859069824+],+"forward": [+-0.46999815106391907,+-0.8820356726646423,+-0.03338973596692085+],+"up": [+-0.015743302181363106,+-0.029445290565490723,+0.9994423985481262+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1229.7454304993153+},+{+"blender_frame": 55,+"matrix_world": [+[+0.8820974230766296,+-0.015509642660617828,+0.4708116948604584,+5.043796062469482+],+[+0.47106707096099854,+0.02892802469432354,+-0.8816229701042175,+-9.460256576538086+],+[+5.400475492933765e-05,+0.9994611740112305,+0.03282342106103897,+2.5787158012390137+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+504.37960624694824,+946.0256576538086,+257.87158012390137+],+"forward": [+-0.4708116948604584,+-0.8816229701042175,+-0.03282342106103897+],+"up": [+-0.015509642660617828,+-0.02892802469432354,+0.9994611740112305+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1224.7424714267254+},+{+"blender_frame": 56,+"matrix_world": [+[+0.8816707730293274,+-0.015270331874489784,+0.4716181457042694,+5.026789665222168+],+[+0.47186532616615295,+0.02841864712536335,+-0.8812125325202942,+-9.413153648376465+],+[+5.365742981666699e-05,+0.9994794726371765,+0.032261427491903305,+2.5536417961120605+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+502.6789665222168,+941.3153648376465,+255.36417961120605+],+"forward": [+-0.4716181457042694,+-0.8812125325202942,+-0.032261427491903305+],+"up": [+-0.015270331874489784,+-0.02841864712536335,+0.9994794726371765+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1219.7248734533787+},+{+"blender_frame": 57,+"matrix_world": [+[+0.8812364935874939,+-0.015034046955406666,+0.4724365472793579,+5.009764671325684+],+[+0.47267571091651917,+0.027905793860554695,+-0.8807945251464844,+-9.365899085998535+],+[+5.818960562464781e-05,+0.9994975328445435,+0.0316978320479393,+2.5284886360168457+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+500.97646713256836,+936.5899085998535,+252.84886360168457+],+"forward": [+-0.4724365472793579,+-0.8807945251464844,+-0.0316978320479393+],+"up": [+-0.015034046955406666,+-0.027905793860554695,+0.9994975328445435+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1214.6961200982332+},+{+"blender_frame": 58,+"matrix_world": [+[+0.8807907700538635,+-0.014799312688410282,+0.47327446937561035,+4.992696285247803+],+[+0.47350576519966125,+0.027374813333153725,+-0.880365252494812,+-9.318523406982422+],+[+7.299969001905993e-05,+0.9995156526565552,+0.03111904487013817,+2.503251075744629+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+499.2696285247803,+931.8523406982422,+250.3251075744629+],+"forward": [+-0.47327446937561035,+-0.880365252494812,+-0.03111904487013817+],+"up": [+-0.014799314551055431,+-0.027374817058444023,+0.9995157718658447+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1209.6573673188686+},+{+"blender_frame": 59,+"matrix_world": [+[+0.8803334832191467,+-0.014551645144820213,+0.474132239818573,+4.9755706787109375+],+[+0.4743555188179016,+0.02684611640870571,+-0.879923939704895,+-9.271066665649414+],+[+7.573200127808377e-05,+0.9995336532592773,+0.030536187812685966,+2.477966070175171+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+497.55706787109375,+927.1066665649414,+247.7966070175171+],+"forward": [+-0.4741322994232178,+-0.8799240589141846,+-0.030536191537976265+],+"up": [+-0.014551645144820213,+-0.02684611640870571,+0.9995336532592773+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1204.6126559376717+},+{+"blender_frame": 60,+"matrix_world": [+[+0.8798763751983643,+-0.01428337674587965,+0.4749879240989685,+4.958423614501953+],+[+0.47520267963409424,+0.02630016952753067,+-0.8794832825660706,+-9.223570823669434+],+[+6.972753908485174e-05,+0.9995520710945129,+0.02992839552462101,+2.4526729583740234+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+495.8423614501953,+922.3570823669434,+245.26729583740234+],+"forward": [+-0.4749879240989685,+-0.8794832825660706,+-0.02992839552462101+],+"up": [+-0.01428337674587965,+-0.02630016952753067,+0.9995520710945129+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1199.5640460401773+},+{+"blender_frame": 61,+"matrix_world": [+[+0.8794240355491638,+-0.014013183303177357,+0.4758327901363373,+4.941309928894043+],+[+0.4760390818119049,+0.025729849934577942,+-0.8790476322174072,+-9.176068305969238+],+[+7.51500265323557e-05,+0.9995707869529724,+0.029298268258571625,+2.427367925643921+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+494.1309928894043,+917.6068305969238,+242.7367925643921+],+"forward": [+-0.47583284974098206,+-0.8790477514266968,+-0.029298271983861923+],+"up": [+-0.014013183303177357,+-0.025729849934577942,+0.9995707869529724+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1194.5170162245631+},+{+"blender_frame": 62,+"matrix_world": [+[+0.8789654970169067,+-0.013754558749496937,+0.47668707370758057,+4.9242329597473145+],+[+0.47688552737236023,+0.025155844166874886,+-0.878605306148529,+-9.128576278686523+],+[+9.336248331237584e-05,+0.9995889067649841,+0.02867046371102333,+2.4020371437072754+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+492.42329597473145,+912.8576278686523,+240.20371437072754+],+"forward": [+-0.47668713331222534,+-0.8786054253578186,+-0.02867046743631363+],+"up": [+-0.013754558749496937,+-0.025155844166874886,+0.9995889067649841+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1189.4762666895986+},+{+"blender_frame": 63,+"matrix_world": [+[+0.8785014152526855,+-0.013511788100004196,+0.4775487184524536,+4.907166481018066+],+[+0.4777398407459259,+0.024590974673628807,+-0.8781570792198181,+-9.081114768981934+],+[+0.00012208384578116238,+0.9996062517166138,+0.028058325871825218,+2.3767035007476807+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+490.71664810180664,+908.1114768981934,+237.67035007476807+],+"forward": [+-0.4775487780570984,+-0.8781571984291077,+-0.028058329597115517+],+"up": [+-0.013511789962649345,+-0.024590978398919106,+0.9996063709259033+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1184.4432715326548+},+{+"blender_frame": 64,+"matrix_world": [+[+0.8780174851417542,+-0.013269753195345402,+0.47844454646110535,+4.8900980949401855+],+[+0.4786284863948822,+0.024034647271037102,+-0.8776885271072388,+-9.033724784851074+],+[+0.00014746430679224432,+0.9996231198310852,+0.02745412290096283,+2.3514280319213867+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+489.00980949401855,+903.3724784851074,+235.14280319213867+],+"forward": [+-0.47844454646110535,+-0.8776885271072388,+-0.02745412290096283+],+"up": [+-0.013269753195345402,+-0.024034647271037102,+0.9996231198310852+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1179.4224223122+},+{+"blender_frame": 65,+"matrix_world": [+[+0.8775151968002319,+-0.012998326681554317,+0.47937265038490295,+4.87306022644043+],+[+0.47954878211021423,+0.02346676029264927,+-0.877201497554779,+-8.986461639404297+],+[+0.00015282726963050663,+0.999640166759491,+0.02682577259838581,+2.3262228965759277+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+487.30602264404297,+898.6461639404297,+232.62228965759277+],+"forward": [+-0.4793725907802582,+-0.8772013783454895,+-0.026825768873095512+],+"up": [+-0.012998326681554317,+-0.02346676029264927,+0.999640166759491+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1174.4180051609874+},+{+"blender_frame": 66,+"matrix_world": [+[+0.8770132064819336,+-0.012701833620667458,+0.48029857873916626,+4.856058120727539+],+[+0.4804665148258209,+0.02288130484521389,+-0.8767146468162537,+-8.939361572265625+],+[+0.00014602528244722635,+0.9996574521064758,+0.02617001160979271,+2.3010663986206055+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+485.6058120727539,+893.9361572265625,+230.10663986206055+],+"forward": [+-0.4802985191345215,+-0.8767145276069641,+-0.02617000788450241+],+"up": [+-0.012701835483312607,+-0.02288130670785904,+0.9996575713157654+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1169.4309122860432+},+{+"blender_frame": 67,+"matrix_world": [+[+0.8765103220939636,+-0.012387114576995373,+0.4812238812446594,+4.839125156402588+],+[+0.4813832938671112,+0.02229277603328228,+-0.8762267231941223,+-8.892440795898438+],+[+0.0001261042052647099,+0.9996746778488159,+0.025502800941467285,+2.276010513305664+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+483.9125156402588,+889.2440795898438,+227.6010513305664+],+"forward": [+-0.4812238812446594,+-0.8762267231941223,+-0.025502800941467285+],+"up": [+-0.012387116439640522,+-0.02229277789592743,+0.9996747970581055+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1164.4655413925648+},+{+"blender_frame": 68,+"matrix_world": [+[+0.8760238885879517,+-0.01208442822098732,+0.4821162819862366,+4.822261810302734+],+[+0.48226767778396606,+0.02171940729022026,+-0.875754714012146,+-8.845715522766113+],+[+0.00011171381629537791,+0.9996911287307739,+0.02485465258359909,+2.25111722946167+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+482.22618103027344,+884.5715522766113,+225.111722946167+],+"forward": [+-0.4821162223815918,+-0.8757545948028564,+-0.024854648858308792+],+"up": [+-0.01208442822098732,+-0.02171940729022026,+0.9996911287307739+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1159.522682055831+},+{+"blender_frame": 69,+"matrix_world": [+[+0.8755555748939514,+-0.011810633353888988,+0.4829730689525604,+4.805459976196289+],+[+0.48311737179756165,+0.02115711383521557,+-0.8752999901771545,+-8.799260139465332+],+[+0.00011953144712606445,+0.9997064471244812,+0.024230150505900383,+2.2263805866241455+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+480.5459976196289,+879.9260139465332,+222.63805866241455+],+"forward": [+-0.4829730689525604,+-0.8752999901771545,+-0.024230150505900383+],+"up": [+-0.011810633353888988,+-0.02115711383521557,+0.9997064471244812+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1154.6088676899672+},+{+"blender_frame": 70,+"matrix_world": [+[+0.875086784362793,+-0.01154246460646391,+0.48382851481437683,+4.788737773895264+],+[+0.4839661717414856,+0.020588228479027748,+-0.874844491481781,+-8.75312328338623+],+[+0.00013668982137460262,+0.9997214078903198,+0.023602645844221115,+2.2017786502838135+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+478.87377738952637,+875.312328338623,+220.17786502838135+],+"forward": [+-0.48382851481437683,+-0.874844491481781,+-0.023602645844221115+],+"up": [+-0.01154246460646391,+-0.020588228479027748,+0.9997214078903198+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1149.7294764965773+},+{+"blender_frame": 71,+"matrix_world": [+[+0.8746078014373779,+-0.011276161298155785,+0.48469993472099304,+4.772145748138428+],+[+0.4848310351371765,+0.020016705617308617,+-0.8743787407875061,+-8.707268714904785+],+[+0.00015753868501633406,+0.9997360706329346,+0.02297379821538925,+2.177325487136841+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+477.2145748138428,+870.7268714904785,+217.73254871368408+],+"forward": [+-0.48469993472099304,+-0.8743787407875061,+-0.02297379821538925+],+"up": [+-0.011276161298155785,+-0.020016705617308617,+0.9997360706329346+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1144.885572977364+},+{+"blender_frame": 72,+"matrix_world": [+[+0.874113917350769,+-0.01098986342549324,+0.4855966866016388,+4.755680561065674+],+[+0.48572102189064026,+0.019443094730377197,+-0.8738976120948792,+-8.66171932220459+],+[+0.00016251395572908223,+0.9997506141662598,+0.022333484143018723,+2.1530673503875732+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+475.5680561065674,+866.171932220459,+215.30673503875732+],+"forward": [+-0.48559674620628357,+-0.8738977313041687,+-0.022333486005663872+],+"up": [+-0.01098986342549324,+-0.019443094730377197,+0.9997506141662598+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1140.0791980326176+},+{+"blender_frame": 73,+"matrix_world": [+[+0.8736175298690796,+-0.010681319050490856,+0.4864959716796875,+4.739312648773193+],+[+0.4866131544113159,+0.01887725479900837,+-0.8734135627746582,+-8.61655044555664+],+[+0.00014550024934578687,+0.9997647404670715,+0.021689172834157944,+2.129028558731079+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+473.93126487731934,+861.6550445556641,+212.9028558731079+],+"forward": [+-0.4864959716796875,+-0.8734135627746582,+-0.021689172834157944+],+"up": [+-0.010681319050490856,+-0.01887725479900837,+0.9997647404670715+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1135.3138314560056+},+{+"blender_frame": 74,+"matrix_world": [+[+0.8731262683868408,+-0.010373687371611595,+0.48738381266593933,+4.723097324371338+],+[+0.48749423027038574,+0.018330197781324387,+-0.8729338049888611,+-8.571805000305176+],+[+0.00012169974070275202,+0.999778151512146,+0.021061688661575317,+2.1051905155181885+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+472.3097324371338,+857.1805000305176,+210.51905155181885+],+"forward": [+-0.48738381266593933,+-0.8729338049888611,+-0.021061688661575317+],+"up": [+-0.010373687371611595,+-0.018330197781324387,+0.999778151512146+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1130.5964211001992+},+{+"blender_frame": 75,+"matrix_world": [+[+0.8726341724395752,+-0.010072018951177597,+0.48827072978019714,+4.707087516784668+],+[+0.48837459087371826,+0.017810117453336716,+-0.8724523186683655,+-8.527498245239258+],+[+9.119752212427557e-05,+0.9997906684875488,+0.02046063169836998,+2.081549644470215+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+470.7087516784668,+852.7498245239258,+208.15496444702148+],+"forward": [+-0.48827072978019714,+-0.8724523186683655,+-0.02046063169836998+],+"up": [+-0.010072018951177597,+-0.017810117453336716,+0.9997906684875488+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1125.9318424388766+},+{+"blender_frame": 76,+"matrix_world": [+[+0.8721339702606201,+-0.009772172197699547,+0.48916947841644287,+4.691276550292969+],+[+0.4892670810222626,+0.017299417406320572,+-0.8719623684883118,+-8.483641624450684+],+[+5.861952013219707e-05,+0.9998026490211487,+0.01986861042678356,+2.058148145675659+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+469.1276550292969,+848.3641624450684,+205.81481456756592+],+"forward": [+-0.48916953802108765,+-0.8719624876976013,+-0.01986861228942871+],+"up": [+-0.009772172197699547,+-0.017299417406320572,+0.9998026490211487+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1121.3206238113344+},+{+"blender_frame": 77,+"matrix_world": [+[+0.8716279864311218,+-0.009466557763516903,+0.49007657170295715,+4.675644874572754+],+[+0.4901680052280426,+0.016770588234066963,+-0.8714665770530701,+-8.440277099609375+],+[+3.0915573006495833e-05,+0.9998145699501038,+0.019257918000221252,+2.035040855407715+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+467.5644874572754,+844.0277099609375,+203.50408554077148+],+"forward": [+-0.49007663130760193,+-0.8714666962623596,+-0.0192579198628664+],+"up": [+-0.009466557763516903,+-0.016770588234066963,+0.9998145699501038+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1116.76403330639+},+{+"blender_frame": 78,+"matrix_world": [+[+0.8711268901824951,+-0.009158452972769737,+0.49097269773483276,+4.660196304321289+],+[+0.49105820059776306,+0.016228212043642998,+-0.8709756135940552,+-8.39747428894043+],+[+9.17996385396691e-06,+0.9998263716697693,+0.018634166568517685,+2.01224422454834+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+466.0196304321289,+839.747428894043,+201.22442245483398+],+"forward": [+-0.49097275733947754,+-0.8709757328033447,+-0.018634168431162834+],+"up": [+-0.009158452972769737,+-0.016228212043642998,+0.9998263716697693+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1112.2674560174346+},+{+"blender_frame": 79,+"matrix_world": [+[+0.8706308007240295,+-0.008867952972650528,+0.49185702204704285,+4.644964218139648+],+[+0.49193698167800903,+0.015701252967119217,+-0.8704891800880432,+-8.355247497558594+],+[+-3.314069090265548e-06,+0.9998373985290527,+0.018032468855381012,+1.98974609375+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+464.49642181396484,+835.5247497558594,+198.974609375+],+"forward": [+-0.4918570816516876,+-0.8704892992973328,+-0.01803247071802616+],+"up": [+-0.008867953903973103,+-0.015701254829764366,+0.9998375177383423+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1107.8349747695029+},+{+"blender_frame": 80,+"matrix_world": [+[+0.8701493740081787,+-0.008600556291639805,+0.49271318316459656,+4.629945278167725+],+[+0.49278828501701355,+0.015181213617324829,+-0.870016872882843,+-8.313610076904297+],+[+2.6448954031366156e-06,+0.9998477697372437,+0.017448173835873604,+1.9675705432891846+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+462.99452781677246,+831.3610076904297,+196.75705432891846+],+"forward": [+-0.49271318316459656,+-0.870016872882843,+-0.017448173835873604+],+"up": [+-0.008600556291639805,+-0.015181213617324829,+0.9998477697372437+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1103.466283902526+},+{+"blender_frame": 81,+"matrix_world": [+[+0.8696830868721008,+-0.008328786119818687,+0.49354037642478943,+4.615138053894043+],+[+0.493610680103302,+0.014633462764322758,+-0.8695598244667053,+-8.272570610046387+],+[+2.0172883523628116e-05,+0.9998582005500793,+0.016837650910019875,+1.9457101821899414+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+461.5138053894043,+827.2570610046387,+194.57101821899414+],+"forward": [+-0.4935404360294342,+-0.8695599436759949,+-0.016837652772665024+],+"up": [+-0.008328787051141262,+-0.014633464626967907,+0.9998583197593689+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1099.1604393348098+},+{+"blender_frame": 82,+"matrix_world": [+[+0.8692222833633423,+-0.008038260042667389,+0.4943561553955078,+4.600559234619141+],+[+0.49442148208618164,+0.014056773856282234,+-0.8691085577011108,+-8.232179641723633+],+[+3.7067740777274594e-05,+0.9998689293861389,+0.01619274914264679,+1.9241904020309448+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+460.05592346191406,+823.2179641723633,+192.41904020309448+],+"forward": [+-0.4943562150001526,+-0.8691086769104004,+-0.01619275100529194+],+"up": [+-0.008038260042667389,+-0.014056773856282234,+0.9998689293861389+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1094.9233677238226+},+{+"blender_frame": 83,+"matrix_world": [+[+0.8687579035758972,+-0.007737486157566309,+0.49517667293548584,+4.5862298011779785+],+[+0.4952371120452881,+0.013482670299708843,+-0.8686532974243164,+-8.192465782165527+],+[+4.488945342018269e-05,+0.9998791813850403,+0.015545067377388477,+1.9030296802520752+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+458.62298011779785,+819.2465782165527,+190.30296802520752+],+"forward": [+-0.49517667293548584,+-0.8686532974243164,+-0.015545067377388477+],+"up": [+-0.007737486157566309,+-0.013482670299708843,+0.9998791813850403+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1090.7609201967716+},+{+"blender_frame": 84,+"matrix_world": [+[+0.8682948350906372,+-0.007443158887326717,+0.4959924817085266,+4.572159290313721+],+[+0.49604833126068115,+0.012936235405504704,+-0.868198573589325,+-8.153446197509766+],+[+4.586431896314025e-05,+0.9998887181282043,+0.014924632385373116,+1.8822563886642456+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+457.21592903137207,+815.3446197509766,+188.22563886642456+],+"forward": [+-0.4959924817085266,+-0.868198573589325,+-0.014924632385373116+],+"up": [+-0.007443157956004143,+-0.012936233542859554,+0.9998885989189148+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1086.6753221023828+},+{+"blender_frame": 85,+"matrix_world": [+[+0.8678495287895203,+-0.0071679046377539635,+0.4967755377292633,+4.5583271980285645+],+[+0.49682721495628357,+0.012411201372742653,+-0.8677607774734497,+-8.115147590637207+],+[+5.444495764095336e-05,+0.9998973608016968,+0.01433226466178894,+1.8618841171264648+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+455.83271980285645,+811.5147590637207,+186.18841171264648+],+"forward": [+-0.4967755377292633,+-0.8677607774734497,+-0.01433226466178894+],+"up": [+-0.0071679046377539635,+-0.012411201372742653,+0.9998973608016968+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1082.6661025639623+},+{+"blender_frame": 86,+"matrix_world": [+[+0.8674200177192688,+-0.006899912841618061,+0.49752891063690186,+4.544735908508301+],+[+0.4975767731666565,+0.01189112663269043,+-0.8673384785652161,+-8.077613830566406+],+[+6.83808175381273e-05,+0.999905526638031,+0.013747837394475937,+1.8418971300125122+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+454.4735908508301,+807.7613830566406,+184.18971300125122+],+"forward": [+-0.49752891063690186,+-0.8673384785652161,+-0.013747837394475937+],+"up": [+-0.006899912841618061,+-0.01189112663269043,+0.999905526638031+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1078.7364230956882+},+{+"blender_frame": 87,+"matrix_world": [+[+0.8669979572296143,+-0.006625842768698931,+0.49826762080192566,+4.531414985656738+],+[+0.4983116686344147,+0.011375929228961468,+-0.8669232726097107,+-8.040889739990234+],+[+7.584000559290871e-05,+0.9999133348464966,+0.01316464226692915,+1.8222891092300415+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+453.1414985656738,+804.0889739990234,+182.22891092300415+],+"forward": [+-0.49826768040657043,+-0.8669233918190002,+-0.013164644129574299+],+"up": [+-0.006625842768698931,+-0.011375929228961468,+0.9999133348464966+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1074.8924097046256+},+{+"blender_frame": 88,+"matrix_world": [+[+0.8665631413459778,+-0.006339165847748518,+0.49902716279029846,+4.518391132354736+],+[+0.49906742572784424,+0.010877585969865322,+-0.86649489402771,+-8.004956245422363+],+[+6.464357284130529e-05,+0.9999208450317383,+0.012589785270392895,+1.8031049966812134+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+451.83911323547363,+800.4956245422363,+180.31049966812134+],+"forward": [+-0.49902716279029846,+-0.86649489402771,+-0.012589785270392895+],+"up": [+-0.006339164916425943,+-0.010877585038542747,+0.9999207258224487+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1071.135881356895+},+{+"blender_frame": 89,+"matrix_world": [+[+0.8661123514175415,+-0.0060564074665308,+0.4998125731945038,+4.505660533905029+],+[+0.49984925985336304,+0.010414067655801773,+-0.8660497069358826,+-7.969827175140381+],+[+4.00673525291495e-05,+0.9999274611473083,+0.01204704400151968,+1.78438138961792+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+450.56605339050293,+796.9827175140381,+178.438138961792+],+"forward": [+-0.49981263279914856,+-0.8660498261451721,+-0.01204704586416483+],+"up": [+-0.0060564074665308,+-0.010414067655801773,+0.9999274611473083+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1067.4690579995513+},+{+"blender_frame": 90,+"matrix_world": [+[+0.865662693977356,+-0.005790992174297571,+0.500594437122345,+4.493232727050781+],+[+0.5006279945373535,+0.009977770037949085,+-0.8656051158905029,+-7.935549259185791+],+[+1.789616362657398e-05,+0.9999335408210754,+0.011536515317857265,+1.7660925388336182+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+449.3232727050781,+793.5549259185791,+176.60925388336182+],+"forward": [+-0.500594437122345,+-0.8656051158905029,+-0.011536515317857265+],+"up": [+-0.005790992174297571,+-0.009977770037949085,+0.9999335408210754+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1063.8940420001745+},+{+"blender_frame": 91,+"matrix_world": [+[+0.8652211427688599,+-0.005526453722268343,+0.5013601779937744,+4.48112678527832+],+[+0.5013906359672546,+0.009566920809447765,+-0.8651680946350098,+-7.902174949645996+],+[+-1.516141855972819e-05,+0.9999390244483948,+0.011048413813114166,+1.7482432126998901+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+448.11267852783203,+790.2174949645996,+174.824321269989+],+"forward": [+-0.5013602375984192,+-0.8651682138442993,+-0.011048414744436741+],+"up": [+-0.005526453722268343,+-0.009566920809447765,+0.9999390244483948+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1060.415380820632+},+{+"blender_frame": 92,+"matrix_world": [+[+0.8647919297218323,+-0.005263776984065771,+0.5021029114723206,+4.4693779945373535+],+[+0.5021305680274963,+0.009150766767561436,+-0.8647434711456299,+-7.869734287261963+],+[+-4.280975917936303e-05,+0.9999443292617798,+0.01055661030113697,+1.7308989763259888+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+446.93779945373535,+786.9734287261963,+173.08989763259888+],+"forward": [+-0.5021029114723206,+-0.8647434711456299,+-0.01055661030113697+],+"up": [+-0.005263776984065771,+-0.009150766767561436,+0.9999443292617798+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1057.0358854485676+},+{+"blender_frame": 93,+"matrix_world": [+[+0.8643640279769897,+-0.005014676135033369,+0.5028415322303772,+4.457982540130615+],+[+0.5028665065765381,+0.008705511689186096,+-0.8643203377723694,+-7.838223934173584+],+[+-4.320603693486191e-05,+0.9999495148658752,+0.01004644576460123,+1.7140772342681885+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+445.7982540130615,+783.8223934173584,+171.40772342681885+],+"forward": [+-0.5028414726257324,+-0.8643202185630798,+-0.010046444833278656+],+"up": [+-0.005014676600694656,+-0.00870551262050867,+0.9999496340751648+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1053.7563929101452+},+{+"blender_frame": 94,+"matrix_world": [+[+0.8639341592788696,+-0.0047813905403018,+0.5035820603370667,+4.446931838989258+],+[+0.5036047697067261,+0.008251442573964596,+-0.8638947606086731,+-7.807681083679199+],+[+-2.466032856318634e-05,+0.9999545812606812,+0.009536633267998695,+1.6977516412734985+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+444.6931838989258,+780.7681083679199,+169.77516412734985+],+"forward": [+-0.5035820603370667,+-0.8638947606086731,+-0.009536633267998695+],+"up": [+-0.0047813905403018,+-0.008251442573964596,+0.9999545812606812+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1050.5800945684314+},+{+"blender_frame": 95,+"matrix_world": [+[+0.8635132312774658,+-0.004574916325509548,+0.504305362701416,+4.436202526092529+],+[+0.5043261647224426,+0.007819745689630508,+-0.863477885723114,+-7.7780961990356445+],+[+6.7990417846885975e-06,+0.9999590516090393,+0.009059702046215534,+1.6818903684616089+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+443.62025260925293,+777.8096199035645,+168.1890368461609+],+"forward": [+-0.504305362701416,+-0.863477885723114,+-0.009059702046215534+],+"up": [+-0.004574915859848261,+-0.007819744758307934,+0.9999589323997498+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1047.5043199956417+},+{+"blender_frame": 96,+"matrix_world": [+[+0.8631122708320618,+-0.004375925753265619,+0.5049931406974792,+4.425830364227295+],+[+0.5050120949745178,+0.007415898144245148,+-0.8630803823471069,+-7.749464988708496+],+[+3.1797982956049964e-05,+0.9999629855155945,+0.008610647171735764,+1.6665449142456055+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+442.5830364227295,+774.9464988708496,+166.65449142456055+],+"forward": [+-0.5049931406974792,+-0.8630803823471069,+-0.008610647171735764+],+"up": [+-0.004375925753265619,+-0.007415898144245148,+0.9999629855155945+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1044.5291864685714+},+{+"blender_frame": 97,+"matrix_world": [+[+0.8627312779426575,+-0.004155389033257961,+0.5056455731391907,+4.415836334228516+],+[+0.5056626796722412,+0.007012375630438328,+-0.8627027273178101,+-7.721839427947998+],+[+3.908904182026163e-05,+0.9999668598175049,+0.008151020854711533,+1.6517431735992432+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+441.58363342285156,+772.1839427947998,+165.17431735992432+],+"forward": [+-0.5056456327438354,+-0.8627028465270996,+-0.008151021786034107+],+"up": [+-0.004155389033257961,+-0.007012375630438328,+0.9999668598175049+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1041.6595593094826+},+{+"blender_frame": 98,+"matrix_world": [+[+0.8623638153076172,+-0.00392540916800499,+0.5062738656997681,+4.406255722045898+],+[+0.5062890648841858,+0.00660629803314805,+-0.8623384833335876,+-7.695255279541016+],+[+4.0435541450278834e-05,+0.999970555305481,+0.0076844231225550175,+1.6375327110290527+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+440.62557220458984,+769.5255279541016,+163.75327110290527+],+"forward": [+-0.5062739253044128,+-0.8623386025428772,+-0.007684424053877592+],+"up": [+-0.00392540916800499,+-0.00660629803314805,+0.999970555305481+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1038.9008253230713+},+{+"blender_frame": 99,+"matrix_world": [+[+0.8620042204856873,+-0.0037089965771883726,+0.5068874955177307,+4.397079944610596+],+[+0.5069011449813843,+0.006236569955945015,+-0.8619816303253174,+-7.6697282791137695+],+[+3.5847224353346974e-05,+0.999973714351654,+0.007256043143570423,+1.623934268951416+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+439.70799446105957,+766.972827911377,+162.3934268951416+],+"forward": [+-0.5068875551223755,+-0.8619817495346069,+-0.007256044074892998+],+"up": [+-0.0037089965771883726,+-0.006236569955945015,+0.999973714351654+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1036.2551028374583+},+{+"blender_frame": 100,+"matrix_world": [+[+0.8616596460342407,+-0.0035151655320078135,+0.5074745416641235,+4.388275623321533+],+[+0.5074867606163025,+0.005896265152841806,+-0.8616394400596619,+-7.645268440246582+],+[+3.660083530121483e-05,+0.9999765157699585,+0.006864472292363644,+1.6109137535095215+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+438.8275623321533,+764.5268440246582,+161.09137535095215+],+"forward": [+-0.5074745416641235,+-0.8616394400596619,+-0.006864472292363644+],+"up": [+-0.0035151655320078135,+-0.005896265152841806,+0.9999765157699585+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1033.7206974625587+},+{+"blender_frame": 101,+"matrix_world": [+[+0.8613442182540894,+-0.003328863298520446,+0.508010983467102,+4.3798441886901855+],+[+0.5080219507217407,+0.005560756660997868,+-0.8613261580467224,+-7.621882915496826+],+[+4.231150523992255e-05,+0.9999790787696838,+0.006480860523879528,+1.5984680652618408+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+437.98441886901855,+762.1882915496826,+159.84680652618408+],+"forward": [+-0.5080110430717468,+-0.861326277256012,+-0.006480861455202103+],+"up": [+-0.003328863298520446,+-0.005560756660997868,+0.9999790787696838+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1031.2964415294118+},+{+"blender_frame": 102,+"matrix_world": [+[+0.8610554933547974,+-0.0031342334114015102,+0.5085014700889587,+4.3717756271362305+],+[+0.5085111260414124,+0.00522919325158,+-0.8610395789146423,+-7.599599838256836+],+[+3.964691131841391e-05,+0.9999814629554749,+0.0060964180156588554,+1.5865757465362549+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+437.17756271362305,+759.9599838256836,+158.6575746536255+],+"forward": [+-0.5085014700889587,+-0.8610395789146423,+-0.0060964180156588554+],+"up": [+-0.0031342334114015102,+-0.00522919325158,+0.9999814629554749+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1028.9839693461545+},+{+"blender_frame": 103,+"matrix_world": [+[+0.8607850074768066,+-0.002926546148955822,+0.5089601874351501,+4.364111423492432+],+[+0.5089686512947083,+0.004917066544294357,+-0.8607709407806396,+-7.578451156616211+],+[+1.6494455849169753e-05,+0.9999837279319763,+0.005722057539969683,+1.5752766132354736+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+436.41114234924316,+757.8451156616211,+157.52766132354736+],+"forward": [+-0.5089602470397949,+-0.8607710599899292,+-0.00572205800563097+],+"up": [+-0.0029265459161251783,+-0.00491706607863307,+0.9999836087226868+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1026.7892753588967+},+{+"blender_frame": 104,+"matrix_world": [+[+0.8605127930641174,+-0.002728344639763236,+0.5094215273857117,+4.356863498687744+],+[+0.5094287991523743,+0.004643199034035206,+-0.8605002760887146,+-7.558449745178223+],+[+-1.760416489560157e-05,+0.9999856352806091,+0.005385429132729769,+1.564592957496643+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+435.6863498687744,+755.8449745178223,+156.4592957496643+],+"forward": [+-0.5094215273857117,+-0.8605002760887146,+-0.005385429132729769+],+"up": [+-0.0027283444069325924,+-0.0046431985683739185,+0.9999855160713196+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1024.7162544052117+},+{+"blender_frame": 105,+"matrix_world": [+[+0.8602356910705566,+-0.002563497982919216,+0.5098902583122253,+4.350033760070801+],+[+0.5098966360092163,+0.004391262773424387,+-0.8602245450019836,+-7.5396013259887695+],+[+-3.3878004614962265e-05,+0.9999871850013733,+0.005084639880806208,+1.5545244216918945+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+435.0033760070801,+753.960132598877,+155.45244216918945+],+"forward": [+-0.5098902583122253,+-0.8602245450019836,+-0.005084639880806208+],+"up": [+-0.0025634977500885725,+-0.0043912623077631,+0.9999870657920837+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1022.7657430048566+},+{+"blender_frame": 106,+"matrix_world": [+[+0.8599709868431091,+-0.0024199080653488636,+0.5103372931480408,+4.343622207641602+],+[+0.510343074798584,+0.00413398677483201,+-0.8599609732627869,+-7.521887302398682+],+[+-2.870103344321251e-05,+0.9999885559082031,+0.004790090955793858,+1.5450475215911865+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+434.36222076416016,+752.1887302398682,+154.50475215911865+],+"forward": [+-0.5103372931480408,+-0.8599609732627869,+-0.004790090955793858+],+"up": [+-0.0024199080653488636,+-0.00413398677483201,+0.9999885559082031+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1020.9336081577931+},+{+"blender_frame": 107,+"matrix_world": [+[+0.8597281575202942,+-0.0022905946243554354,+0.5107468366622925,+4.337640285491943+],+[+0.5107519626617432,+0.0038788416422903538,+-0.859719455242157,+-7.505324363708496+],+[+-1.1837277270387858e-05,+0.9999898672103882,+0.0045046755112707615,+1.5361626148223877+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+433.76402854919434,+750.5324363708496,+153.61626148223877+],+"forward": [+-0.5107468366622925,+-0.859719455242157,+-0.0045046755112707615+],+"up": [+-0.0022905946243554354,+-0.0038788416422903538,+0.9999898672103882+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1019.2212975991424+},+{+"blender_frame": 108,+"matrix_world": [+[+0.8595054745674133,+-0.0021471704822033644,+0.5111221075057983,+4.332113742828369+],+[+0.5111265778541565,+0.0036179102025926113,+-0.8594978451728821,+-7.489934921264648+],+[+-3.7055829125165474e-06,+0.999991238117218,+0.004207089077681303,+1.5278900861740112+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+433.2113742828369,+748.9934921264648,+152.78900861740112+],+"forward": [+-0.5111221075057983,+-0.8594978451728821,+-0.004207089077681303+],+"up": [+-0.0021471704822033644,+-0.0036179102025926113,+0.999991238117218+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1017.6316672470421+},+{+"blender_frame": 109,+"matrix_world": [+[+0.8592860102653503,+-0.0019899148028343916,+0.5114916563034058,+4.327062129974365+],+[+0.5114954113960266,+0.0033628500532358885,+-0.859279453754425,+-7.4757537841796875+],+[+-1.0176825526286848e-05,+0.9999924302101135,+0.003907482139766216,+1.5202810764312744+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+432.7062129974365,+747.5753784179688,+152.02810764312744+],+"forward": [+-0.5114916563034058,+-0.859279453754425,+-0.003907482139766216+],+"up": [+-0.0019899148028343916,+-0.0033628500532358885,+0.9999924302101135+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1016.1706282407977+},+{+"blender_frame": 110,+"matrix_world": [+[+0.8590699434280396,+-0.0018482038285583258,+0.5118548274040222,+4.322437286376953+],+[+0.5118581652641296,+0.00313210510648787,+-0.8590642809867859,+-7.462771892547607+],+[+-1.5457215340575203e-05,+0.9999933838844299,+0.003636715468019247,+1.513331413269043+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+432.2437286376953,+746.2771892547607,+151.3331413269043+],+"forward": [+-0.5118548274040222,+-0.8590642809867859,+-0.003636715468019247+],+"up": [+-0.0018482038285583258,+-0.00313210510648787,+0.9999933838844299+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1014.8349213588517+},+{+"blender_frame": 111,+"matrix_world": [+[+0.8588811755180359,+-0.001715631689876318,+0.5121720433235168,+4.318222522735596+],+[+0.5121749639511108,+0.002922539599239826,+-0.8588762283325195,+-7.450985908508301+],+[+-2.3327935195993632e-05,+0.9999942779541016,+0.0033888176549226046,+1.5070141553878784+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+431.82225227355957,+745.0985908508301,+150.70141553878784+],+"forward": [+-0.5121720433235168,+-0.8588762283325195,+-0.0033888176549226046+],+"up": [+-0.001715631689876318,+-0.002922539599239826,+0.9999942779541016+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1013.6209981632419+},+{+"blender_frame": 112,+"matrix_world": [+[+0.8587200045585632,+-0.0016249639447778463,+0.5124424695968628,+4.3144145011901855+],+[+0.5124450325965881,+0.0027528826612979174,+-0.8587156534194946,+-7.44041109085083+],+[+-1.531188900116831e-05,+0.9999949336051941,+0.003196659730747342,+1.5013312101364136+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+431.44145011901855,+744.041109085083,+150.13312101364136+],+"forward": [+-0.5124424695968628,+-0.8587156534194946,+-0.003196659730747342+],+"up": [+-0.0016249639447778463,+-0.0027528826612979174,+0.9999949336051941+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1012.5301033287542+},+{+"blender_frame": 113,+"matrix_world": [+[+0.8585694432258606,+-0.0015830404590815306,+0.5126948952674866,+4.31104850769043+],+[+0.5126973986625671,+0.002624821849167347,+-0.8585653901100159,+-7.43107795715332+],+[+1.341095230600331e-05,+0.9999953508377075,+0.003065211931243539,+1.496337890625+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+431.10485076904297,+743.107795715332,+149.6337890625+],+"forward": [+-0.5126948952674866,+-0.8585653901100159,+-0.003065211931243539+],+"up": [+-0.0015830404590815306,+-0.002624821849167347,+0.9999953508377075+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1011.5682974283118+},+{+"blender_frame": 114,+"matrix_world": [+[+0.8584291934967041,+-0.0015568106900900602,+0.5129297375679016,+4.308136463165283+],+[+0.5129321217536926,+0.0025221246760338545,+-0.8584255576133728,+-7.422991752624512+],+[+4.273317972547375e-05,+0.9999956488609314,+0.002963603939861059,+1.4920403957366943+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+430.8136463165283,+742.2991752624512,+149.20403957366943+],+"forward": [+-0.5129297375679016,+-0.8584255576133728,+-0.002963603939861059+],+"up": [+-0.0015568106900900602,+-0.0025221246760338545,+0.9999956488609314+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1010.7363721355796+},+{+"blender_frame": 115,+"matrix_world": [+[+0.8583242297172546,+-0.0015405718004330993,+0.5131052136421204,+4.3056535720825195+],+[+0.5131075978279114,+0.0024567064829170704,+-0.8583207726478577,+-7.416133403778076+],+[+6.175565795274451e-05,+0.999995768070221,+0.002899129642173648,+1.4883956909179688+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+430.56535720825195,+741.6133403778076,+148.83956909179688+],+"forward": [+-0.5131052732467651,+-0.8583208918571472,+-0.0028991298750042915+],+"up": [+-0.001540572033263743,+-0.002456706715747714,+0.9999958872795105+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1010.0290269154357+},+{+"blender_frame": 116,+"matrix_world": [+[+0.8582544326782227,+-0.0015138881281018257,+0.5132220387458801,+4.303583145141602+],+[+0.5132243633270264,+0.002405978972092271,+-0.8582510352134705,+-7.4105224609375+],+[+6.44944520900026e-05,+0.9999960660934448,+0.0028419061563909054,+1.48537278175354+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+430.35831451416016,+741.05224609375,+148.537278175354+],+"forward": [+-0.5132220983505249,+-0.85825115442276,+-0.002841906389221549+],+"up": [+-0.001513887895271182,+-0.002405978739261627,+0.9999959468841553+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1009.4465882400982+},+{+"blender_frame": 117,+"matrix_world": [+[+0.8582000732421875,+-0.0014797374606132507,+0.5133134722709656,+4.301952362060547+],+[+0.5133156776428223,+0.0023483680561184883,+-0.8581966757774353,+-7.4061808586120605+],+[+6.445682811317965e-05,+0.9999961256980896,+0.002774941734969616,+1.483005166053772+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+430.1952362060547,+740.618085861206,+148.3005166053772+],+"forward": [+-0.5133135318756104,+-0.8581967949867249,+-0.0027749419678002596+],+"up": [+-0.0014797376934438944,+-0.002348368288949132,+0.9999962449073792+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1008.9946530642919+},+{+"blender_frame": 118,+"matrix_world": [+[+0.8581550717353821,+-0.0014570091152563691,+0.513388454914093,+4.300775051116943+],+[+0.5133906602859497,+0.0022972128354012966,+-0.858151912689209,+-7.403076648712158+],+[+7.097263733157888e-05,+0.9999963641166687,+0.0027193790301680565,+1.4812885522842407+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+430.07750511169434,+740.3076648712158,+148.12885522842407+],+"forward": [+-0.5133885145187378,+-0.8581520318984985,+-0.0027193792629987+],+"up": [+-0.0014570091152563691,+-0.0022972128354012966,+0.9999963641166687+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1008.6711208728957+},+{+"blender_frame": 119,+"matrix_world": [+[+0.8581310510635376,+-0.0014399760402739048,+0.513428807258606,+4.300042629241943+],+[+0.5134308934211731,+0.0022657604422420263,+-0.8581278920173645,+-7.401186466217041+],+[+7.237694080686197e-05,+0.9999964237213135,+0.0026836469769477844,+1.4802442789077759+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+430.00426292419434,+740.1186466217041,+148.0244278907776+],+"forward": [+-0.5134288668632507,+-0.858128011226654,+-0.002683647209778428+],+"up": [+-0.0014399760402739048,+-0.0022657604422420263,+0.9999964237213135+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1008.4731634255149+},+{+"blender_frame": 120,+"matrix_world": [+[+0.8581386804580688,+-0.0014298059977591038,+0.5134159922599792,+4.29973840713501+],+[+0.5134179592132568,+0.002244737232103944,+-0.8581358194351196,+-7.400561332702637+],+[+7.448378164554015e-05,+0.9999964833259583,+0.0026603839360177517,+1.4798954725265503+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+429.973840713501,+740.0561332702637,+147.98954725265503+],+"forward": [+-0.5134159922599792,+-0.8581358194351196,+-0.0026603839360177517+],+"up": [+-0.0014298059977591038,+-0.002244737232103944,+0.9999964833259583+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1008.403027310851+},+{+"blender_frame": 121,+"matrix_world": [+[+0.8581632375717163,+-0.0014210294466465712,+0.513374924659729,+4.299649715423584+],+[+0.5133768320083618,+0.002212952822446823,+-0.8581604361534119,+-7.400585651397705+],+[+8.339677151525393e-05,+0.9999966025352478,+0.0026285983622074127,+1.4798834323883057+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+429.9649715423584,+740.0585651397705,+147.98834323883057+],+"forward": [+-0.513374924659729,+-0.8581604361534119,+-0.0026285983622074127+],+"up": [+-0.0014210294466465712,+-0.002212952822446823,+0.9999966025352478+],+"lens_mm": 32.0,+"fstop": 4.0,+"focus_cm": 1008.3979302959051+}+]+}\ No newline at end of filediff --git a/unreal_demo/cams/s2_teapot_wok_rack.json b/unreal_demo/cams/s2_teapot_wok_rack.jsonnew file mode 100644index 0000000..9f4400a--- /dev/null+++ b/unreal_demo/cams/s2_teapot_wok_rack.json@@ -0,0 +1,6878 @@+{+"shot": "s2_teapot_wok_rack",+"fps": 24,+"frames_n": 144,+"res": [+1920,+804+],+"sensor_width_mm": 24.889999389648438,+"sensor_height_mm": 10.422687244415282,+"dof": true,+"seed": 0,+"shutter_deg": 180.0,+"frames": [+{+"blender_frame": 0,+"matrix_world": [+[+0.7978360056877136,+-0.07873839139938354,+0.5977106094360352,+0.37968820333480835+],+[+0.6028743982315063,+0.1048198789358139,+-0.7909204363822937,+-1.4200986623764038+],+[+-0.0003761512052733451,+0.991369366645813,+0.1310984343290329,+1.299782633781433+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.968820333480835,+142.00986623764038,+129.9782633781433+],+"forward": [+-0.5977106690406799,+-0.7909205555915833,+-0.1310984492301941+],+"up": [+-0.07873838394880295,+-0.10481986403465271,+0.9913692474365234+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.17405803501606+},+{+"blender_frame": 1,+"matrix_world": [+[+0.7978469133377075,+-0.07872936874628067,+0.5976971983909607,+0.3797456920146942+],+[+0.6028599739074707,+0.10479958355426788,+-0.7909340858459473,+-1.4200018644332886+],+[+-0.00036867361632175744,+0.9913722276687622,+0.13107679784297943,+1.2997287511825562+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.97456920146942,+142.00018644332886,+129.97287511825562+],+"forward": [+-0.5976972579956055,+-0.7909342050552368,+-0.13107681274414062+],+"up": [+-0.07872936874628067,+-0.10479958355426788,+0.9913722276687622+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.16868728399277+},+{+"blender_frame": 2,+"matrix_world": [+[+0.7978823184967041,+-0.07874725013971329,+0.5976476073265076,+0.37980031967163086+],+[+0.6028132438659668,+0.10478832572698593,+-0.7909713387489319,+-1.419926404953003+],+[+-0.00033967639319598675,+0.9913718700408936,+0.13107863068580627,+1.2997633218765259+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.980031967163086,+141.9926404953003,+129.9763321876526+],+"forward": [+-0.5976476073265076,+-0.7909713387489319,+-0.13107863068580627+],+"up": [+-0.07874725759029388,+-0.10478834062814713,+0.9913719892501831+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.16603487730026+},+{+"blender_frame": 3,+"matrix_world": [+[+0.797924816608429,+-0.07878146320581436,+0.5975863337516785,+0.3797800838947296+],+[+0.6027569770812988,+0.10485284775495529,+-0.7910056114196777,+-1.4198338985443115+],+[+-0.000342055456712842,+0.9913623929023743,+0.1311507374048233,+1.299838662147522+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.97800838947296,+141.98338985443115,+129.9838662147522+],+"forward": [+-0.5975863933563232,+-0.7910057306289673,+-0.1311507523059845+],+"up": [+-0.07878146320581436,+-0.10485284775495529,+0.9913623929023743+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.15908460319042+},+{+"blender_frame": 4,+"matrix_world": [+[+0.7979907989501953,+-0.07883021980524063,+0.5974918007850647,+0.379628449678421+],+[+0.6026694774627686,+0.10497797280550003,+-0.7910557389259338,+-1.4197134971618652+],+[+-0.00036438912502489984,+0.9913452863693237,+0.13128001987934113,+1.2998439073562622+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.9628449678421,+141.97134971618652,+129.98439073562622+],+"forward": [+-0.5974918007850647,+-0.7910557389259338,+-0.13128001987934113+],+"up": [+-0.07883021980524063,+-0.10497797280550003,+0.9913452863693237+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.14170202612877+},+{+"blender_frame": 5,+"matrix_world": [+[+0.7980729937553406,+-0.07889924198389053,+0.5973730087280273,+0.3794405460357666+],+[+0.602560818195343,+0.10505317896604538,+-0.7911284565925598,+-1.4195629358291626+],+[+-0.0003365050069987774,+0.9913318157196045,+0.13138167560100555,+1.2998120784759521+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.94405460357666,+141.95629358291626,+129.98120784759521+],+"forward": [+-0.5973730683326721,+-0.7911285758018494,+-0.13138169050216675+],+"up": [+-0.07889924198389053,+-0.10505317896604538,+0.9913318157196045+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.11867414414883+},+{+"blender_frame": 6,+"matrix_world": [+[+0.7981445789337158,+-0.07897750288248062,+0.5972669720649719,+0.3792645037174225+],+[+0.6024659276008606,+0.10505610704421997,+-0.7912003397941589,+-1.419356346130371+],+[+-0.0002595178666524589,+0.9913252592086792,+0.1314312219619751,+1.2998441457748413+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.92645037174225,+141.9356346130371,+129.98441457748413+],+"forward": [+-0.5972670316696167,+-0.7912004590034485,+-0.1314312368631363+],+"up": [+-0.07897750288248062,+-0.10505610704421997,+0.9913252592086792+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.09209084510803+},+{+"blender_frame": 7,+"matrix_world": [+[+0.7981873154640198,+-0.07906881719827652,+0.5971977710723877,+0.3791736662387848+],+[+0.602409303188324,+0.10507197678089142,+-0.7912414073944092,+-1.419095516204834+],+[+-0.000186221266631037,+0.9913162589073181,+0.13149890303611755,+1.299963116645813+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.91736662387848,+141.9095516204834,+129.9963116645813+],+"forward": [+-0.5971977710723877,+-0.7912414073944092,+-0.13149890303611755+],+"up": [+-0.07906882464885712,+-0.10507199168205261,+0.9913163781166077+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.06798933446407+},+{+"blender_frame": 8,+"matrix_world": [+[+0.7982199788093567,+-0.07913554459810257,+0.5971452593803406,+0.3791085481643677+],+[+0.6023659706115723,+0.10513690114021301,+-0.7912657260894775,+-1.4188506603240967+],+[+-0.00016475953452754766,+0.9913040995597839,+0.13159093260765076,+1.3000297546386719+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.91085481643677,+141.88506603240967,+130.0029754638672+],+"forward": [+-0.5971452593803406,+-0.7912657260894775,+-0.13159093260765076+],+"up": [+-0.07913554459810257,+-0.10513690114021301,+0.9913040995597839+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.0465301722288+},+{+"blender_frame": 9,+"matrix_world": [+[+0.7982800602912903,+-0.0791320726275444,+0.5970654487609863,+0.3789771795272827+],+[+0.6022864580154419,+0.10519813746213913,+-0.7913181185722351,+-1.4186111688613892+],+[+-0.0001915238972287625,+0.9912979602813721,+0.13163773715496063,+1.3000024557113647+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.89771795272827,+141.86111688613892,+130.00024557113647+],+"forward": [+-0.5970654487609863,+-0.7913181185722351,+-0.13163773715496063+],+"up": [+-0.0791320726275444,+-0.10519813746213913,+0.9912979602813721+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 242.01936349272728+},+{+"blender_frame": 10,+"matrix_world": [+[+0.7983505725860596,+-0.07907699793577194,+0.5969784259796143,+0.37877634167671204+],+[+0.6021929383277893,+0.10519974678754807,+-0.791388988494873,+-1.4183135032653809+],+[+-0.0002213020925410092,+0.9913020133972168,+0.131605863571167,+1.2999523878097534+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.877634167671204,+141.8313503265381,+129.99523878097534+],+"forward": [+-0.596978485584259,+-0.7913891077041626,+-0.13160587847232819+],+"up": [+-0.07907700538635254,+-0.10519976168870926,+0.9913021326065063+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.9819563627243+},+{+"blender_frame": 11,+"matrix_world": [+[+0.7983785271644592,+-0.07898285239934921,+0.5969535708427429,+0.3785099685192108+],+[+0.6021560430526733,+0.10514383763074875,+-0.791424572467804,+-1.4180071353912354+],+[+-0.00025702264974825084,+0.9913155436515808,+0.13150455057621002,+1.2999416589736938+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.85099685192108,+141.80071353912354,+129.99416589736938+],+"forward": [+-0.5969536304473877,+-0.7914246916770935,+-0.13150456547737122+],+"up": [+-0.07898285239934921,+-0.10514383763074875,+0.9913155436515808+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.93993620574474+},+{+"blender_frame": 12,+"matrix_world": [+[+0.7983508706092834,+-0.07889605313539505,+0.5970019698143005,+0.3782465159893036+],+[+0.6021926403045654,+0.10506629943847656,+-0.7914071679115295,+-1.4177273511886597+],+[+-0.0002858942898456007,+0.9913305640220642,+0.13139039278030396,+1.2998906373977661+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.82465159893036,+141.77273511886597,+129.9890637397766+],+"forward": [+-0.5970019698143005,+-0.7914071679115295,+-0.13139039278030396+],+"up": [+-0.07889606058597565,+-0.10506631433963776,+0.9913306832313538+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.90008081495762+},+{+"blender_frame": 13,+"matrix_world": [+[+0.7983124852180481,+-0.07885262370109558,+0.5970589518547058,+0.3779560327529907+],+[+0.6022433638572693,+0.10502436012029648,+-0.7913739681243896,+-1.4173970222473145+],+[+-0.0003038239374291152,+0.9913384914398193,+0.1313307285308838,+1.2997925281524658+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.79560327529907,+141.73970222473145,+129.97925281524658+],+"forward": [+-0.5970590114593506,+-0.7913740873336792,+-0.13133074343204498+],+"up": [+-0.07885263115167618,+-0.10502437502145767,+0.9913386106491089+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.85492768883705+},+{+"blender_frame": 14,+"matrix_world": [+[+0.7982893586158752,+-0.07883282005786896,+0.5970925092697144,+0.37762099504470825+],+[+0.6022740006446838,+0.1050061509013176,+-0.7913531064987183,+-1.4169989824295044+],+[+-0.00031378911808133125,+0.9913420677185059,+0.13130426406860352,+1.2996271848678589+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.762099504470825,+141.69989824295044,+129.9627184867859+],+"forward": [+-0.5970925092697144,+-0.7913531064987183,+-0.13130426406860352+],+"up": [+-0.07883282005786896,+-0.1050061509013176,+0.9913420677185059+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.8011162430048+},+{+"blender_frame": 15,+"matrix_world": [+[+0.7982426285743713,+-0.07884492725133896,+0.5971534252166748,+0.3772413432598114+],+[+0.6023359894752502,+0.10495531558990479,+-0.7913126945495605,+-1.4166145324707031+],+[+-0.0002834377810359001,+0.991346538066864,+0.13127093017101288,+1.2994041442871094+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.72413432598114,+141.6614532470703,+129.94041442871094+],+"forward": [+-0.5971534252166748,+-0.7913126945495605,+-0.13127093017101288+],+"up": [+-0.07884492725133896,+-0.10495531558990479,+0.991346538066864+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.74513146281242+},+{+"blender_frame": 16,+"matrix_world": [+[+0.7981821298599243,+-0.0788743868470192,+0.5972303748130798,+0.37681862711906433+],+[+0.6024162173271179,+0.10488931089639664,+-0.7912602424621582,+-1.4162379503250122+],+[+-0.00023291597608476877,+0.9913511276245117,+0.1312359720468521,+1.2991865873336792+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.68186271190643,+141.62379503250122,+129.91865873336792+],+"forward": [+-0.5972304344177246,+-0.7912603616714478,+-0.1312359869480133+],+"up": [+-0.0788743868470192,+-0.10488931089639664,+0.9913511276245117+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.68735221028328+},+{+"blender_frame": 17,+"matrix_world": [+[+0.7981458306312561,+-0.07890182733535767,+0.5972752571105957,+0.3763394057750702+],+[+0.6024643182754517,+0.10486757010221481,+-0.7912266254425049,+-1.4158122539520264+],+[+-0.00020558014512062073,+0.9913512468338013,+0.13123513758182526,+1.2990071773529053+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.63394057750702,+141.58122539520264,+129.90071773529053+],+"forward": [+-0.5972753167152405,+-0.7912267446517944,+-0.13123515248298645+],+"up": [+-0.07890182733535767,+-0.10486757010221481,+0.9913512468338013+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.6230957955122+},+{+"blender_frame": 18,+"matrix_world": [+[+0.7981376647949219,+-0.07893530279397964,+0.5972818732261658,+0.37592971324920654+],+[+0.6024752855300903,+0.10489101707935333,+-0.791215181350708,+-1.4153151512145996+],+[+-0.00019469053950160742,+0.9913461208343506,+0.1312740296125412,+1.298801302909851+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.592971324920654,+141.53151512145996,+129.8801302909851+],+"forward": [+-0.5972818732261658,+-0.791215181350708,+-0.1312740296125412+],+"up": [+-0.07893530279397964,+-0.10489101707935333,+0.9913461208343506+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.55720472335815+},+{+"blender_frame": 19,+"matrix_world": [+[+0.7981122136116028,+-0.07899124920368195,+0.5973083972930908,+0.3756062090396881+],+[+0.6025088429450989,+0.10491721332073212,+-0.7911861538887024,+-1.4147956371307373+],+[+-0.00017115904483944178,+0.991338849067688,+0.13132862746715546,+1.2985408306121826+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.56062090396881,+141.47956371307373,+129.85408306121826+],+"forward": [+-0.5973083972930908,+-0.7911861538887024,+-0.13132862746715546+],+"up": [+-0.07899124920368195,+-0.10491721332073212,+0.991338849067688+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.494407877326+},+{+"blender_frame": 20,+"matrix_world": [+[+0.7980598211288452,+-0.0790577232837677,+0.5973695516586304,+0.37531208992004395+],+[+0.6025781631469727,+0.10485997051000595,+-0.7911409735679626,+-1.4142366647720337+],+[+-9.435214451514184e-05,+0.9913396239280701,+0.13132299482822418,+1.2982920408248901+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.531208992004395,+141.42366647720337,+129.829204082489+],+"forward": [+-0.5973695516586304,+-0.7911409735679626,+-0.13132299482822418+],+"up": [+-0.0790577307343483,+-0.10485998541116714,+0.9913397431373596+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.4297942072153+},+{+"blender_frame": 21,+"matrix_world": [+[+0.7980114221572876,+-0.079095758497715,+0.5974292159080505,+0.3749367594718933+],+[+0.6026424169540405,+0.10471904277801514,+-0.7911106944084167,+-1.4136213064193726+],+[+1.1285175787634216e-05,+0.9913514852523804,+0.13123345375061035,+1.298136591911316+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.49367594718933,+141.36213064193726,+129.8136591911316+],+"forward": [+-0.5974292159080505,+-0.7911106944084167,+-0.13123345375061035+],+"up": [+-0.079095758497715,+-0.10471904277801514,+0.9913514852523804+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.35579355061054+},+{+"blender_frame": 22,+"matrix_world": [+[+0.7979792952537537,+-0.07909416407346725,+0.5974721312522888,+0.37445905804634094+],+[+0.602684736251831,+0.10456753522157669,+-0.7910982966423035,+-1.4129518270492554+],+[+9.506497735856101e-05,+0.9913675785064697,+0.13111156225204468,+1.2980544567108154+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.445905804634094,+141.29518270492554,+129.80544567108154+],+"forward": [+-0.5974722504615784,+-0.7910984754562378,+-0.13111159205436707+],+"up": [+-0.07909417152404785,+-0.10456755012273788,+0.9913676977157593+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.27176702022552+},+{+"blender_frame": 23,+"matrix_world": [+[+0.7979283332824707,+-0.07903482019901276,+0.5975483059883118,+0.37397128343582153+],+[+0.6027524471282959,+0.10438772290945053,+-0.7910706400871277,+-1.412236213684082+],+[+0.00014541679411195219,+0.9913913607597351,+0.13093233108520508,+1.2979621887207031+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.39712834358215,+141.2236213684082,+129.7962188720703+],+"forward": [+-0.5975483059883118,+-0.7910706400871277,+-0.13093233108520508+],+"up": [+-0.07903482019901276,+-0.10438772290945053,+0.9913913607597351+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.18276350200176+},+{+"blender_frame": 24,+"matrix_world": [+[+0.7978830337524414,+-0.07894175499677658,+0.5976210236549377,+0.3734646439552307+],+[+0.6028123497962952,+0.10424596816301346,+-0.7910436391830444,+-1.4114892482757568+],+[+0.00014679101877845824,+0.9914136528968811,+0.13076314330101013,+1.297860860824585+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.34646439552307,+141.14892482757568,+129.7860860824585+],+"forward": [+-0.5976210236549377,+-0.7910436391830444,+-0.13076314330101013+],+"up": [+-0.07894175499677658,+-0.10424596816301346,+0.9914136528968811+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.09012335538864+},+{+"blender_frame": 25,+"matrix_world": [+[+0.7978896498680115,+-0.0788741186261177,+0.5976210236549377,+0.3729647397994995+],+[+0.6028034687042236,+0.10416845232248306,+-0.7910606265068054,+-1.4106581211090088+],+[+0.0001409489195793867,+0.9914271831512451,+0.1306605190038681,+1.2976787090301514+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.29647397994995,+141.06581211090088,+129.76787090301514+],+"forward": [+-0.5976210236549377,+-0.7910606265068054,+-0.1306605190038681+],+"up": [+-0.0788741186261177,+-0.10416845232248306,+0.9914271831512451+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.9905780106783+},+{+"blender_frame": 26,+"matrix_world": [+[+0.7979404330253601,+-0.07883253693580627,+0.597558856010437,+0.3724016547203064+],+[+0.6027364134788513,+0.10410792380571365,+-0.7911196351051331,+-1.40977144241333+],+[+0.00015536190767306834,+0.9914368391036987,+0.1305871456861496,+1.297451376914978+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.24016547203064,+140.977144241333,+129.7451376914978+],+"forward": [+-0.5975589156150818,+-0.7911197543144226,+-0.1305871605873108+],+"up": [+-0.07883253693580627,+-0.10410792380571365,+0.9914368391036987+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.88219814002514+},+{+"blender_frame": 27,+"matrix_world": [+[+0.7979751229286194,+-0.07882975786924362,+0.5975127816200256,+0.37173545360565186+],+[+0.6026902794837952,+0.1040768176317215,+-0.7911589741706848,+-1.4088637828826904+],+[+0.00017964690050575882,+0.9914403557777405,+0.13056065142154694,+1.2971858978271484+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.173545360565186,+140.88637828826904,+129.71858978271484+],+"forward": [+-0.5975127816200256,+-0.7911589741706848,+-0.13056065142154694+],+"up": [+-0.07882975786924362,+-0.1040768176317215,+0.9914403557777405+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.76631776988506+},+{+"blender_frame": 28,+"matrix_world": [+[+0.7979945540428162,+-0.07883558422327042,+0.5974859595298767,+0.37096652388572693+],+[+0.6026644706726074,+0.10405854880809784,+-0.7911809682846069,+-1.4079748392105103+],+[+0.0001996831560973078,+0.9914418458938599,+0.1305495649576187,+1.296942114830017+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.09665238857269,+140.79748392105103,+129.6942114830017+],+"forward": [+-0.5974860191345215,+-0.7911810874938965,+-0.1305495798587799+],+"up": [+-0.07883558422327042,+-0.10405854880809784,+0.9914418458938599+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.6464785337448+},+{+"blender_frame": 29,+"matrix_world": [+[+0.798051655292511,+-0.07879897952079773,+0.597414493560791,+0.37020888924598694+],+[+0.6025888323783875,+0.10404134541749954,+-0.7912408113479614,+-1.407089352607727+],+[+0.00019315618555992842,+0.9914464950561523,+0.1305137574672699,+1.2967690229415894+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+37.020888924598694,+140.7089352607727,+129.67690229415894+],+"forward": [+-0.5974145531654358,+-0.791240930557251,+-0.1305137723684311+],+"up": [+-0.07879897952079773,+-0.10404134541749954,+0.9914464950561523+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.52772857248783+},+{+"blender_frame": 30,+"matrix_world": [+[+0.7981504201889038,+-0.07874557375907898,+0.5972898006439209,+0.3694532811641693+],+[+0.6024582982063293,+0.10404153168201447,+-0.7913402318954468,+-1.4061627388000488+],+[+0.00017160363495349884,+0.9914506673812866,+0.13048170506954193,+1.2965714931488037+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.94532811641693,+140.61627388000488,+129.65714931488037+],+"forward": [+-0.5972898006439209,+-0.7913402318954468,+-0.13048170506954193+],+"up": [+-0.07874558120965958,+-0.10404154658317566,+0.9914507865905762+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.40511809289455+},+{+"blender_frame": 31,+"matrix_world": [+[+0.7982472777366638,+-0.07870558649301529,+0.597165584564209,+0.3686390221118927+],+[+0.6023299098014832,+0.10406404733657837,+-0.7914350032806396,+-1.405181646347046+],+[+0.00014688685769215226,+0.9914515018463135,+0.13047555088996887,+1.2962685823440552+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.86390221118927,+140.5181646347046,+129.62685823440552+],+"forward": [+-0.5971656441688538,+-0.7914351224899292,+-0.13047556579113007+],+"up": [+-0.07870558649301529,+-0.10406404733657837,+0.9914515018463135+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.27375541627407+},+{+"blender_frame": 32,+"matrix_world": [+[+0.7982998490333557,+-0.07869897782802582,+0.5970961451530457,+0.3677597641944885+],+[+0.6022601127624512,+0.10407786071300507,+-0.7914862632751465,+-1.4042129516601562+],+[+0.00014466550783254206,+0.9914505481719971,+0.13048259913921356,+1.2959485054016113+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.77597641944885,+140.42129516601562,+129.59485054016113+],+"forward": [+-0.5970961451530457,+-0.7914862632751465,+-0.13048259913921356+],+"up": [+-0.07869898527860641,+-0.10407787561416626,+0.9914506673812866+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.1398953050375+},+{+"blender_frame": 33,+"matrix_world": [+[+0.7983154654502869,+-0.0787123441696167,+0.597073495388031,+0.3669009506702423+],+[+0.6022393703460693,+0.104076087474823,+-0.7915023565292358,+-1.403287649154663+],+[+0.0001599356473889202,+0.9914497137069702,+0.13048923015594482,+1.2957289218902588+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.69009506702423,+140.3287649154663,+129.57289218902588+],+"forward": [+-0.5970734357833862,+-0.7915022373199463,+-0.13048921525478363+],+"up": [+-0.0787123441696167,+-0.104076087474823,+0.9914497137069702+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 240.01240581274033+},+{+"blender_frame": 34,+"matrix_world": [+[+0.7983354926109314,+-0.07870985567569733,+0.5970470309257507,+0.36607998609542847+],+[+0.6022128462791443,+0.10407964140176773,+-0.7915219068527222,+-1.4023308753967285+],+[+0.00016013796266634017,+0.9914495348930359,+0.13049055635929108,+1.295497179031372+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.60799860954285,+140.23308753967285,+129.5497179031372+],+"forward": [+-0.5970470905303955,+-0.7915220260620117,+-0.13049057126045227+],+"up": [+-0.07870985567569733,+-0.10407964140176773,+0.9914495348930359+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 239.884452521801+},+{+"blender_frame": 35,+"matrix_world": [+[+0.798362135887146,+-0.07869219034910202,+0.5970137715339661,+0.36528274416923523+],+[+0.6021775603294373,+0.1040969118475914,+-0.7915465831756592,+-1.4013323783874512+],+[+0.000141252763569355,+0.9914491176605225,+0.13049371540546417,+1.2952126264572144+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.52827441692352,+140.13323783874512,+129.52126264572144+],+"forward": [+-0.5970137715339661,+-0.7915465831756592,+-0.13049371540546417+],+"up": [+-0.07869219034910202,+-0.1040969118475914,+0.9914491176605225+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 239.7538524121046+},+{+"blender_frame": 36,+"matrix_world": [+[+0.7983893156051636,+-0.07864672690629959,+0.5969834327697754,+0.36449116468429565+],+[+0.6021416187286377,+0.10410108417272568,+-0.7915733456611633,+-1.4003146886825562+],+[+0.0001080407528206706,+0.9914523363113403,+0.1304696500301361,+1.2950031757354736+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.449116468429565,+140.03146886825562,+129.50031757354736+],+"forward": [+-0.5969834923744202,+-0.7915734648704529,+-0.1304696649312973+],+"up": [+-0.07864672690629959,+-0.10410108417272568,+0.9914523363113403+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 239.622687920928+},+{+"blender_frame": 37,+"matrix_world": [+[+0.7983881831169128,+-0.078587107360363,+0.5969928503036499,+0.3636983633041382+],+[+0.6021431088447571,+0.10406441986560822,+-0.7915770411491394,+-1.399243712425232+],+[+8.204588084481657e-05,+0.9914608597755432,+0.1304045021533966,+1.2948635816574097+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.36983633041382,+139.9243712425232,+129.48635816574097+],+"forward": [+-0.5969928503036499,+-0.7915770411491394,+-0.1304045021533966+],+"up": [+-0.0785871148109436,+-0.10406443476676941,+0.9914609789848328+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 239.48784582316875+},+{+"blender_frame": 38,+"matrix_world": [+[+0.7983545064926147,+-0.0785350501537323,+0.5970445871353149,+0.36291852593421936+],+[+0.6021876931190491,+0.10399087518453598,+-0.7915527820587158,+-1.3980300426483154+],+[+7.74510990595445e-05,+0.9914727210998535,+0.1303144097328186,+1.2946535348892212+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.291852593421936,+139.80300426483154,+129.46535348892212+],+"forward": [+-0.5970446467399597,+-0.7915529012680054,+-0.1303144246339798+],+"up": [+-0.0785350501537323,+-0.10399087518453598,+0.9914727210998535+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 239.34158720076084+},+{+"blender_frame": 39,+"matrix_world": [+[+0.7982988953590393,+-0.07848487794399261,+0.5971256494522095,+0.36213624477386475+],+[+0.6022616624832153,+0.10388269275426865,+-0.7915108799934387,+-1.396769404411316+],+[+9.061105083674192e-05,+0.991487979888916,+0.13019786775112152,+1.2944084405899048+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.213624477386475,+139.6769404411316,+129.44084405899048+],+"forward": [+-0.5971256494522095,+-0.7915108799934387,+-0.13019786775112152+],+"up": [+-0.07848488539457321,+-0.10388270765542984,+0.9914880990982056+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 239.19082581996918+},+{+"blender_frame": 40,+"matrix_world": [+[+0.7982707023620605,+-0.07846207916736603,+0.5971663594245911,+0.3613039553165436+],+[+0.6022988557815552,+0.10382018238306046,+-0.7914906740188599,+-1.3955731391906738+],+[+0.00010408223897684366,+0.9914963841438293,+0.1301342397928238,+1.2942290306091309+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.13039553165436,+139.55731391906738,+129.4229030609131+],+"forward": [+-0.5971663594245911,+-0.7914906740188599,+-0.1301342397928238+],+"up": [+-0.07846207916736603,+-0.10382018238306046,+0.9914963841438293+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 239.043502882123+},+{+"blender_frame": 41,+"matrix_world": [+[+0.798292338848114,+-0.07846737653017044,+0.5971367955207825,+0.3604537844657898+],+[+0.6022703051567078,+0.10381227731704712,+-0.7915135025978088,+-1.394344449043274+],+[+0.00011785217793658376,+0.991496741771698,+0.13013111054897308,+1.2940354347229004+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+36.04537844657898,+139.4344449043274,+129.40354347229004+],+"forward": [+-0.5971367955207825,+-0.7915135025978088,+-0.13013111054897308+],+"up": [+-0.07846738398075104,+-0.10381229221820831,+0.9914968609809875+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 238.8926524668932+},+{+"blender_frame": 42,+"matrix_world": [+[+0.7983291745185852,+-0.07847781479358673,+0.5970860123634338,+0.3595547378063202+],+[+0.6022212505340576,+0.10378890484571457,+-0.7915538549423218,+-1.3930058479309082+],+[+0.0001485060784034431,+0.9914984703063965,+0.1301187127828598,+1.2937766313552856+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.95547378063202,+139.30058479309082,+129.37766313552856+],+"forward": [+-0.5970860123634338,+-0.7915538549423218,+-0.1301187127828598+],+"up": [+-0.07847781479358673,+-0.10378890484571457,+0.9914984703063965+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 238.72903063893318+},+{+"blender_frame": 43,+"matrix_world": [+[+0.7983723282814026,+-0.0784916952252388,+0.5970265865325928,+0.3585365414619446+],+[+0.602164089679718,+0.10374297946691513,+-0.7916033267974854,+-1.3916435241699219+],+[+0.00019696896197274327,+0.9915021061897278,+0.1300904005765915,+1.293513298034668+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.85365414619446,+139.1643524169922,+129.3513298034668+],+"forward": [+-0.5970265865325928,+-0.7916033267974854,+-0.1300904005765915+],+"up": [+-0.0784916952252388,+-0.10374297946691513,+0.9915021061897278+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 238.55604119598866+},+{+"blender_frame": 44,+"matrix_world": [+[+0.7983818054199219,+-0.07847229391336441,+0.5970165133476257,+0.35743746161460876+],+[+0.60215163230896,+0.1036447063088417,+-0.7916256785392761,+-1.3903471231460571+],+[+0.00024308798310812563,+0.9915138483047485,+0.1300002783536911,+1.293273687362671+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.74374616146088,+139.0347123146057,+129.3273687362671+],+"forward": [+-0.5970165133476257,+-0.7916256785392761,+-0.1300002783536911+],+"up": [+-0.07847230136394501,+-0.1036447212100029,+0.9915139675140381+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 238.38320076465607+},+{+"blender_frame": 45,+"matrix_world": [+[+0.7983607053756714,+-0.07842782139778137,+0.5970504879951477,+0.35631436109542847+],+[+0.6021794080734253,+0.10353826731443405,+-0.7916184663772583,+-1.3890973329544067+],+[+0.0002673485432751477,+0.9915285110473633,+0.12988853454589844,+1.2930405139923096+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.63143610954285,+138.90973329544067,+129.30405139923096+],+"forward": [+-0.5970504879951477,+-0.7916184663772583,+-0.12988853454589844+],+"up": [+-0.07842782884836197,+-0.10353828221559525,+0.9915286302566528+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 238.21278475224972+},+{+"blender_frame": 46,+"matrix_world": [+[+0.7983430027961731,+-0.07840076833963394,+0.5970776677131653,+0.3552617132663727+],+[+0.6022029519081116,+0.10349015146493912,+-0.7916067242622375,+-1.387871265411377+],+[+0.0002709164109546691,+0.9915357828140259,+0.12983380258083344,+1.2927297353744507+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.52617132663727,+138.7871265411377,+129.27297353744507+],+"forward": [+-0.5970777273178101,+-0.7916068434715271,+-0.12983381748199463+],+"up": [+-0.07840076833963394,+-0.10349015146493912,+0.9915357828140259+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 238.04825246334076+},+{+"blender_frame": 47,+"matrix_world": [+[+0.7983285188674927,+-0.07842909544706345,+0.5970934629440308,+0.35422074794769287+],+[+0.6022222638130188,+0.10351724922657013,+-0.7915886044502258,+-1.3866225481033325+],+[+0.00027410444454289973,+0.9915305972099304,+0.12987250089645386,+1.2923821210861206+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.42207479476929,+138.66225481033325,+129.23821210861206+],+"forward": [+-0.5970934629440308,+-0.7915886044502258,+-0.12987250089645386+],+"up": [+-0.07842910289764404,+-0.10351726412773132,+0.99153071641922+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 237.88345009088516+},+{+"blender_frame": 48,+"matrix_world": [+[+0.7983143925666809,+-0.07848235219717026,+0.5971052050590515,+0.3531459867954254+],+[+0.6022407412528992,+0.10359444469213486,+-0.7915644645690918,+-1.385393738746643+],+[+0.0002670678368303925,+0.9915183186531067,+0.12996624410152435,+1.292051076889038+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.31459867954254,+138.5393738746643,+129.2051076889038+],+"forward": [+-0.5971052050590515,+-0.7915644645690918,+-0.12996624410152435+],+"up": [+-0.07848235964775085,+-0.10359445959329605,+0.9915184378623962+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 237.71924003958702+},+{+"blender_frame": 49,+"matrix_world": [+[+0.7982795238494873,+-0.07848117500543594,+0.597152054309845,+0.3519836962223053+],+[+0.602287232875824,+0.10365752875804901,+-0.791520893573761,+-1.3841415643692017+],+[+0.0002201759780291468,+0.9915119409561157,+0.13001586496829987,+1.2917894124984741+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.19836962223053,+138.41415643692017,+129.1789412498474+],+"forward": [+-0.597152054309845,+-0.791520893573761,+-0.13001586496829987+],+"up": [+-0.07848117500543594,+-0.10365752875804901,+0.9915119409561157+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 237.54845894873142+},+{+"blender_frame": 50,+"matrix_world": [+[+0.7982256412506104,+-0.07843447476625443,+0.5972301959991455,+0.3508025109767914+],+[+0.6023585796356201,+0.10370820015668869,+-0.7914599180221558,+-1.3827921152114868+],+[+0.00014007266145199537,+0.991510272026062,+0.13002821803092957,+1.291560411453247+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+35.08025109767914,+138.27921152114868,+129.1560411453247+],+"forward": [+-0.5972301959991455,+-0.7914599180221558,+-0.13002821803092957+],+"up": [+-0.07843448221683502,+-0.10370821505784988,+0.9915103912353516+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 237.36900053918362+},+{+"blender_frame": 51,+"matrix_world": [+[+0.7981908917427063,+-0.07840389013290405,+0.5972806811332703,+0.3496567904949188+],+[+0.6024047136306763,+0.10377883911132812,+-0.7914154529571533,+-1.381407380104065+],+[+6.49545545456931e-05,+0.9915053844451904,+0.1300661712884903,+1.2912976741790771+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.96567904949188,+138.1407380104065,+129.12976741790771+],+"forward": [+-0.597280740737915,+-0.7914155721664429,+-0.1300661861896515+],+"up": [+-0.07840389013290405,+-0.10377883911132812,+0.9915053844451904+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 237.18857541680336+},+{+"blender_frame": 52,+"matrix_world": [+[+0.7981749773025513,+-0.07843680679798126,+0.5972975492477417,+0.34849753975868225+],+[+0.6024256348609924,+0.10384207963943481,+-0.7913913130760193,+-1.3800618648529053+],+[+4.958717545378022e-05,+0.9914961457252502,+0.13013648986816406,+1.2910470962524414+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.849753975868225,+138.00618648529053,+129.10470962524414+],+"forward": [+-0.5972975492477417,+-0.7913913130760193,+-0.13013648986816406+],+"up": [+-0.07843680679798126,+-0.10384207963943481,+0.9914961457252502+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 237.29045130312443+},+{+"blender_frame": 53,+"matrix_world": [+[+0.7981549501419067,+-0.07849829643964767,+0.5973162651062012,+0.3473171591758728+],+[+0.6024522185325623,+0.10387162119150162,+-0.79136723279953,+-1.3787542581558228+],+[+7.676889799768105e-05,+0.9914880394935608,+0.13019713759422302,+1.2907263040542603+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.73171591758728,+137.87542581558228,+129.07263040542603+],+"forward": [+-0.5973162651062012,+-0.79136723279953,+-0.13019713759422302+],+"up": [+-0.07849830389022827,+-0.10387163609266281,+0.9914881587028503+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 238.01086582243443+},+{+"blender_frame": 54,+"matrix_world": [+[+0.798132598400116,+-0.07852820307016373,+0.5973421335220337,+0.3461410701274872+],+[+0.6024818420410156,+0.10386985540390015,+-0.7913448214530945,+-1.3773640394210815+],+[+9.704945841804147e-05,+0.9914859533309937,+0.13021370768547058,+1.290378451347351+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.61410701274872,+137.73640394210815,+129.0378451347351+],+"forward": [+-0.5973421931266785,+-0.791344940662384,+-0.13021372258663177+],+"up": [+-0.07852820307016373,+-0.10386985540390015,+0.9914859533309937+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 239.33915793895721+},+{+"blender_frame": 55,+"matrix_world": [+[+0.7981420159339905,+-0.07853960245847702,+0.597328245639801,+0.34496259689331055+],+[+0.6024695634841919,+0.10385823249816895,+-0.7913557291030884,+-1.3759326934814453+],+[+0.00011531246855156496,+0.9914861917495728,+0.13021130859851837,+1.2900919914245605+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.496259689331055,+137.59326934814453,+129.00919914245605+],+"forward": [+-0.5973283052444458,+-0.7913558483123779,+-0.13021132349967957+],+"up": [+-0.07853960990905762,+-0.10385824739933014,+0.9914863109588623+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 241.273333132267+},+{+"blender_frame": 56,+"matrix_world": [+[+0.7981799244880676,+-0.07855138927698135,+0.5972758531570435,+0.343840092420578+],+[+0.6024191379547119,+0.10388041287660599,+-0.791391134262085,+-1.3744951486587524+],+[+0.00011961855489062145,+0.9914830327033997,+0.13023610413074493,+1.289907455444336+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.3840092420578,+137.44951486587524,+128.9907455444336+],+"forward": [+-0.5972759127616882,+-0.7913912534713745,+-0.13023611903190613+],+"up": [+-0.07855138927698135,+-0.10388041287660599,+0.9914830327033997+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 243.8124917447567+},+{+"blender_frame": 57,+"matrix_world": [+[+0.7982109785079956,+-0.07858031988143921,+0.5972305536270142,+0.34279510378837585+],+[+0.6023779511451721,+0.10390442609786987,+-0.7914193868637085,+-1.373024344444275+],+[+0.0001350828242721036,+0.9914782643318176,+0.13027268648147583,+1.2897230386734009+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.279510378837585,+137.3024344444275,+128.9723038673401+],+"forward": [+-0.5972306132316589,+-0.791419506072998,+-0.13027270138263702+],+"up": [+-0.07858031988143921,+-0.10390442609786987,+0.9914782643318176+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 246.94395139813423+},+{+"blender_frame": 58,+"matrix_world": [+[+0.7982208132743835,+-0.0786169171333313,+0.5972126126289368,+0.3417382836341858+],+[+0.6023649573326111,+0.10389421135187149,+-0.7914305925369263,+-1.3715347051620483+],+[+0.00017289489915128797,+0.9914764761924744,+0.1302865743637085,+1.2894792556762695+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.17382836341858,+137.15347051620483,+128.94792556762695+],+"forward": [+-0.5972126722335815,+-0.7914307117462158,+-0.1302865892648697+],+"up": [+-0.0786169096827507,+-0.1038941964507103,+0.9914763569831848+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 250.64927712082863+},+{+"blender_frame": 59,+"matrix_world": [+[+0.7982122898101807,+-0.07863271236419678,+0.597222089767456,+0.3406067192554474+],+[+0.6023763418197632,+0.1039048284292221,+-0.791420578956604,+-1.3700497150421143+],+[+0.00017729315732140094,+0.9914739727973938,+0.13030457496643066,+1.2892218828201294+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+34.06067192554474,+137.00497150421143,+128.92218828201294+],+"forward": [+-0.597222089767456,+-0.791420578956604,+-0.13030457496643066+],+"up": [+-0.07863271236419678,+-0.1039048284292221,+0.9914739727973938+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 254.91233505308628+},+{+"blender_frame": 60,+"matrix_world": [+[+0.7982215285301208,+-0.0786011815071106,+0.597213864326477,+0.3394593596458435+],+[+0.602364182472229,+0.10389038175344467,+-0.7914317846298218,+-1.3685798645019531+],+[+0.00016268987383227795,+0.9914780259132385,+0.13027405738830566,+1.2890111207962036+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.94593596458435,+136.8579864501953,+128.90111207962036+],+"forward": [+-0.597213864326477,+-0.7914317846298218,+-0.13027405738830566+],+"up": [+-0.0786011815071106,+-0.10389038175344467,+0.9914780259132385+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 259.71954092383385+},+{+"blender_frame": 61,+"matrix_world": [+[+0.7982584834098816,+-0.07856544852256775,+0.5971691608428955,+0.33840611577033997+],+[+0.6023151278495789,+0.1038253903388977,+-0.7914775609970093,+-1.3671059608459473+],+[+0.00018147504306398332,+0.9914876818656921,+0.13020063936710358,+1.2887952327728271+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.840611577034,+136.71059608459473,+128.87952327728271+],+"forward": [+-0.5971692204475403,+-0.7914776802062988,+-0.13020065426826477+],+"up": [+-0.07856544852256775,+-0.1038253903388977,+0.9914876818656921+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 265.0555081665516+},+{+"blender_frame": 62,+"matrix_world": [+[+0.7982869744300842,+-0.07856598496437073,+0.5971309542655945,+0.3374253213405609+],+[+0.6022773385047913,+0.10375474393367767,+-0.7915156483650208,+-1.3656079769134521+],+[+0.00023103776038624346,+0.9914950132369995,+0.13014455139636993,+1.2884963750839233+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.74253213405609,+136.56079769134521,+128.84963750839233+],+"forward": [+-0.5971309542655945,+-0.7915156483650208,+-0.13014455139636993+],+"up": [+-0.07856598496437073,+-0.10375474393367767,+0.9914950132369995+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 270.89578807353973+},+{+"blender_frame": 63,+"matrix_world": [+[+0.7983099222183228,+-0.07861746847629547,+0.5970935225486755,+0.336417019367218+],+[+0.6022468209266663,+0.10370766371488571,+-0.791545033454895,+-1.3640626668930054+],+[+0.0003060988965444267,+0.9914958477020264,+0.13013797998428345,+1.2881168127059937+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.6417019367218,+136.40626668930054,+128.81168127059937+],+"forward": [+-0.5970935225486755,+-0.791545033454895,+-0.13013797998428345+],+"up": [+-0.07861746847629547,+-0.10370766371488571,+0.9914958477020264+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 277.20933705568314+},+{+"blender_frame": 64,+"matrix_world": [+[+0.7982833981513977,+-0.07868179678916931,+0.5971205830574036,+0.33532023429870605+],+[+0.6022820472717285,+0.10368760675191879,+-0.7915207743644714,+-1.3624961376190186+],+[+0.0003642757947091013,+0.9914928674697876,+0.13016070425510406,+1.287764310836792+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.532023429870605,+136.24961376190186,+128.7764310836792+],+"forward": [+-0.5971206426620483,+-0.791520893573761,+-0.13016071915626526+],+"up": [+-0.07868179678916931,+-0.10368760675191879,+0.9914928674697876+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 283.9708134531975+},+{+"blender_frame": 65,+"matrix_world": [+[+0.7982131838798523,+-0.07867694646120071,+0.5972149968147278,+0.33419156074523926+],+[+0.6023749709129333,+0.10365553945302963,+-0.7914543151855469,+-1.3609470129013062+],+[+0.00036456651287153363,+0.9914966225624084,+0.13013224303722382,+1.2874327898025513+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.419156074523926,+136.09470129013062,+128.74327898025513+],+"forward": [+-0.5972149968147278,+-0.7914543151855469,+-0.13013224303722382+],+"up": [+-0.07867694646120071,+-0.10365553945302963,+0.9914966225624084+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 291.15838035941124+},+{+"blender_frame": 66,+"matrix_world": [+[+0.7981559634208679,+-0.07861100882291794,+0.5973000526428223,+0.33302587270736694+],+[+0.6024507284164429,+0.1035941019654274,+-0.791404664516449,+-1.35944664478302+],+[+0.0003363477298989892,+0.9915081858634949,+0.13004352152347565,+1.2870252132415771+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.302587270736694,+135.944664478302,+128.70252132415771+],+"forward": [+-0.5973000526428223,+-0.791404664516449,+-0.13004352152347565+],+"up": [+-0.07861101627349854,+-0.10359411686658859,+0.9915083050727844+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 298.7428329885006+},+{+"blender_frame": 67,+"matrix_world": [+[+0.7981078028678894,+-0.07850543409585953,+0.5973783135414124,+0.33186373114585876+],+[+0.6025146842002869,+0.10353530198335648,+-0.7913637161254883,+-1.3579308986663818+],+[+0.0002766045508906245,+0.9915226697921753,+0.12993299961090088,+1.2866265773773193+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.18637311458588,+135.79308986663818,+128.66265773773193+],+"forward": [+-0.5973783731460571,+-0.7913638353347778,+-0.12993301451206207+],+"up": [+-0.07850544154644012,+-0.10353531688451767,+0.9915227890014648+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 306.6925995051861+},+{+"blender_frame": 68,+"matrix_world": [+[+0.798118531703949,+-0.07844050973653793,+0.5973724126815796,+0.3306639492511749+],+[+0.602500319480896,+0.1035117357969284,+-0.7913777232170105,+-1.3563573360443115+],+[+0.00024101459712255746,+0.9915304183959961,+0.1298750638961792,+1.2863409519195557+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+33.06639492511749,+135.63573360443115,+128.63409519195557+],+"forward": [+-0.5973724126815796,+-0.7913777232170105,+-0.1298750638961792+],+"up": [+-0.07844050973653793,+-0.1035117357969284,+0.9915304183959961+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 314.970600605011+},+{+"blender_frame": 69,+"matrix_world": [+[+0.7981884479522705,+-0.07845594733953476,+0.5972769856452942,+0.329397588968277+],+[+0.6024077534675598,+0.10350668430328369,+-0.791448712348938,+-1.3548436164855957+],+[+0.0002716916787903756,+0.9915295839309692,+0.12988030910491943,+1.286119818687439+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+32.9397588968277,+135.48436164855957,+128.6119818687439+],+"forward": [+-0.5972771048545837,+-0.7914488911628723,+-0.12988033890724182+],+"up": [+-0.07845595479011536,+-0.10350669920444489,+0.9915297031402588+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 323.5503189265728+},+{+"blender_frame": 70,+"matrix_world": [+[+0.7982605695724487,+-0.07848739624023438,+0.5971765518188477,+0.3280945122241974+],+[+0.6023122072219849,+0.10348408669233322,+-0.7915245294570923,+-1.3534334897994995+],+[+0.00032642154837958515,+0.9915294647216797,+0.12988118827342987,+1.2858684062957764+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+32.80945122241974,+135.34334897994995,+128.58684062957764+],+"forward": [+-0.5971765518188477,+-0.7915245294570923,+-0.12988118827342987+],+"up": [+-0.07848740369081497,+-0.10348410159349442,+0.9915295839309692+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 332.40153044462204+},+{+"blender_frame": 71,+"matrix_world": [+[+0.7983056902885437,+-0.07852641493082047,+0.5971110463142395,+0.326824426651001+],+[+0.6022523641586304,+0.1034543365240097,+-0.7915738821029663,+-1.3519467115402222+],+[+0.0003857262490782887,+0.9915295243263245,+0.129880890250206,+1.285569190979004+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+32.6824426651001,+135.19467115402222,+128.5569190979004+],+"forward": [+-0.5971111059188843,+-0.7915740013122559,+-0.1298809051513672+],+"up": [+-0.07852641493082047,+-0.1034543365240097,+0.9915295243263245+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 341.47916063666344+},+{+"blender_frame": 72,+"matrix_world": [+[+0.7983102798461914,+-0.07851842790842056,+0.5971059203147888,+0.3255462050437927+],+[+0.6022462844848633,+0.10342536121606827,+-0.7915822863578796,+-1.3503645658493042+],+[+0.0003978954628109932,+0.9915331602096558,+0.12985292077064514,+1.2852922677993774+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+32.55462050437927,+135.03645658493042,+128.52922677993774+],+"forward": [+-0.5971059799194336,+-0.7915824055671692,+-0.12985293567180634+],+"up": [+-0.07851842790842056,+-0.10342536121606827,+0.9915331602096558+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 350.74395686388016+},+{+"blender_frame": 73,+"matrix_world": [+[+0.7983132600784302,+-0.0784604549407959,+0.5971096754074097,+0.3241705000400543+],+[+0.6022423505783081,+0.10342107713222504,+-0.7915858626365662,+-1.348800539970398+],+[+0.0003544589562807232,+0.9915382266044617,+0.12981462478637695,+1.2850571870803833+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+32.41705000400543,+134.8800539970398,+128.50571870803833+],+"forward": [+-0.5971096754074097,+-0.7915858626365662,+-0.12981462478637695+],+"up": [+-0.0784604549407959,+-0.10342107713222504,+0.9915382266044617+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 360.16179770231247+},+{+"blender_frame": 74,+"matrix_world": [+[+0.7983341813087463,+-0.07841256260871887,+0.5970880389213562,+0.3228207528591156+],+[+0.6022147536277771,+0.10345929116010666,+-0.791601836681366,+-1.3472833633422852+],+[+0.0002972166403196752,+0.9915379881858826,+0.12981626391410828,+1.2847881317138672+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+32.28207528591156,+134.72833633422852,+128.47881317138672+],+"forward": [+-0.597088098526001,+-0.7916019558906555,+-0.12981627881526947+],+"up": [+-0.07841257005929947,+-0.10345930606126785,+0.9915381073951721+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 369.70318108797073+},+{+"blender_frame": 75,+"matrix_world": [+[+0.7983530163764954,+-0.07838907837867737,+0.5970658659934998,+0.3215935230255127+],+[+0.6021897792816162,+0.10355749726295471,+-0.7916080951690674,+-1.3457571268081665+],+[+0.00022278056712821126,+0.991529643535614,+0.12988053262233734,+1.284435749053955+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+32.15935230255127,+134.57571268081665,+128.4435749053955+],+"forward": [+-0.5970658659934998,+-0.7916080951690674,+-0.12988053262233734+],+"up": [+-0.07838907837867737,+-0.10355749726295471,+0.991529643535614+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 379.3309837579727+},+{+"blender_frame": 76,+"matrix_world": [+[+0.7983466386795044,+-0.07837296277284622,+0.5970765948295593,+0.3204369843006134+],+[+0.6021983027458191,+0.10367269068956375,+-0.7915865182876587,+-1.3441808223724365+],+[+0.00013845095236320049,+0.9915188550949097,+0.12996278703212738,+1.2840570211410522+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+32.04369843006134,+134.41808223724365,+128.40570211410522+],+"forward": [+-0.5970765948295593,+-0.7915865182876587,+-0.12996278703212738+],+"up": [+-0.07837296277284622,+-0.10367269068956375,+0.9915188550949097+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 389.00129720568657+},+{+"blender_frame": 77,+"matrix_world": [+[+0.7983183860778809,+-0.07833584398031235,+0.597119152545929,+0.3192746043205261+],+[+0.6022356748580933,+0.1037386804819107,+-0.7915493249893188,+-1.3425871133804321+],+[+6.233144813450053e-05,+0.9915148019790649,+0.12999312579631805,+1.2837477922439575+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.927460432052612,+134.2587113380432,+128.37477922439575+],+"forward": [+-0.5971192121505737,+-0.7915494441986084,+-0.12999314069747925+],+"up": [+-0.07833585143089294,+-0.1037386953830719,+0.9915149211883545+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 398.6740805208683+},+{+"blender_frame": 78,+"matrix_world": [+[+0.7983000874519348,+-0.07828649878501892,+0.5971502661705017,+0.31809887290000916+],+[+0.6022601127624512,+0.10376440733671188,+-0.7915274500846863,+-1.3410682678222656+],+[+2.975935785798356e-06,+0.9915160536766052,+0.12998394668102264,+1.2835140228271484+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.809887290000916,+134.10682678222656,+128.35140228271484+],+"forward": [+-0.5971503257751465,+-0.7915275692939758,+-0.12998396158218384+],+"up": [+-0.07828650623559952,+-0.10376442223787308,+0.9915161728858948+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 408.3165094256401+},+{+"blender_frame": 79,+"matrix_world": [+[+0.7982903122901917,+-0.07828313857316971,+0.5971636772155762,+0.31696856021881104+],+[+0.6022729873657227,+0.10381333529949188,+-0.7915112376213074,+-1.3395938873291016+],+[+-3.156521052005701e-05,+0.9915112853050232,+0.13002097606658936,+1.2832894325256348+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.696856021881104,+133.95938873291016,+128.32894325256348+],+"forward": [+-0.597163736820221,+-0.7915113568305969,+-0.13002099096775055+],+"up": [+-0.07828313857316971,+-0.10381333529949188,+0.9915112853050232+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 417.8904816508293+},+{+"blender_frame": 80,+"matrix_world": [+[+0.7983142733573914,+-0.07833576947450638,+0.5971248149871826,+0.3158422112464905+],+[+0.6022412776947021,+0.1038617342710495,+-0.79152911901474,+-1.3381195068359375+],+[+-1.3375100934354123e-05,+0.991502046585083,+0.1300913244485855,+1.2830876111984253+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.584221124649048,+133.81195068359375,+128.30876111984253+],+"forward": [+-0.5971247553825378,+-0.7915289998054504,+-0.13009130954742432+],+"up": [+-0.07833576947450638,+-0.1038617342710495,+0.991502046585083+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 427.3504741489887+},+{+"blender_frame": 81,+"matrix_world": [+[+0.7983739972114563,+-0.07836466282606125,+0.5970410108566284,+0.3146878480911255+],+[+0.6021619439125061,+0.10383234173059464,+-0.7915932536125183,+-1.3366148471832275+],+[+4.077393896295689e-05,+0.9915028214454651,+0.13008525967597961,+1.2828452587127686+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.46878480911255,+133.66148471832275,+128.28452587127686+],+"forward": [+-0.5970410108566284,+-0.7915932536125183,+-0.13008525967597961+],+"up": [+-0.07836466282606125,+-0.10383234173059464,+0.9915028214454651+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 436.6530977189541+},+{+"blender_frame": 82,+"matrix_world": [+[+0.7984405755996704,+-0.07833323627710342,+0.5969561338424683,+0.3135266602039337+],+[+0.6020737290382385,+0.10372570902109146,+-0.7916743159294128,+-1.3351200819015503+],+[+9.471966041019186e-05,+0.9915163516998291,+0.12998118996620178,+1.2825943231582642+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.35266602039337,+133.51200819015503,+128.25943231582642+],+"forward": [+-0.596956193447113,+-0.7916744351387024,+-0.12998120486736298+],+"up": [+-0.07833324372768402,+-0.10372572392225266,+0.9915164709091187+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 445.7668401300907+},+{+"blender_frame": 83,+"matrix_world": [+[+0.7984856367111206,+-0.07827157527208328,+0.596903920173645,+0.3123874366283417+],+[+0.602013885974884,+0.10361538082361221,+-0.7917342782020569,+-1.3336387872695923+],+[+0.00012186130334157497,+0.9915328621864319,+0.12985597550868988,+1.2823445796966553+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.238743662834167,+133.36387872695923,+128.23445796966553+],+"forward": [+-0.596903920173645,+-0.7917342782020569,+-0.12985597550868988+],+"up": [+-0.07827157527208328,+-0.10361538082361221,+0.9915328621864319+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 454.65849339962006+},+{+"blender_frame": 84,+"matrix_world": [+[+0.7985234260559082,+-0.07822766900062561,+0.5968591570854187,+0.3112623393535614+],+[+0.6019637584686279,+0.10355653613805771,+-0.7917801737785339,+-1.3321418762207031+],+[+0.0001304452307522297,+0.9915424585342407,+0.1297825425863266,+1.2821273803710938+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.12623393535614,+133.2141876220703,+128.21273803710938+],+"forward": [+-0.5968590974807739,+-0.7917800545692444,+-0.1297825276851654+],+"up": [+-0.07822767645120621,+-0.1035565510392189,+0.9915425777435303+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 463.2897175848484+},+{+"blender_frame": 85,+"matrix_world": [+[+0.7985979914665222,+-0.07822976261377335,+0.5967588424682617,+0.3100782632827759+],+[+0.6018646359443665,+0.10352852940559387,+-0.7918590307235718,+-1.3306400775909424+],+[+0.00016537454212084413,+0.9915452599525452,+0.12976139783859253,+1.2819372415542603+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+31.007826328277588,+133.06400775909424,+128.19372415542603+],+"forward": [+-0.5967589020729065,+-0.7918591499328613,+-0.12976141273975372+],+"up": [+-0.07822976261377335,+-0.10352852940559387,+0.9915452599525452+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 471.6200701892376+},+{+"blender_frame": 86,+"matrix_world": [+[+0.7987033128738403,+-0.07824266701936722,+0.5966163277626038,+0.30882591009140015+],+[+0.6017249226570129,+0.10349356383085251,+-0.7919698357582092,+-1.329178810119629+],+[+0.00021988047228660434,+0.9915479421615601,+0.12974120676517487,+1.2817012071609497+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+30.882591009140015,+132.9178810119629,+128.17012071609497+],+"forward": [+-0.5966163277626038,+-0.7919698357582092,+-0.12974120676517487+],+"up": [+-0.07824265956878662,+-0.10349354892969131,+0.9915478229522705+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 479.6181246638298+},+{+"blender_frame": 87,+"matrix_world": [+[+0.7988145351409912,+-0.07823235541582108,+0.5964689254760742,+0.30756697058677673+],+[+0.6015774011611938,+0.10345453023910522,+-0.7920870780944824,+-1.3278082609176636+],+[+0.00025942776119336486,+0.9915527701377869,+0.12970377504825592,+1.2813776731491089+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+30.756697058677673,+132.78082609176636,+128.1377673149109+],+"forward": [+-0.5964688658714294,+-0.7920869588851929,+-0.12970376014709473+],+"up": [+-0.07823235541582108,+-0.10345453023910522,+0.9915527701377869+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 487.2598126530647+},+{+"blender_frame": 88,+"matrix_world": [+[+0.7988713383674622,+-0.07818520069122314,+0.5963989496231079,+0.3063265383243561+],+[+0.6015019416809082,+0.1034417599439621,+-0.7921459674835205,+-1.3264107704162598+],+[+0.0002415369381196797,+0.9915578365325928,+0.12966521084308624,+1.2810364961624146+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+30.632653832435608,+132.64107704162598,+128.10364961624146+],+"forward": [+-0.5963989496231079,+-0.7921459674835205,+-0.12966521084308624+],+"up": [+-0.07818520069122314,+-0.1034417599439621,+0.9915578365325928+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 494.5103242993355+},+{+"blender_frame": 89,+"matrix_world": [+[+0.7988621592521667,+-0.07814641296863556,+0.5964164733886719,+0.30506569147109985+],+[+0.6015142798423767,+0.10349326580762863,+-0.7921299338340759,+-1.3249489068984985+],+[+0.0001770212547853589,+0.9915554523468018,+0.12968303263187408,+1.2807291746139526+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+30.506569147109985,+132.49489068984985,+128.07291746139526+],+"forward": [+-0.5964164733886719,+-0.7921299338340759,+-0.12968303263187408+],+"up": [+-0.07814642041921616,+-0.10349328070878983,+0.9915555715560913+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 501.33628994226456+},+{+"blender_frame": 90,+"matrix_world": [+[+0.7988335490226746,+-0.07814572006464005,+0.5964547991752625,+0.3037959933280945+],+[+0.6015521883964539,+0.10358483344316483,+-0.7920891046524048,+-1.323493242263794+],+[+0.00011470465688034892,+0.9915459752082825,+0.12975576519966125,+1.2803664207458496+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+30.37959933280945,+132.3493242263794,+128.03664207458496+],+"forward": [+-0.5964547991752625,+-0.7920891046524048,+-0.12975576519966125+],+"up": [+-0.07814572006464005,+-0.10358483344316483,+0.9915459752082825+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 507.71294236183167+},+{+"blender_frame": 91,+"matrix_world": [+[+0.7988077402114868,+-0.07814086228609085,+0.5964899659156799,+0.30256152153015137+],+[+0.6015864014625549,+0.10371619462966919,+-0.7920459508895874,+-1.3221087455749512+],+[+2.5489938707323745e-05,+0.9915326237678528,+0.12985779345035553,+1.279936671257019+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+30.256152153015137,+132.21087455749512,+127.9936671257019+],+"forward": [+-0.5964899659156799,+-0.7920459508895874,+-0.12985779345035553+],+"up": [+-0.07814086228609085,+-0.10371619462966919,+0.9915326237678528+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 513.6211290955544+},+{+"blender_frame": 92,+"matrix_world": [+[+0.7987929582595825,+-0.07812432199716568,+0.596511960029602,+0.3014158010482788+],+[+0.6016060709953308,+0.10381001234054565,+-0.792018711566925,+-1.3207966089248657+],+[+-4.798513691639528e-05,+0.9915241003036499,+0.1299227774143219,+1.2795785665512085+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+30.14158010482788,+132.07966089248657,+127.95785665512085+],+"forward": [+-0.596511960029602,+-0.792018711566925,+-0.1299227774143219+],+"up": [+-0.07812432944774628,+-0.10381002724170685,+0.9915242195129395+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 519.041396677494+},+{+"blender_frame": 93,+"matrix_world": [+[+0.7987509369850159,+-0.07811735570430756,+0.5965691208839417,+0.30032283067703247+],+[+0.6016618013381958,+0.10380274057388306,+-0.7919772863388062,+-1.3194936513900757+],+[+-5.834119292558171e-05,+0.9915254712104797,+0.12991277873516083,+1.2792965173721313+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+30.032283067703247,+131.94936513900757,+127.92965173721313+],+"forward": [+-0.5965691208839417,+-0.7919772863388062,+-0.12991277873516083+],+"up": [+-0.07811735570430756,+-0.10380274057388306,+0.9915254712104797+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 523.9465147256851+},+{+"blender_frame": 94,+"matrix_world": [+[+0.7986710071563721,+-0.0781305730342865,+0.5966743230819702,+0.2992529571056366+],+[+0.601767897605896,+0.10374277085065842,+-0.7919044494628906,+-1.3182536363601685+],+[+-2.8704642318189144e-05,+0.9915305972099304,+0.12987281382083893,+1.2789983749389648+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.92529571056366,+131.82536363601685,+127.89983749389648+],+"forward": [+-0.596674382686615,+-0.7919045686721802,+-0.12987282872200012+],+"up": [+-0.0781305804848671,+-0.10374278575181961,+0.99153071641922+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 528.3182621002197+},+{+"blender_frame": 95,+"matrix_world": [+[+0.798585832118988,+-0.0781991109251976,+0.5967794060707092,+0.2981310486793518+],+[+0.6018809676170349,+0.10370270907878876,+-0.7918239235877991,+-1.3170191049575806+],+[+3.228702553315088e-05,+0.9915294647216797,+0.1298820823431015,+1.2785638570785522+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.81310486793518,+131.70191049575806,+127.85638570785522+],+"forward": [+-0.5967794060707092,+-0.7918239235877991,+-0.1298820823431015+],+"up": [+-0.0781991109251976,+-0.10370270907878876,+0.9915294647216797+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 532.1265444159508+},+{+"blender_frame": 96,+"matrix_world": [+[+0.7985296249389648,+-0.07827555388212204,+0.5968445539474487,+0.2970099449157715+],+[+0.6019555926322937,+0.10370084643363953,+-0.7917674779891968,+-1.3157129287719727+],+[+8.275052095996216e-05,+0.9915236234664917,+0.12992659211158752,+1.2780911922454834+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.70099449157715,+131.57129287719727,+127.80911922454834+],+"forward": [+-0.5968445539474487,+-0.7917674779891968,+-0.12992659211158752+],+"up": [+-0.07827555388212204,+-0.10370084643363953,+0.9915236234664917+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 535.3523559868336+},+{+"blender_frame": 97,+"matrix_world": [+[+0.7985033988952637,+-0.07827933877706528,+0.5968791842460632,+0.29593372344970703+],+[+0.6019904017448425,+0.10367685556411743,+-0.7917441725730896,+-1.3144044876098633+],+[+9.464928007218987e-05,+0.9915258288383484,+0.12990973889827728,+1.2776342630386353+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.593372344970703,+131.44044876098633,+127.76342630386353+],+"forward": [+-0.5968791842460632,+-0.7917441725730896,+-0.12990973889827728+],+"up": [+-0.07827933877706528,+-0.10367685556411743,+0.9915258288383484+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 537.9916340112686+},+{+"blender_frame": 98,+"matrix_world": [+[+0.7984840869903564,+-0.07823874056339264,+0.5969103574752808,+0.2949675917625427+],+[+0.602016031742096,+0.10361886024475098,+-0.791732132434845,+-1.3131206035614014+],+[+9.296100324718282e-05,+0.9915351271629333,+0.1298389732837677,+1.2772942781448364+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.496759176254272,+131.31206035614014,+127.72942781448364+],+"forward": [+-0.5969104170799255,+-0.7917322516441345,+-0.1298389881849289+],+"up": [+-0.07823874056339264,+-0.10361886024475098,+0.9915351271629333+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.0414809584618+},+{+"blender_frame": 99,+"matrix_world": [+[+0.7984535694122314,+-0.07822053134441376,+0.5969535708427429,+0.29407280683517456+],+[+0.6020565629005432,+0.10361498594284058,+-0.7917019128799438,+-1.3118516206741333+],+[+7.400379399769008e-05,+0.9915369749069214,+0.1298249214887619,+1.2770943641662598+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.407280683517456,+131.18516206741333,+127.70943641662598+],+"forward": [+-0.5969535708427429,+-0.7917019128799438,+-0.1298249214887619+],+"up": [+-0.07822053134441376,+-0.10361498594284058,+0.9915369749069214+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.4910115301609+},+{+"blender_frame": 100,+"matrix_world": [+[+0.7984290719032288,+-0.078244149684906,+0.5969831347465515,+0.2931581139564514+],+[+0.6020889282226562,+0.10364463180303574,+-0.7916733026504517,+-1.3106051683425903+],+[+6.970649701543152e-05,+0.9915319085121155,+0.12986281514167786,+1.2769194841384888+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.31581139564514,+131.06051683425903,+127.69194841384888+],+"forward": [+-0.5969831943511963,+-0.7916734218597412,+-0.12986283004283905+],+"up": [+-0.0782441571354866,+-0.10364464670419693,+0.991532027721405+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 542.326620221138+},+{+"blender_frame": 101,+"matrix_world": [+[+0.7984514832496643,+-0.07826465368270874,+0.5969504714012146,+0.2922098934650421+],+[+0.6020592451095581,+0.10365045815706253,+-0.7916951775550842,+-1.3093633651733398+],+[+8.75678815646097e-05,+0.9915297031402588,+0.12987980246543884,+1.2767361402511597+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.22098934650421,+130.93633651733398,+127.67361402511597+],+"forward": [+-0.5969505310058594,+-0.7916952967643738,+-0.12987981736660004+],+"up": [+-0.07826466113328934,+-0.10365047305822372,+0.9915298223495483+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 542.5398625433445+},+{+"blender_frame": 102,+"matrix_world": [+[+0.7985140681266785,+-0.07824168354272842,+0.596869707107544,+0.2912011742591858+],+[+0.6019761562347412,+0.10363397747278214,+-0.7917605042457581,+-1.3081649541854858+],+[+9.268921712646261e-05,+0.9915332198143005,+0.1298528015613556,+1.2764697074890137+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.12011742591858,+130.81649541854858,+127.64697074890137+],+"forward": [+-0.5968697667121887,+-0.7917606234550476,+-0.12985281646251678+],+"up": [+-0.07824169099330902,+-0.10363399237394333,+0.9915333390235901+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 542.3813469707966+},+{+"blender_frame": 103,+"matrix_world": [+[+0.7985936403274536,+-0.07816684991121292,+0.5967733263969421,+0.2902149260044098+],+[+0.6018707752227783,+0.10363385826349258,+-0.791840672492981,+-1.307032585144043+],+[+4.976720447302796e-05,+0.9915392398834229,+0.12980766594409943,+1.2762081623077393+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+29.02149260044098,+130.7032585144043,+127.62081623077393+],+"forward": [+-0.5967733263969421,+-0.791840672492981,+-0.12980766594409943+],+"up": [+-0.07816684991121292,+-0.10363385826349258,+0.9915392398834229+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 542.2257296741009+},+{+"blender_frame": 104,+"matrix_world": [+[+0.7986272573471069,+-0.07810017466545105,+0.5967367887496948,+0.2892684042453766+],+[+0.6018259525299072,+0.10368915647268295,+-0.7918674349784851,+-1.3059580326080322+],+[+-3.0149869417073205e-05,+0.9915387034416199,+0.12981168925762177,+1.2759886980056763+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.92684042453766,+130.59580326080322,+127.59886980056763+],+"forward": [+-0.5967368483543396,+-0.7918675541877747,+-0.12981170415878296+],+"up": [+-0.07810017466545105,+-0.10368915647268295,+0.9915387034416199+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 542.0799091458321+},+{+"blender_frame": 105,+"matrix_world": [+[+0.7986001372337341,+-0.0780956968665123,+0.5967737436294556,+0.28835269808769226+],+[+0.6018620729446411,+0.1037520170211792,+-0.7918318510055542,+-1.3049241304397583+],+[+-7.782012107782066e-05,+0.9915324449539185,+0.12985920906066895,+1.2757896184921265+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.835269808769226,+130.49241304397583,+127.57896184921265+],+"forward": [+-0.5967737436294556,+-0.7918318510055542,+-0.12985920906066895+],+"up": [+-0.0780956968665123,+-0.1037520170211792,+0.9915324449539185+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.9421449303627+},+{+"blender_frame": 106,+"matrix_world": [+[+0.7985610365867615,+-0.07811540365219116,+0.596823513507843,+0.287453293800354+],+[+0.6019139885902405,+0.10375778377056122,+-0.791791558265686,+-1.3038634061813354+],+[+-7.396483124466613e-05,+0.9915302395820618,+0.12987564504146576,+1.2755252122879028+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.7453293800354,+130.38634061813354,+127.55252122879028+],+"forward": [+-0.5968235731124878,+-0.7917916774749756,+-0.12987565994262695+],+"up": [+-0.07811541110277176,+-0.10375779867172241,+0.9915303587913513+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.8030053377151+},+{+"blender_frame": 107,+"matrix_world": [+[+0.798538327217102,+-0.07814332842826843,+0.5968502759933472,+0.28659164905548096+],+[+0.6019441485404968,+0.10372618585824966,+-0.7917728424072266,+-1.3027845621109009+],+[+-3.723652116605081e-05,+0.9915313720703125,+0.12986722588539124,+1.2751833200454712+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.659164905548096,+130.2784562110901,+127.51833200454712+],+"forward": [+-0.5968502759933472,+-0.7917728424072266,+-0.12986722588539124+],+"up": [+-0.07814333587884903,+-0.10372620075941086,+0.991531491279602+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.6626997292042+},+{+"blender_frame": 108,+"matrix_world": [+[+0.7985296249389648,+-0.0781063586473465,+0.5968667268753052,+0.28582078218460083+],+[+0.6019556522369385,+0.10364491492509842,+-0.7917746901512146,+-1.3017053604125977+],+[+-1.9565573893487453e-05,+0.9915427565574646,+0.1297800987958908,+1.2748045921325684+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.582078218460083,+130.17053604125977,+127.48045921325684+],+"forward": [+-0.59686678647995,+-0.7917748093605042,+-0.129780113697052+],+"up": [+-0.0781063660979271,+-0.10364492982625961,+0.9915428757667542+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.5270611643791+},+{+"blender_frame": 109,+"matrix_world": [+[+0.7984856963157654,+-0.07800767570734024,+0.5969384908676147,+0.2851777970790863+],+[+0.6020139455795288,+0.1035420224070549,+-0.7917438745498657,+-1.300670862197876+],+[+-4.6124623622745275e-05,+0.9915612936019897,+0.12963853776454926,+1.2745118141174316+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.51777970790863,+130.0670862197876,+127.45118141174316+],+"forward": [+-0.5969384908676147,+-0.7917438745498657,+-0.12963853776454926+],+"up": [+-0.07800768315792084,+-0.1035420373082161,+0.9915614128112793+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.4057441055775+},+{+"blender_frame": 110,+"matrix_world": [+[+0.7984034419059753,+-0.07792437076568604,+0.5970592498779297,+0.2845305800437927+],+[+0.6021230220794678,+0.10345421731472015,+-0.7916722893714905,+-1.2996529340744019+],+[+-7.773496326990426e-05,+0.9915771484375,+0.12951822578907013,+1.2742677927017212+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.453058004379272,+129.96529340744019,+127.42677927017212+],+"forward": [+-0.5970593690872192,+-0.7916724681854248,+-0.12951825559139252+],+"up": [+-0.07792436331510544,+-0.10345420241355896,+0.9915770292282104+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.2881076335907+},+{+"blender_frame": 111,+"matrix_world": [+[+0.7983518242835999,+-0.07783904671669006,+0.5971394181251526,+0.2838346064090729+],+[+0.6021912693977356,+0.1033749058842659,+-0.7916308045387268,+-1.2986321449279785+],+[+-0.0001094446488423273,+0.9915919899940491,+0.12940354645252228,+1.273987054824829+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.383460640907288,+129.86321449279785,+127.39870548248291+],+"forward": [+-0.5971394181251526,+-0.7916308045387268,+-0.12940354645252228+],+"up": [+-0.07783905416727066,+-0.1033749207854271,+0.9915921092033386+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.1651998758316+},+{+"blender_frame": 112,+"matrix_world": [+[+0.7983279824256897,+-0.07783737778663635,+0.5971714854240417,+0.2830764949321747+],+[+0.6022229194641113,+0.10334081947803497,+-0.7916111350059509,+-1.2976305484771729+],+[+-9.524301276542246e-05,+0.9915957450866699,+0.12937532365322113,+1.2736647129058838+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.30764949321747,+129.76305484771729,+127.36647129058838+],+"forward": [+-0.5971715450286865,+-0.7916112542152405,+-0.12937533855438232+],+"up": [+-0.07783737778663635,+-0.10334081947803497,+0.9915957450866699+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 541.0377234220505+},+{+"blender_frame": 113,+"matrix_world": [+[+0.7982807159423828,+-0.07793625444173813,+0.597221851348877,+0.28233394026756287+],+[+0.602285623550415,+0.10335387289524078,+-0.7915617823600769,+-1.296684741973877+],+[+-3.382716022315435e-05,+0.9915865659713745,+0.12944531440734863,+1.2734403610229492+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.233394026756287,+129.6684741973877,+127.34403610229492+],+"forward": [+-0.597221851348877,+-0.7915617823600769,+-0.12944531440734863+],+"up": [+-0.07793625444173813,+-0.10335387289524078,+0.9915865659713745+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.917457640171+},+{+"blender_frame": 114,+"matrix_world": [+[+0.7982121109962463,+-0.07804903388023376,+0.597298800945282,+0.28163015842437744+],+[+0.6023766398429871,+0.1033826544880867,+-0.7914888262748718,+-1.2957870960235596+],+[+2.4610366381239146e-05,+0.9915747046470642,+0.1295361965894699,+1.2733206748962402+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.163015842437744,+129.57870960235596,+127.33206748962402+],+"forward": [+-0.597298800945282,+-0.7914888262748718,+-0.1295361965894699+],+"up": [+-0.07804903388023376,+-0.1033826544880867,+0.9915747046470642+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.8056817948818+},+{+"blender_frame": 115,+"matrix_world": [+[+0.79819655418396,+-0.07816433906555176,+0.5973044633865356,+0.2809011936187744+],+[+0.6023971438407898,+0.10345787554979324,+-0.7914633750915527,+-1.2948943376541138+],+[+6.836671673227102e-05,+0.9915576577186584,+0.12966571748256683,+1.2731813192367554+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.09011936187744,+129.48943376541138,+127.31813192367554+],+"forward": [+-0.5973044633865356,+-0.7914633750915527,+-0.12966571748256683+],+"up": [+-0.07816434651613235,+-0.10345789045095444,+0.991557776927948+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.6898312270641+},+{+"blender_frame": 116,+"matrix_world": [+[+0.7982345223426819,+-0.07822535932064056,+0.5972458720207214,+0.280110627412796+],+[+0.6023468971252441,+0.10352912545204163,+-0.7914922833442688,+-1.2940609455108643+],+[+8.242272451752797e-05,+0.9915454983711243,+0.12975932657718658,+1.2729405164718628+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+28.011062741279602,+129.40609455108643,+127.29405164718628+],+"forward": [+-0.5972458720207214,+-0.7914922833442688,+-0.12975932657718658+],+"up": [+-0.07822536677122116,+-0.10352914035320282,+0.9915456175804138+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.5712485313416+},+{+"blender_frame": 117,+"matrix_world": [+[+0.7982644438743591,+-0.07823372632265091,+0.5972047448158264,+0.279323548078537+],+[+0.6023072600364685,+0.10354199260473251,+-0.7915207147598267,+-1.293312668800354+],+[+8.785488898865879e-05,+0.9915435910224915,+0.12977461516857147,+1.2726845741271973+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.9323548078537,+129.3312668800354,+127.26845741271973+],+"forward": [+-0.5972047448158264,+-0.7915207147598267,+-0.12977461516857147+],+"up": [+-0.07823372632265091,+-0.10354199260473251,+0.9915435910224915+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.4600821435452+},+{+"blender_frame": 118,+"matrix_world": [+[+0.7982689738273621,+-0.07823947817087173,+0.597197949886322,+0.27856069803237915+],+[+0.6023011803627014,+0.10352393239736557,+-0.7915276885032654,+-1.2925646305084229+],+[+0.00010444023064337671,+0.9915449023246765,+0.12976369261741638,+1.2723922729492188+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.856069803237915,+129.25646305084229,+127.23922729492188+],+"forward": [+-0.597197949886322,+-0.7915276885032654,+-0.12976369261741638+],+"up": [+-0.07823948562145233,+-0.10352394729852676,+0.9915450215339661+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.351278334856+},+{+"blender_frame": 119,+"matrix_world": [+[+0.7982815504074097,+-0.07823172956705093,+0.5971820950508118,+0.2777937948703766+],+[+0.6022846102714539,+0.10350916534662247,+-0.7915421724319458,+-1.2917520999908447+],+[+0.00010989277507178485,+0.991547167301178,+0.1297471821308136,+1.2721048593521118+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.77937948703766,+129.17520999908447,+127.21048593521118+],+"forward": [+-0.5971821546554565,+-0.7915422916412354,+-0.1297471970319748+],+"up": [+-0.07823172956705093,+-0.10350916534662247,+0.991547167301178+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.2368754148483+},+{+"blender_frame": 120,+"matrix_world": [+[+0.7983335256576538,+-0.07821083813905716,+0.5971152186393738,+0.2769845128059387+],+[+0.6022156476974487,+0.10347431898117065,+-0.7915992736816406,+-1.290993332862854+],+[+0.00012555206194519997,+0.9915523529052734,+0.12970678508281708,+1.2718881368637085+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.698451280593872,+129.0993332862854,+127.18881368637085+],+"forward": [+-0.5971152782440186,+-0.7915993928909302,+-0.12970679998397827+],+"up": [+-0.07821084558963776,+-0.10347433388233185,+0.991552472114563+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.1231616735458+},+{+"blender_frame": 121,+"matrix_world": [+[+0.7984066009521484,+-0.0781744197010994,+0.5970224738121033,+0.2761756181716919+],+[+0.602118730545044,+0.10339073836803436,+-0.7916839122772217,+-1.2903211116790771+],+[+0.0001628408208489418,+0.9915639758110046,+0.12961812317371368,+1.2716875076293945+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.61756181716919,+129.03211116790771,+127.16875076293945+],+"forward": [+-0.5970224738121033,+-0.7916839122772217,+-0.12961812317371368+],+"up": [+-0.0781744197010994,+-0.10339073836803436,+0.9915639758110046+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 540.0156073272228+},+{+"blender_frame": 122,+"matrix_world": [+[+0.798460841178894,+-0.07812584936618805,+0.5969561338424683,+0.2753972113132477+],+[+0.6020467877388,+0.10328026860952377,+-0.7917530536651611,+-1.289646029472351+],+[+0.00020258741278667003,+0.9915793538093567,+0.1295006424188614,+1.2714743614196777+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.539721131324768,+128.9646029472351,+127.14743614196777+],+"forward": [+-0.596956193447113,+-0.7917531728744507,+-0.12950065732002258+],+"up": [+-0.07812584936618805,+-0.10328026860952377,+0.9915793538093567+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.910489320755+},+{+"blender_frame": 123,+"matrix_world": [+[+0.7985313534736633,+-0.07809288054704666,+0.5968660712242126,+0.2747938930988312+],+[+0.6019530892372131,+0.10323511809110641,+-0.7918301224708557,+-1.2889612913131714+],+[+0.00021876429673284292,+0.9915865659713745,+0.12944473326206207,+1.2712125778198242+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.479389309883118,+128.89612913131714,+127.12125778198242+],+"forward": [+-0.5968660712242126,+-0.7918301224708557,+-0.12944473326206207+],+"up": [+-0.07809288799762726,+-0.10323513299226761,+0.9915866851806641+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.8133851587772+},+{+"blender_frame": 124,+"matrix_world": [+[+0.7985895872116089,+-0.0780627429485321,+0.5967921614646912,+0.2743050754070282+],+[+0.6018759608268738,+0.10326362401247025,+-0.7918850779533386,+-1.2882797718048096+],+[+0.0001897929614642635,+0.9915860891342163,+0.12944933772087097,+1.2709980010986328+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.43050754070282,+128.82797718048096,+127.09980010986328+],+"forward": [+-0.5967921614646912,+-0.7918850779533386,+-0.12944933772087097+],+"up": [+-0.0780627429485321,+-0.10326362401247025,+0.9915860891342163+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.7246055305004+},+{+"blender_frame": 125,+"matrix_world": [+[+0.7986153960227966,+-0.07801415771245956,+0.596764087677002,+0.27383163571357727+],+[+0.6018418073654175,+0.10326902568340302,+-0.7919102907180786,+-1.2876355648040771+],+[+0.0001529766886960715,+0.991589367389679,+0.12942439317703247,+1.2708312273025513+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.383163571357727,+128.76355648040771,+127.08312273025513+],+"forward": [+-0.596764087677002,+-0.7919102907180786,+-0.12942439317703247+],+"up": [+-0.07801415026187897,+-0.10326901078224182,+0.9915892481803894+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.6421618759632+},+{+"blender_frame": 126,+"matrix_world": [+[+0.7986368536949158,+-0.0779598206281662,+0.5967422723770142,+0.27331802248954773+],+[+0.6018131971359253,+0.10323314368724823,+-0.7919366955757141,+-1.2869956493377686+],+[+0.0001356640859739855,+0.9915972352027893,+0.1293630301952362,+1.2707197666168213+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.331802248954773,+128.69956493377686,+127.07197666168213+],+"forward": [+-0.5967423319816589,+-0.7919368147850037,+-0.1293630450963974+],+"up": [+-0.0779598280787468,+-0.10323315858840942,+0.9915973544120789+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.5586401224136+},+{+"blender_frame": 127,+"matrix_world": [+[+0.7986496686935425,+-0.07789600640535355,+0.5967336893081665,+0.2728424668312073+],+[+0.6017963886260986,+0.10322118550539017,+-0.7919511795043945,+-1.286312222480774+],+[+9.427488839719445e-05,+0.9916035532951355,+0.1293150931596756,+1.270673155784607+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.284246683120728,+128.6312222480774,+127.0673155784607+],+"forward": [+-0.5967336893081665,+-0.7919511795043945,+-0.1293150931596756+],+"up": [+-0.07789600640535355,+-0.10322118550539017,+0.9916035532951355+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.4752018153667+},+{+"blender_frame": 128,+"matrix_world": [+[+0.7986948490142822,+-0.07787250727415085,+0.5966761112213135,+0.27245834469795227+],+[+0.601736307144165,+0.1032598540186882,+-0.7919915914535522,+-1.2856647968292236+],+[+6.168252730276436e-05,+0.991601288318634,+0.1293318122625351,+1.2706362009048462+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.245834469795227,+128.56647968292236,+127.06362009048462+],+"forward": [+-0.5966761708259583,+-0.7919917106628418,+-0.1293318271636963+],+"up": [+-0.07787251472473145,+-0.1032598689198494,+0.9916014075279236+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.3982760608196+},+{+"blender_frame": 129,+"matrix_world": [+[+0.7987675070762634,+-0.077918142080307,+0.5965729355812073,+0.272142618894577+],+[+0.6016398668289185,+0.10333184897899628,+-0.792055606842041,+-1.2851297855377197+],+[+7.052237197058275e-05,+0.9915903210639954,+0.12941677868366241,+1.270560622215271+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.214261889457703,+128.51297855377197,+127.0560622215271+],+"forward": [+-0.5965729355812073,+-0.792055606842041,+-0.12941677868366241+],+"up": [+-0.077918142080307,+-0.10333184897899628,+0.9915903210639954+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.3320962786674+},+{+"blender_frame": 130,+"matrix_world": [+[+0.7988123297691345,+-0.07798966765403748,+0.5965036749839783,+0.2718312442302704+],+[+0.6015804409980774,+0.10339610278606415,+-0.7920923829078674,+-1.2846795320510864+],+[+9.886975749395788e-05,+0.9915779232978821,+0.12951113283634186,+1.2705087661743164+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.18312442302704,+128.46795320510864,+127.05087661743164+],+"forward": [+-0.5965036749839783,+-0.7920923829078674,+-0.12951113283634186+],+"up": [+-0.07798967510461807,+-0.10339611768722534,+0.9915780425071716+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.274475723505+},+{+"blender_frame": 131,+"matrix_world": [+[+0.7988120913505554,+-0.07808702439069748,+0.5964910387992859,+0.27149125933647156+],+[+0.6015806198120117,+0.10347601026296616,+-0.7920817136764526,+-1.2842127084732056+],+[+0.00012879226414952427,+0.9915619492530823,+0.12963351607322693,+1.2705124616622925+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.149125933647156,+128.42127084732056,+127.05124616622925+],+"forward": [+-0.5964910984039307,+-0.7920818328857422,+-0.12963353097438812+],+"up": [+-0.07808702439069748,+-0.10347601026296616,+0.9915619492530823+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.2166912555695+},+{+"blender_frame": 132,+"matrix_world": [+[+0.7987683415412903,+-0.07813714444637299,+0.5965433120727539,+0.27110376954078674+],+[+0.601638913154602,+0.10354381054639816,+-0.792028546333313,+-1.2837769985198975+],+[+0.00011848529538838193,+0.9915509223937988,+0.1297178417444229,+1.2705129384994507+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.110376954078674,+128.37769985198975,+127.05129384994507+],+"forward": [+-0.5965433716773987,+-0.7920286655426025,+-0.1297178566455841+],+"up": [+-0.07813714444637299,+-0.10354381054639816,+0.9915509223937988+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.1610853374004+},+{+"blender_frame": 133,+"matrix_world": [+[+0.7987282276153564,+-0.0781082957983017,+0.5966007113456726,+0.27067989110946655+],+[+0.6016920804977417,+0.10354862362146378,+-0.7919875383377075,+-1.2833683490753174+],+[+8.36103135952726e-05,+0.9915527701377869,+0.1297043263912201,+1.2704272270202637+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.067989110946655,+128.33683490753174,+127.04272270202637+],+"forward": [+-0.5966007709503174,+-0.7919876575469971,+-0.1297043412923813+],+"up": [+-0.0781082957983017,+-0.10354862362146378,+0.9915527701377869+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.1045041382313+},+{+"blender_frame": 134,+"matrix_world": [+[+0.798716127872467,+-0.0780617967247963,+0.5966228246688843,+0.2703510820865631+],+[+0.6017079949378967,+0.10349780321121216,+-0.7919821739196777,+-1.2829052209854126+],+[+7.440057379426435e-05,+0.991561770439148,+0.129635751247406,+1.2702805995941162+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.03510820865631,+128.29052209854126,+127.02805995941162+],+"forward": [+-0.5966228246688843,+-0.7919821739196777,+-0.129635751247406+],+"up": [+-0.0780617892742157,+-0.10349778831005096,+0.9915616512298584+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 539.0471778810024+},+{+"blender_frame": 135,+"matrix_world": [+[+0.7987100481987,+-0.07805512845516205,+0.5966320633888245,+0.2701072692871094+],+[+0.6017162203788757,+0.10342822223901749,+-0.791985034942627,+-1.2824243307113647+],+[+0.00010990071314154193,+0.9915693402290344,+0.1295761913061142,+1.2701650857925415+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+27.010726928710938,+128.24243307113647,+127.01650857925415+],+"forward": [+-0.5966320633888245,+-0.791985034942627,+-0.1295761913061142+],+"up": [+-0.07805514335632324,+-0.10342824459075928,+0.9915695786476135+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.9934785664082+},+{+"blender_frame": 136,+"matrix_world": [+[+0.7986831665039062,+-0.07809413224458694,+0.5966628193855286,+0.26990097761154175+],+[+0.6017518639564514,+0.1033632755279541,+-0.7919663786888123,+-1.282050609588623+],+[+0.00017489801393821836,+0.9915732145309448,+0.12954775989055634,+1.2700787782669067+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.990097761154175,+128.2050609588623,+127.00787782669067+],+"forward": [+-0.5966628789901733,+-0.7919664978981018,+-0.12954777479171753+],+"up": [+-0.07809413224458694,+-0.1033632755279541,+0.9915732145309448+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.9516390860081+},+{+"blender_frame": 137,+"matrix_world": [+[+0.7986478805541992,+-0.07808970659971237,+0.5967105627059937,+0.26968517899513245+],+[+0.6017985343933105,+0.10329119861125946,+-0.7919402718544006,+-1.2817031145095825+],+[+0.00020743609638884664,+0.9915810823440552,+0.12948757410049438,+1.270054817199707+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.968517899513245,+128.17031145095825,+127.0054817199707+],+"forward": [+-0.5967106223106384,+-0.7919403910636902,+-0.12948758900165558+],+"up": [+-0.07808970659971237,+-0.10329119861125946,+0.9915810823440552+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.9128185808659+},+{+"blender_frame": 138,+"matrix_world": [+[+0.798639714717865,+-0.07801192253828049,+0.5967318415641785,+0.2694624364376068+],+[+0.601809561252594,+0.10319456458091736,+-0.7919445633888245,+-1.2812881469726562+],+[+0.00020163829321973026,+0.9915972948074341,+0.12936358153820038,+1.2700231075286865+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.94624364376068,+128.12881469726562,+127.00231075286865+],+"forward": [+-0.5967318415641785,+-0.7919445633888245,+-0.12936358153820038+],+"up": [+-0.07801191508769989,+-0.10319454967975616,+0.9915971755981445+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.8670951128006+},+{+"blender_frame": 139,+"matrix_world": [+[+0.7986802458763123,+-0.077916219830513,+0.5966899991035461,+0.2692641615867615+],+[+0.601755678653717,+0.10307528078556061,+-0.7920010089874268,+-1.2809672355651855+],+[+0.00020573980873450637,+0.9916172027587891,+0.1292107105255127,+1.2699586153030396+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.926416158676147,+128.09672355651855,+126.99586153030396+],+"forward": [+-0.5966900587081909,+-0.7920011281967163,+-0.1292107254266739+],+"up": [+-0.077916219830513,+-0.10307528078556061,+0.9916172027587891+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.8275258243084+},+{+"blender_frame": 140,+"matrix_world": [+[+0.7987484931945801,+-0.0778411477804184,+0.5966084003448486,+0.2691103518009186+],+[+0.6016649603843689,+0.1029849573969841,+-0.7920816540718079,+-1.2808085680007935+],+[+0.00021485259640030563,+0.9916324019432068,+0.12909337878227234,+1.2698798179626465+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.911035180091858,+128.08085680007935,+126.98798179626465+],+"forward": [+-0.5966084003448486,+-0.7920816540718079,+-0.12909337878227234+],+"up": [+-0.0778411477804184,+-0.1029849573969841,+0.9916324019432068+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.8016410171986+},+{+"blender_frame": 141,+"matrix_world": [+[+0.7987960577011108,+-0.07778629660606384,+0.5965518355369568,+0.2689960300922394+],+[+0.6016018986701965,+0.10293196886777878,+-0.7921364307403564,+-1.2806304693222046+],+[+0.00021309872681740671,+0.99164217710495,+0.12901800870895386,+1.2698485851287842+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.899603009223938,+128.06304693222046,+126.98485851287842+],+"forward": [+-0.5965518951416016,+-0.792136549949646,+-0.12901802361011505+],+"up": [+-0.07778630405664444,+-0.10293198376893997,+0.9916422963142395+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.7781992554665+},+{+"blender_frame": 142,+"matrix_world": [+[+0.7988226413726807,+-0.07772766798734665,+0.5965238809585571,+0.26891112327575684+],+[+0.6015665531158447,+0.10287690162658691,+-0.7921704053878784,+-1.2804229259490967+],+[+0.00020503737323451787,+0.9916526079177856,+0.12893876433372498,+1.2698763608932495+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.891112327575684,+128.04229259490967,+126.98763608932495+],+"forward": [+-0.5965239405632019,+-0.792170524597168,+-0.12893877923488617+],+"up": [+-0.07772766798734665,+-0.10287690162658691,+0.9916526079177856+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.7560002505779+},+{+"blender_frame": 143,+"matrix_world": [+[+0.7988770008087158,+-0.07768522202968597,+0.5964567065238953,+0.26882457733154297+],+[+0.6014944314956665,+0.10281766951084137,+-0.7922329306602478,+-1.2803421020507812+],+[+0.00021850777557119727,+0.9916620850563049,+0.12886589765548706,+1.2699143886566162+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.882457733154297,+128.03421020507812,+126.99143886566162+],+"forward": [+-0.5964567065238953,+-0.7922329306602478,+-0.12886589765548706+],+"up": [+-0.07768522202968597,+-0.10281766951084137,+0.9916620850563049+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.7422934174538+},+{+"blender_frame": 144,+"matrix_world": [+[+0.798945426940918,+-0.07768350094556808,+0.596365213394165,+0.2688475549221039+],+[+0.6014034152030945,+0.10273892432451248,+-0.7923122048377991,+-1.280389666557312+],+[+0.00027966732159256935,+0.9916703701019287,+0.12880191206932068,+1.2700018882751465+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.884755492210388,+128.0389666557312,+127.00018882751465+],+"forward": [+-0.596365213394165,+-0.7923122048377991,+-0.12880191206932068+],+"up": [+-0.07768350094556808,+-0.10273892432451248,+0.9916703701019287+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.7450471520424+},+{+"blender_frame": 145,+"matrix_world": [+[+0.7989679574966431,+-0.07771067321300507,+0.5963315367698669,+0.26898738741874695+],+[+0.6013734340667725,+0.10266989469528198,+-0.7923439145088196,+-1.2804124355316162+],+[+0.00034828297793865204,+0.9916753768920898,+0.1287630945444107,+1.2701598405838013+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+26.898738741874695,+128.04124355316162,+127.01598405838013+],+"forward": [+-0.5963315367698669,+-0.7923439145088196,+-0.1287630945444107+],+"up": [+-0.07771067321300507,+-0.10266989469528198,+0.9916753768920898+],+"lens_mm": 75.0,+"fstop": 2.0,+"focus_cm": 538.7559540569782+}+]+}\ No newline at end of filediff --git a/unreal_demo/cams/s3_wok_push.json b/unreal_demo/cams/s3_wok_push.jsonnew file mode 100644index 0000000..d74d006--- /dev/null+++ b/unreal_demo/cams/s3_wok_push.json@@ -0,0 +1,4622 @@+{+"shot": "s3_wok_push",+"fps": 24,+"frames_n": 96,+"res": [+1920,+804+],+"sensor_width_mm": 24.889999389648438,+"sensor_height_mm": 10.422687244415282,+"dof": true,+"seed": 0,+"shutter_deg": 180.0,+"frames": [+{+"blender_frame": 0,+"matrix_world": [+[+-0.3574367165565491,+-0.21966099739074707,+0.9077379107475281,+-1.299974799156189+],+[+0.9339373111724854,+-0.08370520174503326,+0.3474976122379303,+3.549734354019165+],+[+-0.00034928141394630075,+0.9719786643981934,+0.2350689172744751,+1.1198103427886963+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-129.9974799156189,+-354.9734354019165,+111.98103427886963+],+"forward": [+-0.9077379107475281,+0.3474976122379303,+-0.2350689172744751+],+"up": [+-0.21966099739074707,+0.08370520174503326,+0.9719786643981934+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 209.80631858110428+},+{+"blender_frame": 1,+"matrix_world": [+[+-0.3574233055114746,+-0.2196429818868637,+0.9077475666999817,+-1.3000342845916748+],+[+0.933942437171936,+-0.08370280265808105,+0.34748438000679016,+3.5498046875+],+[+-0.000341489736456424,+0.9719829559326172,+0.2350512444972992,+1.1197619438171387+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-130.00342845916748,+-354.98046875,+111.97619438171387+],+"forward": [+-0.9077475666999817,+0.34748438000679016,+-0.2350512444972992+],+"up": [+-0.2196429818868637,+0.08370280265808105,+0.9719829559326172+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 209.80215668678284+},+{+"blender_frame": 2,+"matrix_world": [+[+-0.35736164450645447,+-0.21964415907859802,+0.9077714681625366,+-1.3002381324768066+],+[+0.9339660406112671,+-0.08371700346469879,+0.3474174737930298,+3.54976749420166+],+[+-0.00031230354215949774,+0.9719813466072083,+0.23505744338035583,+1.1197547912597656+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-130.02381324768066,+-354.976749420166,+111.97547912597656+],+"forward": [+-0.9077715873718262,+0.3474175035953522,+-0.23505747318267822+],+"up": [+-0.2196441888809204,+0.08371701091527939,+0.9719814658164978+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 209.7820781171322+},+{+"blender_frame": 3,+"matrix_world": [+[+-0.3572508692741394,+-0.219720721244812,+0.9077965617179871,+-1.3007822036743164+],+[+0.9340085387229919,+-0.08372083306312561,+0.3473025858402252,+3.549478530883789+],+[+-0.0003080845344811678,+0.9719637036323547,+0.23513038456439972,+1.1197094917297363+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-130.07822036743164,+-354.9478530883789,+111.97094917297363+],+"forward": [+-0.9077965617179871,+0.3473025858402252,+-0.23513038456439972+],+"up": [+-0.2197207510471344,+0.08372084051370621,+0.9719638228416443+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 209.72150042653084+},+{+"blender_frame": 4,+"matrix_world": [+[+-0.3570709824562073,+-0.21986055374145508,+0.907833456993103,+-1.3016788959503174+],+[+0.9340772032737732,+-0.08371654897928238,+0.3471185863018036,+3.5488991737365723+],+[+-0.00031700279214419425,+0.9719324707984924,+0.23525948822498322,+1.1195306777954102+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-130.16788959503174,+-354.8899173736572,+111.95306777954102+],+"forward": [+-0.9078335762023926,+0.347118616104126,+-0.2352595180273056+],+"up": [+-0.21986058354377747,+0.08371655642986298,+0.971932590007782+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 209.61570963263512+},+{+"blender_frame": 5,+"matrix_world": [+[+-0.3568372428417206,+-0.21997760236263275,+0.9078969955444336,+-1.3029100894927979+],+[+0.9341666102409363,+-0.08373469859361649,+0.3468737304210663,+3.548105478286743+],+[+-0.0002819749934133142,+0.9719045162200928,+0.23537537455558777,+1.1192505359649658+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-130.29100894927979,+-354.8105478286743,+111.92505359649658+],+"forward": [+-0.9078971147537231,+0.34687376022338867,+-0.23537540435791016+],+"up": [+-0.21997760236263275,+0.08373469859361649,+0.9719045162200928+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 209.46955680847168+},+{+"blender_frame": 6,+"matrix_world": [+[+-0.3565836250782013,+-0.22005189955234528,+0.9079786539077759,+-1.3044919967651367+],+[+0.9342635273933411,+-0.08377182483673096,+0.34660375118255615,+3.5471394062042236+],+[+-0.00020778503676410764,+0.9718844890594482,+0.23545806109905243,+1.118954062461853+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-130.44919967651367,+-354.71394062042236,+111.8954062461853+],+"forward": [+-0.9079787731170654,+0.34660378098487854,+-0.23545809090137482+],+"up": [+-0.22005189955234528,+0.08377182483673096,+0.9718844890594482+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 209.2850722372532+},+{+"blender_frame": 7,+"matrix_world": [+[+-0.35632941126823425,+-0.2201513797044754,+0.9080544114112854,+-1.3064069747924805+],+[+0.9343605041503906,+-0.08381078392267227,+0.3463327884674072,+3.5460596084594727+],+[+-0.00014088547322899103,+0.9718586206436157,+0.2355649322271347,+1.1186643838882446+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-130.64069747924805,+-354.60596084594727,+111.86643838882446+],+"forward": [+-0.9080544114112854,+0.3463327884674072,+-0.2355649322271347+],+"up": [+-0.2201513797044754,+0.08381078392267227,+0.9718586206436157+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 209.06661674380302+},+{+"blender_frame": 8,+"matrix_world": [+[+-0.356046199798584,+-0.22029618918895721,+0.908130407333374,+-1.3085989952087402+],+[+0.9344683885574341,+-0.08381291478872299,+0.34604090452194214,+3.544807195663452+],+[+-0.00011844241817016155,+0.9718255996704102,+0.23570112884044647,+1.1182684898376465+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-130.85989952087402,+-354.4807195663452,+111.82684898376465+],+"forward": [+-0.908130407333374,+0.34604090452194214,+-0.23570112884044647+],+"up": [+-0.22029618918895721,+0.08381291478872299,+0.9718255996704102+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 208.81456285715103+},+{+"blender_frame": 9,+"matrix_world": [+[+-0.3556864559650421,+-0.22043468058109283,+0.9082376956939697,+-1.3110922574996948+],+[+0.9346054196357727,+-0.08375449478626251,+0.34568488597869873,+3.5433144569396973+],+[+-0.00013194717757869512,+0.9717992544174194,+0.23580974340438843,+1.1177270412445068+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-131.10922574996948,+-354.3314456939697,+111.77270412445068+],+"forward": [+-0.9082376956939697,+0.34568488597869873,+-0.23580974340438843+],+"up": [+-0.22043468058109283,+0.08375449478626251,+0.9717992544174194+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 208.52319449186325+},+{+"blender_frame": 10,+"matrix_world": [+[+-0.35527533292770386,+-0.22052675485610962,+0.9083762168884277,+-1.313941240310669+],+[+0.9347618222236633,+-0.0836634710431099,+0.3452839255332947,+3.541592836380005+],+[+-0.00014643283793702722,+0.9717862010002136,+0.23586353659629822,+1.1170945167541504+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-131.3941240310669,+-354.1592836380005,+111.70945167541504+],+"forward": [+-0.9083763360977173,+0.34528395533561707,+-0.2358635663986206+],+"up": [+-0.22052675485610962,+0.0836634710431099,+0.9717862010002136+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 208.1892929971218+},+{+"blender_frame": 11,+"matrix_world": [+[+-0.3548808693885803,+-0.22057677805423737,+0.9085182547569275,+-1.3171075582504272+],+[+0.9349116086959839,+-0.08354935050010681,+0.3449057340621948,+3.5396342277526855+],+[+-0.00017207718337886035,+0.9717845916748047,+0.23586983978748322,+1.1164268255233765+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-131.71075582504272,+-353.96342277526855,+111.64268255233765+],+"forward": [+-0.908518373966217,+0.3449057638645172,+-0.2358698695898056+],+"up": [+-0.22057680785655975,+0.08354935795068741,+0.9717847108840942+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 207.81750679016113+},+{+"blender_frame": 12,+"matrix_world": [+[+-0.3545205891132355,+-0.22062362730503082,+0.9086474776268005,+-1.320537805557251+],+[+0.9350482225418091,+-0.08344068378210068,+0.344561368227005,+3.5374889373779297+],+[+-0.0002002053806791082,+0.9717833995819092,+0.23587512969970703,+1.115665078163147+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-132.0537805557251,+-353.74889373779297,+111.5665078163147+],+"forward": [+-0.9086475968360901,+0.3445613980293274,+-0.23587515950202942+],+"up": [+-0.22062362730503082,+0.08344068378210068,+0.9717833995819092+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 207.41315335035324+},+{+"blender_frame": 13,+"matrix_world": [+[+-0.3541371822357178,+-0.2207203358411789,+0.9087735414505005,+-1.324295997619629+],+[+0.9351934790611267,+-0.08335240930318832,+0.34418827295303345,+3.535154104232788+],+[+-0.00022089014237280935,+0.9717689752578735,+0.23593437671661377,+1.1147971153259277+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-132.4295997619629,+-353.5154104232788,+111.47971153259277+],+"forward": [+-0.90877366065979,+0.34418830275535583,+-0.23593440651893616+],+"up": [+-0.2207203358411789,+0.08335240930318832,+0.9717689752578735+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 206.97009041905403+},+{+"blender_frame": 14,+"matrix_world": [+[+-0.3536970317363739,+-0.22085313498973846,+0.908912718296051,+-1.3283941745758057+],+[+0.9353600144386292,+-0.08327160030603409,+0.34375494718551636,+3.5326220989227295+],+[+-0.00023274194973055273,+0.9717457294464111,+0.23603010177612305,+1.1138052940368652+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-132.83941745758057,+-353.26220989227295,+111.38052940368652+],+"forward": [+-0.908912718296051,+0.34375494718551636,+-0.23603010177612305+],+"up": [+-0.22085313498973846,+0.08327160030603409,+0.9717457294464111+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 206.48637488484383+},+{+"blender_frame": 15,+"matrix_world": [+[+-0.3532525897026062,+-0.2209795117378235,+0.9090547561645508,+-1.3327640295028687+],+[+0.9355279207229614,+-0.08321818709373474,+0.3433106243610382,+3.529876947402954+],+[+-0.0002147151535609737,+0.9717215299606323,+0.2361295521259308,+1.112703800201416+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-133.27640295028687,+-352.9876947402954,+111.2703800201416+],+"forward": [+-0.9090548753738403,+0.3433106541633606,+-0.23612958192825317+],+"up": [+-0.22097954154014587,+0.08321819454431534,+0.9717216491699219+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 205.96811845898628+},+{+"blender_frame": 16,+"matrix_world": [+[+-0.3527897000312805,+-0.22111016511917114,+0.9092028141021729,+-1.3374103307724+],+[+0.9357027411460876,+-0.08317650854587555,+0.3428443372249603,+3.5269219875335693+],+[+-0.0001820516336010769,+0.9716954231262207,+0.23623715341091156,+1.1115463972091675+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-133.74103307724,+-352.69219875335693,+111.15463972091675+],+"forward": [+-0.9092028141021729,+0.3428443372249603,+-0.23623715341091156+],+"up": [+-0.22111016511917114,+0.08317650854587555,+0.9716954231262207+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 205.41621148586273+},+{+"blender_frame": 17,+"matrix_world": [+[+-0.352255254983902,+-0.2212873250246048,+0.9093668460845947,+-1.3423799276351929+],+[+0.9359040260314941,+-0.08311671018600464,+0.3423088490962982,+3.523761510848999+],+[+-0.0001650371850701049,+0.9716601371765137,+0.23638199269771576,+1.1103559732437134+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-134.2379927635193,+-352.3761510848999,+111.03559732437134+],+"forward": [+-0.9093669652938843,+0.3423088788986206,+-0.23638202250003815+],+"up": [+-0.22128735482692719,+0.08311671763658524,+0.9716602563858032+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 204.82709780335426+},+{+"blender_frame": 18,+"matrix_world": [+[+-0.3516453504562378,+-0.22151358425617218,+0.9095478057861328,+-1.3476498126983643+],+[+0.9361333847045898,+-0.08304495364427567,+0.34169864654541016,+3.520507335662842+],+[+-0.00015753353363834321,+0.9716147184371948,+0.2365686148405075,+1.1090853214263916+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-134.76498126983643,+-352.0507335662842,+110.90853214263916+],+"forward": [+-0.9095479249954224,+0.34169867634773254,+-0.2365686446428299+],+"up": [+-0.22151361405849457,+0.08304496109485626,+0.9716148376464844+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 204.20557036995888+},+{+"blender_frame": 19,+"matrix_world": [+[+-0.35101985931396484,+-0.22175930440425873,+0.9097294211387634,+-1.3531694412231445+],+[+0.9363679885864258,+-0.08298429846763611,+0.341069757938385,+3.517164707183838+],+[+-0.00014213734539225698,+0.9715638756752014,+0.2367774099111557,+1.1077167987823486+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-135.31694412231445,+-351.7164707183838,+110.77167987823486+],+"forward": [+-0.909729540348053,+0.3410697877407074,+-0.2367774397134781+],+"up": [+-0.22175933420658112,+0.0829843059182167,+0.971563994884491+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 203.55604588985443+},+{+"blender_frame": 20,+"matrix_world": [+[+-0.35039544105529785,+-0.22195401787757874,+0.90992271900177,+-1.3589650392532349+],+[+0.9366018176078796,+-0.08294614404439926,+0.34043630957603455,+3.5136947631835938+],+[+-8.662687469040975e-05,+0.9715226888656616,+0.2369464933872223,+1.1063026189804077+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-135.8965039253235,+-351.3694763183594,+110.63026189804077+],+"forward": [+-0.9099228382110596,+0.34043633937835693,+-0.23694652318954468+],+"up": [+-0.22195401787757874,+0.08294614404439926,+0.9715226888656616+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 202.87600085139275+},+{+"blender_frame": 21,+"matrix_world": [+[+-0.3497297465801239,+-0.22208870947360992,+0.9101459383964539,+-1.3650766611099243+],+[+0.9368506669998169,+-0.0828995555639267,+0.33976244926452637,+3.510014057159424+],+[+-6.7128075897926465e-06,+0.9714959263801575,+0.23705634474754333,+1.1049045324325562+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-136.50766611099243,+-351.0014057159424,+110.49045324325562+],+"forward": [+-0.9101460576057434,+0.33976247906684875,+-0.23705637454986572+],+"up": [+-0.22208870947360992,+0.0828995555639267,+0.9714959263801575+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 202.16025486588478+},+{+"blender_frame": 22,+"matrix_world": [+[+-0.34900254011154175,+-0.2222180962562561,+0.910393476486206,+-1.3714996576309204+],+[+0.9371218085289001,+-0.08281799405813217,+0.339033842086792,+3.506110191345215+],+[+5.751550997956656e-05,+0.9714732766151428,+0.23714911937713623,+1.1035062074661255+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-137.14996576309204,+-350.6110191345215,+110.35062074661255+],+"forward": [+-0.9103935956954956,+0.3390338718891144,+-0.23714914917945862+],+"up": [+-0.2222180962562561,+0.08281799405813217,+0.9714732766151428+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 201.40853077173233+},+{+"blender_frame": 23,+"matrix_world": [+[+-0.34825828671455383,+-0.22232423722743988,+0.9106525182723999,+-1.3781921863555908+],+[+0.9373986124992371,+-0.08269140124320984,+0.33829861879348755,+3.502061128616333+],+[+9.114312706515193e-05,+0.9714597463607788,+0.2372044026851654,+1.1020457744598389+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-137.81921863555908,+-350.2061128616333,+110.20457744598389+],+"forward": [+-0.9106526374816895,+0.33829864859580994,+-0.2372044324874878+],+"up": [+-0.22232423722743988,+0.08269140124320984,+0.9714597463607788+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 200.62588155269623+},+{+"blender_frame": 24,+"matrix_world": [+[+-0.34746381640434265,+-0.22246457636356354,+0.9109218120574951,+-1.3851375579833984+],+[+0.9376934170722961,+-0.0825226902961731,+0.337522029876709,+3.49786114692688+],+[+8.501987758791074e-05,+0.9714419841766357,+0.23727722465991974,+1.1005258560180664+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-138.51375579833984,+-349.786114692688,+110.05258560180664+],+"forward": [+-0.9109218120574951,+0.337522029876709,+-0.23727722465991974+],+"up": [+-0.22246457636356354,+0.0825226902961731,+0.9714419841766357+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 199.81374740600586+},+{+"blender_frame": 25,+"matrix_world": [+[+-0.3465626537799835,+-0.22267308831214905,+0.9112140536308289,+-1.3923583030700684+],+[+0.9380268454551697,+-0.0823521614074707,+0.3366360068321228,+3.4935500621795654+],+[+8.066752343438566e-05,+0.9714086651802063,+0.23741352558135986,+1.0988868474960327+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-139.23583030700684,+-349.35500621795654,+109.88868474960327+],+"forward": [+-0.9112140536308289,+0.3366360068321228,+-0.23741352558135986+],+"up": [+-0.22267308831214905,+0.0823521614074707,+0.9714086651802063+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 198.96996542811394+},+{+"blender_frame": 26,+"matrix_world": [+[+-0.3455677330493927,+-0.22291305661201477,+0.9115331768989563,+-1.3998433351516724+],+[+0.9383938908576965,+-0.08219190686941147,+0.3356509506702423,+3.4890687465667725+],+[+9.966600919142365e-05,+0.9713672399520874,+0.23758310079574585,+1.097157597541809+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-139.98433351516724,+-348.90687465667725,+109.71575975418091+],+"forward": [+-0.9115331768989563,+0.3356509506702423,+-0.23758310079574585+],+"up": [+-0.22291305661201477,+0.08219190686941147,+0.9713672399520874+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 198.09419438242912+},+{+"blender_frame": 27,+"matrix_world": [+[+-0.34455499053001404,+-0.2231970727443695,+0.9118469953536987,+-1.4075686931610107+],+[+0.9387660622596741,+-0.08204873651266098,+0.3346433937549591,+3.484381914138794+],+[+0.00012447277549654245,+0.971314013004303,+0.23780015110969543,+1.0953460931777954+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-140.75686931610107,+-348.4381914138794,+109.53460931777954+],+"forward": [+-0.9118469953536987,+0.3346433937549591,+-0.23780015110969543+],+"up": [+-0.2231971025466919,+0.08204874396324158,+0.9713141322135925+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 197.18788638710976+},+{+"blender_frame": 28,+"matrix_world": [+[+-0.34352290630340576,+-0.22350506484508514,+0.9121609330177307,+-1.4154994487762451+],+[+0.9391443133354187,+-0.08190266788005829,+0.3336164653301239,+3.4794836044311523+],+[+0.00014344508235808462,+0.9712556600570679,+0.23803892731666565,+1.0935068130493164+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-141.5499448776245,+-347.94836044311523,+109.35068130493164+],+"forward": [+-0.9121609330177307,+0.3336164653301239,+-0.23803892731666565+],+"up": [+-0.22350506484508514,+0.08190266788005829,+0.9712556600570679+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 196.25526070594788+},+{+"blender_frame": 29,+"matrix_world": [+[+-0.3424007296562195,+-0.22381582856178284,+0.9125065207481384,+-1.4236164093017578+],+[+0.9395540952682495,+-0.08171599358320236,+0.33250677585601807,+3.4744713306427+],+[+0.00014609811478294432,+0.9711997509002686,+0.23826666176319122,+1.0916870832443237+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-142.36164093017578,+-347.44713306427,+109.16870832443237+],+"forward": [+-0.912506639957428,+0.33250680565834045,+-0.2382666915655136+],+"up": [+-0.22381582856178284,+0.08171599358320236,+0.9711997509002686+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 195.30229717493057+},+{+"blender_frame": 30,+"matrix_world": [+[+-0.3411845266819,+-0.2241479754447937,+0.912880539894104,+-1.4319404363632202+],+[+0.9399964213371277,+-0.0815049260854721,+0.3313062787055969,+3.4693567752838135+],+[+0.00014262815238907933,+0.9711408615112305,+0.2385065257549286,+1.089806318283081+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-143.19404363632202,+-346.93567752838135,+108.9806318283081+],+"forward": [+-0.912880539894104,+0.3313062787055969,+-0.2385065257549286+],+"up": [+-0.2241480052471161,+0.0815049335360527,+0.97114098072052+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 194.3255715072155+},+{+"blender_frame": 31,+"matrix_world": [+[+-0.3399312496185303,+-0.22451239824295044,+0.91325843334198,+-1.4404815435409546+],+[+0.9404502511024475,+-0.08129210025072098,+0.3300679624080658,+3.4641032218933105+],+[+0.00013635217328555882,+0.9710745811462402,+0.23877649009227753,+1.0877952575683594+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-144.04815435409546,+-346.41032218933105,+108.77952575683594+],+"forward": [+-0.91325843334198,+0.3300679624080658,+-0.23877649009227753+],+"up": [+-0.22451239824295044,+0.08129210025072098,+0.9710745811462402+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 193.32150146365166+},+{+"blender_frame": 32,+"matrix_world": [+[+-0.3386981785297394,+-0.22488948702812195,+0.9136236906051636,+-1.4491866827011108+],+[+0.940895140171051,+-0.08110097795724869,+0.3288450539112091,+3.4586920738220215+],+[+0.00014198310964275151,+0.9710032343864441,+0.23906615376472473,+1.0857329368591309+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-144.91866827011108,+-345.86920738220215,+108.57329368591309+],+"forward": [+-0.9136236906051636,+0.3288450539112091,+-0.23906615376472473+],+"up": [+-0.22488951683044434,+0.08110098540782928,+0.9710033535957336+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 192.29632019996643+},+{+"blender_frame": 33,+"matrix_world": [+[+-0.33747565746307373,+-0.22527046501636505,+0.9139821529388428,+-1.4580122232437134+],+[+0.9413342475891113,+-0.08092263340950012,+0.3276299238204956,+3.4531853199005127+],+[+0.00015649486158508807,+0.9709298014640808,+0.23936426639556885,+1.0837260484695435+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-145.80122232437134,+-345.31853199005127,+108.37260484695435+],+"forward": [+-0.9139821529388428,+0.3276299238204956,+-0.23936426639556885+],+"up": [+-0.22527049481868744,+0.08092264086008072,+0.9709299206733704+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 191.25862568616867+},+{+"blender_frame": 34,+"matrix_world": [+[+-0.3362073302268982,+-0.2256634384393692,+0.914352536201477,+-1.4669936895370483+],+[+0.9417879581451416,+-0.08072331547737122,+0.3263726830482483,+3.4476234912872314+],+[+0.0001591821783222258,+0.970855176448822,+0.2396668791770935,+1.0816792249679565+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-146.69936895370483,+-344.76234912872314,+108.16792249679565+],+"forward": [+-0.9143526554107666,+0.3263727128505707,+-0.2396669089794159+],+"up": [+-0.2256634384393692,+0.08072331547737122,+0.970855176448822+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 190.20409435033798+},+{+"blender_frame": 35,+"matrix_world": [+[+-0.33489033579826355,+-0.22607474029064178,+0.9147341847419739,+-1.4761296510696411+],+[+0.9422570466995239,+-0.08050142228603363,+0.32507091760635376,+3.442006826400757+],+[+0.00014708595699630678,+0.9707778096199036,+0.23997969925403595,+1.079559087753296+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-147.6129651069641,+-344.2006826400757,+107.95590877532959+],+"forward": [+-0.9147341847419739,+0.32507091760635376,+-0.23997969925403595+],+"up": [+-0.22607477009296417,+0.08050142973661423,+0.9707779288291931+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 189.13203701376915+},+{+"blender_frame": 36,+"matrix_world": [+[+-0.3335331678390503,+-0.22648011147975922,+0.9151296615600586,+-1.4854083061218262+],+[+0.9427383542060852,+-0.08025368303060532,+0.3237340450286865,+3.4363162517547607+],+[+0.0001232019130839035,+0.9707038998603821,+0.24027875065803528,+1.0774741172790527+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-148.54083061218262,+-343.6316251754761,+107.74741172790527+],+"forward": [+-0.9151297807693481,+0.3237340748310089,+-0.24027878046035767+],+"up": [+-0.2264801412820816,+0.08025369048118591,+0.9707040190696716+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 188.04555758833885+},+{+"blender_frame": 37,+"matrix_world": [+[+-0.3321751654148102,+-0.22686105966567993,+0.915529191493988,+-1.4948482513427734+],+[+0.9432176947593689,+-0.07999805361032486,+0.32239827513694763,+3.430561065673828+],+[+0.00010094102617586032,+0.9706360697746277,+0.24055273830890656,+1.0754194259643555+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-149.48482513427734,+-343.0561065673828,+107.54194259643555+],+"forward": [+-0.915529191493988,+0.32239827513694763,+-0.24055273830890656+],+"up": [+-0.22686105966567993,+0.07999805361032486,+0.9706360697746277+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 186.94315776228905+},+{+"blender_frame": 38,+"matrix_world": [+[+-0.3308235704898834,+-0.22722573578357697,+0.915928065776825,+-1.5044941902160645+],+[+0.943692684173584,+-0.07975082844495773,+0.32106703519821167,+3.4247865676879883+],+[+9.133284038398415e-05,+0.9705712199211121,+0.2408147007226944,+1.0732753276824951+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-150.44941902160645,+-342.4786567687988,+107.32753276824951+],+"forward": [+-0.915928065776825,+0.32106703519821167,+-0.2408147007226944+],+"up": [+-0.22722570598125458,+0.07975082099437714,+0.9705711007118225+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 185.81941351294518+},+{+"blender_frame": 39,+"matrix_world": [+[+-0.32946449518203735,+-0.22757452726364136,+0.9163312315940857,+-1.5142674446105957+],+[+0.944167971611023,+-0.07950695604085922,+0.31972721219062805,+3.4189603328704834+],+[+9.294700430473313e-05,+0.97050940990448,+0.24106329679489136,+1.0710792541503906+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-151.42674446105957,+-341.89603328704834,+107.10792541503906+],+"forward": [+-0.9163313508033752,+0.31972724199295044,+-0.24106332659721375+],+"up": [+-0.22757452726364136,+0.07950695604085922,+0.97050940990448+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 184.68135222792625+},+{+"blender_frame": 40,+"matrix_world": [+[+-0.3280329406261444,+-0.2279760092496872,+0.9167450070381165,+-1.5240904092788696+],+[+0.94466632604599,+-0.07926582545042038,+0.3183120787143707,+3.413020372390747+],+[+9.90386979538016e-05,+0.9704349040985107,+0.241363063454628,+1.0689226388931274+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-152.40904092788696,+-341.3020372390747,+106.89226388931274+],+"forward": [+-0.9167450070381165,+0.3183120787143707,+-0.241363063454628+],+"up": [+-0.2279760092496872,+0.07926582545042038,+0.9704349040985107+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 183.5362270474434+},+{+"blender_frame": 41,+"matrix_world": [+[+-0.32650038599967957,+-0.22843711078166962,+0.9171772003173828,+-1.5340150594711304+],+[+0.9451971650123596,+-0.07902540266513824,+0.3167925179004669,+3.4070258140563965+],+[+0.00011313096911180764,+0.9703459739685059,+0.24171991646289825,+1.066736102104187+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-153.40150594711304,+-340.70258140563965,+106.6736102104187+],+"forward": [+-0.9171772003173828,+0.3167925179004669,+-0.24171991646289825+],+"up": [+-0.228437140583992,+0.07902541011571884,+0.9703460931777954+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 182.37949758768082+},+{+"blender_frame": 42,+"matrix_world": [+[+-0.32491335272789,+-0.22889740765094757,+0.917625904083252,+-1.5440949201583862+],+[+0.9457438588142395,+-0.07878579944372177,+0.315216600894928,+3.400979518890381+],+[+0.0001436305756215006,+0.9702571034431458,+0.24207685887813568,+1.0644721984863281+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-154.40949201583862,+-340.0979518890381,+106.44721984863281+],+"forward": [+-0.917625904083252,+0.315216600894928,+-0.24207685887813568+],+"up": [+-0.22889740765094757,+0.07878579944372177,+0.9702571034431458+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 181.20518997311592+},+{+"blender_frame": 43,+"matrix_world": [+[+-0.3232842981815338,+-0.22935080528259277,+0.9180879592895508,+-1.5542750358581543+],+[+0.9463019371032715,+-0.07854756712913513,+0.3135969936847687,+3.394808769226074+],+[+0.00018984527559950948,+0.9701693058013916,+0.24242830276489258,+1.0621858835220337+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-155.42750358581543,+-339.4808769226074,+106.21858835220337+],+"forward": [+-0.9180879592895508,+0.3135969936847687,+-0.24242830276489258+],+"up": [+-0.22935080528259277,+0.07854756712913513,+0.9701693058013916+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 180.01744002103806+},+{+"blender_frame": 44,+"matrix_world": [+[+-0.32166430354118347,+-0.22976458072662354,+0.918553352355957,+-1.5644681453704834+],+[+0.9468538165092468,+-0.07828985154628754,+0.311991423368454,+3.388526201248169+],+[+0.00022882242046762258,+0.9700921773910522,+0.24273650348186493,+1.0599116086959839+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-156.44681453704834,+-338.8526201248169,+105.99116086959839+],+"forward": [+-0.9185534715652466,+0.31199145317077637,+-0.24273653328418732+],+"up": [+-0.22976461052894592,+0.07828985899686813,+0.9700922966003418+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 178.82562428712845+},+{+"blender_frame": 45,+"matrix_world": [+[+-0.32004809379577637,+-0.23017483949661255,+0.919015109539032,+-1.5746625661849976+],+[+0.9474012851715088,+-0.07800764590501785,+0.3103959858417511,+3.3821890354156494+],+[+0.00024486114853061736,+0.970017671585083,+0.24303415417671204,+1.057639479637146+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-157.46625661849976,+-338.21890354156494,+105.7639479637146+],+"forward": [+-0.919015109539032,+0.3103959858417511,+-0.24303415417671204+],+"up": [+-0.23017486929893494,+0.07800765335559845,+0.9700177907943726+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 177.63245329260826+},+{+"blender_frame": 46,+"matrix_world": [+[+-0.3183923661708832,+-0.23064348101615906,+0.9194725155830383,+-1.5848339796066284+],+[+0.9479590058326721,+-0.07771647721529007,+0.30876192450523376,+3.3758857250213623+],+[+0.00024423730792477727,+0.9699296951293945,+0.24338489770889282,+1.0553056001663208+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-158.48339796066284,+-337.58857250213623,+105.53056001663208+],+"forward": [+-0.9194726347923279,+0.30876195430755615,+-0.2433849275112152+],+"up": [+-0.23064351081848145,+0.07771648466587067,+0.9699298143386841+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 176.44139379262924+},+{+"blender_frame": 47,+"matrix_world": [+[+-0.3167005479335785,+-0.23119302093982697,+0.9199187755584717,+-1.5950267314910889+],+[+0.948525607585907,+-0.07744166254997253,+0.30708643794059753,+3.3695883750915527+],+[+0.00024380016839131713,+0.9698208570480347,+0.2438182830810547,+1.052939534187317+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-159.5026731491089,+-336.9588375091553,+105.29395341873169+],+"forward": [+-0.9199188947677612,+0.3070864677429199,+-0.24381831288337708+],+"up": [+-0.23119305074214935,+0.07744167000055313,+0.9698209762573242+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 175.2482831478119+},+{+"blender_frame": 48,+"matrix_world": [+[+-0.3149757981300354,+-0.2317958027124405,+0.9203590750694275,+-1.6052135229110718+],+[+0.9490996599197388,+-0.0771656408905983,+0.3053773045539856,+3.3632543087005615+],+[+0.0002349253772990778,+0.969698965549469,+0.2443026304244995,+1.0505884885787964+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-160.52135229110718,+-336.32543087005615,+105.05884885787964+],+"forward": [+-0.920359194278717,+0.305377334356308,+-0.2443026602268219+],+"up": [+-0.23179583251476288,+0.0771656483411789,+0.9696990847587585+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 174.0553930401802+},+{+"blender_frame": 49,+"matrix_world": [+[+-0.31324487924575806,+-0.23238122463226318,+0.920802116394043,+-1.6154372692108154+],+[+0.9496724009513855,+-0.07684346288442612,+0.30367329716682434,+3.3568577766418457+],+[+0.0001896573230624199,+0.9695845246315002,+0.24475683271884918,+1.0482916831970215+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-161.54372692108154,+-335.68577766418457,+104.82916831970215+],+"forward": [+-0.9208022356033325,+0.30367332696914673,+-0.24475686252117157+],+"up": [+-0.23238122463226318,+0.07684346288442612,+0.9695845246315002+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 172.8589616715908+},+{+"blender_frame": 50,+"matrix_world": [+[+-0.3115064799785614,+-0.23295225203037262,+0.9212474226951599,+-1.625724196434021+],+[+0.9502440094947815,+-0.076481893658638,+0.30197152495384216,+3.350480318069458+],+[+0.00011379749048501253,+0.9694759845733643,+0.24518606066703796,+1.046019434928894+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-162.5724196434021,+-335.0480318069458,+104.6019434928894+],+"forward": [+-0.9212475419044495,+0.30197155475616455,+-0.24518609046936035+],+"up": [+-0.232952281832695,+0.0764819011092186,+0.9694761037826538+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 171.6583415865898+},+{+"blender_frame": 51,+"matrix_world": [+[+-0.30971619486808777,+-0.23354944586753845,+0.9216998219490051,+-1.6359937191009521+],+[+0.9508290886878967,+-0.07612067461013794,+0.3002161979675293,+3.3441574573516846+],+[+4.508522033574991e-05,+0.9693607687950134,+0.24564141035079956,+1.0437275171279907+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-163.59937191009521,+-334.41574573516846,+104.37275171279907+],+"forward": [+-0.9216998219490051,+0.3002161979675293,+-0.24564141035079956+],+"up": [+-0.23354944586753845,+0.07612067461013794,+0.9693607687950134+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 170.46087011694908+},+{+"blender_frame": 52,+"matrix_world": [+[+-0.30788087844848633,+-0.23416349291801453,+0.9221587777137756,+-1.6461949348449707+],+[+0.9514250159263611,+-0.07580464333295822,+0.2984028458595276,+3.3378357887268066+],+[+2.8855149139417335e-05,+0.9692373871803284,+0.24612775444984436,+1.0414586067199707+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-164.61949348449707,+-333.78357887268066,+104.14586067199707+],+"forward": [+-0.9221588969230652,+0.29840287566185,+-0.24612778425216675+],+"up": [+-0.23416349291801453,+0.07580464333295822,+0.9692373871803284+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 169.27069574594498+},+{+"blender_frame": 53,+"matrix_world": [+[+-0.3060305416584015,+-0.23476462066173553,+0.9226217269897461,+-1.6563122272491455+],+[+0.9520217776298523,+-0.0755138173699379,+0.2965676188468933,+3.3315179347991943+],+[+4.709934364655055e-05,+0.9691146612167358,+0.24661055207252502,+1.0391467809677124+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-165.63122272491455,+-333.15179347991943,+103.91467809677124+],+"forward": [+-0.9226217269897461,+0.2965676188468933,+-0.24661055207252502+],+"up": [+-0.23476462066173553,+0.0755138173699379,+0.9691146612167358+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 168.0877186357975+},+{+"blender_frame": 54,+"matrix_world": [+[+-0.30415984988212585,+-0.23533834517002106,+0.9230940341949463,+-1.6664267778396606+],+[+0.9526210427284241,+-0.07520078867673874,+0.29471686482429504,+3.3252623081207275+],+[+5.922057607676834e-05,+0.9689998626708984,+0.24706129729747772,+1.036821722984314+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-166.64267778396606,+-332.52623081207275,+103.6821722984314+],+"forward": [+-0.9230941534042358,+0.29471689462661743,+-0.2470613270998001+],+"up": [+-0.23533834517002106,+0.07520078867673874,+0.9689998626708984+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 166.9069528579712+},+{+"blender_frame": 55,+"matrix_world": [+[+-0.30222663283348083,+-0.23590406775474548,+0.9235844016075134,+-1.6765059232711792+],+[+0.9532361030578613,+-0.07487022131681442,+0.2928060293197632,+3.319056510925293+],+[+7.48235615901649e-05,+0.9688878059387207,+0.24750004708766937,+1.034562110900879+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-167.65059232711792,+-331.9056510925293,+103.45621109008789+],+"forward": [+-0.923584520816803,+0.29280605912208557,+-0.24750007688999176+],+"up": [+-0.23590409755706787,+0.07487022876739502,+0.9688879251480103+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 165.7328024506569+},+{+"blender_frame": 56,+"matrix_world": [+[+-0.30023542046546936,+-0.2364998310804367,+0.9240815043449402,+-1.6864995956420898+],+[+0.9538652300834656,+-0.07452484220266342,+0.2908390462398529,+3.3129420280456543+],+[+8.364526001969352e-05,+0.9687693119049072,+0.24796392023563385,+1.03240966796875+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-168.64995956420898,+-331.29420280456543,+103.240966796875+],+"forward": [+-0.9240815043449402,+0.2908390462398529,+-0.24796392023563385+],+"up": [+-0.2364998310804367,+0.07452484220266342,+0.9687693119049072+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 164.57225531339645+},+{+"blender_frame": 57,+"matrix_world": [+[+-0.29823726415634155,+-0.23710483312606812,+0.9245733618736267,+-1.696402668952942+],+[+0.9544917941093445,+-0.0741870254278183,+0.2888628840446472,+3.306952476501465+],+[+0.00010055540769826621,+0.968647301197052,+0.2484399378299713,+1.030281901359558+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-169.6402668952942,+-330.6952476501465,+103.02819013595581+],+"forward": [+-0.9245733618736267,+0.2888628840446472,+-0.2484399378299713+],+"up": [+-0.23710483312606812,+0.0741870254278183,+0.968647301197052+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 163.4248211979866+},+{+"blender_frame": 58,+"matrix_world": [+[+-0.296254426240921,+-0.23768796026706696,+0.9250609874725342,+-1.7062132358551025+],+[+0.9551091194152832,+-0.0738600492477417,+0.2868996262550354,+3.3010218143463135+],+[+0.00013246756861917675,+0.9685292840003967,+0.24889931082725525,+1.0281273126602173+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-170.62132358551025,+-330.10218143463135,+102.81273126602173+],+"forward": [+-0.9250609874725342,+0.2868996262550354,+-0.24889931082725525+],+"up": [+-0.23768799006938934,+0.0738600566983223,+0.9685294032096863+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 162.2874617576599+},+{+"blender_frame": 59,+"matrix_world": [+[+-0.29428035020828247,+-0.23828329145908356,+0.9255378246307373,+-1.7159241437911987+],+[+0.9557192325592041,+-0.07350640743970871,+0.28495219349861145,+3.295100212097168+],+[+0.0001336163841187954,+0.9684098958969116,+0.24936340749263763,+1.025984287261963+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-171.59241437911987,+-329.5100212097168,+102.59842872619629+],+"forward": [+-0.9255378246307373,+0.28495219349861145,+-0.24936340749263763+],+"up": [+-0.23828332126140594,+0.0735064148902893,+0.9684100151062012+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 161.16042956709862+},+{+"blender_frame": 60,+"matrix_world": [+[+-0.29227110743522644,+-0.23884741961956024,+0.9260289669036865,+-1.7255072593688965+],+[+0.9563355445861816,+-0.07311905920505524,+0.28297704458236694,+3.289233922958374+],+[+0.00012202962534502149,+0.9683002829551697,+0.24978886544704437,+1.0239092111587524+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-172.55072593688965,+-328.9233922958374,+102.39092111587524+],+"forward": [+-0.9260289669036865,+0.28297704458236694,+-0.24978886544704437+],+"up": [+-0.23884744942188263,+0.07311906665563583,+0.9683004021644592+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 160.04881113767624+},+{+"blender_frame": 61,+"matrix_world": [+[+-0.2902214825153351,+-0.23937173187732697,+0.9265379905700684,+-1.7349315881729126+],+[+0.9569594860076904,+-0.07273977994918823,+0.2809581160545349,+3.283522605895996+],+[+0.00014273136912379414,+0.9681994915008545,+0.2501796782016754,+1.0218665599822998+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-173.49315881729126,+-328.3522605895996,+102.18665599822998+],+"forward": [+-0.9265379905700684,+0.2809581160545349,+-0.2501796782016754+],+"up": [+-0.23937173187732697,+0.07273977994918823,+0.9681994915008545+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 158.95736142992973+},+{+"blender_frame": 62,+"matrix_world": [+[+-0.2881813049316406,+-0.23990105092525482,+0.9270378351211548,+-1.7442010641098022+],+[+0.9575759768486023,+-0.07238748669624329,+0.2789417803287506,+3.2779629230499268+],+[+0.00018750864546746016,+0.9680947065353394,+0.2505842447280884,+1.0197911262512207+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-174.42010641098022,+-327.7962923049927,+101.97911262512207+],+"forward": [+-0.9270378351211548,+0.2789417803287506,+-0.2505842447280884+],+"up": [+-0.2399010807275772,+0.07238749414682388,+0.9680948257446289+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 157.8842207789421+},+{+"blender_frame": 63,+"matrix_world": [+[+-0.2861495614051819,+-0.24046126008033752,+0.9275218844413757,+-1.7533527612686157+],+[+0.9581848978996277,+-0.07206565141677856,+0.27692627906799316,+3.2724905014038086+],+[+0.00025242718402296305,+0.9679797291755676,+0.2510279417037964,+1.0176788568496704+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-175.33527612686157,+-327.24905014038086,+101.76788568496704+],+"forward": [+-0.9275218844413757,+0.27692627906799316,+-0.2510279417037964+],+"up": [+-0.2404612898826599,+0.07206565886735916,+0.9679798483848572+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 156.8240150809288+},+{+"blender_frame": 64,+"matrix_world": [+[+-0.28418272733688354,+-0.24104367196559906,+0.9279753565788269,+-1.762385368347168+],+[+0.9587700366973877,+-0.07174389809370041,+0.2749777138233185,+3.267051935195923+],+[+0.0002949344925582409,+0.9678588509559631,+0.2514938414096832,+1.015619158744812+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-176.2385368347168,+-326.7051935195923,+101.5619158744812+],+"forward": [+-0.9279753565788269,+0.2749777138233185,+-0.2514938414096832+],+"up": [+-0.24104367196559906,+0.07174389809370041,+0.9678588509559631+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 155.777857452631+},+{+"blender_frame": 65,+"matrix_world": [+[+-0.2822725176811218,+-0.24159424006938934,+0.928415060043335,+-1.771242618560791+],+[+0.9593342542648315,+-0.07137073576450348,+0.2731008529663086,+3.2616872787475586+],+[+0.00028207406285218894,+0.9677491188049316,+0.2519156336784363,+1.0136157274246216+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-177.1242618560791,+-326.16872787475586,+101.36157274246216+],+"forward": [+-0.928415060043335,+0.2731008529663086,+-0.2519156336784363+],+"up": [+-0.24159426987171173,+0.07137074321508408,+0.9677492380142212+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 154.75205183029175+},+{+"blender_frame": 66,+"matrix_world": [+[+-0.2803504765033722,+-0.24210096895694733,+0.928865373134613,+-1.7798840999603271+],+[+0.9598977565765381,+-0.0709584578871727,+0.27122193574905396,+3.2563905715942383+],+[+0.00024775753263384104,+0.9676529169082642,+0.2522853910923004,+1.011592984199524+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-177.98840999603271,+-325.6390571594238,+101.15929841995239+],+"forward": [+-0.928865373134613,+0.27122193574905396,+-0.2522853910923004+],+"up": [+-0.24210093915462494,+0.0709584504365921,+0.9676527976989746+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 153.7480168044567+},+{+"blender_frame": 67,+"matrix_world": [+[+-0.2784249484539032,+-0.24259315431118011,+0.9293159246444702,+-1.7883468866348267+],+[+0.9604580402374268,+-0.07051501423120499,+0.26934754848480225,+3.251216173171997+],+[+0.00018885648751165718,+0.9675620198249817,+0.25263363122940063,+1.0096194744110107+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-178.83468866348267,+-325.1216173171997,+100.96194744110107+],+"forward": [+-0.9293160438537598,+0.26934757828712463,+-0.252633661031723+],+"up": [+-0.24259315431118011,+0.07051501423120499,+0.9675620198249817+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 152.76557952165604+},+{+"blender_frame": 68,+"matrix_world": [+[+-0.27643918991088867,+-0.243117555975914,+0.9297716021537781,+-1.7966781854629517+],+[+0.9610314965248108,+-0.07009351998567581,+0.2674052119255066,+3.246147394180298+],+[+0.0001600649848114699,+0.9674609303474426,+0.2530202269554138,+1.0077778100967407+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-179.66781854629517,+-324.6147394180298,+100.77778100967407+],+"forward": [+-0.9297716021537781,+0.2674052119255066,+-0.2530202269554138+],+"up": [+-0.2431175857782364,+0.07009352743625641,+0.9674610495567322+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 151.80178731679916+},+{+"blender_frame": 69,+"matrix_world": [+[+-0.27440083026885986,+-0.24367205798625946,+0.9302301406860352,+-1.8047821521759033+],+[+0.9616153836250305,+-0.06973029673099518,+0.2653931975364685,+3.2411324977874756+],+[+0.00019632217299658805,+0.9673476815223694,+0.2534528374671936,+1.0060371160507202+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-180.47821521759033,+-324.11324977874756,+100.60371160507202+],+"forward": [+-0.9302301406860352,+0.2653931975364685,+-0.2534528374671936+],+"up": [+-0.24367208778858185,+0.06973030418157578,+0.9673478007316589+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 150.86340010166168+},+{+"blender_frame": 70,+"matrix_world": [+[+-0.27238425612449646,+-0.24420981109142303,+0.9306816458702087,+-1.8125993013381958+],+[+0.9621885418891907,+-0.06938719749450684,+0.26339828968048096,+3.2361900806427+],+[+0.000252940139034763,+0.9672368168830872,+0.25387582182884216,+1.0043267011642456+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-181.25993013381958,+-323.61900806427,+100.43267011642456+],+"forward": [+-0.9306817650794983,+0.26339831948280334,+-0.25387585163116455+],+"up": [+-0.24420981109142303,+0.06938719749450684,+0.9672368168830872+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 149.95492547750473+},+{+"blender_frame": 71,+"matrix_world": [+[+-0.2704300880432129,+-0.2447354644536972,+0.9311133027076721,+-1.8202383518218994+],+[+0.9627395868301392,+-0.06905540078878403,+0.26146483421325684,+3.231433629989624+],+[+0.00030868261819705367,+0.9671276807785034,+0.2542910873889923,+1.0026227235794067+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-182.02383518218994,+-323.1433629989624,+100.26227235794067+],+"forward": [+-0.9311134219169617,+0.2614648640155792,+-0.2542911171913147+],+"up": [+-0.2447354644536972,+0.06905540078878403,+0.9671276807785034+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 149.06873852014542+},+{+"blender_frame": 72,+"matrix_world": [+[+-0.2685551345348358,+-0.24523787200450897,+0.9315237998962402,+-1.8277251720428467+],+[+0.9632642865180969,+-0.0686912089586258,+0.259621798992157,+3.2268402576446533+],+[+0.0003183975932188332,+0.9670262932777405,+0.2546762526035309,+1.0009809732437134+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-182.77251720428467,+-322.68402576446533,+100.09809732437134+],+"forward": [+-0.9315237998962402,+0.259621798992157,+-0.2546762526035309+],+"up": [+-0.24523790180683136,+0.06869121640920639,+0.96702641248703+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 148.20330142974854+},+{+"blender_frame": 73,+"matrix_world": [+[+-0.26671093702316284,+-0.24573364853858948,+0.9319228529930115,+-1.8349940776824951+],+[+0.9637765288352966,+-0.06828594207763672,+0.25782129168510437,+3.222311019897461+],+[+0.00028186148847453296,+0.9669291973114014,+0.2550449073314667,+0.9994229078292847+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-183.4994077682495,+-322.2311019897461,+99.94229078292847+],+"forward": [+-0.931922972202301,+0.25782132148742676,+-0.25504493713378906+],+"up": [+-0.24573364853858948,+0.06828594207763672,+0.9669291973114014+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 147.36252948641777+},+{+"blender_frame": 74,+"matrix_world": [+[+-0.2648802697658539,+-0.24625198543071747,+0.9323080778121948,+-1.841970682144165+],+[+0.9642813205718994,+-0.06788110733032227,+0.2560347020626068,+3.2179391384124756+],+[+0.00023705261992290616,+0.9668257236480713,+0.25543656945228577,+0.9978976249694824+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-184.1970682144165,+-321.79391384124756,+99.78976249694824+],+"forward": [+-0.9323081970214844,+0.2560347318649292,+-0.25543659925460815+],+"up": [+-0.24625201523303986,+0.06788111478090286,+0.9668258428573608+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 146.55440524220467+},+{+"blender_frame": 75,+"matrix_world": [+[+-0.26309260725975037,+-0.2468099594116211,+0.9326666593551636,+-1.8486568927764893+],+[+0.9647705554962158,+-0.0674830824136734,+0.25429078936576843,+3.2138216495513916+],+[+0.00017773191211745143,+0.9667114019393921,+0.2558692693710327,+0.9963671565055847+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-184.86568927764893,+-321.38216495513916,+99.63671565055847+],+"forward": [+-0.9326666593551636,+0.25429078936576843,+-0.2558692693710327+],+"up": [+-0.2468099594116211,+0.0674830824136734,+0.9667114019393921+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 145.7803301513195+},+{+"blender_frame": 76,+"matrix_world": [+[+-0.2613844573497772,+-0.24736858904361725,+0.9329988360404968,+-1.8550982475280762+],+[+0.9652348756790161,+-0.06709302216768265,+0.2526269555091858,+3.2099344730377197+],+[+0.00010575249325484037,+0.9665957093238831,+0.2563058137893677,+0.994873583316803+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-185.50982475280762,+-320.993447303772,+99.4873583316803+],+"forward": [+-0.9329989552497864,+0.2526269853115082,+-0.25630584359169006+],+"up": [+-0.24736858904361725,+0.06709302216768265,+0.9665957093238831+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 145.0365737080574+},+{+"blender_frame": 77,+"matrix_world": [+[+-0.2597566246986389,+-0.24786844849586487,+0.9333207607269287,+-1.8612967729568481+],+[+0.9656741619110107,+-0.06671080738306046,+0.2510441541671753,+3.206209182739258+],+[+3.6654040741268545e-05,+0.966494083404541,+0.2566887140274048,+0.9934951066970825+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-186.12967729568481,+-320.6209182739258,+99.34951066970825+],+"forward": [+-0.9333208799362183,+0.2510441839694977,+-0.2566887438297272+],+"up": [+-0.24786847829818726,+0.06671081483364105,+0.9664942026138306+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 144.32303458452225+},+{+"blender_frame": 78,+"matrix_world": [+[+-0.25817251205444336,+-0.2483179271221161,+0.9336408376693726,+-1.8671791553497314+],+[+0.9660989046096802,+-0.06634163856506348,+0.24950318038463593,+3.20261549949646+],+[+-1.684630842646584e-05,+0.966404139995575,+0.257027268409729,+0.9922454953193665+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-186.71791553497314,+-320.261549949646,+99.22454953193665+],+"forward": [+-0.9336408376693726,+0.24950318038463593,+-0.257027268409729+],+"up": [+-0.24831795692443848,+0.06634164601564407,+0.9664042592048645+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 143.6459794640541+},+{+"blender_frame": 79,+"matrix_world": [+[+-0.25663846731185913,+-0.24878168106079102,+0.9339401721954346,+-1.872737169265747+],+[+0.9665075540542603,+-0.06601114571094513,+0.24800369143486023,+3.1992130279541016+],+[+-4.830892794416286e-05,+0.9663076400756836,+0.2573902904987335,+0.9910722970962524+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-187.2737169265747,+-319.92130279541016,+99.10722970962524+],+"forward": [+-0.9339402914047241,+0.24800372123718262,+-0.2573903203010559+],+"up": [+-0.24878165125846863,+0.06601113826036453,+0.966307520866394+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 143.00643503665924+},+{+"blender_frame": 80,+"matrix_world": [+[+-0.2551288306713104,+-0.24924388527870178,+0.934230625629425,+-1.8780146837234497+],+[+0.9669070839881897,+-0.06573553383350372,+0.24651481211185455,+3.1959874629974365+],+[+-3.0164366762619466e-05,+0.9662071466445923,+0.2577667236328125,+0.9899815320968628+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-187.80146837234497,+-319.59874629974365,+98.99815320968628+],+"forward": [+-0.934230625629425,+0.24651481211185455,+-0.2577667236328125+],+"up": [+-0.24924391508102417,+0.06573554128408432,+0.9662072658538818+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 142.39991083741188+},+{+"blender_frame": 81,+"matrix_world": [+[+-0.2536419630050659,+-0.24962134659290314,+0.9345346689224243,+-1.8830325603485107+],+[+0.9672982692718506,+-0.0654790997505188,+0.24504435062408447,+3.1929285526275635+],+[+2.4189010218833573e-05,+0.9661271572113037,+0.2580665647983551,+0.9889172911643982+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-188.30325603485107,+-319.29285526275635,+98.89172911643982+],+"forward": [+-0.9345346689224243,+0.24504435062408447,+-0.2580665647983551+],+"up": [+-0.24962134659290314,+0.0654790997505188,+0.9661271572113037+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 141.82257801294327+},+{+"blender_frame": 82,+"matrix_world": [+[+-0.25221753120422363,+-0.2499023824930191,+0.934844970703125,+-1.8877519369125366+],+[+0.9676706194877625,+-0.06521504372358322,+0.2436404526233673,+3.190042734146118+],+[+7.961838855408132e-05,+0.9660723209381104,+0.25827157497406006,+0.9879114031791687+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-188.77519369125366,+-319.0042734146118,+98.79114031791687+],+"forward": [+-0.934844970703125,+0.2436404526233673,+-0.25827157497406006+],+"up": [+-0.2499024122953415,+0.06521505117416382,+0.9660724401473999+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 141.27917736768723+},+{+"blender_frame": 83,+"matrix_world": [+[+-0.2508934438228607,+-0.2501509189605713,+0.9351347088813782,+-1.8921581506729126+],+[+0.9680148363113403,+-0.06494385004043579,+0.24234232306480408,+3.1873531341552734+],+[+0.00010909333650488406,+0.9660263657569885,+0.2584437131881714,+0.9869756698608398+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-189.21581506729126,+-318.73531341552734,+98.69756698608398+],+"forward": [+-0.9351348280906677,+0.24234235286712646,+-0.2584437429904938+],+"up": [+-0.2501509189605713,+0.06494385004043579,+0.9660263657569885+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 140.77224135398865+},+{+"blender_frame": 84,+"matrix_world": [+[+-0.24965505301952362,+-0.2504221498966217,+0.9353935718536377,+-1.8962745666503906+],+[+0.9683348536491394,+-0.06468521803617477,+0.24112963676452637,+3.1848647594451904+],+[+0.0001219377591041848,+0.9659733176231384,+0.2586415112018585,+0.9861334562301636+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-189.62745666503906,+-318.48647594451904,+98.61334562301636+],+"forward": [+-0.9353935718536377,+0.24112963676452637,+-0.2586415112018585+],+"up": [+-0.2504221796989441,+0.06468522548675537,+0.965973436832428+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 140.30026644468307+},+{+"blender_frame": 85,+"matrix_world": [+[+-0.2484525591135025,+-0.25070855021476746,+0.9356369376182556,+-1.9001119136810303+],+[+0.9686440825462341,+-0.06446835398674011,+0.2399427592754364,+3.182521343231201+],+[+0.00016326658078469336,+0.9659136533737183,+0.2588646113872528,+0.9853771924972534+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-190.01119136810303,+-318.2521343231201,+98.53771924972534+],+"forward": [+-0.9356370568275452,+0.2399427890777588,+-0.2588646411895752+],+"up": [+-0.25070855021476746,+0.06446835398674011,+0.9659136533737183+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 139.8604229092598+},+{+"blender_frame": 86,+"matrix_world": [+[+-0.24729660153388977,+-0.25096994638442993,+0.9358730912208557,+-1.9036277532577515+],+[+0.9689398407936096,+-0.0642792135477066,+0.2387966364622116,+3.1803057193756104+],+[+0.00022641185205429792,+0.9658583998680115,+0.2590707838535309,+0.9846508502960205+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-190.36277532577515,+-318.03057193756104,+98.46508502960205+],+"forward": [+-0.9358732104301453,+0.238796666264534,+-0.25907081365585327+],+"up": [+-0.25096994638442993,+0.0642792135477066,+0.9658583998680115+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 139.45477232336998+},+{+"blender_frame": 87,+"matrix_world": [+[+-0.24621933698654175,+-0.25119760632514954,+0.9360960721969604,+-1.9067559242248535+],+[+0.9692142009735107,+-0.06409160792827606,+0.23773154616355896,+3.1782515048980713+],+[+0.00027830549515783787,+0.9658116102218628,+0.259244829416275,+0.9839288592338562+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-190.67559242248535,+-317.82515048980713,+98.39288592338562+],+"forward": [+-0.9360960721969604,+0.23773154616355896,+-0.259244829416275+],+"up": [+-0.25119760632514954,+0.06409160792827606,+0.9658116102218628+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 139.08976167440414+},+{+"blender_frame": 88,+"matrix_world": [+[+-0.24529924988746643,+-0.2514093816280365,+0.9362806677818298,+-1.9095839262008667+],+[+0.9694474339485168,+-0.06388597935438156,+0.2368340641260147,+3.1764168739318848+],+[+0.00027289599529467523,+0.9657702445983887,+0.25939929485321045,+0.9832611083984375+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-190.95839262008667,+-317.6416873931885,+98.32611083984375+],+"forward": [+-0.9362807869911194,+0.2368340939283371,+-0.25939932465553284+],+"up": [+-0.2514093518257141,+0.06388597190380096,+0.9657701253890991+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 138.76033425331116+},+{+"blender_frame": 89,+"matrix_world": [+[+-0.24455571174621582,+-0.251647025346756,+0.9364113807678223,+-1.912155032157898+],+[+0.9696351885795593,+-0.06368496268987656,+0.2361181378364563,+3.17478346824646+],+[+0.00021689824643544853,+0.9657214283943176,+0.2595803439617157,+0.982684314250946+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-191.2155032157898,+-317.478346824646,+98.2684314250946+],+"forward": [+-0.9364113807678223,+0.2361181378364563,+-0.2595803439617157+],+"up": [+-0.25164705514907837,+0.06368497014045715,+0.9657215476036072+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 138.46303522586823+},+{+"blender_frame": 90,+"matrix_world": [+[+-0.24393393099308014,+-0.2519014775753021,+0.9365051984786987,+-1.914400339126587+],+[+0.9697918891906738,+-0.06351984292268753,+0.23551860451698303,+3.173341751098633+],+[+0.00015917784185148776,+0.9656660556793213,+0.25978660583496094,+0.9821326732635498+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-191.4400339126587,+-317.3341751098633,+98.21326732635498+],+"forward": [+-0.9365051984786987,+0.23551860451698303,+-0.25978660583496094+],+"up": [+-0.2519014775753021,+0.06351984292268753,+0.9656660556793213+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 138.20209354162216+},+{+"blender_frame": 91,+"matrix_world": [+[+-0.24340376257896423,+-0.2521584630012512,+0.9365738034248352,+-1.9162532091140747+],+[+0.969925045967102,+-0.06335882842540741,+0.23501285910606384,+3.1721062660217285+],+[+7.97421089373529e-05,+0.9656094908714294,+0.25999656319618225,+0.9816051721572876+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-191.62532091140747,+-317.21062660217285,+98.16051721572876+],+"forward": [+-0.9365739226341248,+0.23501288890838623,+-0.25999659299850464+],+"up": [+-0.2521584928035736,+0.063358835875988,+0.965609610080719+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 137.9838526248932+},+{+"blender_frame": 92,+"matrix_world": [+[+-0.24296043813228607,+-0.2523576021194458,+0.9366353154182434,+-1.9177091121673584+],+[+0.9700362682342529,+-0.06322206556797028,+0.234590545296669,+3.171114206314087+],+[+1.530582085251808e-05,+0.9655665159225464,+0.26015639305114746,+0.9812204837799072+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-191.77091121673584,+-317.1114206314087,+98.12204837799072+],+"forward": [+-0.936635434627533,+0.2345905750989914,+-0.26015642285346985+],+"up": [+-0.2523576021194458,+0.06322206556797028,+0.9655665159225464+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 137.81255409121513+},+{+"blender_frame": 93,+"matrix_world": [+[+-0.24266144633293152,+-0.25245726108551025,+0.9366860389709473,+-1.9188271760940552+],+[+0.970111072063446,+-0.06314712762832642,+0.2343011200428009,+3.1703600883483887+],+[+-1.9903091015294194e-06,+0.9655452966690063,+0.2602349519729614,+0.9809744358062744+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-191.88271760940552,+-317.03600883483887,+98.09744358062744+],+"forward": [+-0.9366860389709473,+0.2343011200428009,+-0.2602349519729614+],+"up": [+-0.25245729088783264,+0.06314713507890701,+0.9655454158782959+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 137.68255338072777+},+{+"blender_frame": 94,+"matrix_world": [+[+-0.24251973628997803,+-0.2524970769882202,+0.9367119669914246,+-1.9195655584335327+],+[+0.9701465964317322,+-0.0631265863776207,+0.23415984213352203,+3.1698057651519775+],+[+6.753914931323379e-06,+0.9655362367630005,+0.26026850938796997,+0.9807935953140259+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-191.95655584335327,+-316.98057651519775,+98.07935953140259+],+"forward": [+-0.9367120862007141,+0.23415987193584442,+-0.26026853919029236+],+"up": [+-0.2524971067905426,+0.0631265938282013,+0.96553635597229+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 137.59512603282928+},+{+"blender_frame": 95,+"matrix_world": [+[+-0.24249128997325897,+-0.2525421679019928,+0.9367073178291321,+-1.9199782609939575+],+[+0.9701536297798157,+-0.06316352635622025,+0.23412048816680908,+3.169416666030884+],+[+4.044552406412549e-05,+0.9655221104621887,+0.2603212893009186,+0.9805687069892883+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-191.99782609939575,+-316.9416666030884,+98.05687069892883+],+"forward": [+-0.9367073178291321,+0.23412048816680908,+-0.2603212893009186+],+"up": [+-0.2525421679019928,+0.06316352635622025,+0.9655221104621887+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 137.54142820835114+},+{+"blender_frame": 96,+"matrix_world": [+[+-0.24252697825431824,+-0.2525913715362549,+0.9366846680641174,+-1.9201184511184692+],+[+0.9701446890830994,+-0.06321588158607483,+0.23414330184459686,+3.1692559719085693+],+[+7.076881593093276e-05,+0.9655057191848755,+0.2603817284107208,+0.9803773164749146+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-192.01184511184692,+-316.92559719085693,+98.03773164749146+],+"forward": [+-0.936684787273407,+0.23414333164691925,+-0.2603817582130432+],+"up": [+-0.25259140133857727,+0.06321588903665543,+0.965505838394165+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 137.519770860672+},+{+"blender_frame": 97,+"matrix_world": [+[+-0.2425706535577774,+-0.2525877058506012,+0.9366743564605713,+-1.9200947284698486+],+[+0.9701337814331055,+-0.06323099881410599,+0.23418445885181427,+3.169229507446289+],+[+7.473585719708353e-05,+0.9655056595802307,+0.2603818476200104,+0.9802348017692566+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+-192.00947284698486,+-316.9229507446289,+98.02348017692566+],+"forward": [+-0.9366744756698608,+0.23418448865413666,+-0.26038187742233276+],+"up": [+-0.2525877356529236,+0.06323100626468658,+0.9655057787895203+],+"lens_mm": 35.0,+"fstop": 2.0,+"focus_cm": 137.51784935593605+}+]+}\ No newline at end of filediff --git a/unreal_demo/cams/s4_neon_tilt.json b/unreal_demo/cams/s4_neon_tilt.jsonnew file mode 100644index 0000000..aa3880c--- /dev/null+++ b/unreal_demo/cams/s4_neon_tilt.json@@ -0,0 +1,5750 @@+{+"shot": "s4_neon_tilt",+"fps": 24,+"frames_n": 120,+"res": [+1920,+804+],+"sensor_width_mm": 24.889999389648438,+"sensor_height_mm": 10.422687244415282,+"dof": true,+"seed": 0,+"shutter_deg": 180.0,+"frames": [+{+"blender_frame": 0,+"matrix_world": [+[+0.9105311632156372,+0.24115005135536194,+0.3358269929885864,+1.7997499704360962+],+[+0.41344064474105835,+-0.5311146974563599,+-0.7395836710929871,+-2.199946165084839+],+[+1.2041011359542608e-05,+0.8122584819793701,+-0.5832976698875427,+1.3499442338943481+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97499704360962,+219.9946165084839,+134.99442338943481+],+"forward": [+-0.3358269929885864,+-0.7395836710929871,+0.5832976698875427+],+"up": [+0.24115005135536194,+0.5311146974563599,+0.8122584819793701+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1254.503583908081+},+{+"blender_frame": 1,+"matrix_world": [+[+0.9105361700057983,+0.2411518692970276,+0.3358120024204254,+1.7997944355010986+],+[+0.41342949867248535,+-0.531126856803894,+-0.7395811676979065,+-2.199876308441162+],+[+7.401715265586972e-06,+0.812250018119812,+-0.5833094716072083,+1.3499375581741333+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97944355010986,+219.9876308441162,+134.99375581741333+],+"forward": [+-0.3358120024204254,+-0.7395811676979065,+0.5833094716072083+],+"up": [+0.2411518692970276,+0.531126856803894,+0.812250018119812+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1254.4963479042053+},+{+"blender_frame": 2,+"matrix_world": [+[+0.9105428457260132,+0.24113699793815613,+0.3358045816421509,+1.7998548746109009+],+[+0.413414865732193,+-0.5310919880867004,+-0.7396143078804016,+-2.1998651027679443+],+[+-5.255933501757681e-06,+0.8122771978378296,+-0.5832715630531311,+1.3499587774276733+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9854874610901,+219.98651027679443,+134.99587774276733+],+"forward": [+-0.33580461144447327,+-0.7396143674850464,+0.5832716226577759+],+"up": [+0.24113699793815613,+0.5310919880867004,+0.8122771978378296+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1254.5094728469849+},+{+"blender_frame": 3,+"matrix_world": [+[+0.910524845123291,+0.2411227822303772,+0.3358636796474457,+1.799891471862793+],+[+0.41345447301864624,+-0.5309339761734009,+-0.7397058010101318,+-2.1998798847198486+],+[+-3.845564788207412e-05,+0.8123847246170044,+-0.5831218957901001,+1.3500103950500488+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9891471862793,+219.98798847198486,+135.00103950500488+],+"forward": [+-0.3358636498451233,+-0.7397057414054871,+0.5831218361854553+],+"up": [+0.2411227822303772,+0.5309339761734009,+0.8123847246170044+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1254.5601725578308+},+{+"blender_frame": 4,+"matrix_world": [+[+0.9104897975921631,+0.24110732972621918,+0.33596980571746826,+1.799851655960083+],+[+0.4135316014289856,+-0.5306611657142639,+-0.7398583889007568,+-2.1998672485351562+],+[+-9.914246038533747e-05,+0.8125674724578857,+-0.5828670263290405,+1.3500581979751587+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9851655960083,+219.98672485351562,+135.00581979751587+],+"forward": [+-0.33596980571746826,+-0.7398583889007568,+0.5828670263290405+],+"up": [+0.24110735952854156,+0.5306612253189087,+0.8125675916671753+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1254.6422481536865+},+{+"blender_frame": 5,+"matrix_world": [+[+0.9104482531547546,+0.24106650054454803,+0.3361113667488098,+1.7997994422912598+],+[+0.4136228859424591,+-0.5303350687026978,+-0.7400410771369934,+-2.199843168258667+],+[+-0.0001474644523113966,+0.8127924203872681,+-0.5825532674789429,+1.3500930070877075+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97994422912598,+219.9843168258667,+135.00930070877075+],+"forward": [+-0.3361113965511322,+-0.7400411367416382,+0.5825533270835876+],+"up": [+0.24106653034687042,+0.5303351283073425,+0.8127925395965576+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1254.7436118125916+},+{+"blender_frame": 6,+"matrix_world": [+[+0.9103914499282837,+0.2410029172897339,+0.3363109529018402,+1.799788475036621+],+[+0.4137480556964874,+-0.529969334602356,+-0.7402331233024597,+-2.199838876724243+],+[+-0.00016384352056775242,+0.813049852848053,+-0.582193911075592,+1.350160002708435+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9788475036621,+219.98388767242432,+135.0160002708435+],+"forward": [+-0.3363109827041626,+-0.7402331829071045,+0.5821939706802368+],+"up": [+0.2410029172897339,+0.529969334602356,+0.813049852848053+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1254.8607110977173+},+{+"blender_frame": 7,+"matrix_world": [+[+0.9103030562400818,+0.24092966318130493,+0.33660271763801575,+1.799867033958435+],+[+0.4139426052570343,+-0.5295150876045227,+-0.7404494285583496,+-2.1998679637908936+],+[+-0.00016001233598217368,+0.8133675456047058,+-0.5817502737045288,+1.3502494096755981+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9867033958435,+219.98679637908936,+135.02494096755981+],+"forward": [+-0.33660271763801575,+-0.7404494285583496,+0.5817502737045288+],+"up": [+0.24092966318130493,+0.5295150876045227,+0.8133675456047058+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1255.0098657608032+},+{+"blender_frame": 8,+"matrix_world": [+[+0.9101801514625549,+0.24087662994861603,+0.3369729220867157,+1.7999582290649414+],+[+0.41421282291412354,+-0.5289547443389893,+-0.7406988143920898,+-2.199906349182129+],+[+-0.00017359122284688056,+0.8137477040290833,+-0.5812183022499084,+1.3502845764160156+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.99582290649414,+219.9906349182129,+135.02845764160156+],+"forward": [+-0.3369729220867157,+-0.7406988143920898,+0.5812183022499084+],+"up": [+0.24087662994861603,+0.5289547443389893,+0.8137477040290833+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1255.1921367645264+},+{+"blender_frame": 9,+"matrix_world": [+[+0.9100359082221985,+0.24086208641529083,+0.33737272024154663,+1.8000011444091797+],+[+0.4145297408103943,+-0.528321385383606,+-0.7409734725952148,+-2.1999268531799316+],+[+-0.00023119518300518394,+0.8141632676124573,+-0.5806358456611633,+1.3502748012542725+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00011444091797,+219.99268531799316,+135.02748012542725+],+"forward": [+-0.33737272024154663,+-0.7409734725952148,+0.5806358456611633+],+"up": [+0.24086211621761322,+0.5283214449882507,+0.8141633868217468+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1255.3900599479675+},+{+"blender_frame": 10,+"matrix_world": [+[+0.9098730087280273,+0.2408638745546341,+0.337810218334198,+1.8000197410583496+],+[+0.41488680243492126,+-0.5276445150375366,+-0.7412559390068054,+-2.1999261379241943+],+[+-0.0002980703429784626,+0.8146016001701355,+-0.5800207257270813,+1.3502781391143799+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00197410583496,+219.99261379241943,+135.027813911438+],+"forward": [+-0.3378101885318756,+-0.7412558794021606,+0.5800206661224365+],+"up": [+0.24086390435695648,+0.5276445746421814,+0.814601719379425+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1255.594789981842+},+{+"blender_frame": 11,+"matrix_world": [+[+0.9096733331680298,+0.24087439477443695,+0.3383404016494751,+1.800018310546875+],+[+0.41532474756240845,+-0.5269215106964111,+-0.741524875164032,+-2.199955463409424+],+[+-0.0003355099179316312,+0.8150663375854492,+-0.579367458820343,+1.3503060340881348+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0018310546875,+219.99554634094238,+135.03060340881348+],+"forward": [+-0.3383404016494751,+-0.741524875164032,+0.579367458820343+],+"up": [+0.24087442457675934,+0.5269215703010559,+0.8150664567947388+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1255.8103799819946+},+{+"blender_frame": 12,+"matrix_world": [+[+0.9094343781471252,+0.2408709079027176,+0.3389844000339508,+1.800015926361084+],+[+0.4158474802970886,+-0.5261278748512268,+-0.7417952418327332,+-2.200003147125244+],+[+-0.0003277370997238904,+0.8155797719955444,+-0.5786443948745728,+1.3502883911132812+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0015926361084,+220.0003147125244,+135.02883911132812+],+"forward": [+-0.3389844298362732,+-0.7417953014373779,+0.5786444544792175+],+"up": [+0.24087096750736237,+0.5261279940605164,+0.8155799508094788+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1256.0510039329529+},+{+"blender_frame": 13,+"matrix_world": [+[+0.9091719388961792,+0.24084115028381348,+0.3397085666656494,+1.8000088930130005+],+[+0.41642075777053833,+-0.5252281427383423,+-0.7421112656593323,+-2.2000250816345215+],+[+-0.0003064233751501888,+0.816168487071991,+-0.5778138637542725,+1.3502579927444458+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00088930130005,+220.00250816345215,+135.02579927444458+],+"forward": [+-0.3397085964679718,+-0.742111325263977,+0.5778139233589172+],+"up": [+0.24084115028381348,+0.5252281427383423,+0.816168487071991+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1256.323766708374+},+{+"blender_frame": 14,+"matrix_world": [+[+0.9088941812515259,+0.2407945990562439,+0.3404841125011444,+1.7999860048294067+],+[+0.41702690720558167,+-0.5242293477058411,+-0.7424769997596741,+-2.2000033855438232+],+[+-0.0002926781016867608,+0.8168240189552307,+-0.576886773109436,+1.3502159118652344+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.99860048294067,+220.00033855438232,+135.02159118652344+],+"forward": [+-0.3404841423034668,+-0.7424770593643188,+0.5768868327140808+],+"up": [+0.24079462885856628,+0.5242294073104858,+0.8168241381645203+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1256.622838973999+},+{+"blender_frame": 15,+"matrix_world": [+[+0.9085936546325684,+0.24071532487869263,+0.3413410782814026,+1.799932837486267+],+[+0.4176812171936035,+-0.5231623649597168,+-0.7428616881370544,+-2.199983596801758+],+[+-0.00024137349100783467,+0.817531168460846,+-0.5758843421936035,+1.35013747215271+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9932837486267,+219.99835968017578,+135.013747215271+],+"forward": [+-0.3413410782814026,+-0.7428616881370544,+0.5758843421936035+],+"up": [+0.24071535468101501,+0.5231624245643616,+0.8175312876701355+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1256.944501399994+},+{+"blender_frame": 16,+"matrix_world": [+[+0.9082698822021484,+0.24061496555805206,+0.3422723710536957,+1.7998632192611694+],+[+0.41838496923446655,+-0.5220177173614502,+-0.7432708144187927,+-2.1999895572662354+],+[+-0.0001698100968496874,+0.8182919025421143,+-0.574802815914154,+1.350055456161499+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98632192611694,+219.99895572662354,+135.0055456161499+],+"forward": [+-0.3422723710536957,+-0.7432708144187927,+0.574802815914154+],+"up": [+0.24061502516269684,+0.5220178365707397,+0.8182920813560486+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1257.2900295257568+},+{+"blender_frame": 17,+"matrix_world": [+[+0.9079273343086243,+0.24051563441753387,+0.3432495594024658,+1.7997864484786987+],+[+0.4191277325153351,+-0.52076256275177,+-0.7437326312065125,+-2.2000041007995605+],+[+-0.00012778467498719692,+0.8191206455230713,+-0.5736212730407715,+1.3500103950500488+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97864484786987,+220.00041007995605,+135.00103950500488+],+"forward": [+-0.3432495892047882,+-0.7437326908111572,+0.5736213326454163+],+"up": [+0.24051563441753387,+0.52076256275177,+0.8191206455230713+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1257.6623797416687+},+{+"blender_frame": 18,+"matrix_world": [+[+0.9075683951377869,+0.24041175842285156,+0.3442699909210205,+1.7997714281082153+],+[+0.41990432143211365,+-0.5193945169448853,+-0.7442511320114136,+-2.199993848800659+],+[+-0.00011475334031274542,+0.8200191855430603,+-0.5723360180854797,+1.3499441146850586+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97714281082153,+219.99938488006592,+134.99441146850586+],+"forward": [+-0.3442699909210205,+-0.7442511320114136,+0.5723360180854797+],+"up": [+0.24041178822517395,+0.51939457654953,+0.8200193047523499+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1258.0654621124268+},+{+"blender_frame": 19,+"matrix_world": [+[+0.9071831107139587,+0.2402845025062561,+0.34537261724472046,+1.799812912940979+],+[+0.4207361042499542,+-0.5179354548454285,+-0.744797945022583,+-2.199974298477173+],+[+-8.269619138445705e-05,+0.8209788203239441,+-0.5709585547447205,+1.3498209714889526+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9812912940979,+219.99742984771729,+134.98209714889526+],+"forward": [+-0.34537264704704285,+-0.7447980046272278,+0.5709586143493652+],+"up": [+0.2402845025062561,+0.5179354548454285,+0.8209788203239441+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1258.496654033661+},+{+"blender_frame": 20,+"matrix_world": [+[+0.9067752957344055,+0.24012525379657745,+0.34655240178108215,+1.799892544746399+],+[+0.42161446809768677,+-0.5164343118667603,+-0.7453433871269226,+-2.199960708618164+],+[+-4.199238901492208e-06,+0.8219703435897827,+-0.5695301294326782,+1.349695086479187+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9892544746399,+219.9960708618164,+134.9695086479187+],+"forward": [+-0.34655243158340454,+-0.7453434467315674,+0.569530189037323+],+"up": [+0.24012528359889984,+0.516434371471405,+0.8219704627990723+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1258.939516544342+},+{+"blender_frame": 21,+"matrix_world": [+[+0.9063507914543152,+0.23995739221572876,+0.3477770686149597,+1.7999615669250488+],+[+0.4225262701511383,+-0.514893651008606,+-0.7458928823471069,+-2.199971914291382+],+[+8.567328040953726e-05,+0.8229854702949524,+-0.5680624842643738,+1.349643349647522+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.99615669250488,+219.99719142913818,+134.9643349647522+],+"forward": [+-0.3477770686149597,+-0.7458928823471069,+0.5680624842643738+],+"up": [+0.23995739221572876,+0.514893651008606,+0.8229854702949524+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1259.3857765197754+},+{+"blender_frame": 22,+"matrix_world": [+[+0.9059039950370789,+0.23980027437210083,+0.34904712438583374,+1.800002932548523+],+[+0.4234832227230072,+-0.5132713913917542,+-0.7464680075645447,+-2.1999993324279785+],+[+0.00015267413982655853,+0.8240439295768738,+-0.566525936126709,+1.3496606349945068+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0002932548523,+219.99993324279785,+134.96606349945068+],+"forward": [+-0.34904712438583374,+-0.7464680075645447,+0.566525936126709+],+"up": [+0.23980027437210083,+0.5132713913917542,+0.8240439295768738+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1259.8430037498474+},+{+"blender_frame": 23,+"matrix_world": [+[+0.9054203033447266,+0.23966097831726074,+0.35039520263671875,+1.8000547885894775+],+[+0.42451635003089905,+-0.5115780234336853,+-0.7470434904098511,+-2.2000176906585693+],+[+0.00021729746367782354,+0.8251367211341858,+-0.5649330615997314,+1.34967839717865+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00547885894775,+220.00176906585693,+134.967839717865+],+"forward": [+-0.35039517283439636,+-0.7470434308052063,+0.5649330019950867+],+"up": [+0.23966097831726074,+0.5115780234336853,+0.8251367211341858+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1260.3092193603516+},+{+"blender_frame": 24,+"matrix_world": [+[+0.9049050211906433,+0.2395353466272354,+0.3518091142177582,+1.8001093864440918+],+[+0.4256133735179901,+-0.5097724199295044,+-0.7476531267166138,+-2.2000341415405273+],+[+0.00025325120077468455,+0.8262898325920105,+-0.5632450580596924,+1.349694013595581+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01093864440918,+220.00341415405273,+134.9694013595581+],+"forward": [+-0.35180914402008057,+-0.7476531863212585,+0.5632451176643372+],+"up": [+0.2395353466272354,+0.5097724199295044,+0.8262898325920105+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1260.796308517456+},+{+"blender_frame": 25,+"matrix_world": [+[+0.9043822884559631,+0.23938977718353271,+0.3532496988773346,+1.8001790046691895+],+[+0.42672330141067505,+-0.50783371925354,+-0.7483395338058472,+-2.1999928951263428+],+[+0.00024728846619836986,+0.8275249600410461,+-0.561428964138031,+1.3496843576431274+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01790046691895,+219.99928951263428,+134.96843576431274+],+"forward": [+-0.353249728679657,+-0.7483395934104919,+0.5614290237426758+],+"up": [+0.23938977718353271,+0.50783371925354,+0.8275249600410461+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1261.3118529319763+},+{+"blender_frame": 26,+"matrix_world": [+[+0.9038541913032532,+0.23921430110931396,+0.3547172248363495,+1.8002214431762695+],+[+0.42784085869789124,+-0.5057875514030457,+-0.7490867972373962,+-2.199920415878296+],+[+0.00021928123896941543,+0.8288276791572571,+-0.5595037341117859,+1.3496748208999634+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.02214431762695,+219.9920415878296,+134.96748208999634+],+"forward": [+-0.3547172546386719,+-0.749086856842041,+0.5595037937164307+],+"up": [+0.23921433091163635,+0.5057876110076904,+0.8288277983665466+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1261.847710609436+},+{+"blender_frame": 27,+"matrix_world": [+[+0.9032973647117615,+0.2390017956495285,+0.35627514123916626,+1.800207257270813+],+[+0.4290149211883545,+-0.5036245584487915,+-0.7498722672462463,+-2.1998355388641357+],+[+0.0002080860431306064,+0.8302050232887268,+-0.5574579834938049,+1.349668025970459+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0207257270813,+219.98355388641357,+134.9668025970459+],+"forward": [+-0.35627517104148865,+-0.7498723268508911,+0.5574580430984497+],+"up": [+0.2390018254518509,+0.5036246180534363,+0.8302051424980164+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1262.4041080474854+},+{+"blender_frame": 28,+"matrix_world": [+[+0.9027091860771179,+0.2387668788433075,+0.35791975259780884,+1.8001400232315063+],+[+0.4302513301372528,+-0.5013546943664551,+-0.750684380531311,+-2.1997833251953125+],+[+0.00020621553994715214,+0.831645131111145,+-0.5553073287010193,+1.3496795892715454+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01400232315063,+219.97833251953125,+134.96795892715454+],+"forward": [+-0.3579197824001312,+-0.7506844997406006,+0.5553073883056641+],+"up": [+0.23876690864562988,+0.5013547539710999,+0.8316452503204346+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1262.9775524139404+},+{+"blender_frame": 29,+"matrix_world": [+[+0.9021040201187134,+0.2385379821062088,+0.35959434509277344,+1.800101399421692+],+[+0.4315187931060791,+-0.49898767471313477,+-0.7515336871147156,+-2.199779987335205+],+[+0.00016382262401748449,+0.8331331610679626,+-0.5530723929405212,+1.349709153175354+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0101399421692,+219.9779987335205,+134.9709153175354+],+"forward": [+-0.35959434509277344,+-0.7515336871147156,+0.5530723929405212+],+"up": [+0.2385380119085312,+0.49898773431777954,+0.8331332802772522+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1263.5664701461792+},+{+"blender_frame": 30,+"matrix_world": [+[+0.9014853239059448,+0.2383003681898117,+0.3612995147705078,+1.8000763654708862+],+[+0.4328099191188812,+-0.4965100586414337,+-0.7524316906929016,+-2.199763298034668+],+[+8.409500878769904e-05,+0.834679901599884,+-0.5507352352142334,+1.3497278690338135+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00763654708862,+219.9763298034668,+134.97278690338135+],+"forward": [+-0.3612995147705078,+-0.7524316906929016,+0.5507352352142334+],+"up": [+0.2383003979921341,+0.4965101182460785,+0.8346800208091736+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1264.1712427139282+},+{+"blender_frame": 31,+"matrix_world": [+[+0.9008395075798035,+0.23803432285785675,+0.363081157207489,+1.8000147342681885+],+[+0.43415242433547974,+-0.49391523003578186,+-0.7533653974533081,+-2.1996910572052+],+[+4.480149073060602e-06,+0.8362938165664673,+-0.5482814311981201,+1.3497154712677002+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00147342681885,+219.96910572052002,+134.97154712677002+],+"forward": [+-0.3630811870098114,+-0.7533655166625977,+0.5482814908027649+],+"up": [+0.23803432285785675,+0.49391523003578186,+0.8362938165664673+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1264.7887468338013+},+{+"blender_frame": 32,+"matrix_world": [+[+0.9001554846763611,+0.2377205193042755,+0.3649780750274658,+1.799916386604309+],+[+0.4355686604976654,+-0.49121806025505066,+-0.7543107867240906,+-2.199633836746216+],+[+-3.134300641249865e-05,+0.8379701375961304,+-0.5457161664962769,+1.3496944904327393+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9916386604309,+219.96338367462158,+134.96944904327393+],+"forward": [+-0.3649781048297882,+-0.7543109059333801,+0.5457162261009216+],+"up": [+0.23772048950195312,+0.4912180006504059,+0.8379700183868408+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1265.4179215431213+},+{+"blender_frame": 33,+"matrix_world": [+[+0.8994346857070923,+0.23736444115638733,+0.36698150634765625,+1.799850344657898+],+[+0.4370553195476532,+-0.4884219169616699,+-0.7552659511566162,+-2.199657917022705+],+[+-3.1462666811421514e-05,+0.8397035598754883,+-0.543044924736023,+1.3496921062469482+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9850344657898,+219.9657917022705,+134.96921062469482+],+"forward": [+-0.36698153614997864,+-0.7552660703659058,+0.5430449843406677+],+"up": [+0.23736447095870972,+0.4884219765663147,+0.8397036790847778+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1266.0616397857666+},+{+"blender_frame": 34,+"matrix_world": [+[+0.8986854553222656,+0.2369903028011322,+0.36905309557914734,+1.799819827079773+],+[+0.43859395384788513,+-0.4855157136917114,+-0.7562471032142639,+-2.199678659439087+],+[+-4.215206718072295e-05,+0.8414927124977112,+-0.5402683019638062,+1.3496731519699097+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9819827079773,+219.9678659439087,+134.96731519699097+],+"forward": [+-0.3690531849861145,+-0.7562472820281982,+0.5402684211730957+],+"up": [+0.2369903326034546,+0.4855157732963562,+0.8414928317070007+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1266.714870929718+},+{+"blender_frame": 35,+"matrix_world": [+[+0.8979074954986572,+0.23659713566303253,+0.37119272351264954,+1.7998101711273193+],+[+0.4401843547821045,+-0.48249268531799316,+-0.7572571635246277,+-2.199674606323242+],+[+-6.711569585604593e-05,+0.8433402180671692,+-0.5373799800872803,+1.349624514579773+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98101711273193,+219.96746063232422,+134.9624514579773+],+"forward": [+-0.3711928129196167,+-0.757257342338562,+0.5373800992965698+],+"up": [+0.23659713566303253,+0.48249268531799316,+0.8433402180671692+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1267.3759460449219+},+{+"blender_frame": 36,+"matrix_world": [+[+0.8970991969108582,+0.23618654906749725,+0.373401939868927,+1.7998303174972534+],+[+0.4418293237686157,+-0.4793674945831299,+-0.7582833766937256,+-2.1997058391571045+],+[+-9.960310126189142e-05,+0.845235288143158,+-0.5343943238258362,+1.3496084213256836+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98303174972534,+219.97058391571045,+134.96084213256836+],+"forward": [+-0.373401939868927,+-0.7582833766937256,+0.5343943238258362+],+"up": [+0.23618654906749725,+0.4793674945831299,+0.845235288143158+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1268.0404305458069+},+{+"blender_frame": 37,+"matrix_world": [+[+0.8962534666061401,+0.2357436716556549,+0.37570568919181824,+1.799880862236023+],+[+0.4435424208641052,+-0.47615376114845276,+-0.7593073844909668,+-2.1997506618499756+],+[+-0.00010823985212482512,+0.8471732139587402,+-0.5313166975975037,+1.3496365547180176+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9880862236023,+219.97506618499756,+134.96365547180176+],+"forward": [+-0.375705748796463,+-0.7593075037002563,+0.5313167572021484+],+"up": [+0.2357437014579773,+0.47615382075309753,+0.8471733331680298+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1268.665361404419+},+{+"blender_frame": 38,+"matrix_world": [+[+0.895370602607727,+0.23525354266166687,+0.3781100809574127,+1.7999595403671265+],+[+0.4453217089176178,+-0.4728458821773529,+-0.7603324055671692,+-2.1997063159942627+],+[+-8.309893019031733e-05,+0.8491599559783936,+-0.5281358361244202,+1.349663257598877+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.99595403671265,+219.97063159942627,+134.9663257598877+],+"forward": [+-0.3781100809574127,+-0.7603324055671692,+0.5281358361244202+],+"up": [+0.23525354266166687,+0.4728458821773529,+0.8491599559783936+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1268.6723828315735+},+{+"blender_frame": 39,+"matrix_world": [+[+0.8944535255432129,+0.23471808433532715,+0.3806053400039673,+1.8000462055206299+],+[+0.44716107845306396,+-0.46944135427474976,+-0.761361837387085,+-2.1996381282806396+],+[+-3.351557097630575e-05,+0.8511946201324463,+-0.5248501896858215,+1.34967839717865+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.004620552063,+219.96381282806396,+134.967839717865+],+"forward": [+-0.3806053400039673,+-0.761361837387085,+0.5248501896858215+],+"up": [+0.23471808433532715,+0.46944135427474976,+0.8511946201324463+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1267.869770526886+},+{+"blender_frame": 40,+"matrix_world": [+[+0.8935173749923706,+0.23413121700286865,+0.38315701484680176,+1.800110936164856+],+[+0.44902870059013367,+-0.4658891260623932,+-0.7624437808990479,+-2.1996424198150635+],+[+-3.1978524930309504e-06,+0.8533052802085876,+-0.521411657333374,+1.349708914756775+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0110936164856,+219.96424198150635,+134.9708914756775+],+"forward": [+-0.38315707445144653,+-0.7624439001083374,+0.5214117169380188+],+"up": [+0.23413121700286865,+0.4658891260623932,+0.8533052802085876+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1266.278052330017+},+{+"blender_frame": 41,+"matrix_world": [+[+0.8925707936286926,+0.233491450548172,+0.38574501872062683,+1.8001753091812134+],+[+0.4509074091911316,+-0.46218231320381165,+-0.7635902762413025,+-2.199636936187744+],+[+-7.285729225259274e-06,+0.8554936051368713,+-0.5178133845329285,+1.349738359451294+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01753091812134,+219.9636936187744,+134.9738359451294+],+"forward": [+-0.38574501872062683,+-0.7635902762413025,+0.5178133845329285+],+"up": [+0.233491450548172,+0.46218231320381165,+0.8554936051368713+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1263.8986229896545+},+{+"blender_frame": 42,+"matrix_world": [+[+0.8916033506393433,+0.23279978334903717,+0.38839131593704224,+1.8002232313156128+],+[+0.4528173506259918,+-0.45836153626441956,+-0.7647621631622314,+-2.1995584964752197+],+[+-1.2825556041207165e-05,+0.8577347993850708,+-0.5140924453735352,+1.3497735261917114+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.02232313156128,+219.95584964752197,+134.97735261917114+],+"forward": [+-0.38839131593704224,+-0.7647621631622314,+0.5140924453735352+],+"up": [+0.23279978334903717,+0.45836153626441956,+0.8577347993850708+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1260.7212901115417+},+{+"blender_frame": 43,+"matrix_world": [+[+0.890611469745636,+0.23205381631851196,+0.3911040127277374,+1.8002077341079712+],+[+0.4547651708126068,+-0.45442959666252136,+-0.7659518718719482,+-2.1994740962982178+],+[+-1.2822223652619869e-05,+0.860025942325592,+-0.5102501511573792,+1.3498345613479614+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.02077341079712,+219.94740962982178,+134.98345613479614+],+"forward": [+-0.3911040723323822,+-0.7659519910812378,+0.5102502107620239+],+"up": [+0.23205384612083435,+0.45442965626716614,+0.8600260615348816+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1256.75448179245+},+{+"blender_frame": 44,+"matrix_world": [+[+0.8895750641822815,+0.23126989603042603,+0.3939167559146881,+1.8001426458358765+],+[+0.45678892731666565,+-0.450405091047287,+-0.7671238780021667,+-2.1994450092315674+],+[+9.440525900572538e-06,+0.8623510599136353,+-0.5063106417655945,+1.3498972654342651+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01426458358765,+219.94450092315674,+134.9897265434265+],+"forward": [+-0.3939168155193329,+-0.7671239972114563,+0.5063107013702393+],+"up": [+0.2312699258327484,+0.45040515065193176,+0.8623511791229248+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1252.0063996315002+},+{+"blender_frame": 45,+"matrix_world": [+[+0.8884912729263306,+0.23044686019420624,+0.3968343734741211,+1.800062894821167+],+[+0.4588935673236847,+-0.44625934958457947,+-0.7682898640632629,+-2.1994564533233643+],+[+4.105582775082439e-05,+0.8647236227989197,+-0.5022481083869934,+1.3499457836151123+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0062894821167,+219.94564533233643,+134.99457836151123+],+"forward": [+-0.3968343734741211,+-0.7682898640632629,+0.5022481083869934+],+"up": [+0.23044686019420624,+0.44625934958457947,+0.8647236227989197+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1246.4932799339294+},+{+"blender_frame": 46,+"matrix_world": [+[+0.8873733878135681,+0.22956444323062897,+0.3998359143733978,+1.8000153303146362+],+[+0.4610516428947449,+-0.44194814562797546,+-0.7694889307022095,+-2.1994683742523193+],+[+5.9444886574056e-05,+0.8671689033508301,+-0.49801406264305115,+1.3499201536178589+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00153303146362,+219.94683742523193,+134.9920153617859+],+"forward": [+-0.3998359143733978,+-0.7694889307022095,+0.49801406264305115+],+"up": [+0.22956447303295135,+0.44194820523262024,+0.8671690225601196+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1240.240490436554+},+{+"blender_frame": 47,+"matrix_world": [+[+0.8862247467041016,+0.22859759628772736,+0.4029255211353302,+1.7999788522720337+],+[+0.4632556736469269,+-0.4374569356441498,+-0.7707305550575256,+-2.1994681358337402+],+[+7.540461956523359e-05,+0.8696979880332947,+-0.4935842454433441,+1.3498718738555908+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.99788522720337,+219.94681358337402,+134.98718738555908+],+"forward": [+-0.4029255211353302,+-0.7707305550575256,+0.4935842454433441+],+"up": [+0.22859759628772736,+0.4374569356441498,+0.8696979880332947+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1233.2602977752686+},+{+"blender_frame": 48,+"matrix_world": [+[+0.885042130947113,+0.22755871713161469,+0.406100332736969,+1.799928069114685+],+[+0.4655109941959381,+-0.43280085921287537,+-0.7719992399215698,+-2.199496030807495+],+[+8.543546573491767e-05,+0.8722960948944092,+-0.4889780580997467,+1.3498269319534302+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9928069114685,+219.9496030807495,+134.98269319534302+],+"forward": [+-0.40610039234161377,+-0.7719993591308594,+0.4889781177043915+],+"up": [+0.22755871713161469,+0.43280085921287537,+0.8722960948944092+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1225.5646586418152+},+{+"blender_frame": 49,+"matrix_world": [+[+0.8838109970092773,+0.22648610174655914,+0.4093681871891022,+1.7998462915420532+],+[+0.46784427762031555,+-0.4280221164226532,+-0.7732521295547485,+-2.1995444297790527+],+[+8.777187758823857e-05,+0.8749292492866516,+-0.48425084352493286,+1.3498406410217285+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98462915420532,+219.95444297790527,+134.98406410217285+],+"forward": [+-0.4093681871891022,+-0.7732521295547485,+0.48425084352493286+],+"up": [+0.22648610174655914,+0.4280221164226532,+0.8749292492866516+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1217.154586315155+},+{+"blender_frame": 50,+"matrix_world": [+[+0.8825327754020691,+0.225371316075325,+0.412727028131485,+1.7997798919677734+],+[+0.47025081515312195,+-0.423117458820343,+-0.7744906544685364,+-2.199559450149536+],+[+8.402445382671431e-05,+0.8775986433029175,+-0.4793960750102997,+1.3499003648757935+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97798919677734,+219.9559450149536,+134.99003648757935+],+"forward": [+-0.41272708773612976,+-0.7744907736778259,+0.47939613461494446+],+"up": [+0.225371316075325,+0.423117458820343,+0.8775986433029175+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1208.0487847328186+},+{+"blender_frame": 51,+"matrix_world": [+[+0.8812304139137268,+0.2241765409708023,+0.41614651679992676,+1.7997405529022217+],+[+0.47268709540367126,+-0.4180620610713959,+-0.7757518887519836,+-2.199554920196533+],+[+6.967969966353849e-05,+0.8803231716156006,+-0.47437435388565063,+1.3499382734298706+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97405529022217,+219.95549201965332,+134.99382734298706+],+"forward": [+-0.41614657640457153,+-0.7757520079612732,+0.4743744134902954+],+"up": [+0.2241765707731247,+0.41806212067604065,+0.8803232908248901+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1198.280644416809+},+{+"blender_frame": 52,+"matrix_world": [+[+0.8799138069152832,+0.22286434471607208,+0.4196227788925171,+1.7996948957443237+],+[+0.47513347864151,+-0.41286829113960266,+-0.7770378589630127,+-2.1995863914489746+],+[+7.490118150599301e-05,+0.8831031322479248,+-0.46917879581451416,+1.3499677181243896+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96948957443237,+219.95863914489746,+134.99677181243896+],+"forward": [+-0.41962283849716187,+-0.7770379781723022,+0.46917885541915894+],+"up": [+0.22286437451839447,+0.41286835074424744,+0.8831032514572144+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1187.8749132156372+},+{+"blender_frame": 53,+"matrix_world": [+[+0.8785696029663086,+0.22145044803619385,+0.4231727123260498,+1.7996232509613037+],+[+0.4776143729686737,+-0.40755343437194824,+-0.7783217430114746,+-2.199625015258789+],+[+0.00010578814544714987,+0.8859232068061829,+-0.46383196115493774,+1.3499467372894287+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96232509613037,+219.9625015258789,+134.99467372894287+],+"forward": [+-0.4231727123260498,+-0.7783217430114746,+0.46383196115493774+],+"up": [+0.22145044803619385,+0.40755343437194824,+0.8859232068061829+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1176.8478393554688+},+{+"blender_frame": 54,+"matrix_world": [+[+0.8771895170211792,+0.21997061371803284,+0.42679211497306824,+1.7995668649673462+],+[+0.48014432191848755,+-0.40211907029151917,+-0.7795907258987427,+-2.199617385864258+],+[+0.00013417773880064487,+0.8887706398963928,+-0.4583521783351898,+1.349929690361023+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.95668649673462,+219.96173858642578,+134.9929690361023+],+"forward": [+-0.426792174577713,+-0.7795908451080322,+0.4583522379398346+],+"up": [+0.21997061371803284,+0.40211907029151917,+0.8887706398963928+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1165.2165412902832+},+{+"blender_frame": 55,+"matrix_world": [+[+0.8757891654968262,+0.21841582655906677,+0.4304508864879608,+1.799531102180481+],+[+0.48269394040107727,+-0.39655017852783203,+-0.780867874622345,+-2.199615716934204+],+[+0.00014145368186291307,+0.8916515111923218,+-0.4527224004268646,+1.3499541282653809+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9531102180481,+219.9615716934204,+134.9954128265381+],+"forward": [+-0.4304508864879608,+-0.780867874622345,+0.4527224004268646+],+"up": [+0.21841585636138916,+0.3965502381324768,+0.8916516304016113+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1153.0137181282043+},+{+"blender_frame": 56,+"matrix_world": [+[+0.8743652701377869,+0.21677613258361816,+0.4341583549976349,+1.7995545864105225+],+[+0.48526832461357117,+-0.39081868529319763,+-0.7821606993675232,+-2.1996541023254395+],+[+0.000123433128464967,+0.8945775032043457,+-0.44691288471221924,+1.3500192165374756+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.95545864105225,+219.96541023254395,+135.00192165374756+],+"forward": [+-0.43415841460227966,+-0.7821608185768127,+0.446912944316864+],+"up": [+0.21677613258361816,+0.39081868529319763,+0.8945775032043457+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1140.2740478515625+},+{+"blender_frame": 57,+"matrix_world": [+[+0.8729068040847778,+0.21503333747386932,+0.4379432499408722,+1.7996357679367065+],+[+0.487886905670166,+-0.38494259119033813,+-0.7834446430206299,+-2.1996827125549316+],+[+0.00011628540960373357,+0.8975411057472229,+-0.44093090295791626,+1.3500730991363525+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96357679367065,+219.96827125549316,+135.00730991363525+],+"forward": [+-0.43794330954551697,+-0.7834447622299194,+0.44093096256256104+],+"up": [+0.21503333747386932,+0.38494259119033813,+0.8975411057472229+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1127.020287513733+},+{+"blender_frame": 58,+"matrix_world": [+[+0.8714093565940857,+0.21318618953227997,+0.44181156158447266,+1.7997056245803833+],+[+0.49055665731430054,+-0.3789447247982025,+-0.7847005128860474,+-2.1996877193450928+],+[+0.00013483926886692643,+0.9005290865898132,+-0.4347957968711853,+1.350098967552185+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97056245803833,+219.96877193450928,+135.0098967552185+],+"forward": [+-0.44181162118911743,+-0.7847006320953369,+0.4347958564758301+],+"up": [+0.21318618953227997,+0.3789447247982025,+0.9005290865898132+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1113.2750988006592+},+{+"blender_frame": 59,+"matrix_world": [+[+0.8698636293411255,+0.2112559676170349,+0.4457670748233795,+1.799729585647583+],+[+0.4932923913002014,+-0.37279272079467773,+-0.785931408405304,+-2.199695110321045+],+[+0.0001460298808524385,+0.9035466313362122,+-0.42848968505859375,+1.3501290082931519+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9729585647583,+219.9695110321045,+135.01290082931519+],+"forward": [+-0.4457671344280243,+-0.7859315276145935,+0.4284897446632385+],+"up": [+0.2112559676170349,+0.37279272079467773,+0.9035466313362122+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1099.070131778717+},+{+"blender_frame": 60,+"matrix_world": [+[+0.8682889342308044,+0.20925158262252808,+0.449764609336853,+1.7997536659240723+],+[+0.4960589110851288,+-0.3665168881416321,+-0.787140965461731,+-2.1997315883636475+],+[+0.0001358189038001001,+0.9065755009651184,+-0.4220436215400696,+1.3501813411712646+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97536659240723,+219.97315883636475,+135.01813411712646+],+"forward": [+-0.4497646689414978,+-0.7871410846710205,+0.42204368114471436+],+"up": [+0.20925158262252808,+0.3665168881416321,+0.9065755009651184+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1084.4399213790894+},+{+"blender_frame": 61,+"matrix_world": [+[+0.8666998744010925,+0.20713965594768524,+0.45378923416137695,+1.7998403310775757+],+[+0.4988301694393158,+-0.36013156175613403,+-0.7883360385894775,+-2.199772596359253+],+[+0.0001281744334846735,+0.9096144437789917,+-0.4154534339904785,+1.350209355354309+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98403310775757,+219.9772596359253,+135.0209355354309+],+"forward": [+-0.45378923416137695,+-0.7883360385894775,+0.4154534339904785+],+"up": [+0.20713965594768524,+0.36013156175613403,+0.9096144437789917+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1069.4214224815369+},+{+"blender_frame": 62,+"matrix_world": [+[+0.8650789260864258,+0.2048962563276291,+0.45788201689720154,+1.7999646663665771+],+[+0.501635730266571,+-0.35360783338546753,+-0.7895081043243408,+-2.1997807025909424+],+[+0.00014342216309159994,+0.9126768708229065,+-0.4086819291114807,+1.3501800298690796+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.99646663665771,+219.97807025909424,+135.01800298690796+],+"forward": [+-0.4578820765018463,+-0.7895082235336304,+0.4086819887161255+],+"up": [+0.2048962563276291,+0.35360783338546753,+0.9126768708229065+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1054.0464997291565+},+{+"blender_frame": 63,+"matrix_world": [+[+0.8634270429611206,+0.20251163840293884,+0.4620420038700104,+1.8000664710998535+],+[+0.5044736266136169,+-0.346928209066391,+-0.7906624674797058,+-2.1997406482696533+],+[+0.00017704445053823292,+0.9157674312591553,+-0.4017089605331421,+1.3501222133636475+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00664710998535,+219.97406482696533,+135.01222133636475+],+"forward": [+-0.4620420038700104,+-0.7906624674797058,+0.4017089605331421+],+"up": [+0.20251163840293884,+0.346928209066391,+0.9157674312591553+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1038.3450746536255+},+{+"blender_frame": 64,+"matrix_world": [+[+0.8617156147956848,+0.2000078409910202,+0.4663078486919403,+1.8001223802566528+],+[+0.5073914527893066,+-0.3400942385196686,+-0.7917637228965759,+-2.1996982097625732+],+[+0.00022966477263253182,+0.9188757538795471,+-0.3945468068122864,+1.3501018285751343+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01223802566528,+219.96982097625732,+135.01018285751343+],+"forward": [+-0.4663079082965851,+-0.7917638421058655,+0.39454686641693115+],+"up": [+0.2000078707933426,+0.34009426832199097,+0.9188758730888367+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1022.3480582237244+},+{+"blender_frame": 65,+"matrix_world": [+[+0.8599403500556946,+0.19743159413337708,+0.4706627130508423,+1.8001623153686523+],+[+0.5103944540023804,+-0.33313673734664917,+-0.7927908897399902,+-2.1996755599975586+],+[+0.00027307786513119936,+0.9219763875007629,+-0.387245774269104,+1.350093126296997+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01623153686523,+219.96755599975586,+135.0093126296997+],+"forward": [+-0.4706627130508423,+-0.7927908897399902,+0.387245774269104+],+"up": [+0.19743162393569946,+0.33313676714897156,+0.9219765067100525+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 1006.0919284820557+},+{+"blender_frame": 66,+"matrix_world": [+[+0.8581340312957764,+0.1947740912437439,+0.4750463664531708,+1.8001629114151+],+[+0.5134256482124329,+-0.32606884837150574,+-0.793771505355835,+-2.1996636390686035+],+[+0.0002916950033977628,+0.9250633120536804,+-0.3798127770423889,+1.3500335216522217+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01629114151,+219.96636390686035,+135.00335216522217+],+"forward": [+-0.47504642605781555,+-0.7937716245651245,+0.3798128366470337+],+"up": [+0.1947740912437439,+0.32606884837150574,+0.9250633120536804+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 989.617931842804+},+{+"blender_frame": 67,+"matrix_world": [+[+0.8562952876091003,+0.1920223832130432,+0.47946423292160034,+1.8001712560653687+],+[+0.516486644744873,+-0.31887221336364746,+-0.7947087287902832,+-2.199648857116699+],+[+0.00028595238109119236,+0.9281421303749084,+-0.37222573161125183,+1.3499805927276611+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01712560653687,+219.96488571166992,+134.9980592727661+],+"forward": [+-0.4794642925262451,+-0.7947088479995728,+0.3722257614135742+],+"up": [+0.1920224130153656,+0.31887224316596985,+0.928142249584198+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 972.9630827903748+},+{+"blender_frame": 68,+"matrix_world": [+[+0.8544591665267944,+0.18912531435489655,+0.4838709533214569,+1.8001824617385864+],+[+0.5195183753967285,+-0.31152597069740295,+-0.7956457734107971,+-2.1996326446533203+],+[+0.00026160827837884426,+0.9312266111373901,+-0.36444032192230225,+1.350014567375183+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01824617385864,+219.96326446533203,+135.0014567375183+],+"forward": [+-0.4838709533214569,+-0.7956457734107971,+0.36444032192230225+],+"up": [+0.18912534415721893,+0.31152600049972534,+0.9312267303466797+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 956.1675667762756+},+{+"blender_frame": 69,+"matrix_world": [+[+0.852634608745575,+0.18605370819568634,+0.4882604479789734,+1.800156831741333+],+[+0.5225075483322144,+-0.3040429651737213,+-0.7965825200080872,+-2.1996703147888184+],+[+0.0002450243919156492,+0.9343135356903076,+-0.356452077627182,+1.3500828742980957+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0156831741333,+219.96703147888184,+135.00828742980957+],+"forward": [+-0.4882604479789734,+-0.7965825200080872,+0.356452077627182+],+"up": [+0.18605372309684753,+0.3040429949760437,+0.9343136548995972+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 939.2735242843628+},+{+"blender_frame": 70,+"matrix_world": [+[+0.8507869839668274,+0.1828453242778778,+0.4926755428314209,+1.8000940084457397+],+[+0.5255107879638672,+-0.2964540123939514,+-0.7974668741226196,+-2.199763536453247+],+[+0.00024254097661469132,+0.9373806715011597,+-0.34830641746520996,+1.3501142263412476+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00940084457397,+219.9763536453247,+135.01142263412476+],+"forward": [+-0.4926755428314209,+-0.7974668741226196,+0.34830641746520996+],+"up": [+0.182845339179039,+0.2964540421962738,+0.9373807907104492+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 922.3146736621857+},+{+"blender_frame": 71,+"matrix_world": [+[+0.8488984704017639,+0.1795058697462082,+0.4971408545970917,+1.8000526428222656+],+[+0.5285558104515076,+-0.28875821828842163,+-0.7982778549194336,+-2.1997992992401123+],+[+0.0002579558058641851,+0.9404235482215881,+-0.3400052785873413,+1.3501299619674683+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00526428222656,+219.97992992401123,+135.01299619674683+],+"forward": [+-0.4971407949924469,+-0.798277735710144,+0.3400052487850189+],+"up": [+0.1795058697462082,+0.28875821828842163,+0.9404235482215881+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 905.3203999996185+},+{+"blender_frame": 72,+"matrix_world": [+[+0.8469547033309937,+0.17607107758522034,+0.5016640424728394,+1.800018548965454+],+[+0.5316650867462158,+-0.28095829486846924,+-0.7989959716796875,+-2.199782609939575+],+[+0.00026658724527806044,+0.9434307217597961,+-0.3315697908401489,+1.3501834869384766+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0018548965454,+219.97826099395752,+135.01834869384766+],+"forward": [+-0.5016641020774841,+-0.798996090888977,+0.3315698206424713+],+"up": [+0.17607107758522034,+0.28095829486846924,+0.9434307217597961+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 888.3249938488007+},+{+"blender_frame": 73,+"matrix_world": [+[+0.8449754118919373,+0.172544926404953,+0.5062061548233032,+1.7999264001846313+],+[+0.5348049998283386,+-0.2730453610420227,+-0.7996435761451721,+-2.1997852325439453+],+[+0.00024280733487103134,+0.9464007019996643,+-0.32299456000328064,+1.3502743244171143+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.99264001846313,+219.97852325439453,+135.02743244171143+],+"forward": [+-0.5062061548233032,+-0.7996435761451721,+0.32299456000328064+],+"up": [+0.1725449413061142,+0.2730453908443451,+0.9464008212089539+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 871.3710427284241+},+{+"blender_frame": 74,+"matrix_world": [+[+0.8429796099662781,+0.16888976097106934,+0.5107462406158447,+1.7998409271240234+],+[+0.5379456281661987,+-0.26501232385635376,+-0.8002392649650574,+-2.199808120727539+],+[+0.0002018303202930838,+0.9493390321731567,+-0.31425347924232483,+1.3503286838531494+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98409271240234,+219.9808120727539,+135.03286838531494+],+"forward": [+-0.5107463002204895,+-0.8002393841743469,+0.3142535090446472+],+"up": [+0.16888977587223053,+0.26501235365867615,+0.9493391513824463+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 854.5041680335999+},+{+"blender_frame": 75,+"matrix_world": [+[+0.8409574031829834,+0.16509786248207092,+0.5152993202209473,+1.7998212575912476+],+[+0.5411013960838318,+-0.2568546235561371,+-0.8007715344429016,+-2.1998062133789062+],+[+0.00015134013665374368,+0.9522439241409302,+-0.30533844232559204,+1.350313425064087+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98212575912476,+219.98062133789062,+135.0313425064087+],+"forward": [+-0.5152993202209473,+-0.8007715344429016,+0.30533844232559204+],+"up": [+0.16509786248207092,+0.2568546235561371,+0.9522439241409302+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 837.7606749534607+},+{+"blender_frame": 76,+"matrix_world": [+[+0.8388991355895996,+0.16117897629737854,+0.5198747515678406,+1.7998460531234741+],+[+0.5442870855331421,+-0.2486087828874588,+-0.8012149333953857,+-2.199767589569092+],+[+0.00010643471614457667,+0.9550994634628296,+-0.2962853014469147,+1.350281834602356+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9846053123474,+219.97675895690918,+135.0281834602356+],+"forward": [+-0.5198747515678406,+-0.8012149333953857,+0.2962853014469147+],+"up": [+0.16117897629737854,+0.2486087828874588,+0.9550994634628296+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 821.1714029312134+},+{+"blender_frame": 77,+"matrix_world": [+[+0.8368103504180908,+0.1571504771709442,+0.5244541168212891,+1.799877643585205+],+[+0.5474928021430969,+-0.24032755196094513,+-0.8015574812889099,+-2.1997320652008057+],+[+7.563445251435041e-05,+0.9578864574432373,+-0.28714731335639954,+1.3502973318099976+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9877643585205,+219.97320652008057,+135.02973318099976+],+"forward": [+-0.5244541168212891,+-0.8015574812889099,+0.28714731335639954+],+"up": [+0.1571504771709442,+0.24032755196094513,+0.9578864574432373+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 804.7703921794891+},+{+"blender_frame": 78,+"matrix_world": [+[+0.8347119092941284,+0.153010293841362,+0.5290027856826782,+1.799904465675354+],+[+0.5506870150566101,+-0.23201429843902588,+-0.8018187880516052,+-2.1997575759887695+],+[+4.9686452257446945e-05,+0.9606025218963623,+-0.27792587876319885,+1.3503458499908447+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9904465675354,+219.97575759887695,+135.03458499908447+],+"forward": [+-0.5290027856826782,+-0.8018187880516052,+0.27792587876319885+],+"up": [+0.153010293841362,+0.23201429843902588,+0.9606025218963623+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 788.599020242691+},+{+"blender_frame": 79,+"matrix_world": [+[+0.8326059579849243,+0.14872729778289795,+0.5335237979888916,+1.799957036972046+],+[+0.5538658499717712,+-0.2236359566450119,+-0.8020097613334656,+-2.1998097896575928+],+[+3.436960469116457e-05,+0.9632585644721985,+-0.26857563853263855,+1.3503848314285278+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9957036972046,+219.98097896575928,+135.03848314285278+],+"forward": [+-0.5335237979888916,+-0.8020097613334656,+0.26857563853263855+],+"up": [+0.14872731268405914,+0.2236359864473343,+0.963258683681488+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 772.692859172821+},+{+"blender_frame": 80,+"matrix_world": [+[+0.8305128216743469,+0.1442977786064148,+0.5379840135574341,+1.8000130653381348+],+[+0.556999683380127,+-0.21521854400634766,+-0.8021423816680908,+-2.199862480163574+],+[+3.6774439649889246e-05,+0.9658462405204773,+-0.2591155767440796,+1.3504396677017212+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00130653381348,+219.98624801635742,+135.04396677017212+],+"forward": [+-0.5379840135574341,+-0.8021423816680908,+0.2591155767440796+],+"up": [+0.144297793507576,+0.21521857380867004,+0.9658463597297668+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 757.0813238620758+},+{+"blender_frame": 81,+"matrix_world": [+[+0.8284336924552917,+0.13977602124214172,+0.5423654317855835,+1.8000439405441284+],+[+0.5600871443748474,+-0.20682621002197266,+-0.8022003173828125,+-2.1998822689056396+],+[+4.70274972030893e-05,+0.9683416485786438,+-0.24962854385375977,+1.3504823446273804+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00439405441284,+219.98822689056396,+135.04823446273804+],+"forward": [+-0.5423654317855835,+-0.8022003173828125,+0.24962854385375977+],+"up": [+0.13977603614330292,+0.20682623982429504,+0.9683417677879333+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 741.7910188436508+},+{+"blender_frame": 82,+"matrix_world": [+[+0.826349675655365,+0.13519273698329926,+0.5466893315315247,+1.800065279006958+],+[+0.5631574988365173,+-0.1984712779521942,+-0.8021613359451294,+-2.1999011039733887+],+[+5.575333852902986e-05,+0.970737874507904,+-0.24014146625995636,+1.350520372390747+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0065279006958,+219.99011039733887,+135.0520372390747+],+"forward": [+-0.5466893911361694,+-0.802161455154419,+0.24014149606227875+],+"up": [+0.13519275188446045,+0.1984713077545166,+0.9707379937171936+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 726.8542170524597+},+{+"blender_frame": 83,+"matrix_world": [+[+0.8242429494857788,+0.1305379718542099,+0.5509841442108154,+1.8000967502593994+],+[+0.5662364363670349,+-0.19011691212654114,+-0.8020174503326416,+-2.199923515319824+],+[+5.7674704294186085e-05,+0.9730443954467773,+-0.23061788082122803,+1.350555181503296+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00967502593994,+219.99235153198242,+135.0555181503296+],+"forward": [+-0.5509841442108154,+-0.8020174503326416,+0.23061788082122803+],+"up": [+0.1305379718542099,+0.19011691212654114,+0.9730443954467773+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 712.3019635677338+},+{+"blender_frame": 84,+"matrix_world": [+[+0.8221254944801331,+0.1257888227701187,+0.5552359223365784,+1.8001383543014526+],+[+0.5693063139915466,+-0.18173804879188538,+-0.8017865419387817,+-2.1999359130859375+],+[+5.1700026233447716e-05,+0.9752684235572815,+-0.22102384269237518,+1.3506135940551758+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01383543014526,+219.99359130859375,+135.06135940551758+],+"forward": [+-0.5552359223365784,+-0.8017865419387817,+0.22102384269237518+],+"up": [+0.1257888227701187,+0.18173804879188538,+0.9752684235572815+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 698.1620401144028+},+{+"blender_frame": 85,+"matrix_world": [+[+0.8200323581695557,+0.12093330174684525,+0.5593944787979126,+1.8001402616500854+],+[+0.5723172426223755,+-0.173360675573349,+-0.8014979958534241,+-2.1999428272247314+],+[+4.920747232972644e-05,+0.9774053692817688,+-0.21137356758117676,+1.3506994247436523+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01402616500854,+219.99428272247314,+135.06994247436523+],+"forward": [+-0.5593944787979126,+-0.8014979958534241,+0.21137356758117676+],+"up": [+0.12093330174684525,+0.173360675573349,+0.9774053692817688+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 684.4591081142426+},+{+"blender_frame": 86,+"matrix_world": [+[+0.8179620504379272,+0.11600209027528763,+0.5634551048278809,+1.8000848293304443+],+[+0.575272262096405,+-0.1650240570306778,+-0.8011422157287598,+-2.1999599933624268+],+[+4.9468631914351135e-05,+0.9794440269470215,+-0.20171618461608887,+1.3507601022720337+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00848293304443,+219.99599933624268,+135.07601022720337+],+"forward": [+-0.5634551644325256,+-0.8011423349380493,+0.20171621441841125+],+"up": [+0.11600209027528763,+0.1650240570306778,+0.9794440269470215+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 671.2178602814674+},+{+"blender_frame": 87,+"matrix_world": [+[+0.8158985376358032,+0.11102718114852905,+0.5674349665641785,+1.800005555152893+],+[+0.5781950354576111,+-0.15674060583114624,+-0.8007014989852905,+-2.200012683868408+],+[+4.047664697282016e-05,+0.9813793897628784,+-0.1920797973871231,+1.3507517576217651+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.0005555152893,+220.00126838684082,+135.0751757621765+],+"forward": [+-0.5674349665641785,+-0.8007014989852905,+0.1920797973871231+],+"up": [+0.11102718114852905,+0.15674060583114624,+0.9813793897628784+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 658.4650248289108+},+{+"blender_frame": 88,+"matrix_world": [+[+0.8138032555580139,+0.10602815449237823,+0.5713862180709839,+1.7999322414398193+],+[+0.5811403393745422,+-0.1485041230916977,+-0.8001390099525452,+-2.2000389099121094+],+[+1.593592605786398e-05,+0.98321133852005,+-0.1824703812599182,+1.3507359027862549+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.99322414398193,+220.00389099121094,+135.0735902786255+],+"forward": [+-0.5713862180709839,+-0.8001390099525452,+0.1824703812599182+],+"up": [+0.10602815449237823,+0.1485041230916977,+0.98321133852005+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 646.2168335914612+},+{+"blender_frame": 89,+"matrix_world": [+[+0.8116733431816101,+0.10098612308502197,+0.5753157734870911,+1.7998460531234741+],+[+0.5841116309165955,+-0.1403028815984726,+-0.7994551658630371,+-2.200021743774414+],+[+-1.5423902368638664e-05,+0.9849450588226318,+-0.1728672981262207,+1.350754976272583+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9846053123474,+220.0021743774414,+135.0754976272583+],+"forward": [+-0.5753158330917358,+-0.7994552850723267,+0.1728673130273819+],+"up": [+0.10098613798618317,+0.1403028964996338,+0.9849451780319214+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 634.4906985759735+},+{+"blender_frame": 90,+"matrix_world": [+[+0.8095460534095764,+0.0958915576338768,+0.5791719555854797,+1.7997410297393799+],+[+0.5870565176010132,+-0.132166787981987,+-0.798684298992157,+-2.1999926567077637+],+[+-3.9786409615771845e-05,+0.9865782260894775,+-0.16328884661197662,+1.3507391214370728+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.974102973938,+219.99926567077637,+135.07391214370728+],+"forward": [+-0.5791719555854797,+-0.798684298992157,+0.16328884661197662+],+"up": [+0.095891572535038,+0.1321668028831482,+0.9865783452987671+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 623.3080357313156+},+{+"blender_frame": 91,+"matrix_world": [+[+0.807435154914856,+0.09078416228294373,+0.5829296112060547,+1.7996437549591064+],+[+0.589956521987915,+-0.12411096692085266,+-0.7978395223617554,+-2.1999917030334473+],+[+-8.323939255205914e-05,+0.9881065487861633,+-0.15377026796340942,+1.3506656885147095+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96437549591064,+219.99917030334473,+135.06656885147095+],+"forward": [+-0.5829296112060547,+-0.7978395223617554,+0.15377026796340942+],+"up": [+0.09078416973352432,+0.12411098182201385,+0.9881066679954529+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 612.6893803477287+},+{+"blender_frame": 92,+"matrix_world": [+[+0.8053542375564575,+0.08568022400140762,+0.5865692496299744,+1.7996050119400024+],+[+0.5927938222885132,+-0.11620111018419266,+-0.7969270944595337,+-2.200040578842163+],+[+-0.00012089035590179265,+0.9895232915878296,+-0.14437374472618103,+1.3506178855895996+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96050119400024,+220.0040578842163,+135.06178855895996+],+"forward": [+-0.5865692496299744,+-0.7969270944595337,+0.14437374472618103+],+"up": [+0.08568022400140762,+0.11620111018419266,+0.9895232915878296+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 602.6506073772907+},+{+"blender_frame": 93,+"matrix_world": [+[+0.8032878041267395,+0.08057840913534164,+0.5901151299476624,+1.7996023893356323+],+[+0.595591127872467,+-0.10849381238222122,+-0.7959273457527161,+-2.2000977993011475+],+[+-0.00011072178313042969,+0.9908259510993958,+-0.13514354825019836,+1.3506139516830444+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96023893356323,+220.00977993011475,+135.06139516830444+],+"forward": [+-0.5901151895523071,+-0.7959274649620056,+0.13514356315135956+],+"up": [+0.08057841658592224,+0.10849382728338242,+0.9908260703086853+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 593.1984774768353+},+{+"blender_frame": 94,+"matrix_world": [+[+0.8012292981147766,+0.07548587769269943,+0.5935770273208618,+1.799605131149292+],+[+0.598357617855072,+-0.10097121447324753,+-0.7948416471481323,+-2.200183391571045+],+[+-6.512475374620408e-05,+0.9920214414596558,+-0.12606865167617798,+1.350590705871582+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9605131149292,+220.0183391571045,+135.0590705871582+],+"forward": [+-0.593576967716217,+-0.7948415279388428,+0.12606863677501678+],+"up": [+0.07548588514328003,+0.10097122937440872,+0.9920215606689453+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 584.3444392085075+},+{+"blender_frame": 95,+"matrix_world": [+[+0.799202024936676,+0.07039317488670349,+0.5969262719154358,+1.7995529174804688+],+[+0.601062536239624,+-0.09359902888536453,+-0.7937020063400269,+-2.2002453804016113+],+[+5.125011739437468e-07,+0.9931183457374573,+-0.11711521446704865,+1.350486159324646+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.95529174804688,+220.02453804016113,+135.0486159324646+],+"forward": [+-0.5969263315200806,+-0.7937021255493164,+0.11711522936820984+],+"up": [+0.07039317488670349,+0.09359902888536453,+0.9931183457374573+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 576.0910205543041+},+{+"blender_frame": 96,+"matrix_world": [+[+0.797227680683136,+0.06534551084041595,+0.6001316905021667,+1.799491047859192+],+[+0.603678822517395,+-0.08637889474630356,+-0.7925342917442322,+-2.200246572494507+],+[+5.015618080506101e-05,+0.994117021560669,+-0.10831134766340256,+1.3503670692443848+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9491047859192,+220.02465724945068,+135.03670692443848+],+"forward": [+-0.6001317501068115,+-0.7925344109535217,+0.10831136256456375+],+"up": [+0.06534551084041595,+0.08637889474630356,+0.994117021560669+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 568.4430006891489+},+{+"blender_frame": 97,+"matrix_world": [+[+0.7953086495399475,+0.0604107640683651,+0.6031871438026428,+1.799452781677246+],+[+0.6062047481536865,+-0.07936432957649231,+-0.7913389205932617,+-2.2002387046813965+],+[+6.615695747314021e-05,+0.9950135350227356,+-0.09974043816328049,+1.3502548933029175+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9452781677246,+220.02387046813965,+135.02548933029175+],+"forward": [+-0.603187084197998,+-0.7913388013839722,+0.0997404232621193+],+"up": [+0.0604107640683651,+0.07936432957649231,+0.9950135350227356+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 561.4095035940409+},+{+"blender_frame": 98,+"matrix_world": [+[+0.7934368252754211,+0.055584512650966644,+0.6061092615127563,+1.7994894981384277+],+[+0.608652651309967,+-0.07257595658302307,+-0.7901105880737305,+-2.200249433517456+],+[+7.104681571945548e-05,+0.9958127737045288,+-0.09141610562801361,+1.3502064943313599+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.94894981384277,+220.0249433517456,+135.020649433136+],+"forward": [+-0.6061092615127563,+-0.7901105880737305,+0.09141610562801361+],+"up": [+0.055584512650966644,+0.07257595658302307,+0.9958127737045288+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 554.9991749227047+},+{+"blender_frame": 99,+"matrix_world": [+[+0.7916040420532227,+0.05083596333861351,+0.608916163444519,+1.7995762825012207+],+[+0.6110345125198364,+-0.06596775352954865,+-0.7888504862785339,+-2.20027232170105+],+[+6.686151027679443e-05,+0.9965259432792664,+-0.08328286558389664,+1.3502427339553833+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.95762825012207,+220.02723217010498,+135.02427339553833+],+"forward": [+-0.6089162230491638,+-0.7888506054878235,+0.08328287303447723+],+"up": [+0.05083597078919411,+0.06596776098012924,+0.9965260624885559+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 549.2138365283608+},+{+"blender_frame": 100,+"matrix_world": [+[+0.7898282408714294,+0.04616612568497658,+0.6115882396697998,+1.7996419668197632+],+[+0.6133282780647278,+-0.05956568568944931,+-0.7875789403915405,+-2.2003002166748047+],+[+7.020435441518202e-05,+0.9971562623977661,+-0.07536165416240692,+1.3502963781356812+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96419668197632,+220.03002166748047,+135.02963781356812+],+"forward": [+-0.6115882396697998,+-0.7875789403915405,+0.07536165416240692+],+"up": [+0.04616612568497658,+0.05956568568944931,+0.9971562623977661+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 544.049456436187+},+{+"blender_frame": 101,+"matrix_world": [+[+0.7881411910057068,+0.041619788855314255,+0.6140857338905334,+1.7996739149093628+],+[+0.6154944896697998,+-0.05341949313879013,+-0.7863287329673767,+-2.200317144393921+],+[+7.731340156169608e-05,+0.9977044463157654,+-0.06771885603666306,+1.3503479957580566+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96739149093628,+220.0317144393921,+135.03479957580566+],+"forward": [+-0.6140857338905334,+-0.7863287329673767,+0.06771885603666306+],+"up": [+0.041619788855314255,+0.05341949313879013,+0.9977044463157654+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 539.5018736831844+},+{+"blender_frame": 102,+"matrix_world": [+[+0.7865400910377502,+0.037238068878650665,+0.6164155602455139,+1.7996485233306885+],+[+0.6175393462181091,+-0.04753878712654114,+-0.785102128982544,+-2.20034122467041+],+[+6.796340312575921e-05,+0.9981750845909119,+-0.06038712337613106,+1.3503464460372925+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96485233306885,+220.03412246704102,+135.03464460372925+],+"forward": [+-0.6164155602455139,+-0.785102128982544,+0.06038712337613106+],+"up": [+0.037238068878650665,+0.04753878712654114,+0.9981750845909119+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 535.5696734972298+},+{+"blender_frame": 103,+"matrix_world": [+[+0.7850103974342346,+0.03303973376750946,+0.6186009645462036,+1.7996280193328857+],+[+0.6194827556610107,+-0.04190775379538536,+-0.7838909029960632,+-2.2003955841064453+],+[+2.463028795318678e-05,+0.99857497215271,+-0.053365565836429596,+1.3503402471542358+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96280193328857,+220.03955841064453,+135.03402471542358+],+"forward": [+-0.6186009645462036,+-0.7838909029960632,+0.053365565836429596+],+"up": [+0.03303973749279976,+0.04190775752067566,+0.9985750913619995+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 532.2561792097986+},+{+"blender_frame": 104,+"matrix_world": [+[+0.7835150361061096,+0.028997346758842468,+0.620695948600769,+1.7996264696121216+],+[+0.6213728785514832,+-0.03651079162955284,+-0.782663881778717,+-2.2004776000976562+],+[+-3.307838778709993e-05,+0.9989125728607178,+-0.04662492126226425,+1.3503541946411133+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96264696121216,+220.04776000976562,+135.03541946411133+],+"forward": [+-0.620695948600769,+-0.782663881778717,+0.04662492126226425+],+"up": [+0.02899734303355217,+0.03651078790426254,+0.9989124536514282+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 529.5604347717017+},+{+"blender_frame": 105,+"matrix_world": [+[+0.7820519804954529,+0.02508850209414959,+0.6227080821990967,+1.799635648727417+],+[+0.6232132911682129,+-0.03138997405767441,+-0.7814217805862427,+-2.200572967529297+],+[+-5.791439616587013e-05,+0.9991923570632935,+-0.04018407687544823,+1.3503762483596802+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9635648727417,+220.0572967529297,+135.03762483596802+],+"forward": [+-0.6227080821990967,+-0.7814217805862427,+0.04018407687544823+],+"up": [+0.02508850209414959,+0.03138997405767441,+0.9991923570632935+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 527.4767976021394+},+{+"blender_frame": 106,+"matrix_world": [+[+0.7806588411331177,+0.021352587267756462,+0.6245927214622498,+1.7996389865875244+],+[+0.6249575614929199,+-0.026596831157803535,+-0.7802055478096008,+-2.2006301879882812+],+[+-4.722152152680792e-05,+0.9994180798530579,+-0.0341075100004673,+1.3503578901290894+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.96389865875244,+220.06301879882812,+135.03578901290894+],+"forward": [+-0.6245927214622498,+-0.7802055478096008,+0.0341075100004673+],+"up": [+0.02135258913040161,+0.026596834883093834,+0.9994181990623474+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 525.9941408643499+},+{+"blender_frame": 107,+"matrix_world": [+[+0.7793565392494202,+0.017812181264162064,+0.6263274550437927,+1.799649715423584+],+[+0.6265806555747986,+-0.022125983610749245,+-0.7790423631668091,+-2.200653314590454+],+[+-1.8333865227759816e-05,+0.9995964765548706,+-0.02840479463338852,+1.3502875566482544+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9649715423584,+220.0653314590454,+135.02875566482544+],+"forward": [+-0.6263275146484375,+-0.7790424823760986,+0.028404798358678818+],+"up": [+0.017812183126807213,+0.022125985473394394,+0.9995965957641602+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 525.1083716982976+},+{+"blender_frame": 108,+"matrix_world": [+[+0.778143584728241,+0.014528038911521435,+0.6279183626174927,+1.7997061014175415+],+[+0.6280864477157593,+-0.01799153722822666,+-0.7779356241226196,+-2.2006564140319824+],+[+-4.662097126129083e-06,+0.9997327327728271,+-0.02312486246228218,+1.3501876592636108+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97061014175415,+220.06564140319824,+135.01876592636108+],+"forward": [+-0.6279183626174927,+-0.7779356241226196,+0.02312486246228218+],+"up": [+0.014528037048876286,+0.017991535365581512,+0.9997326135635376+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.8173181316815+},+{+"blender_frame": 109,+"matrix_world": [+[+0.7769876718521118,+0.01150837168097496,+0.6294105648994446,+1.7998409271240234+],+[+0.6295158267021179,+-0.01418132334947586,+-0.7768582701683044,+-2.200676918029785+],+[+-1.44991536217276e-05,+0.9998332262039185,+-0.01826341450214386,+1.3501330614089966+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98409271240234,+220.06769180297852,+135.01330614089966+],+"forward": [+-0.6294105648994446,+-0.7768582701683044,+0.01826341450214386+],+"up": [+0.01150837168097496,+0.01418132334947586,+0.9998332262039185+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.876544973813+},+{+"blender_frame": 110,+"matrix_world": [+[+0.7758920788764954,+0.008710898458957672,+0.6308056116104126,+1.799963116645813+],+[+0.630865752696991,+-0.010678336024284363,+-0.7758185267448425,+-2.2006962299346924+],+[+-2.2122456357465126e-05,+0.9999050498008728,+-0.013780643232166767,+1.3501098155975342+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9963116645813,+220.06962299346924,+135.01098155975342+],+"forward": [+-0.6308056116104126,+-0.7758185267448425,+0.013780643232166767+],+"up": [+0.008710898458957672,+0.010678336024284363,+0.9999050498008728+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9217429547571+},+{+"blender_frame": 111,+"matrix_world": [+[+0.7749073505401611,+0.006156657822430134,+0.632044792175293,+1.8000370264053345+],+[+0.632074773311615,+-0.0074920388869941235,+-0.7748711109161377,+-2.2006962299346924+],+[+-3.531251786625944e-05,+0.999953031539917,+-0.009697102941572666,+1.3500655889511108+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00370264053345,+220.06962299346924,+135.00655889511108+],+"forward": [+-0.6320448517799377,+-0.7748712301254272,+0.00969710387289524+],+"up": [+0.006156657822430134,+0.0074920388869941235,+0.999953031539917+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9484529835172+},+{+"blender_frame": 112,+"matrix_world": [+[+0.7740368843078613,+0.003796106670051813,+0.6331290006637573,+1.8000539541244507+],+[+0.6331403851509094,+-0.00460493890568614,+-0.7740232944488525,+-2.200690984725952+],+[+-2.2754664314561523e-05,+0.9999822378158569,+-0.005967861507087946,+1.3499951362609863+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00539541244507,+220.06909847259521,+134.99951362609863+],+"forward": [+-0.6331290006637573,+-0.7740232944488525,+0.005967861507087946+],+"up": [+0.003796106670051813,+0.00460493890568614,+0.9999822378158569+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9599140253849+},+{+"blender_frame": 113,+"matrix_world": [+[+0.7732473611831665,+0.0016254681395366788,+0.6341024041175842,+1.8000736236572266+],+[+0.6341044902801514,+-0.002020553220063448,+-0.7732446789741516,+-2.2007126808166504+],+[+2.4353166736545973e-05,+0.9999967217445374,+-0.002593103563413024,+1.3499836921691895+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00736236572266,+220.07126808166504,+134.99836921691895+],+"forward": [+-0.634102463722229,+-0.7732447981834412,+0.0025931037962436676+],+"up": [+0.0016254681395366788,+0.002020553220063448,+0.9999967217445374+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9654529194231+},+{+"blender_frame": 114,+"matrix_world": [+[+0.7725392580032349,+-0.0002894174540415406,+0.6349669694900513,+1.8001115322113037+],+[+0.634967029094696,+0.00023818618501536548,+-0.7725391983985901,+-2.2007548809051514+],+[+7.234598160721362e-05,+1.0,+0.0003677787317428738,+1.350035309791565+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01115322113037,+220.07548809051514,+135.0035309791565+],+"forward": [+-0.6349669694900513,+-0.7725391983985901,+-0.0003677787317428738+],+"up": [+-0.0002894174540415406,+-0.00023818618501536548,+1.0+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9680262973925+},+{+"blender_frame": 115,+"matrix_world": [+[+0.7719658017158508,+-0.0019358283607289195,+0.6356611251831055,+1.8001165390014648+],+[+0.6356640458106995,+0.0021889680065214634,+-0.7719627022743225,+-2.200782299041748+],+[+0.00010294547973899171,+0.9999957084655762,+0.002920344937592745,+1.3500738143920898+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.01165390014648,+220.0782299041748,+135.00738143920898+],+"forward": [+-0.6356611251831055,+-0.7719627022743225,+-0.002920344937592745+],+"up": [+-0.0019358285935595632,+-0.002188968239352107,+0.9999958276748657+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9630561753293+},+{+"blender_frame": 116,+"matrix_world": [+[+0.7715281248092651,+-0.003269026754423976,+0.6361868381500244,+1.8000614643096924+],+[+0.6361952424049377,+0.003796794917434454,+-0.7715187668800354,+-2.200826406478882+],+[+0.00010664508590707555,+0.9999874234199524,+0.005009073298424482,+1.3500431776046753+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+180.00614643096924,+220.08264064788818,+135.00431776046753+],+"forward": [+-0.6361868977546692,+-0.771518886089325,+-0.00500907376408577+],+"up": [+-0.0032690272200852633,+-0.0037967953830957413,+0.9999875426292419+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9537570169196+},+{+"blender_frame": 117,+"matrix_world": [+[+0.7711859941482544,+-0.0042840964160859585,+0.636595606803894,+1.799994707107544+],+[+0.6366100907325745,+0.0050232005305588245,+-0.7711694836616516,+-2.2009081840515137+],+[+0.00010601698886603117,+0.999978244304657,+0.006601119879633188,+1.3499956130981445+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9994707107544,+220.09081840515137,+134.99956130981445+],+"forward": [+-0.6365956664085388,+-0.7711696028709412,+-0.006601120810955763+],+"up": [+-0.0042840964160859585,+-0.0050232005305588245,+0.999978244304657+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9470597220352+},+{+"blender_frame": 118,+"matrix_world": [+[+0.7709289193153381,+-0.0050118607468903065,+0.6369014978408813,+1.799926519393921+],+[+0.636921226978302,+0.005883540492504835,+-0.7709064483642578,+-2.2009687423706055+],+[+0.00011644033656921238,+0.9999701976776123,+0.007727951742708683,+1.3499213457107544+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.9926519393921,+220.09687423706055,+134.99213457107544+],+"forward": [+-0.6369014978408813,+-0.7709064483642578,+-0.007727951742708683+],+"up": [+-0.0050118607468903065,+-0.005883540492504835,+0.9999701976776123+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9404140078695+},+{+"blender_frame": 119,+"matrix_world": [+[+0.7707803249359131,+-0.005443723872303963,+0.6370778679847717,+1.7998383045196533+],+[+0.6371011137962341,+0.006399843376129866,+-0.7707536816596985,+-2.2009689807891846+],+[+0.00011857182835228741,+0.999964714050293,+0.008401075378060341,+1.349853277206421+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.98383045196533,+220.09689807891846,+134.9853277206421+],+"forward": [+-0.6370778679847717,+-0.7707536816596985,+-0.008401075378060341+],+"up": [+-0.005443723872303963,+-0.006399843376129866,+0.999964714050293+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9301909818314+},+{+"blender_frame": 120,+"matrix_world": [+[+0.7707633376121521,+-0.005577790550887585,+0.637097179889679,+1.7997106313705444+],+[+0.6371216177940369,+0.006555802654474974,+-0.7707354426383972,+-2.2009918689727783+],+[+0.00012231736036483198,+0.9999629855155945,+0.008606703020632267,+1.3498293161392212+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.97106313705444,+220.09918689727783,+134.98293161392212+],+"forward": [+-0.637097179889679,+-0.7707354426383972,+-0.008606703020632267+],+"up": [+-0.005577790550887585,+-0.006555802654474974,+0.9999629855155945+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9220343335764+},+{+"blender_frame": 121,+"matrix_world": [+[+0.7708141207695007,+-0.005555329378694296,+0.6370359063148499,+1.7995699644088745+],+[+0.6370601654052734,+0.006505652330815792,+-0.7707865834236145,+-2.201054096221924+],+[+0.00013763914466835558,+0.9999635219573975,+0.008553726598620415,+1.349808931350708+],+[+0.0,+0.0,+0.0,+1.0+]+],+"loc": [+179.95699644088745,+220.10540962219238,+134.9808931350708+],+"forward": [+-0.6370359659194946,+-0.770786702632904,+-0.00855372752994299+],+"up": [+-0.005555328913033009,+-0.0065056513994932175,+0.9999634027481079+],+"lens_mm": 28.0,+"fstop": 2.799999952316284,+"focus_cm": 524.9178242491325+}+]+}\ No newline at end of filediff --git a/unreal_demo/check_match.py b/unreal_demo/check_match.pynew file mode 100644index 0000000..ccd2ddf--- /dev/null+++ b/unreal_demo/check_match.py@@ -0,0 +1,75 @@+"""Camera-match check: overlay Unreal MRQ frames on the Cycles frames of the same shot.++ uv run --python 3.13 --with pillow --with numpy python -I unreal_demo/check_match.py <shot> [blender_frame ...]++Default frames: 1 and the middle frame. Writes unreal_demo/check/<shot>_f####.png, a 2x2 sheet:+ Cycles | Unreal+ 50/50 blend | edges (Cycles red, Unreal cyan; white where they coincide)+and prints an edge-alignment score per frame: the best integer shift (px) between the two edge maps within +-12 px+(0,0 = aligned) and the edge correlation at zero shift vs at the best shift.+"""+import json+import sys+from pathlib import Path++import numpy as np+from PIL import Image, ImageDraw, ImageFilter, ImageFont++ROOT = Path(__file__).resolve().parent.parent+shot = sys.argv[1]+cam = json.load(open(ROOT / f"unreal_demo/cams/{shot}.json"))+n = cam["frames_n"]+frames = [int(x) for x in sys.argv[2:]] or [1, (n + 1) // 2]+OUT = ROOT / "unreal_demo/check"+OUT.mkdir(exist_ok=True)+fnt = ImageFont.truetype("C:/Windows/Fonts/bahnschrift.ttf", 26)+++def edges(im):+ g = im.convert("L").filter(ImageFilter.GaussianBlur(1.2)).filter(ImageFilter.FIND_EDGES)+ a = np.asarray(g, np.float32)+ return a / (a.max() + 1e-6)+++def corr(a, b):+ a = a - a.mean()+ b = b - b.mean()+ return float((a * b).sum() / (np.sqrt((a * a).sum() * (b * b).sum()) + 1e-9))+++for f in frames:+ cy = Image.open(ROOT / f"scenes/hk-dai-pai-dong/out/shots/{shot}/frames/{f:04d}.png").convert("RGB")+ ue = Image.open(ROOT / f"unreal_demo/mrq/SEQ_{shot}/{f - 1:04d}.png").convert("RGB").resize(cy.size)+ ec, eu = edges(cy), edges(ue)+ # Search shifts on a 1/2-res copy, centre region (avoid lens-distorted borders).+ h, w = ec.shape+ c0, c1 = ec[h // 6: -h // 6, w // 6: -w // 6], eu+ best = (-1, 0, 0)+ for dy in range(-12, 13, 2):+ for dx in range(-12, 13, 2):+ s = corr(c0, c1[h // 6 + dy: h - h // 6 + dy, w // 6 + dx: w - w // 6 + dx])+ if s > best[0]:+ best = (s, dx, dy)+ zero = corr(c0, c1[h // 6: h - h // 6, w // 6: w - w // 6])+ print(f"CHECK {shot} f{f}: edge corr at 0 shift {zero:.3f}, best {best[0]:.3f} at dx={best[1]} dy={best[2]} px")+ ov = np.zeros((h, w, 3), np.float32)+ k = 3.0+ ov[..., 0] = np.clip(ec * k, 0, 1)+ ov[..., 1] = np.clip(eu * k, 0, 1)+ ov[..., 2] = np.clip(eu * k, 0, 1)+ ov = np.maximum(ov, np.clip(np.minimum(ec, eu) * k, 0, 1)[..., None])+ tiles = [(cy, "Cycles"), (ue, "Unreal (MRQ)"), (Image.blend(cy, ue, 0.5), "50/50 blend"),+ (Image.fromarray((ov * 255).astype(np.uint8)), f"edges: Cycles red / Unreal cyan best shift {best[1]},{best[2]} px")]+ tw, th = w // 2, h // 2+ sheet = Image.new("RGB", (tw * 2, th * 2))+ for i, (im, lab) in enumerate(tiles):+ t = im.resize((tw, th), Image.LANCZOS)+ d = ImageDraw.Draw(t)+ d.rectangle((0, 0, d.textlength(lab, font=fnt) + 20, 36), fill=(0, 0, 0))+ d.text((10, 4), lab, font=fnt, fill=(255, 255, 255))+ sheet.paste(t, ((i % 2) * tw, (i // 2) * th))+ p = OUT / f"{shot}_f{f:04d}.png"+ sheet.save(p)+ # Full-res crop of the blend for a close look.+ Image.blend(cy, ue, 0.5).crop((w // 2 - 480, h // 2 - 200, w // 2 + 480, h // 2 + 200)).save(OUT / f"{shot}_f{f:04d}_blendcrop.png")+ print("wrote", p)diff --git a/unreal_demo/demo_cut.py b/unreal_demo/demo_cut.pynew file mode 100644index 0000000..f7588d6--- /dev/null+++ b/unreal_demo/demo_cut.py@@ -0,0 +1,242 @@+""""I solved Blender -> Unreal": the HK dai pai dong, same camera moves in Cycles and in Unreal, with wipes.++ uv run --python 3.13 --with pillow --with numpy python -I unreal_demo/demo_cut.py [--only s1_street_crane,...]++Inputs: the graded Cycles shots (scenes/hk-dai-pai-dong/out/shots/<shot>_graded.mp4) and the Unreal MRQ frames+(unreal_demo/mrq/SEQ_<shot>/####.png, 0-based = Blender frame - 1). Both are 1920x804 at 24 fps and the cameras are+keyed every frame from the same camrig bake, so frame i of one sits on frame i of the other.+Per shot the footage is letterboxed into 1920x1080; a divider at x = p(t) * W shows Unreal left of it and Cycles right+of it (p = 0 all Cycles, 1 all Unreal), eased between keyframes. Labels live in the letterbox bars, never on the image.+Also writes unreal_demo/out/<shot>_ue.mp4 (the Unreal render alone).+Output: breakdown/unreal_demo/unreal_demo.mp4 (house style: assemble.py fonts/colours, xfade, nvenc VBR ~30 Mbps).+"""+import os+import subprocess+import sys+from pathlib import Path++import numpy as np+from PIL import Image, ImageDraw, ImageFilter++ROOT = Path(__file__).resolve().parent.parent+os.environ.setdefault("FFMPEG", r"C:\Users\apek-anna\AppData\Local\CapCut\Apps\9.5.0.4050\ffmpeg.exe")+sys.path.insert(0, str(ROOT / "breakdown"))+from assemble import BG, DIM, FF, FPS, H, INK, W, duration, ff, font # noqa: E402++BRASS = (226, 178, 92)+XF = 0.5+FH = 804+Y0 = (H - FH) // 2 # 138+SEG = ROOT / "breakdown/unreal_demo"+SEG_ENC = ["-an", "-c:v", "h264_nvenc", "-preset", "p6", "-rc", "vbr", "-cq", "15", "-b:v", "0", "-pix_fmt", "yuv420p"]+CYC = ROOT / "scenes/hk-dai-pai-dong/out/shots"+UE = ROOT / "unreal_demo/mrq"++# shot, caption (bottom bar), divider keyframes (t seconds, p)+SHOTS = [+ ("s1_street_crane", "Crane down the street · 32 mm · f/4",+ [(0, 0), (1.5, 0), (2.9, 1)]),+ ("h1_walk_in_to_wok", "Handheld walk to the wok · 24 mm · one take",+ [(0, 0), (2.4, 0), (3.8, 1), (8.0, 1), (9.2, 0.5), (15.6, 0.5), (16.8, 1)]),+ ("s3_wok_push", "Push in on the wok · 35 mm · f/2",+ [(0, 0), (0.7, 0), (2.0, 1)]),+ ("h2_walk_tables_neon", "Walk past the tables to the neon · 24 mm · one take",+ [(0, 0), (2.2, 0), (3.6, 1), (7.4, 1), (8.6, 0.5), (13.6, 0.5), (14.8, 1)]),+]+++def smooth(a):+ a = min(max(a, 0.0), 1.0)+ return a * a * (3 - 2 * a)+++def p_at(keys, t):+ if t <= keys[0][0]:+ return keys[0][1]+ for (t0, p0), (t1, p1) in zip(keys, keys[1:]):+ if t <= t1:+ return p0 + (p1 - p0) * smooth((t - t0) / max(t1 - t0, 1e-6))+ return keys[-1][1]+++def text_centered(d, y, txt, fnt, fill):+ d.text(((W - d.textlength(txt, font=fnt)) / 2, y), txt, font=fnt, fill=fill)+++def still_video(img, secs, out):+ png = out.with_suffix(".png")+ img.save(png)+ ff("-loop", "1", "-t", f"{secs:.3f}", "-i", png, "-vf", f"fps={FPS},format=yuv420p", *SEG_ENC, out)+ return secs+++def label_layer(txt, colour, size=30, right=False):+ """RGBA strip (W x Y0) for the top bar with the label left- or right-aligned, a small accent tick before it."""+ im = Image.new("RGBA", (W, Y0), (0, 0, 0, 0))+ d = ImageDraw.Draw(im)+ f = font("bahnschrift.ttf", size)+ tw = d.textlength(txt, font=f)+ x = W - 56 - tw if right else 56 + 18+ y = Y0 - 30 - size+ d.rectangle((x - 18, y + 6, x - 12, y + size + 2), fill=colour + (255,))+ d.text((x, y), txt, font=f, fill=colour + (255,))+ return np.asarray(im, np.float32) / 255.0+++def bottom_layer(left, right):+ im = Image.new("RGBA", (W, H - Y0 - FH), (0, 0, 0, 0))+ d = ImageDraw.Draw(im)+ f = font("segoeuisl.ttf", 26)+ d.text((56, 26), left, font=f, fill=DIM + (255,))+ tw = d.textlength(right, font=f)+ d.text((W - 56 - tw, 26), right, font=f, fill=DIM + (255,))+ return np.asarray(im, np.float32) / 255.0+++def comp(dst, layer, alpha):+ if alpha <= 0:+ return+ a = layer[..., 3:4] * alpha+ dst[:] = dst * (1 - a) + layer[..., :3] * 255 * a+++def cycles_frames(shot):+ src = CYC / f"{shot}_graded.mp4"+ p = subprocess.Popen([FF, "-v", "error", "-i", str(src), "-f", "rawvideo", "-pix_fmt", "rgb24", "-"],+ stdout=subprocess.PIPE)+ while True:+ b = p.stdout.read(W * FH * 3)+ if len(b) < W * FH * 3:+ break+ yield np.frombuffer(b, np.uint8).reshape(FH, W, 3)+ p.wait()+++def ue_only_mp4(shot):+ out = ROOT / f"unreal_demo/out/{shot}_ue.mp4"+ out.parent.mkdir(exist_ok=True)+ ff("-framerate", FPS, "-start_number", 0, "-i", UE / f"SEQ_{shot}/%04d.png", "-vf", "format=yuv420p",+ "-c:v", "h264_nvenc", "-preset", "p7", "-rc", "vbr", "-cq", "16", "-b:v", "0", "-movflags", "+faststart", out)+ return out+++def shot_segment(shot, caption, keys, out):+ ue_files = sorted((UE / f"SEQ_{shot}").glob("*.png"))+ lab_ue = label_layer("UNREAL ENGINE 5.8 · REAL TIME", BRASS)+ lab_cy = label_layer("BLENDER · CYCLES", INK, right=True)+ bot = bottom_layer(caption, "same camera, keyed every frame · frame-synced")+ enc = subprocess.Popen([FF, "-v", "error", "-y", "-f", "rawvideo", "-pix_fmt", "rgb24", "-s", f"{W}x{H}",+ "-r", str(FPS), "-i", "-", *SEG_ENC, str(out)], stdin=subprocess.PIPE)+ n = 0+ for i, cy in enumerate(cycles_frames(shot)):+ if i >= len(ue_files):+ raise SystemExit(f"{shot}: Cycles has more frames than Unreal ({len(ue_files)})")+ ue = np.asarray(Image.open(ue_files[i]).convert("RGB"))+ t = i / FPS+ p = p_at(keys, t)+ x = int(round(p * W))+ fr = np.zeros((H, W, 3), np.float32)+ img = cy.astype(np.float32).copy()+ if x > 0:+ img[:, :x] = ue[:, :x]+ if 0 < x < W:+ img[:, max(0, x - 1): x + 2] = BRASS+ fr[Y0: Y0 + FH] = img+ top = fr[:Y0]+ comp(top, lab_ue, smooth(p / 0.3) if p < 1 else 1.0)+ comp(top, lab_cy, smooth((1 - p) / 0.3) if p > 0 else 1.0)+ fade_b = smooth((t - 0.3) / 0.6)+ comp(fr[Y0 + FH:], bot, fade_b)+ enc.stdin.write(fr.clip(0, 255).astype(np.uint8).tobytes())+ n += 1+ enc.stdin.close()+ enc.wait()+ if n != len(ue_files):+ print(f"WARNING {shot}: Cycles {n} frames, Unreal {len(ue_files)}")+ return n / FPS+++def blurred(shot, at, dim=0.36):+ png = SEG / f"_bg_{shot}.png"+ ff("-ss", f"{at:.2f}", "-i", CYC / f"{shot}_graded.mp4", "-frames:v", "1", png)+ fr = Image.open(png).convert("RGB")+ c = Image.new("RGB", (W, H), BG)+ c.paste(fr.filter(ImageFilter.GaussianBlur(18)).point(lambda v: int(v * dim)), (0, Y0))+ return c+++def title_card(out, secs=3.2):+ c = blurred("s1_street_crane", 2.5)+ d = ImageDraw.Draw(c)+ y = (H - 36 - 30 - 100 - 30 - 34) // 2+ text_centered(d, y, "ANYSCENE", font("bahnschrift.ttf", 34), BRASS)+ text_centered(d, y + 66, "I solved Blender → Unreal", font("segoeuib.ttf", 100), INK)+ text_centered(d, y + 66 + 140, "Any Blender scene, converted automatically. Real time.", font("segoeuisl.ttf", 36), DIM)+ return still_video(c, secs, out)+++def stats_card(out, secs=5.0):+ c = blurred("h2_walk_tables_neon", 12.0, 0.30)+ d = ImageDraw.Draw(c)+ rows = [+ ("732 objects · 42 lights", "every material, camera and light converted"),+ ("56 fps at 1440p", "RTX 5070 Ti · 17.9 ms frame time · Lumen + Nanite, project defaults"),+ ("Built headless. One command.", "Blender scene in, Unreal level out."),+ ]+ big, small = font("segoeuib.ttf", 64), font("segoeuisl.ttf", 32)+ block = 64 + 32 + 32+ gap = 70+ y = (H - (3 * block + 2 * gap)) // 2+ for head, sub in rows:+ text_centered(d, y, head, big, INK)+ text_centered(d, y + 64 + 32, sub, small, DIM)+ y += block + gap+ return still_video(c, secs, out)+++def end_card(out, secs=3.8):+ c = Image.new("RGB", (W, H), BG)+ d = ImageDraw.Draw(c)+ y = (H - 100 - 40 - 36) // 2+ text_centered(d, y, "AnyScene → Unreal", font("segoeuib.ttf", 100), INK)+ text_centered(d, y + 140, "Blender in. Real-time level out. Same shot, both engines.", font("bahnschrift.ttf", 36), BRASS)+ return still_video(c, secs, out)+++def xfade_join(parts, final):+ inputs, chain = [], []+ for p, _ in parts:+ inputs += ["-i", p]+ prev, offset = "[0:v]", parts[0][1]+ for i in range(1, len(parts)):+ lbl = f"[x{i}]"+ chain.append(f"{prev}[{i}:v]xfade=transition=fade:duration={XF}:offset={offset - XF:.3f}{lbl}")+ offset += parts[i][1] - XF+ prev = lbl+ chain.append(f"{prev}fade=t=in:st=0:d=0.4,fade=t=out:st={offset - 0.8:.3f}:d=0.8[vout]")+ ff(*inputs, "-filter_complex", ";".join(chain), "-map", "[vout]", "-c:v", "h264_nvenc", "-preset", "p7", "-tune", "hq",+ "-multipass", "fullres", "-rc", "vbr", "-b:v", "30M", "-maxrate", "36M", "-bufsize", "48M", "-pix_fmt", "yuv420p",+ "-r", str(FPS), "-movflags", "+faststart", final)+ return offset+++def main():+ SEG.mkdir(parents=True, exist_ok=True)+ only = set(sys.argv[sys.argv.index("--only") + 1].split(",")) if "--only" in sys.argv else None+ parts = [(SEG / "_title.mp4", title_card(SEG / "_title.mp4"))]+ for shot, cap, keys in SHOTS:+ out = SEG / f"_shot_{shot}.mp4"+ if only is None or shot in only or not out.exists():+ ue_only_mp4(shot)+ d = shot_segment(shot, cap, keys, out)+ print(f"segment {shot} {d:.2f} s", flush=True)+ parts.append((out, duration(out)))+ parts.append((SEG / "_stats.mp4", stats_card(SEG / "_stats.mp4")))+ parts.append((SEG / "_end.mp4", end_card(SEG / "_end.mp4")))+ final = SEG / "unreal_demo.mp4"+ total = xfade_join(parts, final)+ print(f"{final} {total:.1f} s, {len(parts)} parts")+++if __name__ == "__main__":+ main()diff --git a/unreal_demo/make_seqs.py b/unreal_demo/make_seqs.pynew file mode 100644index 0000000..91db9a3--- /dev/null+++ b/unreal_demo/make_seqs.py@@ -0,0 +1,199 @@+"""Build one LevelSequence per baked camrig shot in the demo project (headless commandlet):++ UnrealEditor-Cmd.exe AnySceneHKDemo.uproject -run=pythonscript -script="<path>/make_seqs.py" -unattended -nosplash -nop4++Env:+ DEMO_CAMS folder of <shot>.json from bake_cams.py (required)+ DEMO_SHOTS comma list of shots (default: every json in DEMO_CAMS)+ DEMO_OUT MRQ output folder on disk (frames land in <DEMO_OUT>/<SEQ name>/)+ DEMO_TS MRQ temporal samples (default 6)+ DEMO_LEVEL level path (default /Game/AnyScene/HK/L_HK)++Per shot: a CineCameraActor DEMO_<shot> in the level (filmback = Blender sensor width x width*h/w), and+/Game/AnySceneDemo/Sequences/SEQ_<shot> at the shot's fps with frames 0..N-1 (= Blender frames 1..N), a camera cut+over the whole range, and a key on every frame (linear) for location, rotation (unwrapped), CurrentFocalLength,+CurrentAperture and FocusSettings.ManualFocusDistance. Extra keys at -1 and N (Blender frames 0 and N+1) cover the+motion-blur subframes at the ends. The camera's own post-process sets motion blur to the shot's shutter (180 deg =+amount 0.5); the level's grade volume turns it off for its stills.+MRQ configs: /Game/AnySceneDemo/MRQ/MRQ_Demo (deferred, PNG, TSR, DEMO_TS temporal samples, 64 warm-up frames with+use_camera_cut_for_warm_up False) and MRQ_DemoCheck (same, 1 temporal sample, for the camera-match check).+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning)++CAMS = os.environ["DEMO_CAMS"]+SHOTS = [s for s in os.environ.get("DEMO_SHOTS", "").split(",") if s] or \+ sorted(f[:-5] for f in os.listdir(CAMS) if f.endswith(".json"))+OUT = os.environ.get("DEMO_OUT", os.path.join(CAMS, "..", "mrq")).replace("\\", "/")+TS = int(os.environ.get("DEMO_TS", "6"))+LEVEL = os.environ.get("DEMO_LEVEL", "/Game/AnyScene/HK/L_HK")+DEST = "/Game/AnySceneDemo"+EAL = unreal.EditorAssetLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+++def log(*a):+ unreal.log_warning("DEMO " + " ".join(str(x) for x in a))+++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def unwrap(prev, cur):+ if prev is None:+ return cur+ while cur - prev > 180:+ cur -= 360+ while cur - prev < -180:+ cur += 360+ return cur+++def channels(sec):+ for fn in ("get_all_channels", "get_channels"):+ if hasattr(sec, fn):+ return list(getattr(sec, fn)())+ return list(unreal.MovieSceneSectionExtensions.get_all_channels(sec))+++def key(ch, f, v):+ ch.add_key(unreal.FrameNumber(f), float(v), 0.0, unreal.MovieSceneTimeUnit.DISPLAY_RATE,+ unreal.MovieSceneKeyInterpolation.LINEAR)+++def float_track(binding, prop, path, n, vals):+ tr = binding.add_track(unreal.MovieSceneFloatTrack)+ tr.set_property_name_and_path(prop, path)+ sec = tr.add_section()+ sec.set_range(-1, n + 1)+ ch = channels(sec)[0]+ for f, v in vals:+ key(ch, f, v)+ return tr+++les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+les.load_level(LEVEL)+log("level", LEVEL, "actors", len(eas.get_all_level_actors()), "shots", SHOTS)++for shot in SHOTS:+ d = json.load(open(os.path.join(CAMS, shot + ".json")))+ n, fps = d["frames_n"], d["fps"]+ label = "DEMO_" + shot+ for a in eas.get_all_level_actors():+ if a.get_actor_label() == label:+ eas.destroy_actor(a)+ fr = d["frames"] # blender frames 0..n+1 -> UE frames -1..n+ f1 = fr[1]+ cam = eas.spawn_actor_from_class(unreal.CineCameraActor, V(f1["loc"]),+ unreal.MathLibrary.make_rot_from_xz(V(f1["forward"]), V(f1["up"])))+ cam.set_actor_label(label)+ cam.set_folder_path("DemoCameras")+ cc = cam.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", d["sensor_width_mm"])+ fb.set_editor_property("sensor_height", d["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ lens = cc.get_editor_property("lens_settings")+ lens.set_editor_property("min_f_stop", 0.7)+ lens.set_editor_property("max_f_stop", 32.0)+ cc.set_editor_property("lens_settings", lens)+ cc.set_editor_property("current_focal_length", f1["lens_mm"])+ cc.set_editor_property("current_aperture", f1["fstop"])+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if d["dof"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", f1["focus_cm"] or 100000.0)+ cc.set_editor_property("focus_settings", fs)+ pp = cc.get_editor_property("post_process_settings")+ pp.set_editor_property("override_motion_blur_amount", True)+ pp.set_editor_property("motion_blur_amount", d["shutter_deg"] / 360.0)+ pp.set_editor_property("override_motion_blur_max", True)+ pp.set_editor_property("motion_blur_max", 100.0)+ cc.set_editor_property("post_process_settings", pp)+ cc.set_editor_property("post_process_blend_weight", 1.0)++ sp = f"{DEST}/Sequences/SEQ_{shot}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{shot}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(n)+ b = seq.add_possessable(cam)+ cb = seq.add_possessable(cc)+ try:+ if not cb.get_parent().is_valid():+ cb.set_parent(b)+ except Exception:+ cb.set_parent(b)++ # Transform: one key per frame, rotation unwrapped so subframes never spin through +-180.+ tr = b.add_track(unreal.MovieScene3DTransformTrack)+ sec = tr.add_section()+ sec.set_range(-1, n + 1)+ ch = channels(sec)+ prev = [None, None, None]+ for i, F in enumerate(fr):+ f = F["blender_frame"] - 1+ r = unreal.MathLibrary.make_rot_from_xz(V(F["forward"]), V(F["up"]))+ rpy = [unwrap(prev[0], r.roll), unwrap(prev[1], r.pitch), unwrap(prev[2], r.yaw)]+ prev = rpy+ for c, v in zip(ch[0:6], F["loc"] + rpy):+ key(c, f, v)+ for c in ch[6:9]:+ key(c, -1, 1.0)+ float_track(cb, "CurrentFocalLength", "CurrentFocalLength", n, [(F["blender_frame"] - 1, F["lens_mm"]) for F in fr])+ if d["dof"]:+ float_track(cb, "CurrentAperture", "CurrentAperture", n, [(F["blender_frame"] - 1, F["fstop"]) for F in fr])+ float_track(cb, "ManualFocusDistance", "FocusSettings.ManualFocusDistance", n,+ [(F["blender_frame"] - 1, F["focus_cm"]) for F in fr])++ try:+ cut = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ cut = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ cs = cut.add_section()+ cs.set_range(0, n)+ cs.set_camera_binding_id(seq.get_binding_id(b) if hasattr(seq, "get_binding_id")+ else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b))+ EAL.save_loaded_asset(seq, False)+ log("sequence", sp, n, "frames @", fps, "keys/channel", len(fr), "tracks", [t.get_display_name() for t in cb.get_tracks()])++if not les.save_current_level():+ log("save_current_level returned False")++for name, ts in (("MRQ_Demo", TS), ("MRQ_DemoCheck", 1)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ png = cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(OUT + ("" if ts > 1 else "/check"))+ out.file_name_format = "{sequence_name}/{frame_number}"+ out.output_resolution = unreal.IntPoint(1920, 804)+ out.zero_pad_frame_numbers = 4+ out.override_existing_output = True+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.spatial_sample_count = 1+ aa.temporal_sample_count = ts+ aa.engine_warm_up_count = 64+ aa.render_warm_up_frames = True+ aa.use_camera_cut_for_warm_up = False+ EAL.save_loaded_asset(cfg, False)+ log("config", cp, "temporal", ts, "out", out.output_directory.path)+log("done", f"{time.time() - T0:.0f}s")diff --git a/unreal_demo/render.sh b/unreal_demo/render.shnew file mode 100644index 0000000..3f96971--- /dev/null+++ b/unreal_demo/render.sh@@ -0,0 +1,22 @@+#!/usr/bin/env bash+# Headless MRQ render of demo sequences (no editor window), one UE process per shot (GPU_QUEUE=1: through pipeline/gpu_run.sh).+# bash unreal_demo/render.sh s1_street_crane,h1_walk_in_to_wok [MRQ_Demo|MRQ_DemoCheck]+# Frames: unreal_demo/mrq/SEQ_<shot>/####.png (0-based, = Blender frame - 1). Log: unreal_demo/logs/mrq_<shot>.log+export MSYS_NO_PATHCONV=1+A="$(cd "$(dirname "$0")/.." && pwd)"+UE="/c/Program Files/Epic Games/UE_5.8/Engine/Binaries/Win64/UnrealEditor-Cmd.exe"+PROJ="C:/Users/apek-anna/Developer/anyscene-unreal/AnySceneHKDemo/AnySceneHKDemo.uproject"+CFG=${2:-MRQ_Demo}+mkdir -p "$A/unreal_demo/logs"+IFS=, read -ra SHOTS <<< "$1"+for s in "${SHOTS[@]}"; do+ t0=$(date +%s)+ ${GPU_QUEUE:+bash "$A/pipeline/gpu_run.sh"} "$UE" "$PROJ" /Game/AnyScene/HK/L_HK -game \+ "-LevelSequence=/Game/AnySceneDemo/Sequences/SEQ_$s.SEQ_$s" \+ "-MoviePipelineConfig=/Game/AnySceneDemo/MRQ/$CFG.$CFG" \+ -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming \+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1,r.TextureStreaming=0" \+ "-abslog=$(cd "$A" && pwd -W)/unreal_demo/logs/mrq_${s}_$CFG.log" > /dev/null 2>&1+ rc=$?+ echo "RENDER $s $CFG rc=$rc $(( $(date +%s) - t0 ))s"+donediff --git a/unreal_fal/README.md b/unreal_fal/README.mdnew file mode 100644index 0000000..60c4e75--- /dev/null+++ b/unreal_fal/README.md@@ -0,0 +1,103 @@+# unreal_fal: the Blender -> Unreal export stage on fal Serverless++`app.py` is the fal app **`apek/blend2unreal`** (private). It runs `export_blend.py` headless on RTX 5090 workers. The+slow texture bake is sharded across workers, and finished assets are cached by content hash on `/data`.++```bash+cd unreal_fal+fal deploy app.py::Blend2Unreal --app-name blend2unreal --auth private --reset-scale+python client.py upload hk_scene.zip # .blend or .zip (a .blend + grade.sh); pack images/fonts first+python client.py export <scene_url> --options '{"frame": 60, "dof": {"cam_street": [9.5, 2.8]}}' --out result.json+```++## API++`POST /export`+```json+{"scene_url": "https://.../hk_scene.zip",+ "options": {"frame": 60, "density": 1024, "max_res": 4096, "dof": {"cam_street": [9.5, 2.8]},+ "grade_sh": "grade.sh", "blend": null, "device": "gpu", "shards": 0, "procs": 0},+ "use_cache": true, "fresh": false, "inline_scene_json": true}+```+Response:+```json+{"job_id": "x_...", "zip_url": "...zip", "scene_json_url": "...scene.json", "scene_json": {...},+ "report": {"counts": {...}, "cache": {...}, "not_baked": [], "not_converted": [...], "warnings": [...],+ "timings": {...}, "worker_seconds": {...}, "shards": [...]},+ "minutes": 5.4}+```+- `device`, `shards` and `procs` don't change the result, so they are left out of the retry fingerprint.+- The app scales to zero (`min_concurrency = 0`), so a cold `/export` first waits ~1-2 min for a worker to boot. Set it to 1 to keep a warm worker ($2.50/h).+- Repeating an identical request returns the finished result, or attaches to a live attempt (heartbeat), or resumes+ a dead one and re-attaches to its shard requests. `fresh: true` exports again.+- `use_cache: false` re-bakes everything into a job-private cache, deleted afterwards. The shared cache is never+ read or changed.++`POST /shard` is internal: `/export` calls it on other workers. Benches call it with `use_cache: false`.++## Pipeline++1. **Plan** (`--plan-out`, ~25 s for HK): names every unique mesh, hashes it and estimates its bake cost.+ - The hash covers: evaluated mesh, material node trees (recursively, with packed image bytes), world-space+ scale, bake settings, the Blender version and the exporter file itself.+ - Materials that read their object (Object Info, object coordinates, object attributes) also hash that object.+2. **Shards**:+ - Cache misses are dealt longest-first into N shards: ~2 min of estimated work per Blender process, at most 32.+ - Shard 0 runs on the `/export` worker; the others are `/shard` requests, submitted and polled (not+ `subscribe()`).+ - Each worker runs 2 Blender processes x 3 threads with OptiX. Each process is resumed up to 6 times after a+ Blender bake crash.+ - Every finished asset is written to `/data/blend2unreal/cache/<h[:2]>/<h>/` (written to a temp dir, then+ renamed into place).+ - Assets still missing after round 1 are re-dealt in a second round.+3. **Merge** (`--plan --cache --link-cache --no-bake`): pulls every asset from the cache by symlink, then writes+ volumes, lights, cameras, world, grade LUT and `scene.json`.+4. **Package**: copies off `/data` with 16 parallel readers, zips (PNG/EXR stored, the rest deflated) and uploads+ to fal storage.++## Machine notes (measured)++- An RTX 5090 worker is **6 cores / 60 GB** (`os.cpu_count()` says 512: the host's). Probed:+ - L: 4 cores / 15 GB+ - XL: 8 / 30 GB+ - RTX PRO 6000: 6+ - H100: 12 / 112 GB+- Per-asset time is mostly CPU: unwrap, Cycles sync, PNG encode.+- 36-asset HK bench on one worker:++ | Setup | Wall time |+ |---|---|+ | GPU, 2 procs x 3 threads | 122 s |+ | GPU, 1 proc x 6 threads | 196 s |+ | CPU, 2 procs | 785 s (road alone 354 s) |++ **GPU (OptiX) is ~6x faster**: it is the default.+- OptiX compiles its "shader raytrace" kernels (AO and Bevel nodes) on the first such bake: ~230 s per process on a+ fresh worker. The warm-up in `setup()` now bakes an AO+Bevel material, and the kernel cache is shared on `/data`+ with the render farm (`/data/anyscene-farm/optix/<gpu>`).++## Changes to merge back into `unreal/`++`export_blend.py` (copied from `unreal/` at 21:15 on Nov 1, after its last edit at 20:25):+1. New flags: `--plan-out FILE`, `--plan FILE`, `--keys FILE`, `--cache DIR`, `--link-cache` (see the docstring).+ Without them the exporter behaves as before, apart from items 2-4.+2. **Asset names are computed over the whole sorted key list before any filtering by `--keys`.**+ - Without `--only`/`--limit` the names are the same as before.+ - With them, the collision suffix `_NNN` now uses the index in the full list. Before, it was the index in the+ filtered list.+3. `scene.json` assets gain `"hash"` when `--cache` is used. Shard mode writes `out/shard_<keys file>`, not+ `scene.json`.+4. With `--gpu`, the bake scene selects OptiX devices itself (a factory-startup Blender would otherwise bake on the+ CPU). Locally, `gpu_prefs.py` via `EXPORT_PRE` keeps working.++`build_level.py`, `render_shots.py`, `side_by_side.py`, `agx_view.py`, `make_copy.py`: unchanged copies.++New: `app.py`, `client.py`, this README.++## Known limits / follow-ups++- The cache on `/data` has no eviction (HK is ~4.6 GB). Job-private caches are deleted after the job.+- `smart_project` UV layouts of converted text (fascia_text_*, neon_*) differ between Linux and Windows Blender.+ Each export's textures match its own GLB UVs, but the PNGs are not byte-comparable across platforms.+- `scene.json` paths use `/` (relpaths on Linux). The local Windows export used `\`. `build_level.py` joins them+ with `os.path.join`, which works on both.diff --git a/unreal_fal/agx_view.py b/unreal_fal/agx_view.pynew file mode 100644index 0000000..870bf9e--- /dev/null+++ b/unreal_fal/agx_view.py@@ -0,0 +1,19 @@+"""Apply a Blender view transform (default AgX + the scene's look) to Unreal scene-linear EXRs (MRQ_Linear output),+so UE and Cycles frames can be compared through the same tone mapper.+ blender -b --factory-startup --python agx_view.py -- <in.exr> <out.png> [look] [exposure]+"""+import sys+import bpy++a = sys.argv[sys.argv.index("--") + 1:]+src, dst = a[0], a[1]+look = a[2] if len(a) > 2 else "AgX - Medium High Contrast"+expo = float(a[3]) if len(a) > 3 else 0.0+sc = bpy.context.scene+sc.view_settings.view_transform = "AgX"+sc.view_settings.look = look+sc.view_settings.exposure = expo+sc.render.image_settings.file_format = "PNG"+img = bpy.data.images.load(src)+img.save_render(dst, scene=sc)+print("AGX", src, "->", dst, flush=True)diff --git a/unreal_fal/app.py b/unreal_fal/app.pynew file mode 100644index 0000000..8e8c875--- /dev/null+++ b/unreal_fal/app.py@@ -0,0 +1,710 @@+"""blend2unreal: the AnyScene Blender -> Unreal export stage (export_blend.py) on fal Serverless, sharded.++ fal deploy unreal_fal/app.py::Blend2Unreal --app-name blend2unreal --auth private++POST /export {scene_url, options} -> a zip of the export folder (mesh/, tex/, world/, grade/, scene.json), scene.json+ (inline and as a URL) and a report (counts, warnings, what didn't convert, timings, worker seconds).+POST /shard one shard of an export (called by /export on other workers of this app; callable directly for benches).++How an export runs (TOGGLE.md section 5):+ 1. plan on the /export worker: `export_blend.py --plan-out` names and hashes every unique mesh (evaluated mesh ++ material node trees + bake settings + exporter code) and estimates its bake cost. No baking.+ 2. shards assets whose hash is not in the bake cache (/data/blend2unreal/cache) are dealt to N shards by cost (LPT).+ Shard 0 runs on the /export worker itself; the rest go to /shard requests on other workers. Each shard runs+ a few Blender processes (`--keys`), bakes on OptiX and writes every finished asset into the cache.+ 3. merge `export_blend.py --plan --cache --link-cache --no-bake`: every asset comes from the cache, then volumes,+ lights, cameras, world and grade, and scene.json. The folder is zipped and put on fal storage.+A re-export of a lightly changed scene only bakes the assets whose hash changed. Identical requests are retry-safe as+in AnyShot: an index keyed by the request's fingerprint returns a finished result, attaches to a live attempt+(heartbeat), or resumes a dead one, re-attaching to its shard requests.++The scene is a .blend or a .zip holding one (and, optionally, the scene's grade.sh). Pack external images and fonts+into the .blend first: the worker has none of your local files.+"""++import asyncio+import hashlib+import json+import os+import shutil+import subprocess+import threading+import time+import urllib.request+import zipfile+from pathlib import PurePosixPath++import fal+from fal.container import ContainerImage+from pydantic import BaseModel, Field++if os.name == "nt":+ # Deploying from Windows: ContainerImage's context_dir default is a WindowsPath Linux can't unpickle.+ _posix = PurePosixPath("/tmp")+ ContainerImage.__dataclass_fields__["context_dir"].default = _posix+ ContainerImage.context_dir = _posix+ ContainerImage.__init__.__defaults__ = tuple(+ _posix if isinstance(d, os.PathLike) else d for d in ContainerImage.__init__.__defaults__ or ()+ )++_HERE = os.path.dirname(os.path.abspath(__file__))+EXPORTER = open(os.path.join(_HERE, "export_blend.py"), encoding="utf-8").read() # carried in the app at deploy time++BLENDER_VERSION = "5.0.1"+DOCKERFILE = f"""+FROM python:3.13-slim+# Expose the driver's graphics libraries too: OptiX (libnvoptix) ships with them, not with plain compute.+ENV NVIDIA_DRIVER_CAPABILITIES=all+RUN apt-get update && apt-get install -y --no-install-recommends \\+ curl ca-certificates xz-utils procps ffmpeg libxi6 libxxf86vm1 libxfixes3 libxrender1 libgl1 libegl1 \\+ libxkbcommon0 libsm6 libice6 libx11-6 libglib2.0-0 \\+ && rm -rf /var/lib/apt/lists/*+RUN curl -fsSL https://download.blender.org/release/Blender{BLENDER_VERSION[:3]}/blender-{BLENDER_VERSION}-linux-x64.tar.xz \\+ | tar -xJ -C /opt \\+ && ln -s /opt/blender-{BLENDER_VERSION}-linux-x64/blender /usr/local/bin/blender+"""++APP_ENV = "BLEND2UNREAL_APP" # this app's own id, for the shard requests (default below)+DEFAULT_APP = "apek/blend2unreal"+LOCAL = "/tmp/blend2unreal" # per-worker disk: scenes (never read from /data by many workers at once), job folders+EXPORT_PY = LOCAL + "/export_blend.py"+DATA = "/data/blend2unreal"+CACHE = DATA + "/cache" # <hash[:2]>/<hash>/{mesh.glb, meta.json, base.png, orm.png, normal.png, emit.png(.json), ready}+INDEX = DATA + "/_index" # <fingerprint>.json: the retry index+JOBS = DATA + "/jobs" # <job_id>/{plan.json, .alive, logs}+# OptiX kernels compiled by the same Blender build on the same GPU model: shared with the render farm app.+OPTIX_CACHE_LOCAL_DIR = "/var/tmp/OptixCache_root"+OPTIX_CACHE_SHARED_DIR = "/data/anyscene-farm/optix"+WARMUP = """import bpy+prefs = bpy.context.preferences.addons["cycles"].preferences+prefs.compute_device_type = "OPTIX"+prefs.get_devices()+for d in prefs.devices:+ d.use = d.type == "OPTIX"+s = bpy.context.scene+s.render.engine = "CYCLES"; s.cycles.device = "GPU"; s.cycles.samples = 4+s.render.resolution_x = s.render.resolution_y = 64+bpy.ops.mesh.primitive_uv_sphere_add()+o = bpy.context.object+m = bpy.data.materials.new("m"); m.use_nodes = True; o.data.materials.append(m)+nt = m.node_tree; p = nt.nodes["Principled BSDF"]+# AO and Bevel nodes need OptiX's separate "shader raytrace" kernels: without them in the warm-up, the first bake of+# each Blender process on a fresh worker compiled them for ~230 s (19 of 32 HK shards).+ao = nt.nodes.new("ShaderNodeAmbientOcclusion"); bev = nt.nodes.new("ShaderNodeBevel")+nt.links.new(ao.outputs["Color"], p.inputs["Base Color"]); nt.links.new(bev.outputs["Normal"], p.inputs["Normal"])+img = bpy.data.images.new("t", 64, 64); n = nt.nodes.new("ShaderNodeTexImage"); n.image = img+nt.nodes.active = n+bpy.ops.render.render()+bpy.ops.object.bake(type="EMIT")+bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT")+print("WARMUP done")+"""++# Shard sizing. Cost model per Blender process from a 36-asset HK bench on an RTX 5090 worker (6 cores, 2 processes+# x 3 threads, OptiX): ~4 s of per-asset overhead (unwrap, scene sync, BVH, PNG writes: CPU-bound) plus ~1 s per+# 3.5 Mpx-channel baked. The same bench on the CPU device took 6x longer (median 17 s per asset; 354 s for the road).+ASSET_OVERHEAD_S = 4.0+PX_PER_S = 3.5e6+TARGET_SHARD_S = 120 # each Blender process gets ~2 min of baking: worker boot + scene fetch + load is ~1.5-2.5 min+DONE_MARK = {"plan": "EXPORT plan written", "shard": "EXPORT shard done", "merge": "EXPORT wrote"}+++def stage(name, msg, **kw):+ print("BLEND2UNREAL " + json.dumps({"t": round(time.time(), 1), "stage": name, "message": msg, **kw}), flush=True)+++def cost_s(row):+ return ASSET_OVERHEAD_S + row.get("est_px", 0) / PX_PER_S+++def deal(rows, n):+ """Longest-processing-time first: rows split into n lists of about equal estimated cost."""+ bins = [[0.0, i, []] for i in range(max(1, n))]+ for r in sorted(rows, key=cost_s, reverse=True):+ b = min(bins, key=lambda b: (b[0], b[1]))+ b[0] += cost_s(r)+ b[2].append(r)+ return [b[2] for b in bins if b[2]]+++def cache_ready(h, cache=CACHE):+ return os.path.exists(os.path.join(cache, h[:2], h, "ready"))+++def cache_root(ns):+ """The shared bake cache, or (use_cache=False) a job-private one under /data/blend2unreal/scratch: a forced re-bake+ neither reads nor deletes shared entries (deleting 627 of them on /data took ~250 s)."""+ if not ns:+ return CACHE+ if not ns.replace("_", "").isalnum():+ raise ValueError("bad cache namespace")+ return f"{DATA}/scratch/{ns}"+++def write_json(path, obj):+ tmp = f"{path}.{os.getpid()}.{threading.get_ident()}.tmp"+ with open(tmp, "w", encoding="utf-8") as f:+ json.dump(obj, f, indent=1)+ os.replace(tmp, path)+++def _safe_extract(zpath, dest):+ with zipfile.ZipFile(zpath) as z:+ for m in z.infolist():+ name = m.filename.replace("\\", "/")+ if name.startswith("/") or ".." in name.split("/") or ":" in name.split("/")[0] or "__MACOSX" in name:+ continue+ target = os.path.join(dest, *name.split("/"))+ if m.is_dir():+ os.makedirs(target, exist_ok=True)+ continue+ os.makedirs(os.path.dirname(target), exist_ok=True)+ with z.open(m) as src, open(target, "wb") as out:+ while chunk := src.read(8 << 20):+ out.write(chunk)+++def fetch_scene(scene_url):+ """Download a scene once per worker into local disk: a .blend as is, a .zip unpacked. Concurrent requests on the+ same worker wait on a lock. Returns the folder."""+ import fcntl # Linux-only; `fal deploy` imports this module on Windows too++ sid = hashlib.sha256(scene_url.encode()).hexdigest()[:16]+ root = os.path.join(LOCAL, "inputs") # not "scenes": export_blend.py refuses scenes/<id>/hk.blend+ dest = os.path.join(root, sid)+ if os.path.exists(os.path.join(dest, ".ready")):+ return dest+ os.makedirs(root, exist_ok=True)+ with open(os.path.join(root, sid + ".lock"), "w") as lock:+ fcntl.flock(lock, fcntl.LOCK_EX)+ if os.path.exists(os.path.join(dest, ".ready")):+ return dest+ tmp = dest + ".part"+ shutil.rmtree(tmp, ignore_errors=True)+ os.makedirs(tmp)+ raw = os.path.join(tmp, "download")+ with urllib.request.urlopen(scene_url, timeout=900) as r, open(raw, "wb") as f:+ while chunk := r.read(8 << 20):+ f.write(chunk)+ with open(raw, "rb") as f:+ head = f.read(8)+ unpacked = os.path.join(tmp, "scene")+ os.makedirs(unpacked)+ if head.startswith(b"PK\x03\x04"):+ _safe_extract(raw, unpacked)+ os.remove(raw)+ elif head.startswith((b"BLENDER", b"\x28\xb5\x2f\xfd", b"\x1f\x8b")): # plain, zstd- or gzip-compressed+ os.replace(raw, os.path.join(unpacked, "scene.blend"))+ else:+ raise ValueError("scene_url must point to a .blend or a .zip holding one")+ shutil.rmtree(dest, ignore_errors=True)+ os.rename(unpacked, dest)+ shutil.rmtree(tmp, ignore_errors=True)+ open(os.path.join(dest, ".ready"), "w").close()+ return dest+++def pick_blend(scene_dir, name=None):+ blends = sorted(os.path.relpath(os.path.join(r, n), scene_dir) for r, _, ns in os.walk(scene_dir)+ for n in ns if n.lower().endswith(".blend"))+ if name:+ if name not in blends:+ raise ValueError(f"{name} is not in the scene zip ({blends[:10]})")+ return os.path.join(scene_dir, name)+ if not blends:+ raise ValueError("the scene holds no .blend file")+ # several: the biggest is the set (the others are usually linked props or backups)+ return max((os.path.join(scene_dir, b) for b in blends), key=os.path.getsize)+++def run_blender(blend, args, log_path, mode, tries=6, timeout=3600, threads=0):+ """export_blend.py in Blender, resumed after crashes: Blender 5.0.1's Cycles bake segfaults about once per 250+ bakes (OpenImageIO ustring in ccl::create_mesh), and the exporter skips the assets it already finished."""+ for i in range(tries):+ start = os.path.getsize(log_path) if os.path.exists(log_path) else 0+ t = time.time()+ with open(log_path, "a") as lf:+ lf.write(f"\n=== {mode} try {i + 1}: blender -b {blend} -- {' '.join(args)}\n")+ lf.flush()+ try:+ t_args = ["-t", str(threads)] if threads else []+ p = subprocess.run(["blender", "-b", *t_args, blend, "--python", EXPORT_PY, "--", *args], stdout=lf,+ stderr=subprocess.STDOUT, timeout=timeout)+ rc = p.returncode+ except subprocess.TimeoutExpired:+ rc = "timeout"+ with open(log_path, errors="replace") as f:+ f.seek(start)+ out = f.read()+ if DONE_MARK[mode] in out:+ return out, round(time.time() - t, 1), i + 1+ if rc == 0: # Blender exits 0 on a Python exception: a retry won't help+ raise RuntimeError(f"export_blend.py {mode} failed:\n{out[-3000:]}")+ print(f"blend2unreal: {mode} try {i + 1} ended rc={rc} without finishing; resuming", flush=True)+ raise RuntimeError(f"export_blend.py {mode} gave up after {tries} tries:\n{out[-3000:]}")+++def machine_info():+ """(cores this container may use, RAM GB). os.cpu_count() is the host's (512 on fal's RTX 5090 nodes); the+ container's CPU quota is far smaller, and Blender sized to the host count ran 12x slower than locally."""+ cores = len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else (os.cpu_count() or 1)+ for path in ("/sys/fs/cgroup/cpu.max", "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"):+ try:+ v = open(path).read().split()+ if path.endswith("cpu.max"):+ q, per = v[0], int(v[1])+ else:+ q, per = v[0], int(open("/sys/fs/cgroup/cpu/cpu.cfs_period_us").read())+ if q not in ("max", "-1"):+ cores = min(cores, max(1, int(q) // per))+ break+ except Exception: # noqa: BLE001+ pass+ mem_gb = 0+ try:+ mem_gb = int(open("/proc/meminfo").read().split("MemTotal:")[1].split()[0]) // (1 << 20)+ for path in ("/sys/fs/cgroup/memory.max", "/sys/fs/cgroup/memory/memory.limit_in_bytes"):+ if os.path.exists(path):+ v = open(path).read().strip()+ if v.isdigit():+ mem_gb = min(mem_gb, int(v) >> 30)+ break+ except Exception: # noqa: BLE001+ pass+ return cores, mem_gb+++def auto_procs(device, blend):+ """Blender processes per worker: each holds the whole set in RAM (~4x the .blend on disk). Per-asset time is mostly+ CPU (OptiX bakes are short), so ~3 cores per process: 2 on the 6-core RTX 5090 workers (122 s for the 36-asset+ bench vs 196 s with 1 process of 6 threads)."""+ cores, mem_gb = machine_info()+ per = max(4, 4 * os.path.getsize(blend) / 1e9 + 2)+ if device == "cpu":+ return max(1, min(2, int(mem_gb // per)))+ return max(1, min(4, cores // 3, int(mem_gb // per)))+++def common_args(o):+ a = ["--frame", str(o.frame), "--density", str(o.density), "--max-res", str(o.max_res)]+ return a+++def run_shard(scene_dir, blend, rows, opts, device, procs, work, use_cache=True, cache=CACHE):+ """Bake and export `rows` (plan rows) with `procs` Blender processes on this worker. Returns stats."""+ os.makedirs(work, exist_ok=True)+ write_json(os.path.join(work, "plan.json"), {"assets": rows})+ out = os.path.join(work, "out")+ procs = max(1, min(procs or auto_procs(device, blend), len(rows)))+ parts = deal(rows, procs)+ results, errors = [None] * len(parts), []+ threads = max(1, machine_info()[0] // len(parts))++ def one(i, part):+ kp = os.path.join(work, f"keys_{i}.json")+ write_json(kp, [r["key"] for r in part])+ args = ["--out", out, "--plan", os.path.join(work, "plan.json"), "--keys", kp, "--cpu-threads", str(threads),+ *common_args(opts)]+ if device == "gpu":+ args.append("--gpu")+ if use_cache:+ args += ["--cache", cache]+ try:+ log, secs, tries = run_blender(blend, args, os.path.join(work, f"blender_{i}.log"), "shard",+ threads=threads)+ per = json.load(open(os.path.join(out, f"shard_keys_{i}.json")))+ results[i] = {"seconds": secs, "tries": tries, "assets": per}+ except Exception as e: # noqa: BLE001+ errors.append(f"process {i}: {type(e).__name__}: {str(e)[-1500:]}")++ workers = [threading.Thread(target=one, args=(i, p)) for i, p in enumerate(parts)]+ for t in workers:+ t.start()+ for t in workers:+ t.join()+ per = [a for r in results if r for a in r["assets"]]+ missing = [r["key"] for r in rows if use_cache and not cache_ready(r["hash"], cache)]+ return {"assets": len(rows), "done": len(per), "from_cache": sum(a["cached"] for a in per),+ "bake_s": round(sum(a["bake_s"] for a in per), 1), "procs": len(parts),+ "process_s": [r["seconds"] if r else None for r in results], "threads": threads,+ "asset_s": {a["asset"]: a["bake_s"] for a in per}, "tries": [r["tries"] if r else None for r in results],+ "missing": missing, "errors": errors}+++class ExportOptions(BaseModel):+ frame: int = Field(60, description="Scene frame to export at (animated materials and transforms are sampled here).")+ density: float = Field(1024, description="Bake texel density, px per metre (halved over 2 m2, quartered over 50 m2).")+ max_res: int = Field(4096, description="Largest bake texture side.")+ dof: dict[str, list[float]] = Field(default_factory=dict, description=(+ "Per-camera depth-of-field overrides {camera: [focus_m, fstop]} (the stills script's values, which the .blend "+ "does not hold)."))+ grade_sh: str | None = Field("grade.sh", description=(+ "Path inside the scene zip of the scene's grade.sh (its GRADE= ffmpeg chain becomes a colour LUT). Ignored "+ "when the file is not there; null skips it."))+ blend: str | None = Field(None, description="Which .blend in the zip is the set (default: the largest).")+ device: str = Field("gpu", description="Bake device: gpu (OptiX) or cpu. Does not change the result.")+ shards: int = Field(0, description="Worker count for the bake (0 = sized from the plan's estimated cost).")+ procs: int = Field(0, description="Blender processes per worker (0 = from cores and RAM).")+++class ExportRequest(BaseModel):+ scene_url: str = Field(description="The scene: a .blend, or a .zip holding one (plus grade.sh). Pack external "+ "images and fonts into the .blend first.")+ options: ExportOptions = Field(default_factory=ExportOptions)+ use_cache: bool = Field(True, description=(+ "Reuse cached bakes (by content hash). False re-bakes everything into a job-private cache that is "+ "deleted afterwards; the shared cache is neither read nor changed."))+ fresh: bool = Field(False, description="Export again even if an identical request already has a result.")+ inline_scene_json: bool = Field(True, description="Also return scene.json inline (dropped when over 8 MB).")+++class ExportResponse(BaseModel):+ job_id: str+ zip_url: str = Field(description="Zip of the export folder: scene.json, mesh/, tex/, world/, grade/, report.json.")+ scene_json_url: str+ scene_json: dict | None+ report: dict+ minutes: float+++class ShardRequest(BaseModel):+ scene_url: str+ rows: list[dict] = Field(description="Plan rows (key, asset, hash, est_px) of the assets to bake.")+ options: ExportOptions = Field(default_factory=ExportOptions)+ job_id: str = ""+ cache_ns: str = Field("", description="Empty: the shared bake cache. Otherwise a job-private cache (use_cache=False).")+ use_cache: bool = Field(True, description="False (benchmarks): bake without reading or writing any cache.")+++class Blend2Unreal(fal.App):+ machine_type = "GPU-RTX5090"+ image = ContainerImage.from_dockerfile_str(DOCKERFILE, context_dir=PurePosixPath("/tmp"))+ requirements = ["pydantic", "fal==1.84.0", "fal-client"]+ min_concurrency = 0 # set 1 (owner-approved while testing) to keep a warm worker: /export then starts at once+ keep_alive = 60 # was 300: 32 shard workers idling 5 min each was ~half of the first HK export's bill+ max_concurrency = 32+ request_timeout = 3600+ startup_timeout = 1800++ def setup(self):+ os.makedirs(LOCAL, exist_ok=True)+ with open(EXPORT_PY, "w", encoding="utf-8") as f:+ f.write(EXPORTER)+ smi = subprocess.run(["nvidia-smi", "--query-gpu=name,driver_version,memory.total", "--format=csv,noheader"],+ capture_output=True, text=True)+ self.device = smi.stdout.strip() or "unknown GPU"+ slug = "".join(c if c.isalnum() else "_" for c in self.device)[:80]+ self.optix_shared = f"{OPTIX_CACHE_SHARED_DIR}/{slug}"+ if os.path.isdir(self.optix_shared):+ shutil.copytree(self.optix_shared, OPTIX_CACHE_LOCAL_DIR, dirs_exist_ok=True)+ t = time.time()+ r = subprocess.run(["blender", "-b", "--factory-startup", "--python-expr", WARMUP], capture_output=True,+ text=True, timeout=900)+ self.save_optix_cache()+ cores, mem = machine_info()+ print(f"blend2unreal ready: {self.device} | {cores} cores, {mem} GB RAM | OptiX warm-up "+ f"{'ok' if 'WARMUP done' in r.stdout else 'FAILED: ' + (r.stdout + r.stderr)[-500:]} in {time.time() - t:.0f} s",+ flush=True)++ def save_optix_cache(self):+ if not os.path.isdir(OPTIX_CACHE_LOCAL_DIR):+ return+ os.makedirs(self.optix_shared, exist_ok=True)+ for name in os.listdir(OPTIX_CACHE_LOCAL_DIR):+ a, b = os.path.join(OPTIX_CACHE_LOCAL_DIR, name), os.path.join(self.optix_shared, name)+ if os.path.isfile(a) and (not os.path.exists(b) or os.path.getsize(a) > os.path.getsize(b)):+ tmp = f"{b}.{os.getpid()}.tmp"+ shutil.copy(a, tmp)+ os.replace(tmp, b)++ # ------------------------------------------------------------------ /shard+ @fal.endpoint("/shard")+ def shard(self, req: ShardRequest) -> dict:+ t0 = time.time()+ scene_dir = fetch_scene(req.scene_url)+ blend = pick_blend(scene_dir, req.options.blend)+ t1 = time.time()+ work = os.path.join(LOCAL, "shards", f"{req.job_id or 'x'}_{os.getpid()}_{int(t0 * 1000)}")+ res = run_shard(scene_dir, blend, req.rows, req.options, req.options.device, req.options.procs, work,+ use_cache=req.use_cache, cache=cache_root(req.cache_ns))+ self.save_optix_cache()+ cores, mem = machine_info()+ res.update(fetch_s=round(t1 - t0, 1), seconds=round(time.time() - t0, 1), device=self.device,+ machine={"cores": cores, "mem_gb": mem}, bake_device=req.options.device)+ if res["errors"] or res["missing"]:+ res["log_tail"] = "".join(open(os.path.join(work, f), errors="replace").read()[-1500:]+ for f in sorted(os.listdir(work)) if f.endswith(".log"))[-4000:]+ if req.use_cache:+ shutil.rmtree(work, ignore_errors=True)+ return res++ # ------------------------------------------------------------------ /export+ @fal.endpoint("/export")+ async def export(self, req: ExportRequest) -> ExportResponse:+ import uuid++ t0 = time.time()+ o = req.options+ if o.device not in ("gpu", "cpu"):+ raise ValueError("options.device must be gpu or cpu")+ # Retry-safe like AnyShot: one job per identical order (device/shards/procs don't change the result).+ order = {"scene_url": req.scene_url, "use_cache": req.use_cache,+ "options": o.model_dump(exclude={"device", "shards", "procs"})}+ fp = hashlib.sha256(json.dumps(order, sort_keys=True).encode()).hexdigest()[:20]+ index = os.path.join(INDEX, fp + ".json")+ os.makedirs(INDEX, exist_ok=True)+ rec = None+ if not req.fresh and os.path.exists(index):+ told = False+ while True:+ rec = json.load(open(index))+ if rec.get("response"):+ stage("done", f"identical request: returning finished job {rec['job_id']}")+ return ExportResponse(**rec["response"])+ alive = os.path.join(JOBS, rec["job_id"], ".alive")+ if not os.path.exists(alive) or time.time() - os.path.getmtime(alive) > 90:+ break # its attempt died: resume it+ if not told:+ stage("received", f"identical request: attached to job {rec['job_id']}, still running")+ told = True+ await asyncio.sleep(20)+ stage("received", f"resuming job {rec['job_id']}")+ else:+ rec = {"job_id": "x_" + uuid.uuid4().hex[:10], "fingerprint": fp, "order": order, "started": t0, "shards": {}}+ write_json(index, rec)+ job_dir = os.path.join(JOBS, rec["job_id"])+ os.makedirs(job_dir, exist_ok=True)++ async def heartbeat():+ while True:+ open(os.path.join(job_dir, ".alive"), "w").close()+ await asyncio.sleep(20)++ hb = asyncio.create_task(heartbeat())+ try:+ return await self._export(req, rec, index, job_dir, t0)+ finally:+ hb.cancel()++ async def _export(self, req, rec, index, job_dir, t0):+ import fal_client+ from fal.toolkit import File++ o = req.options+ T = {}+ stage("fetch", "downloading the scene")+ scene_dir = await asyncio.to_thread(fetch_scene, req.scene_url)+ blend = pick_blend(scene_dir, o.blend)+ T["fetch_s"] = round(time.time() - t0, 1)+ local = os.path.join(LOCAL, "jobs", rec["job_id"])+ os.makedirs(local, exist_ok=True)++ # 1. plan+ plan_path = os.path.join(job_dir, "plan.json")+ t = time.time()+ if not os.path.exists(plan_path):+ stage("plan", f"planning {os.path.basename(blend)} ({os.path.getsize(blend) / 1e9:.2f} GB)")+ lp = os.path.join(local, "plan.json")+ await asyncio.to_thread(run_blender, blend, ["--out", os.path.join(local, "plan_out"), "--plan-out", lp,+ *common_args(o)], os.path.join(local, "plan.log"), "plan")+ shutil.copy(lp, plan_path + ".tmp")+ os.replace(plan_path + ".tmp", plan_path)+ plan = json.load(open(plan_path))+ T["plan_s"] = round(time.time() - t, 1)+ rows = plan["assets"]+ ns = "" if req.use_cache else rec["job_id"]+ cache = cache_root(ns)+ todo = [r for r in rows if not cache_ready(r["hash"], cache)]+ hits = len(rows) - len(todo)+ stage("plan", f"{len(rows)} assets ({plan['placements']} placements): {hits} cached, {len(todo)} to bake, "+ f"~{sum(cost_s(r) for r in todo) / 60:.0f} process-minutes", plan_s=plan.get("plan_s"))++ # 2. shards: shard 0 here, the rest on other workers of this app+ t = time.time()+ shard_stats = []+ if todo:+ procs = o.procs or auto_procs(o.device, blend)+ n = o.shards or max(1, min(32, round(sum(cost_s(r) for r in todo) / (procs * TARGET_SHARD_S))))+ app = os.environ.get(APP_ENV, DEFAULT_APP)+ client = fal_client.AsyncClient(key=os.environ.get("FAL_SERVERLESS_KEY") or os.environ.get("FAL_KEY"))+ for rnd in range(2): # a second round re-deals whatever the first one left unbaked+ todo = [r for r in rows if not cache_ready(r["hash"], cache)]+ if not todo:+ break+ parts = deal(todo, n if rnd == 0 else max(1, min(n, len(todo) // 4 or 1)))+ stage("shards", f"round {rnd + 1}: {len(todo)} assets in {len(parts)} shards ({o.device}, "+ f"{procs} Blender processes per worker)")++ async def remote(i, part):+ sid = f"r{rnd}s{i}"+ payload = {"scene_url": req.scene_url, "rows": part, "options": o.model_dump(), "job_id": rec["job_id"],+ "cache_ns": ns}+ old = rec["shards"].get(sid)+ handle = None+ if old and old.get("request_id") and not old.get("result"):+ handle = await client.get_handle(app, old["request_id"]) # a resumed job re-attaches+ for attempt in range(2):+ if handle is None:+ handle = await client.submit(app, arguments=payload, path="/shard")+ rec["shards"][sid] = {"request_id": handle.request_id, "assets": len(part), "submitted": time.time()}+ write_json(index, rec)+ try:+ while not isinstance(await handle.status(), fal_client.Completed):+ await asyncio.sleep(10)+ res = await handle.get()+ res["shard"] = sid+ rec["shards"][sid]["result"] = {k: res.get(k) for k in ("seconds", "done", "missing")}+ write_json(index, rec)+ stage("shards", f"{sid} done: {res['done']}/{res['assets']} assets in {res['seconds']:.0f}s "+ f"(scene fetch {res['fetch_s']:.0f}s)", **{k: res.get(k) for k in ("process_s", "errors")})+ return res+ except Exception as e: # noqa: BLE001+ stage("shards", f"{sid} attempt {attempt + 1} failed: {type(e).__name__}: {str(e)[:300]}")+ handle = None+ return {"shard": sid, "assets": len(part), "done": 0, "errors": ["request failed twice"], "seconds": 0}++ async def here(part):+ tt = time.time()+ res = await asyncio.to_thread(run_shard, scene_dir, blend, part, o, o.device, procs,+ os.path.join(local, f"shard_r{rnd}"), True, cache)+ res.update(shard=f"r{rnd}s0 (orchestrator)", seconds=round(time.time() - tt, 1), fetch_s=0)+ stage("shards", f"local shard done: {res['done']}/{res['assets']} in {res['seconds']:.0f}s")+ return res++ shard_stats += await asyncio.gather(here(parts[0]), *(remote(i, p) for i, p in enumerate(parts[1:], 1)))+ self.save_optix_cache()+ T["shards_s"] = round(time.time() - t, 1)+ unbaked = [r["key"] for r in rows if not cache_ready(r["hash"], cache)]++ # 3. merge+ t = time.time()+ out = os.path.join(local, "export")+ shutil.rmtree(out, ignore_errors=True)+ args = ["--out", out, "--plan", plan_path, "--cache", cache, "--link-cache", "--no-bake", "--ffmpeg", "ffmpeg",+ *common_args(o)]+ if o.device == "gpu":+ args.append("--gpu") # volume sampling bakes+ if o.dof:+ args += ["--dof", json.dumps(o.dof)]+ grade = os.path.join(scene_dir, o.grade_sh) if o.grade_sh else None+ if grade and os.path.isfile(grade) and os.path.realpath(grade).startswith(os.path.realpath(scene_dir)):+ args += ["--grade-sh", grade]+ else:+ grade = None+ stage("merge", f"writing scene.json ({len(unbaked)} assets left unbaked)")+ merge_log, _, _ = await asyncio.to_thread(run_blender, blend, args, os.path.join(local, "merge.log"), "merge")+ T["merge_s"] = round(time.time() - t, 1)++ scene = json.load(open(os.path.join(out, "scene.json"), encoding="utf-8"))+ report = self._report(plan, scene, out, unbaked, merge_log, grade, shard_stats, hits)+ write_json(os.path.join(out, "report.json"), report)++ # 4. package+ t = time.time()+ stage("package", "zipping and uploading")+ zpath = os.path.join(local, f"{rec['job_id']}.zip")+ await asyncio.to_thread(localize, out)+ T["copy_s"] = round(time.time() - t, 1)+ size = await asyncio.to_thread(zip_dir, out, zpath)+ T["zip_s"] = round(time.time() - t - T["copy_s"], 1)+ zip_url = await asyncio.to_thread(lambda: File.from_path(zpath, content_type="application/zip").url)+ sj_url = await asyncio.to_thread(lambda: File.from_path(os.path.join(out, "scene.json"),+ content_type="application/json").url)+ T["package_s"] = round(time.time() - t, 1)+ T["total_s"] = round(time.time() - t0, 1)+ report["timings"] = T+ report["zip_bytes"] = size+ sec = [s.get("seconds") or 0 for s in shard_stats if "orchestrator" not in str(s.get("shard"))]+ report["worker_seconds"] = {"export_worker": T["total_s"], "shard_workers": round(sum(sec), 1),+ "total": round(T["total_s"] + sum(sec), 1)}+ js = json.dumps(scene)+ res = ExportResponse(job_id=rec["job_id"], zip_url=zip_url, scene_json_url=sj_url,+ scene_json=scene if req.inline_scene_json and len(js) < 8 << 20 else None,+ report=report, minutes=round((time.time() - t0) / 60, 2))+ stage("done", f"{len(scene['assets'])} assets, {len(scene['placements'])} placements in {res.minutes:.1f} min",+ zip_url=zip_url)+ rec = json.load(open(index))+ rec.update(response=res.model_dump(), finished=time.time())+ write_json(index, rec)+ shutil.rmtree(local, ignore_errors=True)+ if ns: # the job-private cache of a use_cache=False export: delete it in the background+ threading.Thread(target=shutil.rmtree, args=(cache, True), daemon=True).start()+ await asyncio.sleep(2) # let the last stage lines reach the queue logs before COMPLETED+ return res++ def _report(self, plan, scene, out, unbaked, merge_log, grade, shard_stats, hits):+ tex = {}+ tex_bytes = 0+ for f in os.listdir(os.path.join(out, "tex")):+ if f.endswith(".png"):+ c = f.rsplit("_", 1)[-1][:-4]+ tex[c] = tex.get(c, 0) + 1+ tex_bytes += os.path.getsize(os.path.join(out, "tex", f))+ glb_bytes = sum(os.path.getsize(os.path.join(out, "mesh", f)) for f in os.listdir(os.path.join(out, "mesh"))+ if f.endswith(".glb"))+ need = {r["key"] for r in plan["assets"] if r.get("channels")}+ no_tex = [a["asset"] for a in scene["assets"] if a["key"] in need and "base" not in a.get("tex", {})]+ warnings = [l.split("EXPORT ", 1)[1] for l in merge_log.splitlines() if l.startswith("EXPORT") and "WARNING" in l]+ warnings += [f"light {l['name']}: {l['note']}" for l in scene["lights"] if l.get("note")]+ od = [a["asset"] for a in scene["assets"] if a.get("object_dependent") and a.get("instances", 1) > 1]+ if od:+ warnings.append(f"{len(od)} instanced assets have object-dependent materials (Object Info, object coords, "+ f"AO, ...): baked once on a representative instance, so instances share one look: {od[:12]}")+ anim = [a["asset"] for a in scene["assets"] if a.get("animated_materials")]+ if anim:+ warnings.append(f"{len(anim)} assets have animated materials, baked at frame {scene['frame']}: {anim[:12]}")+ if unbaked:+ warnings.append(f"{len(unbaked)} assets failed to bake on every try and were exported without textures")+ if grade is None:+ warnings.append("no grade.sh: grade/lut_grade.png not written (Unreal gets the AgX view + exposure only)")+ not_converted = [{"name": n, "why": w} for n, w in scene.get("skipped", [])]+ not_converted += [{"name": v, "why": "volume: exported as sampled density/emission (scene.json volumes), "+ "not geometry"} for v in scene.get("volumes", {})]+ not_converted += [{"name": f["name"], "why": f"{f['kind']} fx: exported as a description (scene.json fx) "+ "for the Niagara stage"} for f in scene.get("fx", [])]+ return {+ "counts": {"objects": plan["objects"], "assets": len(scene["assets"]), "placements": len(scene["placements"]),+ "lights": len(scene["lights"]), "cameras": len(scene["cameras"]),+ "volumes": len(scene.get("volumes", {})), "fx": len(scene.get("fx", [])),+ "converted_to_mesh": len(scene.get("converted", [])), "glass_assets":+ sum(1 for a in scene["assets"] if a.get("glass")),+ "textures": tex, "texture_bytes": tex_bytes, "glb_bytes": glb_bytes},+ "cache": {"hits": hits, "baked": len(plan["assets"]) - hits - len(unbaked), "unbaked": unbaked},+ "not_baked": no_tex,+ "not_converted": not_converted,+ "converted": scene.get("converted", []),+ "warnings": warnings,+ "shards": shard_stats,+ "plan": {"code": plan["code"], "blender": plan["blender"], "plan_s": plan.get("plan_s"),+ "est_mpx": round(sum(r["est_px"] for r in plan["assets"]) / 1e6)},+ }+++def localize(src, workers=16):+ """Replace the merge's symlinks into the /data cache with local copies, many files at once: one reader on /data+ managed ~20 MB/s (220 s to zip HK's 4.4 GB straight off the symlinks)."""+ from concurrent.futures import ThreadPoolExecutor++ links = [os.path.join(r, f) for r, _, fs in os.walk(src) for f in fs if os.path.islink(os.path.join(r, f))]++ def one(p):+ target = os.path.realpath(p)+ tmp = p + ".copy"+ shutil.copyfile(target, tmp)+ os.replace(tmp, p)++ with ThreadPoolExecutor(workers) as ex:+ list(ex.map(one, links))+ return len(links)+++def zip_dir(src, zpath):+ """The export folder as a zip; images stored, the rest deflated."""+ with zipfile.ZipFile(zpath, "w", zipfile.ZIP_DEFLATED, compresslevel=1) as z:+ for root, _, files in os.walk(src):+ for f in sorted(files):+ p = os.path.join(root, f)+ arc = os.path.relpath(p, src).replace(os.sep, "/")+ ct = zipfile.ZIP_STORED if f.endswith((".png", ".exr")) else zipfile.ZIP_DEFLATED+ z.write(p, arc, compress_type=ct)+ return os.path.getsize(zpath)diff --git a/unreal_fal/build_level.py b/unreal_fal/build_level.pynew file mode 100644index 0000000..7b0892d--- /dev/null+++ b/unreal_fal/build_level.py@@ -0,0 +1,674 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,sequences (default: all)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % 16 == 15 or i == len(todo) - 1:+ flush(a)+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked():+ path = f"{DEST}/Materials/M_AnyBaked"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyBaked", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_glass():+ path = f"{DEST}/Materials/M_AnyGlass"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGlass", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ c = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, -500, 0)+ c.set_editor_property("parameter_name", "Color")+ c.set_editor_property("default_value", unreal.LinearColor(1, 1, 1, 1))+ r = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 200)+ r.set_editor_property("parameter_name", "Roughness")+ r.set_editor_property("default_value", 0.05)+ o = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 350)+ o.set_editor_property("parameter_name", "Opacity")+ o.set_editor_property("default_value", 0.25)+ MEL.connect_material_property(c, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], baked)+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ c = g["color"]+ MEL.set_material_instance_vector_parameter_value(gm, "Color", unreal.LinearColor(c[0], c[1], c[2], 1))+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ if a.get("sections"):+ # The GLB keeps only the materials its faces use (an all-glass pane has just the glass section).+ mats = [mats[min(s, len(mats) - 1)] for s in a["sections"]]+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0]:+ continue+ b = v["bounds_ue"]+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(b["center"]), unreal.Rotator(0, 0, 0))+ lf.set_actor_label("LFV_" + name)+ lf.set_folder_path("Volumes")+ # Local fog volumes are unit spheres of radius 100 cm at scale 1 (assumed); scale to the box.+ lf.set_actor_scale3d(unreal.Vector(b["extent"][0] / 100, b["extent"][1] / 100, b["extent"][2] / 100))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"])+ emit = max(v["emission"])+ lc.set_editor_property("radial_fog_extinction", dens)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ lc.set_editor_property("radial_fog_extinction", 1.0)+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * emit, ec[1] * emit, ec[2] * emit, 1))+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", min(1.0, ff["vignette_angle_rad"] / (math.pi / 4) * 0.45))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+ hero = next((c for c in scene["cameras"] if c["name"] == "cam_street"), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(48)+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, 48)+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ EAL.save_loaded_asset(seq, False)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = scene["grade"].get("resolution", [1920, 804])+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.path.join(EXPORT, "..", "compare", "mrq").replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = True+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = 64+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal_fal/client.py b/unreal_fal/client.pynew file mode 100644index 0000000..3861863--- /dev/null+++ b/unreal_fal/client.py@@ -0,0 +1,73 @@+"""Call blend2unreal. FAL_KEY in the environment (the FAL_SERVERLESS_KEY user variable on the owner's box).++ python client.py upload <scene.zip|.blend> -> prints the fal storage URL+ python client.py export <scene_url> [--options '{"dof": {...}}'] [--out result.json] [--fresh] [--no-cache]+ python client.py shard <plan.json> <scene_url> --n 40 [--device cpu] [--procs 2] (bench: no cache read/write)++Polls the queue (submit + status) instead of subscribe(), which hung in AnyShot's tests, and prints the app's+BLEND2UNREAL stage lines as they arrive.+"""+import argparse+import json+import os+import sys+import time++import fal_client++APP = os.environ.get("BLEND2UNREAL_APP", "apek/blend2unreal")+++def run(path, payload, out=None):+ t0 = time.time()+ h = fal_client.submit(APP, arguments=payload, path=path)+ print("request", h.request_id, flush=True)+ seen = 0+ while True:+ st = h.status(with_logs=True)+ logs = getattr(st, "logs", None) or []+ for l in logs[seen:]:+ msg = l.get("message", "")+ if "BLEND2UNREAL" in msg or "blend2unreal" in msg:+ print(f"[{time.time() - t0:6.0f}s] {msg.strip()[:400]}", flush=True)+ seen = max(seen, len(logs))+ if isinstance(st, fal_client.Completed):+ break+ time.sleep(10)+ res = h.get()+ print(f"done in {time.time() - t0:.0f}s wall", flush=True)+ if out:+ json.dump({"request_id": h.request_id, "wall_s": round(time.time() - t0, 1), "result": res},+ open(out, "w"), indent=1)+ return res+++def main():+ ap = argparse.ArgumentParser()+ ap.add_argument("cmd", choices=["upload", "export", "shard"])+ ap.add_argument("args", nargs="+")+ ap.add_argument("--options", default="{}")+ ap.add_argument("--out")+ ap.add_argument("--fresh", action="store_true")+ ap.add_argument("--no-cache", action="store_true")+ ap.add_argument("--n", type=int, default=40)+ ap.add_argument("--device", default="gpu")+ ap.add_argument("--procs", type=int, default=0)+ a = ap.parse_args()+ if a.cmd == "upload":+ print(fal_client.upload_file(a.args[0]))+ elif a.cmd == "export":+ res = run("/export", {"scene_url": a.args[0], "options": json.loads(a.options), "fresh": a.fresh,+ "use_cache": not a.no_cache, "inline_scene_json": False}, a.out)+ print(json.dumps({k: v for k, v in res.items() if k != "scene_json"}, indent=1)[:6000])+ else:+ plan = json.load(open(a.args[0]))+ rows = plan["assets"][: a.n]+ opts = {**json.loads(a.options), "device": a.device, "procs": a.procs}+ res = run("/shard", {"scene_url": a.args[1], "rows": rows, "options": opts, "use_cache": False,+ "job_id": "bench"}, a.out)+ print(json.dumps(res, indent=1)[:4000])+++if __name__ == "__main__":+ sys.exit(main())diff --git a/unreal_fal/export_blend.py b/unreal_fal/export_blend.pynew file mode 100644index 0000000..9bbd45e--- /dev/null+++ b/unreal_fal/export_blend.py@@ -0,0 +1,1359 @@+"""AnyScene -> Unreal export: bake every surface material to PBR textures, export one GLB per unique mesh, and write+scene.json (placements, lights, cameras, world, volumes, grade) in Unreal units and axes.++ blender -b <COPY of scene.blend> --python export_blend.py -- --out <dir> [--frame 60] [--only a,b] [--limit N]+ [--density 1024] [--max-res 4096] [--grade-sh scenes/<id>/scripts/grade.sh] [--ffmpeg path]+ [--dof '{"cam_street": [9.5, 2.8]}'] [--no-bake] [--cpu-threads 0]+ [--plan-out plan.json | --plan plan.json [--keys shard.json]] [--cache DIR [--link-cache]]++Sharded (TOGGLE.md section 5; unreal_fal/app.py runs it on fal):+ 1. --plan-out plan.json: classify, name every asset, hash it (evaluated mesh + material node trees + bake settings ++ this file) and estimate its bake cost; no baking, no volumes, no world. Asset names come from the full key list,+ so they are the same in every process.+ 2. --plan plan.json --keys shard.json --cache DIR: bake and export only these asset keys (any number of processes,+ on any number of machines) and store each finished asset in DIR/<hash[:2]>/<hash>/. Writes no scene.json.+ 3. --plan plan.json --cache DIR --no-bake [--link-cache]: the merge. Every asset comes from the cache (symlinked with+ --link-cache), then scene.json, volumes, lights, cameras, world and grade are written as usual.+ Without --plan, --cache alone also works in one process: finished assets are reused across exports.++Never saves the .blend (it modifies the open file in memory: new UV layers, converted text/curves). Rerunnable:+textures and GLBs that already exist are skipped (delete <out>/tex/<asset>_* or <out>/mesh/<asset>.glb to redo one).++Conventions written to scene.json+ * Space: Unreal (cm, X forward, Y right, Z up, left-handed). Blender (x, y, z) m -> Unreal (x, -y, z) * 100.+ Object transforms are S*M*S with S = diag(1,-1,1), given as location, quaternion (x,y,z,w) and scale.+ * Mesh GLBs are exported in object-local space at identity; the Unreal importer maps glTF to its own axes, so+ build_level.py checks the result against "check_bounds" for the first assets.+ * Photometry: 683 lm/W. Point/spot cd = 683 * P / (4 pi); area cd = 683 * P / pi; sun lux = 683 * S;+ emissive nits = 683 * strength; sky radiance x 683. Exposure: Blender pixel = L_b * 2^exposure, so the Unreal+ manual exposure is EV100 = log2(683 / 1.2) - exposure (written as grade.ev100).+ * Bake: every surface material (procedural or not) is baked per unique mesh into one texture set on a bake UV:+ BaseColor (sRGB png), ORM (R=1, G=roughness, B=metallic, linear png), Normal (tangent, OpenGL +Y, png, only if a+ material perturbs the normal), Emissive (sRGB png + scale, only if emissive). Glass slots (transmission > 0.5)+ are not baked: they keep their own material slot and parameters.+"""+import bmesh # noqa: F401 (kept for hand edits)+import hashlib+import json+import math+import os+import re+import shutil+import subprocess+import sys+import time++import bpy+import numpy as np+from mathutils import Matrix, Vector++LM_PER_W = 683.0+argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+++def arg(name, default=None):+ return argv[argv.index(name) + 1] if name in argv else default+++OUT = os.path.abspath(arg("--out", "unreal_export"))+FRAME = int(arg("--frame", "60"))+ONLY = set(x for x in arg("--only", "").split(",") if x)+LIMIT = int(arg("--limit", "0"))+DENSITY = float(arg("--density", "1024")) # bake px per metre of sqrt(surface area)+MAX_RES = int(arg("--max-res", "4096"))+NO_BAKE = "--no-bake" in argv+DOF = json.loads(arg("--dof", "{}"))+GRADE_SH = arg("--grade-sh")+FFMPEG = arg("--ffmpeg", os.environ.get("FFMPEG", "ffmpeg")) # pipeline/env.sh exports FFMPEG (ffmpeg is not on PATH here)+THREADS = int(arg("--cpu-threads", "0"))+GPU = "--gpu" in argv # bake with OptiX (run through pipeline/gpu_run.sh)+REVERSE = "--reverse" in argv # walk assets from the end: a second process can share the work+PLAN_OUT = arg("--plan-out") # plan pass: write the asset plan and stop+PLAN = arg("--plan") # names and hashes from a plan pass (shards and merge)+KEYS = arg("--keys") # shard: a JSON list of asset keys to bake/export; nothing else is written+CACHE = arg("--cache") # bake cache dir: <hash[:2]>/<hash>/{mesh.glb, meta.json, base.png, ...}+LINK_CACHE = "--link-cache" in argv # symlink cached files into --out instead of copying them++SRC = bpy.data.filepath+if not SRC or os.path.basename(SRC) == "hk.blend" and "scenes" in SRC.replace("\\", "/").split("/"):+ print("export_blend: refusing to run on a scene's own .blend; open a copy", flush=True)+ sys.exit(1)++for d in ("mesh", "tex", "world", "grade"):+ os.makedirs(os.path.join(OUT, d), exist_ok=True)++sc = bpy.context.scene+sc.frame_set(FRAME)+S = Matrix.Diagonal((1.0, -1.0, 1.0, 1.0))+LOG = []+++def log(*a):+ s = " ".join(str(x) for x in a)+ LOG.append(s)+ print("EXPORT", s, flush=True)+++def ue_vec(v, scale=100.0):+ return [v[0] * scale, -v[1] * scale, v[2] * scale]+++def ue_xform(mw):+ t = S @ mw @ S+ loc, rot, scl = t.decompose()+ return {"loc": [loc.x * 100, loc.y * 100, loc.z * 100], "quat": [rot.x, rot.y, rot.z, rot.w], "scale": list(scl)}+++def ue_axes(mw):+ """Forward (-Z local) and up (+Y local) of a Blender camera/light in Unreal axes."""+ r = mw.to_3x3().normalized()+ f = r @ Vector((0, 0, -1))+ u = r @ Vector((0, 1, 0))+ return [f.x, -f.y, f.z], [u.x, -u.y, u.z]+++def safe(name):+ return re.sub(r"[^A-Za-z0-9_]", "_", name)[:60]+++# ------------------------------------------------------------------ material inspection++def output_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ for n in outs:+ if n.is_active_output:+ return n+ return outs[0] if outs else None+++def surface_shader(m):+ if not m or not m.node_tree:+ return None+ o = output_node(m.node_tree)+ if not o or not o.inputs["Surface"].is_linked:+ return None+ return o.inputs["Surface"].links[0].from_node+++def is_volume_only(m):+ if not m or not m.node_tree:+ return False+ o = output_node(m.node_tree)+ return bool(o and o.inputs["Volume"].is_linked and not o.inputs["Surface"].is_linked)+++def find_principled(m):+ sh = surface_shader(m)+ if sh is None:+ return None+ if sh.type == "BSDF_PRINCIPLED":+ return sh+ # Mix shaders etc.: first principled upstream.+ seen, stack = set(), [sh]+ while stack:+ n = stack.pop()+ if n.name in seen:+ continue+ seen.add(n.name)+ if n.type == "BSDF_PRINCIPLED":+ return n+ for i in n.inputs:+ for l in i.links:+ stack.append(l.from_node)+ return None+++def is_glass(m):+ p = find_principled(m)+ if p is not None:+ return (not p.inputs["Transmission Weight"].is_linked) and p.inputs["Transmission Weight"].default_value > 0.5+ sh = surface_shader(m)+ return sh is not None and sh.type in ("BSDF_GLASS", "BSDF_REFRACTION")+++def glass_params(m):+ p = find_principled(m)+ if p is None:+ return {"color": [1, 1, 1], "roughness": 0.0, "ior": 1.45}+ c = p.inputs["Base Color"].default_value+ return {"color": [c[0], c[1], c[2]], "roughness": p.inputs["Roughness"].default_value,+ "ior": p.inputs["IOR"].default_value, "alpha": p.inputs["Alpha"].default_value}+++def emissive(m):+ sh = surface_shader(m)+ if sh is None:+ return False+ if sh.type == "EMISSION":+ return True+ p = find_principled(m)+ if p is None:+ return False+ s = p.inputs["Emission Strength"]+ c = p.inputs["Emission Color"]+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))+++def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+++def uses_object_dependence(m):+ """Nodes whose result depends on the object it sits on (bakes per representative instance)."""+ if not m or not m.node_tree:+ return []+ hits = set()+ def walk(nt):+ for n in nt.nodes:+ if n.type in ("OBJECT_INFO", "AMBIENT_OCCLUSION", "NEW_GEOMETRY", "BEVEL"):+ hits.add(n.type)+ if n.type == "TEX_COORD":+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+ if n.type == "ATTRIBUTE" and n.attribute_type in ("OBJECT", "INSTANCER"):+ hits.add("ATTR_" + n.attribute_name)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+ return sorted(hits)+++def animated(m):+ ad = m.node_tree.animation_data if m and m.node_tree else None+ return bool(ad and (ad.drivers or ad.action))+++# ------------------------------------------------------------------ scene classification++def particle_instancers():+ srcs, emitters = set(), set()+ for o in sc.objects:+ for md in o.modifiers:+ if md.type == "PARTICLE_SYSTEM":+ st = md.particle_system.settings+ emitters.add(o.name)+ if st.render_type == "OBJECT" and st.instance_object:+ srcs.add(st.instance_object.name)+ if st.render_type == "COLLECTION" and st.instance_collection:+ srcs.update(x.name for x in st.instance_collection.all_objects)+ return srcs, emitters+++def object_attr_values(o):+ """Values of the object attributes (Attribute node, type Object/Instancer) its materials read, e.g. a per-console+ screen_idx choosing which CRT page shows. Instances that differ in them cannot share one bake."""+ vals = set()+ for s in o.material_slots:+ for h in uses_object_dependence(s.material):+ if h.startswith("ATTR_"):+ vals.add(f"{h[5:]}={o.get(h[5:])}")+ return sorted(vals)+++def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+ av = object_attr_values(o)+ return "m_" + o.data.name + ("|" + ",".join(av) if av else "")+ return "o_" + o.name+++def tri_count(me):+ me.calc_loop_triangles()+ return len(me.loop_triangles)+++def render_uv(me):+ return next((l for l in me.uv_layers if l.active_render), None) or me.uv_layers.active+++def uv_ok(me):+ """True if the active render UV is a usable non-overlapping atlas inside 0..1 (generated-prop style)."""+ uvl = render_uv(me)+ if uvl is None or len(me.loop_triangles) == 0:+ return False+ n = len(me.loops)+ uv = np.empty(n * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ if uv.min() < -0.01 or uv.max() > 1.01:+ return False+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ total = float(a.sum())+ if total > 1.02 or total < 0.05:+ return False+ # Coarse overlap check: rasterise triangle centroids+vertices into a 512 grid weighted by area.+ g = 512+ idx = np.clip((t.mean(axis=1) * g).astype(np.int32), 0, g - 1)+ occ = np.zeros((g, g), np.float64)+ np.add.at(occ, (idx[:, 1], idx[:, 0]), a)+ return float(occ.max()) < 4.0 / (g * g) + 1e-4 or total < 0.9+++def surface_area(o, me):+ mw = o.matrix_world+ me.calc_loop_triangles()+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3)+ m3 = np.array(mw.to_3x3())+ co = co @ m3.T+ vt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ t = co[vt.reshape(-1, 3)]+ return float(0.5 * np.linalg.norm(np.cross(t[:, 1] - t[:, 0], t[:, 2] - t[:, 0]), axis=1).sum())+++def pow2(x, lo, hi):+ r = lo+ while r < x and r < hi:+ r *= 2+ return min(r, hi)+++# ------------------------------------------------------------------ baking++BAKE_SCENE = None+++def bake_scene():+ global BAKE_SCENE+ if BAKE_SCENE is None:+ bs = bpy.data.scenes.new("__bake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "GPU" if GPU else "CPU"+ if GPU: # device prefs live in user preferences, not the .blend: a factory Blender would bake on the CPU+ prefs = bpy.context.preferences.addons["cycles"].preferences+ if prefs.compute_device_type == "NONE" or not any(d.use and d.type != "CPU" for d in prefs.devices):+ prefs.compute_device_type = "OPTIX"+ prefs.get_devices()+ for d in prefs.devices:+ d.use = d.type == "OPTIX"+ log("bake device:", prefs.compute_device_type, [d.name for d in prefs.devices if d.use])+ bs.cycles.samples = 4+ bs.cycles.use_denoising = False+ bs.render.bake.margin = 8+ bs.render.bake.use_clear = True+ bs.render.bake.target = "IMAGE_TEXTURES"+ if THREADS:+ bs.render.threads_mode = "FIXED"+ bs.render.threads = THREADS+ bs.world = sc.world+ bs.frame_current = FRAME+ BAKE_SCENE = bs+ return BAKE_SCENE+++def run_bake(o, kind):+ bs = bake_scene()+ vl = bs.view_layers[0]+ with bpy.context.temp_override(scene=bs, view_layer=vl, object=o, active_object=o,+ selected_objects=[o], selected_editable_objects=[o]):+ if kind == "NORMAL":+ bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT", margin=8, use_clear=True)+ else:+ bpy.ops.object.bake(type="EMIT", margin=8, use_clear=True)+++def _src(sock):+ return sock.links[0].from_socket if sock.is_linked else None+++class Rewire:+ """Temporarily route one Principled channel into an Emission shader on the material output."""++ def __init__(self, m, channel, img):+ self.m, self.nt = m, m.node_tree+ self.added, self.saved = [], None+ nt = self.nt+ out = output_node(nt)+ p = find_principled(m)+ sh = surface_shader(m)+ em = nt.nodes.new("ShaderNodeEmission")+ self.added.append(em)+ em.inputs["Strength"].default_value = 1.0+ col = em.inputs["Color"]+ if channel == "base":+ if p is not None:+ s = p.inputs["Base Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ elif sh is not None and sh.type == "EMISSION":+ col.default_value = (0, 0, 0, 1)+ elif sh is not None and "Color" in sh.inputs:+ s = sh.inputs["Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+ # R=1 (no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+ else:+ cmb.inputs[i].default_value = p.inputs[k].default_value if p is not None else dv+ nt.links.new(cmb.outputs[0], col)+ elif channel == "emit":+ if sh is not None and sh.type == "EMISSION":+ for k in ("Color", "Strength"):+ s = sh.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[k])+ else:+ em.inputs[k].default_value = s.default_value+ elif p is not None:+ for k, ek in (("Emission Color", "Color"), ("Emission Strength", "Strength")):+ s = p.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[ek])+ else:+ em.inputs[ek].default_value = s.default_value+ else:+ col.default_value = (0, 0, 0, 1)+ if out is not None:+ self.saved = _src(out.inputs["Surface"])+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ self.out = out+ self.tex = nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.added.append(self.tex)+ nt.nodes.active = self.tex++ def restore(self):+ nt = self.nt+ if self.out is not None:+ for l in list(self.out.inputs["Surface"].links):+ nt.links.remove(l)+ if self.saved is not None:+ nt.links.new(self.saved, self.out.inputs["Surface"])+ for n in self.added:+ nt.nodes.remove(n)+++class TargetOnly:+ """For the normal bake: keep the material, just add the active target image node."""++ def __init__(self, m, img):+ self.nt = m.node_tree+ self.tex = self.nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.nt.nodes.active = self.tex++ def restore(self):+ self.nt.nodes.remove(self.tex)+++def new_img(name, res, colorspace, is_float=False):+ old = bpy.data.images.get(name)+ if old:+ bpy.data.images.remove(old)+ w, h = (res, res) if isinstance(res, int) else res+ img = bpy.data.images.new(name, w, h, alpha=False, float_buffer=is_float)+ img.colorspace_settings.name = colorspace+ return img+++def save_png(img, path):+ img.filepath_raw = path+ img.file_format = "PNG"+ img.save()+++def bake_channel(o, mats, channel, res, path):+ cs = {"base": "sRGB", "orm": "Non-Color", "emit": "Linear Rec.709", "normal": "Non-Color"}[channel]+ img = new_img("__bake_" + channel, res, cs, is_float=(channel == "emit"))+ rw = []+ try:+ seen = set()+ for m in mats:+ if m is None or m.name in seen or m.node_tree is None:+ continue+ seen.add(m.name)+ rw.append(TargetOnly(m, img) if channel == "normal" else Rewire(m, channel, img))+ run_bake(o, "NORMAL" if channel == "normal" else "EMIT")+ finally:+ for r in rw:+ r.restore()+ scale = 1.0+ if channel == "emit":+ w, h = (res, res) if isinstance(res, int) else res+ px = np.empty(w * h * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mx = float(np.percentile(px.max(axis=1), 99.95)) if px.size else 0.0+ scale = max(mx, 1e-6)+ out = bpy.data.images.new("__emit_png", w, h, alpha=False)+ out.colorspace_settings.name = "sRGB"+ q = np.ones((w * h, 4), np.float32)+ q[:, :3] = np.clip(px / scale, 0, 1)+ out.pixels.foreach_set(q.ravel())+ save_png(out, path)+ bpy.data.images.remove(out)+ else:+ save_png(img, path)+ bpy.data.images.remove(img)+ return scale+++def uv_stats(me, name):+ """UV coords of a layer and the fraction of the 0..1 square its triangles cover."""+ uvl = me.uv_layers[name]+ uv = np.empty(len(me.loops) * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ me.calc_loop_triangles()+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ return uv, float(a.sum())+++def uv_world_scale(o, me, uv):+ """Area-weighted mean world length (m) of one UV unit along u and along v (per-loop uv array, n x 2)."""+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3) @ np.array(o.matrix_world.to_3x3()).T+ me.calc_loop_triangles()+ nt = len(me.loop_triangles)+ if nt == 0:+ return 0.0, 0.0+ vt = np.empty(nt * 3, np.int32)+ lt = np.empty(nt * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ me.loop_triangles.foreach_get("loops", lt)+ P = co[vt.reshape(-1, 3)].astype(np.float64)+ T = uv[lt.reshape(-1, 3)].astype(np.float64)+ e1, e2 = P[:, 1] - P[:, 0], P[:, 2] - P[:, 0]+ d1, d2 = T[:, 1] - T[:, 0], T[:, 2] - T[:, 0]+ det = d1[:, 0] * d2[:, 1] - d2[:, 0] * d1[:, 1]+ ok = np.abs(det) > 1e-12+ if not ok.any():+ return 0.0, 0.0+ e1, e2, d1, d2, det = e1[ok], e2[ok], d1[ok], d2[ok], det[ok][:, None]+ dpdu = (e1 * d2[:, 1:2] - e2 * d1[:, 1:2]) / det+ dpdv = (e2 * d1[:, 0:1] - e1 * d2[:, 0:1]) / det+ w = 0.5 * np.linalg.norm(np.cross(e1, e2), axis=1)+ if w.sum() <= 0:+ return 0.0, 0.0+ return float((np.linalg.norm(dpdu, axis=1) * w).sum() / w.sum()), float((np.linalg.norm(dpdv, axis=1) * w).sum() / w.sum())+++def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+ empty square one. Returns (uv name, kept, aspect w/h, uv coverage)."""+ me = me_owner.data+ if "bake" in me.uv_layers:+ me.uv_layers.active = me.uv_layers["bake"]+ return "bake", False, me_owner.get("_bake_aspect", 1.0), me_owner.get("_bake_cov", 0.5)+ me.calc_loop_triangles()+ if uv_ok(me):+ ar = render_uv(me)+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)+ uvl = me.uv_layers.new(name="bake")+ if ar is not None:+ ar.active_render = True # keep materials reading their original UVs+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ vl.objects.active = me_owner+ me_owner.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ bpy.ops.mesh.select_all(action="SELECT")+ bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=False)+ try:+ bpy.ops.uv.select_all(action="SELECT")+ bpy.ops.uv.pack_islands(rotate=True, margin=0.003, shape_method="AABB", scale=True)+ except Exception as ex: # noqa: BLE001+ log("pack_islands failed", me_owner.name, ex)+ bpy.ops.object.mode_set(mode="OBJECT")+ me_owner.select_set(False)+ uv, _ = uv_stats(me, "bake")+ lo, hi = uv.min(axis=0), uv.max(axis=0)+ span = np.maximum(hi - lo, 1e-6)+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+ # smart_project unwraps in object-local space, so a non-uniformly scaled object (a unit plane scaled to a 4.2 x 2.1 m+ # display) gets islands whose UV proportions are not its world proportions, and the span ratio above was 1:16 for a+ # 2:1 quad (512 x 4096 texture: 1/4 the texels across the short side). Pick W:H from the world-space length of one+ # UV unit along u and v instead, so texels come out square on the real surface.+ su, sv = uv_world_scale(me_owner, me, uv)+ if su > 0 and sv > 0:+ aspect = su / sv+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+++def bake_size(area, cov, aspect, kept):+ """Texture W,H so texel density is ~DENSITY px/m over the real surface; power of two, clamped."""+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4 # big architecture: coarser texels+ px = d * d * area / cov+ lo = 1024 if kept else 32+ w = pow2(math.sqrt(px * aspect), lo, MAX_RES)+ h = pow2(math.sqrt(px / aspect), lo, MAX_RES)+ if kept:+ w = h = min(max(w, h), 2048) # generated props: their own atlas, 1-2K+ return w, h+++# ------------------------------------------------------------------ bake cache (content hashes)++# Any edit to this file changes every hash: a cached bake is only reused by the exact code that made it.+CODE_SIG = hashlib.sha256(open(__file__, "rb").read()).hexdigest()[:16] if "__file__" in globals() else "nofile"+_UI_PROPS = {"rna_type", "name", "label", "location", "location_absolute", "width", "width_hidden", "height",+ "dimensions", "select", "show_options", "show_preview", "show_texture", "hide", "use_custom_color",+ "color", "parent", "inputs", "outputs", "internal_links", "warning_propagation", "color_tag"}+_SIGS = {}+++def _val(v, depth=0):+ """A deterministic, address-free description of an RNA value (node property or socket default)."""+ if v is None or isinstance(v, (bool, int, str)):+ return v+ if isinstance(v, float):+ return round(v, 6)+ if isinstance(v, bpy.types.Image):+ return ("image", image_sig(v))+ if isinstance(v, bpy.types.NodeTree):+ return ("tree", tree_sig(v))+ if isinstance(v, bpy.types.ColorRamp):+ return ("ramp", v.color_mode, v.interpolation, v.hue_interpolation,+ [(round(e.position, 6), _val(tuple(e.color))) for e in v.elements])+ if isinstance(v, bpy.types.CurveMapping):+ return ("curves", _val(tuple(v.black_level)), _val(tuple(v.white_level)), v.extend,+ [[(_val(tuple(p.location)), p.handle_type) for p in c.points] for c in v.curves])+ if isinstance(v, bpy.types.ID):+ return ("id", type(v).__name__, v.name)+ if isinstance(v, bpy.types.bpy_struct):+ return ("struct", struct_sig(v, depth + 1)) if depth < 3 else ("struct", type(v).__name__)+ try:+ return tuple(_val(x, depth) for x in v)+ except TypeError:+ return type(v).__name__+++def struct_sig(st, depth=0):+ out = []+ for p in st.bl_rna.properties:+ k = p.identifier+ if k in _UI_PROPS or k.startswith("bl_") or p.type == "COLLECTION":+ continue+ try:+ out.append((k, _val(getattr(st, k), depth)))+ except Exception: # noqa: BLE001 (write-only / context-dependent properties)+ pass+ return out+++def image_sig(img):+ key = ("img", img.as_pointer())+ if key not in _SIGS:+ h = hashlib.sha256(repr((img.source, tuple(img.size), img.colorspace_settings.name, img.alpha_mode)).encode())+ if img.packed_file:+ h.update(img.packed_file.data)+ elif img.source == "FILE" and os.path.exists(bpy.path.abspath(img.filepath)):+ with open(bpy.path.abspath(img.filepath), "rb") as f:+ h.update(f.read())+ elif img.source == "GENERATED":+ h.update(repr((img.generated_type, img.generated_width, img.generated_height,+ _val(tuple(img.generated_color)))).encode())+ else:+ h.update(img.filepath.encode())+ _SIGS[key] = h.hexdigest()[:24]+ return _SIGS[key]+++def tree_sig(nt):+ key = ("tree", nt.as_pointer()) # embedded material trees all share one name+ if key not in _SIGS:+ _SIGS[key] = "cycle" # a group that (somehow) contains itself+ nodes = []+ for n in sorted(nt.nodes, key=lambda n: n.name):+ ins = [(i.identifier, i.is_linked, None if i.is_linked or not hasattr(i, "default_value") else _val(i.default_value))+ for i in n.inputs]+ nodes.append((n.bl_idname, n.name, struct_sig(n), ins))+ links = sorted((l.from_node.name, l.from_socket.identifier, l.to_node.name, l.to_socket.identifier, l.is_muted)+ for l in nt.links)+ _SIGS[key] = hashlib.sha256(repr((nodes, links)).encode()).hexdigest()[:24]+ return _SIGS[key]+++def material_sig(m):+ if m is None:+ return None+ if m.node_tree is None:+ return ("plain", _val(tuple(m.diffuse_color)), round(m.roughness, 6), round(m.metallic, 6))+ return tree_sig(m.node_tree)+++_ATTR = {"FLOAT": (1, np.float32, "value"), "INT": (1, np.int32, "value"), "FLOAT_VECTOR": (3, np.float32, "vector"),+ "FLOAT_COLOR": (4, np.float32, "color"), "BYTE_COLOR": (4, np.float32, "color"), "BOOLEAN": (1, bool, "value"),+ "FLOAT2": (2, np.float32, "vector"), "INT8": (1, np.int32, "value"), "INT32_2D": (2, np.int32, "value"),+ "QUATERNION": (4, np.float32, "value")}+++def mesh_sig(me):+ """Hash of the (evaluated) mesh: topology, every attribute (positions, UVs, colours, materials, sharpness) and the+ corner normals the tangent-space normal bake and the GLB normals come from."""+ h = hashlib.sha256()+ a = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("loop_start", a)+ h.update(a.tobytes())+ for at in sorted(me.attributes, key=lambda x: x.name):+ h.update(repr((at.name, at.domain, at.data_type, len(at.data))).encode())+ spec = _ATTR.get(at.data_type)+ if spec is None:+ continue+ k, dt, prop = spec+ buf = np.empty(len(at.data) * k, dt)+ try:+ at.data.foreach_get(prop, buf)+ except Exception: # noqa: BLE001+ buf = np.array([getattr(d, prop) for d in at.data], dtype=dt)+ h.update(buf.tobytes())+ for l in me.uv_layers:+ h.update(repr((l.name, l.active, l.active_render)).encode())+ try:+ cn = np.empty(len(me.loops) * 3, np.float32)+ me.corner_normals.foreach_get("vector", cn)+ h.update(np.round(cn, 5).tobytes())+ except Exception: # noqa: BLE001+ pass+ return h.hexdigest()+++def asset_hash(rep, ev, mats):+ """Content key of one exported asset (GLB + texture set + meta): evaluated mesh, materials, world-space scale+ (texel density), bake settings, Blender version and this exporter. Materials that read the object they sit on+ (Object Info, object coordinates, object attributes, ...) also key on that representative object."""+ h = hashlib.sha256(repr((CODE_SIG, bpy.app.version_string, DENSITY, MAX_RES, FRAME)).encode())+ h.update(mesh_sig(ev).encode())+ h.update(repr([material_sig(m) for m in mats]).encode())+ h.update(repr([round(x, 5) for r in rep.matrix_world.to_3x3() for x in r]).encode())+ if any(uses_object_dependence(m) for m in mats if m):+ h.update(repr((rep.name, [round(x, 5) for r in rep.matrix_world for x in r], object_attr_values(rep),+ _val(tuple(rep.color)), rep.pass_index)).encode())+ return h.hexdigest()[:32]+++def cache_dir(h):+ return os.path.join(CACHE, h[:2], h)+++def _cache_files(an):+ """Cache file name -> path in --out for asset `an`."""+ files = {"mesh.glb": os.path.join(OUT, "mesh", an + ".glb"), "meta.json": os.path.join(OUT, "mesh", an + ".json"),+ "emit.png.json": os.path.join(OUT, "tex", f"{an}_emit.png.json")}+ for c in ("base", "orm", "normal", "emit"):+ files[c + ".png"] = os.path.join(OUT, "tex", f"{an}_{c}.png")+ return files+++def cache_fetch(h, an):+ d = cache_dir(h)+ if not os.path.exists(os.path.join(d, "ready")):+ return False+ for name, dst in _cache_files(an).items():+ src = os.path.join(d, name)+ if not os.path.exists(src):+ continue+ if os.path.lexists(dst):+ os.remove(dst)+ if LINK_CACHE:+ os.symlink(src, dst)+ else:+ shutil.copyfile(src, dst)+ return True+++def cache_store(h, an):+ """Copy a finished asset into the cache: written to a temp dir, then renamed into place (concurrent writers race+ harmlessly; the first rename wins)."""+ d = cache_dir(h)+ if os.path.exists(os.path.join(d, "ready")):+ return+ tmp = f"{d}.tmp{os.getpid()}"+ shutil.rmtree(tmp, ignore_errors=True)+ os.makedirs(tmp)+ for name, src in _cache_files(an).items():+ if os.path.exists(src):+ shutil.copyfile(src, os.path.join(tmp, name))+ open(os.path.join(tmp, "ready"), "w").write(an)+ try:+ os.rename(tmp, d)+ except OSError:+ shutil.rmtree(tmp, ignore_errors=True)+ if not os.path.exists(os.path.join(d, "ready")):+ raise+++# ------------------------------------------------------------------ export++def to_mesh_object(o):+ """Text/curve objects -> real mesh objects (evaluated) in a scratch collection; originals hidden."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ n = bpy.data.objects.new(o.name + "__mesh", me)+ c = bpy.data.collections.get("__converted") or bpy.data.collections.new("__converted")+ if c.name not in sc.collection.children:+ sc.collection.children.link(c)+ c.objects.link(n)+ n.matrix_world = o.matrix_world.copy()+ for k in ("visible_shadow", "visible_camera", "visible_glossy", "visible_diffuse"):+ setattr(n, k, getattr(o, k))+ o.hide_render = True+ return n+++def export_glb(o, uv_name, glass_slots, path):+ """Evaluated mesh at identity with only the bake UV; slots: 0 = baked, 1+ = each glass material."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ for l in [l for l in me.uv_layers if l.name != uv_name]:+ me.uv_layers.remove(l)+ if len(me.uv_layers):+ me.uv_layers[0].name = "UVMap"+ gl = list(glass_slots)+ mi = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("material_index", mi)+ remap = np.zeros(max(len(o.material_slots), 1), np.int32)+ for i in range(len(o.material_slots)):+ remap[i] = gl.index(i) + 1 if i in gl else 0+ mi = remap[np.clip(mi, 0, len(remap) - 1)]+ me.polygons.foreach_set("material_index", mi)+ me.materials.clear()+ base = bpy.data.materials.get("BAKED") or bpy.data.materials.new("BAKED")+ me.materials.append(base)+ for k, gi in enumerate(gl):+ gm = bpy.data.materials.get(f"GLASS_{k}") or bpy.data.materials.new(f"GLASS_{k}")+ me.materials.append(gm)+ tmp = bpy.data.objects.new("__export", me)+ sc.collection.objects.link(tmp)+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ tmp.select_set(True)+ vl.objects.active = tmp+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_apply=True,+ export_materials="PLACEHOLDER", export_texcoords=True, export_normals=True,+ export_tangents=True, export_yup=True, export_animations=False,+ export_cameras=False, export_lights=False, export_extras=False)+ bpy.data.objects.remove(tmp)+ bpy.data.meshes.remove(me)+++# ------------------------------------------------------------------ volumes++def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+ m = next((m for m in o.data.materials if m and is_volume_only(m)), None)+ if m is None:+ return None+ pv = next((nd for nd in m.node_tree.nodes if nd.type == "PRINCIPLED_VOLUME"), None)+ if pv is None:+ return None+ me0 = o.data+ xs = [v.co.x for v in me0.vertices]+ ys = [v.co.y for v in me0.vertices]+ zs = [v.co.z for v in me0.vertices]+ lo, hi = Vector((min(xs), min(ys), min(zs))), Vector((max(xs), max(ys), max(zs)))+ res = {"levels": [], "density": [], "emission": [], "emission_color": None}+ for f in levels:+ z = lo.z + f * (hi.z - lo.z)+ me = bpy.data.meshes.new("__slice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__slice", me)+ sc.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ out = output_node(nt)+ for l in list(out.inputs["Volume"].links):+ nt.links.remove(l)+ vals = {}+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ em = nt.nodes.new("ShaderNodeEmission")+ s = pvc.inputs[sock]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ img = new_img("__vol", n, "Non-Color", is_float=True)+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ bs = bake_scene()+ bs.collection.objects.link(sl)+ try:+ run_bake(sl, "EMIT")+ finally:+ bs.collection.objects.unlink(sl)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ vals[key] = float(px.reshape(-1, 4)[:, 0].mean())+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ res["levels"].append(f)+ res["density"].append(vals["density"])+ res["emission"].append(vals["emission"])+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ c = pv.inputs["Color"].default_value+ res["albedo"] = [c[0], c[1], c[2]]+ res["anisotropy"] = pv.inputs["Anisotropy"].default_value+ ec = pv.inputs["Emission Color"]+ if ec.is_linked:+ # Sample the colour ramp if it is one (flame): mid-height colour as a representative.+ n0 = ec.links[0].from_node+ if n0.type == "VALTORGB":+ res["emission_color"] = list(n0.color_ramp.evaluate(0.6))[:3]+ else:+ res["emission_color"] = list(ec.default_value)[:3]+ mw = o.matrix_world+ corners = [mw @ Vector((x, y, z)) for x in (lo.x, hi.x) for y in (lo.y, hi.y) for z in (lo.z, hi.z)]+ wlo = Vector([min(c[i] for c in corners) for i in range(3)])+ whi = Vector([max(c[i] for c in corners) for i in range(3)])+ res["bounds_ue"] = {"center": ue_vec((wlo + whi) / 2), "extent": [(whi.x - wlo.x) * 50, (whi.y - wlo.y) * 50, (whi.z - wlo.z) * 50]}+ res["bounds_m"] = {"lo": list(wlo), "hi": list(whi)}+ res["material"] = m.name+ res["animated"] = animated(m)+ return res+++# ------------------------------------------------------------------ lights / cameras / world / grade++def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+ mx = max(col) or 1.0+ P = L.energy+ e = {"name": o.name, "type": L.type, "color": [c / mx for c in col], "energy_w": P,+ "cast_shadows": bool(getattr(L, "use_shadow", True)),+ "specular": 1.0 if getattr(o, "visible_glossy", True) else 0.0,+ "diffuse": 1.0 if getattr(o, "visible_diffuse", True) else 0.0,+ "volume": 1.0 if getattr(o, "visible_volume_scatter", True) else 0.0,+ "loc": ue_vec(o.matrix_world.translation), "animated": bool(L.animation_data and (L.animation_data.drivers or L.animation_data.action))}+ f, u = ue_axes(o.matrix_world)+ e["forward"], e["up"] = f, u+ k = mx # colour normalisation folds into intensity+ if L.type in ("POINT", "SPOT"):+ e["candela"] = LM_PER_W * P * k / (4 * math.pi)+ e["source_radius"] = L.shadow_soft_size * 100+ e["soft_falloff"] = bool(getattr(L, "use_soft_falloff", True))+ if L.type == "SPOT":+ outer = math.degrees(L.spot_size) / 2+ e["outer_cone"] = min(outer, 80.0)+ e["inner_cone"] = outer * (1 - L.spot_blend)+ if outer > 80:+ e["note"] = f"spot cone {outer * 2:.0f} deg > Unreal max 160: clamped"+ elif L.type == "AREA":+ e["candela"] = LM_PER_W * P * k / math.pi+ e["shape"] = L.shape+ sx = L.size+ sy = L.size_y if L.shape in ("RECTANGLE", "ELLIPSE") else L.size+ sxx, syy, _ = o.matrix_world.to_scale()+ e["width"], e["height"] = sx * sxx * 100, sy * syy * 100+ e["spread_deg"] = math.degrees(getattr(L, "spread", math.pi))+ elif L.type == "SUN":+ e["lux"] = LM_PER_W * P * k+ e["angle_deg"] = math.degrees(L.angle)+ # IES / gobo: node-based light textures.+ if L.use_nodes and L.node_tree:+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+++def camera_entry(o):+ c = o.data+ f, u = ue_axes(o.matrix_world)+ rx, ry = sc.render.resolution_x, sc.render.resolution_y+ sw = c.sensor_width if c.sensor_fit in ("AUTO", "HORIZONTAL") else c.sensor_height * rx / ry+ d = {"name": o.name, "type": c.type, "lens_mm": c.lens, "sensor_width_mm": sw, "sensor_height_mm": sw * ry / rx,+ "sensor_fit": c.sensor_fit, "shift": [c.shift_x, c.shift_y], "clip": [c.clip_start * 100, c.clip_end * 100],+ "loc": ue_vec(o.matrix_world.translation), "forward": f, "up": u,+ "dof": {"enabled": c.dof.use_dof, "focus_cm": c.dof.focus_distance * 100, "fstop": c.dof.aperture_fstop,+ "blades": c.dof.aperture_blades, "focus_object": c.dof.focus_object.name if c.dof.focus_object else None}}+ if o.name in DOF:+ fd, fs = DOF[o.name]+ d["dof"].update(enabled=True, focus_cm=fd * 100, fstop=fs, source="--dof override (stills script)")+ return d+++def world_bake(path, w=2048, h=1024, spp=32):+ ws = bpy.data.scenes.new("__world")+ ws.world = sc.world+ ws.render.engine = "CYCLES"+ ws.cycles.device = "CPU"+ ws.cycles.samples = spp+ ws.render.resolution_x, ws.render.resolution_y, ws.render.resolution_percentage = w, h, 100+ ws.view_settings.view_transform = "Standard"+ ws.render.image_settings.file_format = "OPEN_EXR"+ ws.render.image_settings.color_depth = "16"+ cd = bpy.data.cameras.new("__pano")+ cd.type = "PANO"+ try:+ cd.panorama_type = "EQUIRECTANGULAR"+ except Exception:+ cd.cycles.panorama_type = "EQUIRECTANGULAR"+ co = bpy.data.objects.new("__pano", cd)+ ws.collection.objects.link(co)+ co.rotation_euler = (math.radians(90), 0, math.radians(-90)) # looking +X? (equirect centre = -Y in Blender -> fixed below)+ co.rotation_euler = (math.radians(90), 0, 0)+ ws.camera = co+ ws.render.filepath = path+ with bpy.context.temp_override(scene=ws):+ bpy.ops.render.render(write_still=True, scene=ws.name)+ # mean radiance for the sky light estimate+ img = bpy.data.images.load(path)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mean = px.mean(axis=0).tolist()+ bpy.data.images.remove(img)+ return {"equirect_exr": path, "mean_radiance": mean, "camera_note": "equirect centre looks along Blender +Y"}+++def compositor_nodes():+ # 5.0: compositing_node_group; Scene.node_tree is gone (use_nodes can still read True with no tree).+ tree = getattr(sc, "compositing_node_group", None) or getattr(sc, "node_tree", None)+ if tree is None:+ return []+ out = []+ for n in tree.nodes:+ d = {"type": n.bl_idname, "name": n.name, "inputs": {}}+ for i in n.inputs:+ if i.is_linked or not hasattr(i, "default_value"):+ continue+ v = i.default_value+ try:+ v = v if isinstance(v, str) else list(v)+ except TypeError:+ pass+ if isinstance(v, (int, float, str, list, bool)):+ d["inputs"][i.name] = v+ for k in ("glare_type", "quality", "blend_type"):+ if hasattr(n, k):+ d[k] = getattr(n, k)+ out.append(d)+ return out+++def ffmpeg_grade(grade_sh):+ """Pull GRADE="..." out of a scene's grade.sh; split into colour (LUT-able) and spatial filters."""+ txt = open(grade_sh, encoding="utf-8").read()+ m = re.search(r'GRADE="([^"]+)"', txt)+ if not m:+ return None+ filters = [f for f in m.group(1).split(",") if f]+ colour = [f for f in filters if f.split("=")[0] in ("curves", "hue", "eq", "colorbalance", "colorchannelmixer", "lutrgb", "colortemperature")]+ spatial = [f for f in filters if f not in colour]+ g = {"source": grade_sh, "filter": m.group(1), "colour": colour, "spatial": spatial}+ for f in spatial:+ if f.startswith("vignette"):+ a = re.search(r"angle=PI/([\d.]+)", f)+ g["vignette_angle_rad"] = math.pi / float(a.group(1)) if a else math.pi / 5+ if f.startswith("rgbashift"):+ g["chromatic_px"] = 1+ noise = re.search(r"noise=alls=(\d+)", txt)+ if noise:+ g["grain_strength"] = int(noise.group(1))+ return g+++def make_lut(colour_filters, path):+ """UE colour grading LUT (256x16, 16 slices of 16x16; R across a slice, G down, B by slice), with the ffmpeg+ colour filters applied. Unreal applies it after the tone curve, i.e. in display space, like ffmpeg on the PNG."""+ n = 16+ ident = os.path.join(os.path.dirname(path), "lut_identity.png")+ img = bpy.data.images.new("__lut", n * n, n, alpha=False)+ img.colorspace_settings.name = "Non-Color"+ px = np.zeros((n, n * n, 4), np.float32)+ for b in range(n):+ for g in range(n):+ for r in range(n):+ px[g, b * n + r] = (r / (n - 1), g / (n - 1), b / (n - 1), 1)+ # Blender rows go bottom-up; UE LUT row 0 (top) is G=0.+ img.pixels.foreach_set(px[::-1].ravel())+ save_png(img, ident)+ bpy.data.images.remove(img)+ if not colour_filters:+ return ident+ cmd = [FFMPEG, "-v", "error", "-y", "-i", ident, "-vf", ",".join(colour_filters), "-frames:v", "1", path]+ try:+ r = subprocess.run(cmd, capture_output=True, text=True)+ except OSError as ex:+ log("LUT ffmpeg not runnable (pass --ffmpeg or set FFMPEG):", FFMPEG, ex)+ return ident+ if r.returncode != 0:+ log("LUT ffmpeg failed:", r.stderr[:300])+ return ident+ return path+++# ------------------------------------------------------------------ main++def write_plan(keys, assets, names, report, n_objs, t0):+ """Plan pass: every asset's name, content hash and estimated bake cost (pixels x channels), for sharding."""+ dg = bpy.context.evaluated_depsgraph_get()+ rows = []+ for k in keys:+ rep = assets[k][0]+ mats = [s.material for s in rep.material_slots]+ bake_mats = [m for m in mats if m and not is_glass(m)]+ ev = rep.evaluated_get(dg).data+ area = surface_area(rep, ev)+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4+ px = min(d * d * area / 0.6, MAX_RES * MAX_RES) if bake_mats else 0+ nch = (2 + any(perturbs_normal(m) for m in bake_mats) + any(emissive(m) for m in bake_mats)) if bake_mats else 0+ rows.append({"key": k, "asset": names[k], "hash": asset_hash(rep, ev, mats), "tris": tri_count(ev),+ "area_m2": round(area, 3), "est_px": int(px * nch), "channels": nch, "instances": len(assets[k]),+ "object_dependent": sorted({x for m in bake_mats for x in uses_object_dependence(m)})})+ plan = {"source": SRC, "frame": FRAME, "density": DENSITY, "max_res": MAX_RES, "code": CODE_SIG,+ "blender": bpy.app.version_string, "objects": n_objs, "assets": rows,+ "placements": sum(r["instances"] for r in rows), "volumes": sorted(report["volumes"]),+ "skipped": report["skipped"], "converted": report["converted"], "plan_s": round(time.time() - t0, 1)}+ json.dump(plan, open(PLAN_OUT, "w", encoding="utf-8"), indent=1)+ log(f"plan written {PLAN_OUT}: {len(rows)} assets, {plan['placements']} placements, "+ f"{sum(r['est_px'] for r in rows) / 1e6:.0f} Mpx to bake, in {plan['plan_s']}s")+++def main():+ t0 = time.time()+ srcs, emitters = particle_instancers()+ report = {"skipped": [], "converted": [], "volumes": {}, "fx": [], "warnings": []}+ objs = []+ for o in list(sc.objects):+ if o.hide_render or not o.visible_get():+ if o.type in ("MESH", "FONT", "CURVE") and not o.hide_render:+ pass+ if o.hide_render:+ continue+ if o.name in srcs:+ report["skipped"].append([o.name, "particle instance source (exported as fx note)"])+ continue+ if o.name in emitters:+ st = [md.particle_system.settings for md in o.modifiers if md.type == "PARTICLE_SYSTEM"]+ report["fx"].append({"name": o.name, "kind": "particles", "count": sum(s.count for s in st),+ "instance": [s.instance_object.name if s.instance_object else None for s in st],+ "lifetime": [s.lifetime for s in st], "velocity": [list(s.object_align_factor) for s in st]})+ if not o.show_instancer_for_render:+ continue+ if o.type in ("FONT", "CURVE", "SURFACE", "META"):+ if o.type == "CURVE" and o.data.bevel_depth == 0 and not o.data.bevel_object and o.data.extrude == 0:+ report["skipped"].append([o.name, "curve without geometry"])+ continue+ n = to_mesh_object(o)+ report["converted"].append([o.name, o.type])+ objs.append(n)+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):+ if PLAN_OUT or KEYS: # sampled by the merge pass only+ report["volumes"][o.name] = None+ continue+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+ log("volume", o.name, [round(x, 4) for x in v["density"]], [round(x, 2) for x in v["emission"]])+ continue+ objs.append(o)+ # Group by unique mesh.+ assets = {}+ for o in objs:+ k = mesh_key(o)+ assets.setdefault(k, []).append(o)+ keys = sorted(assets, key=lambda k: assets[k][0].name, reverse=REVERSE)+ if ONLY:+ keys = [k for k in keys if any(o.name in ONLY or o.name.split("__")[0] in ONLY for o in assets[k])]+ if LIMIT:+ keys = keys[:LIMIT]+ # Asset names over the whole key list (the same in every shard), or the plan's.+ names, used = {}, set()+ for ai, k in enumerate(keys):+ rep = assets[k][0]+ an = safe(rep.data.name if k.startswith("m_") else rep.name)+ an = f"{an}_{ai:03d}" if an in used else an+ used.add(an)+ names[k] = an+ if KEYS:+ want = set(json.load(open(KEYS, encoding="utf-8")))+ keys = [k for k in keys if k in want]+ hashes = {}+ if PLAN:+ plan = json.load(open(PLAN, encoding="utf-8"))+ for row in plan["assets"]:+ if row["key"] in names:+ names[row["key"]], hashes[row["key"]] = row["asset"], row["hash"]+ missing = [k for k in keys if k not in hashes]+ if missing:+ log(f"WARNING {len(missing)} asset keys are not in the plan (hashed here): {missing[:5]}")+ if PLAN_OUT:+ write_plan(keys, assets, names, report, len(objs), t0)+ return+ log(f"{len(objs)} mesh objects -> {len(assets)} unique meshes; exporting {len(keys)}")+ entries, placements, shard = [], [], []+ for ai, k in enumerate(keys):+ group = assets[k]+ rep = group[0]+ an = names[k]+ mats = [s.material for s in rep.material_slots]+ glass = [i for i, m in enumerate(mats) if m and is_glass(m)]+ bake_mats = [m for i, m in enumerate(mats) if i not in glass]+ dg = bpy.context.evaluated_depsgraph_get()+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+ # Material sections the GLB really has, in order (0 = baked, k+1 = glass k). glTF drops unused materials, so an+ # all-glass pane has one section, the glass one; build_level used to give it the baked (opaque) material.+ mi_ = np.empty(len(ev.polygons), np.int32)+ ev.polygons.foreach_get("material_index", mi_)+ sect = sorted({(glass.index(int(i)) + 1) if int(i) in glass else 0 for i in np.unique(mi_)}) if len(mi_) else [0]+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+ meta = glb[:-4] + ".json"+ done = os.path.exists(glb) # written after every bake of the asset succeeded+ h = (hashes.get(k) or asset_hash(rep, ev, mats)) if CACHE else None+ cached = bool(h) and not done and cache_fetch(h, an)+ done = done or cached+ if done:+ # Resume: skip the UV unwrap (an edit-mode smart_project per asset). Blender 5.0.1's bake crashes+ # (OpenImageIO ustring::operator= in ccl::create_mesh) after a few hundred unwrap+bake cycles in one+ # process; re-unwrapping every finished asset on resume made it crash at the same asset every time.+ m0 = json.load(open(meta)) if os.path.exists(meta) else {}+ uv_name, kept, cov, res = None, m0.get("uv") == "kept", m0.get("uv_coverage", 0.0), m0.get("res", [0, 0])+ else:+ uv_name, kept, aspect, cov = ensure_bake_uv(rep, rep)+ res = bake_size(area, cov, aspect, kept)+ e = {"asset": an, "key": k, "tris": tris, "area_m2": round(area, 3), "uv": "kept" if kept else "smart_project",+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera), "sections": sect}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+ bake_scene().collection.objects.link(rep)+ try:+ bake_channel(rep, bake_mats, "base", res, p["base"])+ bake_channel(rep, bake_mats, "orm", res, p["orm"])+ if any(m and perturbs_normal(m) for m in bake_mats):+ bake_channel(rep, bake_mats, "normal", res, p["normal"])+ if any(m and emissive(m) for m in bake_mats):+ s = bake_channel(rep, bake_mats, "emit", res, p["emit"])+ json.dump({"scale": s}, open(p["emit"] + ".json", "w"))+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+ e["tex"] = {c: os.path.relpath(v, OUT) for c, v in p.items() if os.path.exists(v)}+ if not os.path.exists(glb):+ export_glb(rep, uv_name, glass, glb)+ if not done:+ json.dump({"res": list(res), "uv": e["uv"], "uv_coverage": e["uv_coverage"]}, open(meta, "w"))+ e["glb"] = os.path.relpath(glb, OUT)+ # Local bounds in Unreal axes for the importer orientation check.+ bb = [Vector(c) for c in rep.bound_box]+ e["check_bounds"] = {"min": ue_vec(Vector([min(c[i] for c in bb) for i in range(3)])),+ "max": ue_vec(Vector([max(c[i] for c in bb) for i in range(3)]))}+ e["bake_s"] = round(time.time() - t1, 1)+ if h:+ e["hash"] = h+ if not cached and not (NO_BAKE and bake_mats): # never cache an unbaked (texture-less) asset+ cache_store(h, an)+ shard.append({"key": k, "asset": an, "hash": h, "cached": cached, "bake_s": e["bake_s"]})+ entries.append(e)+ for o in group:+ placements.append({"name": o.name, "asset": an, **ue_xform(o.matrix_world),+ "shadow": bool(o.visible_shadow), "camera_visible": bool(o.visible_camera)})+ log(f"[{ai + 1}/{len(keys)}] {an} tris={tris} res={res} uv={e['uv']} inst={len(group)} {e['bake_s']}s"+ + (" (cache)" if cached else ""))+ if KEYS:+ json.dump(shard, open(os.path.join(OUT, f"shard_{os.path.basename(KEYS)}"), "w"), indent=1)+ log(f"shard done: {len(shard)} assets ({sum(r['cached'] for r in shard)} from cache) in {time.time() - t0:.0f}s")+ return+ # Lights, cameras, world, grade.+ lights = [light_entry(o) for o in sc.objects if o.type == "LIGHT" and not o.hide_render]+ cams = [camera_entry(o) for o in sc.objects if o.type == "CAMERA"]+ world = None+ wpath = os.path.join(OUT, "world", "sky.exr")+ if sc.world:+ world = world_bake(wpath) if not os.path.exists(wpath) or "--rebake-world" in argv else {"equirect_exr": wpath}+ if "mean_radiance" not in world:+ img = bpy.data.images.load(wpath)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ world["mean_radiance"] = px.reshape(-1, 4)[:, :3].mean(axis=0).tolist()+ bpy.data.images.remove(img)+ world["equirect_exr"] = os.path.relpath(wpath, OUT)+ world["nits_scale"] = LM_PER_W+ vs = sc.view_settings+ grade = {"view_transform": vs.view_transform, "look": vs.look, "exposure": vs.exposure, "gamma": vs.gamma,+ "use_curve_mapping": vs.use_curve_mapping,+ "ev100": math.log2(LM_PER_W / 1.2) - vs.exposure,+ "compositor": compositor_nodes(),+ "motion_blur": {"on": sc.render.use_motion_blur, "shutter": sc.render.motion_blur_shutter},+ "resolution": [sc.render.resolution_x, sc.render.resolution_y], "fps": sc.render.fps}+ if vs.use_curve_mapping:+ grade["curves"] = [[(p.location[0], p.location[1]) for p in c.points] for c in vs.curve_mapping.curves]+ if GRADE_SH and os.path.exists(GRADE_SH):+ g = ffmpeg_grade(GRADE_SH)+ if g:+ g["lut"] = os.path.relpath(make_lut(g["colour"], os.path.join(OUT, "grade", "lut_grade.png")), OUT)+ grade["ffmpeg"] = g+ scene = {"source": SRC, "frame": FRAME, "units": "unreal cm, X fwd, Y right, Z up", "lm_per_w": LM_PER_W,+ "assets": entries, "placements": placements, "lights": lights, "cameras": cams, "world": world,+ "volumes": report["volumes"], "fx": report["fx"], "grade": grade,+ "skipped": report["skipped"], "converted": report["converted"], "export_s": round(time.time() - t0)}+ jp = os.path.join(OUT, "scene.json")+ if os.path.exists(jp) and (ONLY or LIMIT):+ old = json.load(open(jp, encoding="utf-8"))+ have = {e["asset"] for e in entries}+ scene["assets"] = [e for e in old.get("assets", []) if e["asset"] not in have] + entries+ scene["placements"] = [p for p in old.get("placements", []) if p["asset"] not in have] + placements+ json.dump(scene, open(jp, "w", encoding="utf-8"), indent=1)+ log(f"wrote {jp}: {len(scene['assets'])} assets, {len(scene['placements'])} placements, {len(lights)} lights, "+ f"{len(cams)} cameras, {len(report['volumes'])} volumes in {time.time() - t0:.0f}s")+++main()diff --git a/unreal_fal/make_copy.py b/unreal_fal/make_copy.pynew file mode 100644index 0000000..0a0063e--- /dev/null+++ b/unreal_fal/make_copy.py@@ -0,0 +1,12 @@+"""Make a working copy of a scene .blend with all external paths absolute (a plain file copy breaks the scene's+//../../refs/... texture paths as soon as it lives in another folder). The source file is only read.+ blender -b scenes/<id>/<scene>.blend --python unreal/make_copy.py -- <out.blend>+"""+import sys+import bpy++out = sys.argv[sys.argv.index("--") + 1]+assert bpy.path.abspath(out) != bpy.data.filepath, "refusing to overwrite the source .blend"+bpy.ops.file.make_paths_absolute()+bpy.ops.wm.save_as_mainfile(filepath=out, copy=True, relative_remap=False, compress=False)+print("COPY", bpy.data.filepath, "->", out, flush=True)diff --git a/unreal_fal/render_shots.py b/unreal_fal/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal_fal/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_fal/side_by_side.py b/unreal_fal/side_by_side.pynew file mode 100644index 0000000..e55eddd--- /dev/null+++ b/unreal_fal/side_by_side.py@@ -0,0 +1,47 @@+"""Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.+"""+import os+import sys++from PIL import Image, ImageDraw, ImageFont++cyc, ue, out = sys.argv[1:4]+cams = (sys.argv[4] if len(sys.argv) > 4 else "street,table,wok").split(",")+os.makedirs(out, exist_ok=True)+H = 804+LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")+try:+ font = ImageFont.truetype("arial.ttf", 28)+except OSError:+ font = ImageFont.load_default()+++def fit(p):+ im = Image.open(p).convert("RGB")+ return im.resize((round(im.width * H / im.height), H), Image.LANCZOS)+++rows = []+for c in cams:+ a = fit(os.path.join(cyc, f"{c}_graded.png"))+ up = os.path.join(ue, f"cam_{c}.png")+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+ for x, t in ((12, f"Cycles graded {c}"), (a.width + 20, f"{LABEL} {c}")):+ d.rectangle([x - 6, 8, x + 360, 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)+ print("wrote", os.path.join(out, f"{c}.png"))+w = max(r.width for r in rows)+allim = Image.new("RGB", (w, sum(r.height for r in rows) + 8 * (len(rows) - 1)), (255, 255, 255))+y = 0+for r in rows:+ allim.paste(r, (0, y))+ y += r.height + 8+allim.resize((allim.width // 2, allim.height // 2), Image.LANCZOS).save(os.path.join(out, "all.png"))diff --git a/unreal_fal_ue/README.md b/unreal_fal_ue/README.mdnew file mode 100644index 0000000..ecd9f8c--- /dev/null+++ b/unreal_fal_ue/README.md@@ -0,0 +1,85 @@+# unreal_fal_ue: UE 5.8 headless on fal Serverless (`apek/unreal-build`)++Status (2026-11-02): **working end to end.** HK builds on fal and renders with MRQ. Against the local Windows MRQ+frames the result is near-identical: PSNR 47–50 dB and a mean difference of 0.25–0.36 out of 255.++## Endpoints (private app `apek/unreal-build`, GPU-RTX5090)+| route | in | out |+|---|---|---|+| `/smoke` | `{"render": true}` | engine version, GPU, Vulkan, and a lit-cube PNG rendered offscreen |+| `/build` | `{"export_url", "scene": "HK", "level", "stages", "nanite_tris", "exposure_offset"}` | `content_url` (zip of `Content/AnyScene/<scene>`, Config, uproject), `log_url`, `report` |+| `/render` | `{"content_url", "scene", "cameras": [...], "config": "MRQ_Still", "resolution": [1920,804], "frames": 1, "temporal_samples": 8, "warmup_frames": 64}` | per camera: PNG/EXR URLs, an MP4 when frames > 1, logs |++```+# PowerShell 5.1 strips quotes from arguments, so pass the args as @file.json. FAL_KEY comes from FAL_SERVERLESS_KEY.+python -I tools/call.py apek/unreal-build build @build_args.json build.json+python -I tools/call.py apek/unreal-build render @render_args.json render.json+python -I tools/fetch.py apek/unreal-build <request_id> out.json --wait # re-attach to a request after a local crash+```++## Measured on HK (2026-11-02)+- `/build`: 1514 s end to end, broken down as:+ - fetch and unzip of the 4.7 GB export: 163 s+ - UE commandlet: 1054 s (textures 263 s, meshes 629 s, materials 135 s)+ - zip: 230 s+ - upload: 47 s++ The content zip is 4.15 GB.+- `/render`, three cameras at 1920x804, 8 temporal samples and 64 warm-up frames: 1352 s, broken down as:+ - content fetch: 96 s+ - MRQ config: 17 s+ - `cam_street`: 1103 s, the first render, which compiles shaders into a cold DDC+ - `cam_table`: 64 s+ - `cam_wok`: 61 s+- Cold start, measured from zero runners to a new runner answering `/smoke {"render": false}`: 10.8 s. That node+ already had the image cached. A pull onto a node without the image couldn't be forced, so it is not measured;+ expect minutes for 24 GB.+- The shared DDC on `/data` persists across runners, so later renders on any runner skip most shader compiles.+- Cost: an RTX 5090 is $0.000694/s, about $2.50/h. A warm runner (`min_concurrency=1`) costs about $60 a day.+ The app is now scaled to `min_concurrency=0` and `keep_alive=300`. To warm it again:+ `fal apps scale unreal-build --min-concurrency 1 --keep-alive 3600`.++## Container+- The base image is `ghcr.io/epicgames/unreal-engine:dev-slim-5.8.4`: 24 GB compressed, with the engine at+ `/home/ue4/UnrealEngine` and user `ue4`.+ - Pulling it needs a GitHub account linked to Epic and in the EpicGames org, plus a classic PAT with `read:packages`.+ The PAT goes in the user env vars `GHCR_USER`/`GHCR_TOKEN` and is passed as `ContainerImage(registries=...)`;+ the Depot builder is the only thing that uses it.+- On top of the base image:+ - Python 3.13 via uv (it must match the deploying Python);+ - ffmpeg, the Vulkan loader and tools, and the NVIDIA ICD JSON;+ - `NVIDIA_DRIVER_CAPABILITIES=all`.+- The first image build took 644 s. Redeploys with an unchanged image take about 20 s.++```+$env:UE_SOURCE = "ghcr:dev-slim-5.8.4"; $env:GHCR_USER = "apekshik" # GHCR_TOKEN from the user env var+uv run --python 3.13 --with fal==1.84.0 --with pydantic --with fal-client fal deploy app.py::UnrealBuild --app-name unreal-build --auth private --reset-scale+```+`UE_SOURCE=url:<linux engine zip>` builds from an Epic Linux binary zip instead. `none` builds a probe image with no engine.++## Linux specifics, now verified+- UnrealEditor refuses to run as root, so every engine process runs as `ue4` via `setpriv`.+- Rendering uses `-vulkan -RenderOffscreen` with `SDL_VIDEODRIVER=offscreen`; MRQ runs in `-game` mode with `-LevelSequence`.+- Engine processes run in their own process group:+ - Shutdown is detected from log markers, and the group is killed EXIT_GRACE seconds later; `pkill -u ue4` follows.+ ShaderCompileWorker children otherwise keep stdout open after the engine has exited.+ - Commandlets never log `LogExit`: their last line is `Execution of commandlet took`.+- `skip_retry_conditions=["timeout"]`. Without it, fal re-ran a timed-out build on a new runner every 2 h for 14 h.+- Exports written on Windows hold backslash paths in scene.json. `build_level.py` converts them on Linux; see `_posix_paths`.++## Files (all new; nothing in `unreal/` changed)+- `app.py`: the fal app.+- `mrq_config.py`: makes a per-request MRQ config. It sets the output dir, resolution, frame range, samples and+ warm-up, and `use_camera_cut_for_warm_up=False`.+- `smoke_shot.py`: an offscreen SceneCapture render of a lit cube.+- `template/`: `AnySceneUE.uproject` and Config. `make_project()` swaps the startup map and adds Linux `SF_VULKAN_SM6`.+- `tools/upload_export.py`, `tools/call.py`, `tools/fetch.py`: upload, submit-and-poll, and re-attach.+- `build_level.py`: `unreal/build_level.py` as of 2026-11-01 20:25, plus `_posix_paths` (merge that upstream).+ `app.py` ships whichever `build_level.py` is in this folder.+- `render_mrq.ps1`, `render_shots.py`, `TOGGLE.md`: unchanged copies.++## fal facts learned+- `keep_alive` is capped at 3600 s without a support request.+- Scaling settings persist across deploys; pass `--reset-scale` to apply the values in code.+- A timeout makes the queue retry on a fresh runner unless `skip_retry_conditions` includes `"timeout"`.+- `fal runners list --state terminated --since 6h` and `fal runners logs <id>` recover a dead runner's full log.diff --git a/unreal_fal_ue/TOGGLE.md b/unreal_fal_ue/TOGGLE.mdnew file mode 100644index 0000000..ccde400--- /dev/null+++ b/unreal_fal_ue/TOGGLE.md@@ -0,0 +1,155 @@+# TOGGLE.md: an `unreal` option on `/ref2scene`, and `/scene2unreal`++Design note. Nothing here is implemented yet. It builds on `unreal/export_blend.py`, `unreal/build_level.py`,+`unreal/render_mrq.ps1`, `unreal/perf.ps1` and `unreal/NIAGARA.md`, and on `builder/app.py`+(`SceneBuilderApp`, `BuildRequest`, `_build_and_shoot`).++## 1. API++### 1a. Toggle on `/ref2scene` (and its `/build` alias)++Add one optional field to `BuildRequest`. Like `shots`, it stays **out of the build fingerprint** (`fp` in `_build`),+so one Blender build serves any number of Unreal conversions.++```python+class UnrealOptions(BaseModel):+ enabled: bool = Field(True, description="Convert the passed build into an Unreal 5.8 level.")+ cameras: list[str] = Field(default_factory=list, description="Cameras to render MRQ stills from (default: every scouting camera in shots.json).")+ fx: bool = Field(True, description="Port effects (flames, steam, rain, ...) per NIAGARA.md. False: static fog only.")+ look_match_rounds: int = Field(2, description="Agent look-match passes against the Cycles frames (0 = deterministic conversion only).")+ package: str = Field("plugin", description="plugin: a UE content plugin zip (drop into any 5.8 project). uproject: a full project zip. both.")+ still_res: list[int] = Field([1920, 1080], description="MRQ still resolution (W, H).")+ clip_frames: int = Field(0, description="Also render N-frame MRQ clips per camera (0 = stills only).")+ perf: bool = Field(True, description="Run the real-time perf capture (CSV profiler, GPU memory) at perf_res.")+ perf_res: list[int] = Field([2560, 1440])+ gpu_budget_ms: float = Field(16.6, description="Real-time frame budget the perf report grades against.")++class BuildRequest(BaseModel):+ ...+ unreal: UnrealOptions | None = Field(None, description="Optional: once the build passes its critic, convert it to Unreal.")+```++Add to `BuildResponse`: `unreal_job: dict | None`, holding status, `request_id` and an error if any, with the same+shape as `shots_job`. Add `unreal: UnrealResult | None` (§3).++### 1b. Standalone `/scene2unreal`++`SceneUnrealRequest = {build_id: str, **UnrealOptions, fresh: bool = False, effort: str = "medium"}`.+- It runs on any finished build in `/data/anyscene/builder/<build_id>`.+- It is retry-safe the same way `_build` is: an index keyed by `sha256(build_id + options)` and an `.alive`+ heartbeat.+- `/ref2scene` with `unreal` set calls it **after** `_build`, exactly like `_anyshot`.+- Run it as a **separate fal app** (`anyscene-unreal`) on a UE container. The builder image stays Blender-only, and+ the UE image (about 40 GB with DDC) only starts when someone asks for Unreal. The builder forwards the order with+ `fal_client` and relays the stage lines, as `call_anyshot` does.++## 2. What runs after the critic passes++The gate is the same as for shots: `res.critiques[-1]["passed"] and res.scene_blend_url`.++| # | Stage | Where | Deterministic? |+|---|---|---|---|+| 1 | **Export**: `blender -b <copy> --python export_blend.py -- --out exp/ --gpu --grade-sh ... --frame <hero frame>`, sharded (§5), then a merge pass writes `scene.json` incl. `fx` (NIAGARA.md §4) and the flipbook / VDB bakes the FX plan asks for | builder GPU worker (has Blender + OptiX cache) or the UE worker if Blender is installed there | yes |+| 2 | **FX plan**: `fx_plan.py` fills `technique / template / params` per `fx` entry from the NIAGARA.md decision table | either | yes (rules); entries with `confidence < 0.6` are queued for the agent |+| 3 | **UE build**: `UnrealEditor-Cmd AnySceneUE.uproject -run=pythonscript -script=build_level.py` (stages textures, meshes, materials, level, fx, sequences) on a **Linux GPU container** with the AnySceneFX plugin preinstalled and a persistent DDC on `/data` | UE worker | yes |+| 4 | **Shader warm**: one `-game -RenderOffscreen` run of the level with `fx.Niagara.ForceWaitForCompilationOnActivate=1` and `Editor.AsyncAssetCompilation=0` to fill the DDC (skipped when DDC is warm) | UE worker | yes |+| 5 | **MRQ stills** per camera (`MRQ_Still` + `MRQ_Linear`), plus clips if requested | UE worker | yes, given a fixed seed and warm-up |+| 6 | **Look-match pass** (agent): compare against the Cycles stills (`side_by_side.py`, crops per `fx` bounds, exposure, fog), adjust **parameters only** (exposure offset, fog density, FX user params, light scale) with the NIAGARA.md §6 rules, rebuild only the `level`/`fx` stages, re-render; `look_match_rounds` times | UE worker + Claude | agent-judged, logged as a param diff |+| 7 | **Perf**: `perf.ps1`-equivalent `-game -RenderOffscreen` with `csvprofile`, `nvidia-smi` sampling | UE worker | measured |+| 8 | **Package**: `Plugins/AnyScene_<build>/Content/...` (+ `.uplugin`) zip; optionally the whole `.uproject` minus `Intermediate/`, `Saved/`, `DerivedDataCache/` | UE worker | yes |++**Linux notes.**+- The Linux editor renders through Vulkan (SM6). `-RenderOffscreen` works without a display. Install the Vulkan ICD+ from the NVIDIA container toolkit (`NVIDIA_DRIVER_CAPABILITIES=all`, as the builder Dockerfile already sets).+- Lumen with hardware ray tracing on Vulkan needs a recent driver. Fall back to `r.Lumen.HardwareRayTracing 0` and+ record which mode the render used.+- Swap the Windows `.ps1` wrappers for Python `subprocess` callers. `render_mrq.ps1` and `perf.ps1` are thin.+- Validate on Linux once against the Windows reference box before trusting look-match numbers. Vulkan vs D3D12+ shading differences are small but non-zero. *[untested]*++## 3. Outputs (`UnrealResult`)++```json+{+ "package_url": "...AnyScene_b_xxxx_plugin.zip",+ "uproject_url": "... (optional)",+ "stills": [{"camera": "cam_street", "ue": "...png", "ue_linear": "...exr", "cycles": "...png", "side_by_side": "...png"}],+ "clips": [],+ "look_match": {"rounds": 2, "changes": [{"round": 1, "target": "fx:steam_wok_0", "param": "Opacity", "from": 0.12, "to": 0.18, "why": "transmission 0.71 vs 0.58"}]},+ "fx": [{"id": "steam_wok_0", "type": "steam", "technique": "niagara", "template": "/AnySceneFX/Systems/NS_Steam", "status": "ok"}],+ "perf": {"res": [2560, 1440], "gpu_ms_p50": 0, "gpu_ms_p95": 0, "frame_ms_p95": 0, "gpu_mem_delta_mb": 0, "draw_calls": 0, "verdict": "within budget|over budget"},+ "build_report": "...build_report.json",+ "warnings": [],+ "minutes": {"export": 0, "ue_build": 0, "mrq": 0, "look_match": 0, "total": 0}+}+```++## 4. Time and cost (from the HK run: 627 meshes)++| Stage | HK today (serial) | With §5 sharding | Notes |+|---|---|---|---|+| Blender export (bake + GLB) | ~35 min | ~6-9 min | about 3.3 s per unique mesh; scales with unique meshes, not instances |+| FX bakes (flipbooks / VDB) | n/a | +2-6 min | only for `niagara_flipbook` / `svt` entries; runs in parallel with the mesh shards |+| UE build (import + level) | ~15 min | ~10-15 min | import-bound; Interchange is already batched by 16; FX stage adds < 1 min |+| Shader warm (cold DDC) | ~3-5 min | 0-5 min | ~0 once `/data` DDC is warm for the templates and master materials |+| MRQ stills | ~1 min/still | ~1 min/still | 3 cameras x (1 + rounds) with rounds = 2 → 9 stills ≈ 9 min (or ~45 s each when batched in one process instead of one per camera) |+| Look-match agent | n/a | ~3-5 min/round of thinking + rebuild (`level,fx` stages ≈ 1-2 min) | |+| Perf capture | n/a | ~2 min | 900 frames + startup |+| **Total** | **~55 min + stills** | **~30-40 min** | |++**Cost** = GPU-minutes x the fal machine rate, plus agent tokens.+- GPU time is about 35 GPU-minutes on the parallel path.+- The export shards are CPU-heavy. Bakes can use `--gpu` (OptiX) on the builder's own GPU. Run the export on the+ builder worker that already holds the scene, and hand only `exp/` (GLBs + PNGs, roughly 1-3 GB for HK) to the UE+ app through `/data`.+- Agent tokens apply only to look-match rounds and to low-confidence FX entries: roughly one Claude session of about+ 15-30 tool calls per round.+- With `look_match_rounds = 0` the job is purely deterministic and costs only GPU time.++## 5. Parallelizing the slow export++The export is embarrassingly parallel per unique mesh. Bakes are independent, and existing outputs are skipped+(rerunnable).++1. **Plan pass.** One quick Blender process classifies the objects and writes `export_plan.json`: the list of asset+ keys with estimated bake pixels (area x density). It does no baking.+2. **Shards.** Run *N* Blender processes on copies of the `.blend`, each started with `--shard i/N`. This is a new+ flag: keep `keys[k]` where `k % N == i`, after sorting by estimated cost and dealing round-robin, so shards+ balance. Each shard bakes into the shared `tex/` and `mesh/` directories.+ - Today's `--reverse` and `--only` already show that two processes can share the folder safely.+ - Pick *N* = min(CPU cores ÷ 4, 8) for CPU bakes. With `--gpu`, run 2-3 processes per GPU, since OptiX bakes are+ short and the time goes into Blender overhead.+3. **Merge pass.** One process with `--no-bake`. Every texture and GLB already exists, so it only writes+ `scene.json`, lights, cameras, world, grade and `fx`. This also removes the partial-`scene.json` merge+ (`ONLY`/`LIMIT` branch) from the hot path.+4. **Cache across builds.** Key `tex/` and `mesh/` by a hash of (evaluated mesh data + material node trees + bake+ settings). The same prop library recurs across scenes, and a retry of `/scene2unreal` re-bakes nothing.+5. **FX bakes** (flipbook renders, VDB sampling) are extra shards, scheduled first because they are the longest+ single jobs.++The UE side can overlap with the export. Start texture import of finished shards while the others are still baking:+the `textures` stage is rerunnable and skips assets that exist. Mesh import order does not matter.++## 6. Deterministic vs agent-judged++**Deterministic.** Same input gives the same output, so these steps are cacheable and testable.+- Everything in `export_blend.py`, and the fx classification scores.+- `fx_plan.py` technique and parameter mapping (NIAGARA.md §3-5).+- `build_level.py`.+- Seeds: `RandomSeedOffset = crc32(fx id)`.+- Warm-up counts.+- MRQ settings.+- Packaging.+- Perf numbers (measured, so noisy within ±5%).++**Agent-judged.** Logged as explicit parameter diffs, bounded by `look_match_rounds`.+- Low-confidence fx classification (< 0.6), including `unknown` entries.+- Switching technique when a parameter-only match fails after three rounds (NIAGARA.md §6.5).+- Exposure and fog calibration offsets.+- FX user-parameter tuning.+- Light scale tweaks.+- The final "does it read like the Cycles frame" verdict, which goes into the response next to the side-by-sides.++**Rule.** The agent never edits `build_level.py`, `export_blend.py` or templates during a job. It writes overrides to+`exp/overrides.json`, which `build_level.py` applies on top of `scene.json`. A rerun with the same overrides+reproduces the agent's result exactly.diff --git a/unreal_fal_ue/app.py b/unreal_fal_ue/app.pynew file mode 100644index 0000000..79ca3fe--- /dev/null+++ b/unreal_fal_ue/app.py@@ -0,0 +1,460 @@+"""apek/unreal-build: headless Unreal Engine 5.8 on fal Serverless. Builds an AnyScene export (export_blend.py output:+scene.json + mesh/ + tex/ + world/ + grade/) into a level and renders it with Movie Render Queue, so the Unreal stages of+the Blender -> Unreal converter run off the local GPU. It is the core of the hosted /scene2unreal (TOGGLE.md).++ GHCR_USER=... GHCR_TOKEN=... fal deploy app.py::UnrealBuild --app-name unreal-build --auth private++Endpoints+ /smoke engine version, GPU, Vulkan device and a 640x360 render of a lit cube (proves the RHI works headless).+ /build export_url (zip of an export folder) -> content_url (zip of Content/AnyScene/<Scene> + Config), log, report.+ /render content_url + camera names -> MRQ PNG stills (and an MP4 per camera when frames > 1).++Engine source (UE_SOURCE at deploy time):+ ghcr:<tag> Epic's prebuilt dev image ghcr.io/epicgames/unreal-engine:<tag> (default dev-slim-5.8.0). Pulling needs+ a GitHub account linked to an Epic Games account and a PAT with read:packages (GHCR_USER / GHCR_TOKEN;+ fal strips registry credentials before pickling, they go only to the image builder).+ url:<url> a Linux binary zip of the engine (Epic's "Linux_Unreal_Engine_5.8.x.zip"), downloaded at image build.+Either way the engine ends up at /opt/UnrealEngine in a python:3.13-slim image (the base the render farm already runs).++UnrealEditor refuses to run as root on Linux, so every engine process runs as the `ue` user (setpriv). Shaders and+derived data go to a shared DDC on /data (UE-SharedDataCachePath), so compiles are paid once across workers and jobs.+"""++import hashlib+import json+import os+import shutil+import subprocess+import threading+import time+import urllib.request+import zipfile+from pathlib import Path, PurePosixPath++import fal+from fal.container import ContainerImage++from pydantic import BaseModel, Field++if os.name == "nt":+ # Deploying from Windows: ContainerImage's context_dir default is the cwd as a WindowsPath, evaluated at import.+ # It gets pickled along with the app and Linux can't unpickle a WindowsPath, so swap it for a POSIX path.+ _posix = PurePosixPath("/tmp")+ ContainerImage.__dataclass_fields__["context_dir"].default = _posix+ ContainerImage.context_dir = _posix+ ContainerImage.__init__.__defaults__ = tuple(+ _posix if isinstance(d, os.PathLike) else d for d in ContainerImage.__init__.__defaults__ or ()+ )++UE_SOURCE = os.environ.get("UE_SOURCE", "ghcr:dev-slim-5.8.4") # the local editor is 5.8.4 (CL 58902052)+UE_USER = "ue4" # Epic's images run as ue4 (uid 1000); the other modes create the same user++_ICD = ("mkdir -p /etc/vulkan/icd.d && printf "+ "'{\"file_format_version\":\"1.0.0\",\"ICD\":{\"library_path\":\"libGLX_nvidia.so.0\",\"api_version\":\"1.3\"}}' "+ "> /etc/vulkan/icd.d/nvidia_icd.json")+if UE_SOURCE.startswith("ghcr:"):+ # Build on Epic's image itself: its ~30 engine layers are pulled as they are (copying the engine into another base+ # would re-pack ~60 GB into one layer). fal's isolate needs a Python matching the deploying one, so add 3.13.+ UE = "/home/ue4/UnrealEngine"+ _REGISTRIES = {"ghcr.io": {"username": os.environ.get("GHCR_USER", ""), "password": os.environ.get("GHCR_TOKEN", "")}}+ DOCKERFILE = f"""FROM ghcr.io/epicgames/unreal-engine:{UE_SOURCE[5:]}+USER root+ENV NVIDIA_DRIVER_CAPABILITIES=all NVIDIA_VISIBLE_DEVICES=all+RUN apt-get update && apt-get install -y --no-install-recommends \+ curl ca-certificates unzip zip ffmpeg util-linux libvulkan1 vulkan-tools \+ && rm -rf /var/lib/apt/lists/* && {_ICD}+COPY --from=ghcr.io/astral-sh/uv:0.9.5 /uv /usr/local/bin/uv+RUN UV_PYTHON_INSTALL_DIR=/opt/python uv python install 3.13 \+ && ln -sf "$(UV_PYTHON_INSTALL_DIR=/opt/python uv python find 3.13)" /usr/local/bin/python3.13 \+ && ln -sf /usr/local/bin/python3.13 /usr/local/bin/python \+ && ln -sf /usr/local/bin/python3.13 /usr/local/bin/python3 \+ && rm -f /opt/python/*/lib/python3.13/EXTERNALLY-MANAGED && python -m ensurepip+"""+else:+ UE = "/opt/UnrealEngine"+ _REGISTRIES = {}+ if UE_SOURCE == "none": # probe deploy without an engine: checks the base image, GPU and Vulkan on fal+ _ENGINE = ""+ else: # url:<Linux binary zip>+ _ENGINE = (+ f"RUN curl -fsSL '{UE_SOURCE[4:]}' -o /tmp/ue.zip && mkdir -p /tmp/ue && unzip -q /tmp/ue.zip -d /tmp/ue"+ f" && rm /tmp/ue.zip && mv \"$(dirname \"$(find /tmp/ue -maxdepth 3 -type d -name Engine | head -1)\")\" {UE}"+ f" && chown -R {UE_USER}:{UE_USER} {UE} && rm -rf /tmp/ue\n"+ )+ DOCKERFILE = f"""FROM python:3.13-slim-bookworm+ENV NVIDIA_DRIVER_CAPABILITIES=all NVIDIA_VISIBLE_DEVICES=all+RUN apt-get update && apt-get install -y --no-install-recommends \+ curl ca-certificates unzip zip ffmpeg util-linux libvulkan1 vulkan-tools \+ libgl1 libegl1 libx11-6 libxcursor1 libxrandr2 libxi6 libxinerama1 libxss1 libxcomposite1 libxdamage1 \+ libxext6 libxfixes3 libxrender1 libxkbcommon0 libnss3 libasound2 libpulse0 libsm6 libice6 libglib2.0-0 \+ libfontconfig1 libfreetype6 libicu72 xdg-user-dirs \+ && rm -rf /var/lib/apt/lists/* && useradd -m -u 1000 {UE_USER} && {_ICD}+{_ENGINE}"""+EDITOR = f"{UE}/Engine/Binaries/Linux/UnrealEditor"+EDITOR_CMD = f"{UE}/Engine/Binaries/Linux/UnrealEditor-Cmd"+++def _read(name):+ """Scripts shipped to the worker as strings (no build context). Read at deploy time on the deploying machine."""+ p = os.path.join(os.path.dirname(os.path.abspath(__file__)), name)+ return open(p, encoding="utf-8").read() if os.path.exists(p) else ""+++SCRIPTS = {n: _read(n) for n in ("build_level.py", "mrq_config.py", "smoke_shot.py")}+TEMPLATE = {+ "AnySceneUE.uproject": _read("template/AnySceneUE.uproject"),+ "Config/DefaultEngine.ini": _read("template/Config/DefaultEngine.ini"),+ "Config/DefaultGame.ini": _read("template/Config/DefaultGame.ini"),+}++# Fixed paths: build_level.py bakes some paths into assets, so the same layout on every worker keeps them valid.+ROOT = "/tmp/anyscene"+PROJECT = f"{ROOT}/AnySceneUE"+UPROJECT = f"{PROJECT}/AnySceneUE.uproject"+EXPORT = f"{ROOT}/export"+CACHE = "/tmp/anyscene-cache" # local disk, per worker (see farm/app.py on /data contention)+DDC_SHARED = "/data/unreal/ddc/5.8"+DPCVARS = ("-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,"+ "Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1,r.TextureStreaming=0")+# Commandlets never log LogExit: their last word is "Execution of commandlet took" (the first HK build sat 100 min there).+EXIT_MARKERS = ("LogExit: Exiting.", "LogExit: Editor shut down", "LogExit: Game engine shut down",+ "Execution of commandlet took")+EXIT_GRACE = 60+COMMON = ["-unattended", "-nosplash", "-nop4", "-nosound", "-stdout", "-FullStdOutLogOutput", "-vulkan"]+++def ue_env(extra=None):+ env = {+ "HOME": f"/home/{UE_USER}", "USER": UE_USER, "PATH": "/usr/local/bin:/usr/bin:/bin", "LANG": "C.UTF-8",+ "XDG_CONFIG_HOME": f"/home/{UE_USER}/.config",+ "LD_LIBRARY_PATH": "/usr/lib/x86_64-linux-gnu:/usr/local/nvidia/lib64:/usr/local/nvidia/lib",+ "UE-SharedDataCachePath": DDC_SHARED, "SDL_VIDEODRIVER": "offscreen",+ "NVIDIA_DRIVER_CAPABILITIES": "all",+ }+ env.update(extra or {})+ return env+++def run_ue(args, log_path, timeout, env=None, watch=("ANYSCENE", "SMOKE", "MRQCFG", "Error:", "LogMovieRenderPipeline")):+ """Run an engine process as UE_USER, full output to log_path, interesting lines echoed to the fal log.++ The process gets its own process group, killed as a whole: ShaderCompileWorker children inherit stdout and keep+ the pipe open after the editor has exited (the first smoke run sat 20 min past "Editor shut down"). Once the+ engine logs its shutdown, the group gets EXIT_GRACE seconds before it is killed. The pipe is read on its own+ thread so nothing here waits for EOF, and every UE_USER process is killed at the end in case one left the group."""+ import signal++ cmd = ["setpriv", f"--reuid={UE_USER}", f"--regid={UE_USER}", "--init-groups", *args]+ t = time.time()+ exited = threading.Event()++ def kill():+ try:+ os.killpg(p.pid, signal.SIGKILL)+ except ProcessLookupError:+ pass+ subprocess.run(["pkill", "-9", "-u", UE_USER], check=False)++ with open(log_path, "w", encoding="utf-8", errors="replace") as log:+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=ue_env(env), text=True,+ errors="replace", start_new_session=True)++ def read():+ for line in p.stdout:+ log.write(line)+ if any(w in line for w in watch):+ print(line.rstrip()[:400], flush=True)+ if not exited.is_set() and any(m in line for m in EXIT_MARKERS):+ exited.set()++ reader = threading.Thread(target=read, daemon=True)+ reader.start()+ deadline = t + timeout+ while p.poll() is None and time.time() < deadline:+ if exited.is_set():+ deadline = min(deadline, time.time() + EXIT_GRACE)+ time.sleep(1)+ kill()+ p.wait()+ reader.join(10)+ return p.returncode, round(time.time() - t, 1)+++def tail(path, n=6000):+ try:+ return Path(path).read_text(errors="replace")[-n:]+ except OSError:+ return ""+++def chown_ue(path):+ subprocess.run(["chown", "-R", f"{UE_USER}:{UE_USER}", str(path)], check=False)+++def fetch_zip(url, dest):+ """Download a zip once per worker (keyed by URL hash) and unpack it into dest (replacing it)."""+ key = hashlib.sha256(url.encode()).hexdigest()[:24]+ cached = Path(CACHE) / key+ if not (cached / ".ready").exists():+ shutil.rmtree(cached, ignore_errors=True)+ cached.mkdir(parents=True)+ zpath = cached / "in.zip"+ with urllib.request.urlopen(url, timeout=900) as r, open(zpath, "wb") as f:+ while chunk := r.read(16 << 20):+ f.write(chunk)+ with zipfile.ZipFile(zpath) as z:+ z.extractall(cached / "x")+ zpath.unlink()+ (cached / ".ready").touch()+ shutil.rmtree(dest, ignore_errors=True)+ shutil.copytree(cached / "x", dest)+ return Path(dest)+++def make_project(dest, level):+ """A fresh project from the template, with the scene's level as the startup/default map and Vulkan SM6 on Linux."""+ shutil.rmtree(PROJECT, ignore_errors=True)+ for rel, text in TEMPLATE.items():+ p = Path(PROJECT) / rel+ p.parent.mkdir(parents=True, exist_ok=True)+ if rel == "Config/DefaultEngine.ini":+ if level:+ text = text.replace("/Game/AnyScene/HK/L_HK.L_HK", f"{dest}/{level}.{level}")+ else: # no level yet (smoke): the engine's default empty map+ text = "\n".join(l for l in text.splitlines() if "StartupMap=" not in l and "DefaultMap=" not in l)+ text += ("\n[/Script/LinuxTargetPlatform.LinuxTargetSettings]\n-TargetedRHIs=SF_VULKAN_SM5\n"+ "+TargetedRHIs=SF_VULKAN_SM6\n")+ p.write_text(text)+ (Path(PROJECT) / "Content").mkdir(exist_ok=True)+++def write_scripts():+ d = Path(ROOT) / "scripts"+ d.mkdir(parents=True, exist_ok=True)+ for n, s in SCRIPTS.items():+ (d / n).write_text(s)+ return d+++def upload(path, content_type):+ from fal.toolkit import File # not at module level: its Path constants pickle as WindowsPath from Windows++ return File.from_path(str(path), content_type=content_type).url+++class SmokeRequest(BaseModel):+ render: bool = Field(True, description="Also render a lit cube offscreen (proves Vulkan rendering works).")+++class SmokeResult(BaseModel):+ engine: str+ gpu: str+ vulkan: str+ image_url: str | None = None+ seconds: float+ log_tail: str+++class BuildRequest(BaseModel):+ export_url: str = Field(description="Zip of an AnyScene export folder (scene.json at the zip root).")+ scene: str = Field("HK", description="Content folder name: assets go under /Game/AnyScene/<scene>.")+ level: str = Field("", description="Level name (default L_<scene>).")+ stages: str = Field("textures,meshes,materials,level,sequences", description="build_level.py stages.")+ nanite_tris: int = Field(2000)+ exposure_offset: float = Field(0.0)+ timeout_s: int = Field(5400)+++class BuildResult(BaseModel):+ content_url: str = Field(description="Zip of Content/AnyScene/<scene>/ plus Config/ and the .uproject.")+ log_url: str+ report: dict+ build_seconds: float+ fetch_seconds: float+ content_mb: float+++class RenderRequest(BaseModel):+ content_url: str = Field(description="content_url from /build.")+ scene: str = Field("HK")+ level: str = Field("")+ cameras: list[str] = Field(["cam_street", "cam_table", "cam_wok"])+ config: str = Field("MRQ_Still", description="Base MRQ config: MRQ_Still (PNG, UE tone curve) or MRQ_Linear (EXR).")+ resolution: list[int] = Field([1920, 804])+ frames: int = Field(1, description="Frames per camera; >1 renders a clip and also returns an MP4.")+ temporal_samples: int = Field(8)+ warmup_frames: int = Field(64)+ fps: int = Field(24)+ timeout_s: int = Field(3600)+++class RenderedCamera(BaseModel):+ camera: str+ image_urls: list[str]+ video_url: str | None = None+ seconds: float+ returncode: int+++class RenderResult(BaseModel):+ cameras: list[RenderedCamera]+ fetch_seconds: float+ config_seconds: float+ log_urls: list[str]+++class UnrealBuild(fal.App):+ machine_type = "GPU-RTX5090"+ image = ContainerImage.from_dockerfile_str(DOCKERFILE, context_dir=PurePosixPath("/tmp"), registries=_REGISTRIES)+ # 24 GB compressed image plus a ~5 GB export and its build: the RTX PRO 6000 has more local disk if this fills up.+ requirements = ["pydantic", "fal==1.84.0"]+ # Owner-approved warm worker: the image is tens of GB, so a cold start is minutes of pull plus engine start.+ min_concurrency = int(os.environ.get("UE_MIN_CONCURRENCY", "1"))+ keep_alive = 3600 # fal caps this at 3600 without a support request+ max_concurrency = 4+ request_timeout = 7200+ startup_timeout = 3600+ # A timed-out request is otherwise re-run on a fresh runner: the first HK build hung after finishing and was retried+ # every 2 h for 14 h. Timeouts here mean a bug, not a transient error.+ skip_retry_conditions = ["timeout"]++ def setup(self):+ for d in (ROOT, CACHE, DDC_SHARED):+ os.makedirs(d, exist_ok=True)+ chown_ue(ROOT)+ try:+ chown_ue(DDC_SHARED)+ except Exception:+ pass+ os.chmod(DDC_SHARED, 0o777)+ smi = subprocess.run(["nvidia-smi", "--query-gpu=name,driver_version,memory.total", "--format=csv,noheader"],+ capture_output=True, text=True)+ self.gpu = smi.stdout.strip() or smi.stderr.strip()[-300:]+ vk = subprocess.run(["setpriv", f"--reuid={UE_USER}", f"--regid={UE_USER}", "--init-groups", "vulkaninfo", "--summary"],+ capture_output=True, text=True, env=ue_env())+ lines = [l.strip() for l in vk.stdout.splitlines() if "deviceName" in l or "driverInfo" in l or "apiVersion" in l]+ self.vulkan = "; ".join(lines[:6]) or (vk.stderr or vk.stdout)[-400:]+ try:+ v = json.load(open(f"{UE}/Engine/Build/Build.version"))+ self.engine = f"{v['MajorVersion']}.{v['MinorVersion']}.{v['PatchVersion']} CL{v.get('Changelist')} {v.get('BranchName', '')}"+ except Exception as e:+ self.engine = f"unknown ({e})"+ print("unreal-build ready:", self.engine, "|", self.gpu, "|", self.vulkan, flush=True)++ @fal.endpoint("/smoke")+ def smoke(self, req: SmokeRequest) -> SmokeResult:+ t = time.time()+ url, log = None, ""+ if req.render:+ scripts = write_scripts()+ make_project("/Game/Smoke", "")+ out = Path(ROOT) / "smoke"+ shutil.rmtree(out, ignore_errors=True)+ chown_ue(ROOT)+ lp = f"{ROOT}/smoke.log"+ rc, _ = run_ue([EDITOR, UPROJECT, f"-ExecCmds=py {scripts}/smoke_shot.py", "-RenderOffscreen", DPCVARS,+ *COMMON], lp, 1800, {"ANYSCENE_SMOKE_OUT": str(out)})+ log = tail(lp)+ png = out / "smoke.png"+ if png.exists():+ url = upload(png, "image/png")+ return SmokeResult(engine=self.engine, gpu=self.gpu, vulkan=self.vulkan, image_url=url,+ seconds=round(time.time() - t, 1), log_tail=log[-3000:])++ @fal.endpoint("/build")+ def build(self, req: BuildRequest) -> BuildResult:+ if not req.scene.isidentifier():+ raise ValueError("scene must be an identifier")+ level = req.level or f"L_{req.scene}"+ dest = f"/Game/AnyScene/{req.scene}"+ t0 = time.time()+ fetch_zip(req.export_url, EXPORT)+ t1 = time.time()+ scripts = write_scripts()+ make_project(dest, level)+ chown_ue(ROOT)+ lp = f"{ROOT}/build.log"+ env = {"ANYSCENE_EXPORT": EXPORT, "ANYSCENE_DEST": dest, "ANYSCENE_LEVEL": level, "ANYSCENE_STAGES": req.stages,+ "ANYSCENE_NANITE_TRIS": str(req.nanite_tris), "ANYSCENE_EXPOSURE_OFFSET": str(req.exposure_offset)}+ rc, secs = run_ue([EDITOR_CMD, UPROJECT, "-run=pythonscript", f"-script={scripts}/build_level.py", DPCVARS,+ *COMMON], lp, req.timeout_s, env)+ log_url = upload(lp, "text/plain")+ rp = Path(EXPORT) / "build_report.json"+ report = json.loads(rp.read_text()) if rp.exists() else {}+ content = Path(PROJECT) / "Content" / "AnyScene" / req.scene+ if not (content / f"{level}.umap").exists():+ raise RuntimeError(f"build failed (exit {rc}, no {level}.umap); log {log_url}\n{tail(lp, 3000)}")+ print(f"build done in {secs}s (exit {rc}); zipping content", flush=True)+ t2 = time.time()+ zpath = Path(ROOT) / f"{req.scene}_content.zip"+ with zipfile.ZipFile(zpath, "w", zipfile.ZIP_DEFLATED, compresslevel=1, allowZip64=True) as z:+ for p in content.rglob("*"):+ if p.is_file():+ z.write(p, p.relative_to(PROJECT).as_posix())+ for p in (Path(PROJECT) / "Config").rglob("*"):+ if p.is_file():+ z.write(p, p.relative_to(PROJECT).as_posix())+ z.write(UPROJECT, "AnySceneUE.uproject")+ report["exit_code"] = rc+ t3 = time.time()+ print(f"zipped {zpath.stat().st_size / 1e6:.0f} MB in {t3 - t2:.0f}s; uploading", flush=True)+ content_url = upload(zpath, "application/zip")+ report["zip_s"], report["upload_s"] = round(t3 - t2, 1), round(time.time() - t3, 1)+ print(f"uploaded in {report['upload_s']}s", flush=True)+ res = BuildResult(content_url=content_url, log_url=log_url, report=report,+ build_seconds=secs, fetch_seconds=round(t1 - t0, 1),+ content_mb=round(zpath.stat().st_size / 1e6, 1))+ zpath.unlink(missing_ok=True)+ return res++ @fal.endpoint("/render")+ def render(self, req: RenderRequest) -> RenderResult:+ if not req.scene.isidentifier() or not all(c.isidentifier() for c in req.cameras):+ raise ValueError("scene and camera names must be identifiers")+ level = req.level or f"L_{req.scene}"+ dest = f"/Game/AnyScene/{req.scene}"+ t0 = time.time()+ make_project(dest, level)+ staged = fetch_zip(req.content_url, f"{ROOT}/content_in")+ shutil.copytree(staged / "Content", Path(PROJECT) / "Content", dirs_exist_ok=True)+ t1 = time.time()+ scripts = write_scripts()+ out = Path(ROOT) / "mrq"+ shutil.rmtree(out, ignore_errors=True)+ out.mkdir(parents=True)+ chown_ue(ROOT)+ W, H = req.resolution+ lp = f"{ROOT}/mrq_config.log"+ rc, cfg_s = run_ue([EDITOR_CMD, UPROJECT, "-run=pythonscript", f"-script={scripts}/mrq_config.py", *COMMON], lp,+ 900, {"ANYSCENE_DEST": dest, "ANYSCENE_MRQ_BASE": req.config, "ANYSCENE_MRQ_NAME": "MRQ_Req",+ "ANYSCENE_MRQ_OUT": str(out), "ANYSCENE_MRQ_RES": f"{W}x{H}",+ "ANYSCENE_MRQ_FRAMES": f"0,{req.frames}", "ANYSCENE_MRQ_SAMPLES": str(req.temporal_samples),+ "ANYSCENE_MRQ_WARMUP": str(req.warmup_frames), "ANYSCENE_CAMS": ",".join(req.cameras)})+ logs = [upload(lp, "text/plain")]+ if "MRQCFG wrote" not in tail(lp, 2_000_000): # the exit code is -9 when the group is killed after shutdown+ raise RuntimeError(f"MRQ config failed (exit {rc})\n{tail(lp, 3000)}")+ results = []+ for cam in req.cameras:+ clp = f"{ROOT}/mrq_{cam}.log"+ seq = f"{dest}/Sequences/SEQ_{cam}.SEQ_{cam}"+ rc, secs = run_ue([EDITOR_CMD, UPROJECT, f"{dest}/{level}", "-game", f"-LevelSequence={seq}",+ f"-MoviePipelineConfig={dest}/MRQ/MRQ_Req.MRQ_Req", "-RenderOffscreen", "-windowed",+ f"-resx={W}", f"-resy={H}", "-notexturestreaming", DPCVARS, *COMMON],+ clp, req.timeout_s)+ logs.append(upload(clp, "text/plain"))+ files = sorted(p for p in out.glob(f"SEQ_{cam}*") if p.suffix.lower() in (".png", ".exr"))+ video = None+ if req.frames > 1 and files and files[0].suffix.lower() == ".png":+ mp4 = out / f"{cam}.mp4"+ lst = out / f"{cam}.txt"+ lst.write_text("".join(f"file '{p}'\nduration {1 / req.fps}\n" for p in files))+ subprocess.run(["ffmpeg", "-y", "-loglevel", "error", "-f", "concat", "-safe", "0", "-i", str(lst),+ "-r", str(req.fps), "-c:v", "libx264", "-pix_fmt", "yuv420p", "-crf", "16", str(mp4)],+ check=False)+ if mp4.exists():+ video = upload(mp4, "video/mp4")+ ctype = "image/png" if not files or files[0].suffix.lower() == ".png" else "image/x-exr"+ results.append(RenderedCamera(camera=cam, image_urls=[upload(p, ctype) for p in files], video_url=video,+ seconds=secs, returncode=rc))+ print(f"MRQ {cam}: {len(files)} frames in {secs}s (exit {rc})", flush=True)+ return RenderResult(cameras=results, fetch_seconds=round(t1 - t0, 1), config_seconds=cfg_s, log_urls=logs)diff --git a/unreal_fal_ue/build_level.py b/unreal_fal_ue/build_level.pynew file mode 100644index 0000000..d43da05--- /dev/null+++ b/unreal_fal_ue/build_level.py@@ -0,0 +1,687 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,sequences (default: all)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+++def _posix_paths(o):+ """Exports written on Windows hold paths like tex\\x.png; on Linux basename() and open() need forward slashes."""+ if isinstance(o, dict):+ return {k: _posix_paths(v) for k, v in o.items()}+ if isinstance(o, list):+ return [_posix_paths(v) for v in o]+ return o.replace("\\", "/") if isinstance(o, str) else o+++if os.sep == "/":+ scene = _posix_paths(scene)+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % 16 == 15 or i == len(todo) - 1:+ flush(a)+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked():+ path = f"{DEST}/Materials/M_AnyBaked"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyBaked", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_glass():+ path = f"{DEST}/Materials/M_AnyGlass"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGlass", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ c = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, -500, 0)+ c.set_editor_property("parameter_name", "Color")+ c.set_editor_property("default_value", unreal.LinearColor(1, 1, 1, 1))+ r = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 200)+ r.set_editor_property("parameter_name", "Roughness")+ r.set_editor_property("default_value", 0.05)+ o = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 350)+ o.set_editor_property("parameter_name", "Opacity")+ o.set_editor_property("default_value", 0.25)+ MEL.connect_material_property(c, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], baked)+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ c = g["color"]+ MEL.set_material_instance_vector_parameter_value(gm, "Color", unreal.LinearColor(c[0], c[1], c[2], 1))+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ if a.get("sections"):+ # The GLB keeps only the materials its faces use (an all-glass pane has just the glass section).+ mats = [mats[min(s, len(mats) - 1)] for s in a["sections"]]+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0]:+ continue+ b = v["bounds_ue"]+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(b["center"]), unreal.Rotator(0, 0, 0))+ lf.set_actor_label("LFV_" + name)+ lf.set_folder_path("Volumes")+ # Local fog volumes are unit spheres of radius 100 cm at scale 1 (assumed); scale to the box.+ lf.set_actor_scale3d(unreal.Vector(b["extent"][0] / 100, b["extent"][1] / 100, b["extent"][2] / 100))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"])+ emit = max(v["emission"])+ lc.set_editor_property("radial_fog_extinction", dens)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ lc.set_editor_property("radial_fog_extinction", 1.0)+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * emit, ec[1] * emit, ec[2] * emit, 1))+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", min(1.0, ff["vignette_angle_rad"] / (math.pi / 4) * 0.45))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+ hero = next((c for c in scene["cameras"] if c["name"] == "cam_street"), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(48)+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, 48)+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ EAL.save_loaded_asset(seq, False)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = scene["grade"].get("resolution", [1920, 804])+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.path.join(EXPORT, "..", "compare", "mrq").replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = True+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = 64+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal_fal_ue/mrq_config.py b/unreal_fal_ue/mrq_config.pynew file mode 100644index 0000000..ebe79ab--- /dev/null+++ b/unreal_fal_ue/mrq_config.py@@ -0,0 +1,59 @@+"""Per-request Movie Render Queue config: duplicate a saved config (build_level.py's MRQ_Still / MRQ_Linear) with this+request's output folder, resolution, frame range and sample counts, and stretch the camera sequences to cover the range.+build_level.py bakes the output folder relative to the export folder, which differs per worker, so /render always+writes a fresh config. Runs in a commandlet (no rendering needed):++ UnrealEditor-Cmd <project> -run=pythonscript -script=<path>/mrq_config.py -unattended -nosplash -nop4+Env: ANYSCENE_DEST, ANYSCENE_MRQ_BASE (MRQ_Still), ANYSCENE_MRQ_NAME (MRQ_Req), ANYSCENE_MRQ_OUT, ANYSCENE_MRQ_RES (WxH),+ANYSCENE_MRQ_FRAMES (start,end; end exclusive), ANYSCENE_MRQ_SAMPLES (temporal), ANYSCENE_MRQ_WARMUP (engine warm-up+frames), ANYSCENE_CAMS (comma list of camera names whose SEQ_<cam> gets its playback end extended).+"""+import os+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+BASE = os.environ.get("ANYSCENE_MRQ_BASE", "MRQ_Still")+NAME = os.environ.get("ANYSCENE_MRQ_NAME", "MRQ_Req")+OUT = os.environ["ANYSCENE_MRQ_OUT"]+W, H = (int(x) for x in os.environ.get("ANYSCENE_MRQ_RES", "1920x804").split("x"))+F0, F1 = (int(x) for x in os.environ.get("ANYSCENE_MRQ_FRAMES", "0,1").split(","))+SAMPLES = int(os.environ.get("ANYSCENE_MRQ_SAMPLES", "8"))+WARMUP = int(os.environ.get("ANYSCENE_MRQ_WARMUP", "64"))+CAMS = [c for c in os.environ.get("ANYSCENE_CAMS", "").split(",") if c]+EAL = unreal.EditorAssetLibrary++src = f"{DEST}/MRQ/{BASE}"+dst = f"{DEST}/MRQ/{NAME}"+if EAL.does_asset_exist(dst):+ EAL.delete_asset(dst)+cfg = EAL.duplicate_asset(src, dst)+out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+out.output_directory = unreal.DirectoryPath(OUT)+out.output_resolution = unreal.IntPoint(W, H)+out.use_custom_playback_range = True+out.custom_start_frame, out.custom_end_frame = F0, F1+aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+aa.temporal_sample_count = SAMPLES+aa.engine_warm_up_count = WARMUP+aa.render_warm_up_frames = True+aa.use_camera_cut_for_warm_up = False+EAL.save_loaded_asset(cfg, False)++for cam in CAMS:+ sp = f"{DEST}/Sequences/SEQ_{cam}"+ seq = unreal.load_asset(sp)+ if seq is None:+ unreal.log_warning(f"MRQCFG missing sequence {sp}")+ continue+ if seq.get_playback_end() < F1:+ seq.set_playback_end(F1)+ for track in seq.get_tracks() if hasattr(seq, "get_tracks") else seq.get_master_tracks():+ if isinstance(track, unreal.MovieSceneCameraCutTrack):+ for sec in track.get_sections():+ sec.set_range(0, F1)+ EAL.save_loaded_asset(seq, False)+unreal.log_warning(f"MRQCFG wrote {dst} out={OUT} {W}x{H} frames {F0}-{F1} samples {SAMPLES} warmup {WARMUP}")diff --git a/unreal_fal_ue/render_mrq.ps1 b/unreal_fal_ue/render_mrq.ps1new file mode 100644index 0000000..841229a--- /dev/null+++ b/unreal_fal_ue/render_mrq.ps1@@ -0,0 +1,17 @@+# Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+# UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+# powershell -File render_mrq.ps1 [-Cams cam_street,cam_table,cam_wok] [-Config MRQ_Still|MRQ_Linear]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Dest = "/Game/AnyScene/HK", [string]$Level = "L_HK",+ [string]$Cams = "cam_street,cam_table,cam_wok", [string]$Config = "MRQ_Still"+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"+foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+ "-dpcvars=Editor.AsyncAssetCompilation=0" | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+}diff --git a/unreal_fal_ue/render_shots.py b/unreal_fal_ue/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal_fal_ue/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_fal_ue/smoke_shot.py b/unreal_fal_ue/smoke_shot.pynew file mode 100644index 0000000..ef39acf--- /dev/null+++ b/unreal_fal_ue/smoke_shot.py@@ -0,0 +1,49 @@+"""Smoke render for the fal UE worker: a lit cube in an empty level, captured with a SceneCapture2D (no viewport needed),+written to $ANYSCENE_SMOKE_OUT/smoke.png, then the editor quits. Run inside a windowless editor:++ UnrealEditor <project> "-ExecCmds=py <path>/smoke_shot.py" -RenderOffscreen -unattended -nosplash -nop4 -nosound+"""+import os+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++OUT = os.environ.get("ANYSCENE_SMOKE_OUT", "/tmp/anyscene/smoke")+FRAMES = int(os.environ.get("ANYSCENE_SMOKE_FRAMES", "120"))+os.makedirs(OUT, exist_ok=True)++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+world = ues.get_editor_world()++cube = eas.spawn_actor_from_class(unreal.StaticMeshActor, unreal.Vector(0, 0, 50), unreal.Rotator(0, 0, 30))+cube.static_mesh_component.set_static_mesh(unreal.load_asset("/Engine/BasicShapes/Cube.Cube"))+floor = eas.spawn_actor_from_class(unreal.StaticMeshActor, unreal.Vector(0, 0, 0))+floor.static_mesh_component.set_static_mesh(unreal.load_asset("/Engine/BasicShapes/Plane.Plane"))+floor.set_actor_scale3d(unreal.Vector(20, 20, 1))+sun = eas.spawn_actor_from_class(unreal.DirectionalLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, -40, 30))+eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 300))+eas.spawn_actor_from_class(unreal.SkyAtmosphere, unreal.Vector(0, 0, 0))++rt = unreal.RenderingLibrary.create_render_target2d(world, 640, 360, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, unreal.Vector(-400, -250, 250), unreal.Rotator(0, -25, 32))+c = cap.capture_component2d+c.set_editor_property("texture_target", rt)+c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR)+STATE = {"n": 0, "h": None}+++def tick(dt):+ STATE["n"] += 1+ c.capture_scene()+ if STATE["n"] < FRAMES:+ return+ unreal.unregister_slate_post_tick_callback(STATE["h"])+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, "smoke.png")+ unreal.log_warning("SMOKE wrote " + os.path.join(OUT, "smoke.png"))+ unreal.SystemLibrary.quit_editor()+++STATE["h"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_fal_ue/template/AnySceneUE.uproject b/unreal_fal_ue/template/AnySceneUE.uprojectnew file mode 100644index 0000000..01b7dc2--- /dev/null+++ b/unreal_fal_ue/template/AnySceneUE.uproject@@ -0,0 +1,12 @@+{+ "FileVersion": 3,+ "EngineAssociation": "5.8",+ "Category": "",+ "Description": "AnyScene -> Unreal feasibility test (hk-dai-pai-dong).",+ "Plugins": [+ { "Name": "PythonScriptPlugin", "Enabled": true },+ { "Name": "EditorScriptingUtilities", "Enabled": true },+ { "Name": "MovieRenderPipeline", "Enabled": true },+ { "Name": "Fab", "Enabled": false }+ ]+}diff --git a/unreal_fal_ue/template/Config/DefaultEngine.ini b/unreal_fal_ue/template/Config/DefaultEngine.ininew file mode 100644index 0000000..8f5848d--- /dev/null+++ b/unreal_fal_ue/template/Config/DefaultEngine.ini@@ -0,0 +1,41 @@+[/Script/EngineSettings.GameMapsSettings]+EditorStartupMap=/Game/AnyScene/HK/L_HK.L_HK+GameDefaultMap=/Game/AnyScene/HK/L_HK.L_HK++[/Script/Engine.RendererSettings]+r.DynamicGlobalIlluminationMethod=1+r.ReflectionMethod=1+r.Shadow.Virtual.Enable=1+r.GenerateMeshDistanceFields=True+r.AntiAliasingMethod=4+r.AllowStaticLighting=False+r.SupportSkyAtmosphere=True+r.DefaultFeature.AutoExposure=False+r.Nanite.ProjectEnabled=True+r.Lumen.HardwareRayTracing=True+r.RayTracing=True+r.SkinCache.CompileShaders=True+r.VolumetricFog=True++[/Script/WindowsTargetPlatform.WindowsTargetSettings]+DefaultGraphicsRHI=DefaultGraphicsRHI_DX12+-D3D12TargetedShaderFormats=PCD3D_SM5++D3D12TargetedShaderFormats=PCD3D_SM6++[/Script/PythonScriptPlugin.PythonScriptPluginSettings]+bRemoteExecution=True++[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]+bEnablePlugin=True+bAllowNetworkConnection=True+SecurityToken=AD718C8646B585B329764ABB7818A1AE+bIncludeInShipping=False+bAllowExternalStartInShipping=False+bCompileAFSProject=False+bUseCompression=False+bLogFiles=False+bReportStats=False+ConnectionType=USBOnly+bUseManualIPAddress=False+ManualIPAddress=+diff --git a/unreal_fal_ue/template/Config/DefaultGame.ini b/unreal_fal_ue/template/Config/DefaultGame.ininew file mode 100644index 0000000..b33dbf3--- /dev/null+++ b/unreal_fal_ue/template/Config/DefaultGame.ini@@ -0,0 +1,2 @@+[/Script/EngineSettings.GeneralProjectSettings]+ProjectName=AnySceneUEdiff --git a/unreal_fal_ue/tools/call.py b/unreal_fal_ue/tools/call.pynew file mode 100644index 0000000..86591ad--- /dev/null+++ b/unreal_fal_ue/tools/call.py@@ -0,0 +1,40 @@+"""Call apek/unreal-build (or the probe) and wait by polling the submit handle (subscribe() has hung on long jobs).++ python call.py <app> <route> '<json args>' | @args.json [out.json]+Prints queue/log lines as they arrive, the timings (queued, running) and the result; writes the result to out.json."""+import json+import sys+import time++import fal_client++app, route, a = sys.argv[1], sys.argv[2], sys.argv[3]+args = json.load(open(a[1:])) if a.startswith("@") else json.loads(a) # @file: PowerShell 5.1 strips quotes in args+out = sys.argv[4] if len(sys.argv) > 4 else None+t0 = time.time()+h = fal_client.submit(f"{app}/{route}", arguments=args)+print("request", h.request_id, flush=True)+seen, t_run = 0, None+while True:+ st = h.status(with_logs=True)+ logs = getattr(st, "logs", None) or []+ for l in logs[seen:]:+ print(f"[{time.time() - t0:6.0f}s] {l.get('message', '')[:300]}", flush=True)+ seen = len(logs)+ if isinstance(st, fal_client.InProgress) and t_run is None:+ t_run = time.time()+ print(f"running after {t_run - t0:.0f}s in queue", flush=True)+ if isinstance(st, fal_client.Completed):+ break+ time.sleep(5)+try:+ res = h.get()+except Exception as e: # noqa: BLE001+ res = {"error": str(e)[:6000]}+t1 = time.time()+timing = {"queued_s": round((t_run or t1) - t0, 1), "running_s": round(t1 - (t_run or t1), 1), "total_s": round(t1 - t0, 1),+ "request_id": h.request_id}+print(json.dumps(timing))+print(json.dumps(res, indent=1)[:8000])+if out:+ json.dump({"timing": timing, "result": res}, open(out, "w"), indent=1)diff --git a/unreal_fal_ue/tools/fetch.py b/unreal_fal_ue/tools/fetch.pynew file mode 100644index 0000000..9ef22c1--- /dev/null+++ b/unreal_fal_ue/tools/fetch.py@@ -0,0 +1,30 @@+"""Status and result of an earlier request (e.g. after the local watcher died).++ python fetch.py <app> <request_id> [out.json] [--wait]+--wait polls every 30 s until the request completes (restartable: only the request id is needed)."""+import json+import sys+import time++import fal_client++WAIT = "--wait" in sys.argv+sys.argv = [a for a in sys.argv if a != "--wait"]+app, rid = sys.argv[1], sys.argv[2]+st = fal_client.status(app, rid, with_logs=True)+while WAIT and not isinstance(st, fal_client.Completed):+ time.sleep(30)+ st = fal_client.status(app, rid, with_logs=True)+logs = getattr(st, "logs", None) or []+print(type(st).__name__, "log lines", len(logs))+for l in logs[-40:]:+ print(l.get("timestamp", ""), l.get("message", "")[:300])+if isinstance(st, fal_client.Completed):+ try:+ res = fal_client.result(app, rid)+ except Exception as e: # noqa: BLE001+ res = {"error": str(e)[:6000]}+ print(json.dumps(res, indent=1)[:8000])+ if len(sys.argv) > 3:+ json.dump({"result": res, "metrics": getattr(st, "metrics", None)}, open(sys.argv[3], "w"), indent=1)+ print("metrics", getattr(st, "metrics", None))diff --git a/unreal_fal_ue/tools/upload_export.py b/unreal_fal_ue/tools/upload_export.pynew file mode 100644index 0000000..3055094--- /dev/null+++ b/unreal_fal_ue/tools/upload_export.py@@ -0,0 +1,26 @@+"""Zip an AnyScene export folder (stored, no compression: PNG/GLB are already compressed) and upload it to fal storage.++ python upload_export.py <export_dir> <out.zip>+Prints the URL and writes it next to the zip as <out.zip>.url. FAL_KEY comes from the environment."""+import os+import sys+import time+import zipfile++import fal_client++src, dst = sys.argv[1], sys.argv[2]+t = time.time()+if not os.path.exists(dst):+ with zipfile.ZipFile(dst + ".part", "w", zipfile.ZIP_STORED, allowZip64=True) as z:+ for root, _, files in os.walk(src):+ for f in files:+ p = os.path.join(root, f)+ z.write(p, os.path.relpath(p, src).replace("\\", "/"))+ os.replace(dst + ".part", dst)+print(f"zip {os.path.getsize(dst) / 1e9:.2f} GB in {time.time() - t:.0f}s", flush=True)+t = time.time()+url = fal_client.upload_file(dst)+print(f"uploaded in {time.time() - t:.0f}s", flush=True)+print(url)+open(dst + ".url", "w").write(url)diff --git a/unreal_fx/CHANGES.md b/unreal_fx/CHANGES.mdnew file mode 100644index 0000000..6e4521f--- /dev/null+++ b/unreal_fx/CHANGES.md@@ -0,0 +1,92 @@+# unreal_fx → unreal: changes to merge++These files were developed in isolation from `anyscene/unreal/`. The baselines were copied at the start; their+checksums are in `ORIG.md5`. Merge them by copying the new files and applying the hunks below to the two changed+scripts.++## New files (copy as-is into `anyscene/unreal/`)++| File | Purpose |+|---|---|+| `fx_pack.py` | Builds `/Game/AnySceneFX` (materials and Niagara systems) headlessly from `fx_recipes/*.json` via NiagaraToolsets, then writes `templates.json` and `templates_report.json`. Env: `ANYSCENEFX_ONLY`, `ANYSCENEFX_RECIPES`, `ANYSCENEFX_ROOT`, `ANYSCENEFX_JSON` |+| `fxlib.py` | Synchronous wrapper over `unreal.ToolsetRegistry.execute_tool` (it decodes the double-encoded JSON results) |+| `fx_recipes/NS_{Fire,Steam,Smoke,Rain,Drips,DustMotes,Sparks,FountainJet}.json` | Declarative templates. A new effect type is a new recipe, with no code change |+| `fx_export.py` | Blender-side classifier and measurement. Writes `fx` entries per NIAGARA.md §4.2 (incl. `flicker`, `light_link`, `physical`, `bounds_local`, `seed`). It runs standalone too, patching an existing export without re-baking meshes |+| `templates.json` | The generated contract (param types + `fx_types`). Regenerate it with `fx_pack.py` |+| `FX_AGENT.md` | The agent loop for new scenes and new effect types |++## Round 2 fixes (fire + rain)++- `fx_pack.py`:+ - **`set_params` root cause.** `AddSetParametersModule` with an HLSL default silently stored a garbage literal+ (`Particles.DynamicMaterialParameter` x = -4.2e36), which blacked out every emissive sprite. That's why the fire was+ invisible and the rain emissive was 0. It now always adds a typed placeholder, rewires each entry to HLSL, and reads+ the values back. A dropped expression becomes a build issue.+ - **In-place rebuild.** Existing systems are stripped (emitters + user vars) and rebuilt. Existing materials get+ their graph cleared and rebuilt. No delete, consolidate or rename, so placed levels keep working and no `__build`+ assets are left behind.+ - **Sprite renderers.**+ - `PixelCoverageMode=Enabled`, so sub-pixel streaks keep their energy.+ - Non-uniform (elongated) sprites get no random rotation.+ - New `pivot` core option. NS_Fire uses `[0.5, 0.85]`, so tongues grow up from the spawn point.+ - **M_AFX_Flame** is now a soft gaussian tongue (it used to be a hard triangle).+ - NS_Fire's Flames and Core emitters run on GPU sim.+- `fx_export.py`:+ - **Fire is measured from what a camera can see.** `visible_field` ray-casts every emitting sample to every scene+ camera (volume-only objects count as see-through). Ring, band and spawn height come from the visible part.+ `physical.visibility` and `visible_rz` record it.+ - **Fire brightness = view-ray line integral** through the sampled emission (`view_radiance`), not local emission x+ ring spread. HK burners now read 3.2k and 3.7k nits (they used to read 9.7k, and later 1.2k vs 4.8k).+ - **Fire colour comes from the whole flame.** A guard falls back if the colour comes out black.+ - **Rain/drips Intensity** = 683 x drop emission x drop length / streak length (it used to be a 0.1 guess).+- `work/`: `fxstage.sh` (stages fx,sequences), `mrq.sh`, `clean_fire.py` (one-off cleanup of the old leftover), and+ probes (`probe_rend.py`, `probe_dp.py`, `proj_vis.py`).++## `export_blend.py` (one hunk, not yet applied in this copy, to keep the main exporter untouched while others run it)++In `main()`, after the object walk and before `scene = {...}`:+```python+ import fx_export # unreal/fx_export.py+ report["fx"] = fx_export.classify(sc, FRAME, sorted(emitters), sorted(report["volumes"]),+ os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates.json"))+ for e in report["fx"]:+ for o in e["source"]["objects"]:+ if o in report["volumes"]:+ report["volumes"][o]["claimed_by_fx"] = True+```+(`sys.path` already contains the script's folder when Blender runs it with `--python`. If it doesn't, add+`sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))`.) The old `report["fx"]` note entries are replaced.+On HK, the standalone equivalent is:+`blender -b work/hk_copy.blend --python unreal/fx_export.py -- --scene export/scene.json --out <dir>/scene.json --frame 60` (45 s).++## `build_level.py` (applied in `unreal_fx/build_level.py`; diff it against `unreal/build_level.py`)++1. Docstring and env:+ - `ANYSCENE_STAGES` gains `fx`. The default is now `textures,meshes,materials,level,fx,sequences`.+ - New `ANYSCENE_FX_OVERRIDES` (look-match overrides JSON), `ANYSCENE_CLIP_FRAMES` (default 96) and+ `ANYSCENE_MRQ_OUT` (MRQ output folder; the default stays `<export>/../compare/mrq`).+2. **Local fog volume fix** in `stage_level`:+ - Volumes with `claimed_by_fx` are skipped (flames and plumes are Niagara now).+ - Scale is uniform: `max(extent) / 500` (base radius 500 cm, max-axis sphere).+ - `radial_fog_extinction = sigma × 2r` (optical depth through the centre).+ - `fog_emissive` is multiplied by 683.+3. New `fx_params`, `place_fx`, `stage_fx`:+ - The asset is set first, then the typed user params (+ overrides), then every param is read back; invalid+ params go to `REPORT["errors"]`.+ - Seed offset = `crc32(id)`.+ - Fixed local bounds, warm-up ticks = `preroll_s × fps`, `allow_scalability` off.+ - The stage is rerunnable on its own: it deletes `FX_*` actors first.+4. New `key_flicker`: per camera sequence, a float track on the linked practical light's intensity, built from the+ exporter's sampled `flicker.values`.+5. `stage_sequences`:+ - Playback and camera-cut range are `max(48, CLIP_FRAMES)`.+ - New `MRQ_Clip` config (frames `0..CLIP_FRAMES`).+ - `engine_warm_up_count = max(64, ceil(1.5 × longest preroll × fps))`.+ - `use_camera_cut_for_warm_up = False` is now set explicitly.++## Project requirements (`AnySceneUE.uproject` / playground)++- Enable the `Niagara`, `ToolsetRegistry` and `NiagaraToolsets` plugins. The toolsets are only needed where+ `fx_pack.py` runs; rendering only needs Niagara plus the `/Game/AnySceneFX` content.+- MRQ renders: add `fx.Niagara.ForceWaitForCompilationOnActivate=1` to `-dpcvars` in `render_mrq.ps1` and `perf.ps1`.+- The copy project sets `bRemoteExecution=False`, so headless instances don't answer the user's `ue.py` bridge.diff --git a/unreal_fx/FX_AGENT.md b/unreal_fx/FX_AGENT.mdnew file mode 100644index 0000000..aa0e595--- /dev/null+++ b/unreal_fx/FX_AGENT.md@@ -0,0 +1,84 @@+# FX_AGENT.md: converting any Blender effect to Niagara, by script++The effects layer is generic by construction. Nothing in it is specific to the HK scene. Read `NIAGARA.md` first for+the Unreal and Niagara background. This page covers the loop the converter (and the `/scene2unreal` agent) runs for+any scene.++```+Blender scene ──fx_export.py──▶ scene.json "fx" ──build_level.py (stage fx)──▶ NiagaraActors ──MRQ──▶ compare with Cycles+ classify + measure place, set User params, │+ read back, bounds, seed, warm-up ▼+ ◀── overrides.json (tuning, no re-export)+templates.json ◀──fx_pack.py◀── fx_recipes/*.json (new effect type = new recipe, no code)+```++## 1. The pieces++| File | What it does | Who edits it |+|---|---|---|+| `fx_recipes/NS_*.json` | One Niagara template each: emitters, module rewiring (links, one-line HLSL, enums), extra modules, renderers, and its own sprite materials (HLSL bodies). Ships: Fire, Steam, Smoke, Rain, Drips, DustMotes, Sparks/Embers, FountainJet | humans, or the agent for a new effect type |+| `fx_pack.py` | Builds `/Game/AnySceneFX` headlessly from the recipes through Epic's NiagaraToolsets, then writes `templates.json` (the param types, plus the `fx_types` each template serves) | nobody, per scene |+| `fx_export.py` | Blender side. Classifies volume shaders and particle systems by evidence: emission, drivers, albedo, velocity, gravity, lifetime, names. It measures the effect (baked density and emission slices: base, lean, reach, ring radius, optical depth; driver scroll speed; particle rate, speed, size; ground ray cast) and writes the `fx` entries | rules only |+| `build_level.py` `stage_fx` | Places a `NiagaraActor` per entry and sets the asset, then the typed params, then reads every param back (invalid = error). Also sets fixed bounds, the seed and the warm-up, and keys sampled light flicker into the camera sequences | nobody |+| `overrides.json` (`ANYSCENE_FX_OVERRIDES`) | `{fx_id or "type:<type>": {Param: value}}` applied on top of `scene.json`. This is the look-match knob, and it is reproducible | the agent |++## 2. The agent loop for a new scene++1. Run `fx_export.py`. Every entry gets `type`, `confidence`, `evidence`, the measured `physical` block and+ `params`.+2. **`technique: "agent"`** means no template serves that `type`, or the object was unclassifiable (`unknown`).+ Read its `evidence`, `physical` and `source.objects`, and look at the object in Blender (its node tree and+ modifiers). Then:+ - **An existing template fits** (a lava bubble is a slow orange `NS_Steam`; a waterfall mist is `NS_Steam` with+ a white albedo): set `technique: "niagara"`, `template`, and `params` in `overrides.json`, or patch the entry.+ - **Nothing fits** (falling leaves, snow, bubbles, fireflies, ribbons of a trail): write+ `fx_recipes/NS_<Name>.json`. Copy the closest recipe and change:+ - `fx_types`: the classifier types the template serves (add a type word to `TYPE_WORDS` in `fx_export.py` if+ it is new);+ - `common`: real-world defaults (cm, cm/s, s, nits);+ - `emitters[].core`: `gpu`, `material`, `aligned` (velocity-aligned streaks), `nonuniform` (Aspect = length /+ width), `curl`, `grow`, `sort`, `fade`;+ - `emitters[].inputs`: `[script, module, input, value]`, where `value` is a number, a bool,+ `{"link": "User.X", "type": "float"}`, `{"hlsl": "..."}` or `{"enum": "Display Name"}`. Hidden inputs need+ their parent switch set first: the tool refuses them and says so;+ - `emitters[].add_modules`: `{"asset": "/Niagara/Modules/...", "script": ..., "before": "SolveForcesAndVelocity",+ "inputs": {...}}`;+ - `emitters[].set_params`: `[script, "Particles.X", type, hlsl, before?]`;+ - `materials`: `{"M_AFX_<Name>": {"blend": "ADDITIVE|TRANSLUCENT", "lit": bool, "rgb": hlsl, "base": hlsl,+ "op": hlsl, "depth_fade": cm}}`. The HLSL bodies see `UV`, `PC` (particle colour), `PA` (alpha), `R`+ (random), `T` (time), `DP` (x = Intensity, y = Temperature) and the helpers `X.fbm(float2)` and+ `X.bb(kelvin)`.++ Keep the shared User parameter names (NIAGARA.md §3). Add scene-specific ones under `extra`.+3. Build only the new template. This takes about 1 minute, and the other templates stay as they are:+ `ANYSCENEFX_ONLY=NS_<Name> UnrealEditor-Cmd <proj> -run=pythonscript -script=fx_pack.py`.+ Check `templates_report.json`: `issues` must be empty and `compile.bHasErrors` false.+4. Run `build_level.py` with `ANYSCENE_STAGES=fx,sequences`. `build_report.json` → `fx[].params_invalid` must be+ empty.+5. Render MRQ stills and clips of the cameras that see the effect, and compare against Cycles (NIAGARA.md §6). Tune+ **only** through `overrides.json`: change one parameter per round, at most three rounds. If it still does not+ match, change the template or technique (flipbook / SVT, NIAGARA.md §5).++## 3. Rules learned on HK (apply everywhere)++- **Measure what a camera sees.** `fx_export` ray-casts each emitting sample to the scene cameras. On HK the only+ visible flame is the outer tail in the gap between the wok and its collar, about 1% of the volume. Brightness is the+ emission integrated along the view ray, and a grazing ray through a ring of flame is far brighter than one tongue.+- **Debug a dark sprite with a solid material.** Copy the recipe to `work/dbg_recipes/`, set+ `rgb: "return float3(50,0,50) * PA;"`, build with `ANYSCENEFX_RECIPES`, and place it from a scene.json copy. If the+ quads show up, the simulation is fine and the material inputs (PC, DP) are wrong.+- **Measure the visible part of the effect, not the whole volume.** Burner flames are full strength *under* the+ wok, where Cycles hides them too. Spawning there put every sprite inside the pan. `fx_export` now spawns fire on+ the upper half of the emitting band, at the outer edge of the ring.+- **A ring's slice "spread" is its radius, not the tongue width.** Size flame sprites from the flame height.+- **Steam opacity is tiny.** τ ≈ σ·width ≈ 0.05 for HK's woks, and the Cycles plume is barely visible. Don't+ "fix" a faint plume into fog.+- **Rain streaks need the shutter.** Length = drop + speed × shutter / fps. Cycles renders them motion-blurred.+- **Practical lights already exist.** `light_link` takes the brightest light within 1 m. Niagara's own light stays+ at 0, and the sampled `flicker` drives the practical light's intensity in Sequencer instead.+- **Headless gotchas:**+ - `GetStackIssues` asserts without Slate: only run it in a full editor (`ANYSCENEFX_STACK_ISSUES=1`).+ - `AddSetParametersModule` accepts HLSL defaults only for some types. `fx_pack` falls back to a typed default and+ then rewires the input.+ - `DefaultSystem` ships a stock "Fountain" emitter, which `fx_pack` removes.+ - Enum inputs come back as `NewEnumeratorN`: resolve them by display name (`UEnum_Info`).diff --git a/unreal_fx/NIAGARA.md b/unreal_fx/NIAGARA.mdnew file mode 100644index 0000000..72bd5cb--- /dev/null+++ b/unreal_fx/NIAGARA.md@@ -0,0 +1,655 @@+# NIAGARA.md: porting AnyScene (Blender/Cycles) effects to Unreal 5.8++This is the converter agent's guide to effects: flames, steam, smoke, haze plumes, rain or drizzle, drips and splashes,+sparks and embers, dust motes, fountain jets, and screen or light flicker. Geometry, materials, lights, cameras and fog+already convert (`export_blend.py` writes `scene.json`, then `build_level.py` builds the level). This file covers+what comes next: classify each Blender effect, pick a technique, place it, render it through MRQ and compare it+with Cycles.++Everything marked *[engine]* was confirmed in the installed UE 5.8 files under `C:\Program Files\Epic Games\UE_5.8`.+Items marked *[docs]* come from dev.epicgames.com. Items marked *[untested]* are design guidance: verify them on the+first scene and update this file.++---++## 0. Read this first: findings that change the plan++1. **No built-in fire, steam, smoke or rain system ships with 5.8.** The Niagara plugin includes only generic emitter+ templates (Fountain, HangingParticulates, RecycleParticlesInView, BlowingParticles, DirectionalBurst, ...). There is+ no StarterContent `P_Fire` / `P_Steam` on this install. Real fire and smoke exist only as **NiagaraFluids** grid sims,+ which are Beta and expensive. Plan on an **AnySceneFX content plugin**: about ten master systems authored once, so+ the converter only places them and sets their parameters. Never author Niagara graphs at build time.+2. **Local fog volumes in `build_level.py` are the wrong size.** `ULocalFogVolumeComponent::GetBaseVolumeSize()`+ returns **500 cm**, and the proxy collapses the scale to a uniform sphere using the **max axis**+ (`LocalFogVolumeSceneProxy.cpp:34`) *[engine]*. `build_level.py` assumes a 100 cm unit and non-uniform scale, so+ every LFV comes out about 5x too large and spherical. That is why the wok "flame" became a large static emissive+ glow. `RadialFogExtinction` is also integrated in unit-sphere space: the optical depth straight through the centre+ is exactly `RadialFogExtinction`, independent of size (`LocalFogVolumeCommon.ush:178-203`). The correct mapping is+ **extinction = Blender density (1/m) x path length (m)**, not the raw density.+3. **Particles never reach the level.** The exporter only logs particle emitters into `fx` (no transform, no bounds,+ no velocity), and `build_level.py` ignores `fx`. That is why the HK drizzle and drips are missing. Steam is+ procedural 4D-noise volume shaders, which the exporter samples at one frame into a static LFV. Animated steam+ cannot survive that path.+4. **MRQ needs `render_warm_up_frames = True` for GPU particles.** The flag's own tooltip says GPU particles need the+ warm-up frames to be rendered *[engine: MoviePipelineAntiAliasingSetting.h]*. `build_level.py` already sets it+ (64 engine warm-up frames). Keep it, and keep `use_camera_cut_for_warm_up = False`, or `engine_warm_up_count` is+ ignored.+5. **Pass `fx.Niagara.ForceWaitForCompilationOnActivate=1` in `-dpcvars` for every headless render.** Otherwise a+ component activates while its scripts or GPU shaders are still compiling, and the first frames render without the+ effect. This is the Niagara equivalent of the `Editor.AsyncAssetCompilation=0` gotcha already in+ `render_shots.py`. The per-component property `bWaitForCompilationOnActivate` is editor-only data+ (`NiagaraComponent.cpp:1358`) *[engine]*.+6. **User parameters set from Python in the editor are saved with the level.** In editor builds, `SetVariableFloat`+ and the other setters also call `SetParameterOverride`, which writes `InstanceParameterOverrides`+ (`NiagaraComponent.cpp:2875, 4376`) *[engine]*. So build, set, `save_current_level()` works headlessly. The+ parameter must exist on the asset and the type must match exactly. A wrong name or wrong type is a **silent no-op**.+7. **Epic ships an AI toolset for Niagara authoring:** `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (plus+ `ToolsetRegistry`, both disabled by default). Its tools create systems, add emitters, modules, renderers and user+ variables, set stack inputs, and read compile errors and stack issues. You can call them from Python through+ `unreal.ToolsetRegistry.execute_tool(toolset, tool, json)`. Use this for the **one-time** authoring of the AnySceneFX+ templates, in a full editor session with an RHI. Do not use it in the per-scene build. It is Experimental. Its+ bundled skills (`Content/Python/skills/*.py`) are worth reading. They are summarised in §1 where relevant.+8. **Animated SVTs import headlessly from VDB.** `USparseVolumeTextureFactory` skips its dialog when the import is+ automated or running in a commandlet, auto-detects numbered `.vdb` sequences, and maps the `density` grid to+ attributes A.R (unorm8), with up to 4 other grids in B (fp16) (`SparseVolumeTextureFactory.cpp:40-108, 436`)+ *[engine]*. Blender 5.0 bundles the `openvdb` Python module (`5.0/python/lib/site-packages/openvdb.cp311-*.pyd`), so+ the exporter can write VDBs from procedural volumes itself.++---++## 1. Niagara essentials (only what the converter needs)++- **System > emitters > modules.** A *system* (`UNiagaraSystem`, the asset you place) contains *emitters*. Each+ emitter runs four script stacks in a fixed order: System Spawn/Update, then Emitter Spawn/Update, then Particle+ Spawn/Update. Spawn runs once at creation and Update runs every tick. Within Particle Update the order is forces,+ then collision, then exactly one velocity solve. *Renderers* (sprite, mesh, ribbon, light, ...) draw an emitter's+ particles.+- **Namespaces.** `User.*` is the external interface: set per component, read anywhere. `Engine.*` is read-only (delta+ time, owner transform). `System.*`, `Emitter.*` and `Particles.*` are written by their own scope.+ **Expose everything the converter sets as a `User.` parameter.** From Python, pass the bare name (`SpawnRate`). The+ `User.` prefix also resolves (`RedirectUserVariable`). There is no enum setter: set the int.+- **Types matter.** World-space anchors are `Position` (LWC-aware): use `set_variable_position`. Directions,+ velocities, wind and box extents are `Vector3`: use `set_variable_vec3`. Colours are `LinearColor`.+- **CPU vs GPU.** System and emitter scripts always run on the CPU VM. Only particle scripts move to the GPU.+ - Use **GPU** for anything sustained in the hundreds or more (rain, dust, steam puffs, sparks).+ - Use **CPU** for small counts and for any emitter with a **Light renderer**: light, decal and component renderers+ force the emitter to CPU.+ - A system can mix both.+- **Fixed bounds.** Use fixed bounds for every converter-placed effect. They are cheapest, work on CPU and GPU, and+ stop the culling surprises. Dynamic bounds are CPU-only. GPU emitters without fixed or programmable bounds cull+ wrongly. Set them per instance with `set_system_fixed_bounds(Box)` in **local space**: use the Blender domain or+ emitter box plus travel distance (velocity x lifetime).+- **Warm-up and pre-roll.** `UNiagaraSystem.WarmupTime / WarmupTickCount / WarmupTickDelta` simulate N ticks on+ activation in one frame. Per instance, set `override_warmup_settings = True`, `warmup_tick_count` and+ `warmup_tick_delta`. The component passes these to the instance at activation (`NiagaraComponent.cpp:1219`)+ *[engine]*. Rule: **warm-up time ≥ the longest particle lifetime x 1.5**, so the effect is in steady state on+ frame 1. Mirror Blender's negative `frame_start` (HK drizzle starts at -80) or the Mantaflow `PREROLL`.+- **Determinism and seeds.**+ - The system flag `bDeterminism` + `RandomSeed` makes the instance seed equal the system seed plus the component's+ `RandomSeedOffset`. Without it, every reset gets a random seed.+ - Emitters carry their own `bDeterminism` / `RandomSeed` too.+ - Turn both on in every AnySceneFX template. Set `set_random_seed_offset(hash(fx_id) & 0x7fffffff)` per instance so+ copies differ but runs repeat. The offset is applied on activation or reset, so set it before saving.+ - CPU emitters with determinism repeat exactly under MRQ's fixed timestep. Treat GPU emitters as "very close" *[untested]*.+ For bit-exact repeats, use a sim cache (§2.6).+- **Lit vs unlit sprites.**+ - Fire, embers, sparks, CRT glow: **unlit**, additive or translucent, emissive only.+ - Steam, smoke, haze, dust, rain: **lit translucent**. Use *Translucency Lighting Mode = Volumetric NonDirectional*+ (cheapest, soft) or *Volumetric PerVertex NonDirectional*. The directional modes only matter for normal-mapped+ smoke.+ - Prefer Masked over Translucent where blending allows (drops, chunky debris).+ - Translucent materials need **Two Sided** when seen from both sides.+ - Each material needs the usage flag for its renderer: `MaterialEditingLibrary.set_material_usage(mat,+ unreal.MaterialUsage.MATUSAGE_NIAGARA_SPRITES)`. In 5.8 the `bUsedWith*` flags are deprecated in favour of the+ usage accessor *[engine: Material.h:749]*.+- **Lumen.**+ - Particles do not contribute to Lumen GI or reflections as emitters: a fire sprite lights nothing. Light comes from+ a real light (§3, Lighting).+ - Lit translucent particles receive Lumen GI through the low-resolution translucency lighting volume, so expect+ soft, slightly flat shading.+ - Emissive particles are not in the Lumen scene: they will not show in reflections the way Cycles shows them.+- **Volumetric fog.**+ - A sprite with a **Volume-domain material** injects albedo, emissive and extinction into the volumetric-fog froxel+ grid. This gives real 3D density with no billboard edges *[docs: Volumetric Fog]*. Mesh renderers reject the Volume+ domain *[engine: NiagaraMeshRendererProperties.cpp:1380]*.+ - It needs an Exponential Height Fog with *Volumetric Fog* on, which the converter already spawns.+ - The grid is coarse and camera-aligned, so use it for haze plumes and soft steam bodies, not crisp wisps.+- **Translucency sorting.**+ - Within an emitter: `SortMode = ViewDepth` on the sprite renderer. Leave it at `None` for additive fire and sparks;+ sorting costs GPU time.+ - Between components, sorting is by bounds centre. Fix wrong-order overlaps with the primitive property+ `translucency_sort_priority`, or by splitting the bounds.+- **Depth of field.** Translucent materials default to `TranslucencyPass = MTP_AfterDOF` *[engine: Material.cpp:1183]*,+ so out-of-focus steam stays sharp. For effects in defocused regions (foreground steam in `cam_wok`), set+ `TranslucencyPass = MTP_BeforeDOF` in the template material, or in a second material variant.++---++## 2. Placing and driving Niagara from Python, headless++### 2.1 Confirmed API (UE 5.8, from `NiagaraComponent.h`, `NiagaraActor.h`, `NiagaraFunctionLibrary.h`)++| Need | Call |+|---|---|+| Place | `eas.spawn_actor_from_class(unreal.NiagaraActor, loc, rot)`. Same reason as `spawn_mesh()` in `build_level.py`: spawn by class in the commandlet |+| Component | `act.get_editor_property("niagara_component")` (UPROPERTY `NiagaraComponent`) |+| Set asset | `nc.set_asset(system, True)`. The second arg resets existing overrides: set the asset **first**, then the parameters |+| Float, int, bool | `nc.set_variable_float(name, v)`, `set_variable_int`, `set_variable_bool` |+| Vector, colour | `set_variable_vec3(name, unreal.Vector)`, `set_variable_vec2`, `set_variable_vec4`, `set_variable_linear_color(name, unreal.LinearColor)`, `set_variable_quat` |+| Position (LWC) | `set_variable_position(name, unreal.Vector)` |+| Objects | `set_variable_texture`, `set_variable_material`, `set_variable_static_mesh`, `set_variable_object`, `set_variable_actor` |+| Read back (verify) | `get_variable_float(name)` and the like. In Python these return `(value, is_valid)`; assert `is_valid` |+| Seed | `nc.set_random_seed_offset(int)` |+| Bounds | `nc.set_system_fixed_bounds(unreal.Box)`, `set_emitter_fixed_bounds(emitter_name, box)`; read back with `get_system_fixed_bounds()` |+| Warm-up | `nc.set_editor_property("override_warmup_settings", True)`, `("warmup_tick_count", n)`, `("warmup_tick_delta", dt)` |+| Scalability | `nc.set_allow_scalability(False)`. Cinematic renders must not be distance-culled by an Effect Type |+| Sequencer age | `set_age_update_mode(unreal.NiagaraAgeUpdateMode.DESIRED_AGE_NO_SEEK)`, `set_desired_age(t)`, `seek_to_desired_age(t)` |+| Manual sim | `advance_simulation(ticks, dt)`, `advance_simulation_by_time(seconds, dt)`, `reset_system()`, `reinitialize_system()` |+| Sim cache | `set_sim_cache(cache, reset)`. Capture with `NiagaraSimCacheFunctionLibrary.capture_niagara_sim_cache_immediate(...)` |+| Runtime spawn | `unreal.NiagaraFunctionLibrary.spawn_system_at_location(world, system, loc, rot, scale, auto_destroy, auto_activate, pool, precull)`. Do not use it for level building: it is a transient runtime spawn |++Python names are the snake_case form of the C++ names, with a property's `b` prefix dropped. No stub exists yet+(`Intermediate/PythonStub/unreal.py` is generated only with Developer Mode on). On first use, run+`dir(unreal.NiagaraComponent)` in the build log and fix any name that differs.++### 2.2 Placement snippet (goes into a `stage_fx()` in `build_level.py`)++```python+NS = {}+def fx_system(path):+ if path not in NS:+ NS[path] = unreal.load_asset(path)+ if NS[path] is None:+ warn(f"fx template missing: {path}")+ return NS[path]++def place_fx(eas, fx):+ sysasset = fx_system(fx["template"])+ if sysasset is None:+ return None+ q = fx["transform"]["quat"]+ act = eas.spawn_actor_from_class(unreal.NiagaraActor, V(fx["transform"]["loc"]),+ unreal.Quat(*q).rotator())+ act.set_actor_label("FX_" + fx["id"]); act.set_folder_path("FX")+ nc = act.get_editor_property("niagara_component")+ nc.set_asset(sysasset, True) # 1. asset first (resets overrides)+ for k, v in fx["params"].items(): # 2. typed user params+ t = fx["param_types"][k]+ if t == "float": nc.set_variable_float(k, float(v))+ elif t == "int": nc.set_variable_int(k, int(v))+ elif t == "bool": nc.set_variable_bool(k, bool(v))+ elif t == "vec3": nc.set_variable_vec3(k, V(v))+ elif t == "pos": nc.set_variable_position(k, V(v))+ elif t == "color": nc.set_variable_linear_color(k, unreal.LinearColor(*v[:3], v[3] if len(v) > 3 else 1))+ nc.set_random_seed_offset(fx["seed"]) # 3. determinism+ b = unreal.Box(); b.min = V(fx["bounds_local"]["min"]); b.max = V(fx["bounds_local"]["max"]); b.is_valid = True+ nc.set_system_fixed_bounds(b) # 4. bounds (local)+ nc.set_editor_property("override_warmup_settings", True) # 5. pre-roll+ nc.set_editor_property("warmup_tick_delta", 1.0 / 30.0)+ nc.set_editor_property("warmup_tick_count", int(math.ceil(fx["time"]["preroll_s"] * 30)))+ nc.set_allow_scalability(False)+ for k, t in fx["param_types"].items(): # 6. verify: silent no-ops are the main failure+ if t == "float":+ val, ok = nc.get_variable_float(k)+ if not ok: warn(f"{fx['id']}: user param {k} not on {fx['template']}")+ return act+```+Then call `les.save_current_level()`, as `stage_level` already does. Construct `unreal.Box` the way above, or with+keyword args. Check the result with `get_system_fixed_bounds()`.++### 2.3 Commandlet (`-run=pythonscript`) limits++- **Commandlets render nothing.** A commandlet uses the null RHI unless it is started with `-AllowCommandletRendering`+ (`LaunchEngineLoop.cpp:2246`) *[engine]*.+ - These need no RHI and work in the commandlet: placing actors, setting user parameters, fixed bounds, warm-up+ fields, seeds, and saving.+ - GPU emitters do not simulate there, and their compute shaders are not exercised.+ - Niagara VM script compilation is a DDC/ShaderCompileWorker job. It works from a commandlet, as cooking proves.+ Ship the templates **pre-compiled and saved** in the AnySceneFX plugin, so a fresh build only loads them.+- **The first render compiles shaders.** GPU sim shaders and particle material shaders compile on the first+ `-game -RenderOffscreen` run.+ - Pass `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Budget a one-off cold-DDC compile of about 2-5 minutes per new template set. Keep the DDC on persistent storage+ (`/data`) in the container.+- **Don't author Niagara graphs in the commandlet.** `UNiagaraSystemFactoryNew` exposes no Python properties.+ `EditorAssetLibrary.duplicate_asset()` works for "copy a template and tweak it", but tweaking stack inputs needs+ the NiagaraToolsets editor functions, which expect a full editor. Per-scene variation goes through user parameters,+ not new assets.+- **Plugins.** Niagara is on by default. If you use NiagaraFluids (Beta), NiagaraSimCaching or NiagaraMRQ, enable them+ in `AnySceneUE.uproject` (`"Plugins"`) **before** the build. Enabling a plugin mid-session needs a restart.++### 2.4 MRQ settings for particles (the `MRQ_Still` / `MRQ_Linear` configs in `stage_sequences`)++- `MoviePipelineAntiAliasingSetting`:+ - `engine_warm_up_count = 64`: game-thread ticks with no render; the cheap warm-up.+ - `render_warm_up_frames = True`: required for GPU particles, depth-buffer collision and GPU warm-up.+ - `use_camera_cut_for_warm_up = False`.+ - `temporal_sample_count = 8`: Niagara ticks once per temporal sub-sample, so the accumulation itself gives sprite+ motion blur.+ - Raise `engine_warm_up_count` to `ceil(max_lifetime_s x fps x 1.5)` when the scene's longest lifetime exceeds+ 64/24 s, for example slow steam with 6 s lifetimes.+- **Fixed timestep.** MRQ always steps the world at the sequence rate. Particle state is a pure function of frames+ since activation plus the seed, so the warm-up count must be identical between runs.+- **Pre-roll belongs in the asset or component.** Component warm-up (§2.2) runs on activation, before any MRQ frame.+ Use both component warm-up and MRQ engine warm-up: the first covers steady state, the second covers shader compile+ and streaming.+- `MoviePipelineGameOverrideSetting` (already added) forces cinematic scalability. Also call `set_allow_scalability(False)`+ on every component so Effect Type culling can't drop an effect.+- **Sequencer track (optional, for exact scrubbing).** Add a Niagara System track to the camera's level sequence,+ with a spawn section set to `SectionEvaluateBehavior = ActivateIfInactive` and+ `AgeUpdateMode = DesiredAgeNoSeek`. Age then follows sequence time instead of wall-clock ticks+ (`MovieSceneNiagaraSystemSpawnSection.h`) *[engine]*. Only do this if stills differ between runs.+- **NiagaraMRQ plugin.** It adds a data interface that tells a system whether MRQ is running, plus the temporal sample+ index and count. Use it only if a template must branch for offline quality, for example more particles under MRQ.++### 2.5 Light and screen flicker (not Niagara)++- **Flickering lights.** HK `wok_fire_*` uses a Python driver on `energy`.+ - Do not parse driver expressions. **Sample** the evaluated value per frame in the exporter: `frame_set(f)`, read+ `L.energy` for frames `[start, start+N)`.+ - Write `flicker.values` and key a Sequencer float track on the light's `intensity`, in the camera sequence.+ - Rendered through MRQ, this is deterministic and frame-exact.+- **CRT, screen and sign flicker.** Use a material, not Niagara.+ - Add `FlickerAmp`, `FlickerHz` and `ScanlineDensity` scalar parameters to `M_AnyBaked`'s emissive path, or to a+ dedicated `M_AnyScreen` master: emissive x (1 + amp x noise(time x Hz)), plus a rolling bar.+ - The source is `animated_materials` in the asset entry. Sample the emission strength curve the same way as lights.++### 2.6 When exact repeatability matters: sim caches++Capture the steady-state window once and assign it with `set_sim_cache`. Playback is then identical every run. Use+`capture_niagara_sim_cache_immediate` / `..._multi_frame` from `NiagaraSimCacheFunctionLibrary` in an editor session+with an RHI, or record with a Niagara Cache track in Sequencer (plugin `NiagaraSimCaching`). Only needed for hero+shots and A/B parameter tuning, where seed noise would hide a parameter change.++---++## 3. The template library (`/AnySceneFX/`)++Build these as a content plugin, `Plugins/AnySceneFX/Content/Systems/NS_*.uasset`, authored once and committed.++**Shared rules for every template.**+- `bDeterminism` on, at system and emitter level.+- Fixed bounds mode.+- World space, not local.+- Warm-up 0 in the asset. The converter sets it per instance.+- Every tunable is a `User.` parameter with a real-world default (cm, cm/s, s, nits, K).++**Common user parameters**, the same names in every system so the placement code stays generic:++| Name | Type | Meaning |+|---|---|---|+| `SpawnRate` | float | particles per second (or `Count` for bursts) |+| `LifetimeMin`, `LifetimeMax` | float | seconds |+| `SizeMin`, `SizeMax` | float | sprite size, cm |+| `Velocity` | vec3 | initial velocity, cm/s, world |+| `VelocityJitter` | float | 0..1 fraction (Blender `factor_random`) |+| `Wind` | vec3 | constant drift, cm/s |+| `Gravity` | float | 0..1 x 980 cm/s² |+| `BoxExtent` | vec3 | spawn box half-extent, cm (spawn shape = local box) |+| `Color` | color | albedo (lit) or emissive tint (unlit) |+| `Intensity` | float | emissive luminance multiplier, nits |+| `Opacity` | float | per-sprite peak alpha |+| `Temperature` | float | K, feeds a material `BlackBody` node (fire, embers) |+| `NoiseStrength`, `NoiseFreq` | float | curl-noise force amplitude and frequency |++The seed is not a parameter: it is the component's `RandomSeedOffset`.++**Starting assets that ship with 5.8.** These are mount paths. The engine plugin `/Niagara/` lives at+`Engine/Plugins/FX/Niagara/Content/`, and `/NiagaraFluids/` at `Engine/Plugins/FX/NiagaraFluids/Content/`.++- Emitters: `/Niagara/DefaultAssets/Templates/Emitters/{Fountain, HangingParticulates, RecycleParticlesInView,+ BlowingParticles, DirectionalBurst, OmnidirectionalBurst, SimpleSpriteBurst, SingleLoopingParticle, Minimal,+ UpwardMeshBurst, LocationBasedRibbon, StaticBeam, DynamicBeam, ConfettiBurst}`+- Systems: `/Niagara/DefaultAssets/Templates/Systems/{FountainLightweight, DirectionalBurst, RadialBurst,+ SimpleExplosion, MinimalLightweight, ...}`. The `*Lightweight` systems use stateless emitters, which the Niagara+ toolset cannot edit. Copy the stateful emitters instead.+- Behaviour examples (reference wiring): `/Niagara/DefaultAssets/Templates/BehaviorExamples/{SubUVAnimation,+ SpriteFacingAndAlignment, KillParticles, ...}`+- Fluids (Beta): `/NiagaraFluids/Templates/Gas/3D/Systems/{Grid3D_Gas_Fire, Grid3D_Gas_Smoke, Grid3D_Gas_ColoredFire,+ Grid3D_Gas_ColoredSmoke, Grid3D_MovingGridFire, Grid3D_Gas_Explosion}`, `.../Gas/2D/Systems/{Grid2D_Gas_SmokeFire,+ Grid2D_Gas_Smoke, Grid2D_Gas_MovingFire}`, `/NiagaraFluids/Templates/Liquid/3D/Systems/{Grid3D_Flip_Hose,+ Grid3D_Flip_Splash, Grid3D_Flip_Pool}`; materials `/NiagaraFluids/Materials/Grid3D/M_RayMarch_Fire*`,+ `MI_HeterogeneousVolumes_*`.+- Default sprite materials: `/Niagara/DefaultAssets/DefaultSpriteMaterial`, `M_DepthFade_SpriteSimple`.++**Units used in the mappings below.**+- Blender is metres, the exporter writes centimetres, and Blender axes map to Unreal as (x, -y, z).+- Volume density σ is extinction per metre. Volume emission strength *E* adds radiance per metre, so a slab of+ thickness *t* m that is optically thin glows at about *E·t* (Blender radiance units) = **683·E·t nits**. This is the+ same 683 lm/W the exporter uses for surfaces.+- **Sprite opacity from density.** For a plume of depth *L* (m) seen through *n* overlapping sprites, the target+ optical depth is τ = σ·L. Per-sprite α = 1 − exp(−τ/n). Estimate *n* ≈ SpawnRate × Lifetime × (sprite area ÷+ plume cross-section area).++### 3.1 Per-effect table++| Effect | AnySceneFX system, and how to start it | Key parameter mapping from Blender | Lighting | Real-time budget |+|---|---|---|---|---|+| **Fire / flames** (gas jets, wok, candles, braziers) | `NS_Fire`. Start from `SingleLoopingParticle` + `Fountain` (stateful copies). Two emitters: (a) a **SubUV flame** emitter with a flipbook **baked from the Blender flame volume** (§5.1), unlit additive, random start frame, `bSubImageBlend`; (b) a small blue-core emitter. Hero close-ups: `Grid3D_Gas_Fire` or an SVT (§5) | Domain box → `BoxExtent` and the emitter ring radius. Principled Volume `Emission Strength` x density-ramp peak x thickness → `Intensity` (683·E·t nits). `Emission Color` ramp at 0.6 → `Color`, or `Blackbody Intensity`/`Temperature` → `Temperature`. Flame height (density falloff z) → `Velocity.z` x Lifetime. Noise scroll rate (driver `frame*k`) → flipbook fps | Fire itself lights nothing. **Reuse the Blender practical lights** (`wok_fire_*`, `wok_blue_*` convert already) with the sampled flicker track (§2.5). If the scene has no light, add one CPU emitter with a Light renderer: one particle, `RadiusScale` ≈ flame height x 4, `bAffectsTranslucency` on. Cap: ≤ 4 Niagara lights per scene, ≤ 1 per fire | ≤ 40 sprites per flame, about 0.1 ms. Fluids fire: 1-3 ms at 64³; cinematic only |+| **Steam** (woks, pots, kettles, vents) | `NS_Steam`. Start from `Fountain`. GPU sprites, lit translucent (Volumetric NonDirectional), soft puff texture or a baked steam flipbook, curl noise, size grows x3-5 over life, alpha fades in and out. Add a second **Volume-domain sprite** emitter (§1) for the dense core when volumetric fog is on | Plume box (HK `steam_wok_i`: bottom z = wok rim, top = awning): base disc radius = 0.08 x box width → `BoxExtent`; `rise` (driver `-frame*rise`, m/frame) x fps x 100 → `Velocity.z`; `lean` → `Wind`. Lifetime = box height ÷ rise speed. Density `strength` x 9 (shader constant) = σ peak → `Opacity` by the formula above. `Color` 0.9 grey, anisotropy 0.5 → material phase (backlit glow: enable forward scatter in the material, or rely on volumetric fog) | Lit by scene lights. Needs the practical light behind it to read (HK hood strip, bulbs). `TranslucencyPass = BeforeDOF` for foreground plumes | 200-600 sprites per plume, 0.2-0.5 ms (overdraw-bound) |+| **Smoke** (cigarette curls, exhaust, chimneys) | `NS_Smoke` = `NS_Steam` with a darker albedo, slower rise and a longer life. Thin curls: a **ribbon** emitter (`LocationBasedRibbon`) with curl noise reads better than sprites | MC `smoke_curl_*`: box 0.18 x 0.18 x 0.75 m, noise scroll `-frame*0.012` → `Velocity.z` = 0.012 x fps x 100 cm/s; density 6 → ribbon width 0.5-1 cm, `Opacity` 0.3. Albedo (0.82, 0.8, 0.76) → `Color` | Lit translucent | ribbons: ≤ 3 per curl, negligible |+| **Haze plume / room haze** | Usually **not Niagara**. Homogeneous layers → Exponential Height Fog + Local Fog Volumes (§5.3). Moving plumes (street haze drifting under a light) → `NS_HazePlume`: a few big Volume-domain sprites (2-6 m) | Haze box σ → height fog density (existing code). Local plume: `RadialFogExtinction` = σ x diameter (m) (§0.2). Albedo, anisotropy → `fog_albedo`, `fog_phase_g`. Noise drift → `Wind` | Volumetric fog lighting only. Lights need `volumetric_scattering_intensity` > 0 (already mapped from Blender `visible_volume_scatter`) | LFV about 0.05 ms each; volume sprites 0.3 ms |+| **Rain / drizzle** | `NS_Rain`. Start from `RecycleParticlesInView` (keeps the rain around the camera) or a plain box-spawn GPU emitter. Velocity-aligned sprites (`Alignment = VelocityAligned`), streak length = speed x shutter, masked or translucent, `PixelCoverageMode` Automatic (sub-pixel streaks flicker under TSR otherwise) | Particle settings: `count`, `lifetime`, `frame_start/end` → `SpawnRate = count / (frame_end − frame_start) x fps`; `object_align_factor` (m/s) x 100 → `Velocity` (Blender (x,y,z) → (x,−y,z)); `factor_random` → `VelocityJitter`; emitter object box → `BoxExtent` + transform; instance-object radius x 2 → sprite width (≥ 0.15 cm, or it vanishes), length → streak length; drop material emission 0.5 / alpha 0.35 → `Intensity`, `Opacity` | Lit translucent or unlit with a faint emissive. Rain reads by **backlight**: check it against the street lights in the Cycles frames | GPU, 10k-40k alive, 0.3-0.8 ms |+| **Drips / splashes** | `NS_Drips`: GPU sprites spawned on a line (awning edge) under gravity, killed at the ground plane, plus an **event-free** splash: a second emitter spawned at the computed impact height with `DirectionalBurst`-style spray, or a splash flipbook. Ground ripples: decal flipbook or a puddle material, not particles | `awning_drips`: emitter box (thin strip) → spawn line; `count/span` → `SpawnRate`; `gravity` 1 → `Gravity` = 1; drop size → sprite size; ground z → `KillHeight` (extra user param) | Lit translucent drops; splash unlit-ish | ≤ 200 drops, ≤ 1k spray, about 0.1 ms |+| **Sparks / embers** | `NS_Sparks`: `Fountain` + velocity-aligned additive sprites, gravity, drag, short life. `NS_Embers`: slow buoyant glowing points with curl noise, long life | Particle `velocity`/`normal_factor` → `Velocity`; lifetime → Lifetime; emission colour or temperature → `Temperature` (material BlackBody) and `Intensity` = 683 x strength | Unlit additive; never a light per spark. One Light-renderer particle for a whole shower at most | ≤ 2k, 0.1-0.2 ms |+| **Dust motes** | `NS_DustMotes`: start from `HangingParticulates`. Tiny lit sprites, near-zero velocity, curl-noise drift; only visible inside light shafts, so lit translucent with a strong forward-scatter look | Blender dust particles: count over box volume → density per m³; `SpawnRate` keeps the alive count = count; size 0.05-0.2 cm; box → `BoxExtent` | Lit; needs a shaft light (spot or sun) in the frame | ≤ 3k, 0.1 ms |+| **Fountain water jets** | `NS_FountainJet`: start from `Fountain`, GPU, velocity-aligned stretched sprites + a mist emitter; for hero pools use `Grid3D_Flip_Hose` (Beta, expensive) | Nozzle object → position + direction; jet apex height *h* → `Velocity` = sqrt(2·980·h) cm/s along the nozzle; flow rate → `SpawnRate`; spread → `VelocityJitter` | Lit translucent with high specular-looking emissive edge; check against Cycles highlights | 5k-20k, 0.5 ms; FLIP 3-8 ms |+| **Screen / CRT / light flicker** | Material parameters + Sequencer tracks (§2.5). No Niagara | Sampled emission or energy curves | n/a | ~0 |++Fire, steam and smoke can borrow the **flipbook-from-Blender** path (§5.1). The look then comes from the exact Cycles+shader, and Niagara only supplies motion, variety and parallax.++### 3.2 Authoring the templates once++1. Use a full editor on a GPU box, with `NiagaraToolsets` + `ToolsetRegistry` enabled (Experimental).+2. Discover tool names with `unreal.ToolsetRegistry.get_all_toolset_json_schemas()`.+3. Per template:+ - `CreateNiagaraSystem` from an empty or minimal system;+ - `AddEmitter(<emitter template above>)`;+ - `AddUserVariables(...)`, using the shared parameter names;+ - `SetStackInputData` to link module inputs to the `User.` parameters;+ - `SetRendererData` for alignment, SubUV and sort settings;+ - `SetSystemData` for determinism and fixed bounds.+4. Then call `GetSystemCompileState` and `GetStackIssues`, and fix every error. Epic's own skill text says errors only+ surface once the system has compiled in the editor.+5. A human pass in the Niagara editor is fine as well. The contract is only the user-parameter list above.+6. Save, commit the plugin, and record each system's parameter list in `Plugins/AnySceneFX/templates.json`+ (`{"NS_Steam": {"SpawnRate": "float", ...}}`). The converter reads `param_types` from that file.++---++## 4. Detection rules and the `scene.json` `fx` schema++### 4.1 Classifying Blender effects (exporter side)++Walk every renderable object. A hit gets an `fx` entry and is **not** also exported as a mesh or an LFV, unless+§5 picks the LFV technique. Score each candidate type with the evidence below, take the highest score, and set+`confidence` = top score ÷ (top + runner-up).++| Evidence | Where | Points toward |+|---|---|---|+| Material is volume-only (`is_volume_only`) with `PRINCIPLED_VOLUME` | material | a volume type (steam / smoke / haze / fire) |+| Principled Volume `Emission Strength` > 0, or linked, or `Blackbody Intensity` > 0, or a `BLACKBODY` node, or a `VALTORGB` ramp into Emission Color with orange-to-blue stops | node tree | **fire** |+| Volume with emission 0, albedo > 0.85 grey, density driven by noise + a mapping driver on Z (`-frame*k`) | node tree + drivers | **steam** (k fast, under a hot object) or **smoke** (albedo < 0.85, or name) |+| Volume with no `TEX_NOISE` or a constant density, box > 3 m on its long axis | node tree + size | **haze** (→ fog, §5.3) |+| Volume with noise but drift ≤ 0.002 m/frame and large box | node tree | **haze plume** |+| `FLUID` modifier `DOMAIN`, `domain_type GAS`, cache in OPENVDB | modifier | steam / smoke / fire by `flow_type` of the FLOW objects (`SMOKE`, `FIRE`, `BOTH`) → prefer **SVT** (§5.2) |+| `FLUID` DOMAIN `LIQUID` | modifier | fountain or splash (mesh cache → Alembic or FLIP; flag it for agent review) |+| `VOLUME` object (VDB file) | object type | SVT direct import |+| `PARTICLE_SYSTEM` with `physics_type NEWTON`, `rotation_mode VEL`, velocity mostly −Z ≥ 3 m/s, small elongated instance | particle settings | **rain** |+| … same, slow (< 1 m/s) along −Z, `effector_weights.gravity` ≈ 1, emitter is a thin strip | particle settings | **drips** |+| particles with gravity, short life (< 1.5 s), emissive instance material | settings + material | **sparks** |+| particles with emissive instance, upward velocity, long life | | **embers** |+| particles with ~0 velocity, gravity 0, tiny instance, box emitter | | **dust motes** |+| particles from a small emitter with upward velocity cone, gravity 1, water-like instance (transmission or low roughness) | | **fountain** |+| `NODES` modifier whose tree contains `DISTRIBUTE_POINTS_IN_VOLUME`/`ON_FACES` + `INSTANCE_ON_POINTS` and a `SCENE_TIME` input driving `SET_POSITION` | geometry nodes | rain, dust or drips by the same velocity rules. Sample point positions at two frames to get the velocity |+| Material with drivers/keys on Emission Strength or Color, on a mesh that is a screen (prop name `screen`, `crt`, `monitor`, `tv`, `display`, `sign`) | `animated_materials` | **screen flicker** |+| Light with driver/action on `energy`/`color` | `light_entry.animated` | **light flicker** (sample the curve) |+| Object or material **name** contains a type word (`steam`, `vapor`, `smoke`, `curl`, `haze`, `fog`, `mist`, `flame`, `fire`, `ember`, `spark`, `rain`, `drizzle`, `drip`, `splash`, `dust`, `mote`, `fountain`, `jet`, `flicker`) | names | +2 to that type (tie-breaker, never sufficient alone) |++Also export, per entry:+- `bounds_ue`;+- the emitter shape (box, disc or line from the object's evaluated mesh bounds);+- `preroll_s` from `frame_start < 0` or the fluid `cache_frame_start`;+- the cameras whose frustum contains the bounds;+- the nearest light within 1 m (`light_link`), so fire never double-lights.++For procedural volumes, keep `sample_volume()` but take **8-16 slices**, not 4. Also measure the drift speed by+diffing the mapping-node location driver between two frames, and write the `params` directly.++### 4.2 Schema (JSON Schema 2020-12) for `scene.json → "fx"`++```json+{+ "$id": "anyscene/fx.schema.json",+ "type": "array",+ "items": {+ "type": "object",+ "required": ["id", "type", "confidence", "source", "transform", "bounds_ue", "technique", "params", "time", "seed"],+ "properties": {+ "id": {"type": "string", "pattern": "^[A-Za-z0-9_]+$"},+ "type": {"enum": ["fire", "steam", "smoke", "haze", "haze_plume", "rain", "drips", "splash", "sparks",+ "embers", "dust", "fountain", "screen_flicker", "light_flicker", "unknown"]},+ "confidence": {"type": "number", "minimum": 0, "maximum": 1},+ "source": {"type": "object", "required": ["kind", "objects"], "properties": {+ "kind": {"enum": ["volume_shader", "fluid_domain", "vdb", "particles", "geonodes",+ "animated_emission", "animated_light"]},+ "objects": {"type": "array", "items": {"type": "string"}},+ "material": {"type": ["string", "null"]},+ "evidence": {"type": "array", "items": {"type": "string"}}}},+ "transform": {"type": "object", "required": ["loc", "quat"], "properties": {+ "loc": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3},+ "quat": {"type": "array", "items": {"type": "number"}, "minItems": 4, "maxItems": 4},+ "scale": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3}}},+ "bounds_ue": {"type": "object", "required": ["center", "extent"], "properties": {+ "center": {"type": "array", "items": {"type": "number"}}, "extent": {"type": "array", "items": {"type": "number"}}}},+ "bounds_local": {"type": "object", "properties": {"min": {"type": "array"}, "max": {"type": "array"}}},+ "emitter_shape": {"type": "object", "properties": {+ "kind": {"enum": ["box", "disc", "ring", "line", "plane", "point", "mesh"]},+ "extent_cm": {"type": "array", "items": {"type": "number"}},+ "normal": {"type": "array", "items": {"type": "number"}}}},+ "technique": {"enum": ["niagara", "niagara_flipbook", "niagara_volume_sprite", "svt", "local_fog",+ "height_fog", "material", "sequencer_curve", "skip"]},+ "template": {"type": ["string", "null"], "description": "UE object path, e.g. /AnySceneFX/Systems/NS_Steam.NS_Steam"},+ "params": {"type": "object", "additionalProperties": {"type": ["number", "boolean", "array"]}},+ "param_types": {"type": "object", "additionalProperties": {"enum": ["float", "int", "bool", "vec3", "pos", "color"]}},+ "physical": {"type": "object", "description": "raw Blender-side measurements kept for the look-match pass",+ "properties": {+ "density_per_m": {"type": "number"}, "optical_depth": {"type": "number"},+ "albedo": {"type": "array"}, "anisotropy": {"type": "number"},+ "emission_nits": {"type": "number"}, "emission_color": {"type": "array"}, "temperature_k": {"type": "number"},+ "count": {"type": "integer"}, "lifetime_s": {"type": "array"}, "velocity_cm_s": {"type": "array"},+ "velocity_jitter": {"type": "number"}, "gravity": {"type": "number"}, "size_cm": {"type": "array"},+ "drift_cm_s": {"type": "array"}, "noise_scale_cm": {"type": "number"}}},+ "time": {"type": "object", "required": ["preroll_s", "fps"], "properties": {+ "preroll_s": {"type": "number", "minimum": 0}, "fps": {"type": "number"},+ "start_frame": {"type": "integer"}, "end_frame": {"type": "integer"}, "animated": {"type": "boolean"}}},+ "seed": {"type": "integer", "minimum": 0},+ "flicker": {"type": "object", "properties": {+ "target": {"type": "string"}, "property": {"enum": ["intensity", "emissive_scale", "color"]},+ "fps": {"type": "number"}, "values": {"type": "array", "items": {"type": "number"}}}},+ "flipbook": {"type": "object", "properties": {+ "texture": {"type": "string"}, "grid": {"type": "array"}, "fps": {"type": "number"}, "emissive": {"type": "boolean"}}},+ "vdb": {"type": "object", "properties": {"files": {"type": "string"}, "grids": {"type": "array"}}},+ "cameras": {"type": "array", "items": {"type": "string"}},+ "light_link": {"type": ["string", "null"]},+ "notes": {"type": "array", "items": {"type": "string"}}+ }+ }+}+```+- Units: positions are UE centimetres; velocities are cm/s in UE axes; `extent` is a half-extent in cm; `seed` =+ `crc32(id)`.+- **Ownership.** The exporter fills everything except `technique`, `template` and `params`. A deterministic step+ (`fx_plan.py`, using the decision table in §5.4) fills those three, and the agent may override them.+- `build_level.py` gets a `stage_fx` that dispatches on `technique`. Keep the old `volumes` map for backward+ compatibility, but skip any volume an `fx` entry claims.++---++## 5. Alternatives when Niagara is not the right tool++### 5.1 Flipbooks (SubUV) rendered from the Blender volume++**Best for:** fire, steam puffs and smoke at mid-distance. The look *is* the Cycles shader, with zero tuning of+Niagara colour or density.++How to bake, in a Blender job on the scene copy:+1. Isolate the volume object. Use a transparent film (`film_transparent`) and an orthographic camera fitted to the+ bounds, facing the hero camera's azimuth.+2. Use a black world, plus a neutral key light if the effect is lit (steam). Emissive flames need no light.+3. Render *N* = 64 frames at the scene fps from a steady-state frame. Crossfade the last 16 into the first 16 for a+ loop.+4. Tile 8x8 at 256-512 px per cell. Write RGBA as EXR, or PNG with premultiplied alpha.+5. Export twice for lit effects: an emissive-only pass, and an albedo/alpha pass.+6. Unreal side: `SubImageSize` (8,8) on the sprite renderer, plus a SubUV Animation module whose renderer input+ points at that renderer. Get all three of these right: the grid, the module, and the renderer binding. Any one+ wrong fails **silently**.++Use a flipbook when the camera stays within about 30° of the bake view. Beyond that, sprites rotate visibly; use two+or three bakes at different azimuths, or SVT.++### 5.2 Heterogeneous volumes from VDB (SVT)++**Best for:** hero steam, smoke or fire seen up close or from moving cameras. This is the real 3D density and is the+closest match to Cycles.++**Mantaflow domains.** `cache_data_format = OPENVDB` already writes `cache/data/fluid_data_####.vdb`. Re-save only+the `density`, `flame` and `temperature` grids, or the default mapping packs velocity components into attributes B.++**Procedural shader volumes** (HK steam, MC curls):+1. Sample the material on a 3D grid. Extend `sample_volume` to bake Z slices at 64-128 slices.+2. For animation, repeat per frame for 48-96 frames.+3. Write `.vdb` with Blender's bundled `openvdb` module: `openvdb.FloatGrid`, `copyFromArray`,+ `openvdb.write(path, grids)`.+4. Name the grids `density`, plus `emission` or `temperature`.++**Import into Unreal.**+- Use an `AssetImportTask` on the first file of the numbered sequence. In a commandlet the factory takes the+ unattended path and imports the sequence as an **animated SVT**.+- Optionally pass a `UOpenVDBImportOptionsObject` as `task.options` to control the grid mapping.+- The `InterchangeOpenVDB` plugin is disabled by default. The legacy SVT factory does not need it.++**Render.**+- Spawn `unreal.HeterogeneousVolume`. Its `heterogeneous_volume_component` takes a Volume-domain material that samples+ the SVT (start from `/NiagaraFluids/Materials/Grid3D/Instances/MI_HeterogeneousVolumes_Basic`).+- Animation fields on the component: `frame`, `frame_rate`, `start_frame`, `end_frame`, playing and looping.+- Lighting fields: `step_factor`, `shadow_step_factor`, `lighting_downsample_factor`.+- Map Blender density σ (1/m) to material extinction: σ ÷ 100 per cm, if the material works in world units. Calibrate+ once against a Cycles render of a test cube.++**Cvars.**+- `r.HeterogeneousVolumes 1` (default on).+- `r.HeterogeneousVolumes.Shadows 0` by default: turn it on for self-shadowing steam.+- `r.HeterogeneousVolumes.IndirectLighting 0` by default.+- `r.HeterogeneousVolumes.MaxStepCount 512`.+- `r.HeterogeneousVolumes.Composition 0`: draws before translucency. All *[engine: HeterogeneousVolumes.cpp]*.++**Cost.** Several ms per volume at 1440p. Fine for MRQ, too heavy for a real-time budget unless+`DownsampleFactor` = 2.++### 5.3 Fog for haze++- **Room or street haze** (homogeneous layers, or a large box with gentle noise): Exponential Height Fog plus+ volumetric fog, as `build_level.py` already does.+- **Local layers** (MC ceiling layer, under-awning haze): Local Fog Volumes. Fix §0.2 as follows.+ - Scale = (max box half-extent in cm) ÷ 500.+ - It is a sphere: a long flat box needs several LFVs tiled along its long axis, or height-fog mode+ (`height_fog_extinction`, `height_fog_falloff`, `height_fog_offset`).+ - `radial_fog_extinction` = σ x 2r (m), the optical depth through the centre.+ - `fog_emissive` is luminance: σ_e x 683 nits.+- **Never use an LFV for a flame or a plume.** It cannot move, and its shape is a sphere.++### 5.4 Decision table (per effect)++| Type | Default technique | Use instead when |+|---|---|---|+| fire | `niagara_flipbook` (NS_Fire, flame baked from Blender) | close-up hero, camera moves around it, long shot → `svt` (bake VDB 64 frames) or `Grid3D_Gas_Fire`; tiny candle → unlit sprite, no flipbook |+| steam | `niagara` (NS_Steam lit sprites) + volume-sprite core if volumetric fog is on | Mantaflow cache present, or a hero close-up → `svt`; distant/static → `niagara_flipbook` |+| smoke | curls → `niagara` ribbons; plumes → as steam | — |+| haze | `height_fog` / `local_fog` | visible moving wisps in a light beam → `niagara_volume_sprite` |+| haze_plume | `niagara_volume_sprite` | static in all shots → `local_fog` (fixed size rule) |+| rain | `niagara` (NS_Rain) | only seen through glass far away → material streaks on a card |+| drips / splash | `niagara` (NS_Drips) | ground ripples → animated decal / puddle material |+| sparks / embers | `niagara` | — |+| dust | `niagara` (NS_DustMotes) | — |+| fountain | `niagara` (NS_FountainJet) | Mantaflow liquid cache → Alembic mesh sequence (outside this doc; flag it) |+| screen_flicker / light_flicker | `material` / `sequencer_curve` | — |++---++## 6. Verification loop: did the effect land?++1. **Build.** Run `stage_fx` and save. The build report records, per effect: id, technique, template, user params+ read back (`get_variable_*` valid flags), and fixed bounds read back. Any invalid param is an error, not a warning.+2. **Render.**+ - Render MRQ stills from **every camera in the effect's `cameras`**:+ `render_mrq.ps1 -Cams ...`, with `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Use the **same frame number** as the Cycles still: the exporter's `--frame`, minus the sequence start.+ - For motion, render 24-frame clips of the effect cameras (`custom_end_frame = 24`).+ - Render twice with identical settings to check determinism: the two images' absolute difference should be ~0+ outside the TSR noise floor.+3. **Compare against Cycles.**+ - Use `side_by_side.py`. Compare in the same view transform: use `MRQ_Linear` EXR + Blender AgX, as the pipeline+ already does.+ - For each effect, crop its projected `bounds_ue` box in both images, then compare:+ - **coverage**: the fraction of crop pixels changed vs a render with the effect hidden; render one "FX off"+ still per camera;+ - **mean luminance** and the **99th-percentile luminance** inside the crop, for emissive effects;+ - **contrast and transmission**: background visibility through steam or haze;+ - hue of emissive effects;+ - for rain, streak count, length and angle.+4. **What to look for.**+ - The effect missing entirely: compile, bounds culling, wrong asset, or warm-up.+ - Popping-in in clips: warm-up too short.+ - A box-shaped cut-off: fixed bounds too small.+ - Sharp steam in a blurred foreground: the TranslucencyPass.+ - Black or flat steam: unlit, or no light behind it.+ - Fire that lights nothing, or double lighting: `light_link`.+ - Rain invisible: sprite under a pixel, so check the `PixelCoverageMode` and the width floor.+ - Stepping between frames: the age mode.+ - A sphere-shaped haze blob: the LFV rule.+5. **Adjustment rules.** Change one parameter per round, at most three rounds per effect, and log each round in the+ build report.+ - Coverage too low → raise `SizeMax` first (x1.3), then `SpawnRate` (x1.5). Too high → the reverse order.+ - Too opaque or too faint at matched coverage → scale `Opacity` by `ln(1−T_cycles)/ln(1−T_ue)` (T =+ transmission).+ - Emissive brightness → scale `Intensity` by `L99_cycles / L99_ue`, clamped to x[0.25, 4] per round.+ - Wrong height or reach → `LifetimeMax` (plumes) or `Velocity.z`; keep `Velocity x Lifetime` = the measured Cycles+ reach.+ - Wrong lean → `Wind`.+ - Rain too dense or sparse → `SpawnRate` by the streak-count ratio; streaks too short → the stretch factor+ (speed x shutter), not velocity.+ - After three rounds without converging, switch technique (§5.4 "use instead") and note why in `notes`.++---++## 7. Known gotchas (with sources)++| Gotcha | Fix | Source |+|---|---|---|+| GPU particles absent or frozen in MRQ warm-up | `render_warm_up_frames = True`; engine warm-up alone doesn't run GPU sims | `MoviePipelineAntiAliasingSetting.h` tooltip *[engine]*; Epic MRQ docs |+| `engine_warm_up_count` ignored | `use_camera_cut_for_warm_up = False` (it's EditCondition-gated) | same header |+| Effect missing on the first frames of an offscreen run | `fx.Niagara.ForceWaitForCompilationOnActivate=1` + `Editor.AsyncAssetCompilation=0` | `NiagaraComponent.cpp:112, 1358` *[engine]*; `render_shots.py` notes |+| Nothing renders or compiles in `-run=pythonscript` | expected: null RHI unless `-AllowCommandletRendering`; render in the `-game` pass | `LaunchEngineLoop.cpp:2246` *[engine]* |+| User param silently ignored | exact name + exact type; read back with `get_variable_*` and check the valid flag; set the asset before params (`set_asset` resets overrides) | `NiagaraComponent.cpp:4376, 4620` *[engine]*; NiagaraToolsets `blueprint_interop` skill |+| Effect culled when its origin leaves the view | fixed bounds covering the whole travel; GPU emitters can't use dynamic bounds | `NiagaraSystem.h:1052`; NiagaraToolsets `optimization` skill |+| Effect dropped at distance or by budget | `set_allow_scalability(False)`; `MoviePipelineGameOverrideSetting` | `NiagaraComponent.h` *[engine]* |+| Different particles every run | system + emitter `bDeterminism`, a fixed `RandomSeedOffset`, fixed MRQ warm-up; sim cache for bit-exact results | `NiagaraSystem.h:1073-1085` *[engine]* |+| Translucent FX sharp in defocused areas | material `TranslucencyPass = MTP_BeforeDOF` (default is AfterDOF) | `Material.h:142`, `Material.cpp:1183` *[engine]* |+| Sprite motion blur smears or vanishes | rely on MRQ temporal samples (8); renderer `MotionVectorSetting` Precise for fast sparks, Disable for steam; post-process motion blur is off in the converter (`motion_blur_amount 0`) | `NiagaraRendererProperties.h:480` *[engine]* |+| Thin rain or sparks flicker or disappear under TSR | `PixelCoverageMode` Automatic (project setting enabled) and a width floor; velocity-aligned streaks | `NiagaraSpriteRendererProperties.h` *[engine]* |+| Fire doesn't light the set; Lumen ignores emissive sprites | real lights (Blender practicals or one Light-renderer particle); Niagara lights are CPU-only and shadowless unless MegaLights (`bAllowMegaLights`, `bMegaLightsCastShadows`) | `NiagaraLightRendererProperties.h:62-110` *[engine]*; NiagaraToolsets `renderers` skill |+| Particle lights invisible in fog | light needs volumetric scattering intensity > 0 | *[docs: Volumetric Fog]* |+| Lit translucency looks flat or blotchy | it's the translucency lighting volume; use Volumetric NonDirectional, keep sprites large and soft | Lumen translucency behaviour *[docs]* |+| SubUV shows the whole atlas | renderer `SubImageSize` + a SubUV module + its renderer binding | NiagaraToolsets `renderers` skill |+| Local fog volume 5x too big / spherical | base radius 500 cm; uniform max-axis scale; extinction = optical depth through the centre | `LocalFogVolumeComponent.h:74`, `LocalFogVolumeCommon.ush:178-203` *[engine]* |+| VDB import pops a dialog | not in a commandlet or with automated tasks; numbered files become an animated SVT | `SparseVolumeTextureFactory.cpp:436` *[engine]* |+| Blender motion blur on volumes | irrelevant in UE, but the Cycles reference frames have no volume blur (object blur off on volume boxes); don't add any in UE either | HK `fx.py`, `SKILL.md` §11 |++**Sources.**+- Installed engine files:+ - `Engine/Plugins/FX/Niagara/Source/Niagara/{Public/NiagaraComponent.h, Public/NiagaraActor.h,+ Public/NiagaraFunctionLibrary.h, Classes/NiagaraSystem.h, Classes/NiagaraEmitter.h,+ Public/NiagaraLightRendererProperties.h, Public/NiagaraSpriteRendererProperties.h, Public/NiagaraCommon.h,+ Public/MovieScene/MovieSceneNiagaraSystemSpawnSection.h, Classes/NiagaraSimCacheFunctionLibrary.h,+ Private/NiagaraComponent.cpp, Private/NiagaraSystemInstance.cpp}`+ - `Engine/Plugins/FX/{NiagaraFluids, NiagaraMRQ, NiagaraSimCaching}`+ - `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (tools + `Content/Python/skills`)+ - `Engine/Plugins/Experimental/ToolsetRegistry`+ - `Engine/Plugins/MovieScene/MovieRenderPipeline/.../MoviePipelineAntiAliasingSetting.h`+ - `Engine/Source/Runtime/Engine/Classes/Components/{HeterogeneousVolumeComponent.h, LocalFogVolumeComponent.h}`+ - `Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp`+ - `Engine/Shaders/Private/LocalFogVolumes/LocalFogVolumeCommon.ush`+ - `Engine/Source/Editor/SparseVolumeTexture/Private/SparseVolumeTextureFactory.cpp`+ - `Engine/Source/Runtime/Engine/Public/Materials/Material.h`+ - `Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp`+- Epic docs:+ - [Volumetric Fog](https://dev.epicgames.com/documentation/en-us/unreal-engine/volumetric-fog-in-unreal-engine)+ - [Rendering your Niagara systems (MRQ)](https://dev.epicgames.com/documentation/unreal-engine/rendering-your-niagara-systems)+ - [NiagaraMRQ API](https://dev.epicgames.com/documentation/unreal-engine/API/PluginIndex/NiagaraMRQ)+ - [MoviePipelineAntiAliasingSetting (Python API)](https://api.unrealengine.com/INT/PythonAPI/class/MoviePipelineAntiAliasingSetting.html)+- AnyScene:+ - `scenes/hk-dai-pai-dong/scripts/{fx.py, lights.py, steam.py}`, `NOTES.md`+ - `scenes/mission-control-1970s/scripts/haze.py`+ - `SKILL.md` §11, `builder/CRAFT.md`diff --git a/unreal_fx/ORIG.md5 b/unreal_fx/ORIG.md5new file mode 100644index 0000000..ca9cfa9--- /dev/null+++ b/unreal_fx/ORIG.md5@@ -0,0 +1,2 @@+106496cdb88d1d42b31a4deab69b06f9 *build_level.py+cb060bc4370109d639a2178d002f7056 *export_blend.pydiff --git a/unreal_fx/agx_view.py b/unreal_fx/agx_view.pynew file mode 100644index 0000000..870bf9e--- /dev/null+++ b/unreal_fx/agx_view.py@@ -0,0 +1,19 @@+"""Apply a Blender view transform (default AgX + the scene's look) to Unreal scene-linear EXRs (MRQ_Linear output),+so UE and Cycles frames can be compared through the same tone mapper.+ blender -b --factory-startup --python agx_view.py -- <in.exr> <out.png> [look] [exposure]+"""+import sys+import bpy++a = sys.argv[sys.argv.index("--") + 1:]+src, dst = a[0], a[1]+look = a[2] if len(a) > 2 else "AgX - Medium High Contrast"+expo = float(a[3]) if len(a) > 3 else 0.0+sc = bpy.context.scene+sc.view_settings.view_transform = "AgX"+sc.view_settings.look = look+sc.view_settings.exposure = expo+sc.render.image_settings.file_format = "PNG"+img = bpy.data.images.load(src)+img.save_render(dst, scene=sc)+print("AGX", src, "->", dst, flush=True)diff --git a/unreal_fx/build_level.py b/unreal_fx/build_level.pynew file mode 100644index 0000000..176a9e9--- /dev/null+++ b/unreal_fx/build_level.py@@ -0,0 +1,801 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,fx,sequences (default: all)+ ANYSCENE_FX_OVERRIDES optional JSON {fx id | "type:<type>": {UserParam: value}} applied on top of scene.json fx params+ (look-match tuning; TOGGLE.md "overrides.json")+ ANYSCENE_CLIP_FRAMES length of the MRQ_Clip config and of every camera sequence (default 96 = 4 s at 24 fps)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,fx,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))+FX_OVR = json.load(open(os.environ["ANYSCENE_FX_OVERRIDES"])) if os.environ.get("ANYSCENE_FX_OVERRIDES") else {}+CLIP_FRAMES = int(os.environ.get("ANYSCENE_CLIP_FRAMES", "96"))++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % 16 == 15 or i == len(todo) - 1:+ flush(a)+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked():+ path = f"{DEST}/Materials/M_AnyBaked"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyBaked", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_glass():+ path = f"{DEST}/Materials/M_AnyGlass"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGlass", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ c = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, -500, 0)+ c.set_editor_property("parameter_name", "Color")+ c.set_editor_property("default_value", unreal.LinearColor(1, 1, 1, 1))+ r = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 200)+ r.set_editor_property("parameter_name", "Roughness")+ r.set_editor_property("default_value", 0.05)+ o = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 350)+ o.set_editor_property("parameter_name", "Opacity")+ o.set_editor_property("default_value", 0.25)+ MEL.connect_material_property(c, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], baked)+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ c = g["color"]+ MEL.set_material_instance_vector_parameter_value(gm, "Color", unreal.LinearColor(c[0], c[1], c[2], 1))+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0] or v.get("claimed_by_fx"):+ continue # effects (flames, plumes) are Niagara now: an LFV can neither move nor take their shape+ b = v["bounds_ue"]+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(b["center"]), unreal.Rotator(0, 0, 0))+ lf.set_actor_label("LFV_" + name)+ lf.set_folder_path("Volumes")+ # A local fog volume is a sphere of radius GetBaseVolumeSize() = 500 cm at scale 1, and the proxy collapses the+ # scale to the max axis (LocalFogVolumeSceneProxy.cpp): scale uniformly to the box's largest half-extent.+ r_cm = max(b["extent"])+ lf.set_actor_scale3d(unreal.Vector(1, 1, 1) * (r_cm / 500.0))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"])+ emit = max(v["emission"])+ # RadialFogExtinction is the optical depth straight through the centre (unit-sphere integral): sigma x 2r.+ lc.set_editor_property("radial_fog_extinction", dens * 2 * r_cm / 100.0)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ lc.set_editor_property("radial_fog_extinction", max(dens, 0.01) * 2 * r_cm / 100.0)+ # fog_emissive is luminance: emission per metre x 683 (lm/W, as for every other emitter).+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * emit * 683, ec[1] * emit * 683, ec[2] * emit * 683, 1))+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", min(1.0, ff["vignette_angle_rad"] / (math.pi / 4) * 0.45))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+ hero = next((c for c in scene["cameras"] if c["name"] == "cam_street"), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++# ------------------------------------------------------------------ effects (NIAGARA.md §2)++def fx_params(fx):+ p = dict(fx.get("params", {}))+ for key in ("type:" + fx["type"], fx["id"]):+ p.update(FX_OVR.get(key, {}))+ return p+++def place_fx(eas, fx, systems):+ path = fx["template"]+ if path not in systems:+ systems[path] = unreal.load_asset(path)+ if systems[path] is None:+ warn(f"fx template missing: {path}")+ sysasset = systems[path]+ if sysasset is None:+ return None+ t = fx["transform"]+ act = eas.spawn_actor_from_class(unreal.NiagaraActor, V(t["loc"]), unreal.Quat(*t["quat"]).rotator())+ act.set_actor_label("FX_" + fx["id"])+ act.set_folder_path("FX")+ nc = act.get_editor_property("niagara_component")+ nc.set_asset(sysasset, True) # 1. asset first: set_asset resets overrides+ params, types = fx_params(fx), fx.get("param_types", {})+ for k, v in params.items(): # 2. typed user parameters+ ty = types.get(k, "float")+ if ty == "float":+ nc.set_variable_float(k, float(v))+ elif ty == "int":+ nc.set_variable_int(k, int(v))+ elif ty == "bool":+ nc.set_variable_bool(k, bool(v))+ elif ty == "vec3":+ nc.set_variable_vec3(k, V(v))+ elif ty == "pos":+ nc.set_variable_position(k, V(v))+ elif ty == "color":+ nc.set_variable_linear_color(k, unreal.LinearColor(v[0], v[1], v[2], v[3] if len(v) > 3 else 1.0))+ nc.set_random_seed_offset(int(fx["seed"]) & 0x7FFFFFFF) # 3. determinism+ bl = fx.get("bounds_local") or {"min": [-e for e in fx["bounds_ue"]["extent"]], "max": fx["bounds_ue"]["extent"]}+ nc.set_system_fixed_bounds(unreal.Box(V(bl["min"]), V(bl["max"]))) # 4. fixed bounds, local space+ fps = fx["time"].get("fps", 24)+ ticks = int(math.ceil(fx["time"]["preroll_s"] * fps))+ nc.set_editor_property("override_warmup_settings", True) # 5. pre-roll to steady state on activation+ nc.set_editor_property("warmup_tick_delta", 1.0 / fps)+ nc.set_editor_property("warmup_tick_count", ticks)+ try:+ nc.set_editor_property("allow_scalability", False) # cinematic: never culled by an effect type+ except Exception:+ pass+ # 6. verify: a wrong name or type is a silent no-op, so read every parameter back.+ getters = {"float": nc.get_variable_float, "int": nc.get_variable_int, "bool": nc.get_variable_bool,+ "vec3": nc.get_variable_vec3, "pos": nc.get_variable_position, "color": nc.get_variable_color}+ bad = []+ for k in params:+ try:+ r = getters[types.get(k, "float")](k)+ ok = r[1] if isinstance(r, tuple) else r is not None+ except Exception:+ ok = False+ if not ok:+ bad.append(k)+ rec = {"id": fx["id"], "type": fx["type"], "template": path, "params_set": len(params), "params_invalid": bad,+ "bounds": [list(bl["min"]), list(bl["max"])], "bounds_readback": str(nc.get_system_fixed_bounds())[:200],+ "warmup_ticks": ticks, "seed": int(fx["seed"]) & 0x7FFFFFFF,+ "overrides": {k: v for k, v in params.items() if fx.get("params", {}).get(k) != v}}+ if bad:+ REPORT.setdefault("errors", []).append(f"{fx['id']}: user params not on {path}: {bad}")+ log("ERROR", fx["id"], "invalid params", bad)+ REPORT.setdefault("fx", []).append(rec)+ return act+++def stage_fx():+ t = time.time()+ fxs = [f for f in scene.get("fx", []) if f.get("technique") in ("niagara", "niagara_flipbook") and f.get("template")]+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ les.load_level(f"{DEST}/{LEVEL}")+ for a in eas.get_all_level_actors(): # rerunnable on its own: drop the previous pass's effects+ if a.get_actor_label().startswith("FX_"):+ eas.destroy_actor(a)+ systems = {}+ n = sum(1 for fx in fxs if place_fx(eas, fx, systems))+ skipped = [f["id"] for f in scene.get("fx", []) if f not in fxs]+ if skipped:+ warn(f"fx not placed (technique not handled here): {skipped}")+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), f"{DEST}/{LEVEL}")+ log(f"fx: {n} niagara actors")+ REPORT["timings"]["fx_s"] = round(time.time() - t)+++def key_flicker(seq, eas, fps):+ """Light flicker sampled by the exporter (fx[].flicker): a float track on the light component's intensity."""+ lights = {a.get_actor_label(): a for a in eas.get_all_level_actors() if isinstance(a, unreal.Light)}+ for fx in scene.get("fx", []):+ fl = fx.get("flicker")+ if not fl or fl["target"] not in lights:+ continue+ lc = lights[fl["target"]].light_component+ base = lc.get_editor_property("intensity")+ try:+ b = seq.add_possessable(lc)+ tr = b.add_track(unreal.MovieSceneFloatTrack)+ tr.set_property_name_and_path("Intensity", "Intensity")+ sec = tr.add_section()+ sec.set_range(0, len(fl["values"]))+ ch = sec.get_all_channels()[0]+ for i, v in enumerate(fl["values"]):+ ch.add_key(unreal.FrameNumber(i), base * v)+ REPORT.setdefault("flicker", []).append({"light": fl["target"], "keys": len(fl["values"])})+ except Exception as e:+ warn(f"flicker track on {fl['target']} failed: {e}")+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(max(48, CLIP_FRAMES))+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, max(48, CLIP_FRAMES))+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ key_flicker(seq, eas, fps)+ EAL.save_loaded_asset(seq, False)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = scene["grade"].get("resolution", [1920, 804])+ # Engine warm-up must also cover the longest effect pre-roll (NIAGARA.md �2.4), on top of the component warm-up.+ warm = max([64] + [int(math.ceil(f["time"]["preroll_s"] * fps * 1.5)) for f in scene.get("fx", [])])+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True), ("MRQ_Clip", False)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.environ.get("ANYSCENE_MRQ_OUT", os.path.join(EXPORT, "..", "compare", "mrq")).replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = True+ out.custom_start_frame, out.custom_end_frame = 0, (CLIP_FRAMES if name == "MRQ_Clip" else 1)+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = warm+ aa.use_camera_cut_for_warm_up = False+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "fx": stage_fx, "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal_fx/export_blend.py b/unreal_fx/export_blend.pynew file mode 100644index 0000000..89ff833--- /dev/null+++ b/unreal_fx/export_blend.py@@ -0,0 +1,1023 @@+"""AnyScene -> Unreal export: bake every surface material to PBR textures, export one GLB per unique mesh, and write+scene.json (placements, lights, cameras, world, volumes, grade) in Unreal units and axes.++ blender -b <COPY of scene.blend> --python export_blend.py -- --out <dir> [--frame 60] [--only a,b] [--limit N]+ [--density 1024] [--max-res 4096] [--grade-sh scenes/<id>/scripts/grade.sh] [--ffmpeg path]+ [--dof '{"cam_street": [9.5, 2.8]}'] [--no-bake] [--cpu-threads 0]++Never saves the .blend (it modifies the open file in memory: new UV layers, converted text/curves). Rerunnable:+textures and GLBs that already exist are skipped (delete <out>/tex/<asset>_* or <out>/mesh/<asset>.glb to redo one).++Conventions written to scene.json+ * Space: Unreal (cm, X forward, Y right, Z up, left-handed). Blender (x, y, z) m -> Unreal (x, -y, z) * 100.+ Object transforms are S*M*S with S = diag(1,-1,1), given as location, quaternion (x,y,z,w) and scale.+ * Mesh GLBs are exported in object-local space at identity; the Unreal importer maps glTF to its own axes, so+ build_level.py checks the result against "check_bounds" for the first assets.+ * Photometry: 683 lm/W. Point/spot cd = 683 * P / (4 pi); area cd = 683 * P / pi; sun lux = 683 * S;+ emissive nits = 683 * strength; sky radiance x 683. Exposure: Blender pixel = L_b * 2^exposure, so the Unreal+ manual exposure is EV100 = log2(683 / 1.2) - exposure (written as grade.ev100).+ * Bake: every surface material (procedural or not) is baked per unique mesh into one texture set on a bake UV:+ BaseColor (sRGB png), ORM (R=1, G=roughness, B=metallic, linear png), Normal (tangent, OpenGL +Y, png, only if a+ material perturbs the normal), Emissive (sRGB png + scale, only if emissive). Glass slots (transmission > 0.5)+ are not baked: they keep their own material slot and parameters.+"""+import bmesh # noqa: F401 (kept for hand edits)+import json+import math+import os+import re+import subprocess+import sys+import time++import bpy+import numpy as np+from mathutils import Matrix, Vector++LM_PER_W = 683.0+argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+++def arg(name, default=None):+ return argv[argv.index(name) + 1] if name in argv else default+++OUT = os.path.abspath(arg("--out", "unreal_export"))+FRAME = int(arg("--frame", "60"))+ONLY = set(x for x in arg("--only", "").split(",") if x)+LIMIT = int(arg("--limit", "0"))+DENSITY = float(arg("--density", "1024")) # bake px per metre of sqrt(surface area)+MAX_RES = int(arg("--max-res", "4096"))+NO_BAKE = "--no-bake" in argv+DOF = json.loads(arg("--dof", "{}"))+GRADE_SH = arg("--grade-sh")+FFMPEG = arg("--ffmpeg", os.environ.get("FFMPEG", "ffmpeg")) # pipeline/env.sh exports FFMPEG (ffmpeg is not on PATH here)+THREADS = int(arg("--cpu-threads", "0"))+GPU = "--gpu" in argv # bake with OptiX (run through pipeline/gpu_run.sh)+REVERSE = "--reverse" in argv # walk assets from the end: a second process can share the work++SRC = bpy.data.filepath+if not SRC or os.path.basename(SRC) == "hk.blend" and "scenes" in SRC.replace("\\", "/").split("/"):+ print("export_blend: refusing to run on a scene's own .blend; open a copy", flush=True)+ sys.exit(1)++for d in ("mesh", "tex", "world", "grade"):+ os.makedirs(os.path.join(OUT, d), exist_ok=True)++sc = bpy.context.scene+sc.frame_set(FRAME)+S = Matrix.Diagonal((1.0, -1.0, 1.0, 1.0))+LOG = []+++def log(*a):+ s = " ".join(str(x) for x in a)+ LOG.append(s)+ print("EXPORT", s, flush=True)+++def ue_vec(v, scale=100.0):+ return [v[0] * scale, -v[1] * scale, v[2] * scale]+++def ue_xform(mw):+ t = S @ mw @ S+ loc, rot, scl = t.decompose()+ return {"loc": [loc.x * 100, loc.y * 100, loc.z * 100], "quat": [rot.x, rot.y, rot.z, rot.w], "scale": list(scl)}+++def ue_axes(mw):+ """Forward (-Z local) and up (+Y local) of a Blender camera/light in Unreal axes."""+ r = mw.to_3x3().normalized()+ f = r @ Vector((0, 0, -1))+ u = r @ Vector((0, 1, 0))+ return [f.x, -f.y, f.z], [u.x, -u.y, u.z]+++def safe(name):+ return re.sub(r"[^A-Za-z0-9_]", "_", name)[:60]+++# ------------------------------------------------------------------ material inspection++def output_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ for n in outs:+ if n.is_active_output:+ return n+ return outs[0] if outs else None+++def surface_shader(m):+ if not m or not m.node_tree:+ return None+ o = output_node(m.node_tree)+ if not o or not o.inputs["Surface"].is_linked:+ return None+ return o.inputs["Surface"].links[0].from_node+++def is_volume_only(m):+ if not m or not m.node_tree:+ return False+ o = output_node(m.node_tree)+ return bool(o and o.inputs["Volume"].is_linked and not o.inputs["Surface"].is_linked)+++def find_principled(m):+ sh = surface_shader(m)+ if sh is None:+ return None+ if sh.type == "BSDF_PRINCIPLED":+ return sh+ # Mix shaders etc.: first principled upstream.+ seen, stack = set(), [sh]+ while stack:+ n = stack.pop()+ if n.name in seen:+ continue+ seen.add(n.name)+ if n.type == "BSDF_PRINCIPLED":+ return n+ for i in n.inputs:+ for l in i.links:+ stack.append(l.from_node)+ return None+++def is_glass(m):+ p = find_principled(m)+ if p is not None:+ return (not p.inputs["Transmission Weight"].is_linked) and p.inputs["Transmission Weight"].default_value > 0.5+ sh = surface_shader(m)+ return sh is not None and sh.type in ("BSDF_GLASS", "BSDF_REFRACTION")+++def glass_params(m):+ p = find_principled(m)+ if p is None:+ return {"color": [1, 1, 1], "roughness": 0.0, "ior": 1.45}+ c = p.inputs["Base Color"].default_value+ return {"color": [c[0], c[1], c[2]], "roughness": p.inputs["Roughness"].default_value,+ "ior": p.inputs["IOR"].default_value, "alpha": p.inputs["Alpha"].default_value}+++def emissive(m):+ sh = surface_shader(m)+ if sh is None:+ return False+ if sh.type == "EMISSION":+ return True+ p = find_principled(m)+ if p is None:+ return False+ s = p.inputs["Emission Strength"]+ c = p.inputs["Emission Color"]+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))+++def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+++def uses_object_dependence(m):+ """Nodes whose result depends on the object it sits on (bakes per representative instance)."""+ if not m or not m.node_tree:+ return []+ hits = set()+ def walk(nt):+ for n in nt.nodes:+ if n.type in ("OBJECT_INFO", "AMBIENT_OCCLUSION", "NEW_GEOMETRY", "BEVEL"):+ hits.add(n.type)+ if n.type == "TEX_COORD":+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+ return sorted(hits)+++def animated(m):+ ad = m.node_tree.animation_data if m and m.node_tree else None+ return bool(ad and (ad.drivers or ad.action))+++# ------------------------------------------------------------------ scene classification++def particle_instancers():+ srcs, emitters = set(), set()+ for o in sc.objects:+ for md in o.modifiers:+ if md.type == "PARTICLE_SYSTEM":+ st = md.particle_system.settings+ emitters.add(o.name)+ if st.render_type == "OBJECT" and st.instance_object:+ srcs.add(st.instance_object.name)+ if st.render_type == "COLLECTION" and st.instance_collection:+ srcs.update(x.name for x in st.instance_collection.all_objects)+ return srcs, emitters+++def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+ return "m_" + o.data.name+ return "o_" + o.name+++def tri_count(me):+ me.calc_loop_triangles()+ return len(me.loop_triangles)+++def render_uv(me):+ return next((l for l in me.uv_layers if l.active_render), None) or me.uv_layers.active+++def uv_ok(me):+ """True if the active render UV is a usable non-overlapping atlas inside 0..1 (generated-prop style)."""+ uvl = render_uv(me)+ if uvl is None or len(me.loop_triangles) == 0:+ return False+ n = len(me.loops)+ uv = np.empty(n * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ if uv.min() < -0.01 or uv.max() > 1.01:+ return False+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ total = float(a.sum())+ if total > 1.02 or total < 0.05:+ return False+ # Coarse overlap check: rasterise triangle centroids+vertices into a 512 grid weighted by area.+ g = 512+ idx = np.clip((t.mean(axis=1) * g).astype(np.int32), 0, g - 1)+ occ = np.zeros((g, g), np.float64)+ np.add.at(occ, (idx[:, 1], idx[:, 0]), a)+ return float(occ.max()) < 4.0 / (g * g) + 1e-4 or total < 0.9+++def surface_area(o, me):+ mw = o.matrix_world+ me.calc_loop_triangles()+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3)+ m3 = np.array(mw.to_3x3())+ co = co @ m3.T+ vt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ t = co[vt.reshape(-1, 3)]+ return float(0.5 * np.linalg.norm(np.cross(t[:, 1] - t[:, 0], t[:, 2] - t[:, 0]), axis=1).sum())+++def pow2(x, lo, hi):+ r = lo+ while r < x and r < hi:+ r *= 2+ return min(r, hi)+++# ------------------------------------------------------------------ baking++BAKE_SCENE = None+++def bake_scene():+ global BAKE_SCENE+ if BAKE_SCENE is None:+ bs = bpy.data.scenes.new("__bake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "GPU" if GPU else "CPU"+ bs.cycles.samples = 4+ bs.cycles.use_denoising = False+ bs.render.bake.margin = 8+ bs.render.bake.use_clear = True+ bs.render.bake.target = "IMAGE_TEXTURES"+ if THREADS:+ bs.render.threads_mode = "FIXED"+ bs.render.threads = THREADS+ bs.world = sc.world+ bs.frame_current = FRAME+ BAKE_SCENE = bs+ return BAKE_SCENE+++def run_bake(o, kind):+ bs = bake_scene()+ vl = bs.view_layers[0]+ with bpy.context.temp_override(scene=bs, view_layer=vl, object=o, active_object=o,+ selected_objects=[o], selected_editable_objects=[o]):+ if kind == "NORMAL":+ bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT", margin=8, use_clear=True)+ else:+ bpy.ops.object.bake(type="EMIT", margin=8, use_clear=True)+++def _src(sock):+ return sock.links[0].from_socket if sock.is_linked else None+++class Rewire:+ """Temporarily route one Principled channel into an Emission shader on the material output."""++ def __init__(self, m, channel, img):+ self.m, self.nt = m, m.node_tree+ self.added, self.saved = [], None+ nt = self.nt+ out = output_node(nt)+ p = find_principled(m)+ sh = surface_shader(m)+ em = nt.nodes.new("ShaderNodeEmission")+ self.added.append(em)+ em.inputs["Strength"].default_value = 1.0+ col = em.inputs["Color"]+ if channel == "base":+ if p is not None:+ s = p.inputs["Base Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ elif sh is not None and sh.type == "EMISSION":+ col.default_value = (0, 0, 0, 1)+ elif sh is not None and "Color" in sh.inputs:+ s = sh.inputs["Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+ # R=1 (no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+ else:+ cmb.inputs[i].default_value = p.inputs[k].default_value if p is not None else dv+ nt.links.new(cmb.outputs[0], col)+ elif channel == "emit":+ if sh is not None and sh.type == "EMISSION":+ for k in ("Color", "Strength"):+ s = sh.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[k])+ else:+ em.inputs[k].default_value = s.default_value+ elif p is not None:+ for k, ek in (("Emission Color", "Color"), ("Emission Strength", "Strength")):+ s = p.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[ek])+ else:+ em.inputs[ek].default_value = s.default_value+ else:+ col.default_value = (0, 0, 0, 1)+ if out is not None:+ self.saved = _src(out.inputs["Surface"])+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ self.out = out+ self.tex = nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.added.append(self.tex)+ nt.nodes.active = self.tex++ def restore(self):+ nt = self.nt+ if self.out is not None:+ for l in list(self.out.inputs["Surface"].links):+ nt.links.remove(l)+ if self.saved is not None:+ nt.links.new(self.saved, self.out.inputs["Surface"])+ for n in self.added:+ nt.nodes.remove(n)+++class TargetOnly:+ """For the normal bake: keep the material, just add the active target image node."""++ def __init__(self, m, img):+ self.nt = m.node_tree+ self.tex = self.nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.nt.nodes.active = self.tex++ def restore(self):+ self.nt.nodes.remove(self.tex)+++def new_img(name, res, colorspace, is_float=False):+ old = bpy.data.images.get(name)+ if old:+ bpy.data.images.remove(old)+ w, h = (res, res) if isinstance(res, int) else res+ img = bpy.data.images.new(name, w, h, alpha=False, float_buffer=is_float)+ img.colorspace_settings.name = colorspace+ return img+++def save_png(img, path):+ img.filepath_raw = path+ img.file_format = "PNG"+ img.save()+++def bake_channel(o, mats, channel, res, path):+ cs = {"base": "sRGB", "orm": "Non-Color", "emit": "Linear Rec.709", "normal": "Non-Color"}[channel]+ img = new_img("__bake_" + channel, res, cs, is_float=(channel == "emit"))+ rw = []+ try:+ seen = set()+ for m in mats:+ if m is None or m.name in seen or m.node_tree is None:+ continue+ seen.add(m.name)+ rw.append(TargetOnly(m, img) if channel == "normal" else Rewire(m, channel, img))+ run_bake(o, "NORMAL" if channel == "normal" else "EMIT")+ finally:+ for r in rw:+ r.restore()+ scale = 1.0+ if channel == "emit":+ w, h = (res, res) if isinstance(res, int) else res+ px = np.empty(w * h * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mx = float(np.percentile(px.max(axis=1), 99.95)) if px.size else 0.0+ scale = max(mx, 1e-6)+ out = bpy.data.images.new("__emit_png", w, h, alpha=False)+ out.colorspace_settings.name = "sRGB"+ q = np.ones((w * h, 4), np.float32)+ q[:, :3] = np.clip(px / scale, 0, 1)+ out.pixels.foreach_set(q.ravel())+ save_png(out, path)+ bpy.data.images.remove(out)+ else:+ save_png(img, path)+ bpy.data.images.remove(img)+ return scale+++def uv_stats(me, name):+ """UV coords of a layer and the fraction of the 0..1 square its triangles cover."""+ uvl = me.uv_layers[name]+ uv = np.empty(len(me.loops) * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ me.calc_loop_triangles()+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ return uv, float(a.sum())+++def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+ empty square one. Returns (uv name, kept, aspect w/h, uv coverage)."""+ me = me_owner.data+ if "bake" in me.uv_layers:+ me.uv_layers.active = me.uv_layers["bake"]+ return "bake", False, me_owner.get("_bake_aspect", 1.0), me_owner.get("_bake_cov", 0.5)+ me.calc_loop_triangles()+ if uv_ok(me):+ ar = render_uv(me)+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)+ uvl = me.uv_layers.new(name="bake")+ if ar is not None:+ ar.active_render = True # keep materials reading their original UVs+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ vl.objects.active = me_owner+ me_owner.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ bpy.ops.mesh.select_all(action="SELECT")+ bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=False)+ try:+ bpy.ops.uv.select_all(action="SELECT")+ bpy.ops.uv.pack_islands(rotate=True, margin=0.003, shape_method="AABB", scale=True)+ except Exception as ex: # noqa: BLE001+ log("pack_islands failed", me_owner.name, ex)+ bpy.ops.object.mode_set(mode="OBJECT")+ me_owner.select_set(False)+ uv, _ = uv_stats(me, "bake")+ lo, hi = uv.min(axis=0), uv.max(axis=0)+ span = np.maximum(hi - lo, 1e-6)+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+++def bake_size(area, cov, aspect, kept):+ """Texture W,H so texel density is ~DENSITY px/m over the real surface; power of two, clamped."""+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4 # big architecture: coarser texels+ px = d * d * area / cov+ lo = 1024 if kept else 32+ w = pow2(math.sqrt(px * aspect), lo, MAX_RES)+ h = pow2(math.sqrt(px / aspect), lo, MAX_RES)+ if kept:+ w = h = min(max(w, h), 2048) # generated props: their own atlas, 1-2K+ return w, h+++# ------------------------------------------------------------------ export++def to_mesh_object(o):+ """Text/curve objects -> real mesh objects (evaluated) in a scratch collection; originals hidden."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ n = bpy.data.objects.new(o.name + "__mesh", me)+ c = bpy.data.collections.get("__converted") or bpy.data.collections.new("__converted")+ if c.name not in sc.collection.children:+ sc.collection.children.link(c)+ c.objects.link(n)+ n.matrix_world = o.matrix_world.copy()+ for k in ("visible_shadow", "visible_camera", "visible_glossy", "visible_diffuse"):+ setattr(n, k, getattr(o, k))+ o.hide_render = True+ return n+++def export_glb(o, uv_name, glass_slots, path):+ """Evaluated mesh at identity with only the bake UV; slots: 0 = baked, 1+ = each glass material."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ for l in [l for l in me.uv_layers if l.name != uv_name]:+ me.uv_layers.remove(l)+ if len(me.uv_layers):+ me.uv_layers[0].name = "UVMap"+ gl = list(glass_slots)+ mi = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("material_index", mi)+ remap = np.zeros(max(len(o.material_slots), 1), np.int32)+ for i in range(len(o.material_slots)):+ remap[i] = gl.index(i) + 1 if i in gl else 0+ mi = remap[np.clip(mi, 0, len(remap) - 1)]+ me.polygons.foreach_set("material_index", mi)+ me.materials.clear()+ base = bpy.data.materials.get("BAKED") or bpy.data.materials.new("BAKED")+ me.materials.append(base)+ for k, gi in enumerate(gl):+ gm = bpy.data.materials.get(f"GLASS_{k}") or bpy.data.materials.new(f"GLASS_{k}")+ me.materials.append(gm)+ tmp = bpy.data.objects.new("__export", me)+ sc.collection.objects.link(tmp)+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ tmp.select_set(True)+ vl.objects.active = tmp+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_apply=True,+ export_materials="PLACEHOLDER", export_texcoords=True, export_normals=True,+ export_tangents=True, export_yup=True, export_animations=False,+ export_cameras=False, export_lights=False, export_extras=False)+ bpy.data.objects.remove(tmp)+ bpy.data.meshes.remove(me)+++# ------------------------------------------------------------------ volumes++def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+ m = next((m for m in o.data.materials if m and is_volume_only(m)), None)+ if m is None:+ return None+ pv = next((nd for nd in m.node_tree.nodes if nd.type == "PRINCIPLED_VOLUME"), None)+ if pv is None:+ return None+ me0 = o.data+ xs = [v.co.x for v in me0.vertices]+ ys = [v.co.y for v in me0.vertices]+ zs = [v.co.z for v in me0.vertices]+ lo, hi = Vector((min(xs), min(ys), min(zs))), Vector((max(xs), max(ys), max(zs)))+ res = {"levels": [], "density": [], "emission": [], "emission_color": None}+ for f in levels:+ z = lo.z + f * (hi.z - lo.z)+ me = bpy.data.meshes.new("__slice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__slice", me)+ sc.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ out = output_node(nt)+ for l in list(out.inputs["Volume"].links):+ nt.links.remove(l)+ vals = {}+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ em = nt.nodes.new("ShaderNodeEmission")+ s = pvc.inputs[sock]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ img = new_img("__vol", n, "Non-Color", is_float=True)+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ bs = bake_scene()+ bs.collection.objects.link(sl)+ try:+ run_bake(sl, "EMIT")+ finally:+ bs.collection.objects.unlink(sl)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ vals[key] = float(px.reshape(-1, 4)[:, 0].mean())+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ res["levels"].append(f)+ res["density"].append(vals["density"])+ res["emission"].append(vals["emission"])+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ c = pv.inputs["Color"].default_value+ res["albedo"] = [c[0], c[1], c[2]]+ res["anisotropy"] = pv.inputs["Anisotropy"].default_value+ ec = pv.inputs["Emission Color"]+ if ec.is_linked:+ # Sample the colour ramp if it is one (flame): mid-height colour as a representative.+ n0 = ec.links[0].from_node+ if n0.type == "VALTORGB":+ res["emission_color"] = list(n0.color_ramp.evaluate(0.6))[:3]+ else:+ res["emission_color"] = list(ec.default_value)[:3]+ mw = o.matrix_world+ corners = [mw @ Vector((x, y, z)) for x in (lo.x, hi.x) for y in (lo.y, hi.y) for z in (lo.z, hi.z)]+ wlo = Vector([min(c[i] for c in corners) for i in range(3)])+ whi = Vector([max(c[i] for c in corners) for i in range(3)])+ res["bounds_ue"] = {"center": ue_vec((wlo + whi) / 2), "extent": [(whi.x - wlo.x) * 50, (whi.y - wlo.y) * 50, (whi.z - wlo.z) * 50]}+ res["bounds_m"] = {"lo": list(wlo), "hi": list(whi)}+ res["material"] = m.name+ res["animated"] = animated(m)+ return res+++# ------------------------------------------------------------------ lights / cameras / world / grade++def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+ mx = max(col) or 1.0+ P = L.energy+ e = {"name": o.name, "type": L.type, "color": [c / mx for c in col], "energy_w": P,+ "cast_shadows": bool(getattr(L, "use_shadow", True)),+ "specular": 1.0 if getattr(o, "visible_glossy", True) else 0.0,+ "diffuse": 1.0 if getattr(o, "visible_diffuse", True) else 0.0,+ "volume": 1.0 if getattr(o, "visible_volume_scatter", True) else 0.0,+ "loc": ue_vec(o.matrix_world.translation), "animated": bool(L.animation_data and (L.animation_data.drivers or L.animation_data.action))}+ f, u = ue_axes(o.matrix_world)+ e["forward"], e["up"] = f, u+ k = mx # colour normalisation folds into intensity+ if L.type in ("POINT", "SPOT"):+ e["candela"] = LM_PER_W * P * k / (4 * math.pi)+ e["source_radius"] = L.shadow_soft_size * 100+ e["soft_falloff"] = bool(getattr(L, "use_soft_falloff", True))+ if L.type == "SPOT":+ outer = math.degrees(L.spot_size) / 2+ e["outer_cone"] = min(outer, 80.0)+ e["inner_cone"] = outer * (1 - L.spot_blend)+ if outer > 80:+ e["note"] = f"spot cone {outer * 2:.0f} deg > Unreal max 160: clamped"+ elif L.type == "AREA":+ e["candela"] = LM_PER_W * P * k / math.pi+ e["shape"] = L.shape+ sx = L.size+ sy = L.size_y if L.shape in ("RECTANGLE", "ELLIPSE") else L.size+ sxx, syy, _ = o.matrix_world.to_scale()+ e["width"], e["height"] = sx * sxx * 100, sy * syy * 100+ e["spread_deg"] = math.degrees(getattr(L, "spread", math.pi))+ elif L.type == "SUN":+ e["lux"] = LM_PER_W * P * k+ e["angle_deg"] = math.degrees(L.angle)+ # IES / gobo: node-based light textures.+ if L.use_nodes and L.node_tree:+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+++def camera_entry(o):+ c = o.data+ f, u = ue_axes(o.matrix_world)+ rx, ry = sc.render.resolution_x, sc.render.resolution_y+ sw = c.sensor_width if c.sensor_fit in ("AUTO", "HORIZONTAL") else c.sensor_height * rx / ry+ d = {"name": o.name, "type": c.type, "lens_mm": c.lens, "sensor_width_mm": sw, "sensor_height_mm": sw * ry / rx,+ "sensor_fit": c.sensor_fit, "shift": [c.shift_x, c.shift_y], "clip": [c.clip_start * 100, c.clip_end * 100],+ "loc": ue_vec(o.matrix_world.translation), "forward": f, "up": u,+ "dof": {"enabled": c.dof.use_dof, "focus_cm": c.dof.focus_distance * 100, "fstop": c.dof.aperture_fstop,+ "blades": c.dof.aperture_blades, "focus_object": c.dof.focus_object.name if c.dof.focus_object else None}}+ if o.name in DOF:+ fd, fs = DOF[o.name]+ d["dof"].update(enabled=True, focus_cm=fd * 100, fstop=fs, source="--dof override (stills script)")+ return d+++def world_bake(path, w=2048, h=1024, spp=32):+ ws = bpy.data.scenes.new("__world")+ ws.world = sc.world+ ws.render.engine = "CYCLES"+ ws.cycles.device = "CPU"+ ws.cycles.samples = spp+ ws.render.resolution_x, ws.render.resolution_y, ws.render.resolution_percentage = w, h, 100+ ws.view_settings.view_transform = "Standard"+ ws.render.image_settings.file_format = "OPEN_EXR"+ ws.render.image_settings.color_depth = "16"+ cd = bpy.data.cameras.new("__pano")+ cd.type = "PANO"+ try:+ cd.panorama_type = "EQUIRECTANGULAR"+ except Exception:+ cd.cycles.panorama_type = "EQUIRECTANGULAR"+ co = bpy.data.objects.new("__pano", cd)+ ws.collection.objects.link(co)+ co.rotation_euler = (math.radians(90), 0, math.radians(-90)) # looking +X? (equirect centre = -Y in Blender -> fixed below)+ co.rotation_euler = (math.radians(90), 0, 0)+ ws.camera = co+ ws.render.filepath = path+ with bpy.context.temp_override(scene=ws):+ bpy.ops.render.render(write_still=True, scene=ws.name)+ # mean radiance for the sky light estimate+ img = bpy.data.images.load(path)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mean = px.mean(axis=0).tolist()+ bpy.data.images.remove(img)+ return {"equirect_exr": path, "mean_radiance": mean, "camera_note": "equirect centre looks along Blender +Y"}+++def compositor_nodes():+ # 5.0: compositing_node_group; Scene.node_tree is gone (use_nodes can still read True with no tree).+ tree = getattr(sc, "compositing_node_group", None) or getattr(sc, "node_tree", None)+ if tree is None:+ return []+ out = []+ for n in tree.nodes:+ d = {"type": n.bl_idname, "name": n.name, "inputs": {}}+ for i in n.inputs:+ if i.is_linked or not hasattr(i, "default_value"):+ continue+ v = i.default_value+ try:+ v = v if isinstance(v, str) else list(v)+ except TypeError:+ pass+ if isinstance(v, (int, float, str, list, bool)):+ d["inputs"][i.name] = v+ for k in ("glare_type", "quality", "blend_type"):+ if hasattr(n, k):+ d[k] = getattr(n, k)+ out.append(d)+ return out+++def ffmpeg_grade(grade_sh):+ """Pull GRADE="..." out of a scene's grade.sh; split into colour (LUT-able) and spatial filters."""+ txt = open(grade_sh, encoding="utf-8").read()+ m = re.search(r'GRADE="([^"]+)"', txt)+ if not m:+ return None+ filters = [f for f in m.group(1).split(",") if f]+ colour = [f for f in filters if f.split("=")[0] in ("curves", "hue", "eq", "colorbalance", "colorchannelmixer", "lutrgb", "colortemperature")]+ spatial = [f for f in filters if f not in colour]+ g = {"source": grade_sh, "filter": m.group(1), "colour": colour, "spatial": spatial}+ for f in spatial:+ if f.startswith("vignette"):+ a = re.search(r"angle=PI/([\d.]+)", f)+ g["vignette_angle_rad"] = math.pi / float(a.group(1)) if a else math.pi / 5+ if f.startswith("rgbashift"):+ g["chromatic_px"] = 1+ noise = re.search(r"noise=alls=(\d+)", txt)+ if noise:+ g["grain_strength"] = int(noise.group(1))+ return g+++def make_lut(colour_filters, path):+ """UE colour grading LUT (256x16, 16 slices of 16x16; R across a slice, G down, B by slice), with the ffmpeg+ colour filters applied. Unreal applies it after the tone curve, i.e. in display space, like ffmpeg on the PNG."""+ n = 16+ ident = os.path.join(os.path.dirname(path), "lut_identity.png")+ img = bpy.data.images.new("__lut", n * n, n, alpha=False)+ img.colorspace_settings.name = "Non-Color"+ px = np.zeros((n, n * n, 4), np.float32)+ for b in range(n):+ for g in range(n):+ for r in range(n):+ px[g, b * n + r] = (r / (n - 1), g / (n - 1), b / (n - 1), 1)+ # Blender rows go bottom-up; UE LUT row 0 (top) is G=0.+ img.pixels.foreach_set(px[::-1].ravel())+ save_png(img, ident)+ bpy.data.images.remove(img)+ if not colour_filters:+ return ident+ cmd = [FFMPEG, "-v", "error", "-y", "-i", ident, "-vf", ",".join(colour_filters), "-frames:v", "1", path]+ try:+ r = subprocess.run(cmd, capture_output=True, text=True)+ except OSError as ex:+ log("LUT ffmpeg not runnable (pass --ffmpeg or set FFMPEG):", FFMPEG, ex)+ return ident+ if r.returncode != 0:+ log("LUT ffmpeg failed:", r.stderr[:300])+ return ident+ return path+++# ------------------------------------------------------------------ main++def main():+ t0 = time.time()+ srcs, emitters = particle_instancers()+ report = {"skipped": [], "converted": [], "volumes": {}, "fx": [], "warnings": []}+ objs = []+ for o in list(sc.objects):+ if o.hide_render or not o.visible_get():+ if o.type in ("MESH", "FONT", "CURVE") and not o.hide_render:+ pass+ if o.hide_render:+ continue+ if o.name in srcs:+ report["skipped"].append([o.name, "particle instance source (exported as fx note)"])+ continue+ if o.name in emitters:+ st = [md.particle_system.settings for md in o.modifiers if md.type == "PARTICLE_SYSTEM"]+ report["fx"].append({"name": o.name, "kind": "particles", "count": sum(s.count for s in st),+ "instance": [s.instance_object.name if s.instance_object else None for s in st],+ "lifetime": [s.lifetime for s in st], "velocity": [list(s.object_align_factor) for s in st]})+ if not o.show_instancer_for_render:+ continue+ if o.type in ("FONT", "CURVE", "SURFACE", "META"):+ if o.type == "CURVE" and o.data.bevel_depth == 0 and not o.data.bevel_object and o.data.extrude == 0:+ report["skipped"].append([o.name, "curve without geometry"])+ continue+ n = to_mesh_object(o)+ report["converted"].append([o.name, o.type])+ objs.append(n)+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+ log("volume", o.name, [round(x, 4) for x in v["density"]], [round(x, 2) for x in v["emission"]])+ continue+ objs.append(o)+ # Group by unique mesh.+ assets = {}+ for o in objs:+ k = mesh_key(o)+ assets.setdefault(k, []).append(o)+ keys = sorted(assets, key=lambda k: assets[k][0].name, reverse=REVERSE)+ if ONLY:+ keys = [k for k in keys if any(o.name in ONLY or o.name.split("__")[0] in ONLY for o in assets[k])]+ if LIMIT:+ keys = keys[:LIMIT]+ log(f"{len(objs)} mesh objects -> {len(assets)} unique meshes; exporting {len(keys)}")+ entries, placements = [], []+ for ai, k in enumerate(keys):+ group = assets[k]+ rep = group[0]+ an = safe(rep.data.name if k.startswith("m_") else rep.name)+ an = f"{an}_{ai:03d}" if any(e["asset"] == an for e in entries) else an+ mats = [s.material for s in rep.material_slots]+ glass = [i for i, m in enumerate(mats) if m and is_glass(m)]+ bake_mats = [m for i, m in enumerate(mats) if i not in glass]+ dg = bpy.context.evaluated_depsgraph_get()+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+ meta = glb[:-4] + ".json"+ done = os.path.exists(glb) # written after every bake of the asset succeeded+ if done:+ # Resume: skip the UV unwrap (an edit-mode smart_project per asset). Blender 5.0.1's bake crashes+ # (OpenImageIO ustring::operator= in ccl::create_mesh) after a few hundred unwrap+bake cycles in one+ # process; re-unwrapping every finished asset on resume made it crash at the same asset every time.+ m0 = json.load(open(meta)) if os.path.exists(meta) else {}+ uv_name, kept, cov, res = None, m0.get("uv") == "kept", m0.get("uv_coverage", 0.0), m0.get("res", [0, 0])+ else:+ uv_name, kept, aspect, cov = ensure_bake_uv(rep, rep)+ res = bake_size(area, cov, aspect, kept)+ e = {"asset": an, "key": k, "tris": tris, "area_m2": round(area, 3), "uv": "kept" if kept else "smart_project",+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera)}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+ bake_scene().collection.objects.link(rep)+ try:+ bake_channel(rep, bake_mats, "base", res, p["base"])+ bake_channel(rep, bake_mats, "orm", res, p["orm"])+ if any(m and perturbs_normal(m) for m in bake_mats):+ bake_channel(rep, bake_mats, "normal", res, p["normal"])+ if any(m and emissive(m) for m in bake_mats):+ s = bake_channel(rep, bake_mats, "emit", res, p["emit"])+ json.dump({"scale": s}, open(p["emit"] + ".json", "w"))+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+ e["tex"] = {c: os.path.relpath(v, OUT) for c, v in p.items() if os.path.exists(v)}+ if not os.path.exists(glb):+ export_glb(rep, uv_name, glass, glb)+ if not done:+ json.dump({"res": list(res), "uv": e["uv"], "uv_coverage": e["uv_coverage"]}, open(meta, "w"))+ e["glb"] = os.path.relpath(glb, OUT)+ # Local bounds in Unreal axes for the importer orientation check.+ bb = [Vector(c) for c in rep.bound_box]+ e["check_bounds"] = {"min": ue_vec(Vector([min(c[i] for c in bb) for i in range(3)])),+ "max": ue_vec(Vector([max(c[i] for c in bb) for i in range(3)]))}+ e["bake_s"] = round(time.time() - t1, 1)+ entries.append(e)+ for o in group:+ placements.append({"name": o.name, "asset": an, **ue_xform(o.matrix_world),+ "shadow": bool(o.visible_shadow), "camera_visible": bool(o.visible_camera)})+ log(f"[{ai + 1}/{len(keys)}] {an} tris={tris} res={res} uv={e['uv']} inst={len(group)} {e['bake_s']}s")+ # Lights, cameras, world, grade.+ lights = [light_entry(o) for o in sc.objects if o.type == "LIGHT" and not o.hide_render]+ cams = [camera_entry(o) for o in sc.objects if o.type == "CAMERA"]+ world = None+ wpath = os.path.join(OUT, "world", "sky.exr")+ if sc.world:+ world = world_bake(wpath) if not os.path.exists(wpath) or "--rebake-world" in argv else {"equirect_exr": wpath}+ if "mean_radiance" not in world:+ img = bpy.data.images.load(wpath)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ world["mean_radiance"] = px.reshape(-1, 4)[:, :3].mean(axis=0).tolist()+ bpy.data.images.remove(img)+ world["equirect_exr"] = os.path.relpath(wpath, OUT)+ world["nits_scale"] = LM_PER_W+ vs = sc.view_settings+ grade = {"view_transform": vs.view_transform, "look": vs.look, "exposure": vs.exposure, "gamma": vs.gamma,+ "use_curve_mapping": vs.use_curve_mapping,+ "ev100": math.log2(LM_PER_W / 1.2) - vs.exposure,+ "compositor": compositor_nodes(),+ "motion_blur": {"on": sc.render.use_motion_blur, "shutter": sc.render.motion_blur_shutter},+ "resolution": [sc.render.resolution_x, sc.render.resolution_y], "fps": sc.render.fps}+ if vs.use_curve_mapping:+ grade["curves"] = [[(p.location[0], p.location[1]) for p in c.points] for c in vs.curve_mapping.curves]+ if GRADE_SH and os.path.exists(GRADE_SH):+ g = ffmpeg_grade(GRADE_SH)+ if g:+ g["lut"] = os.path.relpath(make_lut(g["colour"], os.path.join(OUT, "grade", "lut_grade.png")), OUT)+ grade["ffmpeg"] = g+ scene = {"source": SRC, "frame": FRAME, "units": "unreal cm, X fwd, Y right, Z up", "lm_per_w": LM_PER_W,+ "assets": entries, "placements": placements, "lights": lights, "cameras": cams, "world": world,+ "volumes": report["volumes"], "fx": report["fx"], "grade": grade,+ "skipped": report["skipped"], "converted": report["converted"], "export_s": round(time.time() - t0)}+ jp = os.path.join(OUT, "scene.json")+ if os.path.exists(jp) and (ONLY or LIMIT):+ old = json.load(open(jp, encoding="utf-8"))+ have = {e["asset"] for e in entries}+ scene["assets"] = [e for e in old.get("assets", []) if e["asset"] not in have] + entries+ scene["placements"] = [p for p in old.get("placements", []) if p["asset"] not in have] + placements+ json.dump(scene, open(jp, "w", encoding="utf-8"), indent=1)+ log(f"wrote {jp}: {len(scene['assets'])} assets, {len(scene['placements'])} placements, {len(lights)} lights, "+ f"{len(cams)} cameras, {len(report['volumes'])} volumes in {time.time() - t0:.0f}s")+++main()diff --git a/unreal_fx/fx_export.py b/unreal_fx/fx_export.pynew file mode 100644index 0000000..5335d03--- /dev/null+++ b/unreal_fx/fx_export.py@@ -0,0 +1,732 @@+"""Effects classifier for the AnyScene -> Unreal exporter (NIAGARA.md §4): turns volume-shader effects and particle+systems into `scene.json["fx"]` entries (schema in NIAGARA.md §4.2) with a technique, an AnySceneFX template and its+User parameters filled in, so build_level.py only places and sets them.++Used two ways:+ * from export_blend.py: `import fx_export; fx = fx_export.classify(sc, frame, emitters, volumes)`+ * standalone (no mesh bakes; patches an existing export):+ blender -b <copy>.blend --python unreal_fx/fx_export.py -- --scene <export>/scene.json --out <dir>/scene.json [--frame 60]+ writes the input scene.json + "fx" (and marks the volumes an fx entry claims) to --out.++Detection is evidence-based (material node tree, drivers, particle settings, names as a tie-breaker). Parameters+come from measurements: procedural volumes are baked on horizontal slices (density / emission per texel) to get+the plume's base, lean, spread and reach; driver expressions on mapping nodes give the scroll (rise) speed; particle+settings give rate, speed, size and lifetime; the ground under a drip line comes from a ray cast.+"""+import json+import math+import os+import re+import sys+import zlib++import bpy+import numpy as np+from mathutils import Vector++LM_PER_W = 683.0+TEMPLATES = "/Game/AnySceneFX/Systems/{0}.{0}"+TYPE_WORDS = {"fire": ("flame", "fire", "burner"), "steam": ("steam", "vapor", "vapour"), "smoke": ("smoke", "curl"),+ "haze": ("haze", "fog", "mist"), "rain": ("rain", "drizzle"), "drips": ("drip",), "dust": ("dust", "mote"),+ "sparks": ("spark",), "embers": ("ember",)}+PARAM_TYPES = None # filled from templates.json when present+++def log(*a):+ print("FXEXPORT", *a, flush=True)+++def ue_vec(v, s=100.0):+ return [v[0] * s, -v[1] * s, v[2] * s]+++def ue_dir(v, s=100.0):+ return [v[0] * s, -v[1] * s, v[2] * s]+++def crc(s):+ return zlib.crc32(s.encode()) & 0x7FFFFFFF+++def name_hint(name):+ n = name.lower()+ return {t for t, ws in TYPE_WORDS.items() if any(w in n for w in ws)}+++# ------------------------------------------------------------------ node-tree evidence++def out_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ return next((n for n in outs if n.is_active_output), outs[0] if outs else None)+++def volume_material(o):+ for s in o.material_slots:+ m = s.material+ if m and m.node_tree:+ o_ = out_node(m.node_tree)+ if o_ and o_.inputs["Volume"].is_linked and not o_.inputs["Surface"].is_linked:+ return m+ return None+++def principled_volume(m):+ return next((n for n in m.node_tree.nodes if n.type == "PRINCIPLED_VOLUME"), None)+++def drivers(m):+ ad = m.node_tree.animation_data if m.node_tree else None+ return list(ad.drivers) if ad else []+++def driver_rate(d, fps):+ """Per-second rate of a driver expression that is linear in `frame` (e.g. "-frame * 0.055")."""+ ex = d.driver.expression+ try:+ f = lambda fr: eval(ex, {"__builtins__": {}}, {"frame": fr, "sin": math.sin, "cos": math.cos}) # noqa: E731+ return (f(101.0) - f(100.0)) * fps+ except Exception:+ return None+++def mapping_scroll(m, fps):+ """Pattern velocity in object space (m/s) from Mapping-node Location drivers: the pattern moves by -dL/scale."""+ v = [0.0, 0.0, 0.0]+ found = False+ for d in drivers(m):+ mt = re.match(r'nodes\["([^"]+)"\]\.inputs\[(\d+)\]\.default_value', d.data_path)+ if not mt:+ continue+ nd = m.node_tree.nodes.get(mt.group(1))+ if not nd or nd.type != "MAPPING" or int(mt.group(2)) != 1: # inputs[1] = Location+ continue+ r = driver_rate(d, fps)+ if r is None:+ continue+ sc = nd.inputs["Scale"].default_value[d.array_index] or 1.0+ v[d.array_index] = -r / sc+ found = True+ return v if found else None+++def noise_evolution(m, fps):+ """Fastest 4D-noise W rate (1/s): how quickly the pattern re-forms (flicker / boil)."""+ rates = []+ for d in drivers(m):+ mt = re.match(r'nodes\["([^"]+)"\]\.inputs\[\d+\]\.default_value', d.data_path)+ if mt and m.node_tree.nodes.get(mt.group(1)) and m.node_tree.nodes[mt.group(1)].type == "TEX_NOISE":+ r = driver_rate(d, fps)+ if r is not None:+ rates.append(abs(r))+ return max(rates) if rates else 0.0+++def emission_colour(m, levels_z, weights):+ """Emission-weighted mean colour. Handles a ColorRamp on Emission Color (evaluated at each level's generated z+ when its factor comes from a generated/Z chain; otherwise at 0.6)."""+ pv = principled_volume(m)+ s = pv.inputs["Emission Color"]+ if not s.is_linked:+ return list(s.default_value)[:3]+ n0 = s.links[0].from_node+ if n0.type != "VALTORGB":+ return [1.0, 0.5, 0.1]+ fac = n0.inputs[0]+ by_z = fac.is_linked and fac.links[0].from_node.type == "SEPXYZ" and fac.links[0].from_socket.name == "Z"+ if not by_z:+ return list(n0.color_ramp.evaluate(0.6))[:3]+ acc, w = np.zeros(3), 0.0+ for z, wt in zip(levels_z, weights):+ acc += np.array(n0.color_ramp.evaluate(float(z))[:3]) * wt+ w += wt+ return list(acc / max(w, 1e-9))+++# ------------------------------------------------------------------ slice sampling (Cycles EMIT bakes)++_BS = None+++def bake_scene(frame):+ global _BS+ if _BS is None:+ bs = bpy.data.scenes.new("__fxbake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "CPU"+ bs.cycles.samples = 1+ bs.cycles.use_denoising = False+ bs.render.bake.target = "IMAGE_TEXTURES"+ bs.frame_current = frame+ _BS = bs+ return _BS+++def sample_slices(o, m, frame, n=32, levels=12):+ """Bake Density and Emission Strength of a volume material on `levels` horizontal slices through the object's box+ (sharing its object and texture space). Returns lo, hi (object space) and arrays [levels, n, n] per channel."""+ me0 = o.data+ xs = [v.co for v in me0.vertices]+ lo = Vector([min(c[i] for c in xs) for i in range(3)])+ hi = Vector([max(c[i] for c in xs) for i in range(3)])+ pv = principled_volume(m)+ zs = [lo.z + (k + 0.5) / levels * (hi.z - lo.z) for k in range(levels)]+ out = {"density": np.zeros((levels, n, n)), "emission": np.zeros((levels, n, n))}+ bs = bake_scene(frame)+ for li, z in enumerate(zs):+ me = bpy.data.meshes.new("__fxslice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__fxslice", me)+ bs.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ on = out_node(nt)+ for l in list(on.inputs["Volume"].links):+ nt.links.remove(l)+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ s = pvc.inputs[sock]+ if not s.is_linked and s.default_value == 0:+ continue+ em = nt.nodes.new("ShaderNodeEmission")+ if s.is_linked:+ nt.links.new(s.links[0].from_socket, em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], on.inputs["Surface"])+ img = bpy.data.images.new("__fxvol", n, n, alpha=False, float_buffer=True)+ img.colorspace_settings.name = "Non-Color"+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ with bpy.context.temp_override(scene=bs, view_layer=bs.view_layers[0], object=sl, active_object=sl,+ selected_objects=[sl], selected_editable_objects=[sl]):+ bpy.ops.object.bake(type="EMIT", margin=0, use_clear=True)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ out[key][li] = px.reshape(n, n, 4)[:, :, 0] # [row = y, col = x]+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ return lo, hi, zs, out+++def plume_stats(o, lo, hi, zs, field, n):+ """Per-level weighted centroid (world), radial spread (m) and peak, from a [levels, n, n] field."""+ mw = o.matrix_world+ xs = np.linspace(lo.x, hi.x, n, endpoint=False) + (hi.x - lo.x) / (2 * n)+ ys = np.linspace(lo.y, hi.y, n, endpoint=False) + (hi.y - lo.y) / (2 * n)+ X, Y = np.meshgrid(xs, ys)+ sx, sy, sz = mw.to_scale()+ rows = []+ for k, z in enumerate(zs):+ f = np.clip(field[k], 0, None)+ tot = f.sum()+ if tot <= 1e-9:+ rows.append(None)+ continue+ cx, cy = (f * X).sum() / tot, (f * Y).sum() / tot+ r = np.sqrt(((X - cx) * sx) ** 2 + ((Y - cy) * sy) ** 2)+ rows.append({"c": mw @ Vector((cx, cy, z)), "spread": float((f * r).sum() / tot), "r_peak": float(r[np.unravel_index(np.argmax(f), f.shape)]),+ "peak": float(np.percentile(f, 98)), "mean": float(f.mean()), "sum": float(tot)})+ return rows+++# ------------------------------------------------------------------ entries++def template_for(typ, default):+ """Template whose recipe lists this fx type (templates.json "fx_types"), so a recipe an agent adds for a new type+ is picked up without code changes; falls back to the built-in default."""+ for name, t in (PARAM_TYPES or {}).items():+ if typ in t.get("fx_types", []):+ return name+ return default+++def base_entry(fid, typ, conf, kind, objs, mat, evidence, center_ue, extent_ue, technique, template, fps, preroll):+ template = template_for(typ, template) if template else template+ if technique == "niagara" and template is None:+ technique = "agent" # no template for this type yet: queued for the look-match agent (FX_AGENT.md)+ return {"id": re.sub(r"[^A-Za-z0-9_]", "_", fid), "type": typ, "confidence": round(conf, 2),+ "source": {"kind": kind, "objects": objs, "material": mat, "evidence": evidence},+ "transform": {"loc": center_ue, "quat": [0, 0, 0, 1], "scale": [1, 1, 1]},+ "bounds_ue": {"center": center_ue, "extent": extent_ue},+ "technique": technique, "template": TEMPLATES.format(template) if template else None,+ "params": {}, "param_types": {}, "physical": {}, "time": {"preroll_s": preroll, "fps": fps},+ "seed": crc(fid), "notes": []}+++def set_params(e, params):+ tpl = e["template"].split("/")[-1].split(".")[0] if e["template"] else None+ types = (PARAM_TYPES or {}).get(tpl, {}).get("params", {})+ for k, v in params.items():+ if types and k not in types:+ e["notes"].append(f"param {k} not on {tpl}: dropped")+ continue+ e["params"][k] = [round(x, 4) for x in v] if isinstance(v, (list, tuple)) else round(float(v), 4)+ e["param_types"][k] = types.get(k) or ("color" if k == "Color" else "vec3" if isinstance(v, (list, tuple)) else "float")+++def nearest_light(sc, p_world, radius=1.0):+ """The dominant light near the effect (highest energy within radius), so fire never double-lights."""+ best = None+ for o in sc.objects:+ if o.type == "LIGHT" and not o.hide_render:+ d = (o.matrix_world.translation - p_world).length+ if d <= radius and (best is None or o.data.energy > best[0]):+ best = (o.data.energy, o.name)+ return best[1] if best else None+++def flicker(sc, light_name, frame, n, fps):+ o = sc.objects.get(light_name)+ if not o or not (o.data.animation_data and o.data.animation_data.drivers):+ return None+ vals = []+ for f in range(frame, frame + n):+ sc.frame_set(f)+ vals.append(o.data.energy)+ sc.frame_set(frame)+ base = vals[0] or 1.0+ return {"target": light_name, "property": "intensity", "fps": fps, "start_frame": frame,+ "values": [round(v / base, 4) for v in vals], "note": "multiplier on the light's exported intensity"}+++def classify_volume(sc, o, m, frame, fps):+ pv = principled_volume(m)+ ev, score = [], {}+ emit_linked = pv.inputs["Emission Strength"].is_linked or pv.inputs["Emission Strength"].default_value > 0+ bb = pv.inputs["Blackbody Intensity"].default_value > 0+ if emit_linked or bb:+ score["fire"] = score.get("fire", 0) + 4+ ev.append("principled volume emission")+ scroll = mapping_scroll(m, fps)+ has_noise = any(n.type == "TEX_NOISE" for n in m.node_tree.nodes)+ alb = list(pv.inputs["Color"].default_value)[:3]+ dims = o.dimensions+ if not emit_linked:+ if has_noise and scroll and scroll[2] > 0.3:+ score["steam" if min(alb) > 0.85 else "smoke"] = 4+ ev.append(f"noise scrolling up {scroll[2]:.2f} m/s, albedo {min(alb):.2f}")+ if max(dims) > 3.0 and (not scroll or abs(scroll[2]) < 0.05 * fps):+ score["haze"] = score.get("haze", 0) + 3+ ev.append(f"large box {max(dims):.1f} m")+ for t in name_hint(o.name) | name_hint(m.name):+ score[t] = score.get(t, 0) + 2+ ev.append(f"name hint {t}")+ if not score:+ return None, ev, 0.0+ ranked = sorted(score.items(), key=lambda kv: -kv[1])+ top = ranked[0]+ runner = ranked[1][1] if len(ranked) > 1 else 0+ return top[0], ev, top[1] / (top[1] + runner)+++def seen_from(sc, dg, p, cams, skip):+ """True if the world point p has an unobstructed line to any camera (volume-only objects are see-through)."""+ for cpos in cams:+ d = cpos - p+ dist = d.length+ d.normalize()+ q, left = p.copy(), dist+ for _ in range(16):+ hit, loc, _n, _i, ob, _m = sc.ray_cast(dg, q, d, distance=left)+ if not hit:+ return True+ if ob is not None and (getattr(ob, "original", ob).name in skip or volume_material(getattr(ob, "original", ob))):+ step = (loc - q).length + 1e-3+ q, left = loc + d * 1e-3, left - step+ continue+ break+ return False+++def visible_field(sc, o, lo, hi, zs, field, n, rel=0.02):+ """Mask each slice of `field` to the samples some scene camera can see, which is what Cycles shows: burner jets+ under a wok, flame inside a collar, a fire behind fireplace walls are hidden by opaque geometry. Samples under+ `rel` x the field's peak are dropped. Returns the masked field and the visible fraction per level."""+ cams = [c.matrix_world.translation.copy() for c in sc.objects if c.type == "CAMERA"]+ mw = o.matrix_world+ if not cams:+ return field.copy(), [1.0] * len(zs)+ dg = bpy.context.evaluated_depsgraph_get()+ xs = np.linspace(lo.x, hi.x, n, endpoint=False) + (hi.x - lo.x) / (2 * n)+ ys = np.linspace(lo.y, hi.y, n, endpoint=False) + (hi.y - lo.y) / (2 * n)+ thr = rel * float(np.clip(field, 0, None).max())+ out, frac = np.zeros_like(field), []+ for k, z in enumerate(zs):+ f = np.clip(field[k], 0, None)+ for j, i in zip(*np.nonzero(f > thr)):+ if seen_from(sc, dg, mw @ Vector((xs[i], ys[j], z)), cams, {o.name}):+ out[k, j, i] = f[j, i]+ frac.append(float(out[k].sum() / f.sum()) if f.sum() > 1e-9 else 0.0)+ return out, frac+++def view_radiance(sc, o, lo, hi, zs, field, vis, n):+ """Line integral of `field` (emission per metre) along each camera's view ray through every camera-visible sample:+ the radiance Cycles shows there (a ray grazing a ring of flame crosses far more than one tongue's width).+ Returns the 90th percentile over samples and cameras, in the field's units x metres."""+ cams = [c.matrix_world.translation.copy() for c in sc.objects if c.type == "CAMERA"]+ if not cams:+ return 0.0+ mw = o.matrix_world+ inv = mw.inverted()+ levels = len(zs)+ dz = (zs[1] - zs[0]) if levels > 1 else (hi.z - lo.z)+ sx, sy, sz = mw.to_scale()+ step = 0.5 * min((hi.x - lo.x) / n, (hi.y - lo.y) / n, dz)+ step_m = step * (sx + sy + sz) / 3+ span = (hi - lo).length+ xs = np.linspace(lo.x, hi.x, n, endpoint=False) + (hi.x - lo.x) / (2 * n)+ ys = np.linspace(lo.y, hi.y, n, endpoint=False) + (hi.y - lo.y) / (2 * n)+ out = []+ for k, j, i in zip(*np.nonzero(vis > 0)):+ p = Vector((xs[i], ys[j], zs[k]))+ best = 0.0+ for c in cams:+ d = (p - inv @ c).normalized()+ ts = np.arange(-span, span, step)+ P = np.array(p)[None] + ts[:, None] * np.array(d)[None]+ ii = np.floor((P[:, 0] - lo.x) / (hi.x - lo.x) * n).astype(int)+ jj = np.floor((P[:, 1] - lo.y) / (hi.y - lo.y) * n).astype(int)+ kk = np.floor((P[:, 2] - lo.z) / (hi.z - lo.z) * levels).astype(int)+ ok = (ii >= 0) & (ii < n) & (jj >= 0) & (jj < n) & (kk >= 0) & (kk < levels)+ best = max(best, float(np.clip(field[kk[ok], jj[ok], ii[ok]], 0, None).sum() * step_m))+ out.append(best)+ return float(np.percentile(out, 90)) if out else 0.0+++def visible_rz(em, R, zw):+ w = np.clip(em, 0, None)+ if w.sum() <= 0:+ return None+ rr = np.broadcast_to(R[None], w.shape).ravel()+ zz = np.broadcast_to(np.array(zw)[:, None, None], w.shape).ravel()+ ww = w.ravel()+ o = np.argsort(rr)+ c = np.cumsum(ww[o]) / ww.sum()+ return {"r": round(float((rr * ww).sum() / ww.sum()), 3), "z": round(float((zz * ww).sum() / ww.sum()), 3),+ "r10": round(float(rr[o][np.searchsorted(c, 0.1)]), 3), "r90": round(float(rr[o][np.searchsorted(c, 0.9)]), 3)}+++def fire_entry(sc, o, m, frame, fps, ev, conf):+ n = 32+ lo, hi, zs, f = sample_slices(o, m, frame, n=n, levels=12)+ em_all = f["emission"]+ st_all = plume_stats(o, lo, hi, zs, em_all, n)+ pk_all = max(x["peak"] for x in st_all if x)+ # Only what a scene camera can see counts (Cycles hides the rest the same way): burner jets under a wok, flame+ # inside a collar, a fire behind fireplace walls. Measure the visible part; fall back to the upper half of the band+ # when nothing is visible (a fire inside a closed box is still worth a glow).+ em, vfrac = visible_field(sc, o, lo, hi, zs, em_all, n)+ st = plume_stats(o, lo, hi, zs, em, n)+ # A visible arc covers few texels: compare per-level maxima, not the slice-wide percentile in plume_stats.+ mx_vis = em.reshape(len(zs), -1).max(axis=1)+ occluded = bool(mx_vis.max() < 0.01 * float(em_all.max()))+ lev = [k for k in range(len(zs)) if st[k] and mx_vis[k] > 0.08 * mx_vis.max()] if not occluded else []+ if occluded:+ em, st = em_all, st_all+ lev = [k for k, r in enumerate(st) if r and r["peak"] > 0.08 * pk_all]+ mw = o.matrix_world+ zw = [(mw @ Vector((0, 0, zs[k]))).z for k in range(len(zs))]+ vis = (lev[len(lev) // 2:] if len(lev) > 3 else lev) if occluded else lev+ z0, z1 = zw[vis[0]], zw[lev[-1]]+ dz = (zw[1] - zw[0]) if len(zw) > 1 else 0.05+ # The ring is the emission-weighted radius of the visible part about the whole flame's axis (only the arc facing+ # the camera is visible, so the visible centroid itself is off-axis).+ axis = st_all[lev[0]]["c"] if st_all[lev[0]] else st[lev[0]]["c"]+ ax, ay = (mw.inverted() @ axis).xy+ sx, sy, _ = mw.to_scale()+ gx = np.linspace(lo.x, hi.x, n, endpoint=False) + (hi.x - lo.x) / (2 * n)+ gy = np.linspace(lo.y, hi.y, n, endpoint=False) + (hi.y - lo.y) / (2 * n)+ GX, GY = np.meshgrid(gx, gy)+ R = np.hypot((GX - ax) * sx, (GY - ay) * sy)+ wv = np.clip(em[vis], 0, None)+ ring = float((wv * R[None]).sum() / wv.sum()) if not occluded else float(max(st[k]["r_peak"] for k in vis))+ base = {"c": Vector((axis.x, axis.y, z0))}+ width = max(0.01, float(np.average([st_all[k]["spread"] for k in vis if st_all[k]])) * 0.5)+ E = float(np.percentile(em[lev][em[lev] > 0], 99)) if (em[lev] > 0).any() else float(np.percentile(em_all, 99))+ # Colour from the visible upper part of the flame (the blue base is the Core emitter's job).+ # The licking tips (faint, above the 8% body threshold) carry the flame colour; the blue base is the Core emitter.+ pk = max(x["peak"] for x in st_all if x)+ faint = [k for k, r in enumerate(st_all) if r and r["peak"] > 0.01 * pk]+ upper = set(faint[-3:])+ weights = [st_all[k]["sum"] if st_all[k] and k in upper else 0 for k in range(len(zs))]+ gz = [(k + 0.5) / len(zs) for k in range(len(zs))]+ # Flame body colour = the warmest colour among emitting levels (the blue base is drawn by the Core emitter).+ cands = [emission_colour(m, [gz[k]], [1.0]) for k in faint]+ col = max(cands, key=lambda c: c[0] / (c[2] + 0.05)) if cands else emission_colour(m, gz, weights)+ if max(col) < 1e-3: # an emissive flame is never black: fall back to the whole flame's emission-weighted colour+ col = emission_colour(m, gz, [st_all[k]["sum"] if st_all[k] else 0 for k in range(len(zs))])+ mx = max(col) or 1.0+ height = max(0.03, z1 - z0 + dz)+ scroll = mapping_scroll(m, fps) or [0, 0, 1.0]+ boil = noise_evolution(m, fps)+ life = float(np.clip(height / max(scroll[2], 0.3), 0.18, 0.5))+ c = Vector((base["c"].x, base["c"].y, z0))+ e = base_entry(o.name, "fire", conf, "volume_shader", [o.name], m.name, ev, ue_vec(c),+ [(hi.x - lo.x) * 50 * mw.to_scale()[0], (hi.y - lo.y) * 50 * mw.to_scale()[1], (height + 0.1) * 100],+ "niagara", "NS_Fire", fps, 1.0)+ e["bounds_local"] = {"min": [-(ring + 0.15) * 100, -(ring + 0.15) * 100, -10], "max": [(ring + 0.15) * 100, (ring + 0.15) * 100, (height + 0.25) * 100]}+ e["emitter_shape"] = {"kind": "ring", "extent_cm": [ring * 100, ring * 100, 2]}+ tongue = max(height, 0.08) * 100+ # What Cycles shows is the emission integrated along the view ray, through the whole flame in front of and behind+ # the visible sample (the hidden core still glows through the gap). Sprites overlap ~2x (see SpawnRate).+ L = view_radiance(sc, o, lo, hi, zs, em_all, em if not occluded else em_all, n)+ nits = LM_PER_W * (L if L > 0 else E * 0.45 * tongue / 100) * 0.5+ set_params(e, {+ "RingRadius": ring * 100, "BoxExtent": [ring * 100, ring * 100, 2],+ "Velocity": [0, 0, tongue / life], "LifetimeMin": life * 0.7, "LifetimeMax": life * 1.1,+ # Tongue sprites: ~1/4 of the flame height wide, 2.5x as tall (the slice spread of a ring is ~ its radius,+ # so it cannot give the tongue width).+ "SizeMin": max(2.0, tongue * 0.35), "SizeMax": max(3.0, tongue * 0.55), "Aspect": 2.5,+ # Enough tongues for a continuous ring: circumference / tongue width, refreshed every lifetime, x2 overlap.+ "SpawnRate": float(np.clip(2 * (2 * math.pi * ring * 100) / max(tongue * 0.32, 1) / life, 30, 600)),+ "Color": [col[0] / mx, col[1] / mx, col[2] / mx, 1.0], "Intensity": nits, "Opacity": 1.0,+ "NoiseStrength": 300 + 30 * boil, "NoiseFreq": 0.06, "Drag": 2.0, "VelocityJitter": 0.3, "Grow": -0.5,+ "CoreIntensity": 0.35, "LightIntensity": 0.0, "LightRadius": max(100.0, tongue * 6), "LightOffset": [0, 0, tongue * 0.5],+ })+ e["physical"] = {"emission_nits": round(nits, 1), "view_radiance_p90": round(L, 4), "emission_color": col, "emission_per_m_p99": E, "ring_radius_m": ring,+ "height_m": height, "tongue_halfwidth_m": width,+ "profile": [[round(zw[k], 3), round(st[k]["r_peak"], 3), round(st[k]["peak"], 2)] for k in lev], "scroll_m_s": scroll, "noise_w_rate": boil,+ # [z, emission seen by a scene camera / total] per emitting level+ "visibility": [[round(zw[k], 3), round(vfrac[k], 3)] for k in range(len(zs)) if st_all[k]],+ "occluded_fallback": occluded,+ # where the camera-visible emission sits: weighted r (m, about the axis) and z (m, world), r 10/90 %+ "visible_rz": visible_rz(em, R, zw)}+ e["time"]["preroll_s"] = round(life * 3, 2)+ L = nearest_light(sc, c, 1.0)+ e["light_link"] = L+ if L:+ e["notes"].append(f"practical light {L} lights the set; Niagara LightIntensity left at 0 (no double lighting)")+ fl = flicker(sc, L, frame, 240, fps)+ if fl:+ e["flicker"] = fl+ return e+++def steam_entry(sc, o, m, frame, fps, typ, ev, conf):+ n = 32+ lo, hi, zs, f = sample_slices(o, m, frame, n=n, levels=12)+ d = f["density"]+ st = plume_stats(o, lo, hi, zs, d, n)+ mw = o.matrix_world+ good = [k for k, r in enumerate(st) if r and r["peak"] > 0.05 * max(x["peak"] for x in st if x)]+ if not good:+ return None+ b, t = st[good[0]], st[good[-1]]+ z0 = (mw @ Vector((0, 0, lo.z))).z+ ztop = t["c"].z+ height = max(0.2, ztop - z0)+ scroll = mapping_scroll(m, fps) or [0, 0, 0.5]+ rise = max(0.15, scroll[2])+ # The 4D noise scrolls fast but the plume body is only ~height/rise old at the top: lifetime = reach / rise.+ life = float(np.clip(height / rise, 1.0, 6.0))+ lean = (t["c"] - b["c"]) / life # m/s horizontal drift of the centroid+ sigma = float(np.percentile(d[good], 95)) # 1/m in the wisps+ width = 2 * float(np.mean([st[k]["spread"] for k in good]))+ tau = sigma * width # optical depth across the plume in the dense wisps+ base_r = max(0.04, b["spread"])+ alb = list(principled_volume(m).inputs["Color"].default_value)[:3]+ # Sprites: start ~2 x base radius, grow so the top spread matches.+ s0 = base_r * 2 * 100+ grow = float(np.clip((2 * t["spread"] * 100) / max(s0, 1) - 1, 1.0, 6.0))+ rate = float(np.clip(60.0 * height, 40, 160)) # puffs per second: ~100-300 alive per plume+ alive = rate * life+ overlap = max(1.0, alive * (s0 * (1 + grow / 2)) ** 2 / max((width * 100) * (height * 100), 1))+ alpha = float(np.clip(1 - math.exp(-tau / overlap), 0.02, 0.6))+ c = Vector((b["c"].x, b["c"].y, z0))+ e = base_entry(o.name, typ, conf, "volume_shader", [o.name], m.name, ev, ue_vec(c),+ [(hi.x - lo.x) * 50 * mw.to_scale()[0], (hi.y - lo.y) * 50 * mw.to_scale()[1], height * 50 + 30],+ "niagara", "NS_Steam" if typ == "steam" else "NS_Steam", fps, round(life * 1.5, 2))+ ext = [(hi.x - lo.x) * mw.to_scale()[0] * 100, (hi.y - lo.y) * mw.to_scale()[1] * 100]+ e["bounds_local"] = {"min": [-ext[0], -ext[1], -20], "max": [ext[0], ext[1], height * 100 + 80]}+ e["emitter_shape"] = {"kind": "disc", "extent_cm": [base_r * 100, base_r * 100, 2]}+ set_params(e, {+ "SpawnRate": rate, "LifetimeMin": life * 0.8, "LifetimeMax": life * 1.1,+ "SizeMin": s0 * 0.8, "SizeMax": s0 * 1.3, "Grow": grow,+ "Velocity": [0, 0, rise * 100], "Wind": ue_dir(Vector((lean.x, lean.y, 0))), "Drag": 1.2, "VelocityJitter": 0.3,+ "BoxExtent": [base_r * 100, base_r * 100, 2], "Color": alb + [1.0], "Opacity": alpha, "Intensity": 0.0,+ "NoiseStrength": 40 + 30 * rise, "NoiseFreq": 0.02,+ })+ e["physical"] = {"density_per_m": sigma, "optical_depth": tau, "albedo": alb,+ "anisotropy": principled_volume(m).inputs["Anisotropy"].default_value, "lifetime_s": [life],+ "drift_cm_s": [x * 100 for x in lean], "noise_scale_cm": None, "height_m": height, "width_m": width,+ "base_radius_m": base_r, "scroll_m_s": scroll}+ e["notes"].append(f"alive ~{alive:.0f} sprites, est. overlap {overlap:.1f}")+ return e+++def particle_entry(sc, o, frame, fps, shutter):+ md = next(md for md in o.modifiers if md.type == "PARTICLE_SYSTEM")+ ps = md.particle_system.settings+ span = max(1, ps.frame_end - ps.frame_start)+ life_s = ps.lifetime / fps+ v = Vector(ps.object_align_factor)+ speed = v.length+ g = ps.effector_weights.gravity+ ev = [f"particles count {ps.count} over {span} frames, life {life_s:.2f}s, velocity {tuple(round(x, 2) for x in v)}, gravity {g}"]+ inst = ps.instance_object+ radius, length = 0.001, 0.02+ if inst:+ dims = sorted(inst.dimensions)+ radius, length = dims[0] / 2, dims[2]+ score = {}+ if speed >= 3 and v.z < 0 and g < 0.5:+ score["rain"] = 4+ if speed < 1 and g >= 0.5:+ score["drips"] = 4+ if speed < 0.2 and g < 0.1:+ score["dust"] = 3+ if v.z > 0.5 and g >= 0.5:+ score["fountain"] = 3 # launched upward, falls back: jets, sprinklers+ if g >= 0.3 and life_s < 1.5 and speed >= 1:+ score["sparks"] = score.get("sparks", 0) + 2 # short-lived ballistic bits (+ emissive instance below)+ for t in name_hint(o.name):+ score[t] = score.get(t, 0) + 2+ if not score:+ return unknown_entry(o, "particles", ev, fps)+ ranked = sorted(score.items(), key=lambda kv: -kv[1])+ typ = ranked[0][0]+ conf = ranked[0][1] / (ranked[0][1] + (ranked[1][1] if len(ranked) > 1 else 0))+ corners = [o.matrix_world @ Vector(c) for c in o.bound_box]+ lo = Vector([min(c[i] for c in corners) for i in range(3)])+ hi = Vector([max(c[i] for c in corners) for i in range(3)])+ ctr = (lo + hi) / 2+ half = [(hi[i] - lo[i]) * 50 for i in range(3)]+ rate = ps.count / span * fps+ # Drop material: emission strength + alpha of the instance (Principled).+ emis, alpha, colr = 0.0, 1.0, [0.8, 0.85, 0.9]+ if inst and inst.material_slots and inst.material_slots[0].material and inst.material_slots[0].material.node_tree:+ b = next((n for n in inst.material_slots[0].material.node_tree.nodes if n.type == "BSDF_PRINCIPLED"), None)+ if b:+ emis = b.inputs["Emission Strength"].default_value+ alpha = b.inputs["Alpha"].default_value+ colr = list(b.inputs["Emission Color"].default_value)[:3] if emis > 0 else list(b.inputs["Base Color"].default_value)[:3]+ width_cm = max(0.15, radius * 2 * 100)+ preroll = max(0.0, -ps.frame_start / fps)+ if typ == "rain":+ # Streak = drop length + distance travelled during the shutter (Cycles renders the drops motion-blurred).+ streak = length + speed * shutter / fps+ fall_h = hi.z - ground_z(sc, ctr, lo.z)+ life = min(life_s, fall_h / max(speed, 0.1) + 0.05)+ e = base_entry(o.name, "rain", conf, "particles", [o.name], inst.name if inst else None, ev, ue_vec(ctr), half, "niagara", "NS_Rain", fps, round(life * 1.5, 2))+ e["bounds_local"] = {"min": [-half[0] - 50, -half[1] - 50, -fall_h * 100 - 50], "max": [half[0] + 50, half[1] + 50, 50]}+ e["emitter_shape"] = {"kind": "box", "extent_cm": half}+ # Same alive density as Blender (count over its own lifetime), but only for the part above the ground.+ set_params(e, {"SpawnRate": rate, "LifetimeMin": life * 0.95, "LifetimeMax": life,+ "Velocity": ue_dir(v), "VelocityJitter": ps.factor_random * 0.2, "BoxExtent": half,+ "SizeMin": width_cm * (1 - ps.size_random), "SizeMax": width_cm, "Aspect": streak * 100 / width_cm,+ "Color": colr + [1.0], "Intensity": LM_PER_W * emis * length / streak, "Opacity": alpha, "Gravity": 0.0, "Drag": 0.0})+ e["physical"] = {"count": ps.count, "lifetime_s": [life_s], "velocity_cm_s": ue_dir(v), "size_cm": [width_cm, streak * 100],+ "emission_nits": LM_PER_W * emis, "fall_m": fall_h}+ e["notes"].append(f"streak {streak * 100:.1f} cm = drop {length * 100:.1f} cm + {speed:.1f} m/s x {shutter / fps * 1000:.0f} ms shutter")+ else:+ gz = ground_z(sc, ctr, lo.z)+ fall_h = max(0.05, lo.z - gz)+ v0 = -v.z+ t_fall = (-v0 + math.sqrt(v0 * v0 + 2 * 9.81 * g * fall_h)) / (9.81 * g) if g > 0 else fall_h / max(v0, 0.1)+ life = min(life_s, t_fall)+ e = base_entry(o.name, typ, conf, "particles", [o.name], inst.name if inst else None, ev, ue_vec(ctr), half, "niagara",+ {"drips": "NS_Drips", "dust": "NS_DustMotes", "sparks": "NS_Sparks", "fountain": "NS_FountainJet"}.get(typ, "NS_Drips"),+ fps, round(life * 2, 2))+ e["bounds_local"] = {"min": [-half[0] - 30, -half[1] - 30, -fall_h * 100 - 30], "max": [half[0] + 30, half[1] + 30, 30]}+ e["emitter_shape"] = {"kind": "line" if min(half[0], half[1]) < 5 else "box", "extent_cm": half}+ streak = length + (v0 + 9.81 * g * life * 0.5) * shutter / fps * 0.5+ set_params(e, {"SpawnRate": rate, "LifetimeMin": life, "LifetimeMax": life, "Velocity": ue_dir(v), "Gravity": g, "Drag": 0.0,+ "VelocityJitter": ps.factor_random * 0.2, "BoxExtent": half, "SizeMin": width_cm * (1 - ps.size_random),+ "SizeMax": width_cm, "Aspect": max(1.0, streak * 100 / width_cm), "Color": colr + [1.0],+ "Intensity": LM_PER_W * emis * length / max(streak, length), "Opacity": alpha})+ e["physical"] = {"count": ps.count, "lifetime_s": [life_s], "gravity": g, "size_cm": [width_cm, length * 100], "fall_m": fall_h,+ "ground_z_m": gz}+ e["notes"].append("Intensity = 683 x drop emission x drop / streak length: Cycles smears the drop's radiance over its motion-blurred"+ " streak; sub-pixel streaks keep their energy through the sprite renderer's pixel coverage")+ return e+++def unknown_entry(o, kind, ev, fps, mat=None):+ """Something animated we could not classify: keep its box and evidence, queue it for the agent (FX_AGENT.md)."""+ corners = [o.matrix_world @ Vector(c) for c in o.bound_box]+ lo = Vector([min(c[i] for c in corners) for i in range(3)])+ hi = Vector([max(c[i] for c in corners) for i in range(3)])+ e = base_entry(o.name, "unknown", 0.0, kind, [o.name], mat, ev, ue_vec((lo + hi) / 2), [(hi[i] - lo[i]) * 50 for i in range(3)],+ "agent", None, fps, 0.0)+ e["notes"].append("unclassified: pick or author a template (fx_recipes), then set technique/template/params")+ return e+++def ground_z(sc, p, below):+ dg = bpy.context.evaluated_depsgraph_get()+ hit, loc, *_ = sc.ray_cast(dg, Vector((p.x, p.y, below - 0.01)), Vector((0, 0, -1)), distance=50.0)+ return loc.z if hit else 0.0+++def classify(sc, frame, emitter_names, volume_objects, templates_json=None):+ """Return the fx list for the scene. `volume_objects`: names of volume-only mesh objects; `emitter_names`: objects+ with particle systems. Entries claiming a volume carry source.objects = [name]."""+ global PARAM_TYPES+ if templates_json and os.path.exists(templates_json):+ PARAM_TYPES = json.load(open(templates_json))+ fps = sc.render.fps / sc.render.fps_base+ shutter = sc.render.motion_blur_shutter if sc.render.use_motion_blur else 0.0+ sc.frame_set(frame)+ out = []+ for name in volume_objects:+ o = sc.objects[name]+ m = volume_material(o)+ if not m:+ continue+ typ, ev, conf = classify_volume(sc, o, m, frame, fps)+ log("volume", name, typ, round(conf, 2), ev)+ if typ == "fire":+ out.append(fire_entry(sc, o, m, frame, fps, ev, conf))+ elif typ in ("steam", "smoke"):+ e = steam_entry(sc, o, m, frame, fps, typ, ev, conf)+ if e:+ out.append(e)+ elif typ is None:+ out.append(unknown_entry(o, "volume_shader", ev, fps, m.name))+ # haze stays on the fog path (height fog / local fog volumes)+ for name in emitter_names:+ o = sc.objects[name]+ e = particle_entry(sc, o, frame, fps, shutter)+ if e:+ out.append(e)+ log("particles", name, e["type"], e["confidence"])+ sc.frame_set(frame)+ return out+++def main():+ argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+ a = lambda k, d=None: argv[argv.index(k) + 1] if k in argv else d # noqa: E731+ scene_in, out = a("--scene"), a("--out")+ frame = int(a("--frame", "60"))+ sc = bpy.context.scene+ vols = [o.name for o in sc.objects if o.type == "MESH" and not o.hide_render and volume_material(o)+ and all((s.material is None) or s.material == volume_material(o) or True for s in o.material_slots)]+ ems = [o.name for o in sc.objects if not o.hide_render and any(md.type == "PARTICLE_SYSTEM" for md in o.modifiers)]+ fx = classify(sc, frame, ems, vols, a("--templates", os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates.json")))+ scene = json.load(open(scene_in, encoding="utf-8")) if scene_in else {}+ scene["fx"] = fx+ claimed = {o for e in fx for o in e["source"]["objects"]}+ for k, v in scene.get("volumes", {}).items():+ if k in claimed:+ v["claimed_by_fx"] = True+ json.dump(scene, open(out, "w", encoding="utf-8"), indent=1)+ log("wrote", out, len(fx), "fx entries", [(e["id"], e["type"]) for e in fx])+++if __name__ == "__main__":+ main()diff --git a/unreal_fx/fx_pack.py b/unreal_fx/fx_pack.pynew file mode 100644index 0000000..74d14d1--- /dev/null+++ b/unreal_fx/fx_pack.py@@ -0,0 +1,588 @@+"""Build the AnySceneFX template pack (/Game/AnySceneFX) from scratch: sprite materials + NS_Fire, NS_Steam, NS_Rain,+NS_Drips, NS_DustMotes, every one exposing the shared User parameters from NIAGARA.md §3, and write templates.json+(the param_types contract build_level.py reads).++Headless, rerunnable (deletes and rebuilds the pack); needs the NiagaraToolsets + ToolsetRegistry plugins enabled:+ UnrealEditor-Cmd <project>.uproject -run=pythonscript -script="<path>/fx_pack.py" -unattended -nosplash -nop4+Env: ANYSCENEFX_ROOT (default /Game/AnySceneFX), ANYSCENEFX_JSON (where templates.json goes, default next to this file),+ ANYSCENEFX_RECIPES (extra recipe folders), ANYSCENEFX_ONLY (comma list of NS_ names to rebuild; others untouched).++Authoring goes through Epic's experimental NiagaraToolsets (unreal.ToolsetRegistry.execute_tool), wrapped in fxlib.py.+Every template starts from the stateful Fountain emitter (SpawnRate, InitializeParticle, ShapeLocation, AddVelocity,+GravityForce, Drag, ScaleColor, Solve) and rewires its inputs to User parameters with links or one-line HLSL.+"""+import json+import os+import re+import sys++sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))+import unreal # noqa: E402++import fxlib as F # noqa: E402++ROOT = os.environ.get("ANYSCENEFX_ROOT", "/Game/AnySceneFX")+OUT_JSON = os.environ.get("ANYSCENEFX_JSON", os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates.json"))+EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+REPORT = {"systems": {}, "materials": [], "errors": []}+++def log(*a):+ unreal.log_warning("FXPACK " + " ".join(str(x) for x in a))+++# ------------------------------------------------------------------ materials++# Shared HLSL helpers for the Custom nodes: value noise + fbm, and a blackbody approximation (Kelvin -> linear RGB).+HELPERS = """struct AFX {+ float h(float2 p) { return frac(sin(dot(p, float2(127.1, 311.7))) * 43758.5453); }+ float n(float2 p) { float2 i = floor(p); float2 f = frac(p); f = f * f * (3.0 - 2.0 * f);+ return lerp(lerp(h(i), h(i + float2(1, 0)), f.x), lerp(h(i + float2(0, 1)), h(i + float2(1, 1)), f.x), f.y); }+ float fbm(float2 p) { return 0.5 * n(p) + 0.25 * n(p * 2.03 + 1.7) + 0.125 * n(p * 4.01 + 3.1); }+ float3 bb(float k) { float t = clamp(k, 1000.0, 12000.0) / 100.0;+ float r = t <= 66.0 ? 1.0 : saturate(1.292936 * pow(t - 60.0, -0.1332047));+ float g = t <= 66.0 ? saturate(0.3900816 * log(t) - 0.6318414) : saturate(1.129891 * pow(t - 60.0, -0.0755148));+ float b = t >= 66.0 ? 1.0 : (t <= 19.0 ? 0.0 : saturate(0.5432068 * log(t - 10.0) - 1.1962541));+ float3 c = float3(r, g, b); return c * c; }+};+AFX X;+"""++# Per material: custom HLSL for (rgb, opacity). Inputs: UV, PC (particle colour rgb), PA (particle alpha), R (particle+# random), T (time), DP (dynamic parameter: x = Intensity, y = Temperature K).+MATS = {+ # Additive flame tongue on a tall sprite (UV.y 0 = top). Colour hotter at the base; Temperature > 0 swaps in blackbody.+ "M_AFX_Flame": dict(blend="ADDITIVE", lit=False, rgb="""+float y = 1.0 - UV.y;+float t = T * 1.6 + R * 17.0;+float d = X.fbm(float2(UV.x * 3.0 + R * 5.0, y * 2.0 - t * 2.2)) - 0.5;+float x = (UV.x - 0.5 + d * 0.25 * y) * 2.0;+float w = lerp(0.85, 0.3, saturate(y));+float across = exp(-3.0 * (x / w) * (x / w));+float along = smoothstep(0.0, 0.15, y) * smoothstep(1.0, 0.45 + d * 0.4, y);+float body = across * along;+float3 col = DP.y > 0 ? X.bb(DP.y * lerp(1.15, 0.8, y)) : PC * lerp(float3(1.25, 1.15, 0.95), float3(0.95, 0.75, 0.65), y);+return col * body * PA * DP.x;""", op="return 1;"),+ # Soft, noisy steam puff. Lit translucent (volumetric non-directional), before DOF, depth-faded.+ "M_AFX_Steam": dict(blend="TRANSLUCENT", lit=True, depth_fade=12.0, rgb="return PC * DP.x;", base="return PC;", op="""+float2 c = UV - 0.5;+float r = length(c) * 2.0;+float a = saturate(1.0 - r); a = a * a * (3.0 - 2.0 * a);+float n = X.fbm(UV * 2.6 + float2(R * 7.1, R * 3.3 + T * 0.12));+return PA * a * saturate(n * 1.8 - 0.3);"""),+ # Velocity-aligned streak (UV.x across, UV.y along), lit with a little emissive so it reads against the dark.+ "M_AFX_Streak": dict(blend="TRANSLUCENT", lit=True, rgb="""+float x = abs(UV.x - 0.5) * 2.0;+float a = saturate(1.0 - x);+return PC * DP.x * a * a;""", base="return PC;", op="""+float x = abs(UV.x - 0.5) * 2.0;+float a = saturate(1.0 - x); a *= a;+return PA * a * saturate(UV.y * 5.0) * saturate((1.0 - UV.y) * 5.0);"""),+ # Round mote.+ "M_AFX_Mote": dict(blend="TRANSLUCENT", lit=True, rgb="return PC * DP.x;", base="return PC;", op="""+float r = length(UV - 0.5) * 2.0;+float a = saturate(1.0 - r);+return PA * a * a;"""),+}+++def make_material(name, spec):+ folder = f"{ROOT}/Materials"+ path = f"{folder}/{name}"+ if EAL.does_asset_exist(path):+ # The templates reference their materials and deleting a referenced asset can crash the editor: rebuild the+ # graph in place.+ m = EAL.load_asset(path)+ MEL.delete_all_material_expressions(m)+ else:+ m = AT.create_asset(name, folder, unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", getattr(unreal.BlendMode, "BLEND_" + spec["blend"]))+ m.set_editor_property("two_sided", True)+ if spec["lit"]:+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_DEFAULT_LIT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_VOLUMETRIC_NON_DIRECTIONAL)+ else:+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # Foreground plumes in defocused areas (cam_wok) must blur with DOF.+ m.set_editor_property("translucency_pass", unreal.MaterialTranslucencyPass.MTP_BEFORE_DOF)+ MEL.set_material_usage(m, unreal.MaterialUsage.MATUSAGE_NIAGARA_SPRITES)+ y = 0+ def node(cls, x=-900):+ nonlocal y+ y += 160+ return MEL.create_material_expression(m, cls, x, y)+ uv = node(unreal.MaterialExpressionTextureCoordinate)+ pc = node(unreal.MaterialExpressionParticleColor)+ pr = node(unreal.MaterialExpressionParticleRandom)+ tm = node(unreal.MaterialExpressionTime)+ dp = node(unreal.MaterialExpressionDynamicParameter)+ # DynamicParameter defaults (used if the emitter does not write Particles.DynamicMaterialParameter): 1 nit, no blackbody.+ dp.set_editor_property("default_value", unreal.LinearColor(1.0, 0.0, 0.0, 0.0))+ dpm = node(unreal.MaterialExpressionComponentMask)+ dpm.set_editor_property("r", True)+ dpm.set_editor_property("g", True)+ MEL.connect_material_expressions(dp, "RGBA", dpm, "")++ def custom(code, out_type):+ c = node(unreal.MaterialExpressionCustom, -400)+ c.set_editor_property("code", HELPERS + code.strip())+ c.set_editor_property("output_type", out_type)+ ins = []+ for nm in ("UV", "PC", "PA", "R", "T", "DP"):+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", nm)+ ins.append(ci)+ c.set_editor_property("inputs", ins)+ MEL.connect_material_expressions(uv, "", c, "UV")+ MEL.connect_material_expressions(pc, "", c, "PC")+ MEL.connect_material_expressions(pc, "A", c, "PA")+ MEL.connect_material_expressions(pr, "", c, "R")+ MEL.connect_material_expressions(tm, "", c, "T")+ MEL.connect_material_expressions(dpm, "", c, "DP")+ return c++ MEL.connect_material_property(custom(spec["rgb"], unreal.CustomMaterialOutputType.CMOT_FLOAT3), "",+ unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ if spec.get("base"):+ MEL.connect_material_property(custom(spec["base"], unreal.CustomMaterialOutputType.CMOT_FLOAT3), "",+ unreal.MaterialProperty.MP_BASE_COLOR)+ if spec["blend"] != "ADDITIVE":+ op = custom(spec["op"], unreal.CustomMaterialOutputType.CMOT_FLOAT1)+ if spec.get("depth_fade"):+ df = node(unreal.MaterialExpressionDepthFade, -150)+ df.set_editor_property("fade_distance_default", spec["depth_fade"])+ MEL.connect_material_expressions(op, "", df, "Opacity")+ op = df+ MEL.connect_material_property(op, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ REPORT["materials"].append(path)+ return f"{path}.{name}"+++# ------------------------------------------------------------------ niagara helpers++NT = { # Niagara type structs for user variables / linked inputs+ "float": "/Script/Niagara.NiagaraFloat", "int": "/Script/Niagara.NiagaraInt32", "bool": "/Script/Niagara.NiagaraBool",+ "vec3": "/Script/CoreUObject.Vector3f", "vec2": "/Script/CoreUObject.Vector2f", "color": "/Script/CoreUObject.LinearColor",+ "pos": "/Script/Niagara.NiagaraPosition", "vec4": "/Script/CoreUObject.Vector4f",+}+ENUMS = {}+++def enum_value(enum_path, want):+ """Enum inputs come back as NewEnumeratorN: resolve a display name (case-insensitive substring) to its entry."""+ if enum_path not in ENUMS:+ info = F.call("UEnum_Info", {"enum": F.ref(enum_path)}, toolset="NiagaraToolsets.NiagaraToolset_Info")+ ENUMS[enum_path] = info+ info = ENUMS[enum_path]+ s = info if isinstance(info, str) else json.dumps(info)+ try:+ d = json.loads(s)+ while isinstance(d, str):+ d = json.loads(d)+ except Exception:+ d = None+ pairs = []+ if isinstance(d, dict):+ vals = d.get("returnValue", d)+ if isinstance(vals, str):+ try:+ vals = json.loads(vals)+ except Exception:+ pass+ if isinstance(vals, dict):+ vals = vals.get("Values", vals.get("values", []))+ for v in vals if isinstance(vals, list) else []:+ if isinstance(v, dict):+ pairs.append((v.get("Name") or v.get("name"), v.get("DisplayName") or v.get("displayName") or ""))+ if not pairs:+ pairs = re.findall(r'"(?:name|enumName)"\s*:\s*"([^"]+)"[^}]*?"display(?:Name)?"\s*:\s*"([^"]*)"', s)+ for nm, disp in pairs:+ if want.lower() == (disp or "").lower():+ return nm, disp+ for nm, disp in pairs:+ if want.lower() in (disp or "").lower() or want.lower() in nm.lower():+ return nm, disp+ raise RuntimeError(f"enum {enum_path}: no value like {want!r} in {pairs} raw={s[:1500]}")+++def v_float(x):+ return {"struct": F.ref("/Script/Niagara.NiagaraFloat"), "value": {"value": float(x)}}+++def v_bool(b):+ return {"struct": F.ref("/Script/Niagara.NiagaraBool"), "value": {"value": -1 if b else 0}}+++def v_int(i):+ return {"struct": F.ref("/Script/Niagara.NiagaraInt32"), "value": {"value": int(i)}}+++def v_link(name, typ):+ return {"struct": F.ref("/Script/NiagaraEditor.NiagaraExt_StackInputData_Linked"),+ "value": {"linkedVariable": {"name": name, "type": {"classStructOrEnum": F.ref(NT[typ])}}}}+++def v_hlsl(expr):+ return {"struct": F.ref("/Script/NiagaraEditor.NiagaraExt_StackInputData_HlslExpression"), "value": {"hlslExpression": expr}}+++class Sys:+ def __init__(self, name, params):+ self.name = name+ self.final = f"{ROOT}/Systems/{name}"+ self.path = f"{self.final}.{name}"+ self.params = params+ self.topo = {}+ self.issues = []+ if EAL.does_asset_exist(self.final):+ # Placed levels reference the templates and deleting (or consolidating) a referenced system crashes the+ # editor or leaves redirectors: rebuild in place instead. Strip every emitter and user variable, keep the asset.+ summ = F.call("GetSystemSummary", {"system": F.ref(self.path)})+ summ = summ.get("returnValue", summ)+ for e in summ.get("emitters", []):+ F.call("RemoveEmitter", {"emitterToRemove": F.item(self.path, e["emitterName"])}, check=False)+ old_uv = [{"name": u["name"], "type": u["type"]} for u in summ.get("userVariables", [])]+ if old_uv:+ F.call("RemoveUserVariables", {"system": F.ref(self.path), "variablesToRemove": old_uv}, check=False)+ log("system", name, "rebuilt in place: removed", len(summ.get("emitters", [])), "emitters,", len(old_uv), "user vars")+ else:+ F.call("CreateNiagaraSystem", {"assetName": name, "assetPath": f"{ROOT}/Systems",+ "templateSystem": F.ref("/Niagara/DefaultAssets/DefaultSystem.DefaultSystem")})+ # DefaultSystem ships with a stock "Fountain" emitter: drop it, templates add their own named emitters.+ F.call("RemoveEmitter", {"emitterToRemove": F.item(self.path, "Fountain")}, check=False)+ uv = []+ for k, (t, dv, desc) in params.items():+ if t == "float":+ val = v_float(dv)+ elif t == "int":+ val = v_int(dv)+ elif t == "bool":+ val = v_bool(dv)+ elif t == "color":+ val = {"struct": F.ref("/Script/CoreUObject.LinearColor"), "value": dict(zip("rgba", list(dv) + [1.0] * (4 - len(dv))))}+ else: # vec3 / pos+ val = {"struct": F.ref(NT[t] if t == "pos" else "/Script/CoreUObject.Vector3f"), "value": dict(zip("xyz", dv))}+ uv.append({"name": k, "type": {"classStructOrEnum": F.ref(NT[t])}, "defaultValue": val, "description": desc})+ try:+ F.call("AddUserVariables", {"system": F.ref(self.path), "variablesToAdd": uv})+ except RuntimeError:+ # Some builds only accept the double-precision Vector struct as a default value: retry vec3 defaults that way.+ for u in uv:+ if u["defaultValue"]["struct"]["refPath"] == "/Script/CoreUObject.Vector3f":+ u["defaultValue"]["struct"] = F.ref("/Script/CoreUObject.Vector")+ F.call("AddUserVariables", {"system": F.ref(self.path), "variablesToAdd": uv})++ def system_data(self, **kw):+ F.call("SetSystemData", {"system": F.ref(self.path), "systemData": {"propertyValues": json.dumps(kw)}})++ def emitter(self, template, want):+ t = F.call("AddEmitter", {"system": F.ref(self.path), "emitterName": want,+ "templateEmitter": F.ref(f"/Niagara/DefaultAssets/Templates/Emitters/{template}.{template}")})+ t = t.get("returnValue", t) if isinstance(t, dict) else t+ name = t["emitterName"] if isinstance(t, dict) and "emitterName" in t else want+ self.topo[name] = t+ return name++ def emitter_data(self, em, **kw):+ F.call("SetEmitterData", {"emitter": F.item(self.path, em), "emitterData": {"propertyValues": json.dumps(kw)}})++ def inputs_of(self, em, script, module):+ t = F.call("GetModuleTopology", {"moduleRef": F.item(self.path, em, script, module)})+ t = t.get("returnValue", t)+ return {i["name"]: i for i in t.get("inputs", [])}++ def set(self, em, script, module, inp, val):+ """val: number | bool | ('link', 'User.X', type) | ('hlsl', expr) | ('enum', display) | raw instanced dict."""+ if isinstance(val, tuple) and val[0] == "enum":+ ins = self.inputs_of(em, script, module)+ if inp not in ins:+ raise RuntimeError(f"{self.name}/{em}/{module}: no input {inp!r}; have {sorted(ins)}")+ ep = ins[inp]["type"]["classStructOrEnum"]["refPath"]+ nm, disp = enum_value(ep, val[1])+ val = {"struct": F.ref("/Script/NiagaraEditor.NiagaraExt_StackInputData_Enum"),+ "value": {"enum": F.ref(ep), "enumName": nm, "displayName": disp}}+ elif isinstance(val, tuple) and val[0] == "link":+ val = v_link(val[1], val[2])+ elif isinstance(val, tuple) and val[0] == "hlsl":+ val = v_hlsl(val[1])+ elif isinstance(val, bool):+ val = v_bool(val)+ elif isinstance(val, (int, float)):+ val = v_float(val)+ try:+ F.call("SetStackInputData", {"stackInputRef": F.item(self.path, em, script, module, inputs=[inp]), "inputData": val})+ except RuntimeError as e:+ self.issues.append(f"set {em}/{module}/{inp}: {str(e)[:400]}")+ log("ERR", self.name, em, module, inp, str(e)[:400])++ def add_module(self, em, script, asset, before=""):+ t = F.call("AddModule", {"moduleLocationRef": F.item(self.path, em, script, before), "moduleAsset": F.ref(asset)})+ t = t.get("returnValue", t)+ return t["moduleName"], {i["name"]: i for i in t.get("inputs", [])}++ def set_params(self, em, script, entries, before=""):+ """entries: [(Particles.Name, type, hlsl)] -> one SetParameters module.+ AddSetParametersModule accepts an HLSL default without error but stores a garbage literal (seen: a Vector4f+ x = -4.2e36, which blacked out every emissive sprite). So always add with a typed placeholder, rewire each+ entry to its HLSL with SetStackInputData, and read the values back."""+ typed = {"float": v_float(0.0), "int": v_int(0), "bool": v_bool(False),+ "vec3": {"struct": F.ref("/Script/CoreUObject.Vector3f"), "value": {"x": 0, "y": 0, "z": 0}},+ "vec4": {"struct": F.ref("/Script/CoreUObject.Vector4f"), "value": {"x": 0, "y": 0, "z": 0, "w": 0}},+ "color": {"struct": F.ref("/Script/CoreUObject.LinearColor"), "value": {"r": 1, "g": 1, "b": 1, "a": 1}}}+ ps = [{"variable": {"name": n, "type": {"classStructOrEnum": F.ref(NT[t])}}, "defaultValue": typed[t]} for n, t, e in entries]+ try:+ t = F.call("AddSetParametersModule", {"moduleLocationRef": F.item(self.path, em, script, before), "parameters": ps})+ t = t.get("returnValue", t)+ mn = t["moduleName"]+ names = [i["name"] for i in t.get("inputs", [])]+ for n, ty, e in entries:+ k = next((x for x in names if x == n or x.endswith(n.split(".")[-1])), n)+ self.set(em, script, mn, k, ("hlsl", e))+ got = F.call("GetModuleInputValues", {"moduleRef": F.item(self.path, em, script, mn)}, check=False)+ got = got.get("returnValue", got) if isinstance(got, dict) else {}+ vals = {i["name"]: i.get("value", {}) for i in (got.get("inputs", []) if isinstance(got, dict) else [])}+ for n, ty, e in entries:+ v = next((v for k, v in vals.items() if k == n or k.endswith(n.split(".")[-1])), None)+ if v is None or "Hlsl" not in json.dumps(v.get("struct", {})):+ self.issues.append(f"setparams {em}/{n}: HLSL did not stick, read back {json.dumps(v)[:200]}")+ log("ERR", self.name, em, "setparams readback", n, json.dumps(v)[:200])+ except RuntimeError as e:+ self.issues.append(f"setparams {em}: {str(e)[:400]}")+ log("ERR", self.name, em, "setparams", str(e)[:400])++ def renderer(self, em, idx, **kw):+ try:+ F.call("SetRendererData", {"renderer": F.item(self.path, em, renderer=idx), "rendererData": {"propertyValues": json.dumps(kw)}})+ except RuntimeError as e:+ self.issues.append(f"renderer {em}/{idx}: {str(e)[:400]}")+ log("ERR", self.name, em, "renderer", str(e)[:400])++ def finish(self):+ sysobj = unreal.load_asset(self.path)+ if sysobj is not None:+ # Force a synchronous compile so the saved asset carries compiled scripts (render runs only load it).+ try:+ sysobj.request_compile(True)+ except Exception:+ pass+ try:+ unreal.NiagaraEditorFunctionLibrary # noqa: B018+ except Exception:+ pass+ EAL.save_loaded_asset(sysobj, False)+ st = F.call("GetSystemCompileState", {"system": F.ref(self.path)}, check=False)+ # GetStackIssues builds Slate curve widgets and asserts without a Slate app: only in a full editor session.+ si = F.call("GetStackIssues", {"system": F.ref(self.path)}, check=False) if os.environ.get("ANYSCENEFX_STACK_ISSUES") else None+ REPORT["systems"][self.name] = {"path": self.path, "issues": self.issues, "compile": st, "stack_issues": si,+ "params": {k: v[0] for k, v in self.params.items()}}+ log("system", self.name, "issues", len(self.issues))+++# ------------------------------------------------------------------ the shared parameter contract++def common(spawn, life, size, vel, color, intensity, opacity, box, wind=(0, 0, 0), gravity=0.0, drag=0.0, jitter=0.1,+ noise=0.0, noise_freq=0.01, grow=0.0, aspect=1.0, temperature=0.0):+ return {+ "SpawnRate": ("float", spawn, "particles per second"),+ "LifetimeMin": ("float", life[0], "s"), "LifetimeMax": ("float", life[1], "s"),+ "SizeMin": ("float", size[0], "sprite width, cm"), "SizeMax": ("float", size[1], "sprite width, cm"),+ "Aspect": ("float", aspect, "sprite length / width (streaks, flame tongues)"),+ "Velocity": ("vec3", vel, "initial (and terminal, with Drag) velocity, cm/s, world"),+ "VelocityJitter": ("float", jitter, "0..1 cone spread (Blender factor_random)"),+ "Wind": ("vec3", wind, "constant drift, cm/s"),+ "Gravity": ("float", gravity, "0..1 x 980 cm/s2"),+ "Drag": ("float", drag, "linear drag 1/s; with drag the particle settles at Velocity + Wind"),+ "BoxExtent": ("vec3", box, "spawn box half extent, cm, local"),+ "Color": ("color", color, "albedo (lit) or emissive tint (unlit)"),+ "Intensity": ("float", intensity, "emissive luminance multiplier, nits"),+ "Opacity": ("float", opacity, "per-sprite peak alpha"),+ "Temperature": ("float", temperature, "K; > 0 replaces Color with blackbody (fire)"),+ "NoiseStrength": ("float", noise, "curl-noise force, cm/s2"),+ "NoiseFreq": ("float", noise_freq, "curl-noise frequency, 1/cm"),+ "Grow": ("float", grow, "sprite size growth over life (size x (1 + Grow x age))"),+ }+++FADE = "saturate(Particles.NormalizedAge * {a}) * saturate((1.0 - Particles.NormalizedAge) * {b})"+++def fountain_core(s, em, *, gpu, material, fade=(6.0, 2.5), aligned=False, sort=False, curl=True, grow=True, nonuniform=False,+ pivot=(0.5, 0.5)):+ """Rewire a Fountain emitter to the shared User parameters."""+ s.emitter_data(em, SimTarget="GPUComputeSim" if gpu else "CPUSim", bDeterminism=True, RandomSeed=abs(hash(s.name + em)) % 100000,+ CalculateBoundsMode="Fixed", FixedBounds={"min": {"x": -500, "y": -500, "z": -500}, "max": {"x": 500, "y": 500, "z": 500}, "isValid": True},+ bLocalSpace=False)+ EU, PS, PU = "EmitterUpdateScript", "ParticleSpawnScript", "ParticleUpdateScript"+ s.set(em, EU, "SpawnRate", "SpawnRate", ("link", "User.SpawnRate", "float"))+ s.set(em, PS, "InitializeParticle", "Lifetime Min", ("link", "User.LifetimeMin", "float"))+ s.set(em, PS, "InitializeParticle", "Lifetime Max", ("link", "User.LifetimeMax", "float"))+ s.set(em, PS, "InitializeParticle", "Color", ("hlsl", "float4(User.Color.r, User.Color.g, User.Color.b, User.Opacity)"))+ if nonuniform:+ s.set(em, PS, "InitializeParticle", "Sprite Size Mode", ("enum", "Random Non-Uniform"))+ s.set(em, PS, "InitializeParticle", "Sprite Size Min", ("hlsl", "float2(User.SizeMin, User.SizeMin * User.Aspect)"))+ s.set(em, PS, "InitializeParticle", "Sprite Size Max", ("hlsl", "float2(User.SizeMax, User.SizeMax * User.Aspect)"))+ if not aligned:+ # Elongated sprites (tongues, streaks) have an up: the Fountain's random sprite rotation would point them anywhere.+ s.set(em, PS, "InitializeParticle", "Sprite Rotation Mode", ("enum", "Unset"))+ else:+ s.set(em, PS, "InitializeParticle", "Uniform Sprite Size Min", ("link", "User.SizeMin", "float"))+ s.set(em, PS, "InitializeParticle", "Uniform Sprite Size Max", ("link", "User.SizeMax", "float"))+ if aligned:+ s.set(em, PS, "InitializeParticle", "Sprite Rotation Mode", ("enum", "Unset"))+ s.set(em, PS, "ShapeLocation", "Shape Primitive", ("enum", "Box"))+ s.set(em, PS, "ShapeLocation", "Box Size", ("hlsl", "User.BoxExtent * 2.0"))+ s.set(em, PS, "AddVelocity", "Velocity Speed", ("hlsl", "length(User.Velocity)"))+ s.set(em, PS, "AddVelocity", "Cone Axis", ("hlsl", "normalize(User.Velocity + float3(0.0, 0.0, 0.0001))"))+ s.set(em, PS, "AddVelocity", "Cone Angle", ("hlsl", "User.VelocityJitter * 90.0"))+ s.set(em, PS, "AddVelocity", "Rotation Coordinate Space", ("enum", "World"))+ # Intensity + temperature reach the material through the dynamic parameter.+ s.set_params(em, PS, [("Particles.DynamicMaterialParameter", "vec4", "float4(User.Intensity, User.Temperature, 0.0, 0.0)")])+ # Forces: with linear drag k, the force (V + W) k - g makes the particle settle at Velocity + Wind.+ s.set(em, PU, "GravityForce", "Gravity", ("hlsl", "(User.Velocity + User.Wind) * User.Drag + float3(0.0, 0.0, -980.0 * User.Gravity)"))+ s.set(em, PU, "Drag", "Drag", ("link", "User.Drag", "float"))+ s.set(em, PU, "ScaleColor", "Scale Alpha", ("hlsl", FADE.format(a=fade[0], b=fade[1])))+ if curl:+ mn, ins = s.add_module(em, PU, "/Niagara/Modules/Update/Forces/V2/CurlNoiseForce.CurlNoiseForce", before="SolveForcesAndVelocity")+ for k in ins:+ kl = k.lower()+ if "strength" in kl:+ s.set(em, PU, mn, k, ("link", "User.NoiseStrength", "float"))+ elif "frequency" in kl:+ s.set(em, PU, mn, k, ("link", "User.NoiseFreq", "float"))+ REPORT.setdefault("curl_inputs", sorted(ins))+ if grow:+ mn, ins = s.add_module(em, PU, "/Niagara/Modules/Update/Size/ScaleSpriteSize.ScaleSpriteSize")+ s.set(em, PU, mn, "Scale Sprite Size Mode", ("enum", "Non-Uniform"))+ ins = s.inputs_of(em, PU, mn)+ k = next((k for k, i in ins.items() if "Vector2f" in i["type"]["classStructOrEnum"]["refPath"] and i.get("bIsVisible")), None)+ REPORT.setdefault("scalesize_inputs", {k: [i["type"]["classStructOrEnum"]["refPath"].split(".")[-1], i.get("bIsVisible")] for k, i in ins.items()})+ if k:+ s.set(em, PU, mn, k, ("hlsl", "float2(1.0, 1.0) * (1.0 + User.Grow * Particles.NormalizedAge)"))+ else:+ s.issues.append(f"ScaleSpriteSize: no Vector2f scale input in {sorted(ins)}")+ s.renderer(em, 0, Material=F.ref(material), Alignment="VelocityAligned" if aligned else "Unaligned",+ FacingMode="FaceCameraPosition" if aligned else "FaceCamera", SortMode="ViewDepth" if sort else "None",+ PixelCoverageMode="Enabled", bCastShadows=False, MotionVectorSetting="Disable" if not aligned else "AutoDetect",+ PivotInUVSpace={"x": pivot[0], "y": pivot[1]})+++def to_val(v):+ """Recipe JSON value -> Sys.set value: number | bool | {"link","type"} | {"hlsl"} | {"enum"}."""+ if isinstance(v, dict):+ if "link" in v:+ return ("link", v["link"], v.get("type", "float"))+ if "hlsl" in v:+ return ("hlsl", v["hlsl"])+ if "enum" in v:+ return ("enum", v["enum"])+ return v+++def load_recipes():+ """Built-in recipes (fx_recipes/*.json next to this file) + any in ANYSCENEFX_RECIPES (a folder, os.pathsep-separated).+ A later recipe with the same name replaces an earlier one, so an agent can override a built-in."""+ dirs = [os.path.join(os.path.dirname(os.path.abspath(__file__)), "fx_recipes")]+ dirs += [d for d in os.environ.get("ANYSCENEFX_RECIPES", "").split(os.pathsep) if d]+ out = {}+ for d in dirs:+ for f in sorted(os.listdir(d)) if os.path.isdir(d) else []:+ if f.endswith(".json"):+ r = json.load(open(os.path.join(d, f)))+ out[r["name"]] = r+ return out+++def build_recipe(r, mats):+ PU = "ParticleUpdateScript"+ c = r.get("common", {})+ params = common(spawn=c.get("spawn", 50), life=c.get("life", (1, 2)), size=c.get("size", (5, 10)), vel=c.get("vel", (0, 0, 0)),+ color=c.get("color", (1, 1, 1)), intensity=c.get("intensity", 0.0), opacity=c.get("opacity", 1.0),+ box=c.get("box", (10, 10, 10)), wind=c.get("wind", (0, 0, 0)), gravity=c.get("gravity", 0.0), drag=c.get("drag", 0.0),+ jitter=c.get("jitter", 0.1), noise=c.get("noise", 0.0), noise_freq=c.get("noise_freq", 0.01), grow=c.get("grow", 0.0),+ aspect=c.get("aspect", 1.0), temperature=c.get("temperature", 0.0))+ for k, (t, dv, desc) in r.get("extra", {}).items():+ params[k] = (t, tuple(dv) if isinstance(dv, list) else dv, desc)+ s = Sys(r["name"], params)+ sy = r.get("system", {})+ lo, hi = sy.get("bounds", [[-200, -200, -200], [200, 200, 200]])+ s.system_data(bDeterminism=True, RandomSeed=int(sy.get("seed", 1)), bFixedBounds=True,+ FixedBounds={"min": dict(zip("xyz", lo)), "max": dict(zip("xyz", hi)), "isValid": True})+ for e in r["emitters"]:+ em = s.emitter(e.get("template", "Fountain"), e["name"])+ if e.get("core") is not None:+ k = dict(e["core"])+ k["material"] = mats[k["material"]]+ k["fade"] = tuple(k.get("fade", (6.0, 2.5)))+ fountain_core(s, em, **k)+ if e.get("emitter_data"):+ s.emitter_data(em, **e["emitter_data"])+ for script, module, inp, val in e.get("inputs", []):+ s.set(em, script, module, inp, to_val(val))+ for m in e.get("add_modules", []):+ mn, ins = s.add_module(em, m.get("script", PU), m["asset"], before=m.get("before", ""))+ for inp, val in m.get("inputs", {}).items():+ s.set(em, m.get("script", PU), mn, inp, to_val(val))+ # One SetParameters module per (script, position): several modules in a row crashed the toolset headless.+ groups = {}+ for sp in e.get("set_params", []):+ groups.setdefault((sp[0], sp[4] if len(sp) > 4 else ""), []).append(tuple(sp[1:4]))+ for (script, before), entries in groups.items():+ s.set_params(em, script, entries, before=before)+ for idx in sorted(e.get("remove_renderers", []), reverse=True):+ try:+ F.call("RemoveRenderer", {"rendererToRemove": F.item(s.path, em, renderer=idx)})+ except RuntimeError as x:+ s.issues.append(f"remove renderer {em}/{idx}: {x}")+ for rd in e.get("add_renderers", []):+ res = F.call("AddRenderer", {"newRendererLocation": F.item(s.path, em), "rendererClass": F.ref("/Script/Niagara." + rd["class"])})+ res = res.get("returnValue", res) if isinstance(res, dict) else res+ s.renderer(em, int(res.get("index", 0)) if isinstance(res, dict) else 0, **rd.get("data", {}))+ for idx, data in e.get("renderer_data", {}).items():+ if "Material" in data and data["Material"] in mats:+ data = dict(data, Material=F.ref(mats[data["Material"]]))+ s.renderer(em, int(idx), **data)+ s.finish()+ REPORT["systems"][r["name"]].update({"fx_types": r.get("fx_types", []), "description": r.get("description", "")})+++def build():+ for p in (f"{ROOT}/Systems", f"{ROOT}/Materials"):+ if not EAL.does_directory_exist(p):+ EAL.make_directory(p)+ recipes = load_recipes()+ only = set(x for x in os.environ.get("ANYSCENEFX_ONLY", "").split(",") if x)+ allm = dict(MATS)+ for r in recipes.values():+ allm.update(r.get("materials", {}))+ # Materials: all of them on a full build; on an ANYSCENEFX_ONLY build just the ones those recipes ship.+ want_m = set(allm) if not only else {m for n in only for m in recipes[n].get("materials", {})}+ mats = {k: f"{ROOT}/Materials/{k}.{k}" for k in allm}+ for k in sorted(want_m):+ mats[k] = make_material(k, allm[k])+ log("materials", sorted(want_m))+ for name, r in recipes.items():+ if only and name not in only:+ continue+ build_recipe(r, mats)+ # templates.json is the converter's contract: merge, so a partial (ANYSCENEFX_ONLY) build keeps the others.+ out = json.load(open(OUT_JSON)) if os.path.exists(OUT_JSON) and only else {}+ for k, v in REPORT["systems"].items():+ out[k] = {"path": v["path"], "params": v["params"], "fx_types": v.get("fx_types", []), "description": v.get("description", "")}+ json.dump(out, open(OUT_JSON, "w"), indent=1)+ REPORT["toolset_log"] = F.LOG+ json.dump(REPORT, open(OUT_JSON.replace(".json", "_report.json"), "w"), indent=1, default=str)+ log("done", OUT_JSON, sum(len(v["issues"]) for v in REPORT["systems"].values()), "issues")+++try:+ build()+except Exception as e: # keep the partial report+ import traceback+ REPORT["errors"].append(traceback.format_exc())+ REPORT["toolset_log"] = F.LOG+ json.dump(REPORT, open(OUT_JSON.replace(".json", "_report.json"), "w"), indent=1, default=str)+ log("FAILED", e)diff --git a/unreal_fx/fx_recipes/NS_Drips.json b/unreal_fx/fx_recipes/NS_Drips.jsonnew file mode 100644index 0000000..372a307--- /dev/null+++ b/unreal_fx/fx_recipes/NS_Drips.json@@ -0,0 +1,10 @@+{+ "name": "NS_Drips",+ "description": "Drops falling off an edge or line (awnings, pipes, leaves) under gravity; lifetime = fall time to the ground below.",+ "fx_types": ["drips"],+ "common": {"spawn": 6, "life": [0.6, 0.7], "size": [0.35, 0.5], "vel": [0, 0, -20], "color": [0.8, 0.85, 0.9], "intensity": 60, "opacity": 0.6,+ "box": [2, 300, 1], "gravity": 1.0, "jitter": 0.05, "aspect": 3.0},+ "system": {"seed": 4404, "bounds": [[-50, -400, -300], [50, 400, 20]]},+ "emitters": [{"name": "Drops", "template": "Fountain",+ "core": {"gpu": true, "material": "M_AFX_Streak", "fade": [40.0, 40.0], "aligned": true, "curl": false, "grow": false, "nonuniform": true}}]+}diff --git a/unreal_fx/fx_recipes/NS_DustMotes.json b/unreal_fx/fx_recipes/NS_DustMotes.jsonnew file mode 100644index 0000000..25f0a2b--- /dev/null+++ b/unreal_fx/fx_recipes/NS_DustMotes.json@@ -0,0 +1,9 @@+{+ "name": "NS_DustMotes",+ "description": "Floating dust / pollen / ash motes in a box with curl-noise drift; only reads inside light shafts.",+ "fx_types": ["dust"],+ "common": {"spawn": 150, "life": [8.0, 12.0], "size": [0.08, 0.2], "vel": [0, 0, 0], "color": [0.9, 0.85, 0.75], "intensity": 0.0, "opacity": 0.8,+ "box": [200, 200, 150], "drag": 2.0, "jitter": 1.0, "noise": 20, "noise_freq": 0.01},+ "system": {"seed": 5505, "bounds": [[-300, -300, -250], [300, 300, 250]]},+ "emitters": [{"name": "Motes", "template": "Fountain", "core": {"gpu": true, "material": "M_AFX_Mote", "fade": [4.0, 4.0], "grow": false}}]+}diff --git a/unreal_fx/fx_recipes/NS_Fire.json b/unreal_fx/fx_recipes/NS_Fire.jsonnew file mode 100644index 0000000..0b3f18f--- /dev/null+++ b/unreal_fx/fx_recipes/NS_Fire.json@@ -0,0 +1,310 @@+{+ "name": "NS_Fire",+ "description": "Flame tongues on a ring (gas burner, wok, brazier; candle at small sizes): CPU additive sprites + blue core + one capped flickering Niagara light (off by default when the scene has a practical).",+ "fx_types": [+ "fire"+ ],+ "common": {+ "spawn": 60,+ "life": [+ 0.25,+ 0.45+ ],+ "size": [+ 4,+ 7+ ],+ "vel": [+ 0,+ 0,+ 70+ ],+ "color": [+ 1.0,+ 0.45,+ 0.1+ ],+ "intensity": 4000,+ "opacity": 1.0,+ "box": [+ 14,+ 14,+ 2+ ],+ "drag": 3.0,+ "jitter": 0.15,+ "noise": 400,+ "noise_freq": 0.05,+ "grow": -0.5,+ "aspect": 2.6+ },+ "extra": {+ "CoreIntensity": [+ "float",+ 0.35,+ "blue core luminance as a fraction of Intensity"+ ],+ "RingRadius": [+ "float",+ 16.0,+ "burner ring radius, cm (flames spawn on the ring)"+ ],+ "LightIntensity": [+ "float",+ 0.0,+ "Niagara point light brightness; 0 = off (scene has a practical). Capped at 2e4"+ ],+ "LightRadius": [+ "float",+ 150.0,+ "Niagara light attenuation radius, cm"+ ],+ "LightOffset": [+ "vec3",+ [+ 0,+ 0,+ 10+ ],+ "light position relative to the fire, cm"+ ]+ },+ "system": {+ "seed": 1101,+ "bounds": [+ [+ -60,+ -60,+ -20+ ],+ [+ 60,+ 60,+ 80+ ]+ ]+ },+ "emitters": [+ {+ "name": "Flames",+ "template": "Fountain",+ "core": {+ "gpu": true,+ "material": "M_AFX_Flame",+ "fade": [+ 10.0,+ 3.0+ ],+ "nonuniform": true,+ "pivot": [+ 0.5,+ 0.85+ ]+ },+ "inputs": [+ [+ "ParticleSpawnScript",+ "ShapeLocation",+ "Shape Primitive",+ {+ "enum": "Ring"+ }+ ],+ [+ "ParticleSpawnScript",+ "ShapeLocation",+ "Ring Radius",+ {+ "link": "User.RingRadius",+ "type": "float"+ }+ ]+ ]+ },+ {+ "name": "Core",+ "template": "Fountain",+ "core": {+ "gpu": true,+ "material": "M_AFX_Flame",+ "fade": [+ 10.0,+ 3.0+ ],+ "curl": false,+ "grow": false,+ "nonuniform": true,+ "pivot": [+ 0.5,+ 0.85+ ]+ },+ "inputs": [+ [+ "ParticleSpawnScript",+ "ShapeLocation",+ "Shape Primitive",+ {+ "enum": "Ring"+ }+ ],+ [+ "ParticleSpawnScript",+ "ShapeLocation",+ "Ring Radius",+ {+ "hlsl": "User.RingRadius * 0.85"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Color",+ {+ "hlsl": "float4(0.25, 0.42, 1.0, User.Opacity)"+ }+ ],+ [+ "EmitterUpdateScript",+ "SpawnRate",+ "SpawnRate",+ {+ "hlsl": "User.SpawnRate * 0.8"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Lifetime Min",+ {+ "hlsl": "User.LifetimeMin * 0.35"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Lifetime Max",+ {+ "hlsl": "User.LifetimeMax * 0.35"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Sprite Size Min",+ {+ "hlsl": "float2(User.SizeMin * 0.5, User.SizeMin * 0.8)"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Sprite Size Max",+ {+ "hlsl": "float2(User.SizeMax * 0.5, User.SizeMax * 0.8)"+ }+ ]+ ],+ "set_params": [+ [+ "ParticleSpawnScript",+ "Particles.DynamicMaterialParameter",+ "vec4",+ "float4(User.Intensity * User.CoreIntensity, 0.0, 0.0, 0.0)"+ ]+ ]+ },+ {+ "name": "Light",+ "template": "SingleLoopingParticle",+ "emitter_data": {+ "SimTarget": "CPUSim",+ "bDeterminism": true,+ "RandomSeed": 77,+ "CalculateBoundsMode": "Fixed",+ "FixedBounds": {+ "min": {+ "x": -60,+ "y": -60,+ "z": -20+ },+ "max": {+ "x": 60,+ "y": 60,+ "z": 80+ },+ "isValid": true+ }+ },+ "inputs": [+ [+ "EmitterUpdateScript",+ "EmitterState",+ "Life Cycle Mode",+ {+ "enum": "Self"+ }+ ],+ [+ "EmitterUpdateScript",+ "EmitterState",+ "Loop Behavior",+ {+ "enum": "Once"+ }+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "UsePositionOffset",+ true+ ],+ [+ "ParticleSpawnScript",+ "InitializeParticle",+ "Position Offset",+ {+ "link": "User.LightOffset",+ "type": "vec3"+ }+ ],+ [+ "ParticleUpdateScript",+ "ParticleState",+ "Kill Particles When Lifetime Has Elapsed",+ false+ ]+ ],+ "set_params": [+ [+ "ParticleUpdateScript",+ "Particles.LightRadius",+ "float",+ "User.LightRadius",+ "SolveForcesAndVelocity"+ ],+ [+ "ParticleUpdateScript",+ "Particles.Color",+ "color",+ "float4(User.Color.r, User.Color.g, User.Color.b, 1.0) * min(User.LightIntensity, 20000.0) * (1.0 + 0.22 * sin(Engine.Time * 11.3) + 0.14 * sin(Engine.Time * 23.7 + 1.3) + 0.08 * sin(Engine.Time * 41.0))",+ "SolveForcesAndVelocity"+ ]+ ],+ "remove_renderers": [+ 0+ ],+ "add_renderers": [+ {+ "class": "NiagaraLightRendererProperties",+ "data": {+ "bUseInverseSquaredFalloff": true,+ "bAffectsTranslucency": true,+ "RadiusScale": 1.0,+ "bAlphaScalesBrightness": false+ }+ }+ ]+ }+ ]+}\ No newline at end of filediff --git a/unreal_fx/fx_recipes/NS_FountainJet.json b/unreal_fx/fx_recipes/NS_FountainJet.jsonnew file mode 100644index 0000000..6cf6418--- /dev/null+++ b/unreal_fx/fx_recipes/NS_FountainJet.json@@ -0,0 +1,10 @@+{+ "name": "NS_FountainJet",+ "description": "Water jet / spray / sprinkler / hose: GPU velocity-aligned streaks launched along Velocity and falling under gravity; Velocity = sqrt(2 g h) along the nozzle.",+ "fx_types": ["fountain", "splash"],+ "common": {"spawn": 1500, "life": [1.0, 1.4], "size": [0.4, 0.8], "vel": [0, 0, 440], "color": [0.85, 0.9, 0.95], "intensity": 20, "opacity": 0.4,+ "box": [1, 1, 1], "gravity": 1.0, "drag": 0.1, "jitter": 0.06, "aspect": 6.0},+ "system": {"seed": 7707, "bounds": [[-300, -300, -50], [300, 300, 400]]},+ "emitters": [{"name": "Jet", "template": "Fountain",+ "core": {"gpu": true, "material": "M_AFX_Streak", "fade": [30.0, 6.0], "aligned": true, "curl": false, "grow": false, "nonuniform": true}}]+}diff --git a/unreal_fx/fx_recipes/NS_Rain.json b/unreal_fx/fx_recipes/NS_Rain.jsonnew file mode 100644index 0000000..6d1b850--- /dev/null+++ b/unreal_fx/fx_recipes/NS_Rain.json@@ -0,0 +1,10 @@+{+ "name": "NS_Rain",+ "description": "Rain / drizzle over a box: GPU velocity-aligned lit streaks with a faint emissive; streak length = drop + speed x shutter (Aspect).",+ "fx_types": ["rain"],+ "common": {"spawn": 4000, "life": [1.0, 1.2], "size": [0.25, 0.35], "vel": [25, -10, -500], "color": [0.8, 0.85, 0.9], "intensity": 60,+ "opacity": 0.35, "box": [300, 300, 5], "jitter": 0.03, "aspect": 40.0},+ "system": {"seed": 3303, "bounds": [[-400, -400, -700], [400, 400, 50]]},+ "emitters": [{"name": "Streaks", "template": "Fountain",+ "core": {"gpu": true, "material": "M_AFX_Streak", "fade": [30.0, 30.0], "aligned": true, "curl": false, "grow": false, "nonuniform": true}}]+}diff --git a/unreal_fx/fx_recipes/NS_Smoke.json b/unreal_fx/fx_recipes/NS_Smoke.jsonnew file mode 100644index 0000000..6fd6c6f--- /dev/null+++ b/unreal_fx/fx_recipes/NS_Smoke.json@@ -0,0 +1,9 @@+{+ "name": "NS_Smoke",+ "description": "Darker, slower, longer-lived plume (chimneys, exhaust, incense; cigarettes at small sizes): the steam puff look with smoke defaults.",+ "fx_types": ["smoke"],+ "common": {"spawn": 25, "life": [5.0, 8.0], "size": [6, 12], "vel": [0, 0, 20], "color": [0.32, 0.31, 0.3], "intensity": 0.0, "opacity": 0.3,+ "box": [4, 4, 1], "wind": [10, 0, 0], "drag": 1.0, "jitter": 0.15, "noise": 30, "noise_freq": 0.03, "grow": 4.0},+ "system": {"seed": 2303, "bounds": [[-200, -200, -10], [300, 200, 400]]},+ "emitters": [{"name": "Puffs", "template": "Fountain", "core": {"gpu": true, "material": "M_AFX_Steam", "fade": [3.0, 1.2], "sort": true}}]+}diff --git a/unreal_fx/fx_recipes/NS_Sparks.json b/unreal_fx/fx_recipes/NS_Sparks.jsonnew file mode 100644index 0000000..176d6d6--- /dev/null+++ b/unreal_fx/fx_recipes/NS_Sparks.json@@ -0,0 +1,12 @@+{+ "name": "NS_Sparks",+ "description": "Sparks / embers: hot additive velocity-aligned streaks under gravity and drag (grinders, welding, fireworks; campfire embers with Gravity ~ -0.05 and a long life). Ships its own material: the pattern for an agent adding a new look.",+ "fx_types": ["sparks", "embers"],+ "common": {"spawn": 200, "life": [0.4, 0.9], "size": [0.2, 0.4], "vel": [0, 0, 400], "color": [1.0, 0.55, 0.15], "intensity": 20000, "opacity": 1.0,+ "box": [2, 2, 2], "gravity": 1.0, "drag": 0.5, "jitter": 0.5, "aspect": 8.0, "temperature": 1900},+ "system": {"seed": 6606, "bounds": [[-300, -300, -200], [300, 300, 400]]},+ "materials": {"M_AFX_Spark": {"blend": "ADDITIVE", "lit": false, "op": "return 0;",+ "rgb": "float x = abs(UV.x - 0.5) * 2.0;\nfloat a = saturate(1.0 - x);\na *= a * saturate(UV.y * 3.0) * saturate((1.0 - UV.y) * 6.0);\nfloat3 col = DP.y > 0 ? X.bb(DP.y) : PC;\nreturn col * a * PA * DP.x;"}},+ "emitters": [{"name": "Sparks", "template": "Fountain",+ "core": {"gpu": true, "material": "M_AFX_Spark", "fade": [50.0, 1.5], "aligned": true, "curl": false, "grow": false, "nonuniform": true}}]+}diff --git a/unreal_fx/fx_recipes/NS_Steam.json b/unreal_fx/fx_recipes/NS_Steam.jsonnew file mode 100644index 0000000..37501e5--- /dev/null+++ b/unreal_fx/fx_recipes/NS_Steam.json@@ -0,0 +1,9 @@+{+ "name": "NS_Steam",+ "description": "Rising lit vapour plume (woks, pots, kettles, vents, manholes): GPU soft puffs, growing, curl noise, drifting with Wind, depth-sorted, before-DOF.",+ "fx_types": ["steam"],+ "common": {"spawn": 40, "life": [3.0, 4.5], "size": [12, 22], "vel": [0, 0, 30], "color": [0.9, 0.9, 0.9], "intensity": 0.0, "opacity": 0.18,+ "box": [10, 10, 2], "wind": [15, 0, 0], "drag": 1.5, "jitter": 0.25, "noise": 60, "noise_freq": 0.02, "grow": 3.0},+ "system": {"seed": 2202, "bounds": [[-150, -150, -10], [250, 150, 250]]},+ "emitters": [{"name": "Puffs", "template": "Fountain", "core": {"gpu": true, "material": "M_AFX_Steam", "fade": [5.0, 1.6], "sort": true}}]+}diff --git a/unreal_fx/fxlib.py b/unreal_fx/fxlib.pynew file mode 100644index 0000000..b2c744c--- /dev/null+++ b/unreal_fx/fxlib.py@@ -0,0 +1,41 @@+"""Thin synchronous wrapper over Epic's experimental NiagaraToolsets (unreal.ToolsetRegistry.execute_tool), used by+fx_pack.py to author the AnySceneFX templates headlessly (UnrealEditor-Cmd -run=pythonscript)."""+import json++import unreal++TS = "NiagaraToolsets.NiagaraToolset_System"+LOG = []+++def call(tool, args, toolset=TS, check=True):+ unreal.log("FXCALL " + tool + " " + json.dumps(args)[:200])+ r = unreal.ToolsetRegistry.execute_tool(toolset, tool, json.dumps(args))+ if not r.get_editor_property("is_complete"):+ LOG.append(f"{tool} not complete synchronously")+ err = r.get_editor_property("error")+ if err:+ LOG.append(f"{tool} ERROR {err}")+ if check:+ raise RuntimeError(f"{tool}: {err}\nargs={json.dumps(args)[:1500]}")+ return None+ v = r.get_value_as_json_string()+ try:+ while isinstance(v, str) and v[:1] in "{[\"":+ v = json.loads(v)+ except Exception:+ pass+ if isinstance(v, dict) and set(v) == {"returnValue"}:+ v = v["returnValue"]+ while isinstance(v, str) and v[:1] in "{[":+ v = json.loads(v)+ return v+++def ref(path):+ return {"refPath": path}+++def item(system, emitter="", script="", module="", renderer=-1, inputs=()):+ return {"system": ref(system), "emitterName": emitter, "scriptName": script, "moduleName": module,+ "rendererIndex": renderer, "inputNameStack": list(inputs)}diff --git a/unreal_fx/make_copy.py b/unreal_fx/make_copy.pynew file mode 100644index 0000000..0a0063e--- /dev/null+++ b/unreal_fx/make_copy.py@@ -0,0 +1,12 @@+"""Make a working copy of a scene .blend with all external paths absolute (a plain file copy breaks the scene's+//../../refs/... texture paths as soon as it lives in another folder). The source file is only read.+ blender -b scenes/<id>/<scene>.blend --python unreal/make_copy.py -- <out.blend>+"""+import sys+import bpy++out = sys.argv[sys.argv.index("--") + 1]+assert bpy.path.abspath(out) != bpy.data.filepath, "refusing to overwrite the source .blend"+bpy.ops.file.make_paths_absolute()+bpy.ops.wm.save_as_mainfile(filepath=out, copy=True, relative_remap=False, compress=False)+print("COPY", bpy.data.filepath, "->", out, flush=True)diff --git a/unreal_fx/perf.ps1 b/unreal_fx/perf.ps1new file mode 100644index 0000000..a601daf--- /dev/null+++ b/unreal_fx/perf.ps1@@ -0,0 +1,40 @@+# Standalone (-game) real-time performance run of a built AnyScene level, with no window (-RenderOffscreen).+# Captures N frames with the CSV profiler (frame/game/render/GPU times) from the PlayerStart (hero camera), and samples+# total GPU memory with nvidia-smi before and during the run.+# powershell -File perf.ps1 [-Map /Game/AnyScene/HK/L_HK] [-ResX 2560] [-ResY 1440] [-Frames 900] [-Extra "r.Lumen.HardwareRayTracing 0"]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Map = "/Game/AnyScene/HK/L_HK",+ [int]$ResX = 2560, [int]$ResY = 1440, [int]$Frames = 900, [int]$TimeoutS = 600,+ [string]$Tag = "perf", [string]$Extra = ""+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor.exe"+$saved = Join-Path (Split-Path $Project) "Saved"+$csvDir = Join-Path $saved "Profiling\CSV"+$before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+$mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+# The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+$cmds = "r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+if ($Extra) { $cmds = "$Extra,$cmds" }+$args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+ "-dpcvars=Editor.AsyncAssetCompilation=0") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+$proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+$peak = $mem0+$sw = [Diagnostics.Stopwatch]::StartNew()+$csv = $null+while (-not $proc.HasExited -and $sw.Elapsed.TotalSeconds -lt $TimeoutS) {+ Start-Sleep -Seconds 2+ $m = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ if ($m -gt $peak) { $peak = $m }+ $new = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | Where-Object { $before -notcontains $_.FullName }+ if ($new) {+ $f = $new | Sort-Object LastWriteTime | Select-Object -Last 1+ # The CSV is written when the capture ends; wait until the file stops growing.+ $s1 = $f.Length; Start-Sleep -Seconds 3; $s2 = (Get-Item $f.FullName).Length+ if ($s1 -eq $s2 -and $s2 -gt 0) { $csv = $f.FullName; break }+ }+}+if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force }+"gpu_mem_before_mb=$mem0 gpu_mem_peak_mb=$peak delta_mb=$($peak - $mem0)"+"csv=$csv"diff --git a/unreal_fx/render_mrq.ps1 b/unreal_fx/render_mrq.ps1new file mode 100644index 0000000..841229a--- /dev/null+++ b/unreal_fx/render_mrq.ps1@@ -0,0 +1,17 @@+# Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+# UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+# powershell -File render_mrq.ps1 [-Cams cam_street,cam_table,cam_wok] [-Config MRQ_Still|MRQ_Linear]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Dest = "/Game/AnyScene/HK", [string]$Level = "L_HK",+ [string]$Cams = "cam_street,cam_table,cam_wok", [string]$Config = "MRQ_Still"+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"+foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+ "-dpcvars=Editor.AsyncAssetCompilation=0" | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+}diff --git a/unreal_fx/render_shots.py b/unreal_fx/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal_fx/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_fx/side_by_side.py b/unreal_fx/side_by_side.pynew file mode 100644index 0000000..e55eddd--- /dev/null+++ b/unreal_fx/side_by_side.py@@ -0,0 +1,47 @@+"""Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.+"""+import os+import sys++from PIL import Image, ImageDraw, ImageFont++cyc, ue, out = sys.argv[1:4]+cams = (sys.argv[4] if len(sys.argv) > 4 else "street,table,wok").split(",")+os.makedirs(out, exist_ok=True)+H = 804+LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")+try:+ font = ImageFont.truetype("arial.ttf", 28)+except OSError:+ font = ImageFont.load_default()+++def fit(p):+ im = Image.open(p).convert("RGB")+ return im.resize((round(im.width * H / im.height), H), Image.LANCZOS)+++rows = []+for c in cams:+ a = fit(os.path.join(cyc, f"{c}_graded.png"))+ up = os.path.join(ue, f"cam_{c}.png")+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+ for x, t in ((12, f"Cycles graded {c}"), (a.width + 20, f"{LABEL} {c}")):+ d.rectangle([x - 6, 8, x + 360, 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)+ print("wrote", os.path.join(out, f"{c}.png"))+w = max(r.width for r in rows)+allim = Image.new("RGB", (w, sum(r.height for r in rows) + 8 * (len(rows) - 1)), (255, 255, 255))+y = 0+for r in rows:+ allim.paste(r, (0, y))+ y += r.height + 8+allim.resize((allim.width // 2, allim.height // 2), Image.LANCZOS).save(os.path.join(out, "all.png"))diff --git a/unreal_fx/templates.json b/unreal_fx/templates.jsonnew file mode 100644index 0000000..f247265--- /dev/null+++ b/unreal_fx/templates.json@@ -0,0 +1,233 @@+{+ "NS_Drips": {+ "path": "/Game/AnySceneFX/Systems/NS_Drips.NS_Drips",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "drips"+ ],+ "description": "Drops falling off an edge or line (awnings, pipes, leaves) under gravity; lifetime = fall time to the ground below."+ },+ "NS_DustMotes": {+ "path": "/Game/AnySceneFX/Systems/NS_DustMotes.NS_DustMotes",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "dust"+ ],+ "description": "Floating dust / pollen / ash motes in a box with curl-noise drift; only reads inside light shafts."+ },+ "NS_Fire": {+ "path": "/Game/AnySceneFX/Systems/NS_Fire.NS_Fire",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float",+ "CoreIntensity": "float",+ "RingRadius": "float",+ "LightIntensity": "float",+ "LightRadius": "float",+ "LightOffset": "vec3"+ },+ "fx_types": [+ "fire"+ ],+ "description": "Flame tongues on a ring (gas burner, wok, brazier; candle at small sizes): CPU additive sprites + blue core + one capped flickering Niagara light (off by default when the scene has a practical)."+ },+ "NS_FountainJet": {+ "path": "/Game/AnySceneFX/Systems/NS_FountainJet.NS_FountainJet",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "fountain",+ "splash"+ ],+ "description": "Water jet / spray / sprinkler / hose: GPU velocity-aligned streaks launched along Velocity and falling under gravity; Velocity = sqrt(2 g h) along the nozzle."+ },+ "NS_Rain": {+ "path": "/Game/AnySceneFX/Systems/NS_Rain.NS_Rain",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "rain"+ ],+ "description": "Rain / drizzle over a box: GPU velocity-aligned lit streaks with a faint emissive; streak length = drop + speed x shutter (Aspect)."+ },+ "NS_Smoke": {+ "path": "/Game/AnySceneFX/Systems/NS_Smoke.NS_Smoke",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "smoke"+ ],+ "description": "Darker, slower, longer-lived plume (chimneys, exhaust, incense; cigarettes at small sizes): the steam puff look with smoke defaults."+ },+ "NS_Sparks": {+ "path": "/Game/AnySceneFX/Systems/NS_Sparks.NS_Sparks",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "sparks",+ "embers"+ ],+ "description": "Sparks / embers: hot additive velocity-aligned streaks under gravity and drag (grinders, welding, fireworks; campfire embers with Gravity ~ -0.05 and a long life). Ships its own material: the pattern for an agent adding a new look."+ },+ "NS_Steam": {+ "path": "/Game/AnySceneFX/Systems/NS_Steam.NS_Steam",+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "steam"+ ],+ "description": "Rising lit vapour plume (woks, pots, kettles, vents, manholes): GPU soft puffs, growing, curl noise, drifting with Wind, depth-sorted, before-DOF."+ }+}\ No newline at end of filediff --git a/unreal_fx/templates_report.json b/unreal_fx/templates_report.jsonnew file mode 100644index 0000000..4258677--- /dev/null+++ b/unreal_fx/templates_report.json@@ -0,0 +1,712 @@+{+ "systems": {+ "NS_Drips": {+ "path": "/Game/AnySceneFX/Systems/NS_Drips.NS_Drips",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Drops",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Drops",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Drops",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "drips"+ ],+ "description": "Drops falling off an edge or line (awnings, pipes, leaves) under gravity; lifetime = fall time to the ground below."+ },+ "NS_DustMotes": {+ "path": "/Game/AnySceneFX/Systems/NS_DustMotes.NS_DustMotes",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Motes",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Motes",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Motes",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "dust"+ ],+ "description": "Floating dust / pollen / ash motes in a box with curl-noise drift; only reads inside light shafts."+ },+ "NS_Fire": {+ "path": "/Game/AnySceneFX/Systems/NS_Fire.NS_Fire",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": true,+ "bIsStale": true,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Flames",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Flames",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Flames",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Core",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Core",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Core",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Light",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "Unknown",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Light",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "Unknown",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float",+ "CoreIntensity": "float",+ "RingRadius": "float",+ "LightIntensity": "float",+ "LightRadius": "float",+ "LightOffset": "vec3"+ },+ "fx_types": [+ "fire"+ ],+ "description": "Flame tongues on a ring (gas burner, wok, brazier; candle at small sizes): CPU additive sprites + blue core + one capped flickering Niagara light (off by default when the scene has a practical)."+ },+ "NS_FountainJet": {+ "path": "/Game/AnySceneFX/Systems/NS_FountainJet.NS_FountainJet",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Jet",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Jet",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Jet",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "fountain",+ "splash"+ ],+ "description": "Water jet / spray / sprinkler / hose: GPU velocity-aligned streaks launched along Velocity and falling under gravity; Velocity = sqrt(2 g h) along the nozzle."+ },+ "NS_Rain": {+ "path": "/Game/AnySceneFX/Systems/NS_Rain.NS_Rain",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Streaks",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Streaks",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Streaks",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "rain"+ ],+ "description": "Rain / drizzle over a box: GPU velocity-aligned lit streaks with a faint emissive; streak length = drop + speed x shutter (Aspect)."+ },+ "NS_Smoke": {+ "path": "/Game/AnySceneFX/Systems/NS_Smoke.NS_Smoke",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "smoke"+ ],+ "description": "Darker, slower, longer-lived plume (chimneys, exhaust, incense; cigarettes at small sizes): the steam puff look with smoke defaults."+ },+ "NS_Sparks": {+ "path": "/Game/AnySceneFX/Systems/NS_Sparks.NS_Sparks",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Sparks",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Sparks",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Sparks",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "sparks",+ "embers"+ ],+ "description": "Sparks / embers: hot additive velocity-aligned streaks under gravity and drag (grinders, welding, fireworks; campfire embers with Gravity ~ -0.05 and a long life). Ships its own material: the pattern for an agent adding a new look."+ },+ "NS_Steam": {+ "path": "/Game/AnySceneFX/Systems/NS_Steam.NS_Steam",+ "issues": [],+ "compile": {+ "aggregateStatus": "UpToDate",+ "bIsCompiling": false,+ "bIsStale": false,+ "bHasErrors": false,+ "bHasWarnings": false,+ "scripts": [+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemSpawnScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "None",+ "scriptName": "ENiagaraScriptUsage::SystemUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleSpawnScriptInterpolated",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleUpdateScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ },+ {+ "emitterName": "Puffs",+ "scriptName": "ENiagaraScriptUsage::ParticleGPUComputeScript",+ "lastCompileStatus": "UpToDate",+ "errorSummary": "",+ "compileEvents": []+ }+ ]+ },+ "stack_issues": null,+ "params": {+ "SpawnRate": "float",+ "LifetimeMin": "float",+ "LifetimeMax": "float",+ "SizeMin": "float",+ "SizeMax": "float",+ "Aspect": "float",+ "Velocity": "vec3",+ "VelocityJitter": "float",+ "Wind": "vec3",+ "Gravity": "float",+ "Drag": "float",+ "BoxExtent": "vec3",+ "Color": "color",+ "Intensity": "float",+ "Opacity": "float",+ "Temperature": "float",+ "NoiseStrength": "float",+ "NoiseFreq": "float",+ "Grow": "float"+ },+ "fx_types": [+ "steam"+ ],+ "description": "Rising lit vapour plume (woks, pots, kettles, vents, manholes): GPU soft puffs, growing, curl noise, drifting with Wind, depth-sorted, before-DOF."+ }+ },+ "materials": [+ "/Game/AnySceneFX/Materials/M_AFX_Flame",+ "/Game/AnySceneFX/Materials/M_AFX_Mote",+ "/Game/AnySceneFX/Materials/M_AFX_Spark",+ "/Game/AnySceneFX/Materials/M_AFX_Steam",+ "/Game/AnySceneFX/Materials/M_AFX_Streak"+ ],+ "errors": [],+ "curl_inputs": [+ "Bias Noise",+ "Bias Noise Field",+ "Coordinate Space",+ "Curl Noise Cone Mask Angle",+ "Curl Noise Cone Mask Axis",+ "Curl Noise Cone Mask Falloff Angle",+ "CurlNoise",+ "Debug Every N Particles",+ "Debug Force Line Length",+ "Mask Curl Noise",+ "Noise Frequency",+ "Noise Quality / Cost",+ "Noise Strength",+ "Pan Noise",+ "Pan Noise Field",+ "Random Seed",+ "Randomization Vector",+ "Randomize Noise Sample",+ "Sample Position",+ "Scale Curl Lookup By Engine Owner Scale",+ "Write to Intrinsic Parameters"+ ],+ "scalesize_inputs": {+ "Scale Sprite Size Mode": [+ "ENiagara_ScaleSpriteSize",+ true+ ],+ "Uniform Curve Sprite Scale": [+ "NiagaraDataInterfaceCurve",+ false+ ],+ "Non-Uniform Curve Sprite Scale": [+ "NiagaraDataInterfaceVector2DCurve",+ false+ ],+ "Uniform Curve Index": [+ "NiagaraFloat",+ false+ ],+ "Non-Uniform Curve Index": [+ "NiagaraFloat",+ false+ ],+ "Non-Uniform Curve Scale": [+ "Vector2f",+ false+ ],+ "Uniform Curve Scale": [+ "NiagaraFloat",+ false+ ],+ "Scale Factor": [+ "Vector2f",+ true+ ],+ "Uniform Scale Factor": [+ "NiagaraFloat",+ false+ ],+ "Initial Sprite Size": [+ "Vector2f",+ true+ ]+ },+ "toolset_log": []+}\ No newline at end of filediff --git a/unreal_ramen/FIXLOG.md b/unreal_ramen/FIXLOG.mdnew file mode 100644index 0000000..f620a67--- /dev/null+++ b/unreal_ramen/FIXLOG.md@@ -0,0 +1,79 @@+# Ramen → Unreal 5.8: fix log++Copies: scripts in `anyscene/unreal_ramen/` (pristine originals as copied at 20:17 in `_orig/`), scene copy+`anyscene-unreal/ramen/ramen_copy.blend`, project `anyscene-unreal/AnySceneRamen/`. Patch of all script changes: `ramen_fixes.patch` (`diff -ru _orig .`, 216 lines).++**G** = generic (mergeable into `anyscene/unreal/`), **R** = ramen-specific (lives in `anyscene-unreal/ramen/work/`).++## Mergeable change list (generic)++| # | File | Change | Why |+|---|------|--------|-----|+| G1 | `export.sh` | Run the `export_blend.py` next to the script, not `$A/unreal/export_blend.py` | Per-scene copies of `unreal/` silently ran the shared exporter (the one other jobs are editing). |+| G2 | `export.sh` | `EXPORT_NOQUEUE=1` skips `pipeline/gpu_run.sh` | CPU bakes don't need the GPU; with an Unreal job holding the queue the export just waited. |+| G3 | `export_blend.py` | Mantaflow domains (FLUID modifier, DOMAIN) go to `fx` (`kind: mantaflow_gas`, cache path, bounds) instead of `sample_volume` | The slice bake can't see the cache grids; it read the steam shader's constant density 8.0 and would build an opaque local-fog box. Steam is a Niagara job (NIAGARA.md). |+| G4 | `build_level.py` | `ANYSCENE_HERO_CAM` picks the PlayerStart camera (was hard-coded `cam_street`, fallback = first camera) | Scenes without `cam_street` got whatever camera came first. |+| G5 | `render_mrq.ps1`, `perf.ps1` | Full `-dpcvars` set (asset/texture/static-mesh async compilation off, Niagara wait-on-activate) | Was `Editor.AsyncAssetCompilation=0` only. |+| G7 | `build_level.py` `stage_materials` | All-glass meshes (no baked slots): assign the glass MIs from section 0 | glTF drops the unused BAKED slot 0, leaving 1 section, which got the untextured baked MI. Windows, door panes, fridge door, water glasses and jars rendered opaque (11 assets here; HK likely has the same). |+| G8 | `export_blend.py` `ensure_bake_uv` | Set `active_render` on the original UV **by name** after `uv_layers.new("bake")` | **Biggest visual bug.** `uv_layers.new()` reallocates the collection; setting `active_render` through the stale reference cleared it on every layer, so image nodes with an implicit UV (and Texture Coordinate → UV) sampled a single texel. Every re-unwrapped poster, calendar, flyer, sticker, menu card, decal, neon sign and the UV-driven tile wall baked to a flat colour (37 of 152 smart_project assets here). Verified in isolation (`work/uvdbg2.py`: after the old code both layers read `active_render=False`). HK/caustic/bakery/MC exports are very likely affected too. Not fixed upstream as of 21:50. |+| G9 | `export_blend.py` (Rewire orm, `cuts_out`, `e["alpha"]`) + `build_level.py` (`master_baked(masked=True)`) | Principled Alpha baked into ORM.R (was a constant 1); assets with a linked/<1 alpha get `M_AnyBakedMasked` (opacity mask = ORM.R, clip 0.33) | Luminance-keyed decals (floor grime, drips, splatter, rings) and stickers rendered as opaque dark/light squares. `MaterialExpressionDitherTemporalAA` is not exposed to Python in 5.8, so it's a plain clip. 30 assets here. Assets that are opaque keep `M_AnyBaked` (R=1, unchanged). |+| G10 | `export_blend.py` `--only` (note, not fixed) | `--only` matches object names, not asset names (assets named from mesh data, e.g. `decal_floor_001` ← object `decal_floor.001`) | Re-exporting by asset name silently skipped 17 of 42. Workaround: map assets → object names via placements. Suggest matching `an` too. |+| G6 | `perf.ps1` | `r.setres <ResX>x<ResY>w` added to `-ExecCmds` | Same fix mission-control landed upstream (their version also adds a comment line); take upstream's. Confirmed needed: the log shows 1066x600 until `r.SetRes = "2560x1440w"` on frame 1, and the CSV metadata then reads 2560x1440. |++## Ramen-specific++| # | Where | Change | Why |+|---|-------|--------|-----|+| R1 | `work/prep_copy.py` | 5 decal/poster images with `//..\..\refs\ramen\tex` paths re-pointed (absolute) at `blender-scene/refs/ramen/tex`; steam cache dirs re-pointed at the original `scenes/ramen/cache/r2` (read only) | Plain file copy breaks relative paths (make_copy.py would have had to open the original, which is open in the user's GUI Blender). |+| R2 | `work/prep_copy.py` | Added `cam_bowl` (shots.json `bowl_insert` key: pos (3.2, 2.3, 1.42), aim bowl + 7 cm, 100 mm f/2, focus 1.52 m) | The blend has no close-up camera; shot cameras are created by the camrig at render time. |+| R3 | export args | `--frame 1` (heroes and render.py stills use frame 1), `--grade-sh scenes/ramen/finish.sh`, CapCut ffmpeg | Scene's grade lives in finish.sh. |++## Overlap with upstream (`anyscene/unreal/`, mission-control's fixes landed after my copy)++- **G7 ≈ upstream "sections-based material mapping for all-glass meshes"**. Upstream's is better (exporter writes the real+ `sections` list); merge upstream's and drop G7.+- **G6 = upstream `perf.ps1` r.setres**. Take upstream's.+- Upstream's export.sh crash-resume, GLB-exists done test and the ffmpeg-from-env change were already in my copy.+- **Not upstream yet, merge these:** G1, G2, G3, G4, G5, **G8 (flat posters/decals)**, **G9 (alpha cutouts)**, G10 (note).+ G8 hunk applies on top of upstream as-is: upstream line ~544 still sets `ar.active_render = True` on the stale reference.++## Results++Level `/Game/AnyScene/Ramen/L_Ramen`: 296 mesh actors (274 unique meshes), 23 lights (8 spot, 8 rect, 7 point),+7 cine cameras, height fog (haze_volume) + 1 local fog volume (kitchen_vapor), grade PPV with finish.sh LUT.+PlayerStart = cam_wide. Steam (2 Mantaflow domains) and rain (35k particles) are in `scene.json` fx, not built.++**Perf** (standalone `-game`, offscreen, 2560x1440, Lumen HWRT + VSM + Nanite + volumetric fog, 841 frames from+cam_wide, GPU otherwise idle at the time: 1.4 GB used before the run):+85.6 fps mean · frame 11.7 ms (p95 12.7) · GPU 11.2 ms (p95 11.8) · game 1.2 ms · peak GPU memory +3.9 GB.+Top GPU passes: Lights 6.1 ms (23 movable shadowed lights; half the frame), TSR 0.9, shadow depths 0.7,+Lumen reflections 0.6, Nanite vis 0.3, volumetric fog 0.3.++**Stage timings** (machine shared with ~5 other Blender/Unreal jobs, CPU at 100%, RAM ~0 free during export):+| stage | time |+|---|---|+| scene copy (1.27 GB blend + 1.2 GB lib) + path prep | ~1 min |+| export (CPU bake, 274 assets, one Blender OIIO crash + resume) | 41 min wall (2164 s second run) |+| UE build, full (textures 60 s, meshes 801 s, materials 216 s, level 4 s, sequences 10 s) | 18 min |+| fix pass: re-export 42 assets (2 runs) | 1.5 min |+| fix pass: reimport + materials/level/sequences | ~1.5 min |+| MRQ stills, warm DDC (wide / counter / bowl) | 39 / 20 / 20 s (cold first pass: 246 / 108 / 56 s) |+| Cycles reference, cam_bowl, 256 spp OptiX | 65 s render, 69 s wall |+| perf run (900 frames) | 37 s |++## Honest read of the match++- **Layout, props, lighting placement, framing: near-identical** in all three views. Every prop, lamp, sign, stool,+ poster and decal is where Cycles has it; shadows from the pendants and the counter spots fall the same way.+- **Biggest miss: steam.** Cycles' counter and wide shots are dominated by a bright steam wall over the stove; UE has+ none (Niagara gap, NIAGARA.md). It also changes the mood: Cycles' kitchen glows, UE's kitchen is clear and harder.+- **Tone:** UE is flatter and slightly brighter in the shadows, less of Cycles' warm crush (AgX vs UE filmic + LUT;+ the open AgX tone-match item).+- **Backsplash:** stainless at roughness 0.19 / metallic 1 reads as crinkled mirror foil under Lumen vs grey grime in+ Cycles. The bake is correct; the procedural grime (AO + noise) gets lost at 1024x4096 and Lumen reflects the lamps+ harder. Would want a roughness floor or AO-in-roughness tweak (not done).+- **Glass:** water glasses read milky/plastic (translucent master, no refraction, white tint); Cycles' are dark and+ refractive. Window/door glass is fine (rain-on-glass texture lost).+- **Close-up:** a stray white sliver on the counter left of the bowl in UE (not in Cycles); likely one of the+ masked decals/Planes clipping differently. Not investigated.+- Faint counter ring stains (decal_rings) are mostly clipped away by the 0.33 mask.diff --git a/unreal_ramen/NIAGARA.md b/unreal_ramen/NIAGARA.mdnew file mode 100644index 0000000..72bd5cb--- /dev/null+++ b/unreal_ramen/NIAGARA.md@@ -0,0 +1,655 @@+# NIAGARA.md: porting AnyScene (Blender/Cycles) effects to Unreal 5.8++This is the converter agent's guide to effects: flames, steam, smoke, haze plumes, rain or drizzle, drips and splashes,+sparks and embers, dust motes, fountain jets, and screen or light flicker. Geometry, materials, lights, cameras and fog+already convert (`export_blend.py` writes `scene.json`, then `build_level.py` builds the level). This file covers+what comes next: classify each Blender effect, pick a technique, place it, render it through MRQ and compare it+with Cycles.++Everything marked *[engine]* was confirmed in the installed UE 5.8 files under `C:\Program Files\Epic Games\UE_5.8`.+Items marked *[docs]* come from dev.epicgames.com. Items marked *[untested]* are design guidance: verify them on the+first scene and update this file.++---++## 0. Read this first: findings that change the plan++1. **No built-in fire, steam, smoke or rain system ships with 5.8.** The Niagara plugin includes only generic emitter+ templates (Fountain, HangingParticulates, RecycleParticlesInView, BlowingParticles, DirectionalBurst, ...). There is+ no StarterContent `P_Fire` / `P_Steam` on this install. Real fire and smoke exist only as **NiagaraFluids** grid sims,+ which are Beta and expensive. Plan on an **AnySceneFX content plugin**: about ten master systems authored once, so+ the converter only places them and sets their parameters. Never author Niagara graphs at build time.+2. **Local fog volumes in `build_level.py` are the wrong size.** `ULocalFogVolumeComponent::GetBaseVolumeSize()`+ returns **500 cm**, and the proxy collapses the scale to a uniform sphere using the **max axis**+ (`LocalFogVolumeSceneProxy.cpp:34`) *[engine]*. `build_level.py` assumes a 100 cm unit and non-uniform scale, so+ every LFV comes out about 5x too large and spherical. That is why the wok "flame" became a large static emissive+ glow. `RadialFogExtinction` is also integrated in unit-sphere space: the optical depth straight through the centre+ is exactly `RadialFogExtinction`, independent of size (`LocalFogVolumeCommon.ush:178-203`). The correct mapping is+ **extinction = Blender density (1/m) x path length (m)**, not the raw density.+3. **Particles never reach the level.** The exporter only logs particle emitters into `fx` (no transform, no bounds,+ no velocity), and `build_level.py` ignores `fx`. That is why the HK drizzle and drips are missing. Steam is+ procedural 4D-noise volume shaders, which the exporter samples at one frame into a static LFV. Animated steam+ cannot survive that path.+4. **MRQ needs `render_warm_up_frames = True` for GPU particles.** The flag's own tooltip says GPU particles need the+ warm-up frames to be rendered *[engine: MoviePipelineAntiAliasingSetting.h]*. `build_level.py` already sets it+ (64 engine warm-up frames). Keep it, and keep `use_camera_cut_for_warm_up = False`, or `engine_warm_up_count` is+ ignored.+5. **Pass `fx.Niagara.ForceWaitForCompilationOnActivate=1` in `-dpcvars` for every headless render.** Otherwise a+ component activates while its scripts or GPU shaders are still compiling, and the first frames render without the+ effect. This is the Niagara equivalent of the `Editor.AsyncAssetCompilation=0` gotcha already in+ `render_shots.py`. The per-component property `bWaitForCompilationOnActivate` is editor-only data+ (`NiagaraComponent.cpp:1358`) *[engine]*.+6. **User parameters set from Python in the editor are saved with the level.** In editor builds, `SetVariableFloat`+ and the other setters also call `SetParameterOverride`, which writes `InstanceParameterOverrides`+ (`NiagaraComponent.cpp:2875, 4376`) *[engine]*. So build, set, `save_current_level()` works headlessly. The+ parameter must exist on the asset and the type must match exactly. A wrong name or wrong type is a **silent no-op**.+7. **Epic ships an AI toolset for Niagara authoring:** `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (plus+ `ToolsetRegistry`, both disabled by default). Its tools create systems, add emitters, modules, renderers and user+ variables, set stack inputs, and read compile errors and stack issues. You can call them from Python through+ `unreal.ToolsetRegistry.execute_tool(toolset, tool, json)`. Use this for the **one-time** authoring of the AnySceneFX+ templates, in a full editor session with an RHI. Do not use it in the per-scene build. It is Experimental. Its+ bundled skills (`Content/Python/skills/*.py`) are worth reading. They are summarised in §1 where relevant.+8. **Animated SVTs import headlessly from VDB.** `USparseVolumeTextureFactory` skips its dialog when the import is+ automated or running in a commandlet, auto-detects numbered `.vdb` sequences, and maps the `density` grid to+ attributes A.R (unorm8), with up to 4 other grids in B (fp16) (`SparseVolumeTextureFactory.cpp:40-108, 436`)+ *[engine]*. Blender 5.0 bundles the `openvdb` Python module (`5.0/python/lib/site-packages/openvdb.cp311-*.pyd`), so+ the exporter can write VDBs from procedural volumes itself.++---++## 1. Niagara essentials (only what the converter needs)++- **System > emitters > modules.** A *system* (`UNiagaraSystem`, the asset you place) contains *emitters*. Each+ emitter runs four script stacks in a fixed order: System Spawn/Update, then Emitter Spawn/Update, then Particle+ Spawn/Update. Spawn runs once at creation and Update runs every tick. Within Particle Update the order is forces,+ then collision, then exactly one velocity solve. *Renderers* (sprite, mesh, ribbon, light, ...) draw an emitter's+ particles.+- **Namespaces.** `User.*` is the external interface: set per component, read anywhere. `Engine.*` is read-only (delta+ time, owner transform). `System.*`, `Emitter.*` and `Particles.*` are written by their own scope.+ **Expose everything the converter sets as a `User.` parameter.** From Python, pass the bare name (`SpawnRate`). The+ `User.` prefix also resolves (`RedirectUserVariable`). There is no enum setter: set the int.+- **Types matter.** World-space anchors are `Position` (LWC-aware): use `set_variable_position`. Directions,+ velocities, wind and box extents are `Vector3`: use `set_variable_vec3`. Colours are `LinearColor`.+- **CPU vs GPU.** System and emitter scripts always run on the CPU VM. Only particle scripts move to the GPU.+ - Use **GPU** for anything sustained in the hundreds or more (rain, dust, steam puffs, sparks).+ - Use **CPU** for small counts and for any emitter with a **Light renderer**: light, decal and component renderers+ force the emitter to CPU.+ - A system can mix both.+- **Fixed bounds.** Use fixed bounds for every converter-placed effect. They are cheapest, work on CPU and GPU, and+ stop the culling surprises. Dynamic bounds are CPU-only. GPU emitters without fixed or programmable bounds cull+ wrongly. Set them per instance with `set_system_fixed_bounds(Box)` in **local space**: use the Blender domain or+ emitter box plus travel distance (velocity x lifetime).+- **Warm-up and pre-roll.** `UNiagaraSystem.WarmupTime / WarmupTickCount / WarmupTickDelta` simulate N ticks on+ activation in one frame. Per instance, set `override_warmup_settings = True`, `warmup_tick_count` and+ `warmup_tick_delta`. The component passes these to the instance at activation (`NiagaraComponent.cpp:1219`)+ *[engine]*. Rule: **warm-up time ≥ the longest particle lifetime x 1.5**, so the effect is in steady state on+ frame 1. Mirror Blender's negative `frame_start` (HK drizzle starts at -80) or the Mantaflow `PREROLL`.+- **Determinism and seeds.**+ - The system flag `bDeterminism` + `RandomSeed` makes the instance seed equal the system seed plus the component's+ `RandomSeedOffset`. Without it, every reset gets a random seed.+ - Emitters carry their own `bDeterminism` / `RandomSeed` too.+ - Turn both on in every AnySceneFX template. Set `set_random_seed_offset(hash(fx_id) & 0x7fffffff)` per instance so+ copies differ but runs repeat. The offset is applied on activation or reset, so set it before saving.+ - CPU emitters with determinism repeat exactly under MRQ's fixed timestep. Treat GPU emitters as "very close" *[untested]*.+ For bit-exact repeats, use a sim cache (§2.6).+- **Lit vs unlit sprites.**+ - Fire, embers, sparks, CRT glow: **unlit**, additive or translucent, emissive only.+ - Steam, smoke, haze, dust, rain: **lit translucent**. Use *Translucency Lighting Mode = Volumetric NonDirectional*+ (cheapest, soft) or *Volumetric PerVertex NonDirectional*. The directional modes only matter for normal-mapped+ smoke.+ - Prefer Masked over Translucent where blending allows (drops, chunky debris).+ - Translucent materials need **Two Sided** when seen from both sides.+ - Each material needs the usage flag for its renderer: `MaterialEditingLibrary.set_material_usage(mat,+ unreal.MaterialUsage.MATUSAGE_NIAGARA_SPRITES)`. In 5.8 the `bUsedWith*` flags are deprecated in favour of the+ usage accessor *[engine: Material.h:749]*.+- **Lumen.**+ - Particles do not contribute to Lumen GI or reflections as emitters: a fire sprite lights nothing. Light comes from+ a real light (§3, Lighting).+ - Lit translucent particles receive Lumen GI through the low-resolution translucency lighting volume, so expect+ soft, slightly flat shading.+ - Emissive particles are not in the Lumen scene: they will not show in reflections the way Cycles shows them.+- **Volumetric fog.**+ - A sprite with a **Volume-domain material** injects albedo, emissive and extinction into the volumetric-fog froxel+ grid. This gives real 3D density with no billboard edges *[docs: Volumetric Fog]*. Mesh renderers reject the Volume+ domain *[engine: NiagaraMeshRendererProperties.cpp:1380]*.+ - It needs an Exponential Height Fog with *Volumetric Fog* on, which the converter already spawns.+ - The grid is coarse and camera-aligned, so use it for haze plumes and soft steam bodies, not crisp wisps.+- **Translucency sorting.**+ - Within an emitter: `SortMode = ViewDepth` on the sprite renderer. Leave it at `None` for additive fire and sparks;+ sorting costs GPU time.+ - Between components, sorting is by bounds centre. Fix wrong-order overlaps with the primitive property+ `translucency_sort_priority`, or by splitting the bounds.+- **Depth of field.** Translucent materials default to `TranslucencyPass = MTP_AfterDOF` *[engine: Material.cpp:1183]*,+ so out-of-focus steam stays sharp. For effects in defocused regions (foreground steam in `cam_wok`), set+ `TranslucencyPass = MTP_BeforeDOF` in the template material, or in a second material variant.++---++## 2. Placing and driving Niagara from Python, headless++### 2.1 Confirmed API (UE 5.8, from `NiagaraComponent.h`, `NiagaraActor.h`, `NiagaraFunctionLibrary.h`)++| Need | Call |+|---|---|+| Place | `eas.spawn_actor_from_class(unreal.NiagaraActor, loc, rot)`. Same reason as `spawn_mesh()` in `build_level.py`: spawn by class in the commandlet |+| Component | `act.get_editor_property("niagara_component")` (UPROPERTY `NiagaraComponent`) |+| Set asset | `nc.set_asset(system, True)`. The second arg resets existing overrides: set the asset **first**, then the parameters |+| Float, int, bool | `nc.set_variable_float(name, v)`, `set_variable_int`, `set_variable_bool` |+| Vector, colour | `set_variable_vec3(name, unreal.Vector)`, `set_variable_vec2`, `set_variable_vec4`, `set_variable_linear_color(name, unreal.LinearColor)`, `set_variable_quat` |+| Position (LWC) | `set_variable_position(name, unreal.Vector)` |+| Objects | `set_variable_texture`, `set_variable_material`, `set_variable_static_mesh`, `set_variable_object`, `set_variable_actor` |+| Read back (verify) | `get_variable_float(name)` and the like. In Python these return `(value, is_valid)`; assert `is_valid` |+| Seed | `nc.set_random_seed_offset(int)` |+| Bounds | `nc.set_system_fixed_bounds(unreal.Box)`, `set_emitter_fixed_bounds(emitter_name, box)`; read back with `get_system_fixed_bounds()` |+| Warm-up | `nc.set_editor_property("override_warmup_settings", True)`, `("warmup_tick_count", n)`, `("warmup_tick_delta", dt)` |+| Scalability | `nc.set_allow_scalability(False)`. Cinematic renders must not be distance-culled by an Effect Type |+| Sequencer age | `set_age_update_mode(unreal.NiagaraAgeUpdateMode.DESIRED_AGE_NO_SEEK)`, `set_desired_age(t)`, `seek_to_desired_age(t)` |+| Manual sim | `advance_simulation(ticks, dt)`, `advance_simulation_by_time(seconds, dt)`, `reset_system()`, `reinitialize_system()` |+| Sim cache | `set_sim_cache(cache, reset)`. Capture with `NiagaraSimCacheFunctionLibrary.capture_niagara_sim_cache_immediate(...)` |+| Runtime spawn | `unreal.NiagaraFunctionLibrary.spawn_system_at_location(world, system, loc, rot, scale, auto_destroy, auto_activate, pool, precull)`. Do not use it for level building: it is a transient runtime spawn |++Python names are the snake_case form of the C++ names, with a property's `b` prefix dropped. No stub exists yet+(`Intermediate/PythonStub/unreal.py` is generated only with Developer Mode on). On first use, run+`dir(unreal.NiagaraComponent)` in the build log and fix any name that differs.++### 2.2 Placement snippet (goes into a `stage_fx()` in `build_level.py`)++```python+NS = {}+def fx_system(path):+ if path not in NS:+ NS[path] = unreal.load_asset(path)+ if NS[path] is None:+ warn(f"fx template missing: {path}")+ return NS[path]++def place_fx(eas, fx):+ sysasset = fx_system(fx["template"])+ if sysasset is None:+ return None+ q = fx["transform"]["quat"]+ act = eas.spawn_actor_from_class(unreal.NiagaraActor, V(fx["transform"]["loc"]),+ unreal.Quat(*q).rotator())+ act.set_actor_label("FX_" + fx["id"]); act.set_folder_path("FX")+ nc = act.get_editor_property("niagara_component")+ nc.set_asset(sysasset, True) # 1. asset first (resets overrides)+ for k, v in fx["params"].items(): # 2. typed user params+ t = fx["param_types"][k]+ if t == "float": nc.set_variable_float(k, float(v))+ elif t == "int": nc.set_variable_int(k, int(v))+ elif t == "bool": nc.set_variable_bool(k, bool(v))+ elif t == "vec3": nc.set_variable_vec3(k, V(v))+ elif t == "pos": nc.set_variable_position(k, V(v))+ elif t == "color": nc.set_variable_linear_color(k, unreal.LinearColor(*v[:3], v[3] if len(v) > 3 else 1))+ nc.set_random_seed_offset(fx["seed"]) # 3. determinism+ b = unreal.Box(); b.min = V(fx["bounds_local"]["min"]); b.max = V(fx["bounds_local"]["max"]); b.is_valid = True+ nc.set_system_fixed_bounds(b) # 4. bounds (local)+ nc.set_editor_property("override_warmup_settings", True) # 5. pre-roll+ nc.set_editor_property("warmup_tick_delta", 1.0 / 30.0)+ nc.set_editor_property("warmup_tick_count", int(math.ceil(fx["time"]["preroll_s"] * 30)))+ nc.set_allow_scalability(False)+ for k, t in fx["param_types"].items(): # 6. verify: silent no-ops are the main failure+ if t == "float":+ val, ok = nc.get_variable_float(k)+ if not ok: warn(f"{fx['id']}: user param {k} not on {fx['template']}")+ return act+```+Then call `les.save_current_level()`, as `stage_level` already does. Construct `unreal.Box` the way above, or with+keyword args. Check the result with `get_system_fixed_bounds()`.++### 2.3 Commandlet (`-run=pythonscript`) limits++- **Commandlets render nothing.** A commandlet uses the null RHI unless it is started with `-AllowCommandletRendering`+ (`LaunchEngineLoop.cpp:2246`) *[engine]*.+ - These need no RHI and work in the commandlet: placing actors, setting user parameters, fixed bounds, warm-up+ fields, seeds, and saving.+ - GPU emitters do not simulate there, and their compute shaders are not exercised.+ - Niagara VM script compilation is a DDC/ShaderCompileWorker job. It works from a commandlet, as cooking proves.+ Ship the templates **pre-compiled and saved** in the AnySceneFX plugin, so a fresh build only loads them.+- **The first render compiles shaders.** GPU sim shaders and particle material shaders compile on the first+ `-game -RenderOffscreen` run.+ - Pass `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Budget a one-off cold-DDC compile of about 2-5 minutes per new template set. Keep the DDC on persistent storage+ (`/data`) in the container.+- **Don't author Niagara graphs in the commandlet.** `UNiagaraSystemFactoryNew` exposes no Python properties.+ `EditorAssetLibrary.duplicate_asset()` works for "copy a template and tweak it", but tweaking stack inputs needs+ the NiagaraToolsets editor functions, which expect a full editor. Per-scene variation goes through user parameters,+ not new assets.+- **Plugins.** Niagara is on by default. If you use NiagaraFluids (Beta), NiagaraSimCaching or NiagaraMRQ, enable them+ in `AnySceneUE.uproject` (`"Plugins"`) **before** the build. Enabling a plugin mid-session needs a restart.++### 2.4 MRQ settings for particles (the `MRQ_Still` / `MRQ_Linear` configs in `stage_sequences`)++- `MoviePipelineAntiAliasingSetting`:+ - `engine_warm_up_count = 64`: game-thread ticks with no render; the cheap warm-up.+ - `render_warm_up_frames = True`: required for GPU particles, depth-buffer collision and GPU warm-up.+ - `use_camera_cut_for_warm_up = False`.+ - `temporal_sample_count = 8`: Niagara ticks once per temporal sub-sample, so the accumulation itself gives sprite+ motion blur.+ - Raise `engine_warm_up_count` to `ceil(max_lifetime_s x fps x 1.5)` when the scene's longest lifetime exceeds+ 64/24 s, for example slow steam with 6 s lifetimes.+- **Fixed timestep.** MRQ always steps the world at the sequence rate. Particle state is a pure function of frames+ since activation plus the seed, so the warm-up count must be identical between runs.+- **Pre-roll belongs in the asset or component.** Component warm-up (§2.2) runs on activation, before any MRQ frame.+ Use both component warm-up and MRQ engine warm-up: the first covers steady state, the second covers shader compile+ and streaming.+- `MoviePipelineGameOverrideSetting` (already added) forces cinematic scalability. Also call `set_allow_scalability(False)`+ on every component so Effect Type culling can't drop an effect.+- **Sequencer track (optional, for exact scrubbing).** Add a Niagara System track to the camera's level sequence,+ with a spawn section set to `SectionEvaluateBehavior = ActivateIfInactive` and+ `AgeUpdateMode = DesiredAgeNoSeek`. Age then follows sequence time instead of wall-clock ticks+ (`MovieSceneNiagaraSystemSpawnSection.h`) *[engine]*. Only do this if stills differ between runs.+- **NiagaraMRQ plugin.** It adds a data interface that tells a system whether MRQ is running, plus the temporal sample+ index and count. Use it only if a template must branch for offline quality, for example more particles under MRQ.++### 2.5 Light and screen flicker (not Niagara)++- **Flickering lights.** HK `wok_fire_*` uses a Python driver on `energy`.+ - Do not parse driver expressions. **Sample** the evaluated value per frame in the exporter: `frame_set(f)`, read+ `L.energy` for frames `[start, start+N)`.+ - Write `flicker.values` and key a Sequencer float track on the light's `intensity`, in the camera sequence.+ - Rendered through MRQ, this is deterministic and frame-exact.+- **CRT, screen and sign flicker.** Use a material, not Niagara.+ - Add `FlickerAmp`, `FlickerHz` and `ScanlineDensity` scalar parameters to `M_AnyBaked`'s emissive path, or to a+ dedicated `M_AnyScreen` master: emissive x (1 + amp x noise(time x Hz)), plus a rolling bar.+ - The source is `animated_materials` in the asset entry. Sample the emission strength curve the same way as lights.++### 2.6 When exact repeatability matters: sim caches++Capture the steady-state window once and assign it with `set_sim_cache`. Playback is then identical every run. Use+`capture_niagara_sim_cache_immediate` / `..._multi_frame` from `NiagaraSimCacheFunctionLibrary` in an editor session+with an RHI, or record with a Niagara Cache track in Sequencer (plugin `NiagaraSimCaching`). Only needed for hero+shots and A/B parameter tuning, where seed noise would hide a parameter change.++---++## 3. The template library (`/AnySceneFX/`)++Build these as a content plugin, `Plugins/AnySceneFX/Content/Systems/NS_*.uasset`, authored once and committed.++**Shared rules for every template.**+- `bDeterminism` on, at system and emitter level.+- Fixed bounds mode.+- World space, not local.+- Warm-up 0 in the asset. The converter sets it per instance.+- Every tunable is a `User.` parameter with a real-world default (cm, cm/s, s, nits, K).++**Common user parameters**, the same names in every system so the placement code stays generic:++| Name | Type | Meaning |+|---|---|---|+| `SpawnRate` | float | particles per second (or `Count` for bursts) |+| `LifetimeMin`, `LifetimeMax` | float | seconds |+| `SizeMin`, `SizeMax` | float | sprite size, cm |+| `Velocity` | vec3 | initial velocity, cm/s, world |+| `VelocityJitter` | float | 0..1 fraction (Blender `factor_random`) |+| `Wind` | vec3 | constant drift, cm/s |+| `Gravity` | float | 0..1 x 980 cm/s² |+| `BoxExtent` | vec3 | spawn box half-extent, cm (spawn shape = local box) |+| `Color` | color | albedo (lit) or emissive tint (unlit) |+| `Intensity` | float | emissive luminance multiplier, nits |+| `Opacity` | float | per-sprite peak alpha |+| `Temperature` | float | K, feeds a material `BlackBody` node (fire, embers) |+| `NoiseStrength`, `NoiseFreq` | float | curl-noise force amplitude and frequency |++The seed is not a parameter: it is the component's `RandomSeedOffset`.++**Starting assets that ship with 5.8.** These are mount paths. The engine plugin `/Niagara/` lives at+`Engine/Plugins/FX/Niagara/Content/`, and `/NiagaraFluids/` at `Engine/Plugins/FX/NiagaraFluids/Content/`.++- Emitters: `/Niagara/DefaultAssets/Templates/Emitters/{Fountain, HangingParticulates, RecycleParticlesInView,+ BlowingParticles, DirectionalBurst, OmnidirectionalBurst, SimpleSpriteBurst, SingleLoopingParticle, Minimal,+ UpwardMeshBurst, LocationBasedRibbon, StaticBeam, DynamicBeam, ConfettiBurst}`+- Systems: `/Niagara/DefaultAssets/Templates/Systems/{FountainLightweight, DirectionalBurst, RadialBurst,+ SimpleExplosion, MinimalLightweight, ...}`. The `*Lightweight` systems use stateless emitters, which the Niagara+ toolset cannot edit. Copy the stateful emitters instead.+- Behaviour examples (reference wiring): `/Niagara/DefaultAssets/Templates/BehaviorExamples/{SubUVAnimation,+ SpriteFacingAndAlignment, KillParticles, ...}`+- Fluids (Beta): `/NiagaraFluids/Templates/Gas/3D/Systems/{Grid3D_Gas_Fire, Grid3D_Gas_Smoke, Grid3D_Gas_ColoredFire,+ Grid3D_Gas_ColoredSmoke, Grid3D_MovingGridFire, Grid3D_Gas_Explosion}`, `.../Gas/2D/Systems/{Grid2D_Gas_SmokeFire,+ Grid2D_Gas_Smoke, Grid2D_Gas_MovingFire}`, `/NiagaraFluids/Templates/Liquid/3D/Systems/{Grid3D_Flip_Hose,+ Grid3D_Flip_Splash, Grid3D_Flip_Pool}`; materials `/NiagaraFluids/Materials/Grid3D/M_RayMarch_Fire*`,+ `MI_HeterogeneousVolumes_*`.+- Default sprite materials: `/Niagara/DefaultAssets/DefaultSpriteMaterial`, `M_DepthFade_SpriteSimple`.++**Units used in the mappings below.**+- Blender is metres, the exporter writes centimetres, and Blender axes map to Unreal as (x, -y, z).+- Volume density σ is extinction per metre. Volume emission strength *E* adds radiance per metre, so a slab of+ thickness *t* m that is optically thin glows at about *E·t* (Blender radiance units) = **683·E·t nits**. This is the+ same 683 lm/W the exporter uses for surfaces.+- **Sprite opacity from density.** For a plume of depth *L* (m) seen through *n* overlapping sprites, the target+ optical depth is τ = σ·L. Per-sprite α = 1 − exp(−τ/n). Estimate *n* ≈ SpawnRate × Lifetime × (sprite area ÷+ plume cross-section area).++### 3.1 Per-effect table++| Effect | AnySceneFX system, and how to start it | Key parameter mapping from Blender | Lighting | Real-time budget |+|---|---|---|---|---|+| **Fire / flames** (gas jets, wok, candles, braziers) | `NS_Fire`. Start from `SingleLoopingParticle` + `Fountain` (stateful copies). Two emitters: (a) a **SubUV flame** emitter with a flipbook **baked from the Blender flame volume** (§5.1), unlit additive, random start frame, `bSubImageBlend`; (b) a small blue-core emitter. Hero close-ups: `Grid3D_Gas_Fire` or an SVT (§5) | Domain box → `BoxExtent` and the emitter ring radius. Principled Volume `Emission Strength` x density-ramp peak x thickness → `Intensity` (683·E·t nits). `Emission Color` ramp at 0.6 → `Color`, or `Blackbody Intensity`/`Temperature` → `Temperature`. Flame height (density falloff z) → `Velocity.z` x Lifetime. Noise scroll rate (driver `frame*k`) → flipbook fps | Fire itself lights nothing. **Reuse the Blender practical lights** (`wok_fire_*`, `wok_blue_*` convert already) with the sampled flicker track (§2.5). If the scene has no light, add one CPU emitter with a Light renderer: one particle, `RadiusScale` ≈ flame height x 4, `bAffectsTranslucency` on. Cap: ≤ 4 Niagara lights per scene, ≤ 1 per fire | ≤ 40 sprites per flame, about 0.1 ms. Fluids fire: 1-3 ms at 64³; cinematic only |+| **Steam** (woks, pots, kettles, vents) | `NS_Steam`. Start from `Fountain`. GPU sprites, lit translucent (Volumetric NonDirectional), soft puff texture or a baked steam flipbook, curl noise, size grows x3-5 over life, alpha fades in and out. Add a second **Volume-domain sprite** emitter (§1) for the dense core when volumetric fog is on | Plume box (HK `steam_wok_i`: bottom z = wok rim, top = awning): base disc radius = 0.08 x box width → `BoxExtent`; `rise` (driver `-frame*rise`, m/frame) x fps x 100 → `Velocity.z`; `lean` → `Wind`. Lifetime = box height ÷ rise speed. Density `strength` x 9 (shader constant) = σ peak → `Opacity` by the formula above. `Color` 0.9 grey, anisotropy 0.5 → material phase (backlit glow: enable forward scatter in the material, or rely on volumetric fog) | Lit by scene lights. Needs the practical light behind it to read (HK hood strip, bulbs). `TranslucencyPass = BeforeDOF` for foreground plumes | 200-600 sprites per plume, 0.2-0.5 ms (overdraw-bound) |+| **Smoke** (cigarette curls, exhaust, chimneys) | `NS_Smoke` = `NS_Steam` with a darker albedo, slower rise and a longer life. Thin curls: a **ribbon** emitter (`LocationBasedRibbon`) with curl noise reads better than sprites | MC `smoke_curl_*`: box 0.18 x 0.18 x 0.75 m, noise scroll `-frame*0.012` → `Velocity.z` = 0.012 x fps x 100 cm/s; density 6 → ribbon width 0.5-1 cm, `Opacity` 0.3. Albedo (0.82, 0.8, 0.76) → `Color` | Lit translucent | ribbons: ≤ 3 per curl, negligible |+| **Haze plume / room haze** | Usually **not Niagara**. Homogeneous layers → Exponential Height Fog + Local Fog Volumes (§5.3). Moving plumes (street haze drifting under a light) → `NS_HazePlume`: a few big Volume-domain sprites (2-6 m) | Haze box σ → height fog density (existing code). Local plume: `RadialFogExtinction` = σ x diameter (m) (§0.2). Albedo, anisotropy → `fog_albedo`, `fog_phase_g`. Noise drift → `Wind` | Volumetric fog lighting only. Lights need `volumetric_scattering_intensity` > 0 (already mapped from Blender `visible_volume_scatter`) | LFV about 0.05 ms each; volume sprites 0.3 ms |+| **Rain / drizzle** | `NS_Rain`. Start from `RecycleParticlesInView` (keeps the rain around the camera) or a plain box-spawn GPU emitter. Velocity-aligned sprites (`Alignment = VelocityAligned`), streak length = speed x shutter, masked or translucent, `PixelCoverageMode` Automatic (sub-pixel streaks flicker under TSR otherwise) | Particle settings: `count`, `lifetime`, `frame_start/end` → `SpawnRate = count / (frame_end − frame_start) x fps`; `object_align_factor` (m/s) x 100 → `Velocity` (Blender (x,y,z) → (x,−y,z)); `factor_random` → `VelocityJitter`; emitter object box → `BoxExtent` + transform; instance-object radius x 2 → sprite width (≥ 0.15 cm, or it vanishes), length → streak length; drop material emission 0.5 / alpha 0.35 → `Intensity`, `Opacity` | Lit translucent or unlit with a faint emissive. Rain reads by **backlight**: check it against the street lights in the Cycles frames | GPU, 10k-40k alive, 0.3-0.8 ms |+| **Drips / splashes** | `NS_Drips`: GPU sprites spawned on a line (awning edge) under gravity, killed at the ground plane, plus an **event-free** splash: a second emitter spawned at the computed impact height with `DirectionalBurst`-style spray, or a splash flipbook. Ground ripples: decal flipbook or a puddle material, not particles | `awning_drips`: emitter box (thin strip) → spawn line; `count/span` → `SpawnRate`; `gravity` 1 → `Gravity` = 1; drop size → sprite size; ground z → `KillHeight` (extra user param) | Lit translucent drops; splash unlit-ish | ≤ 200 drops, ≤ 1k spray, about 0.1 ms |+| **Sparks / embers** | `NS_Sparks`: `Fountain` + velocity-aligned additive sprites, gravity, drag, short life. `NS_Embers`: slow buoyant glowing points with curl noise, long life | Particle `velocity`/`normal_factor` → `Velocity`; lifetime → Lifetime; emission colour or temperature → `Temperature` (material BlackBody) and `Intensity` = 683 x strength | Unlit additive; never a light per spark. One Light-renderer particle for a whole shower at most | ≤ 2k, 0.1-0.2 ms |+| **Dust motes** | `NS_DustMotes`: start from `HangingParticulates`. Tiny lit sprites, near-zero velocity, curl-noise drift; only visible inside light shafts, so lit translucent with a strong forward-scatter look | Blender dust particles: count over box volume → density per m³; `SpawnRate` keeps the alive count = count; size 0.05-0.2 cm; box → `BoxExtent` | Lit; needs a shaft light (spot or sun) in the frame | ≤ 3k, 0.1 ms |+| **Fountain water jets** | `NS_FountainJet`: start from `Fountain`, GPU, velocity-aligned stretched sprites + a mist emitter; for hero pools use `Grid3D_Flip_Hose` (Beta, expensive) | Nozzle object → position + direction; jet apex height *h* → `Velocity` = sqrt(2·980·h) cm/s along the nozzle; flow rate → `SpawnRate`; spread → `VelocityJitter` | Lit translucent with high specular-looking emissive edge; check against Cycles highlights | 5k-20k, 0.5 ms; FLIP 3-8 ms |+| **Screen / CRT / light flicker** | Material parameters + Sequencer tracks (§2.5). No Niagara | Sampled emission or energy curves | n/a | ~0 |++Fire, steam and smoke can borrow the **flipbook-from-Blender** path (§5.1). The look then comes from the exact Cycles+shader, and Niagara only supplies motion, variety and parallax.++### 3.2 Authoring the templates once++1. Use a full editor on a GPU box, with `NiagaraToolsets` + `ToolsetRegistry` enabled (Experimental).+2. Discover tool names with `unreal.ToolsetRegistry.get_all_toolset_json_schemas()`.+3. Per template:+ - `CreateNiagaraSystem` from an empty or minimal system;+ - `AddEmitter(<emitter template above>)`;+ - `AddUserVariables(...)`, using the shared parameter names;+ - `SetStackInputData` to link module inputs to the `User.` parameters;+ - `SetRendererData` for alignment, SubUV and sort settings;+ - `SetSystemData` for determinism and fixed bounds.+4. Then call `GetSystemCompileState` and `GetStackIssues`, and fix every error. Epic's own skill text says errors only+ surface once the system has compiled in the editor.+5. A human pass in the Niagara editor is fine as well. The contract is only the user-parameter list above.+6. Save, commit the plugin, and record each system's parameter list in `Plugins/AnySceneFX/templates.json`+ (`{"NS_Steam": {"SpawnRate": "float", ...}}`). The converter reads `param_types` from that file.++---++## 4. Detection rules and the `scene.json` `fx` schema++### 4.1 Classifying Blender effects (exporter side)++Walk every renderable object. A hit gets an `fx` entry and is **not** also exported as a mesh or an LFV, unless+§5 picks the LFV technique. Score each candidate type with the evidence below, take the highest score, and set+`confidence` = top score ÷ (top + runner-up).++| Evidence | Where | Points toward |+|---|---|---|+| Material is volume-only (`is_volume_only`) with `PRINCIPLED_VOLUME` | material | a volume type (steam / smoke / haze / fire) |+| Principled Volume `Emission Strength` > 0, or linked, or `Blackbody Intensity` > 0, or a `BLACKBODY` node, or a `VALTORGB` ramp into Emission Color with orange-to-blue stops | node tree | **fire** |+| Volume with emission 0, albedo > 0.85 grey, density driven by noise + a mapping driver on Z (`-frame*k`) | node tree + drivers | **steam** (k fast, under a hot object) or **smoke** (albedo < 0.85, or name) |+| Volume with no `TEX_NOISE` or a constant density, box > 3 m on its long axis | node tree + size | **haze** (→ fog, §5.3) |+| Volume with noise but drift ≤ 0.002 m/frame and large box | node tree | **haze plume** |+| `FLUID` modifier `DOMAIN`, `domain_type GAS`, cache in OPENVDB | modifier | steam / smoke / fire by `flow_type` of the FLOW objects (`SMOKE`, `FIRE`, `BOTH`) → prefer **SVT** (§5.2) |+| `FLUID` DOMAIN `LIQUID` | modifier | fountain or splash (mesh cache → Alembic or FLIP; flag it for agent review) |+| `VOLUME` object (VDB file) | object type | SVT direct import |+| `PARTICLE_SYSTEM` with `physics_type NEWTON`, `rotation_mode VEL`, velocity mostly −Z ≥ 3 m/s, small elongated instance | particle settings | **rain** |+| … same, slow (< 1 m/s) along −Z, `effector_weights.gravity` ≈ 1, emitter is a thin strip | particle settings | **drips** |+| particles with gravity, short life (< 1.5 s), emissive instance material | settings + material | **sparks** |+| particles with emissive instance, upward velocity, long life | | **embers** |+| particles with ~0 velocity, gravity 0, tiny instance, box emitter | | **dust motes** |+| particles from a small emitter with upward velocity cone, gravity 1, water-like instance (transmission or low roughness) | | **fountain** |+| `NODES` modifier whose tree contains `DISTRIBUTE_POINTS_IN_VOLUME`/`ON_FACES` + `INSTANCE_ON_POINTS` and a `SCENE_TIME` input driving `SET_POSITION` | geometry nodes | rain, dust or drips by the same velocity rules. Sample point positions at two frames to get the velocity |+| Material with drivers/keys on Emission Strength or Color, on a mesh that is a screen (prop name `screen`, `crt`, `monitor`, `tv`, `display`, `sign`) | `animated_materials` | **screen flicker** |+| Light with driver/action on `energy`/`color` | `light_entry.animated` | **light flicker** (sample the curve) |+| Object or material **name** contains a type word (`steam`, `vapor`, `smoke`, `curl`, `haze`, `fog`, `mist`, `flame`, `fire`, `ember`, `spark`, `rain`, `drizzle`, `drip`, `splash`, `dust`, `mote`, `fountain`, `jet`, `flicker`) | names | +2 to that type (tie-breaker, never sufficient alone) |++Also export, per entry:+- `bounds_ue`;+- the emitter shape (box, disc or line from the object's evaluated mesh bounds);+- `preroll_s` from `frame_start < 0` or the fluid `cache_frame_start`;+- the cameras whose frustum contains the bounds;+- the nearest light within 1 m (`light_link`), so fire never double-lights.++For procedural volumes, keep `sample_volume()` but take **8-16 slices**, not 4. Also measure the drift speed by+diffing the mapping-node location driver between two frames, and write the `params` directly.++### 4.2 Schema (JSON Schema 2020-12) for `scene.json → "fx"`++```json+{+ "$id": "anyscene/fx.schema.json",+ "type": "array",+ "items": {+ "type": "object",+ "required": ["id", "type", "confidence", "source", "transform", "bounds_ue", "technique", "params", "time", "seed"],+ "properties": {+ "id": {"type": "string", "pattern": "^[A-Za-z0-9_]+$"},+ "type": {"enum": ["fire", "steam", "smoke", "haze", "haze_plume", "rain", "drips", "splash", "sparks",+ "embers", "dust", "fountain", "screen_flicker", "light_flicker", "unknown"]},+ "confidence": {"type": "number", "minimum": 0, "maximum": 1},+ "source": {"type": "object", "required": ["kind", "objects"], "properties": {+ "kind": {"enum": ["volume_shader", "fluid_domain", "vdb", "particles", "geonodes",+ "animated_emission", "animated_light"]},+ "objects": {"type": "array", "items": {"type": "string"}},+ "material": {"type": ["string", "null"]},+ "evidence": {"type": "array", "items": {"type": "string"}}}},+ "transform": {"type": "object", "required": ["loc", "quat"], "properties": {+ "loc": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3},+ "quat": {"type": "array", "items": {"type": "number"}, "minItems": 4, "maxItems": 4},+ "scale": {"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3}}},+ "bounds_ue": {"type": "object", "required": ["center", "extent"], "properties": {+ "center": {"type": "array", "items": {"type": "number"}}, "extent": {"type": "array", "items": {"type": "number"}}}},+ "bounds_local": {"type": "object", "properties": {"min": {"type": "array"}, "max": {"type": "array"}}},+ "emitter_shape": {"type": "object", "properties": {+ "kind": {"enum": ["box", "disc", "ring", "line", "plane", "point", "mesh"]},+ "extent_cm": {"type": "array", "items": {"type": "number"}},+ "normal": {"type": "array", "items": {"type": "number"}}}},+ "technique": {"enum": ["niagara", "niagara_flipbook", "niagara_volume_sprite", "svt", "local_fog",+ "height_fog", "material", "sequencer_curve", "skip"]},+ "template": {"type": ["string", "null"], "description": "UE object path, e.g. /AnySceneFX/Systems/NS_Steam.NS_Steam"},+ "params": {"type": "object", "additionalProperties": {"type": ["number", "boolean", "array"]}},+ "param_types": {"type": "object", "additionalProperties": {"enum": ["float", "int", "bool", "vec3", "pos", "color"]}},+ "physical": {"type": "object", "description": "raw Blender-side measurements kept for the look-match pass",+ "properties": {+ "density_per_m": {"type": "number"}, "optical_depth": {"type": "number"},+ "albedo": {"type": "array"}, "anisotropy": {"type": "number"},+ "emission_nits": {"type": "number"}, "emission_color": {"type": "array"}, "temperature_k": {"type": "number"},+ "count": {"type": "integer"}, "lifetime_s": {"type": "array"}, "velocity_cm_s": {"type": "array"},+ "velocity_jitter": {"type": "number"}, "gravity": {"type": "number"}, "size_cm": {"type": "array"},+ "drift_cm_s": {"type": "array"}, "noise_scale_cm": {"type": "number"}}},+ "time": {"type": "object", "required": ["preroll_s", "fps"], "properties": {+ "preroll_s": {"type": "number", "minimum": 0}, "fps": {"type": "number"},+ "start_frame": {"type": "integer"}, "end_frame": {"type": "integer"}, "animated": {"type": "boolean"}}},+ "seed": {"type": "integer", "minimum": 0},+ "flicker": {"type": "object", "properties": {+ "target": {"type": "string"}, "property": {"enum": ["intensity", "emissive_scale", "color"]},+ "fps": {"type": "number"}, "values": {"type": "array", "items": {"type": "number"}}}},+ "flipbook": {"type": "object", "properties": {+ "texture": {"type": "string"}, "grid": {"type": "array"}, "fps": {"type": "number"}, "emissive": {"type": "boolean"}}},+ "vdb": {"type": "object", "properties": {"files": {"type": "string"}, "grids": {"type": "array"}}},+ "cameras": {"type": "array", "items": {"type": "string"}},+ "light_link": {"type": ["string", "null"]},+ "notes": {"type": "array", "items": {"type": "string"}}+ }+ }+}+```+- Units: positions are UE centimetres; velocities are cm/s in UE axes; `extent` is a half-extent in cm; `seed` =+ `crc32(id)`.+- **Ownership.** The exporter fills everything except `technique`, `template` and `params`. A deterministic step+ (`fx_plan.py`, using the decision table in §5.4) fills those three, and the agent may override them.+- `build_level.py` gets a `stage_fx` that dispatches on `technique`. Keep the old `volumes` map for backward+ compatibility, but skip any volume an `fx` entry claims.++---++## 5. Alternatives when Niagara is not the right tool++### 5.1 Flipbooks (SubUV) rendered from the Blender volume++**Best for:** fire, steam puffs and smoke at mid-distance. The look *is* the Cycles shader, with zero tuning of+Niagara colour or density.++How to bake, in a Blender job on the scene copy:+1. Isolate the volume object. Use a transparent film (`film_transparent`) and an orthographic camera fitted to the+ bounds, facing the hero camera's azimuth.+2. Use a black world, plus a neutral key light if the effect is lit (steam). Emissive flames need no light.+3. Render *N* = 64 frames at the scene fps from a steady-state frame. Crossfade the last 16 into the first 16 for a+ loop.+4. Tile 8x8 at 256-512 px per cell. Write RGBA as EXR, or PNG with premultiplied alpha.+5. Export twice for lit effects: an emissive-only pass, and an albedo/alpha pass.+6. Unreal side: `SubImageSize` (8,8) on the sprite renderer, plus a SubUV Animation module whose renderer input+ points at that renderer. Get all three of these right: the grid, the module, and the renderer binding. Any one+ wrong fails **silently**.++Use a flipbook when the camera stays within about 30° of the bake view. Beyond that, sprites rotate visibly; use two+or three bakes at different azimuths, or SVT.++### 5.2 Heterogeneous volumes from VDB (SVT)++**Best for:** hero steam, smoke or fire seen up close or from moving cameras. This is the real 3D density and is the+closest match to Cycles.++**Mantaflow domains.** `cache_data_format = OPENVDB` already writes `cache/data/fluid_data_####.vdb`. Re-save only+the `density`, `flame` and `temperature` grids, or the default mapping packs velocity components into attributes B.++**Procedural shader volumes** (HK steam, MC curls):+1. Sample the material on a 3D grid. Extend `sample_volume` to bake Z slices at 64-128 slices.+2. For animation, repeat per frame for 48-96 frames.+3. Write `.vdb` with Blender's bundled `openvdb` module: `openvdb.FloatGrid`, `copyFromArray`,+ `openvdb.write(path, grids)`.+4. Name the grids `density`, plus `emission` or `temperature`.++**Import into Unreal.**+- Use an `AssetImportTask` on the first file of the numbered sequence. In a commandlet the factory takes the+ unattended path and imports the sequence as an **animated SVT**.+- Optionally pass a `UOpenVDBImportOptionsObject` as `task.options` to control the grid mapping.+- The `InterchangeOpenVDB` plugin is disabled by default. The legacy SVT factory does not need it.++**Render.**+- Spawn `unreal.HeterogeneousVolume`. Its `heterogeneous_volume_component` takes a Volume-domain material that samples+ the SVT (start from `/NiagaraFluids/Materials/Grid3D/Instances/MI_HeterogeneousVolumes_Basic`).+- Animation fields on the component: `frame`, `frame_rate`, `start_frame`, `end_frame`, playing and looping.+- Lighting fields: `step_factor`, `shadow_step_factor`, `lighting_downsample_factor`.+- Map Blender density σ (1/m) to material extinction: σ ÷ 100 per cm, if the material works in world units. Calibrate+ once against a Cycles render of a test cube.++**Cvars.**+- `r.HeterogeneousVolumes 1` (default on).+- `r.HeterogeneousVolumes.Shadows 0` by default: turn it on for self-shadowing steam.+- `r.HeterogeneousVolumes.IndirectLighting 0` by default.+- `r.HeterogeneousVolumes.MaxStepCount 512`.+- `r.HeterogeneousVolumes.Composition 0`: draws before translucency. All *[engine: HeterogeneousVolumes.cpp]*.++**Cost.** Several ms per volume at 1440p. Fine for MRQ, too heavy for a real-time budget unless+`DownsampleFactor` = 2.++### 5.3 Fog for haze++- **Room or street haze** (homogeneous layers, or a large box with gentle noise): Exponential Height Fog plus+ volumetric fog, as `build_level.py` already does.+- **Local layers** (MC ceiling layer, under-awning haze): Local Fog Volumes. Fix §0.2 as follows.+ - Scale = (max box half-extent in cm) ÷ 500.+ - It is a sphere: a long flat box needs several LFVs tiled along its long axis, or height-fog mode+ (`height_fog_extinction`, `height_fog_falloff`, `height_fog_offset`).+ - `radial_fog_extinction` = σ x 2r (m), the optical depth through the centre.+ - `fog_emissive` is luminance: σ_e x 683 nits.+- **Never use an LFV for a flame or a plume.** It cannot move, and its shape is a sphere.++### 5.4 Decision table (per effect)++| Type | Default technique | Use instead when |+|---|---|---|+| fire | `niagara_flipbook` (NS_Fire, flame baked from Blender) | close-up hero, camera moves around it, long shot → `svt` (bake VDB 64 frames) or `Grid3D_Gas_Fire`; tiny candle → unlit sprite, no flipbook |+| steam | `niagara` (NS_Steam lit sprites) + volume-sprite core if volumetric fog is on | Mantaflow cache present, or a hero close-up → `svt`; distant/static → `niagara_flipbook` |+| smoke | curls → `niagara` ribbons; plumes → as steam | — |+| haze | `height_fog` / `local_fog` | visible moving wisps in a light beam → `niagara_volume_sprite` |+| haze_plume | `niagara_volume_sprite` | static in all shots → `local_fog` (fixed size rule) |+| rain | `niagara` (NS_Rain) | only seen through glass far away → material streaks on a card |+| drips / splash | `niagara` (NS_Drips) | ground ripples → animated decal / puddle material |+| sparks / embers | `niagara` | — |+| dust | `niagara` (NS_DustMotes) | — |+| fountain | `niagara` (NS_FountainJet) | Mantaflow liquid cache → Alembic mesh sequence (outside this doc; flag it) |+| screen_flicker / light_flicker | `material` / `sequencer_curve` | — |++---++## 6. Verification loop: did the effect land?++1. **Build.** Run `stage_fx` and save. The build report records, per effect: id, technique, template, user params+ read back (`get_variable_*` valid flags), and fixed bounds read back. Any invalid param is an error, not a warning.+2. **Render.**+ - Render MRQ stills from **every camera in the effect's `cameras`**:+ `render_mrq.ps1 -Cams ...`, with `-dpcvars=Editor.AsyncAssetCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1`.+ - Use the **same frame number** as the Cycles still: the exporter's `--frame`, minus the sequence start.+ - For motion, render 24-frame clips of the effect cameras (`custom_end_frame = 24`).+ - Render twice with identical settings to check determinism: the two images' absolute difference should be ~0+ outside the TSR noise floor.+3. **Compare against Cycles.**+ - Use `side_by_side.py`. Compare in the same view transform: use `MRQ_Linear` EXR + Blender AgX, as the pipeline+ already does.+ - For each effect, crop its projected `bounds_ue` box in both images, then compare:+ - **coverage**: the fraction of crop pixels changed vs a render with the effect hidden; render one "FX off"+ still per camera;+ - **mean luminance** and the **99th-percentile luminance** inside the crop, for emissive effects;+ - **contrast and transmission**: background visibility through steam or haze;+ - hue of emissive effects;+ - for rain, streak count, length and angle.+4. **What to look for.**+ - The effect missing entirely: compile, bounds culling, wrong asset, or warm-up.+ - Popping-in in clips: warm-up too short.+ - A box-shaped cut-off: fixed bounds too small.+ - Sharp steam in a blurred foreground: the TranslucencyPass.+ - Black or flat steam: unlit, or no light behind it.+ - Fire that lights nothing, or double lighting: `light_link`.+ - Rain invisible: sprite under a pixel, so check the `PixelCoverageMode` and the width floor.+ - Stepping between frames: the age mode.+ - A sphere-shaped haze blob: the LFV rule.+5. **Adjustment rules.** Change one parameter per round, at most three rounds per effect, and log each round in the+ build report.+ - Coverage too low → raise `SizeMax` first (x1.3), then `SpawnRate` (x1.5). Too high → the reverse order.+ - Too opaque or too faint at matched coverage → scale `Opacity` by `ln(1−T_cycles)/ln(1−T_ue)` (T =+ transmission).+ - Emissive brightness → scale `Intensity` by `L99_cycles / L99_ue`, clamped to x[0.25, 4] per round.+ - Wrong height or reach → `LifetimeMax` (plumes) or `Velocity.z`; keep `Velocity x Lifetime` = the measured Cycles+ reach.+ - Wrong lean → `Wind`.+ - Rain too dense or sparse → `SpawnRate` by the streak-count ratio; streaks too short → the stretch factor+ (speed x shutter), not velocity.+ - After three rounds without converging, switch technique (§5.4 "use instead") and note why in `notes`.++---++## 7. Known gotchas (with sources)++| Gotcha | Fix | Source |+|---|---|---|+| GPU particles absent or frozen in MRQ warm-up | `render_warm_up_frames = True`; engine warm-up alone doesn't run GPU sims | `MoviePipelineAntiAliasingSetting.h` tooltip *[engine]*; Epic MRQ docs |+| `engine_warm_up_count` ignored | `use_camera_cut_for_warm_up = False` (it's EditCondition-gated) | same header |+| Effect missing on the first frames of an offscreen run | `fx.Niagara.ForceWaitForCompilationOnActivate=1` + `Editor.AsyncAssetCompilation=0` | `NiagaraComponent.cpp:112, 1358` *[engine]*; `render_shots.py` notes |+| Nothing renders or compiles in `-run=pythonscript` | expected: null RHI unless `-AllowCommandletRendering`; render in the `-game` pass | `LaunchEngineLoop.cpp:2246` *[engine]* |+| User param silently ignored | exact name + exact type; read back with `get_variable_*` and check the valid flag; set the asset before params (`set_asset` resets overrides) | `NiagaraComponent.cpp:4376, 4620` *[engine]*; NiagaraToolsets `blueprint_interop` skill |+| Effect culled when its origin leaves the view | fixed bounds covering the whole travel; GPU emitters can't use dynamic bounds | `NiagaraSystem.h:1052`; NiagaraToolsets `optimization` skill |+| Effect dropped at distance or by budget | `set_allow_scalability(False)`; `MoviePipelineGameOverrideSetting` | `NiagaraComponent.h` *[engine]* |+| Different particles every run | system + emitter `bDeterminism`, a fixed `RandomSeedOffset`, fixed MRQ warm-up; sim cache for bit-exact results | `NiagaraSystem.h:1073-1085` *[engine]* |+| Translucent FX sharp in defocused areas | material `TranslucencyPass = MTP_BeforeDOF` (default is AfterDOF) | `Material.h:142`, `Material.cpp:1183` *[engine]* |+| Sprite motion blur smears or vanishes | rely on MRQ temporal samples (8); renderer `MotionVectorSetting` Precise for fast sparks, Disable for steam; post-process motion blur is off in the converter (`motion_blur_amount 0`) | `NiagaraRendererProperties.h:480` *[engine]* |+| Thin rain or sparks flicker or disappear under TSR | `PixelCoverageMode` Automatic (project setting enabled) and a width floor; velocity-aligned streaks | `NiagaraSpriteRendererProperties.h` *[engine]* |+| Fire doesn't light the set; Lumen ignores emissive sprites | real lights (Blender practicals or one Light-renderer particle); Niagara lights are CPU-only and shadowless unless MegaLights (`bAllowMegaLights`, `bMegaLightsCastShadows`) | `NiagaraLightRendererProperties.h:62-110` *[engine]*; NiagaraToolsets `renderers` skill |+| Particle lights invisible in fog | light needs volumetric scattering intensity > 0 | *[docs: Volumetric Fog]* |+| Lit translucency looks flat or blotchy | it's the translucency lighting volume; use Volumetric NonDirectional, keep sprites large and soft | Lumen translucency behaviour *[docs]* |+| SubUV shows the whole atlas | renderer `SubImageSize` + a SubUV module + its renderer binding | NiagaraToolsets `renderers` skill |+| Local fog volume 5x too big / spherical | base radius 500 cm; uniform max-axis scale; extinction = optical depth through the centre | `LocalFogVolumeComponent.h:74`, `LocalFogVolumeCommon.ush:178-203` *[engine]* |+| VDB import pops a dialog | not in a commandlet or with automated tasks; numbered files become an animated SVT | `SparseVolumeTextureFactory.cpp:436` *[engine]* |+| Blender motion blur on volumes | irrelevant in UE, but the Cycles reference frames have no volume blur (object blur off on volume boxes); don't add any in UE either | HK `fx.py`, `SKILL.md` §11 |++**Sources.**+- Installed engine files:+ - `Engine/Plugins/FX/Niagara/Source/Niagara/{Public/NiagaraComponent.h, Public/NiagaraActor.h,+ Public/NiagaraFunctionLibrary.h, Classes/NiagaraSystem.h, Classes/NiagaraEmitter.h,+ Public/NiagaraLightRendererProperties.h, Public/NiagaraSpriteRendererProperties.h, Public/NiagaraCommon.h,+ Public/MovieScene/MovieSceneNiagaraSystemSpawnSection.h, Classes/NiagaraSimCacheFunctionLibrary.h,+ Private/NiagaraComponent.cpp, Private/NiagaraSystemInstance.cpp}`+ - `Engine/Plugins/FX/{NiagaraFluids, NiagaraMRQ, NiagaraSimCaching}`+ - `Engine/Plugins/Experimental/Toolsets/NiagaraToolsets` (tools + `Content/Python/skills`)+ - `Engine/Plugins/Experimental/ToolsetRegistry`+ - `Engine/Plugins/MovieScene/MovieRenderPipeline/.../MoviePipelineAntiAliasingSetting.h`+ - `Engine/Source/Runtime/Engine/Classes/Components/{HeterogeneousVolumeComponent.h, LocalFogVolumeComponent.h}`+ - `Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp`+ - `Engine/Shaders/Private/LocalFogVolumes/LocalFogVolumeCommon.ush`+ - `Engine/Source/Editor/SparseVolumeTexture/Private/SparseVolumeTextureFactory.cpp`+ - `Engine/Source/Runtime/Engine/Public/Materials/Material.h`+ - `Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp`+- Epic docs:+ - [Volumetric Fog](https://dev.epicgames.com/documentation/en-us/unreal-engine/volumetric-fog-in-unreal-engine)+ - [Rendering your Niagara systems (MRQ)](https://dev.epicgames.com/documentation/unreal-engine/rendering-your-niagara-systems)+ - [NiagaraMRQ API](https://dev.epicgames.com/documentation/unreal-engine/API/PluginIndex/NiagaraMRQ)+ - [MoviePipelineAntiAliasingSetting (Python API)](https://api.unrealengine.com/INT/PythonAPI/class/MoviePipelineAntiAliasingSetting.html)+- AnyScene:+ - `scenes/hk-dai-pai-dong/scripts/{fx.py, lights.py, steam.py}`, `NOTES.md`+ - `scenes/mission-control-1970s/scripts/haze.py`+ - `SKILL.md` §11, `builder/CRAFT.md`diff --git a/unreal_ramen/TOGGLE.md b/unreal_ramen/TOGGLE.mdnew file mode 100644index 0000000..ccde400--- /dev/null+++ b/unreal_ramen/TOGGLE.md@@ -0,0 +1,155 @@+# TOGGLE.md: an `unreal` option on `/ref2scene`, and `/scene2unreal`++Design note. Nothing here is implemented yet. It builds on `unreal/export_blend.py`, `unreal/build_level.py`,+`unreal/render_mrq.ps1`, `unreal/perf.ps1` and `unreal/NIAGARA.md`, and on `builder/app.py`+(`SceneBuilderApp`, `BuildRequest`, `_build_and_shoot`).++## 1. API++### 1a. Toggle on `/ref2scene` (and its `/build` alias)++Add one optional field to `BuildRequest`. Like `shots`, it stays **out of the build fingerprint** (`fp` in `_build`),+so one Blender build serves any number of Unreal conversions.++```python+class UnrealOptions(BaseModel):+ enabled: bool = Field(True, description="Convert the passed build into an Unreal 5.8 level.")+ cameras: list[str] = Field(default_factory=list, description="Cameras to render MRQ stills from (default: every scouting camera in shots.json).")+ fx: bool = Field(True, description="Port effects (flames, steam, rain, ...) per NIAGARA.md. False: static fog only.")+ look_match_rounds: int = Field(2, description="Agent look-match passes against the Cycles frames (0 = deterministic conversion only).")+ package: str = Field("plugin", description="plugin: a UE content plugin zip (drop into any 5.8 project). uproject: a full project zip. both.")+ still_res: list[int] = Field([1920, 1080], description="MRQ still resolution (W, H).")+ clip_frames: int = Field(0, description="Also render N-frame MRQ clips per camera (0 = stills only).")+ perf: bool = Field(True, description="Run the real-time perf capture (CSV profiler, GPU memory) at perf_res.")+ perf_res: list[int] = Field([2560, 1440])+ gpu_budget_ms: float = Field(16.6, description="Real-time frame budget the perf report grades against.")++class BuildRequest(BaseModel):+ ...+ unreal: UnrealOptions | None = Field(None, description="Optional: once the build passes its critic, convert it to Unreal.")+```++Add to `BuildResponse`: `unreal_job: dict | None`, holding status, `request_id` and an error if any, with the same+shape as `shots_job`. Add `unreal: UnrealResult | None` (§3).++### 1b. Standalone `/scene2unreal`++`SceneUnrealRequest = {build_id: str, **UnrealOptions, fresh: bool = False, effort: str = "medium"}`.+- It runs on any finished build in `/data/anyscene/builder/<build_id>`.+- It is retry-safe the same way `_build` is: an index keyed by `sha256(build_id + options)` and an `.alive`+ heartbeat.+- `/ref2scene` with `unreal` set calls it **after** `_build`, exactly like `_anyshot`.+- Run it as a **separate fal app** (`anyscene-unreal`) on a UE container. The builder image stays Blender-only, and+ the UE image (about 40 GB with DDC) only starts when someone asks for Unreal. The builder forwards the order with+ `fal_client` and relays the stage lines, as `call_anyshot` does.++## 2. What runs after the critic passes++The gate is the same as for shots: `res.critiques[-1]["passed"] and res.scene_blend_url`.++| # | Stage | Where | Deterministic? |+|---|---|---|---|+| 1 | **Export**: `blender -b <copy> --python export_blend.py -- --out exp/ --gpu --grade-sh ... --frame <hero frame>`, sharded (§5), then a merge pass writes `scene.json` incl. `fx` (NIAGARA.md §4) and the flipbook / VDB bakes the FX plan asks for | builder GPU worker (has Blender + OptiX cache) or the UE worker if Blender is installed there | yes |+| 2 | **FX plan**: `fx_plan.py` fills `technique / template / params` per `fx` entry from the NIAGARA.md decision table | either | yes (rules); entries with `confidence < 0.6` are queued for the agent |+| 3 | **UE build**: `UnrealEditor-Cmd AnySceneUE.uproject -run=pythonscript -script=build_level.py` (stages textures, meshes, materials, level, fx, sequences) on a **Linux GPU container** with the AnySceneFX plugin preinstalled and a persistent DDC on `/data` | UE worker | yes |+| 4 | **Shader warm**: one `-game -RenderOffscreen` run of the level with `fx.Niagara.ForceWaitForCompilationOnActivate=1` and `Editor.AsyncAssetCompilation=0` to fill the DDC (skipped when DDC is warm) | UE worker | yes |+| 5 | **MRQ stills** per camera (`MRQ_Still` + `MRQ_Linear`), plus clips if requested | UE worker | yes, given a fixed seed and warm-up |+| 6 | **Look-match pass** (agent): compare against the Cycles stills (`side_by_side.py`, crops per `fx` bounds, exposure, fog), adjust **parameters only** (exposure offset, fog density, FX user params, light scale) with the NIAGARA.md §6 rules, rebuild only the `level`/`fx` stages, re-render; `look_match_rounds` times | UE worker + Claude | agent-judged, logged as a param diff |+| 7 | **Perf**: `perf.ps1`-equivalent `-game -RenderOffscreen` with `csvprofile`, `nvidia-smi` sampling | UE worker | measured |+| 8 | **Package**: `Plugins/AnyScene_<build>/Content/...` (+ `.uplugin`) zip; optionally the whole `.uproject` minus `Intermediate/`, `Saved/`, `DerivedDataCache/` | UE worker | yes |++**Linux notes.**+- The Linux editor renders through Vulkan (SM6). `-RenderOffscreen` works without a display. Install the Vulkan ICD+ from the NVIDIA container toolkit (`NVIDIA_DRIVER_CAPABILITIES=all`, as the builder Dockerfile already sets).+- Lumen with hardware ray tracing on Vulkan needs a recent driver. Fall back to `r.Lumen.HardwareRayTracing 0` and+ record which mode the render used.+- Swap the Windows `.ps1` wrappers for Python `subprocess` callers. `render_mrq.ps1` and `perf.ps1` are thin.+- Validate on Linux once against the Windows reference box before trusting look-match numbers. Vulkan vs D3D12+ shading differences are small but non-zero. *[untested]*++## 3. Outputs (`UnrealResult`)++```json+{+ "package_url": "...AnyScene_b_xxxx_plugin.zip",+ "uproject_url": "... (optional)",+ "stills": [{"camera": "cam_street", "ue": "...png", "ue_linear": "...exr", "cycles": "...png", "side_by_side": "...png"}],+ "clips": [],+ "look_match": {"rounds": 2, "changes": [{"round": 1, "target": "fx:steam_wok_0", "param": "Opacity", "from": 0.12, "to": 0.18, "why": "transmission 0.71 vs 0.58"}]},+ "fx": [{"id": "steam_wok_0", "type": "steam", "technique": "niagara", "template": "/AnySceneFX/Systems/NS_Steam", "status": "ok"}],+ "perf": {"res": [2560, 1440], "gpu_ms_p50": 0, "gpu_ms_p95": 0, "frame_ms_p95": 0, "gpu_mem_delta_mb": 0, "draw_calls": 0, "verdict": "within budget|over budget"},+ "build_report": "...build_report.json",+ "warnings": [],+ "minutes": {"export": 0, "ue_build": 0, "mrq": 0, "look_match": 0, "total": 0}+}+```++## 4. Time and cost (from the HK run: 627 meshes)++| Stage | HK today (serial) | With §5 sharding | Notes |+|---|---|---|---|+| Blender export (bake + GLB) | ~35 min | ~6-9 min | about 3.3 s per unique mesh; scales with unique meshes, not instances |+| FX bakes (flipbooks / VDB) | n/a | +2-6 min | only for `niagara_flipbook` / `svt` entries; runs in parallel with the mesh shards |+| UE build (import + level) | ~15 min | ~10-15 min | import-bound; Interchange is already batched by 16; FX stage adds < 1 min |+| Shader warm (cold DDC) | ~3-5 min | 0-5 min | ~0 once `/data` DDC is warm for the templates and master materials |+| MRQ stills | ~1 min/still | ~1 min/still | 3 cameras x (1 + rounds) with rounds = 2 → 9 stills ≈ 9 min (or ~45 s each when batched in one process instead of one per camera) |+| Look-match agent | n/a | ~3-5 min/round of thinking + rebuild (`level,fx` stages ≈ 1-2 min) | |+| Perf capture | n/a | ~2 min | 900 frames + startup |+| **Total** | **~55 min + stills** | **~30-40 min** | |++**Cost** = GPU-minutes x the fal machine rate, plus agent tokens.+- GPU time is about 35 GPU-minutes on the parallel path.+- The export shards are CPU-heavy. Bakes can use `--gpu` (OptiX) on the builder's own GPU. Run the export on the+ builder worker that already holds the scene, and hand only `exp/` (GLBs + PNGs, roughly 1-3 GB for HK) to the UE+ app through `/data`.+- Agent tokens apply only to look-match rounds and to low-confidence FX entries: roughly one Claude session of about+ 15-30 tool calls per round.+- With `look_match_rounds = 0` the job is purely deterministic and costs only GPU time.++## 5. Parallelizing the slow export++The export is embarrassingly parallel per unique mesh. Bakes are independent, and existing outputs are skipped+(rerunnable).++1. **Plan pass.** One quick Blender process classifies the objects and writes `export_plan.json`: the list of asset+ keys with estimated bake pixels (area x density). It does no baking.+2. **Shards.** Run *N* Blender processes on copies of the `.blend`, each started with `--shard i/N`. This is a new+ flag: keep `keys[k]` where `k % N == i`, after sorting by estimated cost and dealing round-robin, so shards+ balance. Each shard bakes into the shared `tex/` and `mesh/` directories.+ - Today's `--reverse` and `--only` already show that two processes can share the folder safely.+ - Pick *N* = min(CPU cores ÷ 4, 8) for CPU bakes. With `--gpu`, run 2-3 processes per GPU, since OptiX bakes are+ short and the time goes into Blender overhead.+3. **Merge pass.** One process with `--no-bake`. Every texture and GLB already exists, so it only writes+ `scene.json`, lights, cameras, world, grade and `fx`. This also removes the partial-`scene.json` merge+ (`ONLY`/`LIMIT` branch) from the hot path.+4. **Cache across builds.** Key `tex/` and `mesh/` by a hash of (evaluated mesh data + material node trees + bake+ settings). The same prop library recurs across scenes, and a retry of `/scene2unreal` re-bakes nothing.+5. **FX bakes** (flipbook renders, VDB sampling) are extra shards, scheduled first because they are the longest+ single jobs.++The UE side can overlap with the export. Start texture import of finished shards while the others are still baking:+the `textures` stage is rerunnable and skips assets that exist. Mesh import order does not matter.++## 6. Deterministic vs agent-judged++**Deterministic.** Same input gives the same output, so these steps are cacheable and testable.+- Everything in `export_blend.py`, and the fx classification scores.+- `fx_plan.py` technique and parameter mapping (NIAGARA.md §3-5).+- `build_level.py`.+- Seeds: `RandomSeedOffset = crc32(fx id)`.+- Warm-up counts.+- MRQ settings.+- Packaging.+- Perf numbers (measured, so noisy within ±5%).++**Agent-judged.** Logged as explicit parameter diffs, bounded by `look_match_rounds`.+- Low-confidence fx classification (< 0.6), including `unknown` entries.+- Switching technique when a parameter-only match fails after three rounds (NIAGARA.md §6.5).+- Exposure and fog calibration offsets.+- FX user-parameter tuning.+- Light scale tweaks.+- The final "does it read like the Cycles frame" verdict, which goes into the response next to the side-by-sides.++**Rule.** The agent never edits `build_level.py`, `export_blend.py` or templates during a job. It writes overrides to+`exp/overrides.json`, which `build_level.py` applies on top of `scene.json`. A rerun with the same overrides+reproduces the agent's result exactly.diff --git a/unreal_ramen/_orig/agx_view.py b/unreal_ramen/_orig/agx_view.pynew file mode 100644index 0000000..870bf9e--- /dev/null+++ b/unreal_ramen/_orig/agx_view.py@@ -0,0 +1,19 @@+"""Apply a Blender view transform (default AgX + the scene's look) to Unreal scene-linear EXRs (MRQ_Linear output),+so UE and Cycles frames can be compared through the same tone mapper.+ blender -b --factory-startup --python agx_view.py -- <in.exr> <out.png> [look] [exposure]+"""+import sys+import bpy++a = sys.argv[sys.argv.index("--") + 1:]+src, dst = a[0], a[1]+look = a[2] if len(a) > 2 else "AgX - Medium High Contrast"+expo = float(a[3]) if len(a) > 3 else 0.0+sc = bpy.context.scene+sc.view_settings.view_transform = "AgX"+sc.view_settings.look = look+sc.view_settings.exposure = expo+sc.render.image_settings.file_format = "PNG"+img = bpy.data.images.load(src)+img.save_render(dst, scene=sc)+print("AGX", src, "->", dst, flush=True)diff --git a/unreal_ramen/_orig/build_level.py b/unreal_ramen/_orig/build_level.pynew file mode 100644index 0000000..66897bb--- /dev/null+++ b/unreal_ramen/_orig/build_level.py@@ -0,0 +1,671 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,sequences (default: all)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % 16 == 15 or i == len(todo) - 1:+ flush(a)+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked():+ path = f"{DEST}/Materials/M_AnyBaked"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyBaked", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_glass():+ path = f"{DEST}/Materials/M_AnyGlass"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGlass", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ c = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, -500, 0)+ c.set_editor_property("parameter_name", "Color")+ c.set_editor_property("default_value", unreal.LinearColor(1, 1, 1, 1))+ r = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 200)+ r.set_editor_property("parameter_name", "Roughness")+ r.set_editor_property("default_value", 0.05)+ o = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 350)+ o.set_editor_property("parameter_name", "Opacity")+ o.set_editor_property("default_value", 0.25)+ MEL.connect_material_property(c, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], baked)+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ c = g["color"]+ MEL.set_material_instance_vector_parameter_value(gm, "Color", unreal.LinearColor(c[0], c[1], c[2], 1))+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ n = sm.get_num_sections(0)+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0]:+ continue+ b = v["bounds_ue"]+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(b["center"]), unreal.Rotator(0, 0, 0))+ lf.set_actor_label("LFV_" + name)+ lf.set_folder_path("Volumes")+ # Local fog volumes are unit spheres of radius 100 cm at scale 1 (assumed); scale to the box.+ lf.set_actor_scale3d(unreal.Vector(b["extent"][0] / 100, b["extent"][1] / 100, b["extent"][2] / 100))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"])+ emit = max(v["emission"])+ lc.set_editor_property("radial_fog_extinction", dens)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ lc.set_editor_property("radial_fog_extinction", 1.0)+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * emit, ec[1] * emit, ec[2] * emit, 1))+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", min(1.0, ff["vignette_angle_rad"] / (math.pi / 4) * 0.45))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+ hero = next((c for c in scene["cameras"] if c["name"] == "cam_street"), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(48)+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, 48)+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ EAL.save_loaded_asset(seq, False)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = scene["grade"].get("resolution", [1920, 804])+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.path.join(EXPORT, "..", "compare", "mrq").replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = True+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = 64+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal_ramen/_orig/csv_summary.sh b/unreal_ramen/_orig/csv_summary.shnew file mode 100644index 0000000..1a3f187--- /dev/null+++ b/unreal_ramen/_orig/csv_summary.sh@@ -0,0 +1,16 @@+#!/usr/bin/env bash+# Summarise an Unreal CSV profile: mean / p50 / p95 of frame, game, render, RHI and GPU time plus the top GPU passes.+# bash csv_summary.sh <Profile(...).csv> [skip_first_frames=60]+f="$1"; skip="${2:-60}"+awk -F, -v skip="$skip" '+NR==1 { for (i=1;i<=NF;i++) col[$i]=i; next }+$1 ~ /^\[/ || NF < 10 { next }+{ n++; if (n<=skip) next; m+++ for (k in col) if (k=="FrameTime"||k=="GameThreadTime"||k=="RenderThreadTime"||k=="RHIThreadTime"||k=="GPUTime"||k ~ /^GPU\//) { v=$(col[k])+0; s[k]+=v; a[k,m]=v } }+END {+ printf "frames=%d (after skipping %d)\n", m, skip+ split("FrameTime GameThreadTime RenderThreadTime RHIThreadTime GPUTime", ks, " ")+ for (j=1;j<=5;j++) { k=ks[j]; c=0; for (i=1;i<=m;i++) t[++c]=a[k,i]; asort(t); printf "%-17s mean %6.2f ms p50 %6.2f p95 %6.2f\n", k, s[k]/m, t[int(c*0.5)], t[int(c*0.95)]; delete t }+ printf "fps(mean frame) %.1f\n", 1000/(s["FrameTime"]/m)+ for (k in s) if (k ~ /^GPU\//) printf "%8.3f %s\n", s[k]/m, k | "sort -rn | head -12"+}' "$f"diff --git a/unreal_ramen/_orig/export.sh b/unreal_ramen/_orig/export.shnew file mode 100644index 0000000..92e1f3f--- /dev/null+++ b/unreal_ramen/_orig/export.sh@@ -0,0 +1,23 @@+#!/usr/bin/env bash+# export_blend.py through the GPU queue, resumed until it finishes. Blender 5.0.1 Cycles bake crashes intermittently+# (EXCEPTION_ACCESS_VIOLATION in OpenImageIO ustring::operator= under ccl::create_mesh, ~1 per 250 bakes, a different+# asset each time); the exporter skips assets whose GLB/texture already exist, so a rerun resumes where it died.+# bash unreal/export.sh <copy.blend> <out_dir> [export_blend.py args...] (log: <out_dir>/export.log)+# EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py"+A="$(cd "$(dirname "$0")/.." && pwd)"+. "$A/pipeline/env.sh"+blend="$1"; out="$2"; shift 2+mkdir -p "$out"+: > "$out/export.log"+pre=()+[ -n "$EXPORT_PRE" ] && pre=(--python "$EXPORT_PRE")+for i in $(seq 1 "${EXPORT_TRIES:-6}"); do+ bash "$A/pipeline/gpu_run.sh" "$BLENDER" -b "$blend" "${pre[@]}" --python "$A/unreal/export_blend.py" -- --out "$out" "$@" \+ >> "$out/export.log" 2>&1+ rc=$?+ if grep -q "^EXPORT wrote" "$out/export.log"; then echo "export: done after $i run(s)"; exit 0; fi+ # rc 0 without "wrote" is a Python exception (Blender exits 0 on those): retrying will not help.+ [ "$rc" = 0 ] && { echo "export: python error, see $out/export.log"; exit 1; }+ echo "export: run $i exited rc=$rc without finishing; resuming" | tee -a "$out/export.log"+done+echo "export: gave up after ${EXPORT_TRIES:-6} runs"; exit 1diff --git a/unreal_ramen/_orig/export_blend.py b/unreal_ramen/_orig/export_blend.pynew file mode 100644index 0000000..89ff833--- /dev/null+++ b/unreal_ramen/_orig/export_blend.py@@ -0,0 +1,1023 @@+"""AnyScene -> Unreal export: bake every surface material to PBR textures, export one GLB per unique mesh, and write+scene.json (placements, lights, cameras, world, volumes, grade) in Unreal units and axes.++ blender -b <COPY of scene.blend> --python export_blend.py -- --out <dir> [--frame 60] [--only a,b] [--limit N]+ [--density 1024] [--max-res 4096] [--grade-sh scenes/<id>/scripts/grade.sh] [--ffmpeg path]+ [--dof '{"cam_street": [9.5, 2.8]}'] [--no-bake] [--cpu-threads 0]++Never saves the .blend (it modifies the open file in memory: new UV layers, converted text/curves). Rerunnable:+textures and GLBs that already exist are skipped (delete <out>/tex/<asset>_* or <out>/mesh/<asset>.glb to redo one).++Conventions written to scene.json+ * Space: Unreal (cm, X forward, Y right, Z up, left-handed). Blender (x, y, z) m -> Unreal (x, -y, z) * 100.+ Object transforms are S*M*S with S = diag(1,-1,1), given as location, quaternion (x,y,z,w) and scale.+ * Mesh GLBs are exported in object-local space at identity; the Unreal importer maps glTF to its own axes, so+ build_level.py checks the result against "check_bounds" for the first assets.+ * Photometry: 683 lm/W. Point/spot cd = 683 * P / (4 pi); area cd = 683 * P / pi; sun lux = 683 * S;+ emissive nits = 683 * strength; sky radiance x 683. Exposure: Blender pixel = L_b * 2^exposure, so the Unreal+ manual exposure is EV100 = log2(683 / 1.2) - exposure (written as grade.ev100).+ * Bake: every surface material (procedural or not) is baked per unique mesh into one texture set on a bake UV:+ BaseColor (sRGB png), ORM (R=1, G=roughness, B=metallic, linear png), Normal (tangent, OpenGL +Y, png, only if a+ material perturbs the normal), Emissive (sRGB png + scale, only if emissive). Glass slots (transmission > 0.5)+ are not baked: they keep their own material slot and parameters.+"""+import bmesh # noqa: F401 (kept for hand edits)+import json+import math+import os+import re+import subprocess+import sys+import time++import bpy+import numpy as np+from mathutils import Matrix, Vector++LM_PER_W = 683.0+argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+++def arg(name, default=None):+ return argv[argv.index(name) + 1] if name in argv else default+++OUT = os.path.abspath(arg("--out", "unreal_export"))+FRAME = int(arg("--frame", "60"))+ONLY = set(x for x in arg("--only", "").split(",") if x)+LIMIT = int(arg("--limit", "0"))+DENSITY = float(arg("--density", "1024")) # bake px per metre of sqrt(surface area)+MAX_RES = int(arg("--max-res", "4096"))+NO_BAKE = "--no-bake" in argv+DOF = json.loads(arg("--dof", "{}"))+GRADE_SH = arg("--grade-sh")+FFMPEG = arg("--ffmpeg", os.environ.get("FFMPEG", "ffmpeg")) # pipeline/env.sh exports FFMPEG (ffmpeg is not on PATH here)+THREADS = int(arg("--cpu-threads", "0"))+GPU = "--gpu" in argv # bake with OptiX (run through pipeline/gpu_run.sh)+REVERSE = "--reverse" in argv # walk assets from the end: a second process can share the work++SRC = bpy.data.filepath+if not SRC or os.path.basename(SRC) == "hk.blend" and "scenes" in SRC.replace("\\", "/").split("/"):+ print("export_blend: refusing to run on a scene's own .blend; open a copy", flush=True)+ sys.exit(1)++for d in ("mesh", "tex", "world", "grade"):+ os.makedirs(os.path.join(OUT, d), exist_ok=True)++sc = bpy.context.scene+sc.frame_set(FRAME)+S = Matrix.Diagonal((1.0, -1.0, 1.0, 1.0))+LOG = []+++def log(*a):+ s = " ".join(str(x) for x in a)+ LOG.append(s)+ print("EXPORT", s, flush=True)+++def ue_vec(v, scale=100.0):+ return [v[0] * scale, -v[1] * scale, v[2] * scale]+++def ue_xform(mw):+ t = S @ mw @ S+ loc, rot, scl = t.decompose()+ return {"loc": [loc.x * 100, loc.y * 100, loc.z * 100], "quat": [rot.x, rot.y, rot.z, rot.w], "scale": list(scl)}+++def ue_axes(mw):+ """Forward (-Z local) and up (+Y local) of a Blender camera/light in Unreal axes."""+ r = mw.to_3x3().normalized()+ f = r @ Vector((0, 0, -1))+ u = r @ Vector((0, 1, 0))+ return [f.x, -f.y, f.z], [u.x, -u.y, u.z]+++def safe(name):+ return re.sub(r"[^A-Za-z0-9_]", "_", name)[:60]+++# ------------------------------------------------------------------ material inspection++def output_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ for n in outs:+ if n.is_active_output:+ return n+ return outs[0] if outs else None+++def surface_shader(m):+ if not m or not m.node_tree:+ return None+ o = output_node(m.node_tree)+ if not o or not o.inputs["Surface"].is_linked:+ return None+ return o.inputs["Surface"].links[0].from_node+++def is_volume_only(m):+ if not m or not m.node_tree:+ return False+ o = output_node(m.node_tree)+ return bool(o and o.inputs["Volume"].is_linked and not o.inputs["Surface"].is_linked)+++def find_principled(m):+ sh = surface_shader(m)+ if sh is None:+ return None+ if sh.type == "BSDF_PRINCIPLED":+ return sh+ # Mix shaders etc.: first principled upstream.+ seen, stack = set(), [sh]+ while stack:+ n = stack.pop()+ if n.name in seen:+ continue+ seen.add(n.name)+ if n.type == "BSDF_PRINCIPLED":+ return n+ for i in n.inputs:+ for l in i.links:+ stack.append(l.from_node)+ return None+++def is_glass(m):+ p = find_principled(m)+ if p is not None:+ return (not p.inputs["Transmission Weight"].is_linked) and p.inputs["Transmission Weight"].default_value > 0.5+ sh = surface_shader(m)+ return sh is not None and sh.type in ("BSDF_GLASS", "BSDF_REFRACTION")+++def glass_params(m):+ p = find_principled(m)+ if p is None:+ return {"color": [1, 1, 1], "roughness": 0.0, "ior": 1.45}+ c = p.inputs["Base Color"].default_value+ return {"color": [c[0], c[1], c[2]], "roughness": p.inputs["Roughness"].default_value,+ "ior": p.inputs["IOR"].default_value, "alpha": p.inputs["Alpha"].default_value}+++def emissive(m):+ sh = surface_shader(m)+ if sh is None:+ return False+ if sh.type == "EMISSION":+ return True+ p = find_principled(m)+ if p is None:+ return False+ s = p.inputs["Emission Strength"]+ c = p.inputs["Emission Color"]+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))+++def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+++def uses_object_dependence(m):+ """Nodes whose result depends on the object it sits on (bakes per representative instance)."""+ if not m or not m.node_tree:+ return []+ hits = set()+ def walk(nt):+ for n in nt.nodes:+ if n.type in ("OBJECT_INFO", "AMBIENT_OCCLUSION", "NEW_GEOMETRY", "BEVEL"):+ hits.add(n.type)+ if n.type == "TEX_COORD":+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+ return sorted(hits)+++def animated(m):+ ad = m.node_tree.animation_data if m and m.node_tree else None+ return bool(ad and (ad.drivers or ad.action))+++# ------------------------------------------------------------------ scene classification++def particle_instancers():+ srcs, emitters = set(), set()+ for o in sc.objects:+ for md in o.modifiers:+ if md.type == "PARTICLE_SYSTEM":+ st = md.particle_system.settings+ emitters.add(o.name)+ if st.render_type == "OBJECT" and st.instance_object:+ srcs.add(st.instance_object.name)+ if st.render_type == "COLLECTION" and st.instance_collection:+ srcs.update(x.name for x in st.instance_collection.all_objects)+ return srcs, emitters+++def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+ return "m_" + o.data.name+ return "o_" + o.name+++def tri_count(me):+ me.calc_loop_triangles()+ return len(me.loop_triangles)+++def render_uv(me):+ return next((l for l in me.uv_layers if l.active_render), None) or me.uv_layers.active+++def uv_ok(me):+ """True if the active render UV is a usable non-overlapping atlas inside 0..1 (generated-prop style)."""+ uvl = render_uv(me)+ if uvl is None or len(me.loop_triangles) == 0:+ return False+ n = len(me.loops)+ uv = np.empty(n * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ if uv.min() < -0.01 or uv.max() > 1.01:+ return False+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ total = float(a.sum())+ if total > 1.02 or total < 0.05:+ return False+ # Coarse overlap check: rasterise triangle centroids+vertices into a 512 grid weighted by area.+ g = 512+ idx = np.clip((t.mean(axis=1) * g).astype(np.int32), 0, g - 1)+ occ = np.zeros((g, g), np.float64)+ np.add.at(occ, (idx[:, 1], idx[:, 0]), a)+ return float(occ.max()) < 4.0 / (g * g) + 1e-4 or total < 0.9+++def surface_area(o, me):+ mw = o.matrix_world+ me.calc_loop_triangles()+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3)+ m3 = np.array(mw.to_3x3())+ co = co @ m3.T+ vt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ t = co[vt.reshape(-1, 3)]+ return float(0.5 * np.linalg.norm(np.cross(t[:, 1] - t[:, 0], t[:, 2] - t[:, 0]), axis=1).sum())+++def pow2(x, lo, hi):+ r = lo+ while r < x and r < hi:+ r *= 2+ return min(r, hi)+++# ------------------------------------------------------------------ baking++BAKE_SCENE = None+++def bake_scene():+ global BAKE_SCENE+ if BAKE_SCENE is None:+ bs = bpy.data.scenes.new("__bake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "GPU" if GPU else "CPU"+ bs.cycles.samples = 4+ bs.cycles.use_denoising = False+ bs.render.bake.margin = 8+ bs.render.bake.use_clear = True+ bs.render.bake.target = "IMAGE_TEXTURES"+ if THREADS:+ bs.render.threads_mode = "FIXED"+ bs.render.threads = THREADS+ bs.world = sc.world+ bs.frame_current = FRAME+ BAKE_SCENE = bs+ return BAKE_SCENE+++def run_bake(o, kind):+ bs = bake_scene()+ vl = bs.view_layers[0]+ with bpy.context.temp_override(scene=bs, view_layer=vl, object=o, active_object=o,+ selected_objects=[o], selected_editable_objects=[o]):+ if kind == "NORMAL":+ bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT", margin=8, use_clear=True)+ else:+ bpy.ops.object.bake(type="EMIT", margin=8, use_clear=True)+++def _src(sock):+ return sock.links[0].from_socket if sock.is_linked else None+++class Rewire:+ """Temporarily route one Principled channel into an Emission shader on the material output."""++ def __init__(self, m, channel, img):+ self.m, self.nt = m, m.node_tree+ self.added, self.saved = [], None+ nt = self.nt+ out = output_node(nt)+ p = find_principled(m)+ sh = surface_shader(m)+ em = nt.nodes.new("ShaderNodeEmission")+ self.added.append(em)+ em.inputs["Strength"].default_value = 1.0+ col = em.inputs["Color"]+ if channel == "base":+ if p is not None:+ s = p.inputs["Base Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ elif sh is not None and sh.type == "EMISSION":+ col.default_value = (0, 0, 0, 1)+ elif sh is not None and "Color" in sh.inputs:+ s = sh.inputs["Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+ # R=1 (no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+ else:+ cmb.inputs[i].default_value = p.inputs[k].default_value if p is not None else dv+ nt.links.new(cmb.outputs[0], col)+ elif channel == "emit":+ if sh is not None and sh.type == "EMISSION":+ for k in ("Color", "Strength"):+ s = sh.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[k])+ else:+ em.inputs[k].default_value = s.default_value+ elif p is not None:+ for k, ek in (("Emission Color", "Color"), ("Emission Strength", "Strength")):+ s = p.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[ek])+ else:+ em.inputs[ek].default_value = s.default_value+ else:+ col.default_value = (0, 0, 0, 1)+ if out is not None:+ self.saved = _src(out.inputs["Surface"])+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ self.out = out+ self.tex = nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.added.append(self.tex)+ nt.nodes.active = self.tex++ def restore(self):+ nt = self.nt+ if self.out is not None:+ for l in list(self.out.inputs["Surface"].links):+ nt.links.remove(l)+ if self.saved is not None:+ nt.links.new(self.saved, self.out.inputs["Surface"])+ for n in self.added:+ nt.nodes.remove(n)+++class TargetOnly:+ """For the normal bake: keep the material, just add the active target image node."""++ def __init__(self, m, img):+ self.nt = m.node_tree+ self.tex = self.nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.nt.nodes.active = self.tex++ def restore(self):+ self.nt.nodes.remove(self.tex)+++def new_img(name, res, colorspace, is_float=False):+ old = bpy.data.images.get(name)+ if old:+ bpy.data.images.remove(old)+ w, h = (res, res) if isinstance(res, int) else res+ img = bpy.data.images.new(name, w, h, alpha=False, float_buffer=is_float)+ img.colorspace_settings.name = colorspace+ return img+++def save_png(img, path):+ img.filepath_raw = path+ img.file_format = "PNG"+ img.save()+++def bake_channel(o, mats, channel, res, path):+ cs = {"base": "sRGB", "orm": "Non-Color", "emit": "Linear Rec.709", "normal": "Non-Color"}[channel]+ img = new_img("__bake_" + channel, res, cs, is_float=(channel == "emit"))+ rw = []+ try:+ seen = set()+ for m in mats:+ if m is None or m.name in seen or m.node_tree is None:+ continue+ seen.add(m.name)+ rw.append(TargetOnly(m, img) if channel == "normal" else Rewire(m, channel, img))+ run_bake(o, "NORMAL" if channel == "normal" else "EMIT")+ finally:+ for r in rw:+ r.restore()+ scale = 1.0+ if channel == "emit":+ w, h = (res, res) if isinstance(res, int) else res+ px = np.empty(w * h * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mx = float(np.percentile(px.max(axis=1), 99.95)) if px.size else 0.0+ scale = max(mx, 1e-6)+ out = bpy.data.images.new("__emit_png", w, h, alpha=False)+ out.colorspace_settings.name = "sRGB"+ q = np.ones((w * h, 4), np.float32)+ q[:, :3] = np.clip(px / scale, 0, 1)+ out.pixels.foreach_set(q.ravel())+ save_png(out, path)+ bpy.data.images.remove(out)+ else:+ save_png(img, path)+ bpy.data.images.remove(img)+ return scale+++def uv_stats(me, name):+ """UV coords of a layer and the fraction of the 0..1 square its triangles cover."""+ uvl = me.uv_layers[name]+ uv = np.empty(len(me.loops) * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ me.calc_loop_triangles()+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ return uv, float(a.sum())+++def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+ empty square one. Returns (uv name, kept, aspect w/h, uv coverage)."""+ me = me_owner.data+ if "bake" in me.uv_layers:+ me.uv_layers.active = me.uv_layers["bake"]+ return "bake", False, me_owner.get("_bake_aspect", 1.0), me_owner.get("_bake_cov", 0.5)+ me.calc_loop_triangles()+ if uv_ok(me):+ ar = render_uv(me)+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)+ uvl = me.uv_layers.new(name="bake")+ if ar is not None:+ ar.active_render = True # keep materials reading their original UVs+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ vl.objects.active = me_owner+ me_owner.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ bpy.ops.mesh.select_all(action="SELECT")+ bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=False)+ try:+ bpy.ops.uv.select_all(action="SELECT")+ bpy.ops.uv.pack_islands(rotate=True, margin=0.003, shape_method="AABB", scale=True)+ except Exception as ex: # noqa: BLE001+ log("pack_islands failed", me_owner.name, ex)+ bpy.ops.object.mode_set(mode="OBJECT")+ me_owner.select_set(False)+ uv, _ = uv_stats(me, "bake")+ lo, hi = uv.min(axis=0), uv.max(axis=0)+ span = np.maximum(hi - lo, 1e-6)+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+++def bake_size(area, cov, aspect, kept):+ """Texture W,H so texel density is ~DENSITY px/m over the real surface; power of two, clamped."""+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4 # big architecture: coarser texels+ px = d * d * area / cov+ lo = 1024 if kept else 32+ w = pow2(math.sqrt(px * aspect), lo, MAX_RES)+ h = pow2(math.sqrt(px / aspect), lo, MAX_RES)+ if kept:+ w = h = min(max(w, h), 2048) # generated props: their own atlas, 1-2K+ return w, h+++# ------------------------------------------------------------------ export++def to_mesh_object(o):+ """Text/curve objects -> real mesh objects (evaluated) in a scratch collection; originals hidden."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ n = bpy.data.objects.new(o.name + "__mesh", me)+ c = bpy.data.collections.get("__converted") or bpy.data.collections.new("__converted")+ if c.name not in sc.collection.children:+ sc.collection.children.link(c)+ c.objects.link(n)+ n.matrix_world = o.matrix_world.copy()+ for k in ("visible_shadow", "visible_camera", "visible_glossy", "visible_diffuse"):+ setattr(n, k, getattr(o, k))+ o.hide_render = True+ return n+++def export_glb(o, uv_name, glass_slots, path):+ """Evaluated mesh at identity with only the bake UV; slots: 0 = baked, 1+ = each glass material."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ for l in [l for l in me.uv_layers if l.name != uv_name]:+ me.uv_layers.remove(l)+ if len(me.uv_layers):+ me.uv_layers[0].name = "UVMap"+ gl = list(glass_slots)+ mi = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("material_index", mi)+ remap = np.zeros(max(len(o.material_slots), 1), np.int32)+ for i in range(len(o.material_slots)):+ remap[i] = gl.index(i) + 1 if i in gl else 0+ mi = remap[np.clip(mi, 0, len(remap) - 1)]+ me.polygons.foreach_set("material_index", mi)+ me.materials.clear()+ base = bpy.data.materials.get("BAKED") or bpy.data.materials.new("BAKED")+ me.materials.append(base)+ for k, gi in enumerate(gl):+ gm = bpy.data.materials.get(f"GLASS_{k}") or bpy.data.materials.new(f"GLASS_{k}")+ me.materials.append(gm)+ tmp = bpy.data.objects.new("__export", me)+ sc.collection.objects.link(tmp)+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ tmp.select_set(True)+ vl.objects.active = tmp+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_apply=True,+ export_materials="PLACEHOLDER", export_texcoords=True, export_normals=True,+ export_tangents=True, export_yup=True, export_animations=False,+ export_cameras=False, export_lights=False, export_extras=False)+ bpy.data.objects.remove(tmp)+ bpy.data.meshes.remove(me)+++# ------------------------------------------------------------------ volumes++def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+ m = next((m for m in o.data.materials if m and is_volume_only(m)), None)+ if m is None:+ return None+ pv = next((nd for nd in m.node_tree.nodes if nd.type == "PRINCIPLED_VOLUME"), None)+ if pv is None:+ return None+ me0 = o.data+ xs = [v.co.x for v in me0.vertices]+ ys = [v.co.y for v in me0.vertices]+ zs = [v.co.z for v in me0.vertices]+ lo, hi = Vector((min(xs), min(ys), min(zs))), Vector((max(xs), max(ys), max(zs)))+ res = {"levels": [], "density": [], "emission": [], "emission_color": None}+ for f in levels:+ z = lo.z + f * (hi.z - lo.z)+ me = bpy.data.meshes.new("__slice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__slice", me)+ sc.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ out = output_node(nt)+ for l in list(out.inputs["Volume"].links):+ nt.links.remove(l)+ vals = {}+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ em = nt.nodes.new("ShaderNodeEmission")+ s = pvc.inputs[sock]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ img = new_img("__vol", n, "Non-Color", is_float=True)+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ bs = bake_scene()+ bs.collection.objects.link(sl)+ try:+ run_bake(sl, "EMIT")+ finally:+ bs.collection.objects.unlink(sl)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ vals[key] = float(px.reshape(-1, 4)[:, 0].mean())+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ res["levels"].append(f)+ res["density"].append(vals["density"])+ res["emission"].append(vals["emission"])+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ c = pv.inputs["Color"].default_value+ res["albedo"] = [c[0], c[1], c[2]]+ res["anisotropy"] = pv.inputs["Anisotropy"].default_value+ ec = pv.inputs["Emission Color"]+ if ec.is_linked:+ # Sample the colour ramp if it is one (flame): mid-height colour as a representative.+ n0 = ec.links[0].from_node+ if n0.type == "VALTORGB":+ res["emission_color"] = list(n0.color_ramp.evaluate(0.6))[:3]+ else:+ res["emission_color"] = list(ec.default_value)[:3]+ mw = o.matrix_world+ corners = [mw @ Vector((x, y, z)) for x in (lo.x, hi.x) for y in (lo.y, hi.y) for z in (lo.z, hi.z)]+ wlo = Vector([min(c[i] for c in corners) for i in range(3)])+ whi = Vector([max(c[i] for c in corners) for i in range(3)])+ res["bounds_ue"] = {"center": ue_vec((wlo + whi) / 2), "extent": [(whi.x - wlo.x) * 50, (whi.y - wlo.y) * 50, (whi.z - wlo.z) * 50]}+ res["bounds_m"] = {"lo": list(wlo), "hi": list(whi)}+ res["material"] = m.name+ res["animated"] = animated(m)+ return res+++# ------------------------------------------------------------------ lights / cameras / world / grade++def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+ mx = max(col) or 1.0+ P = L.energy+ e = {"name": o.name, "type": L.type, "color": [c / mx for c in col], "energy_w": P,+ "cast_shadows": bool(getattr(L, "use_shadow", True)),+ "specular": 1.0 if getattr(o, "visible_glossy", True) else 0.0,+ "diffuse": 1.0 if getattr(o, "visible_diffuse", True) else 0.0,+ "volume": 1.0 if getattr(o, "visible_volume_scatter", True) else 0.0,+ "loc": ue_vec(o.matrix_world.translation), "animated": bool(L.animation_data and (L.animation_data.drivers or L.animation_data.action))}+ f, u = ue_axes(o.matrix_world)+ e["forward"], e["up"] = f, u+ k = mx # colour normalisation folds into intensity+ if L.type in ("POINT", "SPOT"):+ e["candela"] = LM_PER_W * P * k / (4 * math.pi)+ e["source_radius"] = L.shadow_soft_size * 100+ e["soft_falloff"] = bool(getattr(L, "use_soft_falloff", True))+ if L.type == "SPOT":+ outer = math.degrees(L.spot_size) / 2+ e["outer_cone"] = min(outer, 80.0)+ e["inner_cone"] = outer * (1 - L.spot_blend)+ if outer > 80:+ e["note"] = f"spot cone {outer * 2:.0f} deg > Unreal max 160: clamped"+ elif L.type == "AREA":+ e["candela"] = LM_PER_W * P * k / math.pi+ e["shape"] = L.shape+ sx = L.size+ sy = L.size_y if L.shape in ("RECTANGLE", "ELLIPSE") else L.size+ sxx, syy, _ = o.matrix_world.to_scale()+ e["width"], e["height"] = sx * sxx * 100, sy * syy * 100+ e["spread_deg"] = math.degrees(getattr(L, "spread", math.pi))+ elif L.type == "SUN":+ e["lux"] = LM_PER_W * P * k+ e["angle_deg"] = math.degrees(L.angle)+ # IES / gobo: node-based light textures.+ if L.use_nodes and L.node_tree:+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+++def camera_entry(o):+ c = o.data+ f, u = ue_axes(o.matrix_world)+ rx, ry = sc.render.resolution_x, sc.render.resolution_y+ sw = c.sensor_width if c.sensor_fit in ("AUTO", "HORIZONTAL") else c.sensor_height * rx / ry+ d = {"name": o.name, "type": c.type, "lens_mm": c.lens, "sensor_width_mm": sw, "sensor_height_mm": sw * ry / rx,+ "sensor_fit": c.sensor_fit, "shift": [c.shift_x, c.shift_y], "clip": [c.clip_start * 100, c.clip_end * 100],+ "loc": ue_vec(o.matrix_world.translation), "forward": f, "up": u,+ "dof": {"enabled": c.dof.use_dof, "focus_cm": c.dof.focus_distance * 100, "fstop": c.dof.aperture_fstop,+ "blades": c.dof.aperture_blades, "focus_object": c.dof.focus_object.name if c.dof.focus_object else None}}+ if o.name in DOF:+ fd, fs = DOF[o.name]+ d["dof"].update(enabled=True, focus_cm=fd * 100, fstop=fs, source="--dof override (stills script)")+ return d+++def world_bake(path, w=2048, h=1024, spp=32):+ ws = bpy.data.scenes.new("__world")+ ws.world = sc.world+ ws.render.engine = "CYCLES"+ ws.cycles.device = "CPU"+ ws.cycles.samples = spp+ ws.render.resolution_x, ws.render.resolution_y, ws.render.resolution_percentage = w, h, 100+ ws.view_settings.view_transform = "Standard"+ ws.render.image_settings.file_format = "OPEN_EXR"+ ws.render.image_settings.color_depth = "16"+ cd = bpy.data.cameras.new("__pano")+ cd.type = "PANO"+ try:+ cd.panorama_type = "EQUIRECTANGULAR"+ except Exception:+ cd.cycles.panorama_type = "EQUIRECTANGULAR"+ co = bpy.data.objects.new("__pano", cd)+ ws.collection.objects.link(co)+ co.rotation_euler = (math.radians(90), 0, math.radians(-90)) # looking +X? (equirect centre = -Y in Blender -> fixed below)+ co.rotation_euler = (math.radians(90), 0, 0)+ ws.camera = co+ ws.render.filepath = path+ with bpy.context.temp_override(scene=ws):+ bpy.ops.render.render(write_still=True, scene=ws.name)+ # mean radiance for the sky light estimate+ img = bpy.data.images.load(path)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mean = px.mean(axis=0).tolist()+ bpy.data.images.remove(img)+ return {"equirect_exr": path, "mean_radiance": mean, "camera_note": "equirect centre looks along Blender +Y"}+++def compositor_nodes():+ # 5.0: compositing_node_group; Scene.node_tree is gone (use_nodes can still read True with no tree).+ tree = getattr(sc, "compositing_node_group", None) or getattr(sc, "node_tree", None)+ if tree is None:+ return []+ out = []+ for n in tree.nodes:+ d = {"type": n.bl_idname, "name": n.name, "inputs": {}}+ for i in n.inputs:+ if i.is_linked or not hasattr(i, "default_value"):+ continue+ v = i.default_value+ try:+ v = v if isinstance(v, str) else list(v)+ except TypeError:+ pass+ if isinstance(v, (int, float, str, list, bool)):+ d["inputs"][i.name] = v+ for k in ("glare_type", "quality", "blend_type"):+ if hasattr(n, k):+ d[k] = getattr(n, k)+ out.append(d)+ return out+++def ffmpeg_grade(grade_sh):+ """Pull GRADE="..." out of a scene's grade.sh; split into colour (LUT-able) and spatial filters."""+ txt = open(grade_sh, encoding="utf-8").read()+ m = re.search(r'GRADE="([^"]+)"', txt)+ if not m:+ return None+ filters = [f for f in m.group(1).split(",") if f]+ colour = [f for f in filters if f.split("=")[0] in ("curves", "hue", "eq", "colorbalance", "colorchannelmixer", "lutrgb", "colortemperature")]+ spatial = [f for f in filters if f not in colour]+ g = {"source": grade_sh, "filter": m.group(1), "colour": colour, "spatial": spatial}+ for f in spatial:+ if f.startswith("vignette"):+ a = re.search(r"angle=PI/([\d.]+)", f)+ g["vignette_angle_rad"] = math.pi / float(a.group(1)) if a else math.pi / 5+ if f.startswith("rgbashift"):+ g["chromatic_px"] = 1+ noise = re.search(r"noise=alls=(\d+)", txt)+ if noise:+ g["grain_strength"] = int(noise.group(1))+ return g+++def make_lut(colour_filters, path):+ """UE colour grading LUT (256x16, 16 slices of 16x16; R across a slice, G down, B by slice), with the ffmpeg+ colour filters applied. Unreal applies it after the tone curve, i.e. in display space, like ffmpeg on the PNG."""+ n = 16+ ident = os.path.join(os.path.dirname(path), "lut_identity.png")+ img = bpy.data.images.new("__lut", n * n, n, alpha=False)+ img.colorspace_settings.name = "Non-Color"+ px = np.zeros((n, n * n, 4), np.float32)+ for b in range(n):+ for g in range(n):+ for r in range(n):+ px[g, b * n + r] = (r / (n - 1), g / (n - 1), b / (n - 1), 1)+ # Blender rows go bottom-up; UE LUT row 0 (top) is G=0.+ img.pixels.foreach_set(px[::-1].ravel())+ save_png(img, ident)+ bpy.data.images.remove(img)+ if not colour_filters:+ return ident+ cmd = [FFMPEG, "-v", "error", "-y", "-i", ident, "-vf", ",".join(colour_filters), "-frames:v", "1", path]+ try:+ r = subprocess.run(cmd, capture_output=True, text=True)+ except OSError as ex:+ log("LUT ffmpeg not runnable (pass --ffmpeg or set FFMPEG):", FFMPEG, ex)+ return ident+ if r.returncode != 0:+ log("LUT ffmpeg failed:", r.stderr[:300])+ return ident+ return path+++# ------------------------------------------------------------------ main++def main():+ t0 = time.time()+ srcs, emitters = particle_instancers()+ report = {"skipped": [], "converted": [], "volumes": {}, "fx": [], "warnings": []}+ objs = []+ for o in list(sc.objects):+ if o.hide_render or not o.visible_get():+ if o.type in ("MESH", "FONT", "CURVE") and not o.hide_render:+ pass+ if o.hide_render:+ continue+ if o.name in srcs:+ report["skipped"].append([o.name, "particle instance source (exported as fx note)"])+ continue+ if o.name in emitters:+ st = [md.particle_system.settings for md in o.modifiers if md.type == "PARTICLE_SYSTEM"]+ report["fx"].append({"name": o.name, "kind": "particles", "count": sum(s.count for s in st),+ "instance": [s.instance_object.name if s.instance_object else None for s in st],+ "lifetime": [s.lifetime for s in st], "velocity": [list(s.object_align_factor) for s in st]})+ if not o.show_instancer_for_render:+ continue+ if o.type in ("FONT", "CURVE", "SURFACE", "META"):+ if o.type == "CURVE" and o.data.bevel_depth == 0 and not o.data.bevel_object and o.data.extrude == 0:+ report["skipped"].append([o.name, "curve without geometry"])+ continue+ n = to_mesh_object(o)+ report["converted"].append([o.name, o.type])+ objs.append(n)+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+ log("volume", o.name, [round(x, 4) for x in v["density"]], [round(x, 2) for x in v["emission"]])+ continue+ objs.append(o)+ # Group by unique mesh.+ assets = {}+ for o in objs:+ k = mesh_key(o)+ assets.setdefault(k, []).append(o)+ keys = sorted(assets, key=lambda k: assets[k][0].name, reverse=REVERSE)+ if ONLY:+ keys = [k for k in keys if any(o.name in ONLY or o.name.split("__")[0] in ONLY for o in assets[k])]+ if LIMIT:+ keys = keys[:LIMIT]+ log(f"{len(objs)} mesh objects -> {len(assets)} unique meshes; exporting {len(keys)}")+ entries, placements = [], []+ for ai, k in enumerate(keys):+ group = assets[k]+ rep = group[0]+ an = safe(rep.data.name if k.startswith("m_") else rep.name)+ an = f"{an}_{ai:03d}" if any(e["asset"] == an for e in entries) else an+ mats = [s.material for s in rep.material_slots]+ glass = [i for i, m in enumerate(mats) if m and is_glass(m)]+ bake_mats = [m for i, m in enumerate(mats) if i not in glass]+ dg = bpy.context.evaluated_depsgraph_get()+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+ meta = glb[:-4] + ".json"+ done = os.path.exists(glb) # written after every bake of the asset succeeded+ if done:+ # Resume: skip the UV unwrap (an edit-mode smart_project per asset). Blender 5.0.1's bake crashes+ # (OpenImageIO ustring::operator= in ccl::create_mesh) after a few hundred unwrap+bake cycles in one+ # process; re-unwrapping every finished asset on resume made it crash at the same asset every time.+ m0 = json.load(open(meta)) if os.path.exists(meta) else {}+ uv_name, kept, cov, res = None, m0.get("uv") == "kept", m0.get("uv_coverage", 0.0), m0.get("res", [0, 0])+ else:+ uv_name, kept, aspect, cov = ensure_bake_uv(rep, rep)+ res = bake_size(area, cov, aspect, kept)+ e = {"asset": an, "key": k, "tris": tris, "area_m2": round(area, 3), "uv": "kept" if kept else "smart_project",+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera)}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+ bake_scene().collection.objects.link(rep)+ try:+ bake_channel(rep, bake_mats, "base", res, p["base"])+ bake_channel(rep, bake_mats, "orm", res, p["orm"])+ if any(m and perturbs_normal(m) for m in bake_mats):+ bake_channel(rep, bake_mats, "normal", res, p["normal"])+ if any(m and emissive(m) for m in bake_mats):+ s = bake_channel(rep, bake_mats, "emit", res, p["emit"])+ json.dump({"scale": s}, open(p["emit"] + ".json", "w"))+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+ e["tex"] = {c: os.path.relpath(v, OUT) for c, v in p.items() if os.path.exists(v)}+ if not os.path.exists(glb):+ export_glb(rep, uv_name, glass, glb)+ if not done:+ json.dump({"res": list(res), "uv": e["uv"], "uv_coverage": e["uv_coverage"]}, open(meta, "w"))+ e["glb"] = os.path.relpath(glb, OUT)+ # Local bounds in Unreal axes for the importer orientation check.+ bb = [Vector(c) for c in rep.bound_box]+ e["check_bounds"] = {"min": ue_vec(Vector([min(c[i] for c in bb) for i in range(3)])),+ "max": ue_vec(Vector([max(c[i] for c in bb) for i in range(3)]))}+ e["bake_s"] = round(time.time() - t1, 1)+ entries.append(e)+ for o in group:+ placements.append({"name": o.name, "asset": an, **ue_xform(o.matrix_world),+ "shadow": bool(o.visible_shadow), "camera_visible": bool(o.visible_camera)})+ log(f"[{ai + 1}/{len(keys)}] {an} tris={tris} res={res} uv={e['uv']} inst={len(group)} {e['bake_s']}s")+ # Lights, cameras, world, grade.+ lights = [light_entry(o) for o in sc.objects if o.type == "LIGHT" and not o.hide_render]+ cams = [camera_entry(o) for o in sc.objects if o.type == "CAMERA"]+ world = None+ wpath = os.path.join(OUT, "world", "sky.exr")+ if sc.world:+ world = world_bake(wpath) if not os.path.exists(wpath) or "--rebake-world" in argv else {"equirect_exr": wpath}+ if "mean_radiance" not in world:+ img = bpy.data.images.load(wpath)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ world["mean_radiance"] = px.reshape(-1, 4)[:, :3].mean(axis=0).tolist()+ bpy.data.images.remove(img)+ world["equirect_exr"] = os.path.relpath(wpath, OUT)+ world["nits_scale"] = LM_PER_W+ vs = sc.view_settings+ grade = {"view_transform": vs.view_transform, "look": vs.look, "exposure": vs.exposure, "gamma": vs.gamma,+ "use_curve_mapping": vs.use_curve_mapping,+ "ev100": math.log2(LM_PER_W / 1.2) - vs.exposure,+ "compositor": compositor_nodes(),+ "motion_blur": {"on": sc.render.use_motion_blur, "shutter": sc.render.motion_blur_shutter},+ "resolution": [sc.render.resolution_x, sc.render.resolution_y], "fps": sc.render.fps}+ if vs.use_curve_mapping:+ grade["curves"] = [[(p.location[0], p.location[1]) for p in c.points] for c in vs.curve_mapping.curves]+ if GRADE_SH and os.path.exists(GRADE_SH):+ g = ffmpeg_grade(GRADE_SH)+ if g:+ g["lut"] = os.path.relpath(make_lut(g["colour"], os.path.join(OUT, "grade", "lut_grade.png")), OUT)+ grade["ffmpeg"] = g+ scene = {"source": SRC, "frame": FRAME, "units": "unreal cm, X fwd, Y right, Z up", "lm_per_w": LM_PER_W,+ "assets": entries, "placements": placements, "lights": lights, "cameras": cams, "world": world,+ "volumes": report["volumes"], "fx": report["fx"], "grade": grade,+ "skipped": report["skipped"], "converted": report["converted"], "export_s": round(time.time() - t0)}+ jp = os.path.join(OUT, "scene.json")+ if os.path.exists(jp) and (ONLY or LIMIT):+ old = json.load(open(jp, encoding="utf-8"))+ have = {e["asset"] for e in entries}+ scene["assets"] = [e for e in old.get("assets", []) if e["asset"] not in have] + entries+ scene["placements"] = [p for p in old.get("placements", []) if p["asset"] not in have] + placements+ json.dump(scene, open(jp, "w", encoding="utf-8"), indent=1)+ log(f"wrote {jp}: {len(scene['assets'])} assets, {len(scene['placements'])} placements, {len(lights)} lights, "+ f"{len(cams)} cameras, {len(report['volumes'])} volumes in {time.time() - t0:.0f}s")+++main()diff --git a/unreal_ramen/_orig/make_copy.py b/unreal_ramen/_orig/make_copy.pynew file mode 100644index 0000000..0a0063e--- /dev/null+++ b/unreal_ramen/_orig/make_copy.py@@ -0,0 +1,12 @@+"""Make a working copy of a scene .blend with all external paths absolute (a plain file copy breaks the scene's+//../../refs/... texture paths as soon as it lives in another folder). The source file is only read.+ blender -b scenes/<id>/<scene>.blend --python unreal/make_copy.py -- <out.blend>+"""+import sys+import bpy++out = sys.argv[sys.argv.index("--") + 1]+assert bpy.path.abspath(out) != bpy.data.filepath, "refusing to overwrite the source .blend"+bpy.ops.file.make_paths_absolute()+bpy.ops.wm.save_as_mainfile(filepath=out, copy=True, relative_remap=False, compress=False)+print("COPY", bpy.data.filepath, "->", out, flush=True)diff --git a/unreal_ramen/_orig/perf.ps1 b/unreal_ramen/_orig/perf.ps1new file mode 100644index 0000000..a601daf--- /dev/null+++ b/unreal_ramen/_orig/perf.ps1@@ -0,0 +1,40 @@+# Standalone (-game) real-time performance run of a built AnyScene level, with no window (-RenderOffscreen).+# Captures N frames with the CSV profiler (frame/game/render/GPU times) from the PlayerStart (hero camera), and samples+# total GPU memory with nvidia-smi before and during the run.+# powershell -File perf.ps1 [-Map /Game/AnyScene/HK/L_HK] [-ResX 2560] [-ResY 1440] [-Frames 900] [-Extra "r.Lumen.HardwareRayTracing 0"]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Map = "/Game/AnyScene/HK/L_HK",+ [int]$ResX = 2560, [int]$ResY = 1440, [int]$Frames = 900, [int]$TimeoutS = 600,+ [string]$Tag = "perf", [string]$Extra = ""+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor.exe"+$saved = Join-Path (Split-Path $Project) "Saved"+$csvDir = Join-Path $saved "Profiling\CSV"+$before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+$mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+# The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+$cmds = "r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+if ($Extra) { $cmds = "$Extra,$cmds" }+$args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+ "-dpcvars=Editor.AsyncAssetCompilation=0") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+$proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+$peak = $mem0+$sw = [Diagnostics.Stopwatch]::StartNew()+$csv = $null+while (-not $proc.HasExited -and $sw.Elapsed.TotalSeconds -lt $TimeoutS) {+ Start-Sleep -Seconds 2+ $m = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ if ($m -gt $peak) { $peak = $m }+ $new = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | Where-Object { $before -notcontains $_.FullName }+ if ($new) {+ $f = $new | Sort-Object LastWriteTime | Select-Object -Last 1+ # The CSV is written when the capture ends; wait until the file stops growing.+ $s1 = $f.Length; Start-Sleep -Seconds 3; $s2 = (Get-Item $f.FullName).Length+ if ($s1 -eq $s2 -and $s2 -gt 0) { $csv = $f.FullName; break }+ }+}+if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force }+"gpu_mem_before_mb=$mem0 gpu_mem_peak_mb=$peak delta_mb=$($peak - $mem0)"+"csv=$csv"diff --git a/unreal_ramen/_orig/render_mrq.ps1 b/unreal_ramen/_orig/render_mrq.ps1new file mode 100644index 0000000..841229a--- /dev/null+++ b/unreal_ramen/_orig/render_mrq.ps1@@ -0,0 +1,17 @@+# Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+# UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+# powershell -File render_mrq.ps1 [-Cams cam_street,cam_table,cam_wok] [-Config MRQ_Still|MRQ_Linear]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Dest = "/Game/AnyScene/HK", [string]$Level = "L_HK",+ [string]$Cams = "cam_street,cam_table,cam_wok", [string]$Config = "MRQ_Still"+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"+foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+ "-dpcvars=Editor.AsyncAssetCompilation=0" | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+}diff --git a/unreal_ramen/_orig/render_shots.py b/unreal_ramen/_orig/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal_ramen/_orig/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_ramen/_orig/side_by_side.py b/unreal_ramen/_orig/side_by_side.pynew file mode 100644index 0000000..e55eddd--- /dev/null+++ b/unreal_ramen/_orig/side_by_side.py@@ -0,0 +1,47 @@+"""Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.+"""+import os+import sys++from PIL import Image, ImageDraw, ImageFont++cyc, ue, out = sys.argv[1:4]+cams = (sys.argv[4] if len(sys.argv) > 4 else "street,table,wok").split(",")+os.makedirs(out, exist_ok=True)+H = 804+LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")+try:+ font = ImageFont.truetype("arial.ttf", 28)+except OSError:+ font = ImageFont.load_default()+++def fit(p):+ im = Image.open(p).convert("RGB")+ return im.resize((round(im.width * H / im.height), H), Image.LANCZOS)+++rows = []+for c in cams:+ a = fit(os.path.join(cyc, f"{c}_graded.png"))+ up = os.path.join(ue, f"cam_{c}.png")+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+ for x, t in ((12, f"Cycles graded {c}"), (a.width + 20, f"{LABEL} {c}")):+ d.rectangle([x - 6, 8, x + 360, 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)+ print("wrote", os.path.join(out, f"{c}.png"))+w = max(r.width for r in rows)+allim = Image.new("RGB", (w, sum(r.height for r in rows) + 8 * (len(rows) - 1)), (255, 255, 255))+y = 0+for r in rows:+ allim.paste(r, (0, y))+ y += r.height + 8+allim.resize((allim.width // 2, allim.height // 2), Image.LANCZOS).save(os.path.join(out, "all.png"))diff --git a/unreal_ramen/agx_view.py b/unreal_ramen/agx_view.pynew file mode 100644index 0000000..870bf9e--- /dev/null+++ b/unreal_ramen/agx_view.py@@ -0,0 +1,19 @@+"""Apply a Blender view transform (default AgX + the scene's look) to Unreal scene-linear EXRs (MRQ_Linear output),+so UE and Cycles frames can be compared through the same tone mapper.+ blender -b --factory-startup --python agx_view.py -- <in.exr> <out.png> [look] [exposure]+"""+import sys+import bpy++a = sys.argv[sys.argv.index("--") + 1:]+src, dst = a[0], a[1]+look = a[2] if len(a) > 2 else "AgX - Medium High Contrast"+expo = float(a[3]) if len(a) > 3 else 0.0+sc = bpy.context.scene+sc.view_settings.view_transform = "AgX"+sc.view_settings.look = look+sc.view_settings.exposure = expo+sc.render.image_settings.file_format = "PNG"+img = bpy.data.images.load(src)+img.save_render(dst, scene=sc)+print("AGX", src, "->", dst, flush=True)diff --git a/unreal_ramen/build_level.py b/unreal_ramen/build_level.pynew file mode 100644index 0000000..1f012ed--- /dev/null+++ b/unreal_ramen/build_level.py@@ -0,0 +1,685 @@+"""Rebuild an AnyScene export (export_blend.py -> scene.json + GLBs + baked textures) as an Unreal level.++Headless (no editor window), from a shell:+ UnrealEditor-Cmd.exe <project>.uproject -run=pythonscript -script="<path>/build_level.py" -unattended -nosplash -nop4+Configuration comes from environment variables (the pythonscript commandlet does not pass script args reliably):+ ANYSCENE_EXPORT export folder holding scene.json (required)+ ANYSCENE_DEST content root, default /Game/AnyScene/HK+ ANYSCENE_LEVEL level name, default L_HK+ ANYSCENE_STAGES comma list of: textures,meshes,materials,level,sequences (default: all)+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)+ ANYSCENE_HERO_CAM camera whose transform becomes the PlayerStart (perf runs), default cam_street++Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+"""+import json+import math+import os+import time++import unreal+import warnings++warnings.simplefilter("ignore", DeprecationWarning) # UE turns deprecated-property warnings into exceptions++EXPORT = os.environ.get("ANYSCENE_EXPORT", "")+DEST = os.environ.get("ANYSCENE_DEST", "/Game/AnyScene/HK")+LEVEL = os.environ.get("ANYSCENE_LEVEL", "L_HK")+STAGES = os.environ.get("ANYSCENE_STAGES", "textures,meshes,materials,level,sequences").split(",")+ONLY = set(x for x in os.environ.get("ANYSCENE_ONLY", "").split(",") if x)+NANITE_TRIS = int(os.environ.get("ANYSCENE_NANITE_TRIS", "2000"))+EXPO_OFF = float(os.environ.get("ANYSCENE_EXPOSURE_OFFSET", "0"))++EAL = unreal.EditorAssetLibrary+MEL = unreal.MaterialEditingLibrary+AT = unreal.AssetToolsHelpers.get_asset_tools()+T0 = time.time()+REPORT = {"warnings": [], "timings": {}}+KEEP = []+++def log(*a):+ unreal.log_warning("ANYSCENE " + " ".join(str(x) for x in a))+++def warn(msg):+ REPORT["warnings"].append(msg)+ log("WARN", msg)+++scene = json.load(open(os.path.join(EXPORT, "scene.json"), encoding="utf-8"))+ASSETS = [a for a in scene["assets"] if not ONLY or a["asset"] in ONLY]+++# ------------------------------------------------------------------ textures++def tex_path(name):+ return f"{DEST}/Tex/{name}"+++def import_files(files, dest):+ tasks = []+ for f in files:+ t = unreal.AssetImportTask()+ t.filename = f+ t.destination_path = dest+ t.automated = True+ t.save = False+ t.replace_existing = True+ tasks.append(t)+ if tasks:+ AT.import_asset_tasks(tasks)+ return tasks+++def stage_textures():+ t = time.time()+ todo = []+ for a in ASSETS:+ for ch, rel in a.get("tex", {}).items():+ n = os.path.splitext(os.path.basename(rel))[0]+ if not EAL.does_asset_exist(tex_path(n)):+ todo.append((os.path.join(EXPORT, rel), ch, n))+ lut = scene["grade"].get("ffmpeg", {}).get("lut")+ extra = []+ if lut and not EAL.does_asset_exist(tex_path("lut_grade")):+ extra.append(os.path.join(EXPORT, lut))+ sky = (scene.get("world") or {}).get("equirect_exr")+ if sky and not EAL.does_asset_exist(tex_path("sky")):+ extra.append(os.path.join(EXPORT, sky))+ log(f"textures: importing {len(todo)} (+{len(extra)} extra)")+ for i in range(0, len(todo), 64):+ chunk = todo[i:i + 64]+ import_files([f for f, _, _ in chunk], f"{DEST}/Tex")+ for f, ch, n in chunk:+ tx = EAL.load_asset(tex_path(n))+ if tx is None:+ warn(f"texture import failed {f}")+ continue+ if ch == "orm":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_MASKS)+ elif ch == "normal":+ tx.set_editor_property("srgb", False)+ tx.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_NORMALMAP)+ tx.set_editor_property("flip_green_channel", True) # Blender bakes OpenGL (+Y) normals+ else:+ tx.set_editor_property("srgb", True)+ EAL.save_loaded_asset(tx, False)+ log(f"textures {min(i + 64, len(todo))}/{len(todo)} ({time.time() - t:.0f}s)")+ if extra:+ import_files(extra, f"{DEST}/Tex")+ l = EAL.load_asset(tex_path("lut_grade"))+ if l:+ l.set_editor_property("lod_group", unreal.TextureGroup.TEXTUREGROUP_COLOR_LOOKUP_TABLE)+ l.set_editor_property("compression_settings", unreal.TextureCompressionSettings.TC_VECTOR_DISPLACEMENTMAP)+ l.set_editor_property("srgb", False)+ l.set_editor_property("mip_gen_settings", unreal.TextureMipGenSettings.TMGS_NO_MIPMAPS)+ EAL.save_loaded_asset(l, False)+ s = EAL.load_asset(tex_path("sky"))+ if s:+ EAL.save_loaded_asset(s, False)+ REPORT["timings"]["textures_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ meshes++def mesh_folder(a):+ return f"{DEST}/Meshes/{a['asset']}"+++def find_mesh(a):+ for p in EAL.list_assets(mesh_folder(a), recursive=True, include_folder=False):+ d = unreal.EditorAssetLibrary.find_asset_data(p)+ if d.asset_class_path.asset_name == "StaticMesh":+ return EAL.load_asset(p)+ return None+++def pipeline_for(a):+ p = unreal.InterchangeGenericAssetsPipeline()+ mp = p.get_editor_property("mesh_pipeline")+ mp.set_editor_property("import_static_meshes", True)+ mp.set_editor_property("import_skeletal_meshes", False)+ mp.set_editor_property("build_nanite", a["tris"] > NANITE_TRIS and not a.get("glass"))+ mp.set_editor_property("generate_lightmap_u_vs", False)+ try:+ mp.set_editor_property("collision", False)+ except Exception:+ pass+ mat = p.get_editor_property("material_pipeline")+ mat.set_editor_property("import_materials", False)+ try:+ tp = mat.get_editor_property("texture_pipeline")+ tp.set_editor_property("import_textures", False)+ except Exception as ex: # noqa: BLE001+ log("texture pipeline", ex)+ cm = p.get_editor_property("common_meshes_properties")+ cm.set_editor_property("recompute_normals", False)+ cm.set_editor_property("recompute_tangents", False)+ cm.set_editor_property("use_mikk_t_space", True)+ cm.set_editor_property("remove_degenerates", False)+ return p+++def stage_meshes():+ t = time.time()+ im = unreal.InterchangeManager.get_interchange_manager_scripted()+ todo = [a for a in ASSETS if find_mesh(a) is None]+ log(f"meshes: importing {len(todo)} of {len(ASSETS)}")++ def queue(a):+ src = im.create_source_data(os.path.join(EXPORT, a["glb"]))+ prm = unreal.ImportAssetParameters()+ prm.is_automated = True+ prm.replace_existing = True+ pipe = pipeline_for(a)+ KEEP.append(pipe) # soft path to a transient pipeline: keep it alive until the import is done+ prm.override_pipelines = [unreal.SoftObjectPath(pipe.get_path_name())]+ im.import_asset(mesh_folder(a), src, prm)++ def flush(last):+ # UE 5.8 commandlet: the import queued last before wait_until_all_tasks_done() logs "start importing" and+ # never completes (1 in 16 meshes went missing). Queue the last asset a second time as a sacrificial+ # sentinel so the real import of it completes.+ queue(last)+ im.wait_until_all_tasks_done(True)++ for i, a in enumerate(todo):+ queue(a)+ if i % 16 == 15 or i == len(todo) - 1:+ flush(a)+ log(f"meshes {i + 1}/{len(todo)} ({time.time() - t:.0f}s)")+ for attempt in range(2):+ miss = [a for a in ASSETS if find_mesh(a) is None]+ if not miss:+ break+ log(f"meshes: retry {len(miss)} missing (pass {attempt + 1})")+ for a in miss:+ queue(a)+ flush(miss[-1])+ # Orientation check against the exporter's expected local bounds.+ checks = []+ for a in ASSETS[:40]:+ sm = find_mesh(a)+ if sm is None:+ warn(f"mesh missing after import: {a['asset']}")+ continue+ bb = sm.get_bounding_box()+ got = [bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z]+ exp = a["check_bounds"]["min"] + a["check_bounds"]["max"]+ exp = [min(exp[0], exp[3]), min(exp[1], exp[4]), min(exp[2], exp[5]), max(exp[0], exp[3]), max(exp[1], exp[4]), max(exp[2], exp[5])]+ err = max(abs(g - e) for g, e in zip(got, exp))+ checks.append(err)+ if err > 2.0:+ warn(f"bounds mismatch {a['asset']}: got {[round(x, 1) for x in got]} expected {[round(x, 1) for x in exp]}")+ REPORT["orientation_max_err_cm"] = max(checks) if checks else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm:+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["meshes_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ materials++def master_baked(masked=False):+ """M_AnyBaked (opaque) or M_AnyBakedMasked: same graph, opacity mask = ORM.R (baked Principled Alpha)."""+ name = "M_AnyBakedMasked" if masked else "M_AnyBaked"+ path = f"{DEST}/Materials/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset(name, f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+ n.set_editor_property("texture", unreal.load_asset(default))+ n.set_editor_property("sampler_type", stype)+ return n+ m.set_editor_property("used_with_nanite", True)+ bc = tex("BaseColor", -600, -200, "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ # The ORM default must itself be a linear TC_MASKS texture: an sRGB default (WhiteSquareTexture) fails the+ # master's compile ("Sampler type is Masks, should be Color") and every instance silently falls back to the+ # default grid material, while Nanite meshes using it vanish.+ orm_default = next((tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]) for a in scene["assets"]+ if a.get("tex", {}).get("orm") and EAL.does_asset_exist(tex_path(os.path.splitext(os.path.basename(a["tex"]["orm"]))[0]))), None)+ orm = tex("ORM", -600, 50, orm_default or "/Engine/EngineResources/WhiteSquareTexture", unreal.MaterialSamplerType.SAMPLERTYPE_MASKS)+ nrm = tex("Normal", -600, 300, "/Engine/EngineMaterials/DefaultNormal", unreal.MaterialSamplerType.SAMPLERTYPE_NORMAL)+ em = tex("Emissive", -600, 550, "/Engine/EngineResources/Black", unreal.MaterialSamplerType.SAMPLERTYPE_COLOR)+ es = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -600, 800)+ es.set_editor_property("parameter_name", "EmissiveScale")+ es.set_editor_property("default_value", 0.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -250, 600)+ MEL.connect_material_expressions(em, "RGB", mul, "A")+ MEL.connect_material_expressions(es, "", mul, "B")+ MEL.connect_material_property(bc, "RGB", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(orm, "G", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(orm, "B", unreal.MaterialProperty.MP_METALLIC)+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open+ if masked:+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_MASKED)+ # (MaterialExpressionDitherTemporalAA is not exposed to Python in 5.8: plain clip.)+ m.set_editor_property("opacity_mask_clip_value", 0.33)+ MEL.connect_material_property(orm, "R", unreal.MaterialProperty.MP_OPACITY_MASK)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_glass():+ path = f"{DEST}/Materials/M_AnyGlass"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnyGlass", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_TRANSLUCENT)+ m.set_editor_property("translucency_lighting_mode", unreal.TranslucencyLightingMode.TLM_SURFACE_PER_PIXEL_LIGHTING)+ m.set_editor_property("two_sided", True)+ c = MEL.create_material_expression(m, unreal.MaterialExpressionVectorParameter, -500, 0)+ c.set_editor_property("parameter_name", "Color")+ c.set_editor_property("default_value", unreal.LinearColor(1, 1, 1, 1))+ r = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 200)+ r.set_editor_property("parameter_name", "Roughness")+ r.set_editor_property("default_value", 0.05)+ o = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -500, 350)+ o.set_editor_property("parameter_name", "Opacity")+ o.set_editor_property("default_value", 0.25)+ MEL.connect_material_property(c, "", unreal.MaterialProperty.MP_BASE_COLOR)+ MEL.connect_material_property(r, "", unreal.MaterialProperty.MP_ROUGHNESS)+ MEL.connect_material_property(o, "", unreal.MaterialProperty.MP_OPACITY)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def master_sky():+ """Unlit sky dome: equirect texture looked up by view direction (Blender world, +Y at the image centre)."""+ path = f"{DEST}/Materials/M_AnySky"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ m = AT.create_asset("M_AnySky", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ m.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)+ # IsSky: the real-time sky light capture only sees sky-flagged materials, and without it the editor/-game+ # build stamps "YOUR SCENE CONTAINS A SKYDOME MESH WITH A SKY MATERIAL..." over every uncovered pixel.+ m.set_editor_property("is_sky", True)+ m.set_editor_property("two_sided", True)+ cv = MEL.create_material_expression(m, unreal.MaterialExpressionCameraVectorWS, -900, 0)+ cu = MEL.create_material_expression(m, unreal.MaterialExpressionCustom, -650, 0)+ cu.set_editor_property("code", "float3 d = -normalize(V); float3 b = float3(d.x, -d.y, d.z);\n"+ "float u = atan2(b.y, -b.x) / (2*3.14159265) + 0.5; float v = acos(clamp(b.z,-1,1)) / 3.14159265;\n"+ "return float2(frac(u + 0.25), v);")+ cu.set_editor_property("output_type", unreal.CustomMaterialOutputType.CMOT_FLOAT2)+ ci = unreal.CustomInput()+ ci.set_editor_property("input_name", "V")+ cu.set_editor_property("inputs", [ci])+ MEL.connect_material_expressions(cv, "", cu, "V")+ tx = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, -350, 0)+ tx.set_editor_property("parameter_name", "Sky")+ sky = EAL.load_asset(tex_path("sky"))+ if sky:+ tx.set_editor_property("texture", sky)+ tx.set_editor_property("sampler_type", unreal.MaterialSamplerType.SAMPLERTYPE_LINEAR_COLOR)+ MEL.connect_material_expressions(cu, "", tx, "UVs")+ sc = MEL.create_material_expression(m, unreal.MaterialExpressionScalarParameter, -350, 250)+ sc.set_editor_property("parameter_name", "Scale")+ sc.set_editor_property("default_value", 683.0)+ mul = MEL.create_material_expression(m, unreal.MaterialExpressionMultiply, -100, 50)+ MEL.connect_material_expressions(tx, "RGB", mul, "A")+ MEL.connect_material_expressions(sc, "", mul, "B")+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+++def mi(name, parent):+ path = f"{DEST}/Materials/MI/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+ f = unreal.MaterialInstanceConstantFactoryNew()+ m = AT.create_asset(name, f"{DEST}/Materials/MI", unreal.MaterialInstanceConstant, f)+ MEL.set_material_instance_parent(m, parent)+ return m+++def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()+ masked = master_baked(masked=True) if any(a.get("alpha") for a in ASSETS) else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+ m = mi("MI_" + a["asset"], masked if a.get("alpha") else baked)+ MEL.set_material_instance_parent(m, masked if a.get("alpha") else baked) # existing MI: reparent+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+ tx = EAL.load_asset(tex_path(os.path.splitext(os.path.basename(rel))[0]))+ if tx:+ MEL.set_material_instance_texture_parameter_value(m, pname, tx)+ if a.get("emissive"):+ MEL.set_material_instance_scalar_parameter_value(m, "EmissiveScale", a["emissive_scale"] * scene["lm_per_w"])+ EAL.save_loaded_asset(m, False)+ mats = [m]+ for k, g in enumerate(a.get("glass", [])):+ gm = mi(f"MI_{a['asset']}_glass{k}", glass)+ c = g["color"]+ MEL.set_material_instance_vector_parameter_value(gm, "Color", unreal.LinearColor(c[0], c[1], c[2], 1))+ MEL.set_material_instance_scalar_parameter_value(gm, "Roughness", g["roughness"])+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ n = sm.get_num_sections(0)+ if n < len(mats) and not a.get("tex"):+ # All-glass mesh: glTF drops the unused BAKED slot 0, so section 0 is the first glass slot.+ mats = mats[1:]+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+ warn(f"{a['asset']}: {n} sections vs {len(mats)} materials")+ EAL.save_loaded_asset(sm, False)+ REPORT["timings"]["materials_s"] = round(time.time() - t)+++# ------------------------------------------------------------------ level++def V(v):+ return unreal.Vector(v[0], v[1], v[2])+++def rot_fu(f, u):+ return unreal.MathLibrary.make_rot_from_xz(V(f), V(u))+++def spawn_mesh(eas, sm, loc, rot):+ """spawn_actor_from_object returns None in the pythonscript commandlet (no actor factory); spawn by class."""+ act = eas.spawn_actor_from_class(unreal.StaticMeshActor, loc, rot)+ act.static_mesh_component.set_static_mesh(sm)+ return act+++def stage_level():+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ # delete_asset on a map silently fails in the commandlet: remove the .umap file itself (nothing has loaded it yet).+ umap = os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_content_dir()),+ lpath[len("/Game/"):] + ".umap")+ if os.path.exists(umap):+ os.remove(umap)+ unreal.AssetRegistryHelpers.get_asset_registry().scan_files_synchronous([umap], True)+ if not les.new_level(lpath):+ raise RuntimeError(f"new_level failed for {lpath}")+ by = {a["asset"]: a for a in scene["assets"]}+ meshes = {}+ n = 0+ for p in scene["placements"]:+ a = by.get(p["asset"])+ if a is None:+ continue+ if p["asset"] not in meshes:+ meshes[p["asset"]] = find_mesh(a)+ sm = meshes[p["asset"]]+ if sm is None:+ continue+ q = p["quat"]+ rot = unreal.Quat(q[0], q[1], q[2], q[3]).rotator()+ act = spawn_mesh(eas, sm, V(p["loc"]), rot)+ act.set_actor_scale3d(V(p["scale"]))+ act.set_actor_label(p["name"])+ act.set_folder_path("Meshes")+ c = act.static_mesh_component+ c.set_editor_property("cast_shadow", p.get("shadow", True))+ if not p.get("camera_visible", True):+ c.set_editor_property("visible_in_ray_tracing", True)+ c.set_editor_property("hidden_in_game", True)+ n += 1+ log(f"level: {n} mesh actors")+ # Lights.+ nl = 0+ for L in scene["lights"]:+ loc = V(L["loc"])+ rot = rot_fu(L["forward"], L["up"])+ if L["type"] == "POINT":+ act = eas.spawn_actor_from_class(unreal.PointLight, loc, rot)+ elif L["type"] == "SPOT":+ act = eas.spawn_actor_from_class(unreal.SpotLight, loc, rot)+ elif L["type"] == "AREA":+ act = eas.spawn_actor_from_class(unreal.RectLight, loc, rot)+ elif L["type"] == "SUN":+ act = eas.spawn_actor_from_class(unreal.DirectionalLight, loc, rot)+ else:+ warn(f"light type {L['type']} skipped ({L['name']})")+ continue+ act.set_actor_label(L["name"])+ act.set_folder_path("Lights")+ c = act.light_component+ c.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ c.set_light_color(unreal.LinearColor(*L["color"], 1.0), True)+ if L["type"] == "SUN":+ c.set_editor_property("intensity", L["lux"])+ c.set_editor_property("light_source_angle", L.get("angle_deg", 0.5))+ else:+ c.set_editor_property("intensity_units", unreal.LightUnits.CANDELAS)+ c.set_editor_property("intensity", L["candela"])+ c.set_editor_property("attenuation_radius", L["attenuation_radius"])+ if L["type"] in ("POINT", "SPOT"):+ c.set_editor_property("source_radius", L["source_radius"])+ c.set_editor_property("soft_source_radius", 0.0)+ if L["type"] == "SPOT":+ c.set_editor_property("outer_cone_angle", L["outer_cone"])+ c.set_editor_property("inner_cone_angle", L["inner_cone"])+ if L["type"] == "AREA":+ c.set_editor_property("source_width", max(L["width"], 1.0))+ c.set_editor_property("source_height", max(L["height"], 1.0))+ spread = L.get("spread_deg", 180)+ c.set_editor_property("barn_door_angle", min(spread / 2, 88.0))+ c.set_editor_property("barn_door_length", 0.0 if spread >= 179 else 20.0)+ c.set_editor_property("cast_shadows", L["cast_shadows"])+ c.set_editor_property("specular_scale", L["specular"])+ c.set_editor_property("diffuse_scale", L["diffuse"])+ c.set_editor_property("volumetric_scattering_intensity", L["volume"])+ nl += 1+ log(f"level: {nl} lights")+ # Cameras.+ for C in scene["cameras"]:+ act = eas.spawn_actor_from_class(unreal.CineCameraActor, V(C["loc"]), rot_fu(C["forward"], C["up"]))+ act.set_actor_label(C["name"])+ act.set_folder_path("Cameras")+ cc = act.get_cine_camera_component()+ fb = cc.get_editor_property("filmback")+ fb.set_editor_property("sensor_width", C["sensor_width_mm"])+ fb.set_editor_property("sensor_height", C["sensor_height_mm"])+ cc.set_editor_property("filmback", fb)+ cc.set_editor_property("current_focal_length", C["lens_mm"])+ cc.set_editor_property("current_aperture", C["dof"]["fstop"] if C["dof"]["enabled"] else 22.0)+ fs = cc.get_editor_property("focus_settings")+ fs.set_editor_property("focus_method", unreal.CameraFocusMethod.MANUAL if C["dof"]["enabled"] else unreal.CameraFocusMethod.DISABLE)+ fs.set_editor_property("manual_focus_distance", C["dof"]["focus_cm"])+ cc.set_editor_property("focus_settings", fs)+ if any(abs(s) > 1e-4 for s in C["shift"]):+ warn(f"{C['name']}: lens shift {C['shift']} has no CineCamera equivalent")+ # Sky dome + sky light.+ w = scene.get("world") or {}+ sky_mat = master_sky() if EAL.does_asset_exist(tex_path("sky")) else None+ if sky_mat:+ dome = spawn_mesh(eas, unreal.load_asset("/Engine/EngineMeshes/Sphere"), unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ dome.set_actor_scale3d(unreal.Vector(4000, 4000, 4000))+ dome.set_actor_label("SkyDome")+ dome.static_mesh_component.set_material(0, sky_mat)+ dome.static_mesh_component.set_editor_property("cast_shadow", False)+ sl = eas.spawn_actor_from_class(unreal.SkyLight, unreal.Vector(0, 0, 500), unreal.Rotator(0, 0, 0))+ sl.set_actor_label("SkyLight")+ slc = sl.get_component_by_class(unreal.SkyLightComponent)+ slc.set_editor_property("mobility", unreal.ComponentMobility.MOVABLE)+ slc.set_editor_property("real_time_capture", True)+ slc.set_editor_property("source_type", unreal.SkyLightSourceType.SLS_CAPTURED_SCENE)+ slc.set_editor_property("intensity", 1.0)+ # Fog: the largest low-density volume becomes the height fog; the rest become local fog volumes.+ vols = scene.get("volumes", {})+ haze = max(vols.items(), key=lambda kv: kv[1]["bounds_ue"]["extent"][0] * kv[1]["bounds_ue"]["extent"][1], default=(None, None))+ fog = eas.spawn_actor_from_class(unreal.ExponentialHeightFog, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ fog.set_actor_label("HeightFog")+ fc = fog.component+ if haze[1]:+ h = haze[1]+ d = [max(x, 1e-6) for x in h["density"]]+ z0 = h["bounds_m"]["lo"][2]+ z1 = h["bounds_m"]["hi"][2]+ zs = [z0 + f * (z1 - z0) for f in h["levels"]]+ k = math.log(d[0] / d[-1]) / max(zs[-1] - zs[0], 0.1) # per metre+ fog.set_actor_location(unreal.Vector(0, 0, zs[0] * 100), False, False)+ # UE height fog: extinction per cm = FogDensity / 1000 -> per metre FogDensity / 10; falloff per cm = F / 1000.+ fc.set_editor_property("fog_density", d[0] * 10.0)+ fc.set_editor_property("fog_height_falloff", k * 10.0)+ fc.set_editor_property("enable_volumetric_fog", True)+ fc.set_editor_property("volumetric_fog_scattering_distribution", min(h["anisotropy"], 0.9))+ al = h["albedo"]+ fc.set_editor_property("volumetric_fog_albedo", unreal.Color(r=int(al[0] * 255), g=int(al[1] * 255), b=int(al[2] * 255), a=255))+ mr = w.get("mean_radiance", [0.02, 0.02, 0.03])+ fc.set_editor_property("fog_inscattering_luminance", unreal.LinearColor(mr[0] * 683, mr[1] * 683, mr[2] * 683, 1))+ REPORT["haze"] = {"source": haze[0], "fog_density": d[0] * 10, "falloff": k * 10}+ for name, v in vols.items():+ if name == haze[0]:+ continue+ b = v["bounds_ue"]+ lf = eas.spawn_actor_from_class(unreal.LocalFogVolume, V(b["center"]), unreal.Rotator(0, 0, 0))+ lf.set_actor_label("LFV_" + name)+ lf.set_folder_path("Volumes")+ # Local fog volumes are unit spheres of radius 100 cm at scale 1 (assumed); scale to the box.+ lf.set_actor_scale3d(unreal.Vector(b["extent"][0] / 100, b["extent"][1] / 100, b["extent"][2] / 100))+ lc = lf.get_component_by_class(unreal.LocalFogVolumeComponent)+ dens = max(v["density"])+ emit = max(v["emission"])+ lc.set_editor_property("radial_fog_extinction", dens)+ lc.set_editor_property("height_fog_extinction", 0.0)+ al = v["albedo"]+ lc.set_editor_property("fog_albedo", unreal.LinearColor(al[0], al[1], al[2], 1))+ lc.set_editor_property("fog_phase_g", min(v["anisotropy"], 0.9))+ if emit > 0 and v.get("emission_color"):+ ec = v["emission_color"]+ lc.set_editor_property("radial_fog_extinction", 1.0)+ lc.set_editor_property("fog_emissive", unreal.LinearColor(ec[0] * emit, ec[1] * emit, ec[2] * emit, 1))+ if v.get("animated"):+ warn(f"volume {name}: animated procedural density baked to a static local fog volume")+ # Post-process (grade).+ g = scene["grade"]+ ppv = eas.spawn_actor_from_class(unreal.PostProcessVolume, unreal.Vector(0, 0, 0), unreal.Rotator(0, 0, 0))+ ppv.set_actor_label("Grade")+ ppv.set_editor_property("unbound", True)+ s = ppv.settings+ def ov(k, v):+ s.set_editor_property("override_" + k, True)+ s.set_editor_property(k, v)+ ov("auto_exposure_method", unreal.AutoExposureMethod.AEM_MANUAL)+ ov("auto_exposure_apply_physical_camera_exposure", False)+ bias = g["exposure"] - math.log2(scene["lm_per_w"]) + EXPO_OFF+ ov("auto_exposure_bias", bias)+ glare = next((n for n in g.get("compositor", []) if "Glare" in n["type"]), None)+ if glare:+ ov("bloom_intensity", float(glare["inputs"].get("Strength", 0.35)))+ ov("bloom_threshold", -1.0)+ ff = g.get("ffmpeg") or {}+ if "vignette_angle_rad" in ff:+ ov("vignette_intensity", min(1.0, ff["vignette_angle_rad"] / (math.pi / 4) * 0.45))+ if "chromatic_px" in ff:+ ov("scene_fringe_intensity", 0.6)+ if "grain_strength" in ff:+ ov("film_grain_intensity", ff["grain_strength"] / 100.0)+ lut = EAL.load_asset(tex_path("lut_grade"))+ if lut:+ ov("color_grading_lut", lut)+ ov("color_grading_intensity", 1.0)+ ov("motion_blur_amount", 0.0)+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+ hero_name = os.environ.get("ANYSCENE_HERO_CAM", "cam_street")+ hero = next((c for c in scene["cameras"] if c["name"] == hero_name), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+ if not les.save_current_level():+ unreal.EditorLoadingAndSavingUtils.save_map(unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world(), lpath)+ REPORT["timings"]["level_s"] = round(time.time() - t)+ REPORT["actors"] = {"meshes": n, "lights": nl, "cameras": len(scene["cameras"])}+++def stage_sequences():+ """One single-shot LevelSequence per scene camera (camera cut bound to the CineCameraActor) plus a saved MRQ+ primary config, so a still or clip renders headless with:+ UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen ..."""+ t = time.time()+ les = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ lpath = f"{DEST}/{LEVEL}"+ les.load_level(lpath)+ fps = scene["grade"].get("fps", 24)+ for C in scene["cameras"]:+ cam = next((a for a in eas.get_all_level_actors() if a.get_actor_label() == C["name"]), None)+ if cam is None:+ continue+ sp = f"{DEST}/Sequences/SEQ_{C['name']}"+ if EAL.does_asset_exist(sp):+ EAL.delete_asset(sp)+ seq = AT.create_asset(f"SEQ_{C['name']}", f"{DEST}/Sequences", unreal.LevelSequence, unreal.LevelSequenceFactoryNew())+ seq.set_display_rate(unreal.FrameRate(fps, 1))+ seq.set_playback_start(0)+ seq.set_playback_end(48)+ b = seq.add_possessable(cam)+ try:+ track = seq.add_track(unreal.MovieSceneCameraCutTrack)+ except Exception:+ track = seq.add_master_track(unreal.MovieSceneCameraCutTrack)+ sec = track.add_section()+ sec.set_range(0, 48)+ bid = unreal.MovieSceneObjectBindingID()+ bid = seq.get_binding_id(b) if hasattr(seq, "get_binding_id") else unreal.MovieSceneSequenceExtensions.get_binding_id(seq, b)+ sec.set_camera_binding_id(bid)+ EAL.save_loaded_asset(seq, False)+ # MRQ configs: MRQ_Still = deferred + PNG (UE tone curve + grade LUT); MRQ_Linear = EXR with the tone curve off+ # (scene-linear, already exposed) so Blender's AgX view transform can be applied to the Unreal lighting.+ res = scene["grade"].get("resolution", [1920, 804])+ for name, linear in (("MRQ_Still", False), ("MRQ_Linear", True)):+ cp = f"{DEST}/MRQ/{name}"+ if EAL.does_asset_exist(cp):+ EAL.delete_asset(cp)+ cfg = AT.create_asset(name, f"{DEST}/MRQ", unreal.MoviePipelinePrimaryConfig, None)+ if cfg is None:+ warn("could not create MoviePipelinePrimaryConfig asset")+ continue+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineDeferredPassBase)+ if linear:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_EXR)+ col = cfg.find_or_add_setting_by_class(unreal.MoviePipelineColorSetting)+ col.set_editor_property("disable_tone_curve", True)+ else:+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineImageSequenceOutput_PNG)+ cfg.find_or_add_setting_by_class(unreal.MoviePipelineGameOverrideSetting)+ out = cfg.find_or_add_setting_by_class(unreal.MoviePipelineOutputSetting)+ out.output_directory = unreal.DirectoryPath(os.path.join(EXPORT, "..", "compare", "mrq").replace("\\", "/"))+ out.file_name_format = "{sequence_name}" + ("_linear" if linear else "") + ".{frame_number}"+ out.output_resolution = unreal.IntPoint(res[0], res[1])+ out.use_custom_playback_range = True+ out.custom_start_frame, out.custom_end_frame = 0, 1+ aa = cfg.find_or_add_setting_by_class(unreal.MoviePipelineAntiAliasingSetting)+ aa.override_anti_aliasing = True+ aa.anti_aliasing_method = unreal.AntiAliasingMethod.AAM_TSR+ aa.temporal_sample_count = 8+ aa.engine_warm_up_count = 64+ aa.render_warm_up_frames = True+ EAL.save_loaded_asset(cfg, False)+ REPORT["timings"]["sequences_s"] = round(time.time() - t)+++for st in STAGES:+ log("stage", st)+ {"textures": stage_textures, "meshes": stage_meshes, "materials": stage_materials, "level": stage_level,+ "sequences": stage_sequences}[st]()+REPORT["total_s"] = round(time.time() - T0)+json.dump(REPORT, open(os.path.join(EXPORT, "build_report.json"), "w"), indent=1)+log("done", json.dumps(REPORT)[:2000])diff --git a/unreal_ramen/csv_summary.sh b/unreal_ramen/csv_summary.shnew file mode 100644index 0000000..1a3f187--- /dev/null+++ b/unreal_ramen/csv_summary.sh@@ -0,0 +1,16 @@+#!/usr/bin/env bash+# Summarise an Unreal CSV profile: mean / p50 / p95 of frame, game, render, RHI and GPU time plus the top GPU passes.+# bash csv_summary.sh <Profile(...).csv> [skip_first_frames=60]+f="$1"; skip="${2:-60}"+awk -F, -v skip="$skip" '+NR==1 { for (i=1;i<=NF;i++) col[$i]=i; next }+$1 ~ /^\[/ || NF < 10 { next }+{ n++; if (n<=skip) next; m+++ for (k in col) if (k=="FrameTime"||k=="GameThreadTime"||k=="RenderThreadTime"||k=="RHIThreadTime"||k=="GPUTime"||k ~ /^GPU\//) { v=$(col[k])+0; s[k]+=v; a[k,m]=v } }+END {+ printf "frames=%d (after skipping %d)\n", m, skip+ split("FrameTime GameThreadTime RenderThreadTime RHIThreadTime GPUTime", ks, " ")+ for (j=1;j<=5;j++) { k=ks[j]; c=0; for (i=1;i<=m;i++) t[++c]=a[k,i]; asort(t); printf "%-17s mean %6.2f ms p50 %6.2f p95 %6.2f\n", k, s[k]/m, t[int(c*0.5)], t[int(c*0.95)]; delete t }+ printf "fps(mean frame) %.1f\n", 1000/(s["FrameTime"]/m)+ for (k in s) if (k ~ /^GPU\//) printf "%8.3f %s\n", s[k]/m, k | "sort -rn | head -12"+}' "$f"diff --git a/unreal_ramen/export.sh b/unreal_ramen/export.shnew file mode 100644index 0000000..e626c78--- /dev/null+++ b/unreal_ramen/export.sh@@ -0,0 +1,25 @@+#!/usr/bin/env bash+# export_blend.py through the GPU queue, resumed until it finishes. Blender 5.0.1 Cycles bake crashes intermittently+# (EXCEPTION_ACCESS_VIOLATION in OpenImageIO ustring::operator= under ccl::create_mesh, ~1 per 250 bakes, a different+# asset each time); the exporter skips assets whose GLB/texture already exist, so a rerun resumes where it died.+# bash unreal/export.sh <copy.blend> <out_dir> [export_blend.py args...] (log: <out_dir>/export.log)+# EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py" EXPORT_NOQUEUE=1 (CPU bake: skip pipeline/gpu_run.sh)+A="$(cd "$(dirname "$0")/.." && pwd)"+. "$A/pipeline/env.sh"+blend="$1"; out="$2"; shift 2+mkdir -p "$out"+: > "$out/export.log"+pre=()+[ -n "$EXPORT_PRE" ] && pre=(--python "$EXPORT_PRE")+for i in $(seq 1 "${EXPORT_TRIES:-6}"); do+ q=(bash "$A/pipeline/gpu_run.sh"); [ -n "$EXPORT_NOQUEUE" ] && q=()+ # The exporter next to this script (not $A/unreal/): per-scene copies of unreal/ then run their own exporter.+ "${q[@]}" "$BLENDER" -b "$blend" "${pre[@]}" --python "$(cd "$(dirname "$0")" && pwd -W 2>/dev/null || pwd)/export_blend.py" -- --out "$out" "$@" \+ >> "$out/export.log" 2>&1+ rc=$?+ if grep -q "^EXPORT wrote" "$out/export.log"; then echo "export: done after $i run(s)"; exit 0; fi+ # rc 0 without "wrote" is a Python exception (Blender exits 0 on those): retrying will not help.+ [ "$rc" = 0 ] && { echo "export: python error, see $out/export.log"; exit 1; }+ echo "export: run $i exited rc=$rc without finishing; resuming" | tee -a "$out/export.log"+done+echo "export: gave up after ${EXPORT_TRIES:-6} runs"; exit 1diff --git a/unreal_ramen/export_blend.py b/unreal_ramen/export_blend.pynew file mode 100644index 0000000..64ecb45--- /dev/null+++ b/unreal_ramen/export_blend.py@@ -0,0 +1,1056 @@+"""AnyScene -> Unreal export: bake every surface material to PBR textures, export one GLB per unique mesh, and write+scene.json (placements, lights, cameras, world, volumes, grade) in Unreal units and axes.++ blender -b <COPY of scene.blend> --python export_blend.py -- --out <dir> [--frame 60] [--only a,b] [--limit N]+ [--density 1024] [--max-res 4096] [--grade-sh scenes/<id>/scripts/grade.sh] [--ffmpeg path]+ [--dof '{"cam_street": [9.5, 2.8]}'] [--no-bake] [--cpu-threads 0]++Never saves the .blend (it modifies the open file in memory: new UV layers, converted text/curves). Rerunnable:+textures and GLBs that already exist are skipped (delete <out>/tex/<asset>_* or <out>/mesh/<asset>.glb to redo one).++Conventions written to scene.json+ * Space: Unreal (cm, X forward, Y right, Z up, left-handed). Blender (x, y, z) m -> Unreal (x, -y, z) * 100.+ Object transforms are S*M*S with S = diag(1,-1,1), given as location, quaternion (x,y,z,w) and scale.+ * Mesh GLBs are exported in object-local space at identity; the Unreal importer maps glTF to its own axes, so+ build_level.py checks the result against "check_bounds" for the first assets.+ * Photometry: 683 lm/W. Point/spot cd = 683 * P / (4 pi); area cd = 683 * P / pi; sun lux = 683 * S;+ emissive nits = 683 * strength; sky radiance x 683. Exposure: Blender pixel = L_b * 2^exposure, so the Unreal+ manual exposure is EV100 = log2(683 / 1.2) - exposure (written as grade.ev100).+ * Bake: every surface material (procedural or not) is baked per unique mesh into one texture set on a bake UV:+ BaseColor (sRGB png), ORM (R=1, G=roughness, B=metallic, linear png), Normal (tangent, OpenGL +Y, png, only if a+ material perturbs the normal), Emissive (sRGB png + scale, only if emissive). Glass slots (transmission > 0.5)+ are not baked: they keep their own material slot and parameters.+"""+import bmesh # noqa: F401 (kept for hand edits)+import json+import math+import os+import re+import subprocess+import sys+import time++import bpy+import numpy as np+from mathutils import Matrix, Vector++LM_PER_W = 683.0+argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+++def arg(name, default=None):+ return argv[argv.index(name) + 1] if name in argv else default+++OUT = os.path.abspath(arg("--out", "unreal_export"))+FRAME = int(arg("--frame", "60"))+ONLY = set(x for x in arg("--only", "").split(",") if x)+LIMIT = int(arg("--limit", "0"))+DENSITY = float(arg("--density", "1024")) # bake px per metre of sqrt(surface area)+MAX_RES = int(arg("--max-res", "4096"))+NO_BAKE = "--no-bake" in argv+DOF = json.loads(arg("--dof", "{}"))+GRADE_SH = arg("--grade-sh")+FFMPEG = arg("--ffmpeg", os.environ.get("FFMPEG", "ffmpeg")) # pipeline/env.sh exports FFMPEG (ffmpeg is not on PATH here)+THREADS = int(arg("--cpu-threads", "0"))+GPU = "--gpu" in argv # bake with OptiX (run through pipeline/gpu_run.sh)+REVERSE = "--reverse" in argv # walk assets from the end: a second process can share the work++SRC = bpy.data.filepath+if not SRC or os.path.basename(SRC) == "hk.blend" and "scenes" in SRC.replace("\\", "/").split("/"):+ print("export_blend: refusing to run on a scene's own .blend; open a copy", flush=True)+ sys.exit(1)++for d in ("mesh", "tex", "world", "grade"):+ os.makedirs(os.path.join(OUT, d), exist_ok=True)++sc = bpy.context.scene+sc.frame_set(FRAME)+S = Matrix.Diagonal((1.0, -1.0, 1.0, 1.0))+LOG = []+++def log(*a):+ s = " ".join(str(x) for x in a)+ LOG.append(s)+ print("EXPORT", s, flush=True)+++def ue_vec(v, scale=100.0):+ return [v[0] * scale, -v[1] * scale, v[2] * scale]+++def ue_xform(mw):+ t = S @ mw @ S+ loc, rot, scl = t.decompose()+ return {"loc": [loc.x * 100, loc.y * 100, loc.z * 100], "quat": [rot.x, rot.y, rot.z, rot.w], "scale": list(scl)}+++def ue_axes(mw):+ """Forward (-Z local) and up (+Y local) of a Blender camera/light in Unreal axes."""+ r = mw.to_3x3().normalized()+ f = r @ Vector((0, 0, -1))+ u = r @ Vector((0, 1, 0))+ return [f.x, -f.y, f.z], [u.x, -u.y, u.z]+++def safe(name):+ return re.sub(r"[^A-Za-z0-9_]", "_", name)[:60]+++# ------------------------------------------------------------------ material inspection++def output_node(nt):+ outs = [n for n in nt.nodes if n.type == "OUTPUT_MATERIAL"]+ for n in outs:+ if n.is_active_output:+ return n+ return outs[0] if outs else None+++def surface_shader(m):+ if not m or not m.node_tree:+ return None+ o = output_node(m.node_tree)+ if not o or not o.inputs["Surface"].is_linked:+ return None+ return o.inputs["Surface"].links[0].from_node+++def is_volume_only(m):+ if not m or not m.node_tree:+ return False+ o = output_node(m.node_tree)+ return bool(o and o.inputs["Volume"].is_linked and not o.inputs["Surface"].is_linked)+++def find_principled(m):+ sh = surface_shader(m)+ if sh is None:+ return None+ if sh.type == "BSDF_PRINCIPLED":+ return sh+ # Mix shaders etc.: first principled upstream.+ seen, stack = set(), [sh]+ while stack:+ n = stack.pop()+ if n.name in seen:+ continue+ seen.add(n.name)+ if n.type == "BSDF_PRINCIPLED":+ return n+ for i in n.inputs:+ for l in i.links:+ stack.append(l.from_node)+ return None+++def is_glass(m):+ p = find_principled(m)+ if p is not None:+ return (not p.inputs["Transmission Weight"].is_linked) and p.inputs["Transmission Weight"].default_value > 0.5+ sh = surface_shader(m)+ return sh is not None and sh.type in ("BSDF_GLASS", "BSDF_REFRACTION")+++def glass_params(m):+ p = find_principled(m)+ if p is None:+ return {"color": [1, 1, 1], "roughness": 0.0, "ior": 1.45}+ c = p.inputs["Base Color"].default_value+ return {"color": [c[0], c[1], c[2]], "roughness": p.inputs["Roughness"].default_value,+ "ior": p.inputs["IOR"].default_value, "alpha": p.inputs["Alpha"].default_value}+++def emissive(m):+ sh = surface_shader(m)+ if sh is None:+ return False+ if sh.type == "EMISSION":+ return True+ p = find_principled(m)+ if p is None:+ return False+ s = p.inputs["Emission Strength"]+ c = p.inputs["Emission Color"]+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))+++def cuts_out(m):+ """Principled Alpha linked or below 1 (decals keyed from luminance, stickers): baked into ORM.R, masked in UE."""+ p = find_principled(m)+ return bool(p and (p.inputs["Alpha"].is_linked or p.inputs["Alpha"].default_value < 0.999))+++def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+++def uses_object_dependence(m):+ """Nodes whose result depends on the object it sits on (bakes per representative instance)."""+ if not m or not m.node_tree:+ return []+ hits = set()+ def walk(nt):+ for n in nt.nodes:+ if n.type in ("OBJECT_INFO", "AMBIENT_OCCLUSION", "NEW_GEOMETRY", "BEVEL"):+ hits.add(n.type)+ if n.type == "TEX_COORD":+ for k in ("Object", "Generated"):+ if n.outputs[k].is_linked:+ hits.add("COORD_" + k)+ if n.type == "GROUP" and n.node_tree:+ walk(n.node_tree)+ walk(m.node_tree)+ return sorted(hits)+++def animated(m):+ ad = m.node_tree.animation_data if m and m.node_tree else None+ return bool(ad and (ad.drivers or ad.action))+++# ------------------------------------------------------------------ scene classification++def particle_instancers():+ srcs, emitters = set(), set()+ for o in sc.objects:+ for md in o.modifiers:+ if md.type == "PARTICLE_SYSTEM":+ st = md.particle_system.settings+ emitters.add(o.name)+ if st.render_type == "OBJECT" and st.instance_object:+ srcs.add(st.instance_object.name)+ if st.render_type == "COLLECTION" and st.instance_collection:+ srcs.update(x.name for x in st.instance_collection.all_objects)+ return srcs, emitters+++def mesh_key(o):+ if o.type == "MESH" and not any(md.show_render for md in o.modifiers):+ return "m_" + o.data.name+ return "o_" + o.name+++def tri_count(me):+ me.calc_loop_triangles()+ return len(me.loop_triangles)+++def render_uv(me):+ return next((l for l in me.uv_layers if l.active_render), None) or me.uv_layers.active+++def uv_ok(me):+ """True if the active render UV is a usable non-overlapping atlas inside 0..1 (generated-prop style)."""+ uvl = render_uv(me)+ if uvl is None or len(me.loop_triangles) == 0:+ return False+ n = len(me.loops)+ uv = np.empty(n * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ if uv.min() < -0.01 or uv.max() > 1.01:+ return False+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ total = float(a.sum())+ if total > 1.02 or total < 0.05:+ return False+ # Coarse overlap check: rasterise triangle centroids+vertices into a 512 grid weighted by area.+ g = 512+ idx = np.clip((t.mean(axis=1) * g).astype(np.int32), 0, g - 1)+ occ = np.zeros((g, g), np.float64)+ np.add.at(occ, (idx[:, 1], idx[:, 0]), a)+ return float(occ.max()) < 4.0 / (g * g) + 1e-4 or total < 0.9+++def surface_area(o, me):+ mw = o.matrix_world+ me.calc_loop_triangles()+ co = np.empty(len(me.vertices) * 3, np.float32)+ me.vertices.foreach_get("co", co)+ co = co.reshape(-1, 3)+ m3 = np.array(mw.to_3x3())+ co = co @ m3.T+ vt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("vertices", vt)+ t = co[vt.reshape(-1, 3)]+ return float(0.5 * np.linalg.norm(np.cross(t[:, 1] - t[:, 0], t[:, 2] - t[:, 0]), axis=1).sum())+++def pow2(x, lo, hi):+ r = lo+ while r < x and r < hi:+ r *= 2+ return min(r, hi)+++# ------------------------------------------------------------------ baking++BAKE_SCENE = None+++def bake_scene():+ global BAKE_SCENE+ if BAKE_SCENE is None:+ bs = bpy.data.scenes.new("__bake")+ bs.render.engine = "CYCLES"+ bs.cycles.device = "GPU" if GPU else "CPU"+ bs.cycles.samples = 4+ bs.cycles.use_denoising = False+ bs.render.bake.margin = 8+ bs.render.bake.use_clear = True+ bs.render.bake.target = "IMAGE_TEXTURES"+ if THREADS:+ bs.render.threads_mode = "FIXED"+ bs.render.threads = THREADS+ bs.world = sc.world+ bs.frame_current = FRAME+ BAKE_SCENE = bs+ return BAKE_SCENE+++def run_bake(o, kind):+ bs = bake_scene()+ vl = bs.view_layers[0]+ with bpy.context.temp_override(scene=bs, view_layer=vl, object=o, active_object=o,+ selected_objects=[o], selected_editable_objects=[o]):+ if kind == "NORMAL":+ bpy.ops.object.bake(type="NORMAL", normal_space="TANGENT", margin=8, use_clear=True)+ else:+ bpy.ops.object.bake(type="EMIT", margin=8, use_clear=True)+++def _src(sock):+ return sock.links[0].from_socket if sock.is_linked else None+++class Rewire:+ """Temporarily route one Principled channel into an Emission shader on the material output."""++ def __init__(self, m, channel, img):+ self.m, self.nt = m, m.node_tree+ self.added, self.saved = [], None+ nt = self.nt+ out = output_node(nt)+ p = find_principled(m)+ sh = surface_shader(m)+ em = nt.nodes.new("ShaderNodeEmission")+ self.added.append(em)+ em.inputs["Strength"].default_value = 1.0+ col = em.inputs["Color"]+ if channel == "base":+ if p is not None:+ s = p.inputs["Base Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ elif sh is not None and sh.type == "EMISSION":+ col.default_value = (0, 0, 0, 1)+ elif sh is not None and "Color" in sh.inputs:+ s = sh.inputs["Color"]+ if s.is_linked:+ nt.links.new(_src(s), col)+ else:+ col.default_value = s.default_value+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+ # R=alpha (1 unless the material cuts out: decals, stickers; no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0+ if p is not None and p.inputs["Alpha"].is_linked:+ nt.links.new(_src(p.inputs["Alpha"]), cmb.inputs[0])+ elif p is not None:+ cmb.inputs[0].default_value = p.inputs["Alpha"].default_value+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+ else:+ cmb.inputs[i].default_value = p.inputs[k].default_value if p is not None else dv+ nt.links.new(cmb.outputs[0], col)+ elif channel == "emit":+ if sh is not None and sh.type == "EMISSION":+ for k in ("Color", "Strength"):+ s = sh.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[k])+ else:+ em.inputs[k].default_value = s.default_value+ elif p is not None:+ for k, ek in (("Emission Color", "Color"), ("Emission Strength", "Strength")):+ s = p.inputs[k]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs[ek])+ else:+ em.inputs[ek].default_value = s.default_value+ else:+ col.default_value = (0, 0, 0, 1)+ if out is not None:+ self.saved = _src(out.inputs["Surface"])+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ self.out = out+ self.tex = nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.added.append(self.tex)+ nt.nodes.active = self.tex++ def restore(self):+ nt = self.nt+ if self.out is not None:+ for l in list(self.out.inputs["Surface"].links):+ nt.links.remove(l)+ if self.saved is not None:+ nt.links.new(self.saved, self.out.inputs["Surface"])+ for n in self.added:+ nt.nodes.remove(n)+++class TargetOnly:+ """For the normal bake: keep the material, just add the active target image node."""++ def __init__(self, m, img):+ self.nt = m.node_tree+ self.tex = self.nt.nodes.new("ShaderNodeTexImage")+ self.tex.image = img+ self.nt.nodes.active = self.tex++ def restore(self):+ self.nt.nodes.remove(self.tex)+++def new_img(name, res, colorspace, is_float=False):+ old = bpy.data.images.get(name)+ if old:+ bpy.data.images.remove(old)+ w, h = (res, res) if isinstance(res, int) else res+ img = bpy.data.images.new(name, w, h, alpha=False, float_buffer=is_float)+ img.colorspace_settings.name = colorspace+ return img+++def save_png(img, path):+ img.filepath_raw = path+ img.file_format = "PNG"+ img.save()+++def bake_channel(o, mats, channel, res, path):+ cs = {"base": "sRGB", "orm": "Non-Color", "emit": "Linear Rec.709", "normal": "Non-Color"}[channel]+ img = new_img("__bake_" + channel, res, cs, is_float=(channel == "emit"))+ rw = []+ try:+ seen = set()+ for m in mats:+ if m is None or m.name in seen or m.node_tree is None:+ continue+ seen.add(m.name)+ rw.append(TargetOnly(m, img) if channel == "normal" else Rewire(m, channel, img))+ run_bake(o, "NORMAL" if channel == "normal" else "EMIT")+ finally:+ for r in rw:+ r.restore()+ scale = 1.0+ if channel == "emit":+ w, h = (res, res) if isinstance(res, int) else res+ px = np.empty(w * h * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mx = float(np.percentile(px.max(axis=1), 99.95)) if px.size else 0.0+ scale = max(mx, 1e-6)+ out = bpy.data.images.new("__emit_png", w, h, alpha=False)+ out.colorspace_settings.name = "sRGB"+ q = np.ones((w * h, 4), np.float32)+ q[:, :3] = np.clip(px / scale, 0, 1)+ out.pixels.foreach_set(q.ravel())+ save_png(out, path)+ bpy.data.images.remove(out)+ else:+ save_png(img, path)+ bpy.data.images.remove(img)+ return scale+++def uv_stats(me, name):+ """UV coords of a layer and the fraction of the 0..1 square its triangles cover."""+ uvl = me.uv_layers[name]+ uv = np.empty(len(me.loops) * 2, np.float32)+ uvl.data.foreach_get("uv", uv)+ uv = uv.reshape(-1, 2)+ me.calc_loop_triangles()+ lt = np.empty(len(me.loop_triangles) * 3, np.int32)+ me.loop_triangles.foreach_get("loops", lt)+ t = uv[lt.reshape(-1, 3)]+ a = 0.5 * np.abs((t[:, 1, 0] - t[:, 0, 0]) * (t[:, 2, 1] - t[:, 0, 1]) - (t[:, 2, 0] - t[:, 0, 0]) * (t[:, 1, 1] - t[:, 0, 1]))+ return uv, float(a.sum())+++def ensure_bake_uv(o, me_owner):+ """Pick the UV to bake into: a good existing atlas (square texture), or a fresh smart-projected 'bake' layer+ whose islands are stretched to fill 0..1 so long thin parts get a non-square texture instead of a mostly+ empty square one. Returns (uv name, kept, aspect w/h, uv coverage)."""+ me = me_owner.data+ if "bake" in me.uv_layers:+ me.uv_layers.active = me.uv_layers["bake"]+ return "bake", False, me_owner.get("_bake_aspect", 1.0), me_owner.get("_bake_cov", 0.5)+ me.calc_loop_triangles()+ if uv_ok(me):+ ar = render_uv(me)+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)+ ar_name = ar.name if ar is not None else None+ uvl = me.uv_layers.new(name="bake")+ if ar_name is not None:+ # Keep materials reading their original UVs. Look the layer up again: uv_layers.new() reallocates the+ # collection, and setting active_render through the old reference left NO render UV, so every image node+ # with an implicit UV sampled one texel (posters, flyers, calendars, decals baked to a flat colour).+ me.uv_layers[ar_name].active_render = True+ uvl = me.uv_layers["bake"]+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ vl.objects.active = me_owner+ me_owner.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ bpy.ops.mesh.select_all(action="SELECT")+ bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=False)+ try:+ bpy.ops.uv.select_all(action="SELECT")+ bpy.ops.uv.pack_islands(rotate=True, margin=0.003, shape_method="AABB", scale=True)+ except Exception as ex: # noqa: BLE001+ log("pack_islands failed", me_owner.name, ex)+ bpy.ops.object.mode_set(mode="OBJECT")+ me_owner.select_set(False)+ uv, _ = uv_stats(me, "bake")+ lo, hi = uv.min(axis=0), uv.max(axis=0)+ span = np.maximum(hi - lo, 1e-6)+ aspect = float(span[0] / span[1])+ uv = (uv - lo) / span * 0.99 + 0.005+ me.uv_layers["bake"].data.foreach_set("uv", uv.astype(np.float32).ravel()) # re-fetch: edit-mode toggles free the old layer pointer+ _, cov = uv_stats(me, "bake")+ me_owner["_bake_aspect"], me_owner["_bake_cov"] = aspect, cov+ return "bake", False, aspect, max(cov, 0.05)+++def bake_size(area, cov, aspect, kept):+ """Texture W,H so texel density is ~DENSITY px/m over the real surface; power of two, clamped."""+ d = DENSITY if area < 2 else DENSITY / 2 if area < 50 else DENSITY / 4 # big architecture: coarser texels+ px = d * d * area / cov+ lo = 1024 if kept else 32+ w = pow2(math.sqrt(px * aspect), lo, MAX_RES)+ h = pow2(math.sqrt(px / aspect), lo, MAX_RES)+ if kept:+ w = h = min(max(w, h), 2048) # generated props: their own atlas, 1-2K+ return w, h+++# ------------------------------------------------------------------ export++def to_mesh_object(o):+ """Text/curve objects -> real mesh objects (evaluated) in a scratch collection; originals hidden."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ n = bpy.data.objects.new(o.name + "__mesh", me)+ c = bpy.data.collections.get("__converted") or bpy.data.collections.new("__converted")+ if c.name not in sc.collection.children:+ sc.collection.children.link(c)+ c.objects.link(n)+ n.matrix_world = o.matrix_world.copy()+ for k in ("visible_shadow", "visible_camera", "visible_glossy", "visible_diffuse"):+ setattr(n, k, getattr(o, k))+ o.hide_render = True+ return n+++def export_glb(o, uv_name, glass_slots, path):+ """Evaluated mesh at identity with only the bake UV; slots: 0 = baked, 1+ = each glass material."""+ dg = bpy.context.evaluated_depsgraph_get()+ me = bpy.data.meshes.new_from_object(o.evaluated_get(dg), preserve_all_data_layers=True, depsgraph=dg)+ for l in [l for l in me.uv_layers if l.name != uv_name]:+ me.uv_layers.remove(l)+ if len(me.uv_layers):+ me.uv_layers[0].name = "UVMap"+ gl = list(glass_slots)+ mi = np.empty(len(me.polygons), np.int32)+ me.polygons.foreach_get("material_index", mi)+ remap = np.zeros(max(len(o.material_slots), 1), np.int32)+ for i in range(len(o.material_slots)):+ remap[i] = gl.index(i) + 1 if i in gl else 0+ mi = remap[np.clip(mi, 0, len(remap) - 1)]+ me.polygons.foreach_set("material_index", mi)+ me.materials.clear()+ base = bpy.data.materials.get("BAKED") or bpy.data.materials.new("BAKED")+ me.materials.append(base)+ for k, gi in enumerate(gl):+ gm = bpy.data.materials.get(f"GLASS_{k}") or bpy.data.materials.new(f"GLASS_{k}")+ me.materials.append(gm)+ tmp = bpy.data.objects.new("__export", me)+ sc.collection.objects.link(tmp)+ vl = bpy.context.view_layer+ for x in vl.objects:+ if x.select_get():+ x.select_set(False)+ tmp.select_set(True)+ vl.objects.active = tmp+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_apply=True,+ export_materials="PLACEHOLDER", export_texcoords=True, export_normals=True,+ export_tangents=True, export_yup=True, export_animations=False,+ export_cameras=False, export_lights=False, export_extras=False)+ bpy.data.objects.remove(tmp)+ bpy.data.meshes.remove(me)+++# ------------------------------------------------------------------ volumes++def sample_bounds(o):+ corners = [o.matrix_world @ Vector(c) for c in o.bound_box]+ lo = Vector([min(c[i] for c in corners) for i in range(3)])+ hi = Vector([max(c[i] for c in corners) for i in range(3)])+ return {"center": ue_vec((lo + hi) / 2), "extent": [(hi.x - lo.x) * 50, (hi.y - lo.y) * 50, (hi.z - lo.z) * 50]}+++def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+ m = next((m for m in o.data.materials if m and is_volume_only(m)), None)+ if m is None:+ return None+ pv = next((nd for nd in m.node_tree.nodes if nd.type == "PRINCIPLED_VOLUME"), None)+ if pv is None:+ return None+ me0 = o.data+ xs = [v.co.x for v in me0.vertices]+ ys = [v.co.y for v in me0.vertices]+ zs = [v.co.z for v in me0.vertices]+ lo, hi = Vector((min(xs), min(ys), min(zs))), Vector((max(xs), max(ys), max(zs)))+ res = {"levels": [], "density": [], "emission": [], "emission_color": None}+ for f in levels:+ z = lo.z + f * (hi.z - lo.z)+ me = bpy.data.meshes.new("__slice")+ me.from_pydata([(lo.x, lo.y, z), (hi.x, lo.y, z), (hi.x, hi.y, z), (lo.x, hi.y, z)], [], [(0, 1, 2, 3)])+ uv = me.uv_layers.new(name="UVMap")+ for i, c in enumerate([(0, 0), (1, 0), (1, 1), (0, 1)]):+ uv.data[i].uv = c+ me.use_auto_texspace = False+ me.texspace_location = me0.texspace_location+ me.texspace_size = me0.texspace_size+ sl = bpy.data.objects.new("__slice", me)+ sc.collection.objects.link(sl)+ sl.matrix_world = o.matrix_world.copy()+ mc = m.copy()+ me.materials.append(mc)+ nt = mc.node_tree+ pvc = next(nd for nd in nt.nodes if nd.type == "PRINCIPLED_VOLUME")+ out = output_node(nt)+ for l in list(out.inputs["Volume"].links):+ nt.links.remove(l)+ vals = {}+ for key, sock in (("density", "Density"), ("emission", "Emission Strength")):+ em = nt.nodes.new("ShaderNodeEmission")+ s = pvc.inputs[sock]+ if s.is_linked:+ nt.links.new(_src(s), em.inputs["Color"])+ else:+ em.inputs["Color"].default_value = (s.default_value,) * 3 + (1,)+ nt.links.new(em.outputs[0], out.inputs["Surface"])+ img = new_img("__vol", n, "Non-Color", is_float=True)+ tx = nt.nodes.new("ShaderNodeTexImage")+ tx.image = img+ nt.nodes.active = tx+ bs = bake_scene()+ bs.collection.objects.link(sl)+ try:+ run_bake(sl, "EMIT")+ finally:+ bs.collection.objects.unlink(sl)+ px = np.empty(n * n * 4, np.float32)+ img.pixels.foreach_get(px)+ vals[key] = float(px.reshape(-1, 4)[:, 0].mean())+ nt.nodes.remove(tx)+ nt.nodes.remove(em)+ bpy.data.images.remove(img)+ res["levels"].append(f)+ res["density"].append(vals["density"])+ res["emission"].append(vals["emission"])+ bpy.data.objects.remove(sl)+ bpy.data.meshes.remove(me)+ bpy.data.materials.remove(mc)+ c = pv.inputs["Color"].default_value+ res["albedo"] = [c[0], c[1], c[2]]+ res["anisotropy"] = pv.inputs["Anisotropy"].default_value+ ec = pv.inputs["Emission Color"]+ if ec.is_linked:+ # Sample the colour ramp if it is one (flame): mid-height colour as a representative.+ n0 = ec.links[0].from_node+ if n0.type == "VALTORGB":+ res["emission_color"] = list(n0.color_ramp.evaluate(0.6))[:3]+ else:+ res["emission_color"] = list(ec.default_value)[:3]+ mw = o.matrix_world+ corners = [mw @ Vector((x, y, z)) for x in (lo.x, hi.x) for y in (lo.y, hi.y) for z in (lo.z, hi.z)]+ wlo = Vector([min(c[i] for c in corners) for i in range(3)])+ whi = Vector([max(c[i] for c in corners) for i in range(3)])+ res["bounds_ue"] = {"center": ue_vec((wlo + whi) / 2), "extent": [(whi.x - wlo.x) * 50, (whi.y - wlo.y) * 50, (whi.z - wlo.z) * 50]}+ res["bounds_m"] = {"lo": list(wlo), "hi": list(whi)}+ res["material"] = m.name+ res["animated"] = animated(m)+ return res+++# ------------------------------------------------------------------ lights / cameras / world / grade++def light_entry(o):+ L = o.data+ col = Vector(L.color[:3])+ mx = max(col) or 1.0+ P = L.energy+ e = {"name": o.name, "type": L.type, "color": [c / mx for c in col], "energy_w": P,+ "cast_shadows": bool(getattr(L, "use_shadow", True)),+ "specular": 1.0 if getattr(o, "visible_glossy", True) else 0.0,+ "diffuse": 1.0 if getattr(o, "visible_diffuse", True) else 0.0,+ "volume": 1.0 if getattr(o, "visible_volume_scatter", True) else 0.0,+ "loc": ue_vec(o.matrix_world.translation), "animated": bool(L.animation_data and (L.animation_data.drivers or L.animation_data.action))}+ f, u = ue_axes(o.matrix_world)+ e["forward"], e["up"] = f, u+ k = mx # colour normalisation folds into intensity+ if L.type in ("POINT", "SPOT"):+ e["candela"] = LM_PER_W * P * k / (4 * math.pi)+ e["source_radius"] = L.shadow_soft_size * 100+ e["soft_falloff"] = bool(getattr(L, "use_soft_falloff", True))+ if L.type == "SPOT":+ outer = math.degrees(L.spot_size) / 2+ e["outer_cone"] = min(outer, 80.0)+ e["inner_cone"] = outer * (1 - L.spot_blend)+ if outer > 80:+ e["note"] = f"spot cone {outer * 2:.0f} deg > Unreal max 160: clamped"+ elif L.type == "AREA":+ e["candela"] = LM_PER_W * P * k / math.pi+ e["shape"] = L.shape+ sx = L.size+ sy = L.size_y if L.shape in ("RECTANGLE", "ELLIPSE") else L.size+ sxx, syy, _ = o.matrix_world.to_scale()+ e["width"], e["height"] = sx * sxx * 100, sy * syy * 100+ e["spread_deg"] = math.degrees(getattr(L, "spread", math.pi))+ elif L.type == "SUN":+ e["lux"] = LM_PER_W * P * k+ e["angle_deg"] = math.degrees(L.angle)+ # IES / gobo: node-based light textures.+ if L.use_nodes and L.node_tree:+ for nd in L.node_tree.nodes:+ if nd.type == "TEX_IES":+ e["ies"] = bpy.path.abspath(nd.filepath) if nd.mode == "EXTERNAL" else "internal:" + (nd.ies.name if nd.ies else "")+ if nd.type == "TEX_IMAGE" and nd.image:+ e["gobo"] = bpy.path.abspath(nd.image.filepath)+ att = math.sqrt(max(e.get("candela", 0), 1) / 3.0) * 100+ e["attenuation_radius"] = max(300.0, min(att, 8000.0))+ return e+++def camera_entry(o):+ c = o.data+ f, u = ue_axes(o.matrix_world)+ rx, ry = sc.render.resolution_x, sc.render.resolution_y+ sw = c.sensor_width if c.sensor_fit in ("AUTO", "HORIZONTAL") else c.sensor_height * rx / ry+ d = {"name": o.name, "type": c.type, "lens_mm": c.lens, "sensor_width_mm": sw, "sensor_height_mm": sw * ry / rx,+ "sensor_fit": c.sensor_fit, "shift": [c.shift_x, c.shift_y], "clip": [c.clip_start * 100, c.clip_end * 100],+ "loc": ue_vec(o.matrix_world.translation), "forward": f, "up": u,+ "dof": {"enabled": c.dof.use_dof, "focus_cm": c.dof.focus_distance * 100, "fstop": c.dof.aperture_fstop,+ "blades": c.dof.aperture_blades, "focus_object": c.dof.focus_object.name if c.dof.focus_object else None}}+ if o.name in DOF:+ fd, fs = DOF[o.name]+ d["dof"].update(enabled=True, focus_cm=fd * 100, fstop=fs, source="--dof override (stills script)")+ return d+++def world_bake(path, w=2048, h=1024, spp=32):+ ws = bpy.data.scenes.new("__world")+ ws.world = sc.world+ ws.render.engine = "CYCLES"+ ws.cycles.device = "CPU"+ ws.cycles.samples = spp+ ws.render.resolution_x, ws.render.resolution_y, ws.render.resolution_percentage = w, h, 100+ ws.view_settings.view_transform = "Standard"+ ws.render.image_settings.file_format = "OPEN_EXR"+ ws.render.image_settings.color_depth = "16"+ cd = bpy.data.cameras.new("__pano")+ cd.type = "PANO"+ try:+ cd.panorama_type = "EQUIRECTANGULAR"+ except Exception:+ cd.cycles.panorama_type = "EQUIRECTANGULAR"+ co = bpy.data.objects.new("__pano", cd)+ ws.collection.objects.link(co)+ co.rotation_euler = (math.radians(90), 0, math.radians(-90)) # looking +X? (equirect centre = -Y in Blender -> fixed below)+ co.rotation_euler = (math.radians(90), 0, 0)+ ws.camera = co+ ws.render.filepath = path+ with bpy.context.temp_override(scene=ws):+ bpy.ops.render.render(write_still=True, scene=ws.name)+ # mean radiance for the sky light estimate+ img = bpy.data.images.load(path)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ px = px.reshape(-1, 4)[:, :3]+ mean = px.mean(axis=0).tolist()+ bpy.data.images.remove(img)+ return {"equirect_exr": path, "mean_radiance": mean, "camera_note": "equirect centre looks along Blender +Y"}+++def compositor_nodes():+ # 5.0: compositing_node_group; Scene.node_tree is gone (use_nodes can still read True with no tree).+ tree = getattr(sc, "compositing_node_group", None) or getattr(sc, "node_tree", None)+ if tree is None:+ return []+ out = []+ for n in tree.nodes:+ d = {"type": n.bl_idname, "name": n.name, "inputs": {}}+ for i in n.inputs:+ if i.is_linked or not hasattr(i, "default_value"):+ continue+ v = i.default_value+ try:+ v = v if isinstance(v, str) else list(v)+ except TypeError:+ pass+ if isinstance(v, (int, float, str, list, bool)):+ d["inputs"][i.name] = v+ for k in ("glare_type", "quality", "blend_type"):+ if hasattr(n, k):+ d[k] = getattr(n, k)+ out.append(d)+ return out+++def ffmpeg_grade(grade_sh):+ """Pull GRADE="..." out of a scene's grade.sh; split into colour (LUT-able) and spatial filters."""+ txt = open(grade_sh, encoding="utf-8").read()+ m = re.search(r'GRADE="([^"]+)"', txt)+ if not m:+ return None+ filters = [f for f in m.group(1).split(",") if f]+ colour = [f for f in filters if f.split("=")[0] in ("curves", "hue", "eq", "colorbalance", "colorchannelmixer", "lutrgb", "colortemperature")]+ spatial = [f for f in filters if f not in colour]+ g = {"source": grade_sh, "filter": m.group(1), "colour": colour, "spatial": spatial}+ for f in spatial:+ if f.startswith("vignette"):+ a = re.search(r"angle=PI/([\d.]+)", f)+ g["vignette_angle_rad"] = math.pi / float(a.group(1)) if a else math.pi / 5+ if f.startswith("rgbashift"):+ g["chromatic_px"] = 1+ noise = re.search(r"noise=alls=(\d+)", txt)+ if noise:+ g["grain_strength"] = int(noise.group(1))+ return g+++def make_lut(colour_filters, path):+ """UE colour grading LUT (256x16, 16 slices of 16x16; R across a slice, G down, B by slice), with the ffmpeg+ colour filters applied. Unreal applies it after the tone curve, i.e. in display space, like ffmpeg on the PNG."""+ n = 16+ ident = os.path.join(os.path.dirname(path), "lut_identity.png")+ img = bpy.data.images.new("__lut", n * n, n, alpha=False)+ img.colorspace_settings.name = "Non-Color"+ px = np.zeros((n, n * n, 4), np.float32)+ for b in range(n):+ for g in range(n):+ for r in range(n):+ px[g, b * n + r] = (r / (n - 1), g / (n - 1), b / (n - 1), 1)+ # Blender rows go bottom-up; UE LUT row 0 (top) is G=0.+ img.pixels.foreach_set(px[::-1].ravel())+ save_png(img, ident)+ bpy.data.images.remove(img)+ if not colour_filters:+ return ident+ cmd = [FFMPEG, "-v", "error", "-y", "-i", ident, "-vf", ",".join(colour_filters), "-frames:v", "1", path]+ try:+ r = subprocess.run(cmd, capture_output=True, text=True)+ except OSError as ex:+ log("LUT ffmpeg not runnable (pass --ffmpeg or set FFMPEG):", FFMPEG, ex)+ return ident+ if r.returncode != 0:+ log("LUT ffmpeg failed:", r.stderr[:300])+ return ident+ return path+++# ------------------------------------------------------------------ main++def main():+ t0 = time.time()+ srcs, emitters = particle_instancers()+ report = {"skipped": [], "converted": [], "volumes": {}, "fx": [], "warnings": []}+ objs = []+ for o in list(sc.objects):+ if o.hide_render or not o.visible_get():+ if o.type in ("MESH", "FONT", "CURVE") and not o.hide_render:+ pass+ if o.hide_render:+ continue+ if o.name in srcs:+ report["skipped"].append([o.name, "particle instance source (exported as fx note)"])+ continue+ if o.name in emitters:+ st = [md.particle_system.settings for md in o.modifiers if md.type == "PARTICLE_SYSTEM"]+ report["fx"].append({"name": o.name, "kind": "particles", "count": sum(s.count for s in st),+ "instance": [s.instance_object.name if s.instance_object else None for s in st],+ "lifetime": [s.lifetime for s in st], "velocity": [list(s.object_align_factor) for s in st]})+ if not o.show_instancer_for_render:+ continue+ if o.type in ("FONT", "CURVE", "SURFACE", "META"):+ if o.type == "CURVE" and o.data.bevel_depth == 0 and not o.data.bevel_object and o.data.extrude == 0:+ report["skipped"].append([o.name, "curve without geometry"])+ continue+ n = to_mesh_object(o)+ report["converted"].append([o.name, o.type])+ objs.append(n)+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):+ fl = next((md for md in o.modifiers if md.type == "FLUID" and md.fluid_type == "DOMAIN"), None)+ if fl is not None:+ # Mantaflow smoke: the slice bake cannot see the cache grids, so it reads the shader's constant+ # density multiplier (8.0 on the ramen steam) and would become an opaque fog box. Niagara gap.+ d = fl.domain_settings+ report["fx"].append({"name": o.name, "kind": "mantaflow_" + d.domain_type.lower(),+ "cache": bpy.path.abspath(d.cache_directory), "resolution": d.resolution_max,+ "bounds_ue": sample_bounds(o)})+ log("volume", o.name, "is a Mantaflow domain: exported as an fx note, not a fog volume")+ continue+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+ log("volume", o.name, [round(x, 4) for x in v["density"]], [round(x, 2) for x in v["emission"]])+ continue+ objs.append(o)+ # Group by unique mesh.+ assets = {}+ for o in objs:+ k = mesh_key(o)+ assets.setdefault(k, []).append(o)+ keys = sorted(assets, key=lambda k: assets[k][0].name, reverse=REVERSE)+ if ONLY:+ keys = [k for k in keys if any(o.name in ONLY or o.name.split("__")[0] in ONLY for o in assets[k])]+ if LIMIT:+ keys = keys[:LIMIT]+ log(f"{len(objs)} mesh objects -> {len(assets)} unique meshes; exporting {len(keys)}")+ entries, placements = [], []+ for ai, k in enumerate(keys):+ group = assets[k]+ rep = group[0]+ an = safe(rep.data.name if k.startswith("m_") else rep.name)+ an = f"{an}_{ai:03d}" if any(e["asset"] == an for e in entries) else an+ mats = [s.material for s in rep.material_slots]+ glass = [i for i, m in enumerate(mats) if m and is_glass(m)]+ bake_mats = [m for i, m in enumerate(mats) if i not in glass]+ dg = bpy.context.evaluated_depsgraph_get()+ ev = rep.evaluated_get(dg).data+ tris = tri_count(ev)+ area = surface_area(rep, ev)+ texd = os.path.join(OUT, "tex")+ p = {c: os.path.join(texd, f"{an}_{c}.png") for c in ("base", "orm", "normal", "emit")}+ glb = os.path.join(OUT, "mesh", an + ".glb")+ meta = glb[:-4] + ".json"+ done = os.path.exists(glb) # written after every bake of the asset succeeded+ if done:+ # Resume: skip the UV unwrap (an edit-mode smart_project per asset). Blender 5.0.1's bake crashes+ # (OpenImageIO ustring::operator= in ccl::create_mesh) after a few hundred unwrap+bake cycles in one+ # process; re-unwrapping every finished asset on resume made it crash at the same asset every time.+ m0 = json.load(open(meta)) if os.path.exists(meta) else {}+ uv_name, kept, cov, res = None, m0.get("uv") == "kept", m0.get("uv_coverage", 0.0), m0.get("res", [0, 0])+ else:+ uv_name, kept, aspect, cov = ensure_bake_uv(rep, rep)+ res = bake_size(area, cov, aspect, kept)+ e = {"asset": an, "key": k, "tris": tris, "area_m2": round(area, 3), "uv": "kept" if kept else "smart_project",+ "res": list(res), "uv_coverage": round(cov, 3), "slots": [m.name if m else None for m in mats], "glass": [glass_params(mats[i]) for i in glass],+ "emissive": False, "normal": False, "emissive_scale": 0.0, "object_dependent": sorted({h for m in bake_mats if m for h in uses_object_dependence(m)}),+ "animated_materials": [m.name for m in bake_mats if m and animated(m)], "instances": len(group),+ "shadow": bool(rep.visible_shadow), "camera_visible": bool(rep.visible_camera)}+ t1 = time.time()+ if bake_mats and not NO_BAKE:+ if not done: # a crash between channels leaves base without orm: redo the whole set+ bake_scene().collection.objects.link(rep)+ try:+ bake_channel(rep, bake_mats, "base", res, p["base"])+ bake_channel(rep, bake_mats, "orm", res, p["orm"])+ if any(m and perturbs_normal(m) for m in bake_mats):+ bake_channel(rep, bake_mats, "normal", res, p["normal"])+ if any(m and emissive(m) for m in bake_mats):+ s = bake_channel(rep, bake_mats, "emit", res, p["emit"])+ json.dump({"scale": s}, open(p["emit"] + ".json", "w"))+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])+ e["alpha"] = any(m and cuts_out(m) for m in bake_mats)+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+ e["tex"] = {c: os.path.relpath(v, OUT) for c, v in p.items() if os.path.exists(v)}+ if not os.path.exists(glb):+ export_glb(rep, uv_name, glass, glb)+ if not done:+ json.dump({"res": list(res), "uv": e["uv"], "uv_coverage": e["uv_coverage"]}, open(meta, "w"))+ e["glb"] = os.path.relpath(glb, OUT)+ # Local bounds in Unreal axes for the importer orientation check.+ bb = [Vector(c) for c in rep.bound_box]+ e["check_bounds"] = {"min": ue_vec(Vector([min(c[i] for c in bb) for i in range(3)])),+ "max": ue_vec(Vector([max(c[i] for c in bb) for i in range(3)]))}+ e["bake_s"] = round(time.time() - t1, 1)+ entries.append(e)+ for o in group:+ placements.append({"name": o.name, "asset": an, **ue_xform(o.matrix_world),+ "shadow": bool(o.visible_shadow), "camera_visible": bool(o.visible_camera)})+ log(f"[{ai + 1}/{len(keys)}] {an} tris={tris} res={res} uv={e['uv']} inst={len(group)} {e['bake_s']}s")+ # Lights, cameras, world, grade.+ lights = [light_entry(o) for o in sc.objects if o.type == "LIGHT" and not o.hide_render]+ cams = [camera_entry(o) for o in sc.objects if o.type == "CAMERA"]+ world = None+ wpath = os.path.join(OUT, "world", "sky.exr")+ if sc.world:+ world = world_bake(wpath) if not os.path.exists(wpath) or "--rebake-world" in argv else {"equirect_exr": wpath}+ if "mean_radiance" not in world:+ img = bpy.data.images.load(wpath)+ px = np.empty(img.size[0] * img.size[1] * 4, np.float32)+ img.pixels.foreach_get(px)+ world["mean_radiance"] = px.reshape(-1, 4)[:, :3].mean(axis=0).tolist()+ bpy.data.images.remove(img)+ world["equirect_exr"] = os.path.relpath(wpath, OUT)+ world["nits_scale"] = LM_PER_W+ vs = sc.view_settings+ grade = {"view_transform": vs.view_transform, "look": vs.look, "exposure": vs.exposure, "gamma": vs.gamma,+ "use_curve_mapping": vs.use_curve_mapping,+ "ev100": math.log2(LM_PER_W / 1.2) - vs.exposure,+ "compositor": compositor_nodes(),+ "motion_blur": {"on": sc.render.use_motion_blur, "shutter": sc.render.motion_blur_shutter},+ "resolution": [sc.render.resolution_x, sc.render.resolution_y], "fps": sc.render.fps}+ if vs.use_curve_mapping:+ grade["curves"] = [[(p.location[0], p.location[1]) for p in c.points] for c in vs.curve_mapping.curves]+ if GRADE_SH and os.path.exists(GRADE_SH):+ g = ffmpeg_grade(GRADE_SH)+ if g:+ g["lut"] = os.path.relpath(make_lut(g["colour"], os.path.join(OUT, "grade", "lut_grade.png")), OUT)+ grade["ffmpeg"] = g+ scene = {"source": SRC, "frame": FRAME, "units": "unreal cm, X fwd, Y right, Z up", "lm_per_w": LM_PER_W,+ "assets": entries, "placements": placements, "lights": lights, "cameras": cams, "world": world,+ "volumes": report["volumes"], "fx": report["fx"], "grade": grade,+ "skipped": report["skipped"], "converted": report["converted"], "export_s": round(time.time() - t0)}+ jp = os.path.join(OUT, "scene.json")+ if os.path.exists(jp) and (ONLY or LIMIT):+ old = json.load(open(jp, encoding="utf-8"))+ have = {e["asset"] for e in entries}+ scene["assets"] = [e for e in old.get("assets", []) if e["asset"] not in have] + entries+ scene["placements"] = [p for p in old.get("placements", []) if p["asset"] not in have] + placements+ json.dump(scene, open(jp, "w", encoding="utf-8"), indent=1)+ log(f"wrote {jp}: {len(scene['assets'])} assets, {len(scene['placements'])} placements, {len(lights)} lights, "+ f"{len(cams)} cameras, {len(report['volumes'])} volumes in {time.time() - t0:.0f}s")+++main()diff --git a/unreal_ramen/make_copy.py b/unreal_ramen/make_copy.pynew file mode 100644index 0000000..0a0063e--- /dev/null+++ b/unreal_ramen/make_copy.py@@ -0,0 +1,12 @@+"""Make a working copy of a scene .blend with all external paths absolute (a plain file copy breaks the scene's+//../../refs/... texture paths as soon as it lives in another folder). The source file is only read.+ blender -b scenes/<id>/<scene>.blend --python unreal/make_copy.py -- <out.blend>+"""+import sys+import bpy++out = sys.argv[sys.argv.index("--") + 1]+assert bpy.path.abspath(out) != bpy.data.filepath, "refusing to overwrite the source .blend"+bpy.ops.file.make_paths_absolute()+bpy.ops.wm.save_as_mainfile(filepath=out, copy=True, relative_remap=False, compress=False)+print("COPY", bpy.data.filepath, "->", out, flush=True)diff --git a/unreal_ramen/perf.ps1 b/unreal_ramen/perf.ps1new file mode 100644index 0000000..cf962b2--- /dev/null+++ b/unreal_ramen/perf.ps1@@ -0,0 +1,40 @@+# Standalone (-game) real-time performance run of a built AnyScene level, with no window (-RenderOffscreen).+# Captures N frames with the CSV profiler (frame/game/render/GPU times) from the PlayerStart (hero camera), and samples+# total GPU memory with nvidia-smi before and during the run.+# powershell -File perf.ps1 [-Map /Game/AnyScene/HK/L_HK] [-ResX 2560] [-ResY 1440] [-Frames 900] [-Extra "r.Lumen.HardwareRayTracing 0"]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Map = "/Game/AnyScene/HK/L_HK",+ [int]$ResX = 2560, [int]$ResY = 1440, [int]$Frames = 900, [int]$TimeoutS = 600,+ [string]$Tag = "perf", [string]$Extra = ""+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor.exe"+$saved = Join-Path (Split-Path $Project) "Saved"+$csvDir = Join-Path $saved "Profiling\CSV"+$before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+$mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+# The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+$cmds = "r.setres ${ResX}x${ResY}w,r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+if ($Extra) { $cmds = "$Extra,$cmds" }+$args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+$proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+$peak = $mem0+$sw = [Diagnostics.Stopwatch]::StartNew()+$csv = $null+while (-not $proc.HasExited -and $sw.Elapsed.TotalSeconds -lt $TimeoutS) {+ Start-Sleep -Seconds 2+ $m = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ if ($m -gt $peak) { $peak = $m }+ $new = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | Where-Object { $before -notcontains $_.FullName }+ if ($new) {+ $f = $new | Sort-Object LastWriteTime | Select-Object -Last 1+ # The CSV is written when the capture ends; wait until the file stops growing.+ $s1 = $f.Length; Start-Sleep -Seconds 3; $s2 = (Get-Item $f.FullName).Length+ if ($s1 -eq $s2 -and $s2 -gt 0) { $csv = $f.FullName; break }+ }+}+if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force }+"gpu_mem_before_mb=$mem0 gpu_mem_peak_mb=$peak delta_mb=$($peak - $mem0)"+"csv=$csv"diff --git a/unreal_ramen/ramen_fixes.patch b/unreal_ramen/ramen_fixes.patchnew file mode 100644index 0000000..52ed4b5--- /dev/null+++ b/unreal_ramen/ramen_fixes.patch@@ -0,0 +1,216 @@+diff -ru -x _orig -x '*.md' -x __pycache__ -x '*.patch' _orig/build_level.py ./build_level.py+--- _orig/build_level.py 2026-11-01 20:17:59.615024900 -0800++++ ./build_level.py 2026-11-01 22:01:02.778533400 -0800+@@ -10,6 +10,7 @@+ ANYSCENE_ONLY comma list of asset names to (re)import (testing)+ ANYSCENE_NANITE_TRIS Nanite on for meshes above this triangle count (default 2000; glass meshes never)+ ANYSCENE_EXPOSURE_OFFSET extra EV added to the computed manual exposure (calibration)++ ANYSCENE_HERO_CAM camera whose transform becomes the PlayerStart (perf runs), default cam_street++ Assets that already exist are reused (delete the folder to force a reimport). The level is rebuilt from scratch.+ """+@@ -224,11 +225,13 @@++ # ------------------------------------------------------------------ materials++-def master_baked():+- path = f"{DEST}/Materials/M_AnyBaked"++def master_baked(masked=False):++ """M_AnyBaked (opaque) or M_AnyBakedMasked: same graph, opacity mask = ORM.R (baked Principled Alpha)."""++ name = "M_AnyBakedMasked" if masked else "M_AnyBaked"++ path = f"{DEST}/Materials/{name}"+ if EAL.does_asset_exist(path):+ return EAL.load_asset(path)+- m = AT.create_asset("M_AnyBaked", f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())++ m = AT.create_asset(name, f"{DEST}/Materials", unreal.Material, unreal.MaterialFactoryNew())+ def tex(name, x, y, default, stype):+ n = MEL.create_material_expression(m, unreal.MaterialExpressionTextureSampleParameter2D, x, y)+ n.set_editor_property("parameter_name", name)+@@ -257,6 +260,11 @@+ MEL.connect_material_property(nrm, "RGB", unreal.MaterialProperty.MP_NORMAL)+ MEL.connect_material_property(mul, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)+ m.set_editor_property("two_sided", True) # generated props and single planes (signs, facades) are often open++ if masked:++ m.set_editor_property("blend_mode", unreal.BlendMode.BLEND_MASKED)++ # (MaterialExpressionDitherTemporalAA is not exposed to Python in 5.8: plain clip.)++ m.set_editor_property("opacity_mask_clip_value", 0.33)++ MEL.connect_material_property(orm, "R", unreal.MaterialProperty.MP_OPACITY_MASK)+ MEL.recompile_material(m)+ EAL.save_loaded_asset(m, False)+ return m+@@ -340,11 +348,13 @@+ def stage_materials():+ t = time.time()+ baked, glass = master_baked(), master_glass()++ masked = master_baked(masked=True) if any(a.get("alpha") for a in ASSETS) else None+ for a in ASSETS:+ sm = find_mesh(a)+ if sm is None:+ continue+- m = mi("MI_" + a["asset"], baked)++ m = mi("MI_" + a["asset"], masked if a.get("alpha") else baked)++ MEL.set_material_instance_parent(m, masked if a.get("alpha") else baked) # existing MI: reparent+ for ch, pname in (("base", "BaseColor"), ("orm", "ORM"), ("normal", "Normal"), ("emit", "Emissive")):+ rel = a.get("tex", {}).get(ch)+ if rel:+@@ -363,6 +373,9 @@+ EAL.save_loaded_asset(gm, False)+ mats.append(gm)+ n = sm.get_num_sections(0)++ if n < len(mats) and not a.get("tex"):++ # All-glass mesh: glTF drops the unused BAKED slot 0, so section 0 is the first glass slot.++ mats = mats[1:]+ for i in range(n):+ sm.set_material(i, mats[min(i, len(mats) - 1)])+ if n != len(mats):+@@ -585,7 +598,8 @@+ ppv.settings = s+ REPORT["exposure_bias"] = bias+ # Player start at the first hero camera for standalone perf runs.+- hero = next((c for c in scene["cameras"] if c["name"] == "cam_street"), scene["cameras"][0] if scene["cameras"] else None)++ hero_name = os.environ.get("ANYSCENE_HERO_CAM", "cam_street")++ hero = next((c for c in scene["cameras"] if c["name"] == hero_name), scene["cameras"][0] if scene["cameras"] else None)+ if hero:+ ps = eas.spawn_actor_from_class(unreal.PlayerStart, V(hero["loc"]), rot_fu(hero["forward"], [0, 0, 1]))+ ps.set_actor_label("PlayerStart_" + hero["name"])+diff -ru -x _orig -x '*.md' -x __pycache__ -x '*.patch' _orig/export.sh ./export.sh+--- _orig/export.sh 2026-11-01 20:17:59.662970100 -0800++++ ./export.sh 2026-11-01 20:20:23.734833000 -0800+@@ -3,7 +3,7 @@+ # (EXCEPTION_ACCESS_VIOLATION in OpenImageIO ustring::operator= under ccl::create_mesh, ~1 per 250 bakes, a different+ # asset each time); the exporter skips assets whose GLB/texture already exist, so a rerun resumes where it died.+ # bash unreal/export.sh <copy.blend> <out_dir> [export_blend.py args...] (log: <out_dir>/export.log)+-# EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py"++# EXPORT_TRIES=6 EXPORT_PRE="scenes/<id>/scripts/gpu_prefs.py" EXPORT_NOQUEUE=1 (CPU bake: skip pipeline/gpu_run.sh)+ A="$(cd "$(dirname "$0")/.." && pwd)"+ . "$A/pipeline/env.sh"+ blend="$1"; out="$2"; shift 2+@@ -12,7 +12,9 @@+ pre=()+ [ -n "$EXPORT_PRE" ] && pre=(--python "$EXPORT_PRE")+ for i in $(seq 1 "${EXPORT_TRIES:-6}"); do+- bash "$A/pipeline/gpu_run.sh" "$BLENDER" -b "$blend" "${pre[@]}" --python "$A/unreal/export_blend.py" -- --out "$out" "$@" \++ q=(bash "$A/pipeline/gpu_run.sh"); [ -n "$EXPORT_NOQUEUE" ] && q=()++ # The exporter next to this script (not $A/unreal/): per-scene copies of unreal/ then run their own exporter.++ "${q[@]}" "$BLENDER" -b "$blend" "${pre[@]}" --python "$(cd "$(dirname "$0")" && pwd -W 2>/dev/null || pwd)/export_blend.py" -- --out "$out" "$@" \+ >> "$out/export.log" 2>&1+ rc=$?+ if grep -q "^EXPORT wrote" "$out/export.log"; then echo "export: done after $i run(s)"; exit 0; fi+diff -ru -x _orig -x '*.md' -x __pycache__ -x '*.patch' _orig/export_blend.py ./export_blend.py+--- _orig/export_blend.py 2026-11-01 20:17:59.626496800 -0800++++ ./export_blend.py 2026-11-01 22:01:02.786020400 -0800+@@ -176,6 +176,12 @@+ return (s.is_linked or s.default_value > 0) and (c.is_linked or any(v > 0 for v in c.default_value[:3]))++++def cuts_out(m):++ """Principled Alpha linked or below 1 (decals keyed from luminance, stickers): baked into ORM.R, masked in UE."""++ p = find_principled(m)++ return bool(p and (p.inputs["Alpha"].is_linked or p.inputs["Alpha"].default_value < 0.999))+++++ def perturbs_normal(m):+ p = find_principled(m)+ return bool(p and p.inputs["Normal"].is_linked)+@@ -355,10 +361,14 @@+ else:+ col.default_value = (0.5, 0.5, 0.5, 1)+ elif channel == "orm":+- # R=1 (no separate AO), G=roughness, B=metallic++ # R=alpha (1 unless the material cuts out: decals, stickers; no separate AO), G=roughness, B=metallic+ cmb = nt.nodes.new("ShaderNodeCombineColor")+ self.added.append(cmb)+ cmb.inputs[0].default_value = 1.0++ if p is not None and p.inputs["Alpha"].is_linked:++ nt.links.new(_src(p.inputs["Alpha"]), cmb.inputs[0])++ elif p is not None:++ cmb.inputs[0].default_value = p.inputs["Alpha"].default_value+ for i, k, dv in ((1, "Roughness", 0.5), (2, "Metallic", 0.0)):+ if p is not None and p.inputs[k].is_linked:+ nt.links.new(_src(p.inputs[k]), cmb.inputs[i])+@@ -495,9 +505,14 @@+ me.uv_layers.active = ar+ return ar.name, True, 1.0, max(uv_stats(me, ar.name)[1], 0.05)+ ar = render_uv(me)++ ar_name = ar.name if ar is not None else None+ uvl = me.uv_layers.new(name="bake")+- if ar is not None:+- ar.active_render = True # keep materials reading their original UVs++ if ar_name is not None:++ # Keep materials reading their original UVs. Look the layer up again: uv_layers.new() reallocates the++ # collection, and setting active_render through the old reference left NO render UV, so every image node++ # with an implicit UV sampled one texel (posters, flyers, calendars, decals baked to a flat colour).++ me.uv_layers[ar_name].active_render = True++ uvl = me.uv_layers["bake"]+ me.uv_layers.active = uvl+ vl = bpy.context.view_layer+ for x in vl.objects:+@@ -596,6 +611,13 @@++ # ------------------------------------------------------------------ volumes+++def sample_bounds(o):++ corners = [o.matrix_world @ Vector(c) for c in o.bound_box]++ lo = Vector([min(c[i] for c in corners) for i in range(3)])++ hi = Vector([max(c[i] for c in corners) for i in range(3)])++ return {"center": ue_vec((lo + hi) / 2), "extent": [(hi.x - lo.x) * 50, (hi.y - lo.y) * 50, (hi.z - lo.z) * 50]}+++++ def sample_volume(o, n=24, levels=(0.08, 0.3, 0.55, 0.8)):+ """Bake density / emission of a procedural volume on horizontal slices that share the box's object space and+ texture space (so Generated/Object coordinates match). Returns per-level mean density and emission."""+@@ -893,6 +915,16 @@+ elif o.type == "MESH":+ mats = [s.material for s in o.material_slots]+ if mats and all(is_volume_only(m) for m in mats if m):++ fl = next((md for md in o.modifiers if md.type == "FLUID" and md.fluid_type == "DOMAIN"), None)++ if fl is not None:++ # Mantaflow smoke: the slice bake cannot see the cache grids, so it reads the shader's constant++ # density multiplier (8.0 on the ramen steam) and would become an opaque fog box. Niagara gap.++ d = fl.domain_settings++ report["fx"].append({"name": o.name, "kind": "mantaflow_" + d.domain_type.lower(),++ "cache": bpy.path.abspath(d.cache_directory), "resolution": d.resolution_max,++ "bounds_ue": sample_bounds(o)})++ log("volume", o.name, "is a Mantaflow domain: exported as an fx note, not a fog volume")++ continue+ v = sample_volume(o)+ if v:+ report["volumes"][o.name] = v+@@ -957,6 +989,7 @@+ finally:+ bake_scene().collection.objects.unlink(rep)+ e["normal"] = os.path.exists(p["normal"])++ e["alpha"] = any(m and cuts_out(m) for m in bake_mats)+ e["emissive"] = os.path.exists(p["emit"])+ if e["emissive"]:+ e["emissive_scale"] = json.load(open(p["emit"] + ".json"))["scale"]+diff -ru -x _orig -x '*.md' -x __pycache__ -x '*.patch' _orig/perf.ps1 ./perf.ps1+--- _orig/perf.ps1 2026-11-01 20:17:59.655055300 -0800++++ ./perf.ps1 2026-11-01 20:21:31.029539300 -0800+@@ -14,11 +14,11 @@+ $before = Get-ChildItem $csvDir -Filter *.csv -ErrorAction SilentlyContinue | ForEach-Object FullName+ $mem0 = [int](& nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)+ # The bare cvar names print their current values to the log (proof that Lumen / Nanite / volumetric fog are on).+-$cmds = "r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"++$cmds = "r.setres ${ResX}x${ResY}w,r.DynamicGlobalIlluminationMethod,r.ReflectionMethod,r.Nanite,r.VolumetricFog,r.Lumen.HardwareRayTracing,r.RayTracing,r.Shadow.Virtual.Enable,t.MaxFPS 0,r.VSync 0,r.GPUCsvStatsEnabled 1,csvprofile frames=$Frames"+ if ($Extra) { $cmds = "$Extra,$cmds" }+ $args = @($Project, $Map, "-game", "-RenderOffscreen", "-windowed", "-resx=$ResX", "-resy=$ResY", "-unattended", "-nosplash",+ "-nop4", "-nosound", "-log=$Tag.log", "`"-ExecCmds=$cmds`"",+- "-dpcvars=Editor.AsyncAssetCompilation=0") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items++ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1") # async compilation leaves props invisible (render_shots.py); PS 5.1 Start-Process does not quote array items+ $proc = Start-Process -FilePath $ue -ArgumentList $args -PassThru+ $peak = $mem0+ $sw = [Diagnostics.Stopwatch]::StartNew()+diff -ru -x _orig -x '*.md' -x __pycache__ -x '*.patch' _orig/render_mrq.ps1 ./render_mrq.ps1+--- _orig/render_mrq.ps1 2026-11-01 20:17:59.656571000 -0800++++ ./render_mrq.ps1 2026-11-01 20:21:24.957021100 -0800+@@ -11,7 +11,7 @@+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+- "-dpcvars=Editor.AsyncAssetCompilation=0" | Out-Null++ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1" | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+ }+Only in .: waveletNoiseTile.bindiff --git a/unreal_ramen/render_mrq.ps1 b/unreal_ramen/render_mrq.ps1new file mode 100644index 0000000..caa346a--- /dev/null+++ b/unreal_ramen/render_mrq.ps1@@ -0,0 +1,17 @@+# Headless Movie Render Queue stills of a built level, one process per camera sequence (no editor, no window):+# UnrealEditor-Cmd <uproject> <map> -game -LevelSequence=<SEQ> -MoviePipelineConfig=<CFG> -RenderOffscreen+# powershell -File render_mrq.ps1 [-Cams cam_street,cam_table,cam_wok] [-Config MRQ_Still|MRQ_Linear]+param(+ [string]$Project = "C:\Users\apek-anna\Developer\anyscene-unreal\AnySceneUE\AnySceneUE.uproject",+ [string]$Dest = "/Game/AnyScene/HK", [string]$Level = "L_HK",+ [string]$Cams = "cam_street,cam_table,cam_wok", [string]$Config = "MRQ_Still"+)+$ue = "C:\Program Files\Epic Games\UE_5.8\Engine\Binaries\Win64\UnrealEditor-Cmd.exe"+foreach ($c in $Cams.Split(",")) {+ $t = Measure-Command {+ & $ue $Project "$Dest/$Level" -game "-LevelSequence=$Dest/Sequences/SEQ_$c.SEQ_$c" "-MoviePipelineConfig=$Dest/MRQ/$Config.$Config" `+ -RenderOffscreen -windowed -resx=1920 -resy=804 -unattended -nosplash -nop4 -nosound -notexturestreaming "-log=mrq_$c.log" `+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,fx.Niagara.ForceWaitForCompilationOnActivate=1" | Out-Null+ }+ "$c $Config {0:N1}s" -f $t.TotalSeconds+}diff --git a/unreal_ramen/render_shots.py b/unreal_ramen/render_shots.pynew file mode 100644index 0000000..0d38457--- /dev/null+++ b/unreal_ramen/render_shots.py@@ -0,0 +1,185 @@+"""Lit stills of the scene's own cameras from a running editor with no window:++ UnrealEditor.exe <project>.uproject "-ExecCmds=py <path>/render_shots.py" -RenderOffscreen+ "-dpcvars=Editor.AsyncAssetCompilation=0,Editor.AsyncTextureCompilation=0,Editor.AsyncStaticMeshCompilation=0,r.TextureStreaming=0"+ -unattended -nosplash -nop4 -nosound++The -dpcvars are required. With async asset compilation (the default) an offscreen editor never finishes compiling+the imported meshes/textures: ~70% of the scene (every prop, sign, the ground) stays invisible and the rest shows+placeholder textures, with no log line saying so. r.TextureStreaming=0 avoids low-mip signage in a 20 s session.++Use -ExecCmds=py, not -ExecutePythonScript: the latter issues QUIT_EDITOR right after the script returns (frame 3),+before any tick callback has run, unless the script happens to block (a load_level inside it did, which is why the+first test worked). The project's EditorStartupMap is the level; ANYSCENE_MAP can load another one (in Git Bash set+MSYS_NO_PATHCONV=1, or /Game/... is rewritten to C:/Program Files/Git/Game/...).+Movie Render Queue (render_mrq.ps1) gives better frames (8 temporal samples, DOF) at ~50-65 s per still with startup.++Uses a SceneCapture2D per CineCameraActor (same transform, FOV from filmback/focal length, DOF and the unbound+post-process volume's grade copied over), lets Lumen/VSM converge for WARM frames with the capture ticking, then+writes <out>/<camera>.png (tone-mapped + LUT) and <out>/<camera>_hdr.exr (scene-linear, pre-tonemap, for an AgX+pass). Quits the editor when done. Env: ANYSCENE_SHOTS (comma list of camera labels), ANYSCENE_SHOT_DIR,+ANYSCENE_SHOT_RES (WxH, default 1920x804), ANYSCENE_WARM (frames, default 90), ANYSCENE_WARM_S (wall-clock seconds+before the first capture, default 0), ANYSCENE_QUIT (default 1).+"""+import os+import time+import warnings++import unreal++warnings.simplefilter("ignore", DeprecationWarning)++SHOTS = [s for s in os.environ.get("ANYSCENE_SHOTS", "cam_street,cam_table,cam_wok").split(",") if s]+OUT = os.environ.get("ANYSCENE_SHOT_DIR", os.path.join(unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_saved_dir()), "Shots"))+W, H = (int(x) for x in os.environ.get("ANYSCENE_SHOT_RES", "1920x804").split("x"))+WARM = int(os.environ.get("ANYSCENE_WARM", "90"))+# Wall-clock minimum before the FIRST capture: on a cold DDC the editor renders the default material and skips+# meshes whose shaders are still compiling (150 frames pass in ~3 s), so frame counts alone are not enough.+WARM_S = float(os.environ.get("ANYSCENE_WARM_S", "0"))+T_START = time.time()+QUIET_S = float(os.environ.get("ANYSCENE_QUIET_S", "20"))+_LOG = {"path": None, "pos": 0, "last": time.time(), "n": 0}+++def compile_quiet():+ """True once the editor log has shown no texture-build / shader-compile line for QUIET_S seconds. There is no+ Python API for the asset/shader compiling managers, and a fresh import spends minutes encoding textures in the+ background (props render with placeholders, or not at all, until it is done)."""+ if _LOG["path"] is None:+ d = unreal.Paths.convert_relative_path_to_full(unreal.Paths.project_log_dir())+ logs = [os.path.join(d, f) for f in os.listdir(d) if f.endswith(".log")]+ _LOG["path"] = max(logs, key=os.path.getmtime)+ try:+ with open(_LOG["path"], "rb") as f:+ f.seek(_LOG["pos"])+ chunk = f.read()+ _LOG["pos"] = f.tell()+ except OSError:+ return True+ hits = sum(chunk.count(k) for k in (b"Building texture", b"Building static mesh", b"shaders remaining",+ b"Compiling shader", b"Waiting for static meshes", b"LogShaderCompilers: Display: Compiled"))+ if hits:+ _LOG["last"] = time.time()+ _LOG["n"] += hits+ return time.time() - _LOG["last"] >= QUIET_S+QUIT = os.environ.get("ANYSCENE_QUIT", "1") == "1"+MOVABLE = os.environ.get("ANYSCENE_MOVABLE", "0") == "1"+os.makedirs(OUT, exist_ok=True)+++def log(*a):+ unreal.log_warning("SHOTS " + " ".join(str(x) for x in a))+++eas = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)+ues = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem)+STATE = {"i": 0, "frame": 0, "cap": None, "t0": time.time(), "handle": None, "rt": None, "rt_hdr": None, "cap_hdr": None}+++def actors():+ return eas.get_all_level_actors()+++++def reregister_meshes():+ """Force every static mesh component to rebuild its render state (set the mesh to None and back)."""+ n = 0+ for a in actors():+ if isinstance(a, unreal.StaticMeshActor):+ c = a.static_mesh_component+ sm = c.static_mesh+ if sm:+ if MOVABLE:+ c.set_mobility(unreal.ComponentMobility.MOVABLE)+ c.set_static_mesh(None)+ c.set_static_mesh(sm)+ n += 1+ log("re-registered", n, "mesh components")+++def setup(label):+ world = ues.get_editor_world()+ cam = next((a for a in actors() if a.get_actor_label() == label), None)+ if cam is None:+ log("missing camera", label)+ return False+ cc = cam.get_cine_camera_component()+ fb = cc.filmback.sensor_width+ fov = 2 * unreal.MathLibrary.radians_to_degrees(unreal.MathLibrary.atan(fb / 2 / cc.current_focal_length))+ ppv = next((a for a in actors() if isinstance(a, unreal.PostProcessVolume) and a.get_editor_property("unbound")), None)+ caps = []+ for kind in ("ldr", "hdr"):+ if kind == "ldr":+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA8_SRGB)+ else:+ rt = unreal.RenderingLibrary.create_render_target2d(world, W, H, unreal.TextureRenderTargetFormat.RTF_RGBA16F)+ cap = eas.spawn_actor_from_class(unreal.SceneCapture2D, cam.get_actor_location(), cam.get_actor_rotation())+ c = cap.capture_component2d+ c.set_editor_property("fov_angle", fov)+ c.set_editor_property("texture_target", rt)+ c.set_editor_property("capture_source", unreal.SceneCaptureSource.SCS_FINAL_TONE_CURVE_HDR if kind == "ldr" else unreal.SceneCaptureSource.SCS_SCENE_COLOR_HDR)+ c.set_editor_property("capture_every_frame", True)+ c.set_editor_property("always_persist_rendering_state", True)+ if ppv:+ s = ppv.settings+ # Cine camera DOF onto the capture (captures don't read the camera component).+ fs = cc.focus_settings+ if fs.focus_method == unreal.CameraFocusMethod.MANUAL:+ s.set_editor_property("override_depth_of_field_fstop", True)+ s.set_editor_property("depth_of_field_fstop", cc.current_aperture)+ s.set_editor_property("override_depth_of_field_focal_distance", True)+ s.set_editor_property("depth_of_field_focal_distance", fs.manual_focus_distance)+ s.set_editor_property("override_depth_of_field_sensor_width", True)+ s.set_editor_property("depth_of_field_sensor_width", fb)+ c.set_editor_property("post_process_settings", s)+ c.set_editor_property("post_process_blend_weight", 1.0)+ caps.append((cap, rt))+ STATE["caps"] = caps+ return True+++def finish(label):+ world = ues.get_editor_world()+ (cap, rt), (cap_h, rt_h) = STATE["caps"]+ unreal.RenderingLibrary.export_render_target(world, rt, OUT, label + ".png")+ unreal.RenderingLibrary.export_render_target(world, rt_h, OUT, label + "_hdr.exr")+ eas.destroy_actor(cap)+ eas.destroy_actor(cap_h)+ log("wrote", os.path.join(OUT, label + ".png"), f"{time.time() - STATE['t0']:.1f}s")+++def tick(dt):+ i = STATE["i"]+ if i >= len(SHOTS):+ unreal.unregister_slate_post_tick_callback(STATE["handle"])+ log("done")+ if QUIT:+ unreal.SystemLibrary.quit_editor()+ return+ label = SHOTS[i]+ if STATE["frame"] == 0:+ STATE["t0"] = time.time()+ if not setup(label):+ STATE["i"] += 1+ return+ STATE["frame"] += 1+ # capture_every_frame only keeps ticking for the first capture of the session (later ones export all-black+ # frames), so drive every capture explicitly each frame.+ for cap, _ in STATE["caps"]:+ cap.capture_component2d.capture_scene()+ if STATE["frame"] >= WARM and (STATE["i"] > 0 or (time.time() - T_START >= WARM_S and compile_quiet())):+ if STATE["i"] == 0:+ log("compile quiet after", f"{time.time() - T_START:.0f}s", "build lines seen", _LOG["n"])+ finish(label)+ STATE["frame"] = 0+ STATE["i"] += 1+++log("start", SHOTS, OUT, f"{W}x{H}", "warm", WARM, "world", ues.get_editor_world().get_path_name(), "actors", len(actors()))+if os.environ.get("ANYSCENE_MAP"):+ unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level(os.environ["ANYSCENE_MAP"])+ log("loaded", ues.get_editor_world().get_path_name(), len(actors()), [a.get_actor_label() for a in actors()][:8])+if os.environ.get("ANYSCENE_REREGISTER", "0") == "1": # debugging aid; did not fix invisible props (async compile did)+ reregister_meshes()+STATE["handle"] = unreal.register_slate_post_tick_callback(tick)diff --git a/unreal_ramen/side_by_side.py b/unreal_ramen/side_by_side.pynew file mode 100644index 0000000..e55eddd--- /dev/null+++ b/unreal_ramen/side_by_side.py@@ -0,0 +1,47 @@+"""Cycles-vs-Unreal comparison sheets: Cycles graded on the left, Unreal on the right, labelled, same height.+ uv run --no-project --with pillow python -I side_by_side.py <cycles_dir> <ue_dir> <out_dir> [street,table,wok]+Reads <cycles_dir>/<cam>_graded.png and <ue_dir>/cam_<cam>.png; writes <out_dir>/<cam>.png and <out_dir>/all.png.+"""+import os+import sys++from PIL import Image, ImageDraw, ImageFont++cyc, ue, out = sys.argv[1:4]+cams = (sys.argv[4] if len(sys.argv) > 4 else "street,table,wok").split(",")+os.makedirs(out, exist_ok=True)+H = 804+LABEL = os.environ.get("SBS_LABEL", "Unreal 5.8 (Lumen)")+try:+ font = ImageFont.truetype("arial.ttf", 28)+except OSError:+ font = ImageFont.load_default()+++def fit(p):+ im = Image.open(p).convert("RGB")+ return im.resize((round(im.width * H / im.height), H), Image.LANCZOS)+++rows = []+for c in cams:+ a = fit(os.path.join(cyc, f"{c}_graded.png"))+ up = os.path.join(ue, f"cam_{c}.png")+ b = fit(up) if os.path.exists(up) else Image.new("RGB", a.size, (60, 0, 0))+ sheet = Image.new("RGB", (a.width + b.width + 8, H), (255, 255, 255))+ sheet.paste(a, (0, 0))+ sheet.paste(b, (a.width + 8, 0))+ d = ImageDraw.Draw(sheet)+ for x, t in ((12, f"Cycles graded {c}"), (a.width + 20, f"{LABEL} {c}")):+ d.rectangle([x - 6, 8, x + 360, 46], fill=(0, 0, 0))+ d.text((x, 12), t, fill=(255, 255, 255), font=font)+ sheet.save(os.path.join(out, f"{c}.png"))+ rows.append(sheet)+ print("wrote", os.path.join(out, f"{c}.png"))+w = max(r.width for r in rows)+allim = Image.new("RGB", (w, sum(r.height for r in rows) + 8 * (len(rows) - 1)), (255, 255, 255))+y = 0+for r in rows:+ allim.paste(r, (0, y))+ y += r.height + 8+allim.resize((allim.width // 2, allim.height // 2), Image.LANCZOS).save(os.path.join(out, "all.png"))diff --git a/web/.env.example b/web/.env.exampleindex 45e965b..7213c8b 100644--- a/web/.env.example+++ b/web/.env.example@@ -14,9 +14,13 @@ NEXT_PUBLIC_ANYKIT_APP=your-fal-username/anykit# NEXT_PUBLIC_ANYSCENE_TEST_APP=your-fal-username/anyscene-builder# Optional, server only: shared secret every proxied request must carry (required in production; the proxy is-# closed without it), and the per-IP job limit.+# closed without it), an admin key that also skips the limits, and the limits (see README: Access key, who's building).# ANYSCENE_ACCESS_KEY=choose-a-long-random-string+# ANYSCENE_ADMIN_KEY=another-long-random-string+# ANYSCENE_BUILDS_PER_DAY=3# ANYSCENE_JOBS_PER_HOUR=6+# ANYSCENE_OWNER_DOMAIN=example.com+# BLOB_READ_WRITE_TOKEN= (set by Vercel when a Blob store is connected; holds the daily counts)# Optional: extra dev-server origins (comma-separated hosts, e.g. your LAN IP) allowed to load dev assets.# DEV_ORIGINS=192.168.1.20,*.localdiff --git a/web/.gitignore b/web/.gitignoreindex 870ca1e..bc93f3b 100644--- a/web/.gitignore+++ b/web/.gitignore@@ -10,3 +10,7 @@ public/replay/!fixtures/**/*.png!screenshots/*.png!fixtures/**/*.glb++# deployment secrets (written by the deploy, never committed)+STUDIO_ACCESS_KEY.txt+.verceldiff --git a/web/.vercelignore b/web/.vercelignorenew file mode 100644index 0000000..03bf369--- /dev/null+++ b/web/.vercelignore@@ -0,0 +1,7 @@+# never upload local secrets or build output+.env*+!.env.example+STUDIO_ACCESS_KEY.txt+node_modules+.next+screenshotsdiff --git a/web/README.md b/web/README.mdindex 98d9107..db9c4ba 100644--- a/web/README.md+++ b/web/README.md@@ -60,13 +60,46 @@ npm run import:builder -- <run dir> fal_mc_1It copies `events.jsonl`, `build.json` and any `still_*.png` (served locally in place of the remote stills), plus areference image. A run without `build.json` yet replays up to its last event and stops there.-## Access key and rate limit+## Password, who's building, and limits-The proxy checks a shared secret: set `ANYSCENE_ACCESS_KEY` in the server environment and every proxied request must-carry it as `x-anyscene-key` (the page asks for it under **Access key** in the toolbar and keeps it in that browser's-localStorage). With the variable unset the proxy is open in `next dev` and **closed** in production, so a fresh-deployment can't start builds on the account. New jobs are also limited per IP (`ANYSCENE_JOBS_PER_HOUR`, default-6; in memory, so per serverless instance: a backstop, not a quota).+The proxy checks a shared password, verified on the server: set `ANYSCENE_ACCESS_KEY` in the server environment and every proxied request must+carry it as `x-anyscene-key`. With the variable unset the proxy is open in `next dev` and **closed** in production,+so a fresh deployment can't start builds on the account. `ANYSCENE_ADMIN_KEY`, given in place of the password, also+skips the limits below.++The page asks once for the password and an email or username (**Sign in** in the toolbar; kept in that browser's+localStorage) and sends them to our own proxy only (`x-anyscene-key`, `x-anyscene-user`, `x-anyscene-name`). The proxy+tags each `/ref2scene` build with `owner` (the email or username) (stored by `builder/app.py`, listed by `/builds`, left out of+the retry fingerprint), so the gallery's **My builds** shows your own and **Everyone** shows all. A build's page is+shareable as `/?open=<build id>` (**Copy link**). It is self-declared behind the shared password: a label, not+authentication (see Google sign-in below).++Limits, all server only:++| variable | default | |+|---|---|---|+| `ANYSCENE_BUILDS_PER_DAY` | 3 | builds per email per UTC day; counted in a private Vercel Blob store when `BLOB_READ_WRITE_TOKEN` is set (else in memory) |+| `ANYSCENE_JOBS_PER_HOUR` | 6 | new jobs (builds and shots) per IP per hour, in memory per instance: a backstop |+| `ANYSCENE_OWNER_DOMAIN` | none | only emails at this domain may build, e.g. `fal.ai` (usernames are always allowed) |++The build button notes the cost (about $60-100 a build) and what's left today, and asks before starting.+`app/api/me` answers the page's "is my key right, who am I, what's left" check.++### Google sign-in (later)++To replace the self-declared name with real accounts restricted to one Google Workspace domain:++1. Google Cloud console, the owner's project: **APIs & Services > OAuth consent screen**, user type **Internal** (only+ the Workspace's accounts can sign in). Then **Credentials > Create credentials > OAuth client ID**, type **Web+ application**, authorized redirect URI `https://studio.anyscene.org/api/auth/callback/google` (and+ `http://localhost:3210/api/auth/callback/google` for dev).+2. `npm install next-auth@5` and add `auth.ts` with the Google provider, `authorization: { params: { hd: "fal.ai" } }`,+ and a `signIn` callback that returns `profile.email_verified && profile.email.endsWith("@fal.ai")` (`hd` alone is+ only a hint); export `handlers` from `app/api/auth/[...nextauth]/route.ts`.+3. Vercel env: `AUTH_SECRET` (`npx auth secret`), `AUTH_GOOGLE_ID`, `AUTH_GOOGLE_SECRET`, `AUTH_TRUST_HOST=true`.+4. In `lib/guard.ts`, take the owner from `await auth()` (session email and name) instead of the `x-anyscene-*`+ headers, and treat a session as the access key (keep `ANYSCENE_ADMIN_KEY` for the owner). In the page, replace the+ sign-in card with `signIn("google")`.## Replay mode (pipeline)diff --git a/web/app/api/fal/proxy/route.ts b/web/app/api/fal/proxy/route.tsindex 9a0a6be..abd7eb3 100644--- a/web/app/api/fal/proxy/route.ts+++ b/web/app/api/fal/proxy/route.ts@@ -1,7 +1,7 @@-import { timingSafeEqual } from "node:crypto";-import type { NextRequest } from "next/server";+import { NextRequest } from "next/server";import { createRouteHandler } from "@fal-ai/server-proxy/nextjs";-import { ALL_APPS } from "@/lib/apps";+import { ALL_APPS, BUILDER_APP } from "@/lib/apps";+import { BUILDS_PER_DAY, DEV_OPEN, JOBS_PER_HOUR, buildsToday, clientIp, ipLimited, keyError, keyRole, owner, quotaMessage, recordBuild } from "@/lib/guard";// fal's server-side proxy: the browser talks to /api/fal/proxy and the server adds FAL_KEY (never sent to the client).// POSTs are limited to the AnyScene apps and fal storage uploads (for the reference image), so the key can't be used@@ -9,72 +9,65 @@ import { ALL_APPS } from "@/lib/apps";// with none set, only uploads get through.const fal = createRouteHandler({allowedEndpoints: [...ALL_APPS.map((app) => `${app}/**`), "storage/upload/**"],- allowUnauthorizedRequests: true, // our own guard below decides who gets through+ allowUnauthorizedRequests: true, // our own guard below decides who gets through (lib/guard.ts)});-// ---------------------------------------------------------------- guard-// Shared secret: set ANYSCENE_ACCESS_KEY on the server and every proxied request must carry it as x-anyscene-key.-// Off in local dev when the variable is unset; in production an unset key closes the proxy (fail closed), so a fresh-// deployment can't be used to start builds on the owner's account.-const ACCESS_KEY = process.env.ANYSCENE_ACCESS_KEY || "";-const DEV_OPEN = !ACCESS_KEY && process.env.NODE_ENV !== "production";+// Gallery reads (every build on storage, one build's events) are cheap lookups, not jobs: they don't count.+const READ_ONLY = /\/(builds|build_events|kits|kit_events)\/?(\?.*)?$/;+// A new scene build: the expensive one, counted against the per-person daily limit and tagged with its owner.+const BUILD = BUILDER_APP ? new RegExp(`^/${BUILDER_APP}/(ref2scene|build)/?$`) : null;-// Rate limit on new jobs (POSTs to an app; status polls and uploads are not counted), per client IP, in memory.-// Per serverless instance only: a backstop behind the key, not a quota. ANYSCENE_JOBS_PER_HOUR, default 6.-const JOBS_PER_HOUR = Number(process.env.ANYSCENE_JOBS_PER_HOUR || 6);-const jobs = new Map<string, number[]>();+const APP_TARGETS = ALL_APPS.map((app) => `/${app}/`);function json(status: number, error: string) {return new Response(JSON.stringify({ detail: error }), { status, headers: { "content-type": "application/json" } });}-function keyOk(req: NextRequest) {- if (DEV_OPEN) return true;- if (!ACCESS_KEY) return false;- const got = Buffer.from(req.headers.get("x-anyscene-key") || "");- const want = Buffer.from(ACCESS_KEY);- return got.length === want.length && timingSafeEqual(got, want);-}--// Gallery reads (every build on storage, one build's events) are cheap lookups, not jobs: they don't count.-const READ_ONLY = /\/(builds|build_events|kits|kit_events)\/?(\?.*)?$/;--const APP_TARGETS = ALL_APPS.map((app) => `/${app}/`);--function startsJob(req: NextRequest) {+/** The fal path of a new job (a POST to one of our apps, not a gallery read), or null. */+function jobPath(req: NextRequest) {const target = req.headers.get("x-fal-target-url") || "";const m = target.match(/^https:\/\/(?:queue\.)?fal\.run(\/[^?]*)/);- return !!m && APP_TARGETS.some((p) => `${m[1]}/`.startsWith(p)) && !READ_ONLY.test(target);+ return m && req.method === "POST" && APP_TARGETS.some((p) => `${m[1]}/`.startsWith(p)) && !READ_ONLY.test(target) ? m[1] : null;}-function rateLimited(req: NextRequest) {- if (DEV_OPEN || !startsJob(req)) return false;- const ip = (req.headers.get("x-forwarded-for") || "").split(",")[0].trim() || req.headers.get("x-real-ip") || "unknown";- const now = Date.now();- const recent = (jobs.get(ip) || []).filter((t) => now - t < 3600_000);- if (recent.length >= JOBS_PER_HOUR) {- jobs.set(ip, recent);- return true;- }- recent.push(now);- jobs.set(ip, recent);- return false;-}+async function guarded(req: NextRequest, forward: (req: NextRequest) => Promise<Response>): Promise<Response> {+ const role = keyRole(req);+ if (!role) return json(401, keyError(req));+ const path = jobPath(req);+ if (!path) return forward(req);++ // local dev with no access key set: no limits, and a build is tagged only if the page says who you are+ const who = owner(req, role);+ if ("error" in who && !DEV_OPEN) return json(403, who.error);+ const limited = role !== "admin" && !DEV_OPEN;+ if (limited && ipLimited(clientIp(req))) return json(429, `Too many jobs from this address: ${JOBS_PER_HOUR} an hour.`);+ if (!BUILD?.test(path) || "error" in who) return forward(req);-function guard(req: NextRequest): Response | null {- if (!keyOk(req)) {- return json(401, ACCESS_KEY ? "This AnyScene needs an access key." : "The AnyScene proxy is closed: ANYSCENE_ACCESS_KEY is not set on the server.");+ if (limited && (await buildsToday(who.email)) >= BUILDS_PER_DAY) return json(429, quotaMessage());+ // tag the build with who asked for it (builder/app.py stores `owner`; it is not part of the retry fingerprint)+ let body: Record<string, unknown>;+ try {+ body = JSON.parse((await req.text()) || "{}");+ } catch {+ return json(400, "The build request is not JSON.");+ }+ const headers = new Headers(req.headers);+ headers.delete("content-length");+ const tagged = new NextRequest(req.url, { method: "POST", headers, body: JSON.stringify({ ...body, owner: who.tag }) });+ const res = await forward(tagged);+ if (res.ok && limited) {+ const requestId = (await res.clone().json().catch(() => ({})))?.request_id || "";+ await recordBuild(who.email, requestId).catch((e) => console.error("quota record failed", e));}- if (req.method === "POST" && rateLimited(req)) return json(429, `Too many builds from this address: ${JOBS_PER_HOUR} an hour.`);- return null;+ return res;}export async function GET(req: NextRequest) {- return guard(req) ?? fal.GET(req);+ return guarded(req, fal.GET);}export async function POST(req: NextRequest) {- return guard(req) ?? fal.POST(req);+ return guarded(req, fal.POST);}export async function PUT(req: NextRequest) {- return guard(req) ?? fal.PUT(req);+ return guarded(req, fal.PUT);}diff --git a/web/app/api/me/route.ts b/web/app/api/me/route.tsnew file mode 100644index 0000000..8f9e6d3--- /dev/null+++ b/web/app/api/me/route.ts@@ -0,0 +1,13 @@+import { BUILDS_PER_DAY, DEV_OPEN, OWNER_DOMAIN, buildsToday, keyError, keyRole, owner } from "@/lib/guard";++// The page's check before a build: is the access key right, who does the server take you for, and how many builds+// are left today. Same headers as the fal proxy (x-anyscene-key, x-anyscene-user, x-anyscene-name).+export async function GET(req: Request) {+ const role = keyRole(req);+ if (!role) return Response.json({ detail: keyError(req) }, { status: 401 });+ const who = owner(req, role);+ const base = { admin: role === "admin", open: DEV_OPEN, limit: BUILDS_PER_DAY, domain: OWNER_DOMAIN || null };+ if ("error" in who) return Response.json({ ...base, owner: null, error: who.error, used: 0 });+ const used = await buildsToday(who.email).catch(() => 0);+ return Response.json({ ...base, owner: who.tag, error: null, used });+}diff --git a/web/app/globals.css b/web/app/globals.cssindex a1b8223..45110b0 100644--- a/web/app/globals.css+++ b/web/app/globals.css@@ -462,6 +462,7 @@ input[type="range"]::-moz-range-thumb { width: 9px; height: 15px; border: 1.5px.left { padding: 16px; }.center { padding: 8px 16px 0; }.shelf-wrap { padding: 12px 16px 0; }+ .shelf-head { flex-wrap: wrap; row-gap: 6px; }.result { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }}@@ -718,3 +719,16 @@ a.text-btn { display: inline-flex; align-items: center; min-height: var(--hit);.gallery-main { padding: 12px 16px 28px; }.gallery-grid { grid-template-columns: 1fr; }}++/* sign-in and confirm cards (components/WhoAmI.tsx) */+.sheet-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(31, 29, 26, 0.45); }+.sheet { width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--paper); border: 2px solid var(--ink); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px; }+.sheet h2 { margin: 0; font-family: var(--font-head); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; font-size: 20px; }+.sheet p { margin: 0; }+.sheet input { background: var(--card); border: 1px solid var(--ink); border-radius: 0; padding: 6px 8px; font: inherit; font-size: 16px; min-height: var(--hit, 32px); }+.sheet input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }+.sheet .error-note { margin: 0; }+.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; }+.sheet-actions .primary, .sheet-actions .secondary { min-width: 110px; }+.cost-note b { color: var(--ink); }+.gallery-owner { color: var(--dim-text); }diff --git a/web/components/BuilderInputs.tsx b/web/components/BuilderInputs.tsxindex 24b3def..15cc82b 100644--- a/web/components/BuilderInputs.tsx+++ b/web/components/BuilderInputs.tsx@@ -20,9 +20,11 @@ interface Props {canBuild: boolean;building: boolean;onBuild: () => void;+ /** Under the button: what a build costs, how many are left today. */+ note?: React.ReactNode;}-export default function BuilderInputs({ value, onChange, disabled, canBuild, building, onBuild }: Props) {+export default function BuilderInputs({ value, onChange, disabled, canBuild, building, onBuild, note }: Props) {const fileRef = useRef<HTMLInputElement>(null);const [over, setOver] = useState(false);const set = (patch: Partial<BuilderInputsState>) => onChange({ ...value, ...patch });@@ -113,7 +115,7 @@ export default function BuilderInputs({ value, onChange, disabled, canBuild, bui<button className="primary" disabled={!canBuild} onClick={onBuild}>{building ? "Building" : "Build the scene"}</button>- <p className="fine">One agent builds it end to end and loops with a critic. Up to 2 hours.</p>+ <p className="fine">One agent builds it end to end and loops with a critic. Up to 2 hours.{note ? <> {note}</> : null}</p></div>);}diff --git a/web/components/BuilderStudio.tsx b/web/components/BuilderStudio.tsxindex 53f6f73..07735d8 100644--- a/web/components/BuilderStudio.tsx+++ b/web/components/BuilderStudio.tsx@@ -3,7 +3,7 @@import { useCallback, useEffect, useReducer, useRef, useState } from "react";import { useSearchParams } from "next/navigation";import { builderReducer, clock, initialBuilder, type BuilderResponse } from "@/lib/builder";-import { LiveSource, ReplaySource, getAccessKey, setAccessKey, type Source } from "@/lib/sources";+import { LiveSource, ReplaySource, getWho, ownerName, type Source } from "@/lib/sources";import { BUILDER_APP } from "@/lib/apps";import { galleryApp, galleryEvents, toBuilderResponse, type GalleryItem, type GalleryKind } from "@/lib/gallery";import BuilderInputs, { type BuilderInputsState } from "./BuilderInputs";@@ -15,8 +15,11 @@ import BuilderViewport, { type BTab } from "./BuilderViewport";import ProductionLog from "./ProductionLog";import CriticPanel from "./CriticPanel";import Stamp from "./Stamp";+import WhoAmI, { Confirm, fetchMe, type Me } from "./WhoAmI";const SPEEDS = [1, 4, 16, 32, 64];+/** What one build costs on fal (agent + generations + GPU time), for the note on the button and the confirm card. */+const BUILD_COST = "$60-100";/** The agent builder (NEXT_PUBLIC_ANYSCENE_APP): one request builds the whole scene; the agent's log streams in, its* milestones fill the schedule, the critic scores each round. */@@ -46,9 +49,13 @@ export default function BuilderStudio() {const followRef = useRef(true);followRef.current = follow;const [rightOpen, setRightOpen] = useState(true);- const [keyOpen, setKeyOpen] = useState(false);- const [keyDraft, setKeyDraft] = useState("");const [needsKey, setNeedsKey] = useState(false);+ // live only: who this browser is (app/api/me), the sign-in card, and the confirm card before a paid build+ const [me, setMe] = useState<Me | null>(null);+ const [whoOpen, setWhoOpen] = useState<"" | "first" | "edit" | "build">("");+ const [confirming, setConfirming] = useState(false);+ const [checking, setChecking] = useState(false);+ const [copied, setCopied] = useState(false);const [, tick] = useState(0);const refUrl = useRef("");// event times are the builder's own clock (from when the worker started); the slate clock counts from the click@@ -71,6 +78,18 @@ export default function BuilderStudio() {};}, [replayName, initialSpeed]);+ const live = !replayName;+ useEffect(() => {+ if (!live) return;+ if (!getWho()) return setWhoOpen("first");+ fetchMe()+ .then(setMe)+ .catch(() => {+ setNeedsKey(true);+ setWhoOpen("first");+ });+ }, [live]);+useEffect(() => {if (source instanceof ReplaySource) source.speed = speed;}, [source, speed]);@@ -126,12 +145,30 @@ export default function BuilderStudio() {if (followRef.current) setTab("stills");} catch (e) {const msg = errorMessage(e);- if (/access key|proxy is closed/i.test(msg)) setNeedsKey(true);+ if (/password|access key|proxy is closed/i.test(msg)) setNeedsKey(true);dispatch({ type: "fail", message: msg });setEndAt(source.clock());}}, [source, inputs]);+ // Live: a build costs real money, so check who you are and what's left today, then ask before starting.+ const requestBuild = useCallback(async () => {+ if (!live) return doBuild();+ if (!getWho()) return setWhoOpen("build");+ setChecking(true);+ try {+ const m = await fetchMe();+ setMe(m);+ if (m.error) return setWhoOpen("build");+ setConfirming(true);+ } catch {+ setNeedsKey(true);+ setWhoOpen("build");+ } finally {+ setChecking(false);+ }+ }, [live, doBuild]);+// ?watch=<fal request id>: follow a build started elsewhere. Its "received" event carries the request's inputs// (reference, prompt, dials, effort), which fill the form so the page shows what the build was given.const watchStarted = useRef(false);@@ -165,7 +202,7 @@ export default function BuilderStudio() {}).catch((e) => {const msg = errorMessage(e);- if (/access key|proxy is closed/i.test(msg)) setNeedsKey(true);+ if (/password|access key|proxy is closed/i.test(msg)) setNeedsKey(true);dispatch({ type: "fail", message: msg });setEndAt(source.clock());});@@ -189,7 +226,7 @@ export default function BuilderStudio() {} catch (e) {if (stop) return;const msg = errorMessage(e);- if (/access key|proxy is closed/i.test(msg)) setNeedsKey(true);+ if (/password|access key|proxy is closed/i.test(msg)) setNeedsKey(true);dispatch({ type: "fail", message: msg });setEndAt(source.clock());return;@@ -245,7 +282,7 @@ export default function BuilderStudio() {const autoDone = useRef(false);useEffect(() => {- if (auto && source && !autoDone.current) {+ if (auto && source instanceof ReplaySource && !autoDone.current) {autoDone.current = true;setTimeout(() => doBuild(), 1200);}@@ -315,35 +352,24 @@ export default function BuilderStudio() {{openId ? "Back to gallery" : "Gallery"}</a>)}+ {!replay && run.buildId && (+ <button+ className="text-btn"+ title="A link to this build that anyone with the password can open"+ onClick={() => {+ navigator.clipboard?.writeText(`${location.origin}/?open=${run.buildId}`).then(() => {+ setCopied(true);+ setTimeout(() => setCopied(false), 1600);+ });+ }}+ >+ {copied ? "Link copied" : "Copy link"}+ </button>+ )}{!replay && (- <span className="key-ctl">- {keyOpen ? (- <form- onSubmit={(e) => {- e.preventDefault();- setAccessKey(keyDraft.trim());- setKeyOpen(false);- setNeedsKey(false);- }}- >- <input- type="password"- autoComplete="off"- aria-label="Access key"- placeholder="access key"- value={keyDraft}- onChange={(e) => setKeyDraft(e.target.value)}- />- <button className="text-btn" type="submit">- Save- </button>- </form>- ) : (- <button className={`text-btn ${needsKey ? "bad" : ""}`} onClick={() => setKeyOpen(true)}>- {needsKey ? "Access key needed" : getAccessKey() ? "Access key set" : "Access key"}- </button>- )}- </span>+ <button className={`text-btn ${needsKey ? "bad" : ""}`} onClick={() => setWhoOpen("edit")} title={me?.owner || undefined}>+ {needsKey ? "Password needed" : me?.owner ? `${ownerName(me.owner)}${me.admin ? " (admin)" : ""}` : "Sign in"}+ </button>)}<button className="text-btn" onClick={() => setRightOpen((o) => !o)} aria-expanded={rightOpen}>{rightOpen ? "Hide critic" : "Show critic"}@@ -360,8 +386,9 @@ export default function BuilderStudio() {}}disabled={running}canBuild={!!(inputs.file || refUrl.current) && !running && !!source}- building={running}- onBuild={doBuild}+ building={running || checking}+ onBuild={requestBuild}+ note={live ? <CostNote me={me} /> : null}/>{res && res.build_id && openKind === "scene" && <ShotsOrder res={res} source={source instanceof LiveSource ? source : null} />}<BuilderSchedule run={run} now={serverNow} />@@ -392,10 +419,57 @@ export default function BuilderStudio() {<aside className="right" aria-hidden={!rightOpen}><CriticPanel run={run} /></aside>++ {whoOpen && (+ <WhoAmI+ reason={whoOpen === "build" ? (me?.error ?? "Tell AnyScene who you are before starting a build.") : undefined}+ onCancel={whoOpen === "first" ? undefined : () => setWhoOpen("")}+ onDone={(m) => {+ const next = whoOpen;+ setMe(m);+ setNeedsKey(false);+ setWhoOpen("");+ if (next === "build") setConfirming(true);+ }}+ />+ )}+ {confirming && (+ <Confirm+ title="Start this build?"+ yes="Start the build"+ onNo={() => setConfirming(false)}+ onYes={() => {+ setConfirming(false);+ doBuild();+ setTimeout(() => fetchMe().then(setMe, () => {}), 10_000); // the build is counted once fal accepts it+ }}+ >+ <p>+ It runs on fal for up to 2 hours and costs about <b>{BUILD_COST}</b>. It keeps going if you close this tab; find it later under+ My builds in the gallery.+ </p>+ <p className="fine">{quotaLine(me)}</p>+ </Confirm>+ )}</div>);}+function quotaLine(me: Me | null) {+ if (!me) return "";+ if (me.admin || me.open) return "No daily limit for you.";+ const left = Math.max(0, me.limit - me.used);+ return `${left} of ${me.limit} builds left today for ${ownerName(me.owner)} (resets 00:00 UTC).`;+}++function CostNote({ me }: { me: Me | null }) {+ return (+ <span className="cost-note">+ Costs about <b>{BUILD_COST}</b> a build.{me && !me.admin && !me.open ? ` ${Math.max(0, me.limit - me.used)} of ${me.limit} left today.` : ""}+ </span>+ );+}+function errorMessage(e: unknown): string {if (!e) return "Request failed";const anyE = e as { body?: { detail?: unknown }; message?: string; status?: number };diff --git a/web/components/Gallery.tsx b/web/components/Gallery.tsxindex 0d13938..e7ba8b3 100644--- a/web/components/Gallery.tsx+++ b/web/components/Gallery.tsx@@ -4,8 +4,11 @@ import { useCallback, useEffect, useState } from "react";import { useSearchParams } from "next/navigation";import { SCORE_KEYS } from "@/lib/builder";import { ago, cachedList, galleryApp, listGallery, storeList, STATUS_LABEL, type GalleryItem, type GalleryKind, type GalleryList } from "@/lib/gallery";-import { getAccessKey } from "@/lib/sources";+import { getAccessKey, getWho, ownerEmail, ownerName } from "@/lib/sources";import Stamp from "./Stamp";+import WhoAmI from "./WhoAmI";++const WHOSE_STORAGE = "anyscene.gallery.whose";const POLL_MS = 30_000; // the list refreshes while open, so new and running builds show up@@ -20,6 +23,28 @@ export default function Gallery() {const [loading, setLoading] = useState(false);const [error, setError] = useState("");const [filter, setFilter] = useState<"all" | "running" | "done">("all");+ // My builds / Everyone (scenes carry an owner tag; kits don't yet)+ const [whose, setWhose] = useState<"mine" | "everyone">("everyone");+ const [me, setMe] = useState("");+ const [whoOpen, setWhoOpen] = useState(false);+ useEffect(() => {+ setMe(getWho()?.email ?? "");+ try {+ if (localStorage.getItem(WHOSE_STORAGE) === "mine") setWhose("mine");+ } catch {+ /* default: everyone */+ }+ }, []);+ const pickWhose = (w: "mine" | "everyone") => {+ if (w === "mine" && !getWho()) return setWhoOpen(true);+ setWhose(w);+ try {+ localStorage.setItem(WHOSE_STORAGE, w);+ } catch {+ /* not remembered */+ }+ };+ const mine = whose === "mine" && kind === "scene";const load = useCallback(async () => {setLoading(true);@@ -51,7 +76,9 @@ export default function Gallery() {if (override) p.set("gallery_app", override);return `/?${p.toString()}`;};- const builds = (list?.builds ?? []).filter((b) => filter === "all" || (filter === "running" ? b.status === "running" : b.status !== "running"));+ const builds = (list?.builds ?? [])+ .filter((b) => !mine || (!!me && ownerEmail(b.owner) === me))+ .filter((b) => filter === "all" || (filter === "running" ? b.status === "running" : b.status !== "running"));const running = (list?.builds ?? []).filter((b) => b.status === "running").length;return (@@ -89,6 +116,15 @@ export default function Gallery() {Kits</a></div>+ {kind === "scene" && (+ <div className="seg small" role="group" aria-label="Whose builds">+ {(["mine", "everyone"] as const).map((w) => (+ <button key={w} className={(w === "mine") === mine ? "on" : ""} aria-pressed={(w === "mine") === mine} onClick={() => pickWhose(w)}>+ {w === "mine" ? "My builds" : "Everyone"}+ </button>+ ))}+ </div>+ )}<div className="seg small" role="group" aria-label="Show">{(["all", "running", "done"] as const).map((f) => (<button key={f} className={filter === f ? "on" : ""} aria-pressed={filter === f} onClick={() => setFilter(f)}>@@ -111,7 +147,14 @@ export default function Gallery() {{error && (<p className="error-note">{error}- {/access key|proxy is closed/i.test(error) && !getAccessKey() ? " Set the access key on the build page first." : ""}+ {/password|access key/i.test(error) && (+ <>+ {" "}+ <button className="text-btn" onClick={() => setWhoOpen(true)}>+ {getAccessKey() ? "Change the password" : "Enter the password"}+ </button>+ </>+ )}</p>)}{!list && !error && (@@ -122,7 +165,13 @@ export default function Gallery() {)}{list && builds.length === 0 && (<div className="empty gallery-empty">- <p>{filter === "all" ? `No ${kind === "kit" ? "kits" : "builds"} on ${app} yet.` : "Nothing here with this filter."}</p>+ <p>+ {mine && filter === "all"+ ? `No builds under ${me} yet. Builds you start on the build page are saved here.`+ : filter === "all"+ ? `No ${kind === "kit" ? "kits" : "builds"} on ${app} yet.`+ : "Nothing here with this filter."}+ </p></div>)}<ul className="gallery-grid">@@ -131,6 +180,17 @@ export default function Gallery() {))}</ul></main>+ {whoOpen && (+ <WhoAmI+ onCancel={() => setWhoOpen(false)}+ onDone={() => {+ setWhoOpen(false);+ setMe(getWho()?.email ?? "");+ if (error) load();+ else pickWhose("mine");+ }}+ />+ )}</div>);}@@ -171,6 +231,7 @@ function Card({ b, href, now }: { b: GalleryItem; href: string; now?: number })<b>{b.id.replace(/^[bk]_/, "").slice(0, 6).toUpperCase()}</b><span title={b.started ? new Date(b.started * 1000).toLocaleString() : ""}>{b.started ? ago(b.started, now) : ""}</span><span>{b.minutes != null ? `${Math.round(b.minutes)} min` : ""}</span>+ {b.owner && <span className="gallery-owner" title={b.owner}>{ownerName(b.owner)}</span>}<span>{b.critic_rounds ? `${b.critic_rounds} round${b.critic_rounds === 1 ? "" : "s"}${avg != null ? `, avg ${avg.toFixed(1)}` : ""}` : "no critic"}</span>diff --git a/web/components/WhoAmI.tsx b/web/components/WhoAmI.tsxnew file mode 100644index 0000000..07c4fe2--- /dev/null+++ b/web/components/WhoAmI.tsx@@ -0,0 +1,106 @@+"use client";++import { useEffect, useState } from "react";+import { anysceneHeaders, getAccessKey, getWho, setAccessKey, setWho } from "@/lib/sources";++/** What the server says about this browser's key and name (app/api/me). */+export interface Me {+ admin: boolean;+ open: boolean;+ owner: string | null;+ error: string | null;+ limit: number;+ used: number;+ domain: string | null;+}++export async function fetchMe(): Promise<Me> {+ const r = await fetch("/api/me", { headers: anysceneHeaders(), cache: "no-store" });+ const body = await r.json().catch(() => ({}));+ if (!r.ok) throw new Error(body.detail || `HTTP ${r.status}`);+ return body as Me;+}++/** The sign-in card: the shared password and an email or username, kept in this browser. Checked against the server before it closes. */+export default function WhoAmI({ onDone, onCancel, reason }: { onDone: (me: Me) => void; onCancel?: () => void; reason?: string }) {+ const [key, setKey] = useState("");+ const [email, setEmail] = useState("");+ const [busy, setBusy] = useState(false);+ const [error, setError] = useState("");++ useEffect(() => {+ setKey(getAccessKey());+ const w = getWho();+ if (w) setEmail(w.email);+ }, []);++ const submit = async (e: React.FormEvent) => {+ e.preventDefault();+ setBusy(true);+ setError("");+ const prev = { key: getAccessKey(), who: getWho() };+ setAccessKey(key.trim());+ setWho({ name: "", email: email.trim().toLowerCase() });+ try {+ const me = await fetchMe();+ if (me.error) throw new Error(me.error);+ onDone(me);+ } catch (err) {+ setAccessKey(prev.key);+ setWho(prev.who);+ setError(err instanceof Error ? err.message : String(err));+ } finally {+ setBusy(false);+ }+ };++ return (+ <div className="sheet-backdrop" onClick={(e) => e.target === e.currentTarget && onCancel?.()}>+ <form className="sheet" role="dialog" aria-modal="true" aria-labelledby="who-title" onSubmit={submit}>+ <h2 id="who-title">Who's on the call sheet?</h2>+ <p className="fine">+ {reason || "Your builds are saved under your email or username, so you can find them again under My builds."} Kept in this browser only.+ </p>+ <label className="field">+ <span className="field-label">Email or username</span>+ <input required autoComplete="username" value={email} onChange={(e) => setEmail(e.target.value)} maxLength={120} placeholder="[email protected] or a username" />+ </label>+ <label className="field">+ <span className="field-label">Password</span>+ <input type="password" autoComplete="current-password" value={key} onChange={(e) => setKey(e.target.value)} placeholder="from the owner" />+ </label>+ {error && <p className="error-note">{error}</p>}+ <div className="sheet-actions">+ {onCancel && (+ <button type="button" className="secondary" onClick={onCancel}>+ Cancel+ </button>+ )}+ <button type="submit" className="primary" disabled={busy || !email.trim()}>+ {busy ? "Checking" : "Save"}+ </button>+ </div>+ </form>+ </div>+ );+}++/** A yes/no card before something that costs money. */+export function Confirm({ title, children, yes, onYes, onNo }: { title: string; children: React.ReactNode; yes: string; onYes: () => void; onNo: () => void }) {+ return (+ <div className="sheet-backdrop" onClick={(e) => e.target === e.currentTarget && onNo()}>+ <div className="sheet" role="alertdialog" aria-modal="true" aria-labelledby="confirm-title">+ <h2 id="confirm-title">{title}</h2>+ {children}+ <div className="sheet-actions">+ <button type="button" className="secondary" onClick={onNo} autoFocus>+ Cancel+ </button>+ <button type="button" className="primary" onClick={onYes}>+ {yes}+ </button>+ </div>+ </div>+ </div>+ );+}diff --git a/web/lib/gallery.ts b/web/lib/gallery.tsindex 0220a15..2bc3c83 100644--- a/web/lib/gallery.ts+++ b/web/lib/gallery.ts@@ -30,6 +30,8 @@ export interface GalleryItem {floor_plan_url?: string | null;items?: string[] | null;name?: string | null;+ /** Who started it, "Name <email>" (builds since the owner tag; older ones have none). */+ owner?: string | null;critic_rounds: number;last_scores?: Record<string, number> | null;last_summary?: string | null;diff --git a/web/lib/guard.ts b/web/lib/guard.tsnew file mode 100644index 0000000..e64aef5--- /dev/null+++ b/web/lib/guard.ts@@ -0,0 +1,114 @@+// Server only: who may use the proxy, who they say they are, and how many builds they have left today. Used by+// app/api/fal/proxy (every fal call) and app/api/me (the page's "who am I, what's left" check).+import { createHash, timingSafeEqual } from "node:crypto";+import { list, put } from "@vercel/blob";++// Shared password: set ANYSCENE_ACCESS_KEY on the server and every proxied request must carry it as x-anyscene-key.+// Off in local dev when the variable is unset; in production an unset key closes the proxy (fail closed), so a fresh+// deployment can't be used to start builds on the owner's account. ANYSCENE_ADMIN_KEY, given in place of the access+// key, also skips the per-IP and per-person limits.+export const ACCESS_KEY = process.env.ANYSCENE_ACCESS_KEY || "";+const ADMIN_KEY = process.env.ANYSCENE_ADMIN_KEY || "";+export const DEV_OPEN = !ACCESS_KEY && process.env.NODE_ENV !== "production";++// New jobs per client IP per hour (in memory, per serverless instance: a backstop) and builds per person per UTC day+// (in a private Vercel Blob store when BLOB_READ_WRITE_TOKEN is set, so it holds across instances; else in memory).+export const JOBS_PER_HOUR = Number(process.env.ANYSCENE_JOBS_PER_HOUR || 6);+export const BUILDS_PER_DAY = Number(process.env.ANYSCENE_BUILDS_PER_DAY || 3);+// Optional: only emails at this domain may build (e.g. fal.ai); usernames are always allowed, the password is the gate.+export const OWNER_DOMAIN = (process.env.ANYSCENE_OWNER_DOMAIN || "").trim().toLowerCase().replace(/^@/, "");++const same = (got: string, want: string) => {+ const a = Buffer.from(got);+ const b = Buffer.from(want);+ return !!want && a.length === b.length && timingSafeEqual(a, b);+};++/** "admin", "user", or null when the key is missing or wrong. */+export function keyRole(req: Request): "admin" | "user" | null {+ const got = req.headers.get("x-anyscene-key") || "";+ if (ADMIN_KEY && same(got, ADMIN_KEY)) return "admin";+ if (DEV_OPEN || same(got, ACCESS_KEY)) return "user";+ return null;+}++export function keyError(req: Request) {+ if (!ACCESS_KEY) return "The AnyScene proxy is closed: ANYSCENE_ACCESS_KEY is not set on the server.";+ return req.headers.get("x-anyscene-key") ? "That password isn't right." : "This AnyScene needs the password.";+}++const RESERVED = /^(admin|administrator|owner|root|anyscene)$/;++export interface Owner {+ email: string;+ name: string;+ /** What a build is tagged with: "Name <email>". */+ tag: string;+}++/** Who the request says it is (x-anyscene-user: an email or a username; x-anyscene-name optional), or an error to show. */+export function owner(req: Request, role: "admin" | "user" | null = null): Owner | { error: string } {+ const email = (req.headers.get("x-anyscene-user") || "").trim().toLowerCase();+ let name = "";+ try {+ name = decodeURIComponent(req.headers.get("x-anyscene-name") || "");+ } catch {+ /* a malformed name is just left out */+ }+ name = name.replace(/[<>\p{Cc}]/gu, "").trim().slice(0, 60);+ if (!email) return { error: "Tell AnyScene who you are (email or username) before starting a build." };+ if (email.includes("@")) {+ if (!/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(email) || email.length > 120) return { error: `"${email}" is not an email address.` };+ if (OWNER_DOMAIN && !email.endsWith(`@${OWNER_DOMAIN}`)) return { error: `Builds here are for @${OWNER_DOMAIN} addresses.` };+ } else if (!/^[a-z0-9._-]{2,40}$/.test(email)) {+ return { error: "A username is 2 to 40 letters, digits, dots, dashes or underscores." };+ }+ // The label is self-declared, so names that would pass for the owner need the admin password.+ if (role !== "admin" && RESERVED.test(email.split("@")[0])) return { error: `"${email}" is reserved for the owner. Pick another name.` };+ return { email, name, tag: name ? `${name} <${email}>` : email };+}++export function clientIp(req: Request) {+ return (req.headers.get("x-forwarded-for") || "").split(",")[0].trim() || req.headers.get("x-real-ip") || "unknown";+}++// ---------------------------------------------------------------- per-IP, per hour+const jobs = new Map<string, number[]>();++/** Counts a new job for this IP; true when it is over the hourly limit (and then not counted). */+export function ipLimited(ip: string) {+ const now = Date.now();+ const recent = (jobs.get(ip) || []).filter((t) => now - t < 3600_000);+ const over = recent.length >= JOBS_PER_HOUR;+ if (!over) recent.push(now);+ jobs.set(ip, recent);+ return over;+}++// ---------------------------------------------------------------- per person, per UTC day+const BLOB = !!process.env.BLOB_READ_WRITE_TOKEN;+const memBuilds = new Map<string, number>();+const day = () => new Date().toISOString().slice(0, 10);+const prefix = (email: string) => `quota/${day()}/${createHash("sha256").update(email).digest("hex").slice(0, 24)}/`;++export async function buildsToday(email: string): Promise<number> {+ if (!BLOB) return memBuilds.get(prefix(email)) ?? 0;+ const r = await list({ prefix: prefix(email), limit: 1000 });+ return r.blobs.length;+}++export async function recordBuild(email: string, requestId: string) {+ if (!BLOB) {+ memBuilds.set(prefix(email), (memBuilds.get(prefix(email)) ?? 0) + 1);+ return;+ }+ await put(`${prefix(email)}${Date.now()}-${requestId || "job"}.json`, JSON.stringify({ email, requestId, at: new Date().toISOString() }), {+ access: "private",+ contentType: "application/json",+ addRandomSuffix: true,+ });+}++export function quotaMessage() {+ return `That's ${BUILDS_PER_DAY} builds today for you, the daily limit (it resets at 00:00 UTC). Ask the owner if you need more.`;+}diff --git a/web/lib/sources.ts b/web/lib/sources.tsindex 5dcf61c..ba3e1c8 100644--- a/web/lib/sources.ts+++ b/web/lib/sources.ts@@ -36,7 +36,7 @@ export interface Source {// ---------------------------------------------------------------- live-// The proxy can require a shared access key (ANYSCENE_ACCESS_KEY on the server). The viewer types it once; it is kept+// The proxy can require a shared password (ANYSCENE_ACCESS_KEY on the server). The viewer types it once; it is kept// in this browser's localStorage and sent as x-anyscene-key to our own proxy only (the proxy never forwards it to fal).export const ACCESS_KEY_STORAGE = "anyscene.access-key";export function getAccessKey(): string {@@ -57,15 +57,56 @@ export function setAccessKey(k: string) {}let sessionKey = "";+// Who is building: an email or username the viewer gives once, kept in localStorage and sent to our proxy as+// x-anyscene-user / x-anyscene-name. The proxy tags each build with it (`owner`, listed in /builds) and counts it+// against the per-person daily limit. Self-declared, behind the shared password: a label, not authentication.+export interface Who {+ name: string;+ email: string;+}+export const WHO_STORAGE = "anyscene.who";+let sessionWho: Who | null = null;+export function getWho(): Who | null {+ if (sessionWho) return sessionWho;+ try {+ const w = JSON.parse(localStorage.getItem(WHO_STORAGE) || "null");+ return w?.email ? { name: String(w.name || ""), email: String(w.email) } : null;+ } catch {+ return null;+ }+}+export function setWho(w: Who | null) {+ sessionWho = w;+ try {+ if (w) localStorage.setItem(WHO_STORAGE, JSON.stringify(w));+ else localStorage.removeItem(WHO_STORAGE);+ } catch {+ /* private window: kept for this page only */+ }+}+/** The owner tag a build carries: "Name <email>". */+export const ownerEmail = (owner?: string | null) => (owner?.match(/<([^>]+)>/)?.[1] ?? owner ?? "").toLowerCase();+export const ownerName = (owner?: string | null) => owner?.replace(/\s*<[^>]*>\s*$/, "").trim() || ownerEmail(owner).split("@")[0];++/** Our own headers for /api/* calls: the access key and who is asking. */+export function anysceneHeaders(): Record<string, string> {+ const h: Record<string, string> = {};+ const key = sessionKey || getAccessKey();+ if (key) h["x-anyscene-key"] = key;+ const who = getWho();+ if (who) {+ h["x-anyscene-user"] = who.email;+ h["x-anyscene-name"] = encodeURIComponent(who.name);+ }+ return h;+}+let falConfigured = false;export function configureFal() {if (falConfigured) return;fal.config({proxyUrl: "/api/fal/proxy",- requestMiddleware: async (req) => {- const key = sessionKey || getAccessKey();- return key ? { ...req, headers: { ...(req.headers || {}), "x-anyscene-key": key } } : req;- },+ requestMiddleware: async (req) => ({ ...req, headers: { ...(req.headers || {}), ...anysceneHeaders() } }),});falConfigured = true;}diff --git a/web/package-lock.json b/web/package-lock.jsonindex cedd3bd..0ee1078 100644--- a/web/package-lock.json+++ b/web/package-lock.json@@ -10,6 +10,7 @@"dependencies": {"@fal-ai/client": "^1.10.1","@fal-ai/server-proxy": "^1.2.1",+ "@vercel/blob": "2.8.2","next": "^16.4.3","react": "^19.3.1","react-dom": "^19.3.1",@@ -815,6 +816,68 @@"dev": true,"license": "MIT"},+ "node_modules/@vercel/blob": {+ "version": "2.8.2",+ "resolved": "https://registry.npmjs.org/@vercel/blob/-/blob-2.8.2.tgz",+ "integrity": "sha512-ZUUWO2VA00r9ZTRtKgH4va7FGOUxUtge2FaRr9WZmeeX2s3C3qVe2tOTLTbv/tkcd+L+ijxaI2eP9S1/mGHc9Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "@vercel/oidc": "^3.6.1",+ "async-retry": "^1.3.3",+ "is-buffer": "^2.0.5",+ "is-node-process": "^1.2.0",+ "throttleit": "^2.1.0",+ "undici": "^6.23.0"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@vercel/cli-config": {+ "version": "0.3.1",+ "resolved": "https://registry.npmjs.org/@vercel/cli-config/-/cli-config-0.3.1.tgz",+ "integrity": "sha512-sISbygqlFXYb8qfPu/+2Cf/A8IjrlAuZePdag3EDQr2PRA455s7UZtl9Ro674CWsB/saBRmz3jEkw0YsQs8OoQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "xdg-app-paths": "5",+ "zod": "4.1.11"+ }+ },+ "node_modules/@vercel/cli-exec": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@vercel/cli-exec/-/cli-exec-1.0.1.tgz",+ "integrity": "sha512-g9XerViJ/paZujufXYcu5XYI2vU2rtB4sgdpjUHde5RnOkdmpu0ngH46LCFGHoPXO/C+qDPSczIHIRN+8Q2YKQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "execa": "5.1.1"+ },+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/@vercel/oidc": {+ "version": "3.8.10",+ "resolved": "https://registry.npmjs.org/@vercel/oidc/-/oidc-3.8.10.tgz",+ "integrity": "sha512-sPw1kIfQEA6/2dB+zlAJHnhhNBRJ8t/t4HfFvKO+g0EPBA7NbCKyGovuhgAV6Mnl865ka7HqCEguIy596czdAw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@vercel/cli-config": "0.3.1",+ "@vercel/cli-exec": "1.0.1",+ "jose": "^5.9.6"+ },+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/async-retry": {+ "version": "1.3.3",+ "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz",+ "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==",+ "license": "MIT",+ "dependencies": {+ "retry": "0.13.1"+ }+ },"node_modules/baseline-browser-mapping": {"version": "2.11.34","resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.34.tgz",@@ -853,6 +916,20 @@"integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==","license": "MIT"},+ "node_modules/cross-spawn": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.1.0",+ "shebang-command": "^2.0.0",+ "which": "^2.0.1"+ },+ "engines": {+ "node": ">= 8"+ }+ },"node_modules/csstype": {"version": "3.2.3","resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",@@ -879,6 +956,29 @@"node": ">=14.18"}},+ "node_modules/execa": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",+ "license": "MIT",+ "dependencies": {+ "cross-spawn": "^7.0.3",+ "get-stream": "^6.0.0",+ "human-signals": "^2.1.0",+ "is-stream": "^2.0.0",+ "merge-stream": "^2.0.0",+ "npm-run-path": "^4.0.1",+ "onetime": "^5.1.2",+ "signal-exit": "^3.0.3",+ "strip-final-newline": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/execa?sponsor=1"+ }+ },"node_modules/fflate": {"version": "0.8.3","resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz",@@ -886,6 +986,89 @@"dev": true,"license": "MIT"},+ "node_modules/get-stream": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/human-signals": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">=10.17.0"+ }+ },+ "node_modules/is-buffer": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz",+ "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/is-node-process": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz",+ "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==",+ "license": "MIT"+ },+ "node_modules/is-stream": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/isexe": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",+ "license": "ISC"+ },+ "node_modules/jose": {+ "version": "5.10.0",+ "resolved": "https://registry.npmjs.org/jose/-/jose-5.10.0.tgz",+ "integrity": "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/panva"+ }+ },+ "node_modules/merge-stream": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",+ "license": "MIT"+ },"node_modules/meshoptimizer": {"version": "1.1.1","resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.1.1.tgz",@@ -893,6 +1076,15 @@"dev": true,"license": "MIT"},+ "node_modules/mimic-fn": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },"node_modules/nanoid": {"version": "3.3.20","resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",@@ -964,6 +1156,51 @@}}},+ "node_modules/npm-run-path": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/onetime": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",+ "license": "MIT",+ "dependencies": {+ "mimic-fn": "^2.1.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/os-paths": {+ "version": "4.4.0",+ "resolved": "https://registry.npmjs.org/os-paths/-/os-paths-4.4.0.tgz",+ "integrity": "sha512-wrAwOeXp1RRMFfQY8Sy7VaGVmPocaLwSFOYCGKSyo8qmJ+/yaafCl5BCA1IQZWqFSRBrKDYFeR9d/VyQzfH/jg==",+ "license": "MIT",+ "engines": {+ "node": ">= 6.0"+ }+ },+ "node_modules/path-key": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },"node_modules/picocolors": {"version": "1.1.1","resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",@@ -1044,6 +1281,15 @@"react": "^19.3.1"}},+ "node_modules/retry": {+ "version": "0.13.1",+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz",+ "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==",+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },"node_modules/robot3": {"version": "0.4.1","resolved": "https://registry.npmjs.org/robot3/-/robot3-0.4.1.tgz",@@ -1119,6 +1365,33 @@}}},+ "node_modules/shebang-command": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",+ "license": "MIT",+ "dependencies": {+ "shebang-regex": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/shebang-regex": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/signal-exit": {+ "version": "3.0.7",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",+ "license": "ISC"+ },"node_modules/source-map-js": {"version": "1.2.2","resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",@@ -1128,6 +1401,15 @@"node": ">=0.10.0"}},+ "node_modules/strip-final-newline": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },"node_modules/styled-jsx": {"version": "5.1.6","resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz",@@ -1157,6 +1439,18 @@"integrity": "sha512-Qiu7R+Cmh8CstZsY1uJOSWnVlfo7ZtNLV7mF8Jltk3LB3AtDu9cRZlcnRKkAk8Y4z6KKw35z7Y7Urd7jWY8etA==","license": "MIT"},+ "node_modules/throttleit": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-2.1.0.tgz",+ "integrity": "sha512-nt6AMGKW1p/70DF/hGBdJB57B8Tspmbp5gfJ8ilhLnt7kkr2ye7hzD6NVG8GGErk2HWF34igrL2CXmNIkzKqKw==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/tslib": {"version": "2.9.1","resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz",@@ -1177,12 +1471,70 @@"node": ">=14.17"}},+ "node_modules/undici": {+ "version": "6.29.1",+ "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz",+ "integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==",+ "license": "MIT",+ "engines": {+ "node": ">=18.17"+ }+ },"node_modules/undici-types": {"version": "8.9.0","resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz","integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==","dev": true,"license": "MIT"+ },+ "node_modules/which": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",+ "license": "ISC",+ "dependencies": {+ "isexe": "^2.0.0"+ },+ "bin": {+ "node-which": "bin/node-which"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/xdg-app-paths": {+ "version": "5.5.1",+ "resolved": "https://registry.npmjs.org/xdg-app-paths/-/xdg-app-paths-5.5.1.tgz",+ "integrity": "sha512-hI3flOB4PLZIy5prbtTpirobtPE2ZtZ52szO+2mM9Efp6ErM398La+C1lIpNWDfNoQk+6Lsi6nMcCwVB7pxeMQ==",+ "license": "MIT",+ "dependencies": {+ "os-paths": "^4.0.1",+ "xdg-portable": "^7.2.0"+ },+ "engines": {+ "node": ">= 6.0"+ }+ },+ "node_modules/xdg-portable": {+ "version": "7.3.0",+ "resolved": "https://registry.npmjs.org/xdg-portable/-/xdg-portable-7.3.0.tgz",+ "integrity": "sha512-sqMMuL1rc0FmMBOzCpd0yuy9trqF2yTTVe+E9ogwCSWQCdDEtQUwrZPT6AxqtsFGRNxycgncbP/xmOOSPw5ZUw==",+ "license": "MIT",+ "dependencies": {+ "os-paths": "^4.0.1"+ },+ "engines": {+ "node": ">= 6.0"+ }+ },+ "node_modules/zod": {+ "version": "4.1.11",+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.11.tgz",+ "integrity": "sha512-WPsqwxITS2tzx1bzhIKsEs19ABD5vmCVa4xBo2tq/SrV4RNZtfws1EnCWQXM6yh8bD08a1idvkB5MZSBiZsjwg==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/colinhacks"+ }}}}diff --git a/web/package.json b/web/package.jsonindex 5a7e906..41a931a 100644--- a/web/package.json+++ b/web/package.json@@ -18,6 +18,7 @@"dependencies": {"@fal-ai/client": "^1.10.1","@fal-ai/server-proxy": "^1.2.1",+ "@vercel/blob": "2.8.2","next": "^16.4.3","react": "^19.3.1","react-dom": "^19.3.1",