Skip to main content

LensStudio:AssetUtils.js.findAsset

Function

Finds an asset in the asset manager based on the specified type, name, and optional parent directory.

findAsset(assetManager, assetType, assetName, parentDir?): Asset[]

Finds an asset in the asset manager based on the specified type, name, and optional parent directory.

Parameters

ParameterTypeDescription
assetManagerAssetManager-
assetTypestringThe type of the asset to find.
assetNamestringThe name of the asset to find.
parentDir?Path(Optional) The parent directory of the asset. If provided, the asset's source path must match this directory.

Returns

Asset[]

An array of assets that match the specified criteria.