Skip to content

About

Unofficial KeyShot Python Libraries and Documentation

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Unofficial KeyShot Python

Unofficial KeyShot Python API references, scripting documentation, material and shader information, examples, training resources, and platform-agnostic AI agent configurations.

This repository originally started as a collection of technical documentation, scripts, and reference materials I developed for my KeyShot Python training courses. Over time, it grew into a much larger knowledge base covering the lux and luxmath APIs, material and shader parameters, scripting workflows, practical examples, and information I’ve collected through years of working with KeyShot.

One advantage of maintaining these resources is that the official KeyShot Python documentation available online doesn’t always reflect the latest releases. API information retrieved directly from KeyShot can provide more current references. However, this repository goes well beyond API documentation. It includes additional technical knowledge, examples, and training materials that aren’t necessarily available in the official documentation. A particularly important part of the collection is the internal material and shader parameter reference, which records scripting details that are usually discovered by inspecting actual material graphs in KeyShot.

I also used this knowledge base to develop my custom KeyShot Python Scripting GPT. With OpenAI transitioning from Custom GPTs to plugins, I wanted to preserve the complete collection rather than limit it to what a plugin can accommodate. Moving everything into GitHub allows me to maintain the original resources, continue expanding them, and make them publicly available.

Moving forward, the goal is to maintain this as an evolving, AI-agnostic KeyShot Python resource. Alongside updated API references, documentation, and scripting examples, I’ll be developing and adding AI skills and agent configurations that can be used across different AI platforms.

The idea is simple: preserve the knowledge, keep it current, and make it accessible to both people learning KeyShot Python and AI assistants helping them write scripts.

API source of truth — KeyShot Studio 2026.3

The API references were captured from KeyShot Studio 2026.3 for Windows, build 15.2.0.140 with embedded Python 3.13.12. The GUI references are:

  • lux/KeyShot_lux_API.md — the help(lux) dump documenting exposed scene, material graph, camera, environment, import/export, rendering, and other KeyShot Python APIs.
  • luxmath/KeyShot_luxmath_API.md — the help(luxmath) dump documenting the vector and matrix API used for transformations.

Use the capture for the module and execution mode you are working with. See the headless lux reference and headless luxmath reference for headless scripting.

Why the material and shader parameters are here

Knowing a lux function exists is only half the challenge of scripting materials. The public KeyShot Python documentation explains how to access material graphs, but does not provide a comprehensive per-shader inventory of the exact internal parameter names, types, and observed values. The names shown in KeyShot's Material Graph interface do not always match the identifiers a Python script must use.

To discover those details, you normally have to inspect an actual material in KeyShot using lux.getMaterialGraph(), MaterialGraph.getNodes(), and ShaderNode.getParameters(). For example, this read-only KeyShot Python script lists the parameter names and types for materials used in the open scene:

import lux

for material_name in lux.getSceneMaterials() or []:
    graph = lux.getMaterialGraph(name=material_name)
    if graph is None:
        continue

    for node in graph.getNodes() or []:
        print("Material:", material_name, "Node:", node.getName(), node.getType())
        for parameter in node.getParameters() or []:
            print(" ", parameter.getName(), parameter.getType())

Preserving that hard-to-find information is one of the reasons this knowledge base exists. Rather than requiring everyone to rediscover shader identifiers and parameter types in the scripting console, the repository brings together:

This makes the collection useful both to people learning KeyShot Python and to AI assistants that need concrete material and shader information instead of guessed parameter names. The saved parameter lists are reference observations, not a guarantee that every material or KeyShot version exposes identical settings. For an actual script, verify the relevant graph and parameter types in the target scene.

KeyShot Studio manual

Repository layout

  • Scripting guides cover the API, materials, scene nodes, and transformations.
  • Script examples cover materials, information, transforms, rendering, GUI scripting, and animation.
  • AI skills provide configurations and references for multiple platforms.

Scripts and reference status

This repository includes KeyShot Python scripts for training, practical use, and reference.

When reusing a reference script, check its runtime assumptions and side effects. Verify its lux and luxmath calls against the appropriate KeyShot Studio 2026.3 API reference.

Using the AI agent

See the KeyShot Python knowledge base and the available skills.

Selected script examples

The repository also includes scripts I've shared with the KeyShot community. These are examples of what can be built with the API, not the primary purpose of this knowledge base:

For related GUI, API, transformation, and scripting guides, see the documentation index.

The Inspector can write report/trace files, and its optional all-saved-item inspections temporarily change active camera, environment, or image-style selections. The converter modifies materials. Review each script's scope and test scene-changing operations on a saved copy. Other reference scripts remain available throughout the repository.

Contributing

PRs welcome for new examples, 2026.3 patterns, or AI knowledge improvements. When KeyShot changes the scripting API, refresh lux/KeyShot_lux_API.md from a new help(lux) capture first.

License

GPLv3. See LICENSE.

About

Unofficial KeyShot Python Libraries and Documentation

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages