LensStudio:Workspaces
ModuleModule for inspecting Lens Studio workspaces and installing custom workspace presets.
Module for inspecting Lens Studio workspaces and installing custom workspace presets. Before using anything in this namespace, make sure to import LensStudio:Workspaces.
Example
List the workspaces open in Lens Studio. Add IWorkspaceManager to your plugin descriptor's dependencies.
import { IWorkspaceManager } from 'LensStudio:Workspaces';
// Returns the names shown on the workspace tabs, in tab order.
export function listWorkspaceNames(pluginSystem: Editor.PluginSystem): string[] {
const manager = pluginSystem.findInterface(IWorkspaceManager) as IWorkspaceManager;
if (Editor.isNull(manager)) throw new Error('The workspace manager is unavailable');
return manager.all.map(workspace => workspace.metadata.name);
}
Classes
| Class | Description |
|---|---|
| Descriptor | Describes a workspace preset: its metadata and serialized panel layout. Obtain one for a preset folder with IWorkspaceManager.readDescriptor(). |
| IWorkspaceManager | Plugin component that manages the workspaces open in Lens Studio, each a tab with its own panel layout, and the custom workspace presets users can open. Obtain it with pluginSystem.findInterface(IWorkspaceManager); it replaces the deprecated IGui.workspaces. |
| Metadata | Display name and icon of a workspace or workspace preset. |
| PresetHandle | Opaque handle returned by IWorkspaceManager.register() for an installed workspace preset. Pass it to unregister() to remove the preset; the preset is also removed when the handle is released, so keep a reference while the preset should stay installed. |
| Workspace | A workspace open in Lens Studio: a named tab with its own panel layout. Get open workspaces from IWorkspaceManager.all or the manager's signals. |