Skip to content
github-actions[bot] edited this page Oct 16, 2026 · 2 revisions

Script

The orca.script module exposes ScriptPluginCapabilityBase for plugins that run from the Plugins dialog.

Base class get_type() returns Required methods Invoked by
orca.script.ScriptPluginCapabilityBase Script get_name(), execute(self) -> ExecutionResult the Plugins dialog -> Run action

Lifecycle hooks on_load() / on_unload() are optional and available on every capability (defaults do nothing). So is on_lifecycle_event(event, ctx), which observes application events such as project saves or slicing; see Lifecycle Events.

Important

ScriptPluginCapabilityBase.execute() runs on the main/UI thread: live host handles are safe to read for the whole call and orca.host.ui dialogs open inline, but a slow execute() freezes the UI. Keep it quick; offload heavy work to your own threading.Thread (which must not touch the model) and surface results through a create_window panel.

Minimal Shape

import orca

class HelloScript(orca.script.ScriptPluginCapabilityBase):
    def get_name(self):
        return "Hello Script"

    def execute(self):
        return orca.ExecutionResult.success("Hello from a script plugin")

See Registry for ExecutionResult, package registration, and capability name rules.

Application Structure Overview

WIP...

Warning

!! incomplete, possibly inaccurate, being updated with new info !!

Refers to the entire application. The whole view, file loading, project saving and loading is all managed by this class. This class contains members for the model viewer, the sidebar, gcode viewer and everything else.

This is relating the the sidebar in the application window

full-sidebar

The drop down menus where you can see and select presets

combobox

Refers to the various windows with settings. e.g. the Popup to edit printer or filament preset. Also the section to edit process preset and the object list. These 4 are managed by TabPrinter, TabFilament, TabPrint and TabPrintModel respectively.

tab-popup

Clone this wiki locally