Exposed Headless Scripting Functionality

Headless scripting is an experimental feature.

Headless scripting is a Pro feature, and only available with KeyShot 9.3 or newer.

This page describes the various functions, classes, and constants exposed when running KeyShot in headless mode.
Note that only a subset of the scripting functionality in KeyShot can currently be used through headless scripting.

Headless Usage

keyshot -headless [options] [scene path] -script <script path> [script arguments]

Options

-xlic <external license folder>

-floating_license_server <FlexLM server>
Note that the server must be preceeded with "@" when default port is used and "port@" if not.

-floating_feature <FlexLM feature> (<NR cores>)
Accepted FlexLM features:

  • keyshot2 (Pro)

  • keyshot_enterprise

  • keyshot_network_rendering (NR, checks out all cores if <NR cores> is not specified)

-generateconfig [no cloud] [no auto-update] [FlexLM server] [FlexLM feature]
Generates a config file in the KeyShot resource folder. Unrelated to headless: KeyShot Cloud is disabled if [no cloud] is '1', and auto-update checking is disabled if [no auto-update] is '1'.

-progress
Writes rendering progress on stdout, e.g. 'Rendering: xxx.x%'.

Locally configured node-locked or floating licenses in the settings file will automatically be used if no arguments are given to override them.

This can be found by entering keyshot -help -headless

Headless scripting documentation

Below is a list of the functions, classes and constants that are available in headless mode.
The full documentation for these, can be found as part of the KeyShot Scripting Documentation, here.

Functions

  • lux.getAnimationFrame()

  • lux.setAnimationFrame()

  • lux.getRenderEngine()

  • lux.getRenderOptions()

  • lux.isHeadless()

  • lux.openFile()

  • lux.renderImage()

  • lux.sync()

Classes

  • lux.RenderOptions

Constants

  • lux.RENDER_ENGINE_INTERIOR

  • lux.RENDER_ENGINE_INTERIOR_GPU

  • lux.RENDER_ENGINE_PRODUCT

  • lux.RENDER_ENGINE_PRODUCT_GPU

  • lux.RENDER_MODE_ADVANCED

  • lux.RENDER_MODE_SAMPLES

  • lux.RENDER_MODE_TIME

  • lux.RENDER_OUTPUT_EXR

  • lux.RENDER_OUTPUT_JPEG

  • lux.RENDER_OUTPUT_PNG

  • lux.RENDER_OUTPUT_PSD16

  • lux.RENDER_OUTPUT_PSD32

  • lux.RENDER_OUTPUT_PSD8

  • lux.RENDER_OUTPUT_TIFF32

  • lux.RENDER_OUTPUT_TIFF8