lmvideo reference

Every context object, host function, host type and method of the lmvideo v0.1.124 host, generated from the published schema file schema/lmvideo.dsl.json, plus the command line, the result envelope, exit codes and the standard library the release ships.

The schema records parameter types and return types only. Parameter meanings are given where the repository documentation states them; everything else is listed as a typed signature. The same list is printed by lmvideo --lmcode-signatures.

Surface at a glance

ItemCount in v0.1.124
Schema format (dsl.schema)2
Context objects3 (canvas, video, out)
Host function names74
Host function signatures81
Host types55
Host method signatures524
Standard library signatures (lmcode_std_v3)206 (83 functions, 123 methods on 16 types)
Total lines of --lmcode-signatures814 (3 context, 164 fn, 647 method)
Block result typeJson, nullable

Command line

The host prints this usage line for an unknown option. It is the complete list of top level modes in v0.1.124.

lmvideo --bogus
LMCODE_RETURN_BEGIN
{"ok":false,"phase":"cli","code":"CLI_USAGE","message":"usage: lmvideo --lmcode FILE [--output PATH] [--offline] | --lmcode-schema [--json] | --lmcode-signatures | --version | demo OUT.png | render IN.svg OUT.png\n"}
LMCODE_RETURN_END
InvocationWhat it does
lmvideo --versionPrints the version line, for example lmvideo 0.1.124.
lmvideo --lmcode-schemaPrints the host schema JSON. The bytes are identical to schema/lmvideo.dsl.json in the repository (SHA-256 97d1643ca2d15ed98ae76acb5a5a4828b8a3509df770b0f395569a2c96c980a2).
lmvideo --lmcode-schema --jsonSame bytes as above in v0.1.124. This is the form the lmscript compiler calls.
lmvideo --lmcode-signaturesPrints one line per context object, function and method, host and standard library together: 814 lines.
lmvideo --lmcode FILERuns compiled block bytecode and prints the result envelope between LMCODE_RETURN_BEGIN and LMCODE_RETURN_END. run_lmcode does this for you.
--output PATH, --offlineOptions of the --lmcode mode named in the usage line. The public repository does not describe them further, so they are listed here without semantics.
lmvideo demo OUT.pngWrites a built in demonstration picture (500 by 350 pixels in v0.1.124).
lmvideo render IN.svg OUT.png [--width W] [--height H] [--background COLOR]Rasterizes one SVG file to a PNG without any LMScript program.
lmvideo render-job DIR [--renderer raster|cycles] [--pass color] [--output OUT.png]Renders a scene job directory written by Scene3D.save_job.
lmvideo render-job-batch DIR [--renderer raster|cycles] [--pass color] [--output DIR]Renders a directory of frame jobs. Output is written atomically and completed frames survive cancellation.
lmvideo render-job --capabilitiesPrints accepted job options and bounds as JSON. It does not load or smoke test the renderer.
lmvideo render-job --capabilities
{"schema":"render-job-capabilities/v1","status":"ok","renderers":["raster","cycles"],"passes":["color"],"max_frames":32,"max_pixels":4194304,"atomic_outputs":true,"cancellation":"renderer callback; completed frames and manifest are retained"}

Outer block attributes

AttributeValue used by the repository examplesMeaning
clilmvideoHost executable that supplies the schema and runs the block.
installgithub:lmctl-ai/lmvideo@v0.1.124Release that lmscript downloads into its tool cache when the host is not already there. The examples pin the tag for reproducible runs.

Exit codes and error codes

These were observed by running the v0.1.124 Linux binary and lmscript 0.2.482. The public repository contains no exit code table, so only observed values are listed.

CommandSituationExit code
lmvideo --version, --lmcode-schema, --lmcode-signaturesSuccess0
lmvideo demo, lmvideo render, lmvideo render-job --capabilitiesSuccess0
lmvideo with an unknown optionEnvelope with code CLI_USAGE2
lmvideo --lmcode FILEBytecode file cannot be read, envelope with code LOAD_BAD_BYTECODE3
lmvideo renderInput SVG cannot be opened3
lmvideo render-job or render-job-batch without a directoryUsage text1
lmscript --check FILE.lmsBlock does not compile against the host schema2
lmscript FILE.lmsAn assert on r.ok fails after a host error1
lmscript FILE.lmsHost error that the script inspects without asserting0

Envelope codes seen from the host

phasecodeCause
cliCLI_USAGEUnknown command line option.
loadLOAD_BAD_BYTECODEThe file given to --lmcode cannot be read.
loadLOAD_UNBOUNDThe program imports a function the host does not provide, for example a rest_ function.
runRUN_HOSTA host call failed, for example video.frame outside begin and end. The envelope carries line and column of the block.
appAPP_FAILThe block called out.fail. The message is the text passed to fail, prefixed with the block line and column.

Result envelope

run_lmcode returns a value with ok and, on success, result; on failure it carries phase, code, message and, when known, line and column. The result of a successful lmvideo block in v0.1.124 has these fields.

{"ok":true,"result":{"output":["drew 160x100"],"file":"build/dot.png","width":160,"height":100,"frames":1,"fps":30,"bytecode_bytes":1253,"instructions":47,"wall_ms":294,"render_calls":0,"phase_ms":{"compose":41.90718,"post":0.000943,"setup":252.409468},"max_frame_ms":0,"max_render_ms":0}}
FieldContent
outputList of the strings passed to out.print, in order.
file, width, height, frames, fpsThe output the host reports for the run, with its pixel size, frame count and frame rate.
bytecode_bytes, instructionsSize of the compiled block and the number of executed instructions.
wall_ms, phase_ms, max_frame_ms, max_render_ms, render_callsTiming and render counters. They vary from run to run.

