Skip to main content

Editor.Assets

Class

Namespace containing all asset types for Lens Studio projects.

Example

const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const assetManager = model.project.assetManager;

// Create a native asset (RenderTarget) via the asset manager
const rt = assetManager.createNativeAsset(
'RenderTarget', 'MyTarget', new Editor.Model.SourcePath(new Editor.Path(''), Editor.Model.SourceRootDirectory.Assets)
) as Editor.Assets.RenderTarget;

// Find a specific asset by name
const found = assetManager.assets.filter(a => a.name === 'MyTarget');

// Type-check with isOfType (handles parent classes)
const renderTargets = assetManager.assets.filter(a => a.isOfType('RenderTarget'));

console.log(`Created "${rt.name}"; found ${found.length} by name, ${renderTargets.length} RenderTarget(s) total`);

Nested types

Enumerations

EnumerationDescription
AntialiasingModeThe aliasing mode of Editor.Assets.RenderTarget.
AntialiasingQualityEnum for antialiasing quality levels.
BlendModeThe blendmode of a Editor.Assets.PassInfo.
ClearColorOptionHow a Render Target should be cleared every frame Editor.Assets.RenderTarget.
CullModeEnum that specifies which faces of a mesh to cull during rendering.
DepthBufferStrategyThe depth buffer strategy of a Editor.Assets.RenderTarget.
DepthFunctionHow a Editor.Assets.PassInfo should determine its depth compared to others.
FilteringModeHow a texture should be sampled.
FrustumCullModeThe same entity as in Lens Scripting.
HandTracking3DHandTypeUsed with {Editor.Assets.HandTracking3DAsset}.
LocationTypeUsed with {Editor.Assets.Location}.
MSAAStrategyEnum for multisample anti-aliasing strategy selection.
ObjectTrackingTextureTypeUsed with Editor.Assets.ObjectTrackingTexture.
PackagePolicyEnum defining how asset packages can be unpacked and their transparency handling.
PassBindingTypeEnum defining types of bindings for render passes.
RemoteAssetType-
ScriptTypeThe kind of script a Editor.Assets.ScriptAsset defines: a component that can be attached to a scene object, a module that other scripts import, or a custom asset type.
SegmentationTypeBuilt in segmentation textures to be used with Editor.Assets.SegmentationTexture.
ShaderTypeEnum of shader type categories.
TextureCompressionLevelQuality preset selecting how aggressively a texture is compressed.
VertexAttributeUsed witih Editor.Assets.FaceMesh
WrapModeOptions for what value is returned when a fetch falls outside the bounds of a texture.

Classes

