LensStudio:AssetLibrary.AssetListService
ClassA handle to the "LensStudio:AssetLibrary".AssetListService which can provide a list of assets based on the passed in parameters.
Index
Example
// AssetListService provides fetchAsync() to query the asset library.
// Obtain it from IAssetLibraryProvider.assetService.
const provider = this.pluginSystem.findInterface(
IAssetLibraryProvider.interfaceId
) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;
const service = provider.assetService;
const envSetting = new EnvironmentSetting();
envSetting.environment = Environment.Production;
envSetting.space = Space.Public;
const filter = new AssetFilter();
filter.searchText = 'material';
const request = new AssetListRequest(envSetting, filter);
const response = await service.fetchAsync(request);
if (response.ok && response.data) {
console.log('Found', response.data.assets.length, 'assets');
}
Extends
Methods
fetchAsync()
fetchAsync(
request):Promise<AssetListResponse>
Fetches a list of assets from the Asset Library matching the given request, returning a promise that resolves to an AssetListResponse.
Parameters
| Parameter | Type |
|---|---|
request | AssetListRequest |
Returns
Promise<AssetListResponse>
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean