LensStudio:AssetLibrary.AssetListSuccess
ClassThe result of a fetch call by the "LensStudio:AssetLibrary".AssetListService, which provides you a list of matching assets in the Asset Library.
Index
Properties
Example
// AssetListSuccess is the data payload inside a successful AssetListResponse.
// It has a protected constructor — you read it from response.data.
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 = 'material';
const response = await provider.assetService.fetchAsync(
new AssetListRequest(envSetting, filter)
);
if (response.ok && response.data) {
const success = response.data; // AssetListSuccess
console.log('Found', success.assets.length, 'assets');
const first = success.assets[0];
if (first) {
console.log('First asset:', first.assetId, first.assetName, first.assetType);
}
}
Properties
assets
readonlyassets:Asset[]
Array of assets returned from a successful asset list request.