ClassDescription
AnimationAssetRepresents an animation asset with playback timing information.
AssetRepresents an imported asset with cached file and metadata.
AssetCompressionSettingsBase type assigned to AssetImportMetadata.compressionSettings to set how an asset is compressed during import.
AssetImporterSettingsEntity subclass representing the structural organization of entities within a scene.
AudioTrackAssetRepresents an audio track asset.
BodyTracking3DAsset3D body tracking asset with optional hand tracking support.
CustomAssetAn instance of a custom asset type defined by an @asset script. Create as many instances of a type as needed; they hold pure data that can be shared across script components. The script's inputs are exposed as properties of the instance and can be set independently of the script's defaults.
CustomCodeNodeAssetAsset representing a custom code node in a visual graph.
CustomVariationStyleA user-defined named style on a variable Editor.Assets.Font. Holds the standard variation axis values (weight, width, slant, italic, opticalSize) plus any custom axes the font exposes (e.g. GRAD, YOPQ). Create one with Font.createVariationStyle() and apply it by setting preferredStyle on a Text component to its name.
DeviceCameraTextureA native asset that provides the texture from the camera feed. Import with Editor.Model.AssetManager#createNativeAsset.
DracoCompressionSettingsSets Google Draco geometry compression on a mesh asset; assign to AssetImportMetadata.compressionSettings.
FaceCropTextureA native asset that provides a cropped region of the input texture, calculated based on face position. Import with Editor.Model.AssetManager#createNativeAsset. Learn more in LensScripting.FaceCropTextureProvider
FaceMeshA native asset that provides a 3D mesh of the user's face. Import with Editor.Model.AssetManager#createNativeAsset. Learn more in the Face Mesh guide.
FileCompressionSettingsBase type for file-backed compression strategies, assigned to AssetImportMetadata.compressionSettings to set the compression applied at import.
FileMeshAn asset for 3D meshes.
FileTextureAn asset for textures.
FileTexture2DArrayA 2D texture array asset loaded from file containing multiple 2D texture layers.
FileTexture3D3D texture asset imported from an external file.
FileTextureCubemapCubemap texture asset with per-face texture information.
FileTextureInfoHolds texture file dimensions.
FileTextureInfo3D3D texture file information including depth.
FontFont asset for text rendering.
FontCollectionAn ordered collection of Font and FontFamily assets, allowing a Text component to access multiple fonts and font families.
FontCollectionEntrySingle entry within a FontCollection, pairing a Font or FontFamily asset with weight and italic style attributes.
FontFamilyGroups multiple Font assets into a single family, mapping each to a style (weight + italic).
FontFamilyEntryMaps a single Font asset to a specific style (weight and italic flag) within a FontFamily.
GaussianSplattingAssetAsset containing Gaussian splats for use with GaussianSplattingVisual.
HairDataAssetNative asset providing data for hair rendering.
HandMeshA render mesh that follows a tracked hand. Assign it to a RenderMeshVisual's mesh to render the user's hand.
HandTracking3DAsset3D hand tracking asset for hand pose and gesture recognition.
ImageMarkerA LensScripting.MarkerAsset for use with Editor.Components.MarkerTrackingComponent
JavaScriptAssetA script asset that is written in JavaScript.
JsonAssetAsset wrapping JSON data.
LicensedAudioTrackLicensed audio track asset with metadata and runtime source paths.
LocationAssetAsset representing a named location with an identifier and type.
LocationMeshA native asset that provides data for LensScripting.LocationAsset. Import with Editor.Model.AssetManager#createNativeAsset.
MarkdownAssetNative asset for markdown content.
MarkerAssetBase asset for marker tracking with configurable height.
MaterialMaterial asset defining rendering passes and their properties.
MeshInfoRead-only metadata describing the geometry and rigging of a mesh asset.
MLAssetMachine learning model asset.
NamedInstanceInfoRead-only named axis preset from the font's fvar table, for example "Condensed Bold". Returned from Font.namedInstances. Apply one by setting a Text.preferredStyle on a Text component to the instance's name.
NativePackageDescriptorMetadata descriptor for a native package asset.
Object3DAssetBase asset type for 3D object models.
ObjectOwnerBase class for entities which has object and component relationship such as Editor.Assets.Scene and Editor.Assets.ObjectPrefab.
ObjectPrefabReusable object template that can be instantiated in scenes.
ObjectTrackingTextureA native asset that provides information for object tracking texture. Learn more at LensScripting.ObjectTrackingTextureProvider. Import with Editor.Model.AssetManager#createNativeAsset.
PassRendering pass asset used within a material.
PassBindingDefines a binding parameter for a render pass with metadata for UI presentation and value constraints.
PassConfigurationPlain configuration object describing a Pass asset, blend mode, and shader defines to apply to a PassInfo via setPassConfiguration.
PassInfoThe Editor.Assets.Pass on a Editor.Assets.Material.
PassUiDataShader pass UI configuration data.
PerformanceCompressionSettingsSets runtime-performance-tuned texture compression with optional mipmaps; assign to AssetImportMetadata.compressionSettings.
PhysicsNamespace for physics-related assets and configuration.
RemoteAssetMetadata-
RemoteAssetOrganization-
RemoteAssetResource-
RemoteMLAssetML asset backed by a remote device-dependent resource.
RemoteReferenceAssetReference to a remote asset identified by an asset ID.
RenderMesh3D mesh asset for rendering geometry.
RenderTargetA native asset that provides the target for a camera to provide its output to. Import with Editor.Model.AssetManager#createNativeAsset.
SamplerTexture sampling configuration for filtering, mipmapping, and wrapping modes.
SceneThe entity which will be converted into the Lens scene during project export. This scene will contain and own all objects and components in the Lens. This entity can be accessed via the current project’s model.project.scene.
ScriptAssetScript asset that can be attached to scene objects, containing inputs, attachments, and metadata.
ScriptInputInfoMetadata about a script input parameter.
SegmentationTextureA native asset that provides information for segmentation texture. Import with Editor.Model.AssetManager#createNativeAsset.
SetupScriptScript executed during asset package setup.
SizeCompressionSettingsSets size-prioritized texture compression at a configurable quality level; assign to AssetImportMetadata.compressionSettings.
SnapcodeMarkerA native asset that can be used with LensScripting.MarkerTrackingComponent Learn more at LensScripting.SnapcodeMarkerProvider. Import with Editor.Model.AssetManager#createNativeAsset.
SubgraphAssetAsset representing a subgraph embeddable in other graphs.
SupabaseProjectSupabase project asset with connection credentials.
TextureBase texture asset.
TextureParameterAssociates a texture with a sampler for use in a material pass.
TypeScriptAssetTypeScript script asset for Lens Studio plugins.
VariationAxisInfoRead-only metadata describing one OpenType variation axis on a variable font. Returned from Font.variationAxes.
VectorCompositeVector graphics asset created by importing an SVG file.
VersionUsed to set the version of script assets.
VideoTextureTexture asset created by importing a video file.