libraryextensions/blender/lib/Blender.xtl
Blender.xtl -- the facade of the blender extension: Blender 3D in batch, driven from X_eTaL. A program writes the Python -- a launcher that runs Blender in the background, and the bpy script Blender runs inside -- with bl:w_rite!, runs the launcher with bl:r_un! (python3, with XETAL_BLENDER set to the Blender found), and lists what it made with bl:f_iles. Paths are under the working directory (or XETAL_BLENDER_ROOT). Import: "bl:" u_se< "Blender" Run with xetal-x (xetal-x --ext DIR puts this directory on XETAL_PATH). Each signature line is written out by the binding macro (lib/Ffi.xtlm).
ˡa̲bout : Unit -> Char
bl:a_bout @: the extension's name and version.
"a_bout : unit -> text" ᶠᶠⁱb̲ind< "blender/about"
ˡw̲rite! : Char -> Char -> Int
path bl:w_rite! text: the text into the file (made whole, or not at all; its directory made); how many bytes.
"w_rite! : text text -> int" ᶠᶠⁱb̲ind< "blender/write"
ˡb̲lender : Unit -> Char
bl:b_lender @: the Blender program found -- BLENDER, the macOS application, or blender on the PATH -- or "" when there is none.
"b_lender : unit -> text" ᶠᶠⁱb̲ind< "blender/blender"
ˡv̲ersion : Unit -> Char
bl:v_ersion @: that Blender's version line ("Blender 5.1.2"), or "".
"v_ersion : unit -> text" ᶠᶠⁱb̲ind< "blender/version"
ˡr̲un! : Char -> Char -> Char
script bl:r_un! args: python3 script args (args split at spaces) from the working directory -- XETAL_PYTHON, else the active virtual environment's python3 (VIRTUAL_ENV), else python3 on the PATH -- XETAL_BLENDER set to the Blender found, stopped after XETAL_BLENDER_TIMEOUT seconds (900 by default); the whole output goes to the script's .log beside it. "exit N" (or "timeout after S s"), "errors N" -- the log's Python tracebacks and Blender "Error:" lines, since a run can fail inside and still exit 0 -- and the log's last 20 lines.
"r_un! : text text -> text" ᶠᶠⁱb̲ind< "blender/run"
ᶠᶠⁱb̲ind< expands to
ˡr̲un! ← { a b → pa ← a ⎕N̲PUT "ext:blender/run?text" pb ← b ⎕N̲PUT "ext:blender/run?text" ⎕N̲GET "ext:blender/run" }
ˡr̲ead : Char -> Char
bl:r_ead path: a file's text (a small one a run wrote: a report).
"r_ead : text -> text" ᶠᶠⁱb̲ind< "blender/read"
ᶠᶠⁱb̲ind< expands to
ˡr̲ead ← { a → pa ← a ⎕N̲PUT "ext:blender/read?text" ⎕N̲GET "ext:blender/read" }