Get Worker Script Template
get_worker_templateRetrieves the worker script contract, starter source, and reference worker path needed to build a custom worker for render_video. Use it to obtain the required template before writing your own worker code.
Instructions
Get the worker script contract required by render_video, plus the full source of the bundled starter worker (a small file where only renderFrame() needs editing) and the path of the larger reference worker. Use this before authoring a custom worker: copy starterSource to a new file, replace renderFrame(), and pass that file as worker_script. Either templatePath (test scene) or starterPath (gradient) can be passed directly as render_video's worker_script to render without writing code. Read-only: returns documentation and source text, touches nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | Messages the worker must post to parentPort, their fields, and when to send them | |
| workerData | Yes | Fields injected into the worker via worker_threads workerData, mapped to their meaning | |
| starterPath | Yes | Absolute path of the bundled starter worker (edit renderFrame only); usable directly as render_video worker_script | |
| templatePath | Yes | Absolute path of the bundled reference worker (particle test scene); usable directly as render_video worker_script | |
| starterSource | Yes | Full source code of the starter worker; copy it, replace renderFrame(), save as your worker_script | |
| templateSource | Yes | Full source code of the bundled reference worker |