KeyShot 10.2 Scripting Documentation

built-in module lux

lux          index (built-in)
The module contains various classes and functions to use for manipulating the scene and rendering images/animations/XRs/configurations.
  Classes
Env encapsulates environment settings in a clear and consise way. Get an instance of the active environment using lux.getActiveEnvironment().
 

Methods defined here:
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self, /)
Return repr(self).
__str__(self, /)
Return str(self).
getBackgroundColor(...)
Get background color as an RGB tuple.
getBackplateImage(...)
Get backplate image, if set.
getBrightness(...)
Get environment brightness in the form of a float value.
getFlattenGround(...)
Returns whether flattening of the ground is enabled or disabled.
getGroundReflections(...)
Returns whether ground reflections are enabled or disabled.
getGroundShadows(...)
Returns whether ground shadows are enabled or disabled.
getGroundShadowsColor(...)
Get ground shadows color as an RGB tuple.
getGroundSize(...)
Get environment ground size.
getHeight(...)
Get environment height.
getLightingEnvironment(...)
Get the environment image.
getName(...)
Get environment name.
getOcclusionGroundShadows(...)
Returns whether occlusion ground shadows are enabled or disabled.
getRotation(...)
Get environment rotation.
getSize(...)
Get environment size.
setBackgroundColor(...)
Apply RGB color as the background color.
color = RGB color tuple. *
setBackplateImage(...)
Applies backplate image to the scene.
path = Path to the backplate image. *
setBrightness(...)
Set environment brightness.
value = Brightness value to set in the form of a float. *
setFlattenGround(...)
Enable or disable flattening of the ground.
enable = Boolean value for enabling or disabling flattening of the ground. *
setGroundReflections(...)
Enable or disable ground reflections.
enable = Boolean value for enabling or disabling ground reflections. *
setGroundShadows(...)
Enable or disable ground shadows.
enable = Boolean value for enabling or disabling ground shadows. *
setGroundShadowsColor(...)
Apply RGB color as the ground shadows color.
color = RGB color tuple. *
setGroundSize(...)
Set environment ground size.
size = Environment ground size in the form of a number larger than zero (in meters). *
setHeight(...)
Set environment height.
height = Environment height in the form of a float value in [-0.5, 0.5]. *
setLightingEnvironment(...)
Applies an image as the scene's lighting environment. When no path is specified then current lighting environment is used, which is useful when switching from backplate or color background to lighitng environment.
path = Path to the environment image to apply. *
setOcclusionGroundShadows(...)
Enable or disable occlusion ground shadows. It is only possible when ground shadows are enabled.
enable = Boolean value for enabling or disabling occlusion ground shadows. *
setRotation(...)
Set environment rotation.
rotation = Environment rotation in the form of a float value in [0, 360[. *
setSize(...)
Set environment size.
size = Environment size in the form of a number value in meters. *

Static methods defined here:
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
ImageStyle encapsulates image style settings in a clear and consise way. Get an instance of the active image style using lux.getActiveImageStyle().
 

Methods defined here:
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self, /)
Return repr(self).
__str__(self, /)
Return str(self).
getBloom(...)
Returns whether bloom is enabled or disabled for the image style.
getChromaticAberration(...)
Returns whether chromatic aberration is enabled or disabled for the image style.
getColor(...)
Returns whether color is enabled or disabled for the photographic image style.
getCurve(...)
Returns whether curve is enabled or disabled for the photographic image style.
getDenoise(...)
Returns whether denoise is enabled or disabled for the image style.
getKind(...)
Get image style kind. Returns lux.IMAGE_STYLE_BASIC or lux.IMAGE_STYLE_PHOTOGRAPHIC
getName(...)
Get image style name.
getVignette(...)
Returns whether vignette is enabled or disabled for the image style.
setBloom(...)
Enable or disable bloom.
enable = Boolean value for enabling or disabling bloom. *
setChromaticAberration(...)
Enable or disable chromatic aberration.
enable = Boolean value for enabling or disabling chromatic aberration. *
setColor(...)
Enable or disable color for the photographic image style.
enable = Boolean value for enabling or disabling color. *
setCurve(...)
Enable or disable curve for the photographic image style.
enable = Boolean value for enabling or disabling curve. *
setDenoise(...)
Enable or disable denoise.
enable = Boolean value for enabling or disabling denoise. *
setKind(...)
Set image style kind.
kind = Kind of image style: lux.IMAGE_STYLE_BASIC or lux.IMAGE_STYLE_PHOTOGRAPHIC. *
setVignette(...)
Enable or disable vignette.
enable = Boolean value for enabling or disabling vignette. *

Static methods defined here:
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
MultiMaterial encapsulates access and modification in a clear and consise way. Create a new multi-material using lux.createMultiMaterial() by giving a name of an existing material to base it off of. Or retrieve a multi-material instance via lux.getMultiMaterial(). A multi-material can be applied to scene nodes by using its name, just like normal materials.
 

Methods defined here:
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self, /)
Return repr(self).
__str__(self, /)
Return str(self).
getActiveMaterial(...)
Gets the active sub material of the multi-material.
getName(...)
Gets the name of the multi-material.
getSubMaterials(...)
Gets the list of sub materials of the multi-material. The order matters.
setActiveMaterial(...)
Set active sub material of multi-material.
name = Name of sub material to activate. Must be one of the associated sub materia names! *
setName(...)
Set multi-material name.
name = Name of multi-material. *
setSubMaterials(...)
Sets the list of sub materials of the multi-material. The order matters.
mats = The list of materials. *