Under --dry-run the envelope is {"ok":true,"result":null,"dry":true} and no host code runs.

Context objects

Three objects exist in every block without being constructed.

NameTypeRole
canvasCanvasThe drawing surface of the active video frame, or of the Surface chosen with canvas.target.
videoVideoSize, frame rate, frame count, output path and the begin, frame, end lifecycle.
outOutputText output: print adds a line to result.output, fail stops the block with code APP_FAIL.

Host functions

74 function names with 81 signatures. Functions are called by bare name inside the block. Several are overloaded; each overload is one row.

2D drawing, text and documents

FunctionParametersReturns
paint(none)Paint
path(none)Path
fontfloatFont
font_loadstringTypeface
font_loadstring, stringTypeface
font_catalog(none)string
fonts_used(none)string
svgstringSvg
svg_filestringSvg
svg_filestring, stringSvg
template_svgstringTemplateSvg
surfaceint, intSurface
documentint, intDocument
pdf_documentfloat, floatPdfDocument
picture_filestringPicture
keyframes(none)Keyframes
mixstring, string, floatstring

Images, layouts and timelines

FunctionParametersReturns
image_createint, intImage
image_createint, int, stringImage
image_createint, int, float, float, float, floatImage
image_filestringImage
image_filestring, stringImage
image_bytesstringImage
image_rgbaint, int, stringImage
image_patternint, int, string, string, string, stringImage
image_haldintImage
image_curve(none)Curve
image_panelImage, Image, intImage
image_text_widthstring, floatfloat
image_assert_closefloat, float, floatvoid
image_assert_trueboolvoid
layout_createint, intLayout
layout_sheet(none)Layout
timeline_create(none)Timeline
timeline_createint, intTimeline
frame_cachestring, intFrameCache

3D scenes, cameras and meshes

FunctionParametersReturns
scene3d(none)Scene3D
scene_jobstringScene3D
camera3d(none)Camera3D
render_availablestringbool
mesh_boxfloat, float, floatMesh3D
mesh_beveled_boxfloat, float, float, floatMesh3D
mesh_planefloat, floatMesh3D
mesh_spherefloat, int, intMesh3D
mesh_cylinderfloat, float, intMesh3D
mesh_conefloat, float, intMesh3D
mesh_torusfloat, float, int, intMesh3D
mesh_lathestring, intMesh3D
mesh_lathe_closedstring, intMesh3D
mesh_tube_splinestring, float, int, boolMesh3D
mesh_extrudestring, floatMesh3D
mesh_heightfieldImage, float, float, floatMesh3D
mesh_trianglesstring, stringMesh3D
mesh_loadstringMesh3D
mesh_textTypeface, string, float, float, floatMesh3D
mesh_text_bevelTypeface, string, float, float, float, floatMesh3D
point_cloud(none)PointCloud
hair_curvesstring, string, stringHairCurves

Materials, textures and environments

FunctionParametersReturns
material(none)Material
materialstring, float, floatMaterial
material_sourcestringMaterial
material_filestringMaterial
material_loadstringMaterial
material_compilestring, string, int, intMaterial
texture_from_imageImage, stringTexture
texture_filestring, stringTexture
texture_constantstringTextureGraph
texture_noisestring, int, intTextureGraph
texture_graph_imageTextureTextureGraph
texture_checkerstring, string, intTextureGraph
texture_gradientstring, string, intTextureGraph
texture_bricksstring, string, intTextureGraph
texture_stripesstring, string, intTextureGraph
texture_rampstring, string, intTextureGraph
texture_radialstring, string, intTextureGraph
environment_imageImageEnvironment
environment_filestring, stringEnvironment
environment_linearint, int, stringEnvironment

Physics

FunctionParametersReturns
physics_worldfloat, intPhysicsWorld
physics_materialfloat, floatPhysicsMaterial
physics_presentationint, int, intPhysicsPresentation

Host types and methods

55 opaque types with 524 method signatures. Values are created by the functions above or returned by other methods; the line under each heading lists where a value of that type comes from according to the schema. Most configuration methods return the receiver so calls can be chained.

GroupTypes
Output and videoVideo, Output
Canvas drawingCanvas, Paint, Path, Font, Typeface, Gradient, DrawNode, Shape, Group, Grid, Text, ImageView, Keyframes, Keyframe
PlotsPlot, Series, Heatmap, VectorField, Legend, Axes
Panels and layout managersPanel, LayoutItem
ImagesImage, Curve, Layout, Timeline, FrameCache
SVG and vector documentsSvg, SvgNode, TemplateSvg, Surface, Document, Picture, PdfDocument
3D sceneScene3D, Camera3D, Node3D, InstancedNode3D, Mesh3D, HairCurves, PointCloud, Projection, Anchor3D
Materials and texturesMaterial, Texture, TextureGraph, Environment
PhysicsPhysicsWorld, PhysicsMaterial, PhysicsBody, PhysicsPose, PhysicsTake, PhysicsPresentation

Video

15 method signatures. Comes from: context object video.

MethodParametersReturns
sizeint, intvoid
fpsintvoid
framesintvoid
outputstringvoid
crfintvoid
begin(none)void
frame(none)void
end(none)void
index(none)int
count(none)int
t(none)float
time(none)float
width(none)int
height(none)int
save_framestringvoid

Output

2 method signatures. Comes from: context object out.

MethodParametersReturns
printstringvoid
failstringvoid

Canvas

69 method signatures. Comes from: context object canvas, Document.canvas, Surface.canvas.

