janction-render 0.4.280__tar.gz → 0.4.296__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {janction_render-0.4.280 → janction_render-0.4.296}/PKG-INFO +1 -1
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/__init__.py +1 -1
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/brief.py +19 -4
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/cli.py +157 -4
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/client.py +20 -5
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/mcp_common.py +250 -9
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/mcp_server.py +65 -10
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/terms_defaults.py +2 -1
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/tooldocs.py +7 -7
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render.egg-info/PKG-INFO +1 -1
- {janction_render-0.4.280 → janction_render-0.4.296}/pyproject.toml +1 -1
- {janction_render-0.4.280 → janction_render-0.4.296}/LICENSE +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/README.md +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/decision_words.py +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/desktop_notify.py +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/hookup.py +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/libplan.py +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/links.py +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/mcp_app.html +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render/prompts.py +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render.egg-info/SOURCES.txt +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render.egg-info/dependency_links.txt +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render.egg-info/entry_points.txt +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render.egg-info/requires.txt +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/janction_render.egg-info/top_level.txt +0 -0
- {janction_render-0.4.280 → janction_render-0.4.296}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: janction-render
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.296
|
|
4
4
|
Summary: Cloud GPU rendering for Blender scenes and 3D models (GLB, FBX, USD, OBJ, STL), built for AI agents: MCP server (remote + stdio), HTTP API and CLI. Product shots, 360-degree turntables, animations and stills; preview in seconds with a critic; no local Blender or GPU. Free welcome credit for a new key. Current pricing and limits: https://render.janction.jp/pricing
|
|
5
5
|
Author-email: "JasmyLab Inc." <contact@jasmylab.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -47,7 +47,11 @@ def estimate_brief(e: dict[str, Any] | None) -> dict[str, Any] | None:
|
|
|
47
47
|
# 11/9 シーンと違う設定・シーンの設定で描く値(受付の旗 JR_SCENE_DIFF・JR_SCENE_SETTINGS。OFF なら無い)
|
|
48
48
|
"scene_diff", "scene_settings",
|
|
49
49
|
# 11/9 最終の経路での試し描きのコマ・見積もり・値段(受付の旗 JR_FINAL_TEST。OFF なら無い)
|
|
50
|
-
"test"
|
|
50
|
+
"test",
|
|
51
|
+
# 11/13 見積もりの ID(受付の旗 JR_ESTIMATE_ID。OFF なら無い)。render_final(estimate_id=...) に渡す
|
|
52
|
+
"estimate_id",
|
|
53
|
+
# 11/13 人に見せる計画(受付の旗 JR_PLAN_REQUIRED。OFF なら無い): 描くもの・天井・時間・送り先
|
|
54
|
+
"plan")
|
|
51
55
|
return {k: e[k] for k in keep if e.get(k) is not None}
|
|
52
56
|
|
|
53
57
|
|
|
@@ -58,6 +62,8 @@ FINAL_W, FINAL_H, FINAL_SPP = 1920, 1080, 128
|
|
|
58
62
|
PRESET_FINALS: dict[str, dict[str, Any]] = {
|
|
59
63
|
"product": {"what": "4 product shots (PNG, 0/90/180/270 degrees)", "width": 1440, "height": 1440, "samples": 128},
|
|
60
64
|
"turntable": {"what": "a 360-degree turntable MP4", "width": 1280, "height": 720, "samples": 64},
|
|
65
|
+
# 11/12 スキャン向け(受付の旗 JR_SCAN_PRESET。旗が効いた試し描きだけが params.preset に scan を持つ)
|
|
66
|
+
"scan": {"what": "a 4-second sweep around the scan (MP4)", "width": 1280, "height": 720, "samples": 64},
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
|
|
@@ -146,9 +152,12 @@ def final_body_after_preview(j: dict[str, Any]) -> dict[str, Any] | None:
|
|
|
146
152
|
# 10/14: preset='product' の試し描きのあとに preset なしの仕上げを勧めていた(4 枚の PNG ではなく 1080p の 4 コマの回転になる)。
|
|
147
153
|
# 同じ preset で仕上げる(大きさ・出力は受付が preset から決める)
|
|
148
154
|
body = {"scene_id": j["scene_id"], "kind": "final", "preset": pre}
|
|
149
|
-
for k in ("engine", "blender", "transparent"
|
|
155
|
+
for k in ("engine", "blender", "transparent", "subject_only", "reduce_points", "ocio_config", "scene_name",
|
|
156
|
+
"camera_move", "camera_angle"):
|
|
150
157
|
if p.get(k):
|
|
151
158
|
body[k] = p[k]
|
|
159
|
+
if pre == "scan" and not p.get("subject_only"):
|
|
160
|
+
body["subject_only"] = False # 試し描きで周りを残した(か、その旗が効いていない)なら、仕上げも同じに
|
|
152
161
|
return body
|
|
153
162
|
frames = [int(x) for x in (j.get("frames") or []) if isinstance(x, (int, float))]
|
|
154
163
|
body: dict[str, Any] = {"scene_id": j["scene_id"], "kind": "final", "width": FINAL_W, "height": FINAL_H, "samples": FINAL_SPP}
|
|
@@ -169,7 +178,8 @@ def final_body_after_preview(j: dict[str, Any]) -> dict[str, Any] | None:
|
|
|
169
178
|
body["frame_start"], body["frame_end"] = min(frames), max(frames)
|
|
170
179
|
else:
|
|
171
180
|
body["frame_start"] = body["frame_end"] = int(j.get("frame_start") or 1)
|
|
172
|
-
for k in ("engine", "blender", "camera", "transparent"
|
|
181
|
+
for k in ("engine", "blender", "camera", "transparent", "subject_only", "reduce_points", "ocio_config", "scene_name",
|
|
182
|
+
"camera_move", "camera_angle"):
|
|
173
183
|
if p.get(k):
|
|
174
184
|
body[k] = p[k]
|
|
175
185
|
env = p.get("environment")
|
|
@@ -477,7 +487,11 @@ def preview_presentation(j: dict[str, Any], fu: dict[str, Any] | None, image_url
|
|
|
477
487
|
f"the project now (curl -L -o preview.png '{image_url}'); in a chat app, tell the user to save the image. "
|
|
478
488
|
"render_share makes a page that stays (unlisted).")
|
|
479
489
|
else:
|
|
480
|
-
|
|
490
|
+
# 11/13: 「24 時間」と決め打ちしていた。払った鍵(累計 500 円以上)は 7 日・月額は 30 日なので、仕事の expires_at で言う
|
|
491
|
+
until = str(j.get("expires_at") or "").strip()
|
|
492
|
+
when = (f"keeps its own copy until {until}, counted from the last use" if until
|
|
493
|
+
else "deletes its own copy after a while from the last use (24 hours, 7 days for keys that paid 500 JPY or more)")
|
|
494
|
+
keep = f"Saved to {saved_to}; the files stay there (the service {when})." if saved_to else ""
|
|
481
495
|
out: dict[str, Any] = {"show_user": show, "show_user_ja": show_ja, "next_actions": actions}
|
|
482
496
|
if keep:
|
|
483
497
|
out["keep"] = keep
|
|
@@ -656,6 +670,7 @@ def brief(j: dict[str, Any]) -> dict[str, Any]:
|
|
|
656
670
|
"job_id": j["job_id"],
|
|
657
671
|
"kind": j["kind"],
|
|
658
672
|
"status": j["status"],
|
|
673
|
+
**({"news": j["news"]} if isinstance(j.get("news"), dict) else {}), # 11/13 伝えてもいい話(受付が描き終えた結果に 1 回)
|
|
659
674
|
**({"stage": j["stage"]} if j.get("stage") and j.get("stage") != j.get("status") else {}), # rendering / assembling(10/14)
|
|
660
675
|
"scene_id": j["scene_id"],
|
|
661
676
|
"frames": j["frames"] if j.get("frames") else f"{j['frame_start']}-{j['frame_end']}",
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
janction-render render scene.blend --frames 1-240 --test # 同じ設定で 10 コマ試し、測った秒・検品・全体の値段を見てから全体
|
|
6
6
|
janction-render status JOB
|
|
7
7
|
janction-render download JOB --out DIR [--wait 600]
|
|
8
|
+
janction-render download JOB --out DIR --follow # 描いている間、描けたコマから順に落とし続ける
|
|
8
9
|
janction-render cancel JOB
|
|
9
10
|
janction-render retry JOB [--yes] # 失敗・取り消しの仕上げの足りないコマだけ描き直す(値段を先に見せる)
|
|
10
11
|
janction-render jobs
|
|
@@ -21,7 +22,9 @@ from __future__ import annotations
|
|
|
21
22
|
import argparse
|
|
22
23
|
import json
|
|
23
24
|
import os
|
|
25
|
+
import re
|
|
24
26
|
import sys
|
|
27
|
+
import time
|
|
25
28
|
from pathlib import Path
|
|
26
29
|
from typing import Any
|
|
27
30
|
|
|
@@ -169,6 +172,48 @@ def cmd_upload(c: Client, args: argparse.Namespace) -> int:
|
|
|
169
172
|
return 0
|
|
170
173
|
|
|
171
174
|
|
|
175
|
+
def cmd_verify_package(c: Any, args: argparse.Namespace) -> int:
|
|
176
|
+
"""手元に落とした仕上げのフォルダを package.json(受付の旗 JR_DELIVERY_PACKAGE の納品の目録)と照らす(11/13、v2 QAD-08)。
|
|
177
|
+
受付には何も送らない。欠け・中身違い・目録に無い納品物があれば 1 で終わる。"""
|
|
178
|
+
from .server import package
|
|
179
|
+
folder = Path(args.folder)
|
|
180
|
+
if not (folder / package.NAME).is_file():
|
|
181
|
+
print(_j({"ok": False, "error": f"no {package.NAME} in {folder}"}))
|
|
182
|
+
return 1
|
|
183
|
+
out = package.verify(folder)
|
|
184
|
+
print(_j(out))
|
|
185
|
+
return 0 if out["ok"] else 1
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def cmd_bake(c: Client, args: argparse.Namespace) -> int:
|
|
189
|
+
""".blend のシミュレーションを受付の側で焼き、焼いたシーンの scene_id を出す(11/12、受付の旗 JR_FARM_BAKE)。
|
|
190
|
+
焼くのは描かない作業(GPU を付けない)。出た baked_scene_id で render --scene-id を打てば、焼いたシミュレーションで描ける。"""
|
|
191
|
+
sid = _scene(c, args)
|
|
192
|
+
j = c.submit(sid, kind="task", task="bake_simulations")
|
|
193
|
+
print(f"job {j['job_id']} queued (bakes the simulations, no render)", file=sys.stderr)
|
|
194
|
+
j = c.wait(j["job_id"], timeout=args.timeout, on_progress=_progress)
|
|
195
|
+
out = {"job_id": j.get("job_id"), "status": j.get("status"), "scene_id": sid}
|
|
196
|
+
if j.get("status") != "done":
|
|
197
|
+
out.update({k: j.get(k) for k in ("error", "log_tail") if j.get(k)})
|
|
198
|
+
print(_j(out))
|
|
199
|
+
return 1
|
|
200
|
+
folder = Path(args.out) if args.out else Path("render_out") / safe_name(j["job_id"])
|
|
201
|
+
paths = c.download(j["job_id"], folder, only=["verification.json", "scene.blend"])
|
|
202
|
+
ver = {}
|
|
203
|
+
for p in paths:
|
|
204
|
+
if p.name == "verification.json":
|
|
205
|
+
try:
|
|
206
|
+
ver = json.loads(p.read_text(encoding="utf-8"))
|
|
207
|
+
except ValueError:
|
|
208
|
+
ver = {}
|
|
209
|
+
out.update({k: ver.get(k) for k in ("baked_scene_id", "baked", "not_baked", "bake_errors", "next") if ver.get(k) is not None})
|
|
210
|
+
out["files"] = [str(p) for p in paths]
|
|
211
|
+
if ver.get("baked_scene_id"):
|
|
212
|
+
print(f"baked: render it with janction-render render --scene-id {ver['baked_scene_id']} ...", file=sys.stderr)
|
|
213
|
+
print(_j(out))
|
|
214
|
+
return 0 if ver.get("baked_scene_id") else 1
|
|
215
|
+
|
|
216
|
+
|
|
172
217
|
def cmd_inspect(c: Client, args: argparse.Namespace) -> int:
|
|
173
218
|
sid = _scene(c, args)
|
|
174
219
|
j = c.submit(sid, kind="info")
|
|
@@ -204,13 +249,45 @@ def cmd_inspect(c: Client, args: argparse.Namespace) -> int:
|
|
|
204
249
|
return 0
|
|
205
250
|
|
|
206
251
|
|
|
252
|
+
def _frame_range(text: str) -> "tuple[int, int] | None":
|
|
253
|
+
m = re.fullmatch(r"\s*(\d+)\s*-\s*(\d+)\s*", text or "")
|
|
254
|
+
return (int(m.group(1)), int(m.group(2))) if m and int(m.group(2)) >= int(m.group(1)) else None
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def _scene_frame_range(c: Client, sid: str, args: argparse.Namespace) -> tuple[int, int]:
|
|
258
|
+
"""シーンのコマの範囲(読み取りの仕事。GPU なし・無料)。--draft-video で --frames を渡さなかったとき(11/13)。"""
|
|
259
|
+
print("reading the scene's frame range first (no GPU time, nothing charged)", file=sys.stderr)
|
|
260
|
+
j = c.submit(sid, kind="info")
|
|
261
|
+
if j.get("status") != "done":
|
|
262
|
+
j = c.wait(j["job_id"], timeout=min(float(getattr(args, "timeout", 300) or 300), 600.0), on_progress=_progress)
|
|
263
|
+
if j.get("status") != "done":
|
|
264
|
+
raise SystemExit(f"could not read the scene ({j.get('error') or j.get('status')}); pass --frames START-END")
|
|
265
|
+
info = j.get("info") or {}
|
|
266
|
+
return int(info.get("frame_start") or 1), int(info.get("frame_end") or 1)
|
|
267
|
+
|
|
268
|
+
|
|
207
269
|
def cmd_preview(c: Client, args: argparse.Namespace) -> int:
|
|
270
|
+
if getattr(args, "full_turn", False) and getattr(args, "draft_video", False):
|
|
271
|
+
raise SystemExit("--full-turn and --draft-video do not go together: one is a turn around the subject, the other the scene's animation")
|
|
208
272
|
sid = _scene(c, args)
|
|
209
273
|
w, h = args.size
|
|
210
274
|
frames = parse_frames(args.frames, default=args.frame)
|
|
275
|
+
extra: dict[str, Any] = {}
|
|
276
|
+
what = f"frames {frames}"
|
|
277
|
+
if getattr(args, "full_turn", False):
|
|
278
|
+
# 11/13 一周を 1 枚で(受付の full_turn): 回るカメラの 1 周を最大 24 コマ、角度の札つきで 1 枚に並べる
|
|
279
|
+
frames, what = None, "the whole turn (up to 24 frames in one sheet)"
|
|
280
|
+
extra.update(orbit=True, full_turn=True)
|
|
281
|
+
elif getattr(args, "draft_video", False):
|
|
282
|
+
# 11/13 下描き動画(受付の draft_video): 範囲から最大 24 コマを小さく描き、並べた 1 枚と実際の長さで流れる draft.mp4
|
|
283
|
+
rng = _frame_range(args.frames) or _scene_frame_range(c, sid, args)
|
|
284
|
+
if rng[1] <= rng[0]:
|
|
285
|
+
raise SystemExit("the scene has one frame; --draft-video is for an animation (pass --frames START-END)")
|
|
286
|
+
frames, what = None, f"a draft video of frames {rng[0]}-{rng[1]}"
|
|
287
|
+
extra.update(draft_video=True, frame_start=rng[0], frame_end=rng[1])
|
|
211
288
|
j = c.submit(sid, kind="preview", frames=frames, camera=args.camera, width=w, height=h,
|
|
212
|
-
samples=args.samples, engine=args.engine, max_yen=args.max_yen)
|
|
213
|
-
print(f"job {j['job_id']} queued:
|
|
289
|
+
samples=args.samples, engine=args.engine, max_yen=args.max_yen, **extra)
|
|
290
|
+
print(f"job {j['job_id']} queued: {what} (estimate ~{j['estimate']['seconds']}s)", file=sys.stderr)
|
|
214
291
|
j = c.wait(j["job_id"], timeout=args.timeout, on_progress=_progress)
|
|
215
292
|
if j["status"] != "done":
|
|
216
293
|
print(_j({k: j.get(k) for k in ("job_id", "status", "error", "log_tail", "warnings")}))
|
|
@@ -529,7 +606,41 @@ def cmd_status(c: Client, args: argparse.Namespace) -> int:
|
|
|
529
606
|
return 0
|
|
530
607
|
|
|
531
608
|
|
|
609
|
+
FOLLOW_DONE = ("done", "failed", "canceled", "expired")
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
def follow_download(c: Client, job_id: str, out: Path, interval: float = 10.0, timeout: float = 0.0,
|
|
613
|
+
sleep: Any = time.sleep, say: Any = None) -> tuple[dict[str, Any], list[Path]]:
|
|
614
|
+
"""描いている間、描けたコマ(成果物に出たもの)から順に落とし続け、終わったら残り(動画・点検の報告)を全部落とす(11/12)。
|
|
615
|
+
競合の同期アプリ(GarageFarm renderBeamer・Ranch RANCHSync など)に当たる。手元にあるファイルは落とし直さない(Client.download)。
|
|
616
|
+
timeout が 0 より大きければ、その秒で待つのをやめる(そこまでに届いた分は手元に残る)。返す: (最後の仕事の状態, 手元のファイル)。"""
|
|
617
|
+
say = say or (lambda _m: None)
|
|
618
|
+
t0 = time.monotonic()
|
|
619
|
+
have: set[str] = set()
|
|
620
|
+
paths: list[Path] = []
|
|
621
|
+
while True:
|
|
622
|
+
j = c.job(job_id)
|
|
623
|
+
names = [a["name"] for a in (j.get("artifacts") or [])]
|
|
624
|
+
new = [n for n in names if n not in have]
|
|
625
|
+
if new:
|
|
626
|
+
got = c.download(job_id, out, only=new)
|
|
627
|
+
have.update(new)
|
|
628
|
+
paths = sorted(set(paths) | set(got))
|
|
629
|
+
say(f"{job_id}: {len(have)} file(s) here ({j.get('progress') or j.get('status')})")
|
|
630
|
+
if j.get("status") in FOLLOW_DONE:
|
|
631
|
+
return j, paths
|
|
632
|
+
if timeout and time.monotonic() - t0 > timeout:
|
|
633
|
+
say(f"{job_id}: stopped following after {int(timeout)} s; it is still {j.get('status')}")
|
|
634
|
+
return j, paths
|
|
635
|
+
sleep(max(2.0, float(interval)))
|
|
636
|
+
|
|
637
|
+
|
|
532
638
|
def cmd_download(c: Client, args: argparse.Namespace) -> int:
|
|
639
|
+
if getattr(args, "follow", False):
|
|
640
|
+
out = Path(args.out) if args.out else Path("render_out") / safe_name(args.job)
|
|
641
|
+
j, paths = follow_download(c, args.job, out, interval=args.interval, timeout=args.wait, say=_say_err)
|
|
642
|
+
print(_j({"job_id": args.job, "status": j["status"], "files": [str(p) for p in paths]}))
|
|
643
|
+
return 0 if j["status"] == "done" else 1
|
|
533
644
|
j = c.wait(args.job, timeout=args.wait, on_progress=_progress) if args.wait else c.job(args.job)
|
|
534
645
|
out = Path(args.out) if args.out else Path("render_out") / safe_name(args.job)
|
|
535
646
|
paths = c.download(args.job, out, on_progress=_say_err)
|
|
@@ -600,6 +711,19 @@ def cmd_connections(c: Client, args: argparse.Namespace) -> int:
|
|
|
600
711
|
return 0
|
|
601
712
|
|
|
602
713
|
|
|
714
|
+
def cmd_connect_code(c: Client, args: argparse.Namespace) -> int:
|
|
715
|
+
"""11/12: 別の AI アプリ・端末・ブラウザで同じアカウントを使うための 1 回きりのコード。コードは端末にだけ出す。"""
|
|
716
|
+
v = c.connect_code()
|
|
717
|
+
if args.json:
|
|
718
|
+
print(_j(v))
|
|
719
|
+
return 0
|
|
720
|
+
print(v["code"])
|
|
721
|
+
print(f"valid once, until {v.get('expires_at', '')} (10 minutes). In the other AI app, connect JANCTION Render and choose "
|
|
722
|
+
f"\"I have a connect code\" on the connection page, or open {v.get('connect_page', '/connect/code')} in another browser. "
|
|
723
|
+
"Do not paste the code into a chat or share it.", file=sys.stderr)
|
|
724
|
+
return 0
|
|
725
|
+
|
|
726
|
+
|
|
603
727
|
def cmd_disconnect(c: Client, args: argparse.Namespace) -> int:
|
|
604
728
|
print(_j(c.disconnect(args.id)))
|
|
605
729
|
return 0
|
|
@@ -948,6 +1072,18 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
948
1072
|
_asset_root_arg(s)
|
|
949
1073
|
s.set_defaults(fn=cmd_upload)
|
|
950
1074
|
|
|
1075
|
+
s = sub.add_parser("verify-package", help="check a downloaded render folder against its package.json (nothing is sent)")
|
|
1076
|
+
s.add_argument("folder", help="the folder with package.json and the files")
|
|
1077
|
+
s.set_defaults(fn=cmd_verify_package, offline=True)
|
|
1078
|
+
|
|
1079
|
+
s = sub.add_parser("bake", help="bake the simulations of a .blend on the service (no render); prints the baked scene_id")
|
|
1080
|
+
s.add_argument("scene", nargs="?", help=".blend file")
|
|
1081
|
+
s.add_argument("--scene-id", default=None, help="reuse an uploaded scene")
|
|
1082
|
+
s.add_argument("--timeout", type=float, default=1200)
|
|
1083
|
+
s.add_argument("--out", default=None, help="folder for scene.blend and verification.json")
|
|
1084
|
+
_asset_root_arg(s)
|
|
1085
|
+
s.set_defaults(fn=cmd_bake)
|
|
1086
|
+
|
|
951
1087
|
s = sub.add_parser("inspect", help="read the scene without rendering (cameras, frame range, missing files)")
|
|
952
1088
|
s.add_argument("scene", nargs="?", help=".blend file or bpy Python script")
|
|
953
1089
|
s.add_argument("--scene-id", default=None, help="reuse an uploaded scene")
|
|
@@ -967,6 +1103,11 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
967
1103
|
s.add_argument("--out", default=None)
|
|
968
1104
|
s.add_argument("--timeout", type=float, default=300)
|
|
969
1105
|
s.add_argument("--max-yen", type=int, default=None, help="refuse the preview if it could cost more than this (JPY)")
|
|
1106
|
+
s.add_argument("--full-turn", action="store_true",
|
|
1107
|
+
help="the whole turn around the subject: up to 24 small frames in one sheet, labelled in degrees")
|
|
1108
|
+
s.add_argument("--draft-video", action="store_true",
|
|
1109
|
+
help="a long animation as a draft: up to 24 small frames across --frames START-END (default: the scene's range), "
|
|
1110
|
+
"one sheet plus draft.mp4 at the real length, with the estimate for every frame")
|
|
970
1111
|
_asset_root_arg(s)
|
|
971
1112
|
s.set_defaults(fn=cmd_preview)
|
|
972
1113
|
|
|
@@ -1038,7 +1179,10 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1038
1179
|
s = sub.add_parser("download")
|
|
1039
1180
|
s.add_argument("job")
|
|
1040
1181
|
s.add_argument("--out", default=None)
|
|
1041
|
-
s.add_argument("--wait", type=float, default=0, help="seconds to wait for the job first")
|
|
1182
|
+
s.add_argument("--wait", type=float, default=0, help="seconds to wait for the job first (with --follow: stop following after)")
|
|
1183
|
+
s.add_argument("--follow", action="store_true",
|
|
1184
|
+
help="keep downloading frames as they finish until the job ends, then fetch the rest (video, reports)")
|
|
1185
|
+
s.add_argument("--interval", type=float, default=10.0, help="--follow: seconds between checks (at least 2)")
|
|
1042
1186
|
s.set_defaults(fn=cmd_download)
|
|
1043
1187
|
|
|
1044
1188
|
s = sub.add_parser("revoke-key", help="revoke your key (use when it leaked); every connected app stops working")
|
|
@@ -1046,6 +1190,10 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1046
1190
|
s.set_defaults(fn=cmd_revoke_key)
|
|
1047
1191
|
s = sub.add_parser("connections", help="apps connected with your key (Claude, ChatGPT, Codex ...)")
|
|
1048
1192
|
s.set_defaults(fn=cmd_connections)
|
|
1193
|
+
s = sub.add_parser("connect-code", help="a one-time code (10 minutes) to use this same account from another AI app, device "
|
|
1194
|
+
"or browser, without signing up")
|
|
1195
|
+
s.add_argument("--json", action="store_true")
|
|
1196
|
+
s.set_defaults(fn=cmd_connect_code)
|
|
1049
1197
|
s = sub.add_parser("disconnect", help="disconnect one app (id from 'connections')")
|
|
1050
1198
|
s.add_argument("id")
|
|
1051
1199
|
s.set_defaults(fn=cmd_disconnect)
|
|
@@ -1135,7 +1283,12 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
1135
1283
|
return 0
|
|
1136
1284
|
c = Client(server=args.server, api_key=args.key, client="cli")
|
|
1137
1285
|
try:
|
|
1138
|
-
|
|
1286
|
+
rc = int(args.fn(c, args))
|
|
1287
|
+
news = getattr(c, "last_news", None)
|
|
1288
|
+
if isinstance(news, dict) and news.get("text"): # 11/13: 結果の後に 1 行(標準エラー。結果の JSON は変えない)
|
|
1289
|
+
print("", file=sys.stderr)
|
|
1290
|
+
print(f"From JANCTION: {news['text']}", file=sys.stderr)
|
|
1291
|
+
return rc
|
|
1139
1292
|
except ClientError as exc:
|
|
1140
1293
|
if exc.status == 429 and exc.error == "quota_exceeded":
|
|
1141
1294
|
print(f"quota: {exc.detail}", file=sys.stderr)
|
|
@@ -754,6 +754,7 @@ def unreachable_error(server: str, url: str, exc: BaseException) -> ClientError:
|
|
|
754
754
|
|
|
755
755
|
class Client:
|
|
756
756
|
def __init__(self, server: Optional[str] = None, api_key: Optional[str] = None, client: str = "") -> None:
|
|
757
|
+
self.last_news: Optional[dict[str, Any]] = None
|
|
757
758
|
from . import __version__
|
|
758
759
|
|
|
759
760
|
self.server = (server or os.environ.get("JANCTION_RENDER_SERVER") or DEFAULT_SERVER).rstrip("/")
|
|
@@ -1269,10 +1270,13 @@ class Client:
|
|
|
1269
1270
|
return r.json()
|
|
1270
1271
|
|
|
1271
1272
|
def share(self, job_id: str, title: str = "", note: str = "", include_script: bool = False, listed: bool = False,
|
|
1272
|
-
prompt: str = "") -> dict[str, Any]:
|
|
1273
|
-
"""描けた結果を公開ページにする(/r/<id>)。prompt は「エージェントに頼んだこと」。
|
|
1274
|
-
|
|
1275
|
-
|
|
1273
|
+
prompt: str = "", expires_days: int = 0) -> dict[str, Any]:
|
|
1274
|
+
"""描けた結果を公開ページにする(/r/<id>)。prompt は「エージェントに頼んだこと」。expires_days(1〜90)は受付の旗
|
|
1275
|
+
JR_SHARE_EXPIRY が開いていれば、その日数でページを閉じる(0 なら送らない=今までどおり)。"""
|
|
1276
|
+
body = {"title": title, "note": note, "include_script": include_script, "listed": listed, "prompt": prompt}
|
|
1277
|
+
if expires_days:
|
|
1278
|
+
body["expires_days"] = int(expires_days)
|
|
1279
|
+
r = self.s.post(f"{self.server}/v1/jobs/{job_id}/share", headers=self._headers(), json=body, timeout=120)
|
|
1276
1280
|
self._raise(r)
|
|
1277
1281
|
return r.json()
|
|
1278
1282
|
|
|
@@ -1302,6 +1306,13 @@ class Client:
|
|
|
1302
1306
|
self._raise(r)
|
|
1303
1307
|
return r.json()
|
|
1304
1308
|
|
|
1309
|
+
def connect_code(self) -> dict[str, Any]:
|
|
1310
|
+
"""このアカウントの接続コード(8 字・10 分・1 回、11/12)。別の AI アプリの JANCTION の接続のページ(I have a connect code)か、
|
|
1311
|
+
別のブラウザの /connect/code に入れると、同じアカウント(残高・無料の残り・作品)につながる。鍵そのもので呼ぶ。"""
|
|
1312
|
+
r = self.s.post(f"{self.server}/v1/me/connect-code", headers=self._headers(), timeout=30)
|
|
1313
|
+
self._raise(r)
|
|
1314
|
+
return r.json()
|
|
1315
|
+
|
|
1305
1316
|
def disconnect(self, conn_id: str) -> dict[str, Any]:
|
|
1306
1317
|
r = self.s.delete(f"{self.server}/v1/connections/{conn_id}", headers=self._headers(), timeout=30)
|
|
1307
1318
|
self._raise(r)
|
|
@@ -1353,7 +1364,11 @@ class Client:
|
|
|
1353
1364
|
return self._req("POST", "/v1/estimate", json=body)
|
|
1354
1365
|
|
|
1355
1366
|
def job(self, job_id: str) -> dict[str, Any]:
|
|
1356
|
-
|
|
1367
|
+
j = self._req("GET", f"/v1/jobs/{job_id}")
|
|
1368
|
+
# 11/13 0.4.292: 受付が描き終えた結果に 1 回だけ付ける「伝えてもいい話」(server/news_notice.py)を覚えておく(CLI は最後に 1 行出す)
|
|
1369
|
+
if isinstance(j, dict) and isinstance(j.get("news"), dict):
|
|
1370
|
+
self.last_news = j["news"]
|
|
1371
|
+
return j
|
|
1357
1372
|
|
|
1358
1373
|
def next_actions(self, job_id: str) -> Optional[dict[str, Any]]:
|
|
1359
1374
|
"""終わった仕事の次の一手(受付の旗 JR_RET_NEXT_ACTIONS が OFF なら None)。見るだけで描かない。"""
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
受付の server/jobs.py もプリセットの名前はここから取る。"""
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
|
+
import json
|
|
11
12
|
import os
|
|
12
13
|
from typing import Any, Optional
|
|
13
14
|
|
|
@@ -17,9 +18,17 @@ PURPOSE_PRESETS = ("product", "turntable", "animation")
|
|
|
17
18
|
FINAL_TOOL_DEFAULTS = {"width": 1920, "height": 1080, "samples": 128, "output": "auto"}
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
# 11/12 スキャン向けのプリセット(受付の旗 JR_SCAN_PRESET、jobs.PRESET_DEFAULTS の scan)。道具の側は名前を受付へ通すだけで、
|
|
22
|
+
# 受け付けるかは受付が鍵ごとに決める(旗が効いていなければ、受付が今までと同じ「知らないプリセット」で断る)。
|
|
23
|
+
# 道具の説明・引数の説明には足さない(審査中の文を変えない。案内は llms.txt の 1 行)
|
|
24
|
+
SCAN_PRESET = "scan"
|
|
25
|
+
|
|
26
|
+
|
|
20
27
|
def preset_of(preset: str) -> str:
|
|
21
28
|
"""道具の preset 引数を正す。知らない名前は ValueError(リモートは INVALID_INPUT、stdio も同じ文で返す)。"""
|
|
22
29
|
p = (preset or "").strip().lower()
|
|
30
|
+
if p == SCAN_PRESET:
|
|
31
|
+
return p
|
|
23
32
|
if p and p not in PURPOSE_PRESETS:
|
|
24
33
|
raise ValueError("preset must be '', 'product', 'turntable' or 'animation'")
|
|
25
34
|
return p
|
|
@@ -72,10 +81,20 @@ def job_params(environment: str, environment_strength: float, environment_visibl
|
|
|
72
81
|
|
|
73
82
|
# ------------------------------------------------------------------ サンプル数の自動(11/5、旗 JR_AUTO_SAMPLES、既定 OFF)
|
|
74
83
|
|
|
84
|
+
def _auto_samples_min_frames() -> int:
|
|
85
|
+
"""受付の auto_samples.min_frames と同じ値(JR_AUTO_SAMPLES_MIN_FRAMES、既定 100)。説明に書く(11/12: 100 コマ未満で
|
|
86
|
+
黙って試しを飛ばすのが説明に無かった)。"""
|
|
87
|
+
try:
|
|
88
|
+
return max(1, int(float(os.environ.get("JR_AUTO_SAMPLES_MIN_FRAMES") or 100)))
|
|
89
|
+
except (TypeError, ValueError):
|
|
90
|
+
return 100
|
|
91
|
+
|
|
92
|
+
|
|
75
93
|
AUTO_SAMPLES_DOCS = {
|
|
76
|
-
"auto_samples": ("True (final, Cycles): a small test render of one
|
|
77
|
-
"looks the same as samples; billed like a preview.
|
|
78
|
-
"the
|
|
94
|
+
"auto_samples": ("True (final, Cycles, " + str(_auto_samples_min_frames()) + " frames or more): a small test render of one "
|
|
95
|
+
"frame picks the lowest samples, up to samples, that looks the same as samples; billed like a preview. "
|
|
96
|
+
"A shorter final skips the test and renders at samples (the reply's auto_samples.summary says so). "
|
|
97
|
+
"render_estimate with it shows the test's cost and the saving."),
|
|
79
98
|
"probe_frame": "With auto_samples: the frame to test (0 = the middle frame).",
|
|
80
99
|
}
|
|
81
100
|
|
|
@@ -611,9 +630,9 @@ def diagnose(health: Optional[dict[str, Any]], me: Optional[dict[str, Any]], las
|
|
|
611
630
|
|
|
612
631
|
# ------------------------------------------------------------------ 引数の説明(道具の description の末尾に足す)
|
|
613
632
|
|
|
614
|
-
_ENGINE_DOC = (" engine: '' or 'cycles' (path tracing, the default) | 'eevee' (Blender's real-time rasterizer: about
|
|
615
|
-
"per-frame cost on animations, but every
|
|
616
|
-
"frames or
|
|
633
|
+
_ENGINE_DOC = (" engine: '' or 'cycles' (path tracing, the default) | 'eevee' (Blender's real-time rasterizer: about two-thirds "
|
|
634
|
+
"of the Cycles per-frame cost on longer animations, but every GPU chunk pays about 7-9 s of loading and shader "
|
|
635
|
+
"compilation, so below about 100 frames Cycles is usually as cheap or cheaper; previews are faster on Cycles; HDRI presets work; no caustics or accurate bounce light).")
|
|
617
636
|
_TRANSPARENT_DOC = (" transparent=True: transparent background (alpha) instead of the world/HDRI backdrop; the preview sheet "
|
|
618
637
|
"shows it over dark grey.")
|
|
619
638
|
_ORBIT_DOC = (" orbit=True: turntable; an orbit camera circles the scene once over orbit_frames frames (default 24, "
|
|
@@ -642,13 +661,13 @@ _ENV_DOC = {
|
|
|
642
661
|
"bundled HDRI (a good first render for scenes without lighting work); 'compare' (render_preview only) renders the "
|
|
643
662
|
"first frame under all four presets in one 2x2 image with labels, so you can pick one; environment_strength scales it (1.0); "
|
|
644
663
|
"environment_visible=False hides the HDRI from the camera (flat grey backdrop, HDRI lighting only). blender: '' "
|
|
645
|
-
"(a .blend opens with the version it was saved in, other scenes with 5.0) or '5.0' / '5.2' (also '4.5', '4.2', '3.6'; a script that stops on Blender 5 because of an older API is rendered again on those automatically). asset_urls: https links to images or glTF .bin files sent with the scene; a .blend finds them "
|
|
664
|
+
"(a .blend opens with the version it was saved in, other scenes with 5.0) or '5.0' / '5.2' / '5.3' (also '4.5', '4.2', '3.6'; a script that stops on Blender 5 because of an older API is rendered again on those automatically). asset_urls: https links to images or glTF .bin files sent with the scene; a .blend finds them "
|
|
646
665
|
"through relative paths (same folder), a script through os.environ['JR_ASSETS_DIR']."),
|
|
647
666
|
"stdio": ("environment: '' keeps the scene's own world; 'studio' | 'sunset' | 'overcast' | 'night' replaces it with a "
|
|
648
667
|
"bundled HDRI (good first render for scenes without lighting work); 'compare' (render_preview only) renders the "
|
|
649
668
|
"first frame under all four presets in one 2x2 image with labels, so you can pick one; environment_strength scales it (1.0); "
|
|
650
669
|
"environment_visible=False hides the HDRI from the camera (flat grey backdrop, HDRI lighting only). "
|
|
651
|
-
"blender: '' (a .blend opens with the version it was saved in, other scenes with 5.0) or '5.0' / '5.2' (also '4.5', '4.2', '3.6'; a script that stops on Blender 5 because of an older API is rendered again on those automatically). assets: local files (images, glTF "
|
|
670
|
+
"blender: '' (a .blend opens with the version it was saved in, other scenes with 5.0) or '5.0' / '5.2' / '5.3' (also '4.5', '4.2', '3.6'; a script that stops on Blender 5 because of an older API is rendered again on those automatically). assets: local files (images, glTF "
|
|
652
671
|
".bin, ...) sent along with the scene; a .blend finds them through relative paths, a script through "
|
|
653
672
|
"os.environ['JR_ASSETS_DIR']."),
|
|
654
673
|
}
|
|
@@ -835,6 +854,48 @@ OPT_IN: tuple[tuple[str, str, str, str], ...] = (
|
|
|
835
854
|
("JR_FINAL_TEST", "render_final", "test_frames", ""),
|
|
836
855
|
("JR_FINAL_TEST", "render_estimate", "test", ""),
|
|
837
856
|
("JR_FINAL_TEST", "render_estimate", "test_frames", ""),
|
|
857
|
+
# 11/12 スキャンの被写体だけ(受付の旗 JR_SPLAT_SUBJECT、server/splat.py)
|
|
858
|
+
# 道具の説明には足さない(引数の説明だけ。11/9 の旗と同じ・審査中の道具の説明を変えない)
|
|
859
|
+
("JR_SPLAT_SUBJECT", "render_preview", "subject_only", ""),
|
|
860
|
+
("JR_SPLAT_SUBJECT", "render_final", "subject_only", ""),
|
|
861
|
+
# 11/12 大きなスキャンを減らして描く(受付の旗 JR_SPLAT_REDUCE、server/splat.py)
|
|
862
|
+
("JR_SPLAT_REDUCE", "render_preview", "reduce_points", ""),
|
|
863
|
+
("JR_SPLAT_REDUCE", "render_final", "reduce_points", ""),
|
|
864
|
+
# 11/12 一周まるごとの試し描き(受付の旗 JR_FULL_TURN、server/jobs.py _full_turn)
|
|
865
|
+
("JR_FULL_TURN", "render_preview", "full_turn", ""),
|
|
866
|
+
# 11/12 アニメ全体の下描き動画(受付の旗 JR_DRAFT_VIDEO、jobs._draft)。道具の説明には足さない(引数の説明だけ)
|
|
867
|
+
("JR_DRAFT_VIDEO", "render_preview", "draft_video", ""),
|
|
868
|
+
# 11/12 カメラの動き(受付の旗 JR_CAMERA_MOVE、jobs._camera_move)。道具の説明には足さない(引数の説明だけ)
|
|
869
|
+
("JR_CAMERA_MOVE", "render_preview", "camera_move", ""),
|
|
870
|
+
("JR_CAMERA_MOVE", "render_preview", "camera_angle", ""),
|
|
871
|
+
("JR_CAMERA_MOVE", "render_final", "camera_move", ""),
|
|
872
|
+
("JR_CAMERA_MOVE", "render_final", "camera_angle", ""),
|
|
873
|
+
# 11/12 1 枚の静止画を分けて描く(受付の旗 JR_SPLIT_STILL、jobs._split)。道具の説明には足さない(引数の説明だけ)
|
|
874
|
+
("JR_SPLIT_STILL", "render_final", "split", ""),
|
|
875
|
+
# 11/12 合成の File Output ノードの出力を持ち帰る(受付の旗 JR_FILE_OUTPUTS)。道具の説明には足さない(引数の説明だけ)
|
|
876
|
+
("JR_FILE_OUTPUTS", "render_final", "file_outputs", ""),
|
|
877
|
+
# 11/12 静止画の一部だけ描き直す(受付の旗 JR_REGION_RENDER、jobs._region)。道具の説明には足さない(引数の説明だけ)
|
|
878
|
+
("JR_REGION_RENDER", "render_final", "region", ""),
|
|
879
|
+
("JR_REGION_RENDER", "render_final", "region_of", ""),
|
|
880
|
+
# 11/12 独自の色管理(受付の旗 JR_CUSTOM_OCIO、server/ocio.py)。道具の説明には足さない(引数の説明だけ)
|
|
881
|
+
("JR_CUSTOM_OCIO", "render_preview", "ocio_config", ""),
|
|
882
|
+
("JR_CUSTOM_OCIO", "render_final", "ocio_config", ""),
|
|
883
|
+
# 11/12 描くシーン(受付の旗 JR_SCENE_SELECT、jobs._scene_name)。道具の説明には足さない(引数の説明だけ)
|
|
884
|
+
("JR_SCENE_SELECT", "render_preview", "scene_name", ""),
|
|
885
|
+
("JR_SCENE_SELECT", "render_final", "scene_name", ""),
|
|
886
|
+
# 11/13 v2 REV-02+AGT-03 シーンの固定(受付の旗 JR_SCENE_LOCK、jobs._scene_lock)。道具の説明には足さない(引数の説明だけ)
|
|
887
|
+
("JR_SCENE_LOCK", "render_preview", "lock", ""),
|
|
888
|
+
("JR_SCENE_LOCK", "render_preview", "lock_base", ""),
|
|
889
|
+
("JR_SCENE_LOCK", "render_final", "lock", ""),
|
|
890
|
+
("JR_SCENE_LOCK", "render_final", "lock_base", ""),
|
|
891
|
+
# 11/13 v2 QAD-02 比べの変えてよい所(受付の旗 JR_COMPARE_REGIONS、server/compare_regions.py)。compare_to と一緒に
|
|
892
|
+
("JR_COMPARE_REGIONS", "render_final", "compare_allow", ""),
|
|
893
|
+
# 11/13 v2 QAD-06 色の仕様との照合(受付の旗 JR_COLOR_SPEC、server/color_spec.py)
|
|
894
|
+
("JR_COLOR_SPEC", "render_final", "color_spec", ""),
|
|
895
|
+
# 11/12 保存先へ送る(受付の旗 JR_DELIVER_URL、server/deliver_url.py)。道具の説明には足さない(引数の説明だけ)
|
|
896
|
+
("JR_DELIVER_URL", "render_final", "upload_url", ""),
|
|
897
|
+
# 11/13 v2 BIZ-02 見積もりの ID(受付の旗 JR_ESTIMATE_ID、server/estimate_ids.py)。道具の説明には足さない(引数の説明だけ)
|
|
898
|
+
("JR_ESTIMATE_ID", "render_final", "estimate_id", ""),
|
|
838
899
|
)
|
|
839
900
|
# 旗が ON の引数の説明(stdio の P と、説明の無いリモートの引数に付ける。新版の tooldocs.param_docs に長い文があればそちらが勝つ)
|
|
840
901
|
OPT_IN_PARAM_DOCS: dict[str, str] = {
|
|
@@ -858,6 +919,58 @@ OPT_IN_PARAM_DOCS: dict[str, str] = {
|
|
|
858
919
|
"smaller; beauty only, not with passes)."),
|
|
859
920
|
"test": FINAL_TEST_DOC,
|
|
860
921
|
"test_frames": "test='contiguous': how many frames from frame_start to test (1-24, default 10; 0 = default).",
|
|
922
|
+
"reduce_points": ("Gaussian splats over the point limit (refused with splat_too_large): True renders the most visible splats "
|
|
923
|
+
"up to the limit and leaves out the faint and tiny ones (at most half; the file is not changed). Only when "
|
|
924
|
+
"the user accepts that; use the same value for the final as for the preview."),
|
|
925
|
+
"camera_move": ("A camera move made by the service instead of the full turn of orbit: 'arc' (sweeps 80 degrees around the "
|
|
926
|
+
"subject), 'push_in' (moves closer), 'pull_back' (starts close and reveals the whole), 'rise' (from low to "
|
|
927
|
+
"looking down). It eases in and out over orbit_frames frames (48 when left out); orbit_elevation, "
|
|
928
|
+
"orbit_distance and orbit_target apply. The preview shows the start, two frames between and the end. Use "
|
|
929
|
+
"the same values for the final."),
|
|
930
|
+
"camera_angle": ("With camera_move: the direction the move is centred on, in degrees (0 = front, counter-clockwise seen "
|
|
931
|
+
"from above), the same angles as the labels of an orbit or full_turn preview."),
|
|
932
|
+
"draft_video": ("True for an animation: preview the whole frame range as a small, quick draft: up to 24 frames spread over "
|
|
933
|
+
"the range, tiled in sheet.png and played over the real length in draft.mp4 (the reply's draft section). "
|
|
934
|
+
"Leave frames out. The reply's final_estimate is the time and price of every frame at full quality."),
|
|
935
|
+
"full_turn": ("True with orbit=True (or preset='turntable'): preview the whole turn as up to 24 small frames in one sheet "
|
|
936
|
+
"(labelled in degrees) instead of 4 angles; leave frames out. Preview only."),
|
|
937
|
+
"subject_only": ("Gaussian splats (.spz, 3DGS .ply) only: True keeps the scanned subject and what it stands on and removes the "
|
|
938
|
+
"rest of the capture (sky, far scenery, haze, the floor); the file is not changed. Use the same value for the "
|
|
939
|
+
"final as for the preview."),
|
|
940
|
+
"color_spec": ("The colour settings the delivery must have, checked against what Blender reads from the scene: "
|
|
941
|
+
"view_transform, look, display_device, working_space, file_colorspace (EXR), exposure, gamma, ocio_config "
|
|
942
|
+
"(bundled/custom), film_transparent, encoding (scene_linear/display). Differences fail the delivery check; "
|
|
943
|
+
"settings that tend to apply a colour transform twice are listed as risks."),
|
|
944
|
+
"compare_allow": ("With compare_to: boxes [x0, y0, x1, y1] in pixels of this render where change is expected (up to 8). The "
|
|
945
|
+
"comparison then says which frames changed visibly outside them (compare_outside.png marks it in red) and "
|
|
946
|
+
"which settings differ from the earlier render."),
|
|
947
|
+
"lock": ("What must stay exactly as in lock_base's render: any of camera, lights, geometry, materials, text, color, world. "
|
|
948
|
+
"The service measures the scene you send (after your script runs, before its own options such as colors or "
|
|
949
|
+
"environment) and refuses to render if a locked item differs, so an edit cannot change them by accident."),
|
|
950
|
+
"lock_base": ("job_id of an earlier render of this key whose scene the locked items must match (it must have been rendered "
|
|
951
|
+
"while scene locks were on; its job shows scene_fingerprint)."),
|
|
952
|
+
"scene_name": ("A .blend with several scenes: the scene to render (scene_info lists them in 'scenes'); empty = the scene "
|
|
953
|
+
"that was active when the file was saved. Use the same value for the preview and the final."),
|
|
954
|
+
"ocio_config": ("Relative name of an OCIO config you sent in assets (with its LUT files in the same folders), e.g. "
|
|
955
|
+
"'ocio/config.ocio': Blender renders with that color management (its view transforms, looks and color "
|
|
956
|
+
"spaces). Use the same value for the preview and the final."),
|
|
957
|
+
"file_outputs": ("True: also return what the scene's compositor File Output nodes write for each frame (PNG and OpenEXR; "
|
|
958
|
+
"Blender 5.0 or newer). The files come back named fo<node>s<item>_<frame> and the job's file_outputs "
|
|
959
|
+
"section says which node and item each belongs to. Not with cameras, split or region."),
|
|
960
|
+
"region": ("With region_of: [x0, y0, x1, y1] in pixels (top-left origin) of the part to render again; only that part is "
|
|
961
|
+
"rendered with the scene you send now and pasted into the earlier image, so the GPU time is that area's share. "
|
|
962
|
+
"For a fix that stays inside the box (a label, a material, one object); shadows or reflections it casts "
|
|
963
|
+
"outside the box keep the old look."),
|
|
964
|
+
"region_of": "With region: job_id of the earlier single-image PNG final to patch (same key, same width and height).",
|
|
965
|
+
"split": ("One still (frame_start = frame_end, PNG) split across GPUs that render at the same time: 2 (two strips), 4 (2x2) "
|
|
966
|
+
"or 9 (3x3); the parts overlap and are joined into one frame_0001.png. GPU time is about the same as one frame, "
|
|
967
|
+
"the wait is shorter. 0 = not split."),
|
|
968
|
+
"estimate_id": ("The estimate_id from render_estimate with the same settings: the render is refused, with nothing charged, "
|
|
969
|
+
"if the estimate is for another scene, has expired (10 minutes) or the render would now hold more than the "
|
|
970
|
+
"price the estimate showed. Pass it after the user agreed to that price."),
|
|
971
|
+
"upload_url": ("A pre-signed HTTPS PUT URL of the user's own storage (S3, R2, GCS, Azure SAS ...): when the render is done the "
|
|
972
|
+
"service uploads the result there once (the video, the single image, or a zip of the frames), with that "
|
|
973
|
+
"file's Content-Type. The job's upload section says whether it went through. No password or key is stored."),
|
|
861
974
|
}
|
|
862
975
|
|
|
863
976
|
|
|
@@ -880,6 +993,107 @@ def opt_in(tool: str) -> tuple[list[str], str]:
|
|
|
880
993
|
return hidden, "".join(doc for flag, t, _, doc in OPT_IN if t == tool and doc and flag_on(flag))
|
|
881
994
|
|
|
882
995
|
|
|
996
|
+
def open_arguments() -> dict[str, list[str]]:
|
|
997
|
+
"""全員に開いている旗つきの引数: 道具 → 引数の並び(受付の /v1/capabilities の optional_arguments。旗の名前は外に出さない)。
|
|
998
|
+
どの旗も開いていなければ {}(欄そのものを出さない)。運営の鍵だけ(ops)の旗は入らない。"""
|
|
999
|
+
out: dict[str, list[str]] = {}
|
|
1000
|
+
for flag, tool, param, _ in OPT_IN:
|
|
1001
|
+
if flag_on(flag) and param not in out.setdefault(tool, []):
|
|
1002
|
+
out[tool].append(param)
|
|
1003
|
+
return {t: v for t, v in out.items() if v}
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
# 手元で動かす MCP(stdio)の道具の一覧を、受付が全員に開けている旗つきの引数に合わせる(11/12)。
|
|
1007
|
+
# 旗つきの引数は起動時の env で決まるので、受付の旗を開けても、利用者の PC で動く MCP の道具の一覧には出なかった(11/5 からの旗も)。
|
|
1008
|
+
# 起動時に受付の /v1/capabilities を 1 回読み、optional_arguments に載っている引数の旗を、手元の env にまだ無いものだけ入れる。
|
|
1009
|
+
# - 入れるのは OPT_IN にある旗だけ・値は "1" だけ(受付の返事で、ほかの環境変数は変えられない)
|
|
1010
|
+
# - 手元の env に旗がもう在れば("0" でも)触らない。JR_FLAGS_FROM_SERVER=0 で読みに行かない
|
|
1011
|
+
# - 読めなかったときは、前に読めた結果(~/.janction-render-options.json、7 日まで)を使う。それも無ければ今までどおり
|
|
1012
|
+
# - 送るのは版の入った User-Agent だけ(鍵もシーンも送らない)
|
|
1013
|
+
FLAGS_SYNC_ENV = "JR_FLAGS_FROM_SERVER"
|
|
1014
|
+
FLAGS_CACHE_DAYS = 7
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
def _options_cache() -> Any:
|
|
1018
|
+
from pathlib import Path
|
|
1019
|
+
return Path(os.environ.get("JANCTION_RENDER_OPTIONS_CACHE") or (Path.home() / ".janction-render-options.json"))
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
def _cached_arguments(server: str, now: float) -> Optional[tuple[dict[str, Any], list[Any]]]:
|
|
1023
|
+
try:
|
|
1024
|
+
d = json.loads(_options_cache().read_text(encoding="utf-8")).get(server)
|
|
1025
|
+
if isinstance(d, dict) and now - float(d.get("at") or 0) <= FLAGS_CACHE_DAYS * 86400 and isinstance(d.get("optional_arguments"), dict):
|
|
1026
|
+
presets = d.get("optional_presets")
|
|
1027
|
+
return d["optional_arguments"], (presets if isinstance(presets, list) else [])
|
|
1028
|
+
except (OSError, ValueError, TypeError, AttributeError):
|
|
1029
|
+
pass
|
|
1030
|
+
return None
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
def _remember_arguments(server: str, args: dict[str, Any], now: float, presets: Optional[list[Any]] = None) -> None:
|
|
1034
|
+
try:
|
|
1035
|
+
p = _options_cache()
|
|
1036
|
+
try:
|
|
1037
|
+
all_ = json.loads(p.read_text(encoding="utf-8"))
|
|
1038
|
+
except (OSError, ValueError):
|
|
1039
|
+
all_ = {}
|
|
1040
|
+
if not isinstance(all_, dict):
|
|
1041
|
+
all_ = {}
|
|
1042
|
+
all_[server] = {"at": now, "optional_arguments": args, "optional_presets": list(presets or [])}
|
|
1043
|
+
p.write_text(json.dumps(all_), encoding="utf-8")
|
|
1044
|
+
except OSError:
|
|
1045
|
+
pass
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
def sync_open_arguments(server: str = "", timeout: float = 2.5, fetch: Any = None, now: Optional[float] = None) -> list[str]:
|
|
1049
|
+
"""受付が全員に開けている旗つきの引数に、手元の env の旗を合わせる。入れた旗の名前を返す(何もしなければ [])。
|
|
1050
|
+
道具を登録する前(opt_in_snapshot の前)に 1 回だけ呼ぶ。失敗しても例外は出さない。"""
|
|
1051
|
+
import time as _time
|
|
1052
|
+
if (os.environ.get(FLAGS_SYNC_ENV) or "").strip().lower() in ("0", "false", "off", "no"):
|
|
1053
|
+
return []
|
|
1054
|
+
from .client import DEFAULT_SERVER
|
|
1055
|
+
server = (server or os.environ.get("JANCTION_RENDER_SERVER") or DEFAULT_SERVER).rstrip("/")
|
|
1056
|
+
t = _time.time() if now is None else now
|
|
1057
|
+
args: Optional[dict[str, Any]] = None
|
|
1058
|
+
presets: list[Any] = []
|
|
1059
|
+
try:
|
|
1060
|
+
if fetch is None:
|
|
1061
|
+
import requests
|
|
1062
|
+
from . import __version__
|
|
1063
|
+
|
|
1064
|
+
def fetch(url: str) -> Any:
|
|
1065
|
+
r = requests.get(url, timeout=timeout, headers={"User-Agent": f"janction-render-mcp/{__version__} (options)"})
|
|
1066
|
+
return r.json() if r.status_code == 200 else None
|
|
1067
|
+
body = fetch(server + "/v1/capabilities")
|
|
1068
|
+
if isinstance(body, dict):
|
|
1069
|
+
got = body.get("optional_arguments")
|
|
1070
|
+
args = got if isinstance(got, dict) else {}
|
|
1071
|
+
pr = body.get("optional_presets")
|
|
1072
|
+
presets = pr if isinstance(pr, list) else []
|
|
1073
|
+
_remember_arguments(server, args, t, presets)
|
|
1074
|
+
except Exception: # noqa: BLE001 — 読めなければ前の結果か、今までどおり
|
|
1075
|
+
args = None
|
|
1076
|
+
if args is None:
|
|
1077
|
+
cached = _cached_arguments(server, t)
|
|
1078
|
+
if cached is not None:
|
|
1079
|
+
args, presets = cached
|
|
1080
|
+
if not isinstance(args, dict):
|
|
1081
|
+
return []
|
|
1082
|
+
turned: list[str] = []
|
|
1083
|
+
for flag, name in OPEN_PRESETS: # 11/12 旗つきのプリセットの値(勧めの判定に使う。引数は前から出ている)
|
|
1084
|
+
if os.environ.get(flag) is None and isinstance(presets, list) and name in presets:
|
|
1085
|
+
os.environ[flag] = "1"
|
|
1086
|
+
turned.append(flag)
|
|
1087
|
+
for flag, tool, param, _ in OPT_IN:
|
|
1088
|
+
if flag in turned or os.environ.get(flag) is not None:
|
|
1089
|
+
continue
|
|
1090
|
+
listed = args.get(tool)
|
|
1091
|
+
if isinstance(listed, list) and param in listed:
|
|
1092
|
+
os.environ[flag] = "1"
|
|
1093
|
+
turned.append(flag)
|
|
1094
|
+
return turned
|
|
1095
|
+
|
|
1096
|
+
|
|
883
1097
|
def final_opt_in() -> tuple[list[str], str]:
|
|
884
1098
|
"""render_final の (隠す引数, 説明に足す文)。"""
|
|
885
1099
|
return opt_in("render_final")
|
|
@@ -902,12 +1116,39 @@ OFFER_FEATURES: dict[str, tuple[str, str]] = {
|
|
|
902
1116
|
"deliver": ("render_final", "deliver"),
|
|
903
1117
|
"compare_to": ("render_final", "compare_to"),
|
|
904
1118
|
"auto_samples": ("render_final", "auto_samples"),
|
|
1119
|
+
"draft_video": ("render_preview", "draft_video"), # 11/12 アニメ全体の下描き動画(旗 JR_DRAFT_VIDEO)
|
|
1120
|
+
# 11/12 スキャン向けのプリセット(旗 JR_SCAN_PRESET)。preset は前からある引数なので、どの道具の一覧にも出ている
|
|
1121
|
+
"scan_preset": ("render_preview", "preset"),
|
|
905
1122
|
}
|
|
906
1123
|
|
|
907
1124
|
|
|
1125
|
+
# 引数がいつも道具の一覧に出ている(前からある引数の新しい値の)機能: 起動時にこの旗が全員に ON のときだけ勧める(ops は勧めない。
|
|
1126
|
+
# ほかの勧めと同じ)。手元の MCP には、受付の /v1/capabilities の optional_presets で届く(sync_open_arguments)
|
|
1127
|
+
OFFER_FEATURE_FLAGS = {"scan_preset": "JR_SCAN_PRESET"}
|
|
1128
|
+
# 前からある preset 引数の、旗つきの値(11/12): (旗, 値)
|
|
1129
|
+
OPEN_PRESETS = (("JR_SCAN_PRESET", "scan"),)
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
# 11/13 引数が増えない旗つきの機能(受付の /v1/capabilities の optional_features)。アドオンと作業台は、これで部品を出すか決める
|
|
1133
|
+
OPEN_FEATURES = (("JR_NOTIFY_CHAT", "notify_chat"), ("JR_FARM_BAKE", "bake_simulations"),
|
|
1134
|
+
("JR_RENDER_MEMORY", "render_memory"), ("JR_PRINT_STILLS", "print_stills"),
|
|
1135
|
+
("JR_PROJECT_TAG", "project_tag")) # 11/13 v2 REN-05 案件の印(アドオンが .blend の案件の番号を送る)
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
def open_features() -> list[str]:
|
|
1139
|
+
"""全員に開いている、引数の増えない旗つきの機能の名前。無ければ [](欄を出さない=今までと同じ形)。"""
|
|
1140
|
+
return [name for flag, name in OPEN_FEATURES if flag_on(flag)]
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
def open_presets() -> list[str]:
|
|
1144
|
+
"""全員に開いている旗つきのプリセットの値(受付の /v1/capabilities の optional_presets)。無ければ []。"""
|
|
1145
|
+
return [name for flag, name in OPEN_PRESETS if flag_on(flag)]
|
|
1146
|
+
|
|
1147
|
+
|
|
908
1148
|
def offerable(snapshot: dict[str, tuple[list[str], str]]) -> list[str]:
|
|
909
1149
|
"""起動時の道具の形(opt_in_snapshot の結果)で呼べる、勧められる機能の名前。旗が OFF・ops なら空。"""
|
|
910
|
-
return [f for f, (tool, param) in OFFER_FEATURES.items() if tool in snapshot and param not in snapshot[tool][0]
|
|
1150
|
+
return [f for f, (tool, param) in OFFER_FEATURES.items() if tool in snapshot and param not in snapshot[tool][0]
|
|
1151
|
+
and (f not in OFFER_FEATURE_FLAGS or flag_on(OFFER_FEATURE_FLAGS[f]))]
|
|
911
1152
|
|
|
912
1153
|
|
|
913
1154
|
def opt_in_values(**values: Any) -> dict[str, Any]:
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
JANCTION_RENDER_SERVER 受付の URL(既定 https://render.janction.jp。手元の受付なら http://127.0.0.1:8340)
|
|
9
9
|
JANCTION_RENDER_API_KEY API キー(無ければ一時キーを自動で取る)
|
|
10
10
|
JANCTION_RENDER_OUT 仕事の保管の親フォルダ(既定 ~/janction-render。その下に <job_id>)
|
|
11
|
+
JR_FLAGS_FROM_SERVER 0 で、起動時に受付へ「全員に開いている追加の引数」を聞きに行かない(既定は聞く。11/12、
|
|
12
|
+
mcp_common.sync_open_arguments。聞けなければ前の結果か、手元の env のまま)
|
|
11
13
|
JANCTION_RENDER_DELIVER 利用者が開く仕上げの動画の届け先(既定 そのユーザーの Downloads。docs/101 RCV-03)
|
|
12
14
|
JANCTION_RENDER_NOTIFY 0 で、仕上げの見張り(終わったら動画を届け先へ・デスクトップの通知)を止める(既定 1。11/9)
|
|
13
15
|
"""
|
|
@@ -86,8 +88,8 @@ mcp = MCPServer(
|
|
|
86
88
|
"render_status / render_download. Always tell the user the time estimate (estimate.human / eta.human). "
|
|
87
89
|
"Every finished preview also returns final_estimate (how long the same scene takes as a final render) and quota_left_today: say both before asking the user. "
|
|
88
90
|
"cameras=['CamA','CamB',...] renders the same frame from several named cameras in ONE job (preview: tiled in one sheet; final: one PNG per camera, camera_files maps names to files): use it for product shots from fixed angles instead of one job per camera. "
|
|
89
|
-
"Blender 5.0 or 5.
|
|
90
|
-
"(about
|
|
91
|
+
"Blender 5.0, 5.2 or 5.3 with Cycles on GPU (a .blend opens with the version it was saved in; scripts and 3D files use 5.0 unless blender='5.2' or '5.3'; blender='4.5', '4.2' or '3.6' picks an older Blender, and a script that stops on Blender 5 because of an older API is rendered again on 4.5, 4.2 or 3.6 automatically); engine='eevee' switches to EEVEE "
|
|
92
|
+
"(about two-thirds of the Cycles per-frame cost on longer animations; every GPU chunk pays about 7-9 s of loading and shader compilation, so below about 100 frames Cycles is usually as cheap or cheaper, and previews stay on Cycles); output='png'|'exr' returns frames, 'mp4'|'webm'|'prores' a video. Blender 5.0 API notes for scripts: materials always use nodes, so set a color on the Principled BSDF (mat.node_tree.nodes['Principled BSDF'].inputs['Base Color'].default_value = (r, g, b, 1)); mat.diffuse_color only affects the viewport. Animate with obj.keyframe_insert(); obj.animation_data.action.fcurves no longer exists (set bpy.context.preferences.edit.keyframe_new_interpolation_type='LINEAR' before inserting keyframes for constant-speed motion); do not set Material.use_nodes; leave resolution, samples and denoising to the service. Inputs: a .blend, a bpy "
|
|
91
93
|
"script, or a 3D file (FBX, glTF/GLB, USD, OBJ, STL, PLY, Alembic) that is imported into an empty scene; images "
|
|
92
94
|
"and other assets can be sent with the scene (assets=[...]). environment='studio'|'sunset'|'overcast'|'night' "
|
|
93
95
|
"lights the scene with a bundled HDRI for a good-looking first render. Inputs and results are deleted 24 hours "
|
|
@@ -153,12 +155,12 @@ ENV_DOC, POLYHAVEN_DOC = _D["ENV_DOC"], _D["POLYHAVEN_DOC"]
|
|
|
153
155
|
|
|
154
156
|
# ---- 引数の説明(スキーマに出る。Glama の品質点と、各 AI が引数を正しく埋める助け。10/7)
|
|
155
157
|
P: dict[str, str] = {
|
|
156
|
-
"scene_path": "Local path to the scene: a .blend file, a bpy .py script, or a 3D file (.glb/.gltf/.fbx/.usd/.obj/.stl/.ply/.abc, imported into an empty scene). Uploaded once; reuse the returned scene_id afterwards.",
|
|
158
|
+
"scene_path": "Local path to the scene: a .blend file, a bpy .py script, or a 3D file (.glb/.gltf/.fbx/.usd/.obj/.stl/.ply/.abc, imported into an empty scene; a Gaussian splat .spz or 3DGS .ply opens with Blender 5.3). Uploaded once; reuse the returned scene_id afterwards.",
|
|
157
159
|
"scene_id": "scene_id returned by an earlier call (reuses the uploaded scene without sending it again).",
|
|
158
|
-
"scene_script": "The scene as bpy Python code (text). No file and no local Blender needed; the service runs it in Blender 5.0 (5.2 with blender='5.2').",
|
|
160
|
+
"scene_script": "The scene as bpy Python code (text). No file and no local Blender needed; the service runs it in Blender 5.0 (5.2 or 5.3 with blender='5.2' / '5.3').",
|
|
159
161
|
"scene_url": f"https link to a .blend, a .py script or a 3D file; the service fetches it (e.g. the sample {SAMPLE_URL}, or a 12-hour /upload link).",
|
|
160
162
|
"assets": "Extra files sent with the scene: local paths (textures, glTF .bin), 'polyhaven:<id>' CC0 assets, or https URLs.",
|
|
161
|
-
"blender": "Blender version: '' (default: a .blend opens with the version it was saved in, other scenes with 5.0) or '5.0' / '5.2' (also '4.5', '4.2', '3.6'; a script that stops on Blender 5 because of an older API is rendered again on those automatically) to choose.",
|
|
163
|
+
"blender": "Blender version: '' (default: a .blend opens with the version it was saved in, other scenes with 5.0) or '5.0' / '5.2' / '5.3' (also '4.5', '4.2', '3.6'; a script that stops on Blender 5 because of an older API is rendered again on those automatically) to choose.",
|
|
162
164
|
"frames": "Preview frames: '' = frame 1; '12' = one frame; '1,8,16,24' or '1-24' = up to 4 frames tiled in one labeled image.",
|
|
163
165
|
"camera": "Name of the camera object to render from (default: the scene's active camera, or an automatic camera if none).",
|
|
164
166
|
"cameras": "Several camera object names (up to 8) to render the same frame from in one job; the preview tiles them, the final returns one file per camera. Leave empty for the normal single camera.",
|
|
@@ -730,20 +732,39 @@ def render_preview(
|
|
|
730
732
|
transparent: Annotated[bool, D("transparent", False)] = False,
|
|
731
733
|
preset: Annotated[str, D("preset", "")] = "",
|
|
732
734
|
variations: Annotated[Optional[list[mcp_common.Variant]], D("variations", None)] = None,
|
|
735
|
+
subject_only: Annotated[bool, D("subject_only", False)] = False,
|
|
736
|
+
full_turn: Annotated[bool, D("full_turn", False)] = False,
|
|
737
|
+
reduce_points: Annotated[bool, D("reduce_points", False)] = False,
|
|
738
|
+
ocio_config: Annotated[str, D("ocio_config", "")] = "",
|
|
739
|
+
scene_name: Annotated[str, D("scene_name", "")] = "",
|
|
740
|
+
lock: Annotated[Optional[list[str]], D("lock", None)] = None,
|
|
741
|
+
lock_base: Annotated[str, D("lock_base", "")] = "",
|
|
742
|
+
draft_video: Annotated[bool, D("draft_video", False)] = False,
|
|
743
|
+
camera_move: Annotated[str, D("camera_move", "")] = "",
|
|
744
|
+
camera_angle: Annotated[float, D("camera_angle", 0.0)] = 0.0,
|
|
733
745
|
) -> list[Any]:
|
|
734
746
|
"""Render a fast, cheap preview of a Blender scene on a JANCTION GPU and show the image. (full description on the tool)."""
|
|
735
747
|
c = _client()
|
|
736
748
|
try:
|
|
737
749
|
preset = _preset_of(preset)
|
|
738
|
-
frame_list = parse_frames(frames) if (frames or not (orbit or preset)) else None
|
|
750
|
+
frame_list = parse_frames(frames) if (frames or not (orbit or preset or draft_video or camera_move)) else None
|
|
739
751
|
sid = _resolve_scene(c, scene_path, scene_id, scene_script, assets, scene_url=scene_url)
|
|
740
|
-
if preset == "animation" and frame_list is None:
|
|
741
|
-
_ensure_scene_info(c, sid)
|
|
752
|
+
if (preset == "animation" or draft_video) and frame_list is None:
|
|
753
|
+
_ensure_scene_info(c, sid) # 11/12 draft_video もシーンのコマ範囲が要る
|
|
742
754
|
params = dict(frames=frame_list, camera=camera or None, cameras=(list(cameras) if cameras else None),
|
|
743
755
|
variations=(list(variations) if variations else None),
|
|
744
756
|
width=width, height=height, samples=samples, transparent=(True if transparent else None),
|
|
745
757
|
**_job_params(environment, environment_strength, environment_visible, blender, orbit, orbit_frames,
|
|
746
|
-
orbit_elevation, orbit_target, orbit_distance, engine=engine)
|
|
758
|
+
orbit_elevation, orbit_target, orbit_distance, engine=engine),
|
|
759
|
+
**mcp_common.opt_in_values(subject_only=(True if subject_only else None), # 11/12 旗 JR_SPLAT_SUBJECT
|
|
760
|
+
full_turn=(True if full_turn else None), # 11/12 旗 JR_FULL_TURN
|
|
761
|
+
reduce_points=(True if reduce_points else None), # 11/12 旗 JR_SPLAT_REDUCE
|
|
762
|
+
ocio_config=ocio_config or None, # 11/12 旗 JR_CUSTOM_OCIO
|
|
763
|
+
scene_name=scene_name or None, # 11/12 旗 JR_SCENE_SELECT
|
|
764
|
+
lock=(list(lock) if lock else None), lock_base=lock_base or None, # 11/13 旗 JR_SCENE_LOCK
|
|
765
|
+
draft_video=(True if draft_video else None), # 11/12 旗 JR_DRAFT_VIDEO(False なら送らない)
|
|
766
|
+
camera_move=camera_move or None, # 11/12 旗 JR_CAMERA_MOVE(空なら送らない)
|
|
767
|
+
camera_angle=(float(camera_angle) if camera_move and camera_angle else None)))
|
|
747
768
|
j = c.submit(sid, kind="preview", **_with_preset(params, preset, "preview"))
|
|
748
769
|
_log(f"preview job {j['job_id']} submitted frames={frame_list}")
|
|
749
770
|
j = _wait_unless_gated(c, j, PREVIEW_WAIT_S)
|
|
@@ -805,6 +826,9 @@ def _shown_image(path: Path) -> Optional[Any]:
|
|
|
805
826
|
|
|
806
827
|
|
|
807
828
|
# 旗つきの引数(11/5、mcp_common.OPT_IN): 旗が OFF の引数は道具の一覧に出さず、説明の 1 文も足さない。起動時の手元の env で 1 回読む
|
|
829
|
+
# 11/12: その前に、受付が全員に開けている旗つきの引数を手元の env に合わせる(mcp_common.sync_open_arguments。試験の中では
|
|
830
|
+
# 読みに行かない。JR_FLAGS_FROM_SERVER=0 で止められる)
|
|
831
|
+
SYNCED_FLAGS: list[str] = [] if "pytest" in sys.modules else mcp_common.sync_open_arguments()
|
|
808
832
|
OPT_IN_NOW = mcp_common.opt_in_snapshot()
|
|
809
833
|
mcp.tool(annotations=_ann(WRITE, "Render preview"), structured_output=False, meta=_ui_meta(),
|
|
810
834
|
description=RENDER_PREVIEW_DESCRIPTION + OPT_IN_NOW["render_preview"][1])(
|
|
@@ -972,6 +996,22 @@ def render_final(
|
|
|
972
996
|
exr_codec: Annotated[str, D("exr_codec", "")] = "",
|
|
973
997
|
test: Annotated[str, D("test", "")] = "",
|
|
974
998
|
test_frames: Annotated[int, D("test_frames", 0)] = 0,
|
|
999
|
+
subject_only: Annotated[bool, D("subject_only", False)] = False,
|
|
1000
|
+
reduce_points: Annotated[bool, D("reduce_points", False)] = False,
|
|
1001
|
+
split: Annotated[int, D("split", 0)] = 0,
|
|
1002
|
+
ocio_config: Annotated[str, D("ocio_config", "")] = "",
|
|
1003
|
+
scene_name: Annotated[str, D("scene_name", "")] = "",
|
|
1004
|
+
lock: Annotated[Optional[list[str]], D("lock", None)] = None,
|
|
1005
|
+
lock_base: Annotated[str, D("lock_base", "")] = "",
|
|
1006
|
+
compare_allow: Annotated[Optional[list[list[int]]], D("compare_allow", None)] = None,
|
|
1007
|
+
color_spec: Annotated[Optional[dict[str, Any]], D("color_spec", None)] = None,
|
|
1008
|
+
upload_url: Annotated[str, D("upload_url", "")] = "",
|
|
1009
|
+
estimate_id: Annotated[str, D("estimate_id", "")] = "",
|
|
1010
|
+
region: Annotated[Optional[list[int]], D("region", None)] = None,
|
|
1011
|
+
region_of: Annotated[str, D("region_of", "")] = "",
|
|
1012
|
+
camera_move: Annotated[str, D("camera_move", "")] = "",
|
|
1013
|
+
camera_angle: Annotated[float, D("camera_angle", 0.0)] = 0.0,
|
|
1014
|
+
file_outputs: Annotated[bool, D("file_outputs", False)] = False,
|
|
975
1015
|
) -> str:
|
|
976
1016
|
"""Render the final frames (or a video) of a Blender scene on JANCTION GPUs. (full description on the tool)."""
|
|
977
1017
|
c = _client()
|
|
@@ -995,7 +1035,22 @@ def render_final(
|
|
|
995
1035
|
# 既定値(空)で呼ばれるので本文は今までと同じ
|
|
996
1036
|
extra.update(mcp_common.opt_in_values(colors=colors, compare_to=compare_to, passes=passes, deliver=deliver,
|
|
997
1037
|
allow_missing=allow_missing, # 11/9 旗 JR_PREFLIGHT_BLOCK_FINAL(False なら送らない)
|
|
998
|
-
exr_depth=exr_depth, exr_codec=exr_codec
|
|
1038
|
+
exr_depth=exr_depth, exr_codec=exr_codec, # 11/9 旗 JR_PRO_EXR(空なら送らない)
|
|
1039
|
+
subject_only=(True if subject_only else None), # 11/12 旗 JR_SPLAT_SUBJECT
|
|
1040
|
+
reduce_points=(True if reduce_points else None), # 11/12 旗 JR_SPLAT_REDUCE
|
|
1041
|
+
split=(int(split) if split else None), # 11/12 旗 JR_SPLIT_STILL(0 なら送らない)
|
|
1042
|
+
ocio_config=ocio_config or None, # 11/12 旗 JR_CUSTOM_OCIO
|
|
1043
|
+
scene_name=scene_name or None, # 11/12 旗 JR_SCENE_SELECT(空なら送らない)
|
|
1044
|
+
lock=(list(lock) if lock else None), lock_base=lock_base or None, # 11/13 旗 JR_SCENE_LOCK
|
|
1045
|
+
compare_allow=([list(b) for b in compare_allow] if compare_allow else None), # 11/13 JR_COMPARE_REGIONS
|
|
1046
|
+
color_spec=(dict(color_spec) if color_spec else None), # 11/13 JR_COLOR_SPEC
|
|
1047
|
+
upload_url=upload_url or None, # 11/12 旗 JR_DELIVER_URL(空なら送らない)
|
|
1048
|
+
estimate_id=estimate_id or None, # 11/13 旗 JR_ESTIMATE_ID(空なら送らない)
|
|
1049
|
+
region=(list(region) if region else None), # 11/12 旗 JR_REGION_RENDER
|
|
1050
|
+
region_of=region_of or None,
|
|
1051
|
+
camera_move=camera_move or None, # 11/12 旗 JR_CAMERA_MOVE(空なら送らない)
|
|
1052
|
+
camera_angle=(float(camera_angle) if camera_move and camera_angle else None),
|
|
1053
|
+
file_outputs=(True if file_outputs else None))) # 11/12 旗 JR_FILE_OUTPUTS
|
|
999
1054
|
params = dict(frame_start=frame_start, frame_end=frame_end,
|
|
1000
1055
|
width=width, height=height, samples=samples, fps=fps, output=output,
|
|
1001
1056
|
camera=camera or None, transparent=(True if transparent else None), notify_url=notify_url or None,
|
|
@@ -35,7 +35,7 @@ PAID_MIN_YEN = 500
|
|
|
35
35
|
SPEND_CAP_JOB_YEN = 100000
|
|
36
36
|
SPEND_CAP_DAY_YEN = 100000
|
|
37
37
|
SPEND_CAP_HARD_MAX_YEN = 100000
|
|
38
|
-
MONTHLY_PLANS = [{'id': '
|
|
38
|
+
MONTHLY_PLANS = [{'id': 'basic', 'name': 'Basic', 'price_yen': 1500, 'credit_yen': 1650}, {'id': 'standard', 'name': 'Standard', 'price_yen': 4500, 'credit_yen': 5400}, {'id': 'pro', 'name': 'Pro', 'price_yen': 15000, 'credit_yen': 19500}]
|
|
39
39
|
# 公開物に 1 件でもあれば CI が落ちる言い方(正規表現、大文字小文字を区別しない)と、その理由
|
|
40
40
|
FORBIDDEN_PATTERNS: list[tuple[str, str]] = [
|
|
41
41
|
('free[ -]beta', '無料ベータは 2026-10-08 に終わった'),
|
|
@@ -69,6 +69,7 @@ ENV_PROFILE: dict[str, str] = {
|
|
|
69
69
|
'JR_TTL_HOURS': '24',
|
|
70
70
|
'JR_PAID_TTL_HOURS': '168',
|
|
71
71
|
'JR_PAID_MIN_YEN': '500',
|
|
72
|
+
'JR_MONTHLY_PLANS': 'basic:Basic:1500:1650,standard:Standard:4500:5400,pro:Pro:15000:19500',
|
|
72
73
|
'JR_SPEND_CAP_PER_JOB_YEN': '100000',
|
|
73
74
|
'JR_SPEND_CAP_PER_KEY_PER_DAY_YEN': '100000',
|
|
74
75
|
}
|
|
@@ -75,8 +75,8 @@ def _assets_param(flavor: str) -> str:
|
|
|
75
75
|
|
|
76
76
|
# ------------------------------------------------------------------ 指示文
|
|
77
77
|
|
|
78
|
-
_WHEN = ("WHEN TO USE: the user wants to render, preview, animate or turntable a Blender scene (a .blend, a bpy script
|
|
79
|
-
"
|
|
78
|
+
_WHEN = ("WHEN TO USE: the user wants to render, preview, animate or turntable a Blender scene (a .blend, a bpy script, a "
|
|
79
|
+
"glTF/GLB/FBX/USD/OBJ or a splat .spz), or product shots / a 360-degree product video, and has no NVIDIA GPU or "
|
|
80
80
|
"local rendering is slow.")
|
|
81
81
|
_DONT = ("DO NOT USE: to edit a scene open in the user's Blender (a local Blender MCP does that); for one still on a machine "
|
|
82
82
|
"with its own NVIDIA GPU (local is faster); for non-Blender video or other GPU work.")
|
|
@@ -381,15 +381,15 @@ def _script_notes(flavor: str) -> str:
|
|
|
381
381
|
def param_docs(flavor: str, wait_cap_s: int = 50) -> dict[str, str]:
|
|
382
382
|
remote = flavor == "remote"
|
|
383
383
|
return {
|
|
384
|
-
"scene_path": "Local path to the scene: a .blend file, a bpy .py script, or a 3D file (.glb/.gltf/.fbx/.usd/.obj/.stl/.ply/.abc, imported into an empty scene). Uploaded once; reuse the returned scene_id afterwards.",
|
|
384
|
+
"scene_path": "Local path to the scene: a .blend file, a bpy .py script, or a 3D file (.glb/.gltf/.fbx/.usd/.obj/.stl/.ply/.abc, imported into an empty scene; a Gaussian splat .spz or 3DGS .ply opens with Blender 5.3). Uploaded once; reuse the returned scene_id afterwards.",
|
|
385
385
|
"scene_id": "scene_id returned by an earlier call (reuses the uploaded scene without sending it again).",
|
|
386
386
|
"resume_limit": "How many projects to return (1-20, default 3).",
|
|
387
387
|
"resume_cursor": "next_cursor from the previous call, to see more projects. Leave empty for the newest.",
|
|
388
|
-
"scene_script": "The scene as bpy Python code (text). No file and no local Blender needed; the service runs it in Blender 5.0 (5.2 with blender='5.2')." + _script_notes(flavor),
|
|
389
|
-
"scene_url": f"https link to a .blend, a .py script or a 3D file (.glb/.gltf/.fbx/.usd/.obj/.stl/.ply/.abc); the service fetches it (e.g. the sample {SAMPLE_URL}, or a {UPLOAD_LINK_HOURS}-hour /upload link). A .gltf or .obj also brings its .bin / .mtl / textures from the same folder.",
|
|
388
|
+
"scene_script": "The scene as bpy Python code (text). No file and no local Blender needed; the service runs it in Blender 5.0 (5.2 or 5.3 with blender='5.2' / '5.3')." + _script_notes(flavor),
|
|
389
|
+
"scene_url": f"https link to a .blend, a .py script or a 3D file (.glb/.gltf/.fbx/.usd/.obj/.stl/.ply/.abc; a Gaussian splat .spz or 3DGS .ply opens with Blender 5.3); the service fetches it (e.g. the sample {SAMPLE_URL}, or a {UPLOAD_LINK_HOURS}-hour /upload link). A .gltf or .obj also brings its .bin / .mtl / textures from the same folder.",
|
|
390
390
|
"asset_urls": "Extra files sent with the scene: https links (textures, glTF .bin) or 'polyhaven:<id>' CC0 assets from asset_search ('polyhaven:<id>@2k' for 2k textures). A .blend finds them through relative paths (same folder); a script through os.environ['JR_ASSETS_DIR'] or the jr_assets helpers.",
|
|
391
391
|
"assets": "Extra files sent with the scene: local paths (textures, glTF .bin), https links, or 'polyhaven:<id>' CC0 assets from asset_search. A .blend finds them through relative paths (same folder); a script through os.environ['JR_ASSETS_DIR'] or the jr_assets helpers.",
|
|
392
|
-
"blender": "Blender version: '' (default: a .blend opens with the version it was saved in, other scenes with 5.0) or '5.0' / '5.2' (also '4.5', '4.2', '3.6'; a script that stops on Blender 5 because of an older API is rendered again on those automatically) to choose.",
|
|
392
|
+
"blender": "Blender version: '' (default: a .blend opens with the version it was saved in, other scenes with 5.0) or '5.0' / '5.2' / '5.3' (also '4.5', '4.2', '3.6'; a script that stops on Blender 5 because of an older API is rendered again on those automatically) to choose.",
|
|
393
393
|
"frames": f"Preview frames: '' = frame 1; '12' = one frame; '1,8,16,24' or '1-24' = up to {PREVIEW_FRAMES_MAX} frames tiled in one labeled image (to judge camera motion and animation; same GPU time as one 720p frame).",
|
|
394
394
|
"camera": "Name of the camera object to render from (default: the scene's active camera, or an automatic camera if there is none). Ignored with orbit=True; not combinable with cameras.",
|
|
395
395
|
"cameras": "Several camera object names (up to 8) rendered from the same frame in one job: the preview tiles them in one labeled sheet, the final returns one PNG/EXR per camera (camera_files maps names to files). For product shots from fixed angles. Not combinable with orbit, environment='compare' or camera.",
|
|
@@ -410,7 +410,7 @@ def param_docs(flavor: str, wait_cap_s: int = 50) -> dict[str, str]:
|
|
|
410
410
|
"idempotency_key": "Any string up to 128 characters that identifies this order: sending the same key again returns the first job instead of rendering twice (a different body with the same key is refused).",
|
|
411
411
|
"orbit_target": "Object name or 'x,y,z' to centre the orbit on (default: the scene's main objects).",
|
|
412
412
|
"orbit_distance": "Multiplier for the orbit camera distance (default 1.0).",
|
|
413
|
-
"engine": "'' or 'cycles' (path tracing, default) | 'eevee' (real-time rasterizer: about
|
|
413
|
+
"engine": "'' or 'cycles' (path tracing, default) | 'eevee' (real-time rasterizer: about two-thirds of the Cycles per-frame cost on longer animations; every GPU chunk pays about 7-9 s of loading and shader compilation, so below about 100 frames Cycles is usually as cheap or cheaper, and previews stay on Cycles).",
|
|
414
414
|
"transparent": "True renders on a transparent background (alpha) for product shots and overlays; png / exr / webm / gif / webp keep it, mp4 and prores cannot. The preview sheet shows it over dark grey.",
|
|
415
415
|
"frame_start": "First frame to render (inclusive).",
|
|
416
416
|
"frame_end": "Last frame to render (inclusive); equal to frame_start for a single image. With orbit=True and no frame_end, one full turn is rendered.",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: janction-render
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.296
|
|
4
4
|
Summary: Cloud GPU rendering for Blender scenes and 3D models (GLB, FBX, USD, OBJ, STL), built for AI agents: MCP server (remote + stdio), HTTP API and CLI. Product shots, 360-degree turntables, animations and stills; preview in seconds with a critic; no local Blender or GPU. Free welcome credit for a new key. Current pricing and limits: https://render.janction.jp/pricing
|
|
5
5
|
Author-email: "JasmyLab Inc." <contact@jasmylab.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "janction-render"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.296"
|
|
8
8
|
description = "Cloud GPU rendering for Blender scenes and 3D models (GLB, FBX, USD, OBJ, STL), built for AI agents: MCP server (remote + stdio), HTTP API and CLI. Product shots, 360-degree turntables, animations and stills; preview in seconds with a critic; no local Blender or GPU. Free welcome credit for a new key. Current pricing and limits: https://render.janction.jp/pricing"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{janction_render-0.4.280 → janction_render-0.4.296}/janction_render.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{janction_render-0.4.280 → janction_render-0.4.296}/janction_render.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|