Plugin Marketplace
Sign in

Documentation

Lua API: every module and type
Lua API

Lua API reference

Everything a PrusaSlicer plugin can call: the api module, the values it hands back and the tables it takes.

API version1.0.0manifest.json"project.plugin": "1.0.0"From PrusaSlicer3.0.0-alpha13Editor stubsDownload .zip

A first plugin

A plugin is one Lua file with an info table and an execute function. This one asks for a size and adds a cube of it to the project. Write your first plugin walks through it.

cube.lua
info = {
    id = "com.example.cube",
    type = "project.plugin",
    title = "Cube",
    menu = "Examples/Cube",
    params = {
        { name = "size", label = "Size [mm]", type = "float", default = 20 },
    },
}

function execute(params)
    local cube = api.make_cube(params.size, params.size, params.size)
    api.project:add_object({ mesh = cube })
end

Modules

Classes

Values the API gives your plugin, and the tables you build to pass to it.

Enums

Globals

Names every plugin file sees without a require.

VolumeTypeVolumeType
apiapi

In your editor

The same API ships as annotated Lua stubs. Point your editor's Lua language server at them for completion, hover docs and type checks; an AI agent can read them too.Set up your editor.

Download the stubs for 1.0.0

    ↑↓ move↵ openAPI 1.0.0