MethodParametersReturns
scene3dScene3D, float, float, int, intvoid
scene3d_cameraScene3D, Camera3D, float, float, int, intvoid
panelfloat, float, float, floatPanel
plotfloat, float, float, floatPlot
boxfloat, float, float, float, string, string, string, float, floatShape
boxShape, string, float, float, string, string, string, float, floatShape
diamondfloat, float, float, float, string, string, string, floatShape
cylinderfloat, float, float, float, string, string, string, floatShape
notefloat, float, float, float, string, string, string, floatShape
clusterfloat, float, float, float, string, string, string, float, floatShape
connectorfloat, float, float, float, string, string, string, string, string, float, string, float, float, floatGroup
connectorShape, string, Shape, string, string, string, string, string, string, float, string, float, float, floatGroup
connectorfloat, float, Shape, string, string, string, string, string, string, float, string, float, float, floatGroup
connectorShape, string, float, float, string, string, string, string, string, float, string, float, float, floatGroup
gridfloat, float, float, float, int, int, float, floatGrid
lifelinefloat, float, float, stringGroup
messagefloat, float, float, float, string, bool, stringGroup
activationfloat, float, float, string, stringGroup
self_messagefloat, float, string, stringGroup
group(none)Group
draw_diagram(none)void
clearstringvoid
rectfloat, float, float, float, Paintvoid
rectfloat, float, float, float, stringDrawNode
round_rectfloat, float, float, float, float, float, Paintvoid
ovalfloat, float, float, float, Paintvoid
circlefloat, float, float, Paintvoid
circlefloat, float, float, stringDrawNode
linefloat, float, float, float, Paintvoid
linefloat, float, float, float, string, floatDrawNode
log_axesfloat, float, float, float, float, float, float, float, bool, bool, int, Font, PaintAxes
log_axesfloat, float, float, float, float, float, float, float, int, stringGroup
log_axesfloat, float, float, float, float, float, float, float, bool, bool, int, stringGroup
legendfloat, float, StrList, StrList, Font, Paint, PaintLegend
legendfloat, float, string, string, stringGroup
legendfloat, float, string, string, string, stringGroup
axesfloat, float, float, float, float, float, float, float, int, Font, PaintAxes
axesfloat, float, float, float, float, float, float, float, int, stringGroup
arrowfloat, float, float, float, float, Paintvoid
arrowfloat, float, float, float, string, floatDrawNode
polylineFloatList, Paintvoid
polylinestring, string, floatDrawNode
pathPath, Paintvoid
pathstring, string, string, floatDrawNode
textstring, float, float, Font, Paintvoid
textfloat, float, float, string, stringDrawNode
textfloat, float, float, string, string, floatDrawNode
imageImage, float, floatvoid
imagestring, float, float, float, floatDrawNode
image_rectImage, float, float, float, floatvoid
svgSvg, float, float, float, floatvoid
picturePicture, float, float, float, floatvoid
save(none)void
restore(none)void
translatefloat, floatvoid
scalefloat, floatvoid
rotatefloatvoid
clip_rectfloat, float, float, floatvoid
targetSurfaceCanvas
typefaceTypefaceCanvas
redraw(none)void
snapshot(none)Image
snapshotImageImage
pngstring, int, int, intvoid
ellipsefloat, float, float, float, stringDrawNode
measure_textstring, float, boolfloat
linear_gradientstring, float, float, float, floatGradient
load_svgstring, stringSvgNode
load_svgstring, string, stringSvgNode

Paint

11 method signatures. Comes from: paint.

MethodParametersReturns
colorstringself
alphafloatself
antialiasboolself
fill(none)self
stroke(none)self
stroke_widthfloatself
stroke_capstringself
stroke_joinstringself
gradientfloat, float, float, float, string, stringself
dashfloat, floatself
blurfloatself

Path

9 method signatures. Comes from: path.

MethodParametersReturns
move_tofloat, floatself
line_tofloat, floatself
quad_tofloat, float, float, floatself
cubic_tofloat, float, float, float, float, floatself
close(none)self
rectfloat, float, float, floatself
ovalfloat, float, float, floatself
circlefloat, float, floatself
round_rectfloat, float, float, float, float, floatself

Font

2 method signatures. Comes from: font, Typeface.font.

MethodParametersReturns
boldboolFont
measurestringfloat

Typeface

7 method signatures. Comes from: font_load.

MethodParametersReturns
fontfloatFont
family(none)string
sha256(none)string
source(none)string
has_glyphsstringbool
license(none)string
version(none)string

Gradient

1 method signatures. Comes from: Canvas.linear_gradient.

MethodParametersReturns
stopfloat, stringGradient

DrawNode

3 method signatures. Comes from: Canvas.rect, Canvas.circle, Canvas.line, Canvas.arrow, Canvas.polyline, Canvas.path, Canvas.text, Canvas.image, Canvas.ellipse.

MethodParametersReturns
set_attrstring, stringDrawNode
set_attrsStrMapDrawNode
get_attrsStrListStrMap

Shape

9 method signatures. Comes from: Canvas.box, Canvas.diamond, Canvas.cylinder, Canvas.note, Canvas.cluster, LayoutItem.shape, Grid.cell.

MethodParametersReturns
fillstringShape
strokestringShape
stroke_widthfloatShape
radiusfloatShape
labelstringShape
set_attrstring, stringShape
set_attrsStrMapShape
cx(none)float
cy(none)float

Group

4 method signatures. Comes from: Canvas.connector, Canvas.lifeline, Canvas.message, Canvas.activation, Canvas.self_message, Canvas.group, Canvas.log_axes, Canvas.legend, Canvas.axes.

MethodParametersReturns
addGroupGroup
addDrawNodeGroup
set_attrstring, stringGroup
set_attrsStrMapGroup

Grid

1 method signatures. Comes from: Canvas.grid.

MethodParametersReturns
cellint, intShape

Text

4 method signatures. Comes from: LayoutItem.text.

MethodParametersReturns
colorstringText
sizefloatText
boldboolText
alignstringText

ImageView

1 method signatures. Comes from: LayoutItem.image.

MethodParametersReturns
fitstringImageView

Keyframes

3 method signatures. Comes from: keyframes.

MethodParametersReturns
len(none)int
atintKeyframe
addfloat, float, stringKeyframes

Keyframe

3 method signatures. Comes from: Keyframes.at.

MethodParametersReturns
x(none)float
y(none)float
color(none)string

Plot

23 method signatures. Comes from: Canvas.plot, LayoutItem.plot.

MethodParametersReturns
titlestringPlot
xlabelstringPlot
ylabelstringPlot
y2labelstringPlot
x_rangefloat, floatPlot
y_rangefloat, floatPlot
y2_rangefloat, floatPlot
x_scalestringPlot
y_scalestringPlot
legendstringPlot
gridboolPlot
backgroundstringPlot
heatmapstring, int, intHeatmap
quiverstringVectorField
x_symlogfloatPlot
y_symlogfloatPlot
x_datestringPlot
insetfloat, float, float, floatPlot
seriesstring, string, stringSeries
annotatefloat, float, string, stringPlot
vlinefloat, string, floatPlot
hlinefloat, string, floatPlot
draw(none)Plot

Series

14 method signatures. Comes from: Plot.series.

MethodParametersReturns
addfloat, floatSeries
add_errorfloat, float, float, floatSeries
clear(none)Series
axisstringSeries
colorstringSeries
widthfloatSeries
dashstringSeries
markerstringSeries
add_bandfloat, float, floatSeries
histogramintSeries
boxfloat, float, float, float, floatSeries
stackstringSeries
groupstringSeries
donutfloatSeries

Heatmap

8 method signatures. Comes from: Plot.heatmap.

MethodParametersReturns
cellint, int, floatHeatmap
palettestringHeatmap
rangefloat, floatHeatmap
colorbarboolHeatmap
labelsboolHeatmap
contoursint, string, floatHeatmap
clear(none)Heatmap
draw(none)Heatmap

VectorField

6 method signatures. Comes from: Plot.quiver.

MethodParametersReturns
addfloat, float, float, floatVectorField
colorstringVectorField
scalefloatVectorField
streamlinesboolVectorField
clear(none)VectorField
draw(none)VectorField

Legend

3 method signatures. Comes from: Canvas.legend.

MethodParametersReturns
width(none)float
height(none)float
draw(none)Legend

Axes

3 method signatures. Comes from: Canvas.log_axes, Canvas.axes.

MethodParametersReturns
xfloatfloat
yfloatfloat
draw(none)Axes

Panel

18 method signatures. Comes from: Canvas.panel, LayoutItem.panel.

MethodParametersReturns
managerstringPanel
paddingfloat, float, float, floatPanel
gapfloatPanel
backgroundstringPanel
edgestring, floatPanel
alignstring, stringPanel
min_sizefloat, floatPanel
max_sizefloat, floatPanel
columnsintPanel
row_weightint, floatPanel
column_weightint, floatPanel
add_panel(none)LayoutItem
add_plot(none)LayoutItem
add_textstringLayoutItem
add_shapestringLayoutItem
add_imageImageLayoutItem
add_glue(none)LayoutItem
draw(none)Panel

LayoutItem

16 method signatures. Comes from: Panel.add_panel, Panel.add_plot, Panel.add_text, Panel.add_shape, Panel.add_image, Panel.add_glue.

MethodParametersReturns
panel(none)Panel
plot(none)Plot
text(none)Text
shape(none)Shape
image(none)ImageView
packstring, string, boolLayoutItem
fillstringLayoutItem
gridint, int, int, intLayoutItem
borderstringLayoutItem
placefloat, float, float, floatLayoutItem
preferred_sizefloat, floatLayoutItem
min_sizefloat, floatLayoutItem
max_sizefloat, floatLayoutItem
weightfloatLayoutItem
stickystringLayoutItem
alignstring, stringLayoutItem

Image

55 method signatures. Comes from: image_panel, image_hald, image_pattern, image_bytes, image_rgba, image_create, image_file, PhysicsPresentation.render, Texture.image, Scene3D.render_camera, Scene3D.render_image, Scene3D.render_depth_image, Scene3D.render_normal_image, Layout.render, and 4 more.

MethodParametersReturns
width(none)int
height(none)int
rgba(none)string
encode_png(none)string
copy(none)Image
pixelint, int, intfloat
set_pixelint, int, float, float, float, floatImage
savestringvoid
resizeint, intImage
resizeint, int, stringImage
cropint, int, int, intImage
flipboolImage
rotatefloatImage
rotatefloat, float, float, float, floatImage
levelsfloat, float, floatImage
curvesCurveImage
curves_rgbCurve, Curve, CurveImage
hslfloat, float, floatImage
channelmixfloat, float, float, float, float, float, float, float, floatImage
grayscale(none)Image
sepiafloatImage
rectfloat, float, float, float, float, float, float, floatImage
circlefloat, float, float, float, float, float, floatImage
linefloat, float, float, float, float, float, float, float, floatImage
textfloat, float, string, float, float, float, float, floatImage
textfloat, float, string, Font, PaintImage
blurfloat, floatImage
sharpenfloat, floatImage
edgesfloatImage
unsharpfloat, float, float, floatImage
vignettefloat, floatImage
tilt_shiftfloat, float, floatImage
blendImage, string, float, int, intImage
maskImageImage
selectionint, int, int, intImage
meanintfloat
stddevintfloat
minintfloat
maxintfloat
psnrImagefloat
ssimImagefloat
histogram_csv(none)string
histogramstringvoid
clutImageImage
colormapstringImage
thresholdfloatImage
invert(none)Image
normalize(none)Image
equalize(none)Image
morphologystring, intImage
perspectivefloat, float, float, float, float, float, float, floatImage
lensfloatImage
healint, int, int, int, intImage
encodestringstring
fonts(none)string

