KeyShot Studio
Scripting
Articles in this section
Headless Scripting
Headless scripting is a Pro feature, and only available with KeyShot Studio 9.3 or newer.
Scripting
Quick Start Scripting
There are three ways of using scripting:
Scripting
Scripting
Scripting (Pro feature) allows you to unleash the power of KeyShot Studio for automation, batch processing, and more.
Scripting
Scripting Console
KeyShot Studio scripting uses Python 3.13.
Scripting
Scripting Examples
In this page you will find KeyShot Studio’s predefined scripts and instructions on how to use them. These scripts are listed under the Scripts tab inside the Scripting window.
Scripting
Scripting: Accessing Scene Nodes
The elements of the scene can be accessed via lux.getSceneTree() with each scene tree node being of the type lux.SceneNode. It is useful because for each node you can hide/show, lock/unlock, select/deselect, change material, apply transformations, duplicate, move and more. Try help(lux.SceneNode) for more information.
Scripting
Scripting: Camera Manipulation
Working with cameras in scripting is just like using the Camera tab in Project → Camera: You can create a camera, manipulate it to suit your needs, and save it.
Scripting
Scripting: Canceling Scripts
In general you can’t cancel a script but certain operations can, such as importing a file or rendering an image, animation or XR. Canceling in those situations means to cancel the dialog associated, like the rendering output window or import progress dialog.
Scripting
Scripting: Custom Input Dialog
In scripts it is especially preferable to show a single dialog when multiple inputs are needed. For this you can use lux.getInputDialog(). The scripts provided by KeyShot will use this.
Scripting
Scripting: Import File
Importing models with scripting is easy:
Scripting
Scripting: Material Graph
Manipulating the Material Graph via Scripting is an advanced feature that has been added in KeyShot 11.
Scripting
Scripting: Render Image
Assuming you have already loaded a BIP file, or imported some geometry, and you want to render to an image with scripting then do the following:
Scripting
Scripting: Transforming Scene Nodes
Nodes can be translated, scaled, rotated etc. via scripting. It is possible by using 4×4 transformation matrices of type luxmath.Matrix. There are two ways to transform: relative or absolute. A relative transform means to apply the transform locally, i.e. it is multiplied last in the chain of existing transforms. Th...
Scripting