renderboy 0.7.4 → 0.7.5
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.
- package/README.md +2 -2
- package/dist/renderboy.js +87 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Render Blender files on cloud GPUs from the command line. Built for coding agents, usable by hand.
|
|
4
4
|
|
|
5
5
|
`renderboy render scene.blend` checks, bakes and packs the scene with the Blender on your machine,
|
|
6
|
-
uploads one file, renders its frames on RTX 4090s with
|
|
7
|
-
contact sheet back.
|
|
6
|
+
uploads one file, renders its frames on RTX 4090s with its own engine (Cycles, EEVEE or
|
|
7
|
+
Workbench), and brings the frames, an MP4 and a contact sheet back.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
package/dist/renderboy.js
CHANGED
|
@@ -32,7 +32,7 @@ var listed = (names, and = "and") => names.length < 2 ? names.join("") : `${name
|
|
|
32
32
|
var skillInstall = (app) => `renderboy skill install ${app}`;
|
|
33
33
|
var SKILL_INSTALL_ANY = { command: "renderboy skill install APP", apps: listed(SKILL_APPS.map(([app]) => app), "or") };
|
|
34
34
|
var HELP = {
|
|
35
|
-
intro: "RenderBoy renders a saved .blend on cloud GPUs (RTX 4090,
|
|
35
|
+
intro: "RenderBoy renders a saved .blend on cloud GPUs (RTX 4090; Cycles, EEVEE or Workbench) and brings the frames, an MP4 and a contact sheet back. Build and preview the scene on this machine with Blender 5.2, for free; `renderboy render` checks, bakes and packs it with that Blender, uploads one file, renders its frames on the farm and downloads them.",
|
|
36
36
|
start: [
|
|
37
37
|
["renderboy login", "once: approve a link in any browser"],
|
|
38
38
|
["renderboy render scene.blend --frames 1", "a still (one frame)"],
|
|
@@ -74,8 +74,8 @@ var HELP = {
|
|
|
74
74
|
],
|
|
75
75
|
scene: [
|
|
76
76
|
"A saved .blend, rendered as saved: its active scene, camera, frame range, resolution, samples, denoiser, view layers, colour management and image format. Python in the file never runs: drivers that need it are refused.",
|
|
77
|
-
|
|
78
|
-
`The farm: Blender 5.2.4, one RTX 4090 (${MACHINE.vramGb} GB) with ${MACHINE.ramGb} GB of RAM per GPU. Cycles renders with OptiX on the GPU, and the scene's denoiser runs on the GPU too: leave the denoiser as it is. The compositor runs on the CPU there, whatever the file's compositor device (Blender 5.2 defaults it to the GPU).`,
|
|
77
|
+
"The scene's own engine renders it: Cycles, EEVEE or Workbench (an add-on's engine is refused). EEVEE, Workbench, Grease Pencil and Freestyle with the compositor on draw with the GPU, so they render only on farm GPUs that can draw: on a provider whose GPUs can't, the job fails free and says so.",
|
|
78
|
+
`The farm: Blender 5.2.4, one RTX 4090 (${MACHINE.vramGb} GB) with ${MACHINE.ramGb} GB of RAM per GPU. Cycles renders with OptiX on the GPU, and the scene's denoiser runs on the GPU too: leave the denoiser as it is. EEVEE draws with Vulkan. The compositor runs on the CPU there, whatever the file's compositor device (Blender 5.2 defaults it to the GPU).`,
|
|
79
79
|
"Simulations (cloth, rigid and soft bodies, particles, dynamic paint, Geometry Nodes simulation zones and bakes) are baked here, and textures, UDIMs, fonts and linked libraries are packed into the one file. Refused, as a .blend can't hold them: image sequences and movies, OpenVDB volumes, Alembic and USD caches, fluid simulations, nodes from add-ons.",
|
|
80
80
|
"At most 8192 px a side, 20,000 frames, 60 minutes a frame, 5 GB packed.",
|
|
81
81
|
"A scene set to write a movie renders PNG frames: the video is made here.",
|
|
@@ -135,7 +135,7 @@ var CLI_FIXES = {
|
|
|
135
135
|
BLENDER_NOT_FOUND: `Install it with \`${INSTALL_COMMAND}\`, or put a Blender 5.2 \`blender\` on PATH.`,
|
|
136
136
|
CORRUPT_FILE: "Open and re-save the file in Blender 5.2, then render again.",
|
|
137
137
|
UNSUPPORTED_VERSION: "Save the file with Blender 5.2.",
|
|
138
|
-
UNSUPPORTED_ENGINE:
|
|
138
|
+
UNSUPPORTED_ENGINE: 'Set the render engine of the scenes named to Cycles, EEVEE or Workbench (`scene.render.engine = "CYCLES"`), save, and render again.',
|
|
139
139
|
NO_CAMERA: "Add a camera and set it as the scene's camera, then save.",
|
|
140
140
|
BAD_FRAMES: "Pass frames like 1-250, 1-250:2 or 1,125,250, inside the scene's range.",
|
|
141
141
|
RESOLUTION_TOO_LARGE: "Lower the resolution or its percentage to 8192 px a side or less.",
|
|
@@ -152,11 +152,6 @@ var CLI_FIXES = {
|
|
|
152
152
|
UNAUTHORIZED: "Run `renderboy login`, or set RENDERBOY_KEY to a new token from the account page.",
|
|
153
153
|
CLI_TOO_OLD: `Run the same command again: renderboy updates itself first. If it can't, update it with \`${INSTALL_COMMAND}\` (or \`${NPM_UPDATE_COMMAND}\` if npm installed it).`
|
|
154
154
|
};
|
|
155
|
-
var ENGINE_FIXES = {
|
|
156
|
-
engine: 'Set the render engine of the scenes named to Cycles (`scene.render.engine = "CYCLES"`), save, and render again.',
|
|
157
|
-
grease_pencil: "Hide the Grease Pencil objects named from the render (`hide_render = True`) or delete them, save, and render again.",
|
|
158
|
-
freestyle: "Turn off Freestyle (`scene.render.use_freestyle = False`) or the compositor (`scene.render.use_compositing = False`), save, and render again: together they need GPU drawing."
|
|
159
|
-
};
|
|
160
155
|
|
|
161
156
|
// src/errors.ts
|
|
162
157
|
var EXIT_OK = 0;
|
|
@@ -704,7 +699,7 @@ var fill = (text2, width, options = {}) => wrap(text2, width, options).join("\n"
|
|
|
704
699
|
var LINE_BREAKS = new RegExp("\\r\\n|[\\n\\r\\x0b\\x0c\\x1c\\x1d\\x1e\\x85\\u2028\\u2029]");
|
|
705
700
|
|
|
706
701
|
// src/version.ts
|
|
707
|
-
var VERSION = "0.7.
|
|
702
|
+
var VERSION = "0.7.5";
|
|
708
703
|
var USER_AGENT = `renderboy/${VERSION}`;
|
|
709
704
|
|
|
710
705
|
// src/api.ts
|
|
@@ -1930,6 +1925,7 @@ says where. Nothing is read from Blender's stdout.
|
|
|
1930
1925
|
|
|
1931
1926
|
from __future__ import annotations
|
|
1932
1927
|
|
|
1928
|
+
import ctypes
|
|
1933
1929
|
import json
|
|
1934
1930
|
import os
|
|
1935
1931
|
import re
|
|
@@ -2193,7 +2189,58 @@ def reach(scene):
|
|
|
2193
2189
|
|
|
2194
2190
|
# --- the check ------------------------------------------------------------------------------
|
|
2195
2191
|
|
|
2196
|
-
|
|
2192
|
+
# The engines the farm renders with (docs/design.md, "Engine and versions"); EEVEE and Workbench draw.
|
|
2193
|
+
ENGINES = {"CYCLES": "Cycles", "BLENDER_EEVEE": "EEVEE", "BLENDER_WORKBENCH": "Workbench"}
|
|
2194
|
+
# RenderData.engine is char[32]; it lies this far into the struct in Blender 5.2 (2452 bytes), so
|
|
2195
|
+
# the search for it stays well inside a Scene.
|
|
2196
|
+
_ENGINE_SIZE = 32
|
|
2197
|
+
_ENGINE_SEARCH = 3072
|
|
2198
|
+
_engine_offset: int | None = None
|
|
2199
|
+
|
|
2200
|
+
|
|
2201
|
+
def _find_engine_offset() -> int:
|
|
2202
|
+
"""Where RenderData.engine lies, found in a scene of our own: the offset at which the name of the
|
|
2203
|
+
engine it is set to appears, for two engines. -1 if not found."""
|
|
2204
|
+
probe = bpy.data.scenes.new("renderboy engine probe")
|
|
2205
|
+
try:
|
|
2206
|
+
found = None
|
|
2207
|
+
for engine in ("CYCLES", "BLENDER_WORKBENCH"):
|
|
2208
|
+
probe.render.engine = engine
|
|
2209
|
+
raw = ctypes.string_at(probe.render.as_pointer(), _ENGINE_SEARCH)
|
|
2210
|
+
at = {m.start() for m in re.finditer(re.escape(engine.encode() + b"\\0"), raw)}
|
|
2211
|
+
found = at if found is None else found & at
|
|
2212
|
+
return min(found) if found else -1
|
|
2213
|
+
finally:
|
|
2214
|
+
bpy.data.scenes.remove(probe)
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
def stored_engine(scene) -> str:
|
|
2218
|
+
"""The engine the file stored for \`scene\`. Blender opens a scene whose engine is not registered
|
|
2219
|
+
(an add-on's) on EEVEE, logging "Engine '\u2026' not available", and keeps the stored name in the
|
|
2220
|
+
scene, where Python can't see it: it is read from the struct, at the offset an engine name
|
|
2221
|
+
set from Python lands at."""
|
|
2222
|
+
global _engine_offset
|
|
2223
|
+
if _engine_offset is None:
|
|
2224
|
+
_engine_offset = _find_engine_offset()
|
|
2225
|
+
if _engine_offset < 0:
|
|
2226
|
+
print(f"scene check: can't read the stored engine in Blender {bpy.app.version_string}", file=sys.stderr)
|
|
2227
|
+
if _engine_offset < 0:
|
|
2228
|
+
return scene.render.engine
|
|
2229
|
+
raw = ctypes.string_at(scene.render.as_pointer() + _engine_offset, _ENGINE_SIZE)
|
|
2230
|
+
name = raw.split(b"\\0", 1)[0].decode("utf-8", "replace")
|
|
2231
|
+
return name or scene.render.engine
|
|
2232
|
+
|
|
2233
|
+
|
|
2234
|
+
def samples_of(scene) -> int:
|
|
2235
|
+
"""The samples of the scene's engine: Cycles' samples, EEVEE's render samples, Workbench's
|
|
2236
|
+
anti-aliasing samples (1 when it is off or FXAA)."""
|
|
2237
|
+
engine = scene.render.engine
|
|
2238
|
+
if engine == "BLENDER_EEVEE":
|
|
2239
|
+
return int(scene.eevee.taa_render_samples)
|
|
2240
|
+
if engine == "BLENDER_WORKBENCH":
|
|
2241
|
+
aa = scene.display.render_aa
|
|
2242
|
+
return int(aa) if aa.isdigit() else 1
|
|
2243
|
+
return int(scene.cycles.samples)
|
|
2197
2244
|
|
|
2198
2245
|
|
|
2199
2246
|
def label(id_) -> str:
|
|
@@ -2206,9 +2253,9 @@ def label(id_) -> str:
|
|
|
2206
2253
|
|
|
2207
2254
|
def freestyle_through_compositor(scene) -> bool:
|
|
2208
2255
|
"""Freestyle lines in a scene whose compositor is on: Blender composites the strokes with GPU
|
|
2209
|
-
drawing, even with the compositor on the CPU, so they
|
|
2210
|
-
the compositor off
|
|
2211
|
-
sequencer, whose Freestyle is not drawn.)"""
|
|
2256
|
+
drawing, even with the compositor on the CPU, so they render only where the GPU can draw.
|
|
2257
|
+
(Freestyle with the compositor off doesn't draw; nor does a scene rendered only through another
|
|
2258
|
+
scene's compositor or sequencer, whose Freestyle is not drawn.)"""
|
|
2212
2259
|
return (scene.render.use_freestyle and compositor(scene) is not None
|
|
2213
2260
|
and any(layer.use and layer.use_freestyle for layer in scene.view_layers))
|
|
2214
2261
|
|
|
@@ -2242,16 +2289,18 @@ def drivers(id_):
|
|
|
2242
2289
|
|
|
2243
2290
|
|
|
2244
2291
|
def analyze(scene, base_dir: str) -> dict:
|
|
2245
|
-
"""What the render of \`scene\` reaches: its files and
|
|
2292
|
+
"""What the render of \`scene\` reaches: its files, its problems, and what of it needs GPU
|
|
2293
|
+
drawing (\`drawing\`: EEVEE, Workbench, Grease Pencil, Freestyle with the compositor), which
|
|
2294
|
+
is no problem but renders only where the GPU can draw."""
|
|
2246
2295
|
scenes, ids = reach(scene)
|
|
2247
|
-
files, problems = [], []
|
|
2296
|
+
files, problems, drawing = [], [], []
|
|
2248
2297
|
simulations = 0 # that may need baking: not baked into the file, or a Geometry Nodes simulation
|
|
2249
2298
|
rbw = scene.rigidbody_world
|
|
2250
2299
|
if rbw is not None and rbw.enabled and rbw.collection is not None:
|
|
2251
2300
|
simulations += rbw.point_cache.use_disk_cache or not rbw.point_cache.is_baked
|
|
2252
2301
|
|
|
2253
|
-
def problem(code, item
|
|
2254
|
-
entry = {"code": code, "item": item
|
|
2302
|
+
def problem(code, item):
|
|
2303
|
+
entry = {"code": code, "item": item}
|
|
2255
2304
|
if entry not in problems:
|
|
2256
2305
|
problems.append(entry)
|
|
2257
2306
|
|
|
@@ -2265,9 +2314,11 @@ def analyze(scene, base_dir: str) -> dict:
|
|
|
2265
2314
|
"relink": os.path.normpath(resolved) != found if os.path.isabs(resolved) else True})
|
|
2266
2315
|
|
|
2267
2316
|
for sc in scenes:
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
problem("UNSUPPORTED_ENGINE", f'scene "{sc.name}" renders with {engine}'
|
|
2317
|
+
engine = stored_engine(sc)
|
|
2318
|
+
if engine not in ENGINES:
|
|
2319
|
+
problem("UNSUPPORTED_ENGINE", f'scene "{sc.name}" renders with {engine}')
|
|
2320
|
+
elif engine != "CYCLES":
|
|
2321
|
+
drawing.append(f'scene "{sc.name}" renders with {ENGINES[engine]}')
|
|
2271
2322
|
for strip in sequencer_strips(sc):
|
|
2272
2323
|
if strip.type in ("IMAGE", "MOVIE"):
|
|
2273
2324
|
problem("CANNOT_PACK", f'sequencer strip "{strip.name}" ({strip.type.lower()} file)')
|
|
@@ -2275,7 +2326,7 @@ def analyze(scene, base_dir: str) -> dict:
|
|
|
2275
2326
|
if drv.driver.type == "SCRIPTED" and not drv.driver.is_simple_expression:
|
|
2276
2327
|
problem("PYTHON_DRIVERS", f'scene "{sc.name}" {drv.data_path}: {drv.driver.expression}')
|
|
2277
2328
|
if freestyle_through_compositor(scene):
|
|
2278
|
-
|
|
2329
|
+
drawing.append(f'scene "{scene.name}" draws Freestyle lines with the compositor on')
|
|
2279
2330
|
if scene.camera is None:
|
|
2280
2331
|
problem("NO_CAMERA", f'scene "{scene.name}"')
|
|
2281
2332
|
|
|
@@ -2322,7 +2373,7 @@ def analyze(scene, base_dir: str) -> dict:
|
|
|
2322
2373
|
problem("CANNOT_PACK", f"{id_.filepath} (Alembic or USD cache)")
|
|
2323
2374
|
elif isinstance(id_, bpy.types.Object):
|
|
2324
2375
|
if id_.type in ("GREASEPENCIL", "GPENCIL") and not id_.hide_render:
|
|
2325
|
-
|
|
2376
|
+
drawing.append(f"{label(id_)} is Grease Pencil")
|
|
2326
2377
|
for mod in id_.modifiers:
|
|
2327
2378
|
if not mod.show_render:
|
|
2328
2379
|
continue
|
|
@@ -2350,8 +2401,9 @@ def analyze(scene, base_dir: str) -> dict:
|
|
|
2350
2401
|
facts = {
|
|
2351
2402
|
"name": scene.name,
|
|
2352
2403
|
"camera": scene.camera.name if scene.camera is not None else None,
|
|
2404
|
+
"engine": scene.render.engine,
|
|
2353
2405
|
"resolution": [width, height],
|
|
2354
|
-
"samples":
|
|
2406
|
+
"samples": samples_of(scene),
|
|
2355
2407
|
"fps": round(r.fps / r.fps_base, 6),
|
|
2356
2408
|
"frame_start": scene.frame_start,
|
|
2357
2409
|
"frame_end": scene.frame_end,
|
|
@@ -2366,7 +2418,7 @@ def analyze(scene, base_dir: str) -> dict:
|
|
|
2366
2418
|
"look": view.look, "exposure": view.exposure, "gamma": view.gamma},
|
|
2367
2419
|
}
|
|
2368
2420
|
local["simulations"] = simulations
|
|
2369
|
-
return {"facts": facts, "local": local, "files": files, "problems": problems, "ids": ids}
|
|
2421
|
+
return {"facts": facts, "local": local, "files": files, "problems": problems, "drawing": drawing, "ids": ids}
|
|
2370
2422
|
`;
|
|
2371
2423
|
|
|
2372
2424
|
// src/blender_scripts/encode.py
|
|
@@ -4111,9 +4163,7 @@ var limits = { check: 20 * 60, pack: 6 * 3600 };
|
|
|
4111
4163
|
var PACK_KEEP_SECONDS = 7 * 86400;
|
|
4112
4164
|
var LISTED = 5;
|
|
4113
4165
|
var MESSAGES = {
|
|
4114
|
-
UNSUPPORTED_ENGINE: "{file}
|
|
4115
|
-
"UNSUPPORTED_ENGINE/grease_pencil": "{file} needs GPU drawing, which the farm doesn't have: {items}.",
|
|
4116
|
-
"UNSUPPORTED_ENGINE/freestyle": "{file} needs GPU drawing, which the farm doesn't have: {items}.",
|
|
4166
|
+
UNSUPPORTED_ENGINE: "{file} renders with an engine the farm doesn't have (an add-on's): {items}.",
|
|
4117
4167
|
NO_CAMERA: "The active scene of {file} has no camera ({items}).",
|
|
4118
4168
|
RESOLUTION_TOO_LARGE: "The render is {items}, over 8192 px on a side.",
|
|
4119
4169
|
MISSING_FILE: "{file} uses files that are not on this machine: {items}.",
|
|
@@ -4171,15 +4221,13 @@ function problemFromRun(run3, file, doing) {
|
|
|
4171
4221
|
function groupProblems(found, fileName) {
|
|
4172
4222
|
const groups = /* @__PURE__ */ new Map();
|
|
4173
4223
|
for (const item2 of found) {
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
groups.get(key).items.push(item2.item);
|
|
4224
|
+
if (!groups.has(item2.code)) groups.set(item2.code, []);
|
|
4225
|
+
groups.get(item2.code).push(item2.item);
|
|
4177
4226
|
}
|
|
4178
|
-
return [...groups.
|
|
4227
|
+
return [...groups.entries()].map(([code, items]) => {
|
|
4179
4228
|
const shown = items.slice(0, LISTED).join(", ") + (items.length > LISTED ? ` and ${items.length - LISTED} more` : "");
|
|
4180
|
-
const template = MESSAGES[
|
|
4181
|
-
|
|
4182
|
-
return new Problem(code, template.replace("{file}", fileName).replace("{items}", shown), fix);
|
|
4229
|
+
const template = MESSAGES[code] || "{file}: {items}.";
|
|
4230
|
+
return new Problem(code, template.replace("{file}", fileName).replace("{items}", shown));
|
|
4183
4231
|
});
|
|
4184
4232
|
}
|
|
4185
4233
|
var sha256Hex = (text2) => crypto2.createHash("sha256").update(text2, "utf8").digest("hex");
|
|
@@ -4339,12 +4387,13 @@ async function send(storage, file, parts, partSize, slow2) {
|
|
|
4339
4387
|
// src/render.ts
|
|
4340
4388
|
var FARM_OUTPUTS = { waitSeconds: 300, everySeconds: 3 };
|
|
4341
4389
|
var steps = { find, check, pack, make };
|
|
4390
|
+
var ENGINE_NAMES = { CYCLES: "Cycles", BLENDER_EEVEE: "EEVEE", BLENDER_WORKBENCH: "Workbench" };
|
|
4342
4391
|
function summary(checked, wanted) {
|
|
4343
4392
|
const facts = checked.facts;
|
|
4344
4393
|
const bits = [`scene "${facts.name}"`, facts.camera ? `camera "${facts.camera}"` : "no camera"];
|
|
4345
4394
|
if (wanted.length) bits.push(describe2(wanted));
|
|
4346
4395
|
const [width, height] = facts.resolution;
|
|
4347
|
-
bits.push(`${width}x${height}`, plural(facts.samples, "sample"));
|
|
4396
|
+
bits.push(`${width}x${height}`, `${ENGINE_NAMES[facts.engine] ?? facts.engine} at ${plural(facts.samples, "sample")}`);
|
|
4348
4397
|
return `${checked.name}: ${bits.join(", ")}`;
|
|
4349
4398
|
}
|
|
4350
4399
|
function framesToRender(spec2, facts) {
|
|
@@ -4706,7 +4755,7 @@ description: Renders Blender .blend scenes and animations on cloud GPUs with the
|
|
|
4706
4755
|
|
|
4707
4756
|
# Rendering with renderboy
|
|
4708
4757
|
|
|
4709
|
-
\`renderboy\` is installed on this machine. It renders a saved .blend on the RenderBoy farm's GPUs (Cycles): it checks the scene with the local Blender, bakes its simulations, packs every file it uses into one copy, uploads that, renders the frames and downloads them, with \`video.mp4\` and \`contact_sheet.png\`, into \`scene_render/\` (for \`scene.blend\`) in the current directory.
|
|
4758
|
+
\`renderboy\` is installed on this machine. It renders a saved .blend on the RenderBoy farm's GPUs with its own engine (Cycles, EEVEE or Workbench): it checks the scene with the local Blender, bakes its simulations, packs every file it uses into one copy, uploads that, renders the frames and downloads them, with \`video.mp4\` and \`contact_sheet.png\`, into \`scene_render/\` (for \`scene.blend\`) in the current directory.
|
|
4710
4759
|
|
|
4711
4760
|
\`renderboy --help\` and \`renderboy render --help\` are the authority: read both before the first render of a session. This skill only adds the rules that keep a render from wasting money.
|
|
4712
4761
|
|
|
@@ -4714,7 +4763,7 @@ description: Renders Blender .blend scenes and animations on cloud GPUs with the
|
|
|
4714
4763
|
|
|
4715
4764
|
- Building, editing or previewing a scene, or a quick look: the local Blender does that for free.
|
|
4716
4765
|
- Nobody asked for a farm render: ask before spending the person's credit.
|
|
4717
|
-
- A
|
|
4766
|
+
- A job of an EEVEE or Workbench scene that failed because no machine could draw: switching it to Cycles changes the look. Ask first.
|
|
4718
4767
|
|
|
4719
4768
|
## Workflow
|
|
4720
4769
|
|