Curve

1 method signatures. Comes from: image_curve.

MethodParametersReturns
pointfloat, floatCurve

Layout

7 method signatures. Comes from: layout_sheet, layout_create.

MethodParametersReturns
addImage, string, float, int, intLayout
addImageLayout
maskedImage, Image, string, float, int, intLayout
clear(none)Layout
render(none)Image
renderImageImage
renderint, int, float, float, float, floatImage

Timeline

7 method signatures. Comes from: timeline_create.

MethodParametersReturns
addImage, intTimeline
size(none)int
delayintint
frameintImage
duration(none)float
encode_gif(none)string
savestringvoid

FrameCache

5 method signatures. Comes from: frame_cache.

MethodParametersReturns
renderScene3D, int, int, intImage
renderScene3D, int, int, int, ImageImage
hits(none)int
misses(none)int
last_hit(none)bool

Svg

4 method signatures. Comes from: svg, svg_file, TemplateSvg.render.

MethodParametersReturns
root(none)SvgNode
nodestringSvgNode
width(none)float
height(none)float

SvgNode

2 method signatures. Comes from: Svg.root, Svg.node, Canvas.load_svg.

MethodParametersReturns
set_attrstring, stringSvgNode
set_attrsStrMapSvgNode

TemplateSvg

1 method signatures. Comes from: template_svg.

MethodParametersReturns
renderfloat, float, stringSvg

Surface

5 method signatures. Comes from: surface.

MethodParametersReturns
canvas(none)Canvas
image(none)Image
pngstringvoid
svgstringvoid
pdfstringvoid

Document

2 method signatures. Comes from: document.

MethodParametersReturns
canvas(none)Canvas
finish(none)Picture

Picture

7 method signatures. Comes from: picture_file, Document.finish.

MethodParametersReturns
width(none)int
height(none)int
drawCanvas, float, float, float, floatvoid
pngstring, intvoid
svgstringvoid
pdfstringvoid
skpstringvoid

PdfDocument

3 method signatures. Comes from: pdf_document.

MethodParametersReturns
add_pagePicturePdfDocument
pages(none)int
writestringvoid

Scene3D

44 method signatures. Comes from: scene3d, scene_job.

MethodParametersReturns
environmentEnvironment, float, float, boolScene3D
tonemapstring, floatScene3D
shadowsint, float, float, intScene3D
shadow_lightintScene3D
shadows_off(none)Scene3D
addMesh3D, stringNode3D
addMesh3D, MaterialNode3D
add_hairHairCurves, MaterialNode3D
group(none)Node3D
cameraCamera3DScene3D
backgroundstringScene3D
ambientfloatScene3D
timefloatScene3D
clear(none)Scene3D
clip_planefloat, float, float, floatScene3D
clear_clip(none)Scene3D
render_cameraCamera3D, int, intImage
directional_lightfloat, float, float, string, floatScene3D
point_lightfloat, float, float, string, float, floatScene3D
spot_lightfloat, float, float, float, float, float, string, float, float, floatScene3D
add_instancesMesh3D, stringInstancedNode3D
add_instancesMesh3D, MaterialInstancedNode3D
render_imageint, intImage
render_imageint, int, intImage
render_imageint, int, ImageImage
render_imageint, int, stringImage
render_imageint, int, string, int, int, int, boolImage
render_depth_imageint, intImage
render_normal_imageint, intImage
pointsPointCloudScene3D
clear_points(none)Scene3D
projectionint, intProjection
projectionCamera3D, int, intProjection
projectionint, int, ProjectionProjection
export_gltfstring, boolvoid
sky_hosekfloat, float, float, float, float, boolScene3D
clear_environment(none)Scene3D
import_objstring, floatNode3D
import_gltfstring, floatNode3D
save_jobstring, int, int, intvoid
save_jobstring, int, int, string, int, int, int, boolvoid
area_lightfloat, float, float, float, float, float, float, float, string, float, floatScene3D
light_causticsint, boolScene3D
threadsintScene3D

Camera3D

6 method signatures. Comes from: camera3d.

MethodParametersReturns
look_atfloat, float, float, float, float, floatCamera3D
upfloat, float, floatCamera3D
perspectivefloat, float, floatCamera3D
orthofloat, float, floatCamera3D
lensfloat, floatCamera3D
doffloat, float, intCamera3D

Node3D

15 method signatures. Comes from: PhysicsBody.sync, PhysicsPose.sync, Scene3D.add, Scene3D.add_hair, Scene3D.group, Scene3D.import_obj, Scene3D.import_gltf.

MethodParametersReturns
materialMaterialNode3D
cast_shadowboolNode3D
receive_shadowboolNode3D
cast_causticsboolNode3D
receive_causticsboolNode3D
parentNode3DNode3D
visibleboolNode3D
unlitboolNode3D
cullboolNode3D
colorstringNode3D
keyframefloat, float, float, float, float, float, float, float, float, floatNode3D
positionfloat, float, floatNode3D
rotationfloat, float, floatNode3D
scalefloat, float, floatNode3D
id(none)string

InstancedNode3D

4 method signatures. Comes from: Scene3D.add_instances.

