BlenderJob

One Blender job while it runs: follow every line it prints and its progress, then wait for its result or stop it.

BlenderService:StartHeadlessAsync makes it as a child of the BlenderService, and it leaves when the job ends. Connect to Line and Progress before your code next yields. WaitAsync gives the same result however often you ask, and StopAsync stops only this job's own Blender, never another.

Call BlenderService:StartHeadlessAsync.

Properties

NameTypeDefaultDescription
Processanyread-onlyThe running Blender process, whose Pid and ExitCode you can read.
Folderstringread-onlyThe job's temporary folder, removed when the job ends unless BlenderService.KeepJobFolders is on.

Methods

NameArgumentsReturnsDescription
WaitAsync
yields
(timeout: number?)(BlenderResult?, string?)Waits for the job to end: its result, plus why when it failed; asking again gives the same result, and a timeout leaves it running.
StopAsync
yields
()numberStops this job's own Blender and waits for its exit code; called after the end, it gives the code the job ended with.

Events

NamePassesDescription
Line(string)Fires with each line Blender prints, from either stream, in the order they arrive.
Progress(string, number, number?)Fires with stage, done and total for each progress() call or printed line like "Faces: 12 / 40"; total is nil for "?".
From ShotInstance 33