Skip to main content

LensStudio:PanelPlugin

Module

Module providing base classes for creating panel-based plugins in Lens Studio.

Example

// PanelPlugin provides a dockable panel in the Lens Studio editor.
// Override createWidget(parent) to build the UI, deinit() to clean up.
const root = new Widget(parent);
const layout = new BoxLayout();
layout.setDirection(Direction.TopToBottom);
layout.spacing = 8;
root.layout = layout;

const title = new Label(root);
title.text = 'PanelPlugin Example';
title.fontRole = FontRole.LargeTitleBold;
layout.addWidget(title);

const info = new Label(root);
info.text = 'This panel was created by extending PanelPlugin and overriding createWidget().';
info.wordWrap = true;
layout.addWidget(info);

const btn = new PushButton(root);
btn.text = 'Hello from PanelPlugin';
layout.addWidget(btn);

this.connections.push(
btn.onClick.connect(() => {
info.text = 'Button clicked! Use pluginSystem.findInterface() to access editor APIs.';
})
);

Classes

ClassDescription
DescriptorConfiguration descriptor for a PanelPlugin, holding metadata such as id, name, description, and dependencies.
EditorDescriptorBase descriptor class for editor plugins, extended by panel and editor plugin descriptor types.
PanelDescriptorDescriptor subclass specific to panel plugins, used to register a panel with the editor plugin system.
PanelPluginBase class for plugins that create persistent UI panels; extend this and implement createWidget() to build panel UI.