MethodParametersReturns
scatter_on_meshMesh3D, int, int, bool, floatInstancedNode3D
add_instancefloat, float, float, float, float, float, float, float, float, stringInstancedNode3D
size(none)int
set_instanceint, float, float, float, float, float, float, float, float, floatInstancedNode3D

Mesh3D

13 method signatures. Comes from: mesh_text, mesh_text_bevel, mesh_triangles, mesh_load, mesh_box, mesh_plane, mesh_sphere, mesh_cylinder, mesh_cone, mesh_torus, mesh_lathe, mesh_lathe_closed, mesh_tube_spline, mesh_extrude, and 2 more.

MethodParametersReturns
copy(none)Mesh3D
geometry_hash(none)string
replaceMesh3DMesh3D
revision(none)int
boundintfloat
savestringvoid
vertices(none)int
triangles(none)int
positionsstringMesh3D
uvsstringMesh3D
colorsstringMesh3D
set_vertex_scalarsstring, string, float, floatMesh3D
fonts(none)string

HairCurves

Opaque handle with no methods. Comes from: hair_curves.

PointCloud

4 method signatures. Comes from: point_cloud.

MethodParametersReturns
addfloat, float, float, float, string, float, boolPointCloud
setint, float, float, float, float, string, float, boolPointCloud
size(none)int
clear(none)PointCloud

Projection

1 method signatures. Comes from: Scene3D.projection.

MethodParametersReturns
atfloat, float, floatAnchor3D

Anchor3D

5 method signatures. Comes from: Projection.at.

MethodParametersReturns
x(none)float
y(none)float
depth(none)float
visible(none)bool
occluded(none)bool

Material

28 method signatures. Comes from: material, material_source, material_file, material_load, material_compile.

MethodParametersReturns
copy(none)Material
base_colorstringMaterial
emissivestring, floatMaterial
alphastring, floatMaterial
double_sidedboolMaterial
thin_walledboolMaterial
volume_absorptionstring, floatMaterial
density_gridint, int, int, stringMaterial
volume_scatteringfloat, float, stringMaterial
subsurfacefloat, float, float, floatMaterial
clearcoatfloat, floatMaterial
anisotropyfloat, floatMaterial
hairfloat, float, float, stringMaterial
heightImage, float, boolMaterial
savestringvoid
metallicfloatMaterial
roughnessfloatMaterial
occlusionfloatMaterial
opacityfloatMaterial
normal_scalefloatMaterial
transmissionfloatMaterial
iorfloatMaterial
albedoTextureMaterial
ormTextureMaterial
normalTextureMaterial
emissionTextureMaterial
wireframestring, floatMaterial
wireframe_off(none)Material

Texture

9 method signatures. Comes from: texture_from_image, texture_file, TextureGraph.bake.

MethodParametersReturns
levels(none)int
imageintImage
samplefloat, float, float, intfloat
wrapstring, stringTexture
filterstringTexture
rotatefloatTexture
repeatfloat, floatTexture
offsetfloat, floatTexture
fonts(none)string

TextureGraph

6 method signatures. Comes from: texture_constant, texture_noise, texture_graph_image, texture_checker, texture_gradient, texture_bricks, texture_stripes, texture_ramp, texture_radial.

MethodParametersReturns
invert(none)TextureGraph
bakeint, int, stringTexture
amountfloatTextureGraph
addTextureGraph, floatTextureGraph
multiplyTextureGraph, floatTextureGraph
mixTextureGraph, floatTextureGraph

Environment

Opaque handle with no methods. Comes from: environment_image, environment_file, environment_linear.

PhysicsWorld

11 method signatures. Comes from: physics_world.

MethodParametersReturns
gravityfloat, float, floatPhysicsWorld
planarboolPhysicsWorld
boxfloat, float, float, float, float, float, float, PhysicsMaterialPhysicsBody
spherefloat, float, float, float, float, PhysicsMaterialPhysicsBody
stepintPhysicsWorld
time(none)float
timestep(none)float
body_count(none)int
bodyintPhysicsBody
randomfloat, floatfloat
bakeint, intPhysicsTake

PhysicsMaterial

2 method signatures. Comes from: physics_material.

MethodParametersReturns
friction(none)float
restitution(none)float

PhysicsBody

19 method signatures. Comes from: PhysicsWorld.box, PhysicsWorld.sphere, PhysicsWorld.body.

MethodParametersReturns
x(none)float
y(none)float
z(none)float
qx(none)float
qy(none)float
qz(none)float
qw(none)float
vx(none)float
vy(none)float
vz(none)float
id(none)int
sleeping(none)bool
pose(none)PhysicsPose
syncNode3DNode3D
positionfloat, float, floatPhysicsBody
rotationfloat, float, floatPhysicsBody
velocityfloat, float, floatPhysicsBody
angular_velocityfloat, float, floatPhysicsBody
impulsefloat, float, floatPhysicsBody

PhysicsPose

11 method signatures. Comes from: PhysicsBody.pose, PhysicsTake.pose.

MethodParametersReturns
x(none)float
y(none)float
z(none)float
qx(none)float
qy(none)float
qz(none)float
qw(none)float
vx(none)float
vy(none)float
vz(none)float
syncNode3DNode3D

PhysicsTake

3 method signatures. Comes from: PhysicsWorld.bake.

MethodParametersReturns
frames(none)int
body_count(none)int
posefloat, intPhysicsPose

PhysicsPresentation

9 method signatures. Comes from: physics_presentation.

MethodParametersReturns
titlestring, float, float, stringPhysicsPresentation
barstring, float, float, float, float, stringPhysicsPresentation
bulletstring, float, float, stringPhysicsPresentation
kpistring, int, float, float, stringPhysicsPresentation
stepintPhysicsPresentation
tumble(none)PhysicsPresentation
assemble(none)PhysicsPresentation
render(none)Image
body_count(none)int