Static methods defined here:
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
RenderOptions encapsulates render options in a clear and concise way. The options can be persisted as a dictionary using getDict() and fed to RenderOptions(dict=your_dict) when employing it.
 
The rendering mode can be found by the "render_mode" key of the dictionary. It can have three values: lux.RENDER_MODE_ADVANCED, lux.RENDER_MODE_TIME, or lux.RENDER_MODE_SAMPLES.
 
Get an instance of the current render options using lux.getRenderOptions().
 

Methods defined here:
__eq__(self, value, /)
Return self==value.
__ge__(self, value, /)
Return self>=value.
__gt__(self, value, /)
Return self>value.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__le__(self, value, /)
Return self<=value.
__lt__(self, value, /)
Return self<value.
__ne__(self, value, /)
Return self!=value.
__repr__(self, /)
Return repr(self).
__str__(self, /)
Return str(self).
getDict(...)
Get specified options as a dictionary. This can be useful to persist options and then supply to a lux.RenderOptions() constructor when needed to render something. Be wary of the version specified in the dictionary, key values will be converted to the latest version automatically.
setAddToQueue(...)
Instead of rendering immediately then it will be added to the internal KeyShot queue, waiting for processing. Note that a copy of the scene will be saved to disk each time. Call lux.processQueue() to process the queue and render what has been added to it.
add = Whether to add to queue or not. *
setAdvancedRendering(...)
Render in advanced mode with specified samples.
samples = The number of samples. *
setAntiAliasing(...)
Set anti aliasing level.
level = Value from 1 to 8. *
setBackgroundRendering(...)
Render in external background process. Note that a background window will open and the call-site will return immediately!
ext = Whether to render in background or not. *
setCausticsQuality(...)
Set caustics quality.
quality = Value from 0 to 10 (0 will disable it). *
setDofQuality(...)
Set depth-of-field quality.
quality = Value from 1 to 10. *
setGlobalIllumination(...)
Set global illumination quality.
quality = Quality from 0 to 5 (0 will disable it). *
setGlobalIlluminationCache(...)
Set whether or not to use global illumination cache.
enable = Use cache. *
setIndirectBounces(...)
Set the number of indirect bounces.
bounces = The number of indirect bounces. *
setMaxSamplesRendering(...)
Render until max samples is reached.
samples = Maximum samples. *
setMaxTimeRendering(...)
Render the amount of time specified.
time = Time in seconds (floating-point number). *
setOutputAlphaChannel(...)
Set whether to have alpha channel in output image.
enable = Use alpha channel or not. *
setOutputAmbientOcclusionPass(...)
Output ambient occlusion pass separate to the result.
enable = Output ambient occlusion pass. *
setOutputCausticsPass(...)
Output caustics pass separate to the result.
enable = Output caustics pass. *
setOutputClownPass(...)
Output clown pass separate to the result.
enable = Output clown pass. *
setOutputDepthPass(...)
Output depth pass separate to the result.
enable = Output depth pass. *
setOutputDiffusePass(...)
Output diffuse pass separate to the result.
enable = Output diffuse pass. *
setOutputDirectLightingPass(...)
Output direct lighting pass separate to the result.
enable = Output direct lighting pass. *
setOutputIndirectLightingPass(...)
Output indirect lighting pass separate to the result.
enable = Output indirect lighting pass. *
setOutputNormalsPass(...)
Output normals pass separate to the result.
enable = Output normals pass. *
setOutputReflectionPass(...)
Output reflection pass separate to the result.
enable = Output reflection pass. *
setOutputRefractionPass(...)
Output refraction pass separate to the result.
enable = Output refraction pass. *
setOutputRenderLayers(...)
Output render layers separate to the result
enable = Output render layers. *
setOutputShadowPass(...)
Output shadow pass separate to the result.
enable = Output shadow pass. *
setPixelBlur(...)
Set pixel blur.
blur = Value from 1 to 3. *
setRayBounces(...)
Set the number of ray bounces.
bounces = The number of ray bounces. *
setRegion(...)
Set render region to get subset of image.
region = Tuple/list of (start x-axis, start y-axis, end x-axis, end y-axis). Use None to unset a region. *
setSendToNetwork(...)
Instead of rendering locally it can be done using KeyShot Network Rendering.
send = Whether to send to network or not. *
setShadowQuality(...)
Set shadow quality.
quality = Value from 1 to 10. *
setSharpShadows(...)
Set whether to have sharp shadows or not.
enable = Output sharp shadows. *
setSharperTextureFiltering(...)
Set whether or not to preserve detail in textures when viewed at grazing angles.
enable = Output sharper texture filtering. *
setThreads(...)
Set the number of rendering threads. Zero threads means one thread per core.
threads = The number of threads. *

Static methods defined here:
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.

Data and other attributes defined here:
__hash__ = None
SceneNode encapsulates a node in the scene tree and enables for manipulation, such as hiding/showing, locking/unlocking, setting materials etc., and traversal of the tree. It provides a means for searching and accessing groups, objects and animations for global and local operations. Get an instance of the root of the scene tree using lux.getSceneTree().
 

