Skip to main content

Editor.Model

Class

The 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

EnumerationDescription
DeviceTypeEnum representing the target device type for a Lens Studio project.
EntityBaseTypeEnum defining the base types an entity prototype can represent.
FindOptionEnum of options controlling model lookup behavior.
LensActivationCameraThe various cameras which will be activated when this project's Lens turns on.
LensApplicabilityThe various contexts in which this Lens can be used.
LensClientCompatibilityEnumerates the client surfaces a Lens can target for distribution.
PackageOptionEnum representing the packaging state of an asset or resource.
ProjectSaveModeEnum controlling how and when a project is saved.
ResultTypeHow a file should be imported into the project.
SourceRootDirectoryEnum identifying the root directory context for resolving source paths within a Lens Studio project.

Classes

ClassDescription
AssetContextContext object holding the current asset selection, providing access to selected assets and their paths.
AssetImportMetadataA handle for the metadata of an asset.
AssetManagerManages project assets — creating, importing, finding, and organizing assets within the project.
AssetMetaStores metadata for an asset, including type information and associated properties.
BaseChangesStreamBase class for streams that track and apply model changes.
EntityAn object in the scene, or asset in the Editor.Model.AssetManager
EntityPrototypeDataDefines prototype data for an entity type, including its display metadata and factory function.
EntityStructureEntity subclass representing the structural organization of entities within a scene.
ExportOptionsOptions controlling how a model is exported, including dependency handling and packaging policy.
ExternalPackageDependencyRepresents an external package dependency, including its import metadata and version configuration.
IEntityPrototypeRegistryRegistry for entity prototypes, providing methods to create, query, and register entity types within the Editor model.
IEntityRegistryA registry of various entities.
IModelCore plugin component interface providing access to the current Lens Studio project and its lifecycle events.
ImportResultThe result of Editor.Model.AssetManager.importExternalFile and Editor.Model.AssetManager.importExternalFileAsync.
ImportSettingsSettings object describing how a model import operation was configured.
InspectableMetaMetadata for an inspectable object, providing display caption and icon for use in the Editor UI.
InstantiationParamsParameters used when instantiating a scene object, including its parent hierarchy.
LayerThe layers within a Editor.Model.LayerSet.
LayerIdThe id of a Editor.Model.Layer.
LayersThe layers of a {@Editor.Assets.Scene}.
LayerSetRepresents an immutable set of scene layers, supporting set operations like union, intersection, and difference.
MetaThe metadata of an entity.
MetaInfoMetadata of the current project's Lens.
ObjectContextContext scoped to a set of scene objects, providing access to the current object selection.
PrefabableAn entity which can be turned into a prefab, such as Editor.Model.SceneObject.
ProjectRepresents the open Lens Studio project, providing access to the scene, asset manager, and project settings.
SceneObjectA node in the scene hierarchy, holding components and child scene objects.
SourcePathRepresents a file path within a Lens Studio project, combining a root-relative path with a source root directory.
TransformEntityEntity that carries a spatial transform, representing position, rotation, and scale in the scene.
WorldTransformAccessorProvides read and write access to an entity's world-space transform.