Skip to main content

LensStudio:Workspaces

Module

Module 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

ClassDescription
DescriptorDescribes a workspace preset: its metadata and serialized panel layout. Obtain one for a preset folder with IWorkspaceManager.readDescriptor().
IWorkspaceManagerPlugin 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.
MetadataDisplay name and icon of a workspace or workspace preset.
PresetHandleOpaque 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.
WorkspaceA workspace open in Lens Studio: a named tab with its own panel layout. Get open workspaces from IWorkspaceManager.all or the manager's signals.