Editor.Model
ClassThe model object is a core concept in the plugin development environment.
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)
Example
const model = pluginSystem.findInterface(Editor.Model.IModel)
const assetManager = model.project.assetManager
const scene = model.project.scene
Nested types
Enumerations
| Enumeration | Description |
|---|---|
| DeviceType | Enum representing the target device type for a Lens Studio project. |
| EntityBaseType | Enum defining the base types an entity prototype can represent. |
| FindOption | Enum of options controlling model lookup behavior. |
| LensActivationCamera | The various cameras which will be activated when this project's Lens turns on. |
| LensApplicability | The various contexts in which this Lens can be used. |
| LensClientCompatibility | Enumerates the client surfaces a Lens can target for distribution. |
| PackageOption | Enum representing the packaging state of an asset or resource. |
| ProjectSaveMode | Enum controlling how and when a project is saved. |
| ResultType | How a file should be imported into the project. |
| SourceRootDirectory | Enum identifying the root directory context for resolving source paths within a Lens Studio project. |
Classes
| Class | Description |
|---|---|
| AssetContext | Context object holding the current asset selection, providing access to selected assets and their paths. |
| AssetImportMetadata | A handle for the metadata of an asset. |
| AssetManager | Manages project assets — creating, importing, finding, and organizing assets within the project. |
| AssetMeta | Stores metadata for an asset, including type information and associated properties. |
| BaseChangesStream | Base class for streams that track and apply model changes. |
| Entity | An object in the scene, or asset in the Editor.Model.AssetManager |
| EntityPrototypeData | Defines prototype data for an entity type, including its display metadata and factory function. |
| EntityStructure | Entity subclass representing the structural organization of entities within a scene. |
| ExportOptions | Options controlling how a model is exported, including dependency handling and packaging policy. |
| ExternalPackageDependency | Represents an external package dependency, including its import metadata and version configuration. |
| IEntityPrototypeRegistry | Registry for entity prototypes, providing methods to create, query, and register entity types within the Editor model. |
| IEntityRegistry | A registry of various entities. |
| IModel | Core plugin component interface providing access to the current Lens Studio project and its lifecycle events. |
| ImportResult | The result of Editor.Model.AssetManager.importExternalFile and Editor.Model.AssetManager.importExternalFileAsync. |
| ImportSettings | Settings object describing how a model import operation was configured. |
| InspectableMeta | Metadata for an inspectable object, providing display caption and icon for use in the Editor UI. |
| InstantiationParams | Parameters used when instantiating a scene object, including its parent hierarchy. |
| Layer | The layers within a Editor.Model.LayerSet. |
| LayerId | The id of a Editor.Model.Layer. |
| Layers | The layers of a {@Editor.Assets.Scene}. |
| LayerSet | Represents an immutable set of scene layers, supporting set operations like union, intersection, and difference. |
| Meta | The metadata of an entity. |
| MetaInfo | Metadata of the current project's Lens. |
| ObjectContext | Context scoped to a set of scene objects, providing access to the current object selection. |
| Prefabable | An entity which can be turned into a prefab, such as Editor.Model.SceneObject. |
| Project | Represents the open Lens Studio project, providing access to the scene, asset manager, and project settings. |
| SceneObject | A node in the scene hierarchy, holding components and child scene objects. |
| SourcePath | Represents a file path within a Lens Studio project, combining a root-relative path with a source root directory. |
| TransformEntity | Entity that carries a spatial transform, representing position, rotation, and scale in the scene. |
| WorldTransformAccessor | Provides read and write access to an entity's world-space transform. |