Methods defined here:
__eq__(self, value, /)
Return self==value.
__ge__(self, value, /)
Return self>=value.
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__le__(self, value, /)
Return self<=value.
__lt__(self, value, /)
Return self<value.
__ne__(self, value, /)
Return self!=value.
__repr__(self, /)
Return repr(self).
__str__(self, /)
Return str(self).
applyTransform(...)
Apply a transformation (luxmath.Matrix) to the node and its children.
For example, to scale the node to 1/10 of the size:
  T = luxmath.Matrix().makeIdentity().scale(0.1)
  node.applyTransform(T)
Where 'node' is your lux.SceneNode.
Or move an object to absolute position (1, 2, 3):
  T = luxmath.Matrix().makeIdentity().translate(luxmath.Vector((1, 2, 3)))
  node.applyTransform(T, absolute = True)
 
trans = The transformation (luxmath.Matrix) to apply. *
absolute = Whether to make an absolute transformation instead of a relative one. Must be an object node for absolute transform. (default = False)
centerAndFit(...)
Centers and fits the node.
deselect(...)
Visually deselects node in the scene.
dump(...)
Returns a string representation of the node and its children.
duplicate(...)
Duplicate current node and subtree.
amount = The amount of duplicates to create (default = 1).
linkMats = Whether to link materials or not (default = false).
find(...)
Find nodes in the subtree of this node by searching part names and material names. If no names or materials are given then it will find everything.
name = Part name to search for (string/tuple/list). 
mat = Material name to search for (string/tuple/list). 
all = Match all part names or all material names (default = false).
types = Filter results to match types (int/tuple/list) which can be the following the values: lux.NODE_TYPE_GROUP, lux.NODE_TYPE_OBJECT, lux.NODE_TYPE_ANIMATION, lux.NODE_TYPE_MODEL_SET, and lux.NODE_TYPE_MODEL default = all types). 
depth = The amount of levels to go down the tree. A value of 1 means to only match the direct children of this node etc. (default = -1 = all)
getBoundingBox(...)
Get bounding box of node as a tuple of two vectors: min and max.
world = Whether to be in world space or not (default = false).
getCenter(...)
Get the center of this node.
world = Whether to be in world space or not (default = false).
getChildren(...)
Get children of group.
getID(...)
Get node ID.
getKind(...)
Get node kind. Can be one of the following values: lux.NODE_TYPE_GROUP, lux.NODE_TYPE_OBJECT, lux.NODE_TYPE_ANIMATION, lux.NODE_TYPE_MODEL_SET, or lux.NODE_TYPE_MODEL.
getMaterial(...)
Get material of a node.
getName(...)
Get node name.
getParent(...)
Get parent node of this node.
getPath(...)
Get path from root to this node as a tuple of lux.SceneNode objects.
text = Whether to return the names instead of lux.SceneNode objects (default = false).
getRenderLayer(...)
Get render layer for associated node, if any.
getTransform(...)
Get the transformation matrix of this node.
world = Whether to be in world space or not (default = false).
hide(...)
Hide node.
isAnimation(...)
Check if node is an animation.
isDescendantOf(...)
Checks if this node is a descendant of the input group node.
group = Group node to check sub-tree of. *
isGroup(...)
Check if node is a group.
isHidden(...)
Check if node is hidden.
isLocked(...)
Check if node is locked.
isModel(...)
Check if node is a model (direct child of a model set).
isModelSet(...)
Check if node is a model set.
isObject(...)
Check if node is an object.
isSelected(...)
Check if node is selected in the scene.
lock(...)
Lock node.
moveToGroup(...)
Move this node to another group node. Note: This changes the scene tree.
group = Group node to move this node to. *
select(...)
Visually selects node in the scene.
setMaterial(...)
Set material of a node. If applying to a group then it will apply to all sub nodes.
mat = The name of the material or multi-material to apply. It can also be an instance of lux.MultiMaterial. *
setName(...)
Set name of node.
name = New name of node. *
setRenderLayer(...)
Associate node with render layer, creating it if name is non-existent. Current render layer will be unset if name is unspecified or empty.
name = Render layer name. (See available ones with lux.getRenderLayers())
show(...)
Show node if hidden.
snapToGround(...)
Snaps node to ground plane.
unlock(...)
Unlock node.

Static methods defined here:
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
  Functions
applyMaterialMapping(...)
Applies a material mapping.
dict = Dictionary of object IDs to material names. *
clearGeometry(...)
Clears all geometry in the scene.
ask = Whether to ask to clear or not (default = false, only in GUI mode).
createMultiMaterial(...)
Create a multi-material based on an existing material.
name = Name of new multi-material. *
mat = Name of existing material to clone from. Can be a string or list of strings (first item of the list will be used to clone from). *
deleteMaterial(...)
Deletes material from KeyShot context.
name = Name of material to delete. *
dumpTree(...)
Dumps the scene tree as a JSON string.
enablePerformanceMode(...)
Enable or disable performance rendering mode.
enable = Whether to enable or not. (default = true)
encodeVideo(...)
Encodes a video from frames of a folder.
folder = Folder to encode video frames from. *
frameFiles = Name of the frame files. The extension dictates the image format (can be jpg/jpeg, png, exr, or tif/tiff). *
videoName = Name of the video file, if any. The extension dictates the video format (can be mp4, mov, avi, or flv). *
fps = Frames per second. Relates to the number of frames available! *
firstFrame = Frame to start encoding from (defaults to scene settings).
lastFrame = Frame to end encoding at (defaults to scene settings).
keepFrames = Whether to keep the frames after encoding (default = true)
opts = Options specified as a lux.RenderOptions object (see lux.getRenderOptions()).
exportFile(...)
Export scene to a file of specified format.
path = Path to export file to. *
format = Export format can be one of the following values: lux.EXPORT_OBJ, lux.EXPORT_FBX, lux.EXPORT_GLTF (will be saved as GLB if the file extension is '.glb'), lux.EXPORT_STL, lux.EXPORT_3MF, lux.EXPORT_USD. *
mode = Optional texture mode dictionary to provide additional information. The dictionary has the following form:
  {"mode": mode}
