Skip to main content

LensStudio:AssetLibrary.AssetType

Enum

The types of assets that might be provided by the "LensStudio:AssetLibrary".

Index

Example

// AssetType is the discriminator on each Asset returned from the library —
// AssetFilter narrows by text/category, but to filter by type you check
// asset.assetType after the fetch. Below: pull custom components only.
const provider = this.pluginSystem.findInterface(
IAssetLibraryProvider.interfaceId
) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;

const envSetting = new EnvironmentSetting();
envSetting.environment = Environment.Production;
envSetting.space = Space.Public;

const filter = new AssetFilter();
filter.searchText = 'tween';

const response = await provider.assetService.fetchAsync(
new AssetListRequest(envSetting, filter)
);

if (response.ok && response.data) {
const customComponents = response.data.assets.filter(
a => a.assetType === AssetType.CustomComponent
);
console.log(`Found ${customComponents.length} custom components`);
for (const c of customComponents.slice(0, 3)) {
console.log(' -', c.assetName);
}
}

Enumeration Members

AnimatedTexture

AnimatedTexture: number

Represents an animated texture asset.


AssetPackage

AssetPackage: number

Represents a packaged bundle of assets.


Audio

Audio: number

Represents an audio asset.


CustomComponent

CustomComponent: number

Represents a custom component asset.


Default

Default: number

Default asset type used when no specific type is specified.


Guide

Guide: number

Represents a guide or tutorial asset.


Invalid

Invalid: number

Represents an unrecognized or unset asset type.


Material

Material: number

Represents a material asset.


Mesh3D

Mesh3D: number

Represents a 3D mesh asset.


MLModel

MLModel: number

Represents a machine learning model asset.


Music

Music: number

Represents a music asset.


ObjectPrefab

ObjectPrefab: number

Represents a reusable scene object prefab.


ObjectPreset

ObjectPreset: number

Represents a predefined scene object preset.


Plugin

Plugin: number

Represents a plugin asset.


ProjectTemplate

ProjectTemplate: number

Represents a project template asset.


RemoteApi

RemoteApi: number

Represents a remote API asset.


Script

Script: number

Represents a script asset.


Texture

Texture: number

Represents a static texture asset.


Video

Video: number

Represents a video asset.