Files
OrcaSlicer/src/libslic3r
Ian Chua 82b860480f feat: initial draft of lifecycle events API for plugins (#15293)
# Description

This PR introduces lifecycle events to the plugin API. 
For all plugin capabilities, you can define a `on_lifecycle_event`
function in the plugin that takes in a event enum and a small payload
for some generic information on the lifecycle event.
The idea is to keep the payload generic and small, and if you want to
get more information, you should invoke other more targeted APIs to get
more information.
For example, lets say you are keeping track of the the `ObjectAdded*`
event hook for model transformation, addition or deletion. The payload
would tell you the name of the model, and you should use a targeted API
such as `orca.host.plater().model()` to get more information on the
model. This is the overall design principle of the API.

Currently the lifecycle events are the following:
```cpp
    enum class LifecycleEvent {
        // Project (3mf)
        NewProject,
        ProjectOpened,
        ProjectBeforeSave,
        ProjectAfterSave,
        ProjectClosed,
        ProjectDirtyChanged,

        // Slicing pipeline
        SliceStarted,
        SliceGeometryFinished,
        GCodeExportStarted,
        GCodeExportFinished,
        SlicingJobComplete,

        // Plate/model editing
        ObjectAdded,
        ObjectDeleted,
        ObjectTransformed,
        ObjectChanged,
        ObjectRenamed,
        PlateCreated,
        PlateDeleted,
        PlateSelected,
        PlateRenamed,

        // Preset
        PresetSelected,
        PresetSaved,

        // Printer/device
        PrintStateChanged,
        DeviceOnlineChanged,
        DeviceDiscovered,
        DeviceSelected,
        DeviceConnected,
        DeviceDisconnected,
        UploadStarted,
        UploadFinished,

        // Print/send jobs
        PrintJobStarted,
        PrintJobFinished,
        SendJobStarted,
        SendJobFinished,
    };
```

This is an initial draft and lifecycle events can be included later on.

[orca_telegram_notifier_plugin_any.py](https://github.com/user-attachments/files/31220973/orca_telegram_notifier_plugin_any.py)

If you're familiar with telegram bots, after you install the telegram
bot, in the config of this plugin, you can enter the Bot ID and the Chat
ID with said bot.

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->

## Tests

<!--
> Please describe the tests that you have conducted to verify the
changes made in this PR.
-->

For this plugin, I am testing it with a telegram bot that sends me a
message on lifecycle event.


<!--
> A guide for users on how to download the artifacts from this PR.
-->

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-09-23 12:52:08 +08:00
..
2024-10-05 21:53:16 +03:00
2026-06-18 09:13:51 -03:00
2026-08-23 22:43:41 +08:00
2026-08-04 21:56:15 +08:00
2026-09-22 20:50:18 -03:00
2026-03-13 02:12:10 -07:00
…
2025-06-14 21:05:25 +08:00
2026-04-23 00:21:19 +08:00
2025-10-28 15:29:47 +08:00
2026-03-24 09:18:38 -07:00
2026-03-24 09:18:38 -07:00
2026-08-23 22:11:48 +08:00
…
2026-03-24 09:18:38 -07:00
2025-09-18 17:08:18 +08:00
2025-09-18 17:08:18 +08:00
2025-12-08 22:42:11 +08:00
2026-03-13 01:56:51 -07:00
2026-07-02 17:49:36 +08:00
2026-07-02 17:49:36 +08:00
2026-03-13 01:56:51 -07:00
2026-05-04 15:52:34 +08:00
2026-03-13 01:56:51 -07:00
2025-12-08 22:42:11 +08:00
2026-05-10 02:21:13 +08:00
2026-07-27 19:52:29 -03:00
2026-07-27 19:52:29 -03:00
…
…
2026-01-29 19:19:37 +08:00
2026-01-23 17:05:56 +08:00
2025-12-08 22:42:11 +08:00
2025-12-08 22:42:11 +08:00