where mode can be one of the following values: lux.EXPORT_SINGLE_COLOR (STL), lux.EXPORT_VERTEX_COLOR (STL), lux.EXPORT_BAKING (GLTF, THREEMF, USD). Some modes can take additional options:
  {"mode": lux.EXPORT_VERTEX_COLOR,
   "sub_div": sub_div,
   "stop_criteria": stop_criteria,
   "poly_count": poly_count,
   "edge_length": edge_length}
where sub_div can be either lux.EXPORT_SUB_DIV_NORMAL or lux.EXPORT_SUB_DIV_ADAPTIVE, and stop_criteria can be lux.EXPORT_SUB_DIV_POLYCOUNT or lux.EXPORT_SUB_DIV_EDGE_LENGTH.
  {"mode": lux.EXPORT_BAKING,
   "dpi": dpi,
   "num_samples": number_of_samples,
   "occlusion": include_ambient_occlusion_boolean,
   "draco_compression": Compress using Draco (only GLTF/B),
   "preferred_output": preferred_output}
where preferred_output can be either lux.EXPORT_OUTPUT_TEXTURES or lux.EXPORT_OUTPUT_GEOMETRY_SHADERS.
getActiveConfiguration(...)
Returns a dict of the current active configuration.
getActiveEnvironment(...)
Get active environment instance for manipulating and retrieving information.
getActiveImageStyle(...)
Get active image style instance for manipulating and retrieving information.
getActiveStudio(...)
Get active studio name of the scene.
getAnimationFrame(...)
Returns the current animation frame.
getAnimationInfo(...)
Returns information about the animation; the duration in seconds, and the amount of frames.
getAnimationTime(...)
Returns the current animation time in seconds.
getBrowserDialog(...)
Show browser dialog. Specify either URL or HTML contents.
url = URL to load inside browser dialog (use 'file:///' to load local files).
html = HTML contents to load inside browser dialog.
result = Lambda expression or function to evaluate when "lux.yieldResult(..)" is called in JavaScript on the page inside the browser dialog. It will be invoked with the result dictionary (JS Object) as parameter. Note that the earliest time to use the function in JS is when the page is loaded, i.e. the 'load' event, and up to 500ms later. The functionality is automatically loaded onto the page. (default = None)
init = Dictionary of data to initialize the "lux.initData" with in JavaScript of the browser dialog. (default = None)
getCamera(...)
Retrieves the currently active camera of the scene.
getCameraDirection(...)
Gets the direction of the active camera of the scene.
getCameraDistance(...)
Get distance from active camera to pivot/look-at point.
getCameraLookAt(...)
Gets the lool-at point of the active camera of the scene.
getCameraPosition(...)
Gets the position of the active camera of the scene.
getCameraUp(...)
Gets the up vector of the active camera of the scene.
getCameras(...)
Retrieves the cameras of the scene.
getEnvironments(...)
Get list of environents of the scene.
getExternalFiles(...)
Returns a list of all external files needed by the current scene.
getImageStyles(...)
Get list of image styles of the scene.
getImportOptions(...)
Returns import options in a dictionary:
 accurate_tessellation: Use alternative tessellation method when available.
 adjust_camera_look_at: Adjust active camera to look at the imported geometry.
 adjust_environment: Adjust environment sphere to fit the imported geometry.
 camera_import: Import cameras if able.
 center_geometry: Center newly added geometry in the scene.
 snap_to_ground: Snap newly imported geometry to the ground plane.
 compute_normals: Compute normals during import, if the format allows.
 geometry_units: The unit of the imported scene, if not automatically detected. Supply as conversion factor from meters, e.g. cm = 100, feet = 3.2808399, etc.
 include_nurbs: Include NURBS data.
 import_type: How to import to scene. Add to scene = 0, Update active geometry = 1, Clear and  import to new scene = 2.
 merge_groups: Apply some post import merging to identically named groups.
 merge_objects: Apply some post import merging to identically named objects.
 retain_materials: Apply material changes to the active model to the imported model.
 separate_materials: Ensure that materials are not linked across parts.
 separate_parts: Prevent objects from being merged during import. Certain formats only.
 tessellation_quality: Tessellation quality from 0.0 to 1.0. Higher values should yield more triangles.
 up_vector: Up vector of the source program. x = 0, y = 1, z = 2, -x = 3, -y = 4, -z = 5
 frame: Import a specific animation frame, if able.
 mayaForceVersion: Maya file import depends on a local Maya installation. This option forces the importer to use a specific version. Should be a string representing the year release, e.g. "2013".
 group_by: For importers with multiple grouping options. Group by Layer = 0, Group by Shader = 1, Group by Object = 2.
 model_set_import_to: Which model set to import to. All = 0, Active = 1, Selected = 2, New = 3