String values and argument orders stated by the repository

The schema types many options as plain string, so it defines no enums. The values below are the ones that appear in the repository documentation and runnable examples; other values may exist but are not listed because they could not be confirmed from public material.

WhereValues or argument order
ColorsHex strings such as #1e3c72. mix(color, color, t) blends two of them.
Plot.series(name, kind, color)Kinds used in the examples: line, bar, scatter, area, stacked_bar, grouped_bar, errorbar, step, histogram, donut, box.
Series.marker, Series.dashcircle; dashed.
Plot.legendnone hides the legend.
Plot.x_scalelog.
Heatmap.palette, Image.colormapviridis, magma, coolwarm; viridis.
Panel.managergrid, border, place, pack.
LayoutItem.fill, LayoutItem.stickyboth, none; nsew.
Paint.stroke_cap, Paint.stroke_joinround.
Image.blend modeover, screen. The migration notes say ten blend modes exist.
Image.morphologyerode, dilate, median.
Texture.filter, Texture.wraptrilinear; repeat, repeat.
Scene3D.tonemapaces.
Renderer namesraster and cycles, for Scene3D.render_image, Scene3D.save_job, render_available and the render-job commands.
Scene3D.render_image(width, height, renderer, samples, bounces, seed, denoise)The seven argument overload: renderer name, path tracing samples, maximum bounces, repeatable seed, denoise switch.
Scene3D.render_image(width, height, samples)Raster render; the migration notes map 2 by 2 supersampling to samples 2.
Scene3D.directional_light(x, y, z, color, intensity)The vector points toward the light source.
Camera3D.perspective(fov, near, far)Vertical field of view in degrees.
Node3D.position, rotation, scaleSet semantics; rotation in degrees.
mesh_planeLies in the XZ plane facing +Y.
physics_world(timestep, seed)Fixed step in seconds and a seed, for example 1.0 / 120.0 and 42.
physics_material(friction, restitution)Both in the range 0 to 1.
PhysicsWorld.boxFull width, height, depth, position x, y, z, mass, material. Mass zero is static.
PhysicsWorld.sphereRadius, position x, y, z, mass, material.
PhysicsWorld.bake(frames, stride)2 to 512 samples, stride 1 to 1000.
PhysicsTake.pose(t, body_id)t from 0 to 1; interpolated position and normalized quaternion.
physics_presentation(width, height, seed)Authoring coordinates are top left pixels.
PhysicsPresentation.title(text, x, y, color)One rigid tile per printable ASCII character.
PhysicsPresentation.bar(label, value, maximum, x, y, color)Twenty normalized bins, rounded to nearest.
PhysicsPresentation.kpi(label, count, x, y, color)Exactly 0 to 64 grains.

Built in block functions

Besides the host and standard functions, the block language itself supplies these numeric and conversion built-ins, as listed by the compiler diagnostic for an undefined name: float, str, sin, cos, sqrt, abs, floor, pow, min, max, clamp, lerp, ease, ease_in, ease_out, int. Loops in the examples use for with range(start, end).

Physics limits

LimitValue
Bodies per world2048
Simultaneous worlds4
Fixed updates per world1,000,000
Updates per step call10,000
Updates per bake10,000
Stored body poses per bake262,144
Stored body poses across all retained takes524,288
Body shapesBoxes and spheres. Capsules, convex hulls and joints are not exposed.

Standard library in v0.1.124: lmcode_std_v3, 206 signatures

The lmvideo release pins the standard catalog by hash in toolchain.lock.json (std_sha256 1defd1be67bf11cf1780f7d890059cd2ac6fd506a7b7fa578e31b5ef124aa221). That hash is the 206 signature edition of lmcode_std_v3: 83 function signatures and 123 methods on 16 container and Json types. All of them appear in lmvideo --lmcode-signatures and are callable in a block without any import.

Standard function groups

GroupSignaturesFunction names
Strings21str_base64_decode, str_base64_encode, str_contains, str_ends_with, str_find, str_hex_decode, str_hex_encode, str_is_float, str_is_int, str_len, str_lower, str_match, str_repeat, str_replace, str_split, str_starts_with, str_substr, str_to_float, str_to_int, str_trim, str_upper
Math16math_abs, math_ceil, math_floor, math_max, math_min, math_pow, math_round, math_sqrt
Files5file_append, file_exists, file_lines, file_read, file_write
JSON and templates2json_parse, template_render
Result envelope24lmcode_return_null, lmcode_return_put, lmcode_return_put_null, lmcode_return_set
Container constructors15float_list, float_map, float_pq, float_queue, float_stack, int_list, int_map, int_pq, int_queue, int_stack, str_list, str_map, str_pq, str_queue, str_stack

Standard functions

