VRED User Plugin

Overview

The VRED plugin framework provides a robust and flexible interface for creating custom plugins. The framework is designed to be easy to integrate and use, featuring a header-only API, which means there are no additional dependencies required. The VRED User Plugin Interface allows developers to extend the functionality of VRED by creating custom plugins. This interface provides hooks for various events and operations within VRED, enabling plugins to interact with the application seamlessly.

Classes

VREDUserKernelInterface

This class provides the core interface for registering plugin callbacks and interacting with VRED’s kernel. It allows plugins to register for updates, messages, and frame buffer changes.

Key Methods

  • registerUpdate(std::function<void()> callback): Registers a callback function that will be called on each update cycle.

  • registerMessage(std::function<void(const VREDMessage &)> callback): Registers a callback function to handle messages sent to the plugin.

  • registerFrameBufferChanged(std::function<bool(const VREDGLBuffer &)> callback): Registers a callback function that will be called whenever the frame buffer changes. The callback should return a boolean indicating whether the change was handled.

  • runPython(const std::string &command): Executes a Python command within VRED.

VREDUserPluginInterface

This class should be inherited by all user plugins. It provides the basic structure and lifecycle management for plugins.

Key Methods

  • Constructor: Initializes the plugin and registers necessary callbacks with the VREDUserKernelInterface.

  • Destructor: Cleans up resources when the plugin is unloaded.

Release Notes

Version 110

Version 110 was added to VRED 2025.2.

  • Improved binary compatibility between different versions, ensuring backward and forward compatibility.

  • Ability to run Python commands from a thread.

  • Added register functions for handling messages and updates.

Version 100

Version 100 was added to VRED 2025. Initial release of the VRED plugin framework. This version includes the following features:

  • Core interface for registering plugin callbacks and interacting with VRED’s kernel.

  • Ability to register for frame buffer changes.

  • Support for executing Python commands within VRED.

  • Base class VREDUserPluginInterface for creating user plugins with lifecycle management.