selected_model_set_ids = List of ids of model sets to import to when model_set_import == 2. Get model set id with GetId() on a lux.SceneNode.
ext = File extension to get specific options.
getDefaults = Whether to get KeyShot defaults or user settings from a previous import (default = false).
inclusion_options = A bitwise collection of flags determining which features to import. Set to 31 for all features.
getInputDialog(...)
Show dialog according to the arguments provided and return the results. It returns None if cancelled.
 
For example, to show a dialog asking a string, an integer between 10 and 50 that has default value 42, and an item of [1, 2, 3]:
    values = [("string", lux.DIALOG_TEXT, "Input string:", "hello"),
              ("int", lux.DIALOG_INTEGER, "Input int:", 42, (10, 50)),
              (lux.DIALOG_LABEL, "Freestanding label text."),
              ("item", lux.DIALOG_ITEM, "Select item:", 2, [1, 2, 3])]
    opts = lux.getInputDialog(title = "This is the title", values = values)
The returned options, with default values, would be:
    {"string": "hello", "int": 42, "item": [1, "2"]}
 
Another trick is using a lambda when clicking "Apply" so the dialog does not need to close every time, and it gets a more interactive feel.
    values = [("string", lux.DIALOG_TEXT, "Text:", "test")]
    lux.getInputDialog(title = "Testing Apply", values = values,
                       apply = lambda res: print(res))
In this case it means that whenever "Apply" is clicked the result will be printed to console.
 
title = Title of the dialog. *
 
desc = Description of dialog. (default = None) 
 
values = The values of the dialog to build and show. It expects a list of tuples, one tuple for each control. The tuple must contain four or five values depending on the type: key, type, label, and default value, with the additional constraints value in some cases. The key is a string, the label is a string, the type can be one of the following values: lux.DIALOG_TEXT, lux.DIALOG_INTEGER, lux.DIALOG_DOUBLE, lux.DIALOG_ITEM, lux.DIALOG_CHECK, lux.DIALOG_FILE, lux.DIALOG_FOLDER, or lux.DIALOG_LABEL. If the type is lux.DIALOG_INTEGER or lux.DIALOG_DOUBLE then the extra constraints value must be present in the tuple, which is a tuple of minimum and maximum value, and if the type is lux.DIALOG_ITEM then the extra argument must be a list of items to select from. As a special case, if the type is lux.DIALOG_LABEL then the tuple size must be two and the second value must be a string (if the string contains only dashes then it becomes a horizontal divider). * 
 
id = Special ID to enable persisting values and when reopening. If given then clicking OK will remember the values so that if the ID is used again then the values will be the default values. Make sure that the ID is unique enough so other scripts won't use it by accident. (default = None)
 
