Skip to main content

LensStudio:AssetLibrary.Asset

Class

A handle for an asset from the Asset Library.

Index

Example

// AssetLibrary.Asset represents a single entry in the online asset library.
// It has a protected constructor -- you receive Asset objects from service responses.
// Demonstrates reading Asset properties from a query response:
const { IAssetLibraryProvider, AssetFilter, AssetListRequest, EnvironmentSetting, Environment, Space } = await import('LensStudio:AssetLibrary');
const provider = this.pluginSystem.findInterface(IAssetLibraryProvider.interfaceId) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;
const filter = new AssetFilter();
filter.searchText = '3D';
const envSetting = new EnvironmentSetting();
envSetting.environment = Environment.Production;
envSetting.space = Space.Public;
const request = new AssetListRequest(envSetting, filter);
const response = await provider.assetService.fetchAsync(request);
if (response.ok && response.data) {
const asset = response.data.assets[0];
console.log('assetId:', asset.assetId);
console.log('assetName:', asset.assetName);
console.log('description:', asset.description);
}

Properties

assetId

readonly assetId: string

The id of the asset.


assetName

readonly assetName: string

The name of the asset.


assetType

readonly assetType: AssetType

The type of the asset.


complexity

readonly complexity: number

Complexity rating of the asset.


creator?

readonly optional creator?: Creator

Name or identifier of the asset's creator.


description

readonly description: string

Short description of the asset.


documentationUrl

readonly documentationUrl: string

URL pointing to the asset's documentation page.


fullDescription

readonly fullDescription: string

Full-length description of the asset.


maxLsVersion

readonly maxLsVersion: Version

Maximum Lens Studio version compatible with this asset.


platforms

readonly platforms: Platform[]

List of platforms the asset supports.


previews

readonly previews: Resource[]

Preview images or media associated with the asset.


resources

readonly resources: Resource[]

A handle for the resources contained in the asset that can be downloaded.


subcategories

readonly subcategories: Subcategory[]

Subcategory tags assigned to the asset.