FunctionParametersReturns
file_appendstring, stringvoid
file_existsstringbool
file_linesstringStrList
file_readstringstring
file_writestring, stringvoid
float_list(none)FloatList
float_map(none)FloatMap
float_pq(none)FloatPQ
float_queue(none)FloatQueue
float_stack(none)FloatStack
int_list(none)IntList
int_map(none)IntMap
int_pq(none)IntPQ
int_queue(none)IntQueue
int_stack(none)IntStack
json_parsestringJson
lmcode_return_null(none)void
lmcode_return_putstring, boolvoid
lmcode_return_putstring, floatvoid
lmcode_return_putstring, FloatListvoid
lmcode_return_putstring, FloatMapvoid
lmcode_return_putstring, intvoid
lmcode_return_putstring, IntListvoid
lmcode_return_putstring, IntMapvoid
lmcode_return_putstring, Jsonvoid
lmcode_return_putstring, StrListvoid
lmcode_return_putstring, StrMapvoid
lmcode_return_putstring, stringvoid
lmcode_return_put_nullstringvoid
lmcode_return_setboolvoid
lmcode_return_setfloatvoid
lmcode_return_setFloatListvoid
lmcode_return_setFloatMapvoid
lmcode_return_setintvoid
lmcode_return_setIntListvoid
lmcode_return_setIntMapvoid
lmcode_return_setJsonvoid
lmcode_return_setStrListvoid
lmcode_return_setStrMapvoid
lmcode_return_setstringvoid
math_absintint
math_absfloatfloat
math_ceilintint
math_ceilfloatfloat
math_floorintint
math_floorfloatfloat
math_maxint, intint
math_maxfloat, floatfloat
math_minint, intint
math_minfloat, floatfloat
math_powint, intint
math_powfloat, floatfloat
math_roundintint
math_roundfloatfloat
math_sqrtintint
math_sqrtfloatfloat
str_base64_decodestringstring
str_base64_encodestringstring
str_containsstring, stringbool
str_ends_withstring, stringbool
str_findstring, stringint
str_hex_decodestringstring
str_hex_encodestringstring
str_is_floatstringbool
str_is_intstringbool
str_lenstringint
str_list(none)StrList
str_lowerstringstring
str_map(none)StrMap
str_matchstring, stringbool
str_pq(none)StrPQ
str_queue(none)StrQueue
str_repeatstring, intstring
str_replacestring, string, stringstring
str_splitstring, stringStrList
str_stack(none)StrStack
str_starts_withstring, stringbool
str_substrstring, int, intstring
str_to_floatstringfloat
str_to_intstringint
str_trimstringstring
str_upperstringstring
template_renderstring, Jsonstring

Standard types

TypeMethod signaturesMethods
FloatList7add, at, clear, contains, index_of, len, set
FloatMap10len, has, get, get_or, set, key_at, remove, clear, keys, values
FloatPQ6push, pop, peek, len, empty, clear
FloatQueue7push, pop, peek, len, empty, clear, at
FloatStack7push, pop, peek, len, empty, clear, at
IntList7add, at, clear, contains, index_of, len, set
IntMap10len, has, get, get_or, set, key_at, remove, clear, keys, values
IntPQ6push, pop, peek, len, empty, clear
IntQueue7push, pop, peek, len, empty, clear, at
IntStack7push, pop, peek, len, empty, clear, at
Json11kind, len, at, get, has, keys, as_string, as_int, as_float, as_bool, to_json
StrList8add, at, clear, contains, index_of, join, len, set
StrMap10clear, get, get_or, has, key_at, len, remove, set, keys, values
StrPQ6push, pop, peek, len, empty, clear
StrQueue7push, pop, peek, len, empty, clear, at
StrStack7push, pop, peek, len, empty, clear, at

The Json type is also the block result type: the schema declares result as nullable Json.

Standard REST and CLI interfaces: not in v0.1.124

The current lmcode_std_v3 catalog has 226 canonical signatures. The 20 added signatures are the former lmcode_std_rest_v1 module: 5 functions and 15 RestExchange methods, together with 10 standard interfaces. lmvideo v0.1.124 was built against the 206 signature catalog, so none of the names in this section exist in that release: its signature list contains no rest_ function and no RestExchange type. A recent compiler (checked with lmscript 0.2.482) still accepts the names at compile time because it knows the newer catalog, but the v0.1.124 host refuses the program when it loads it, with code LOAD_UNBOUND, as shown below. lmvideo picks the 226 signature catalog up when a later release is built against it. The tables are provided so that a reader knows what will and will not resolve today.

prog = _lmcode_ cli="lmvideo" install="github:lmctl-ai/lmvideo@v0.1.124";
rest_stop();
end _lmcode_
r = run_lmcode(prog);
println(json_stringify(r));
{"ok":false,"phase":"load","code":"LOAD_UNBOUND","message":"import 'fn rest_stop() -> void' is not provided by the host"}

Standard interfaces (current catalog only)

InterfaceHandler parametersReturnsIn lmvideo v0.1.124
RestGetexchange: RestExchangevoidNo
RestPostexchange: RestExchangevoidNo
RestPutexchange: RestExchangevoidNo
RestDeleteexchange: RestExchangevoidNo
RestPatchexchange: RestExchangevoidNo
RestHeadexchange: RestExchangevoidNo
RestOptionsexchange: RestExchangevoidNo
RestHandlerexchange: RestExchangevoidNo
CliCommandexchange: RestExchangevoidNo
CliOptionexchange: RestExchangevoidNo

REST and CLI functions (current catalog only)

FunctionParametersReturnsIn lmvideo v0.1.124
rest_configstring, stringvoidNo
rest_routestring, string, stringvoidNo
rest_serve(none)voidNo
rest_stop(none)voidNo
rest_cliStrListstringNo

Route templates in the current catalog accept {param} and {rest...} as well as :param and :rest... placeholders. rest_cli takes an argument list and is the stateless CLI mode that dispatches options, commands and REST routes.

RestExchange methods (current catalog only)

MethodParametersReturnsIn lmvideo v0.1.124
method(none)stringNo
path(none)stringNo
querystringstringNo
has_querystringboolNo
paramstringstringNo
headerstringstringNo
has_headerstringboolNo
body(none)stringNo
statusintvoidNo
set_headerstring, stringvoidNo
sendstringvoidNo
jsonstringvoidNo
getstringstringNo
setstring, stringvoidNo
incrementstringintNo

See also