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).

source · imports ffi: lib/Ffi.xtlm

ˡa̲bout : Unit -> Char

function · line 15

bl:a_bout @: the extension's name and version.

"a_bout : unit -> text"          ᶠᶠⁱb̲ind< "blender/about"
ᶠᶠⁱb̲ind< expands to
ˡa̲bout ← { @ →
  ⎕N̲GET "ext:blender/about"
}

ˡw̲rite! : Char -> Char -> Int

function · line 18

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̲ind< expands to
ˡw̲rite! ← { a b →
  pa ← a ⎕N̲PUT "ext:blender/write?text"
  pb ← b ⎕N̲PUT "ext:blender/write?text"
  f̲loor f̲irst n̲umbers ⎕N̲GET "ext:blender/write"
}
Used in: _, _, _, _, _, m, p, _, _, _, _, _, _, _, _, _, _, _, _

ˡb̲lender : Unit -> Char

function · line 21

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"
ᶠᶠⁱb̲ind< expands to
ˡb̲lender ← { @ →
  ⎕N̲GET "ext:blender/blender"
}

ˡv̲ersion : Unit -> Char

function · line 23

bl:v_ersion @: that Blender's version line ("Blender 5.1.2"), or "".

"v_ersion : unit -> text"        ᶠᶠⁱb̲ind< "blender/version"
ᶠᶠⁱb̲ind< expands to
ˡv̲ersion ← { @ →
  ⎕N̲GET "ext:blender/version"
}
Used in: m

ˡr̲un! : Char -> Char -> Char

function · line 32

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

function · line 34

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"
}

ˡf̲iles : Char -> Char

function · line 37

bl:f_iles dir: the files under dir, one a line, "bytes path", sorted by path.

"f_iles : text -> text"          ᶠᶠⁱb̲ind< "blender/files"
ᶠᶠⁱb̲ind< expands to
ˡf̲iles ← { a →
  pa ← a ⎕N̲PUT "ext:blender/files?text"
  ⎕N̲GET "ext:blender/files"
}

ˡpackage : Char

value · line 40

The native package behind these functions.

ˡpackage ← "blender"