apply = Lambda expression or function to evaluate when "Apply" is clicked in the dialog. It will be invoked with the result dictionary as parameter. The dialog will not close when "Apply" is clicked. (default = None)
getInputDouble(...)
Show dialog to input a double.
title = Title of the dialog (default = "Enter double").
label = Label of the dialog (default = "Enter double:").
value = Initial value (default = 0).
min = Minimum value (default = -2147483647).
max = Maximum value (default = 2147483647).
decimal = Maximum number of decimal places (default = 1).
getInputFile(...)
Show dialog to select file(s) from the file system.
multiple = If multiple files can be selected (default = false).
title = Title of the dialog (default = "Select file(s)").
folder = The folder to show initially (default = home folder).
filter = Filter of files to allow selection from (default = none). An example could be "*.obj *.bip" for all OBJs and BIPs.
getInputFolder(...)
Show dialog to select a folder from the file system.
title = Title of the dialog (default = "Select folder").
folder = The folder to show initially (default = home folder).
getInputInt(...)
Show dialog to input an integer.
title = Title of the dialog (default = "Enter integer").
label = Label of the dialog (default = "Enter integer:").
value = Initial value (default = 0).
min = Minimum value (default = -2147483647).
max = Maximum value (default = 2147483647).
step = Stepping amount (default = 1).
getInputItem(...)
Show dialog to select an item from a list/tuple of items.
items = List/tuple of items to choose from. *
title = Title of the dialog (default = "Select item").
label = Label of the dialog (default = "Select item:").
current = Index of initial item (default = 0).
editable = If editable or not (default = true).
getInputText(...)
Show dialog to input a string.
title = Title of the dialog (default = "Enter text").
label = Label of the dialog (default = "Enter text:").
value = Initial value (default = empty string).
getKeyShotVersion(...)
Returns the KeyShot version as (major, minor, build, arch) tuple, where arch is either "32 bit" or "64 bit".
getLibraryBackplates(...)
Gets all backplates of the library.
filter = Filter by relative path in library, e.g. 'Backplates/Outdoor'.
getLibraryEnvironments(...)
Gets all environments of the library.
filter = Filter by relative path in library, e.g. 'Environments/Studio/Basic'.
getLibraryMaterials(...)
Gets all materials of the library.
filter = Filter by relative path in library, e.g. 'Materials/Metal/Titanium'.
getLibraryTextures(...)
Gets all textures of the library.
filter = Filter by relative path in library, e.g. 'Textures/Wood'.
getLightingPreset(...)
Get currently used lighting preset.
getLightingPresets(...)
Get list of lighting presets, both default and custom ones.
getMaterialMapping(...)
Gets material mapping: object ID -> material name.
getMaterialTemplates(...)
Gets material template names.
getMessageBox(...)
Show message box.
msg = Descriptive text of message box. *
title = Title of message box. Note that it doesn't show on macOS. (default is empty).
type = Type of message box: lux.MESSAGE_BOX_INFO, lux.MESSAGE_BOX_WARNING, lux.MESSAGE_BOX_CRITICAL (default = lux.MESSAGE_BOX_INFO).
getMetaData(...)
Get meta data of scene.
format = Format of meta data can be lux.META_DATA_SIMPLE (simple format .meta) or lux.META_DATA_XMP (XML). (default = XMP)
getModelSets(...)
Returns the list of active model sets.
getMultiMaterial(...)
Get multi-material instanced from material name.
name = Name of multi-material. *
getOS(...)
Returns the OS version string.
getObjectMaterial(...)
Gets the material applied to the object(s).
obj = Object ID or list of IDs. *
getObjects(...)
Gets the object IDs of the scene.
getRenderEngine(...)
Get render engine currently in use.
getRenderLayers(...)
Returns a list of render layers in the current scene.
getRenderOptions(...)
Returns render options as a lux.RenderOptions object. If defaults is set then it will return the internal defaults, otherwise it's the values as they appear in the render dialog.
defaults = Return defaults or not (default = false).
getSceneInfo(...)
Returns information about the scene in a dict: name, file name, unit/meter scale and number of triangles, objects, nurbs, curves, scene width/height, and rendering width/height.
getSceneMaterials(...)
Gets currently used materials of the scene.
getSceneTree(...)
Get lux.SceneNode object representing the root of the scene tree.
getSphericalCamera(...)
Get spherical information in degrees of active camera as a list: azimuth, inclination, and
twist.
getStudios(...)
Get studio names of the scene.
hasContents(...)
Determine if there is any content in the scene.
importFile(...)
Imports a file.
path = File path to import. *
showOpts = Show options dialog (default = false).
dontAsk = Whether or not to suppress blocking dialogs while script is running, e.g. save scene (default = true).
opts = Options specified as a dictionary (see lux.getImportOptions()).
importMaterials(...)
Imports materials from MTL file into material library.
file = MTL File path to import materials from. *
folder = The existing sub material library folder to add the materials to, i.e. 'Glass/Basic' (default = '.', which is the root materials folder).
isCameraUnsaved(...)
Checks if current camera has unsaved changes.
isHeadless(...)
Returns whether KeyShot is running in headless or GUI mode.
isPaused(...)
Checks if renderer is paused.
isPerformanceModeEnabled(...)
Checks if performance rendering mode is enabled.
isSceneChanged(...)
Checks if scene has been changed.
isUndoEnabled(...)
Check whether undo/redo stack is enabled.
loadMaterials(...)
Loads materials from MTL file as in-project materials, i.e. they will not show up in the material library visually.
file = MTL File path to load materials from. *
newCamera(...)
Creates a new camera and makes it active. If not creating unique name and the name exists then it returns false.
name = The name of the camera to create. *
unique = Whether to create a unique name using numbers at the end (default = false)
newModelSet(...)
Create a new model set.
name = The name of the new model set to create. *
newScene(...)
Clears the scene.
dontAsk = Whether or not to suppress blocking dialogs while script is running, e.g. save scene (default = true).
openFile(...)
Opens or imports a file.
path = File path to open. *
dontAsk = Whether or not to suppress blocking dialogs while script is running, e.g. save scene (default = true).
pause(...)
Pauses renderer.
prettyPrint(...)
Returns pretty representation of input object.
processQueue(...)
Process render queue.
removeCamera(...)
Removes a camera.
name = The name of the camera to remove. *
removeModelSet(...)
Remove a model set. If current model set is to be removed then the default model set is chosen.
name = The name of the new model set to remove. *
renderAnimation(...)
Renders frames of the scene to a folder and/or video file.
folder = Folder to render frames to. *
frameFiles = Name of the frame files. The extension dictates the image format (can be jpg/jpeg, png, exr, tif/tiff or psd). (default = "frame.%d.jpg")
keepFrames = Whether to keep the frames after rendering (default = true).
width = Resolution width in pixels of the frames (default = scene width).
height = Resolution height in pixels of the frames (default = scene height).
fps = Frames per second (default = 12).
videoName = Name of the video file, if any. The extension dictates the video format (can be mp4, mov, avi, or flv). (default = none)
opts = Options specified as a lux.RenderOptions object (see lux.getRenderOptions()).
format = Image format. Can be one of the following values: lux.RENDER_OUTPUT_JPEG, lux.RENDER_OUTPUT_PNG, lux.RENDER_OUTPUT_EXR, lux.RENDER_OUTPUT_TIFF8, lux.RENDER_OUTPUT_TIFF32, lux.RENDER_OUTPUT_PSD8, lux.RENDER_OUTPUT_PSD16, lux.RENDER_OUTPUT_PSD32 (requires file extension to match).
renderConfiguration(...)
Renders a configuration of the scene.
name = Name of configuration. It must contain an image extension: jpg, jpeg, or png. For images mode the name must also contain '%d'. *
folder = Folder to render files to. *
web = Whether or not to render web files (default = False).
modelVariations = Enable model variations for images mode (default = False).
materialVariations = Enable material variations for images mode (default = False).
studioVariations = Enable studio variations for images mode (default = False).
iBook = Whether or not to produce an iBook widget. Only suitable for Web Configurations. (default = False)
iBookWidth = Resolution width of the iBook frames. Only suitable when iBook is enabled. (Default = scene width)
iBookHeight = Resolution height of the iBook frames. Only suitable when iBook is enabled. (Default = scene height)
opts = Options specified as a lux.RenderOptions object (see lux.getRenderOptions()).
renderFrames(...)
Renders frames of the scene to a folder.
folder = Folder to render frames to. *
frameFiles = Name of the frame files. The extension dictates the image format (can be jpg/jpeg, png, exr, tif/tiff or psd). (default = "frame.%d.jpg")
width = Resolution width in pixels of the frames (default = scene width).
height = Resolution height in pixels of the frames (default = scene height).
fps = Frames per second (default = 12).
opts = Options specified as a lux.RenderOptions object (see lux.getRenderOptions()).
format = Image format. Can be one of the following values: lux.RENDER_OUTPUT_JPEG, lux.RENDER_OUTPUT_PNG, lux.RENDER_OUTPUT_EXR, lux.RENDER_OUTPUT_TIFF8, lux.RENDER_OUTPUT_TIFF32, lux.RENDER_OUTPUT_PSD8, lux.RENDER_OUTPUT_PSD16, lux.RENDER_OUTPUT_PSD32 (requires file extension to match).
renderImage(...)
Renders the scene to an image file.
path = File path to render to. The extension dictates the image format (can be jpg/jpeg, png, exr, tif/tiff or psd). *
width = Resolution width in pixels of the output image (default = scene width).
height = Resolution height in pixels of the output image (default = scene height).
opts = Options specified as a lux.RenderOptions object (see lux.getRenderOptions()).
format = Image format. Can be one of the following values: lux.RENDER_OUTPUT_JPEG, lux.RENDER_OUTPUT_PNG, lux.RENDER_OUTPUT_EXR, lux.RENDER_OUTPUT_TIFF8, lux.RENDER_OUTPUT_TIFF32, lux.RENDER_OUTPUT_PSD8, lux.RENDER_OUTPUT_PSD16, lux.RENDER_OUTPUT_PSD32 (requires file extension to match).
renderMultiMaterial(...)
Renders a multi-material in the scene.
name = The name of the material or multi-material to apply. It can also be an instance of lux.MultiMaterial. *
folder = Folder to render files to. *
opts = Options specified as a lux.RenderOptions object (see lux.getRenderOptions()).
renderXR(...)
Renders a XR from the scene.
folder = Folder to put results in. *
name = Name of the XR. *
type = XR type. (default = lux.XR_TYPE_TURNTABLE)
center = XR center type. (default = lux.XR_CENTER_OBJECT)
width = Resolution width in pixels of the frames (default = scene width).
height = Resolution height in pixels of the frames (default = scene height).
vwidth = Viewport width in pixels. Will be the size that is displayed in XR. (default = resolution width).
vheight = Viewport height in pixels. Will be the size that is displayed in XR. (default = resolution height).
hframes = Horizontal frames. The XR type plays a role here. (default = 0 = use default)
vframes = Vertical frames. The XR type plays a role here. (default = 0 = use default)
hbegin = Horizontal angel begin. (only for lux.XR_TYPE_CUSTOM)
hend = Horizontal angel end. (only for lux.XR_TYPE_CUSTOM)
vbegin = Vertical angel begin. (only for lux.XR_TYPE_CUSTOM)
vend = Vertical angel end. (only for lux.XR_TYPE_CUSTOM)
opts = Explicit render options specified as a lux.RenderOptions object (see lux.getRenderOptions()). NOTE that some values are overwritten by other options provided to this function and internally to suite the XR rendering.
saveCamera(...)
Saves current camera if there are unsaved changes.
saveFile(...)
Saves scene to a file. If no path is given then known path is used or a dialog will ask.
path = File to save to.
savePackage(...)
Saves scene to a KSP package. If no path is given then known path is used or a dialog will ask.
path = File to save to.
screenshot(...)
Take a screenshot of current realtime window state and return the path to it.
setActiveEnvironment(...)
Set active environment of the scene. Use lux.getEnvironments() to get a list of names.
name = Name of the environment. *
setActiveImageStyle(...)
Set active image style of the scene. Use lux.getImageStyles() to get a list of names.
name = Name of the image style. *
setActiveStudio(...)
Set active studio name of the scene.
name = Name of studio. *
setAnimationFrame(...)
Set the animation frame.
frame = The animation frame number. *
setAnimationTime(...)
Set the animation time in seconds.
secs = The animation time in seconds as a floating-point number. *
setCamera(...)
Sets the active camera of the scene.
camera = The name of the camera to use. *
setCameraDirection(...)
Sets the direction of the active camera of the scene.
dir = Direction of the camera (x, y, z). *
setCameraDistance(...)
Set distance from active camera to pivot/look-at point.
dist = The distance. *
setCameraLookAt(...)
Set camera to look at an object or a point.
obj = Object ID.
pt = Point as tuple (x, y, z).
setCameraPosition(...)
Sets the position of the active camera of the scene.
pos = Position of the camera (x, y, z). *
setCameraUp(...)
Sets the up vector of the active camera of the scene.
up = Up vector of the camera (x, y, z). *
setLightingPreset(...)
Set lighting preset to be used.
name = Name of preset. *
setMaterialTemplate(...)
Applies a material template to part of the scene or all of it if no argument is given.
name = Name of the material template. *
showSel = Show part selection dialog. (only in GUI mode)
setModelSets(...)
Set active model sets and deativate all others. It returns true if all names of model sets could be activated, and thus false even if only some were activated.
names = The list of names of model sets to activate. Using 'Default' will set the default model set. An empty list deactivates all model sets. *
setObjectMaterial(...)
Applies a material to an object in the scene.
mat = Material name to apply. *
obj = Object ID to apply to. *
setRenderEngine(...)
Set render engine to use for the scene.
engine = Type of render engine to use: lux.RENDER_ENGINE_PRODUCT, lux.RENDER_ENGINE_INTERIOR, lux.RENDER_ENGINE_PRODUCT_GPU, or lux.RENDER_ENGINE_INTERIOR_GPU. *
setSceneUnit(...)
Set scene unit and rescale scene if desired.
unit = The scene unit can be one of the following values: lux.UNIT_MM, lux.UNIT_CM, lux.UNIT_IN, lux.UNIT_FT, lux.UNIT_M. *
keep = Whether to keep current size or rescale (default = True).
setSphericalCamera(...)
Set spherical information of active camera: azimuth, inclination, and twist.
azimuth = The spherical azimuth in degrees [-180, 180]. *
incl = The spherical inclination in degrees [-90, 90]. *
twist = The spherical twist degrees [-180, 180]. *
setStandardView(...)
Set standard view of currently active camera.
view = Standard view to set. Must be one of the following: lux.VIEW_FRONT, lux.VIEW_BACK, lux.VIEW_LEFT, lux.VIEW_RIGHT, lux.VIEW_TOP, lux.VIEW_BOTTOM, lux.VIEW_ISOMETRIC. *
setUndoEnabled(...)
Enable or disable the undo/redo stack. When a script context is destroyed then undo is re-enabled if disabled.
enable = Enable or not (default = true).
sync(...)
Synchronize event queue to enforce pending operations.
unpause(...)
Unpauses renderer.
  Data
