Editor
ClassNamespace that provides access to the components of Lens Studio.
Index
Methods
Example
// Get the model component
const model = this.pluginSystem.findInterface(Editor.Model.IModel);
// Get the AssetManager in the current project (e.g. to import file).
const assetManager = model.project.assetManager;
Methods
createAnimationClip()
staticcreateAnimationClip(scene):AnimationClip
Create a new animation clip for the given scene.
Parameters
| Parameter | Type |
|---|---|
scene | Scene |
Returns
isNull()
staticisNull(object):boolean
Check if a native object is null or destroyed.
Parameters
| Parameter | Type |
|---|---|
object | any |
Returns
boolean
Nested types
Namespaces
| Namespace | Description |
|---|---|
| Alignment | - |
Enumerations
| Enumeration | Description |
|---|---|
| AnimationLayerBlendMode | Enum defining how animation layers blend with the base animation. |
| AnimationLayerScaleMode | Defines how animation layer scaling is applied to the base animation. |
| Axis | Enum of spatial axes. |
| PlaybackMode | Enumeration of animation playback modes. |
| TargetPlatform | Enum of platforms a Lens Studio plugin or project can target. |
Classes
| Class | Description |
|---|---|
| Ai | Access AI chat functionality and message history. |
| AnimationClip | Represents an animation clip instance with playback configuration. |
| Assets | Namespace containing all asset types for Lens Studio projects. |
| Buffer | Wraps a byte array for data serialization and deserialization. |
| Components | Container for all scene component types and related enums. |
| Compression | Provides compression and decompression utilities. |
| ContextAction | An action in a Editor.IContextActionRegistry. |
| Dock | Container for dock panel management functionality. |
| GaussianSplatting | Namespace providing utilities to create and import Gaussian splatting (GSAF) assets from PLY input files. |
| Graph | Utility class for converting between binary and YAML representations of graph files. |
| IAuthorization | Component that allows you to check whether Lens Studio is authorized, as well as get authorization. Requires snap_auth_token in the module.json of your plugin. |
| Icon | An icon to be used in the Editor UI. |
| IContext | Editor context passed to context action callbacks when a right-click menu is triggered. |
| IContextActionRegistry | A registry of Editor.ContextAction which will be shown in a contextual menu (i.e. right click). |
| IEntityPicker | Popup window that allows the user to choose specific objects in the Scene hierarchy, or assets in the Asset Browser. |
| IGuard | Represents ownership of a resource. If this object is garbage collected, or dispose() method is called – the associated resource is freed. |
| IInterface | Base interface type for Editor plugin system objects. |
| InterfaceId | Unique identifier for plugin interfaces. |
| IPackageActions | Interface for package-level actions. |
| IPackageRegistry | Interface for package discovery and registration. |
| IPlugin | Interface representing a plugin. |
| IPluginComponent | Interface for plugin component registration. |
| IRuntimeBundleExporter | Interface for exporting an asset, together with the assets it references, as a runtime bundle file. Resolve it through pluginSystem.findInterface(). |
| Model | The model object is a core concept in the plugin development environment. It serves as a central point for accessing key elements such as the scene, project, and Editor.Model.AssetManager. The model object encapsulates the data model representing a Lens Studio project. It brings together environment entities and functionalities that are essential for developing plugins. It plays a role analogous to the "Model" component found in Model-View-Controller architectural patterns, containing both data and business logic. In order to get the model object, which many key objects are stored within, you need the pluginSystem object which is being passed into the constructor of the plugin class, along with the ID of the model component (which can be accessed through the Editor namespace) |
| MyLenses | Namespace for Lens Studio's My Lenses account integration. It has no public members; account state is available through Editor.IAuthorization. |
| PackageMetadata | Metadata information about a package. |
| Path | A path in the filesystem, or Asset Manager. Useful for things like importing files into Lens Studio through the Editor.Model.AssetManager. |
| PluginSystem | Provides access to the Lens Studio editor plugins, components, and interfaces |
| Point | Represents a 2D point with x and y coordinates. |
| Rect | Represents a 2D rectangle with position and dimensions. |
| RuntimeBundleExporter | Lens Studio's built-in implementation of Editor.IRuntimeBundleExporter. Obtain it through pluginSystem.findInterface(Editor.IRuntimeBundleExporter) instead of constructing it. |
| ScopedConnection | Stores event listener connections, automatically cleaned up on scope exit. |
| Shape | Represents a 2D or 3D shape object. |
| Size | Used with Editor.Assets.RenderTarget. |
| Transform | Represents position, rotation, and scale in 3D space. |
| Version | Version information for the editor or plugin. |