Skip to main content

LensStudio:AssetUtils.js.findOrCreateNonNativeAsset

Function

Finds or creates an asset in the asset manager.

findOrCreateNonNativeAsset(assetManager, assetAbsPath, destDirInProject): Promise<Asset>

Finds or creates an asset in the asset manager.

Parameters

ParameterTypeDescription
assetManagerAssetManagerThe asset manager instance.
assetAbsPathPathThe absolute path of the asset.
destDirInProjectPathThe destination directory in the project. this is a relative path to the project Assets root.

Returns

Promise<Asset>

The primary asset found or created.

Throws

Error if there is an error importing the asset or if the import result is invalid.