DIALOG_CHECK = 4
DIALOG_DOUBLE = 2
DIALOG_FILE = 5
DIALOG_FOLDER = 6
DIALOG_INTEGER = 1
DIALOG_ITEM = 3
DIALOG_LABEL = 7
DIALOG_TEXT = 0
EXPORT_3MF = 5
EXPORT_BAKING = 4
EXPORT_FBX = 1
EXPORT_GLTF = 2
EXPORT_OBJ = 0
EXPORT_OUTPUT_GEOMETRY_SHADERS = 1
EXPORT_OUTPUT_TEXTURES = 0
EXPORT_SINGLE_COLOR = 0
EXPORT_STL = 4
EXPORT_SUB_DIV_ADAPTIVE = 2
EXPORT_SUB_DIV_EDGE_LENGTH = 1
EXPORT_SUB_DIV_NORMAL = 1
EXPORT_SUB_DIV_POLYCOUNT = 0
EXPORT_USD = 6
EXPORT_VERTEX_COLOR = 1
IMAGE_STYLE_BASIC = 0
IMAGE_STYLE_PHOTOGRAPHIC = 1
MESSAGE_BOX_CRITICAL = 3
MESSAGE_BOX_INFO = 1
MESSAGE_BOX_WARNING = 2
META_DATA_SIMPLE = 1
META_DATA_XMP = 0
NODE_TYPE_ANIMATION = 3
NODE_TYPE_GROUP = 1
NODE_TYPE_MODEL = 5
NODE_TYPE_MODEL_SET = 4
NODE_TYPE_OBJECT = 2
RENDER_ENGINE_INTERIOR = 1
RENDER_ENGINE_INTERIOR_GPU = 4
RENDER_ENGINE_PRODUCT = 0
RENDER_ENGINE_PRODUCT_GPU = 3
RENDER_MODE_ADVANCED = 0
RENDER_MODE_SAMPLES = 2
RENDER_MODE_TIME = 1
RENDER_OUTPUT_EXR = 2
RENDER_OUTPUT_JPEG = 0
RENDER_OUTPUT_PNG = 5
RENDER_OUTPUT_PSD16 = 8
RENDER_OUTPUT_PSD32 = 7
RENDER_OUTPUT_PSD8 = 6
RENDER_OUTPUT_TIFF32 = 3
RENDER_OUTPUT_TIFF8 = 1
UNIT_CM = 1
UNIT_FT = 3
UNIT_IN = 2
UNIT_M = 4
UNIT_MM = 0
VIEW_BACK = 2
VIEW_BOTTOM = 6
VIEW_FRONT = 1
VIEW_ISOMETRIC = 7
VIEW_LEFT = 3
VIEW_RIGHT = 4
VIEW_TOP = 5
XR_CENTER_CAMERA = 4
XR_CENTER_CAMERA_PIVOT = 5
XR_CENTER_ENVIRONMENT = 1
XR_CENTER_OBJECT = 2
XR_TYPE_CUSTOM = 5
XR_TYPE_HEMISPHERICAL = 3
XR_TYPE_SPHERICAL = 2
XR_TYPE_TUMBLE = 4
XR_TYPE_TURNTABLE = 1
Copyright by Luxion - Generated on Fri May 28 16:07:06 2021 using a modified pydoc.