On this page
Warning
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
For headless usage on mac use the following executable:
keyshot -headless [options] [scene path] -script <script path> [script arguments]
This executable is also still in use on Windows for backwards compatibility.
For stdin (standard input) and stdout (standard output) on Windows use new KeyShot headless executable:
keyshot_headless -headless [options] [scene path] -script <script path> [script arguments]
You can for example use the stdout to output the script to a file by using the redirect operator “>” or “>>”.
The executable would then look like this:keyshot_headless -headless -script <script path> [script arguments] > logfile.txt
Options
You can open the options by entering keyshot -help -headless
This will show you the following in your terminal:
-xlic <external license folder>
-floating_license_server <FlexLM server>
Note
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.
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.applyMaterialMapping()
- lux.clearGeometry()
- lux.deleteMaterial()
- lux.enablePerformanceMode()
- lux.encodeVideo()
- lux.exportFile()
- lux.getAnimationFrame()
- lux.getAnimationInfo()
- lux.getAnimationTime()
- lux.getCamera()
- lux.getCameraDirection()
- lux.getCameraDistance()
- lux.getCameraLookAt()
- lux.getCameraPosition()
- lux.getCameraUp()
- lux.getCameras()
- lux.getExternalFiles()
- lux.getKeyShotVersion()
- lux.getLibraryBackplates()
- lux.getLibraryEnvironments()
- lux.getLibraryMaterials()
- lux.getLibraryTextures()
- lux.getMaterialMapping()
- lux.getMaterialTemplates()
- lux.getMetaData()
- lux.getModelSets()
- lux.getOS()
- lux.getObjectMaterial()
- lux.getObjects()
- lux.getRenderEngine()
- lux.getRenderLayers()
- lux.getRenderOptions()
- lux.getSceneInfo()
- lux.getSceneTree()
- lux.getSphericalCamera()
- lux.hasContents()
- lux.importMaterials()
- lux.isCameraUnsaved()
- lux.isHeadless()
- lux.isPaused()
- lux.isPerformanceModeEnabled()
- lux.isSceneChanged()
- lux.loadMaterials()
- lux.newCamera()
- lux.newModelSet()
- lux.openFile()
- lux.pause()
- lux.prettyPrint()
- lux.removeCamera()
- lux.removeModelSet()
- lux.renderImage()
- lux.saveCamera()
- lux.setAnimationFrame()
- lux.setAnimationTime()
- lux.setCamera()
- lux.setCameraDirection()
- lux.setCameraDistance()
- lux.setCameraLookAt()
- lux.setCameraPosition()
- lux.setCameraUp()
- lux.setMaterialTemplate()
- lux.setModelSets()
- lux.setObjectMaterial()
- lux.setRenderEngine()
- lux.setSphericalCamera()
- lux.setStandardView()
- lux.sync()
- lux.unpause()
Classes
- lux.RenderOptions
- lux.SceneNode
- luxmath.Matrix
- luxmath.Vector
Constants
- lux.EXPORT_3MF
- lux.EXPORT_BAKING
- lux.EXPORT_FBX
- lux.EXPORT_GLTF
- lux.EXPORT_OBJ
- lux.EXPORT_OUTPUT_GEOMETRY_SHADERS
- lux.EXPORT_OUTPUT_TEXTURES
- lux.EXPORT_SINGLE_COLOR
- lux.EXPORT_STL
- lux.EXPORT_SUB_DIV_ADAPTIVE
- lux.EXPORT_SUB_DIV_EDGE_LENGTH
- lux.EXPORT_SUB_DIV_NORMAL
- lux.EXPORT_SUB_DIV_POLYCOUNT
- lux.EXPORT_USD
- lux.EXPORT_VERTEX_COLOR
- lux.NODE_TYPE_ANIMATION
- lux.NODE_TYPE_GROUP
- lux.NODE_TYPE_MODEL
- lux.NODE_TYPE_MODEL_SET
- lux.NODE_TYPE_OBJECT
- 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