allyhub 3d-model
Builds a 3D model's TypeScript module (defineModel) into a GLB; --inspect measures it without writing one
allyhub 3d-model [file] [options]Arguments
Section titled “Arguments”| Argument | Type | What it is |
|---|---|---|
<file> |
string | The model module, a .ts, .mts, .js or .mjs file whose default export is defineModel(build) |
Options
Section titled “Options”| Option | Type | Default | What it does |
|---|---|---|---|
--inspect |
boolean | false |
Measure it without writing a GLB: each object’s parent, matrix, bounds (Blender Z-up metres), triangles, materials as glTF reads them, UV layers, a curve’s splines |
--args |
string | "{}" |
What the module’s build is given (defineModel’s parameters), a JSON object |
--out |
string | The GLB to write (default .allyhub/out/<module>.glb, named as the module is); one there is replaced only after the build succeeds | |
--fresh |
boolean | false |
Build anew instead of reusing the build kept in .allyhub/cache/model (one is reused while the module, the files it read, its parameters, seed and the modelling runtime are unchanged); the new build is kept too |
Parameters
Section titled “Parameters”Each is given as --param name=value.
| Name | Type | Default | What it does |
|---|---|---|---|
seed |
integer | 0 |
Seed of the build’s random generator (bpy.random, 32 bits) |
Global options
Section titled “Global options”--dir <value>: the project’s folder; default the one around where it is run. --json: print the result as JSON.
Examples
Section titled “Examples”allyhub 3d-model models/table.tsallyhub 3d-model models/table.ts --inspect --args '{"width":1.8}'Exit codes
Section titled “Exit codes”0 when it succeeds; the others are listed in Exit codes.
In the work
Section titled “In the work”modeling: Modelling a prop in code, or adding one from a library
add search → add → 3d-model → 3d-model capabilities