Skip to content
Peter Shinners edited this page Apr 16, 2021 · 7 revisions
void  getAssetIdForScope(
    const std::string& assetId,
    const std::string& scope,
    std::string& ret
)

Modify an assetId into another assetId.

The most common use for this function is to remove a specific version number from an assetId. Katana will pass a scope of "name" to represent this request.

It is possible for an asset plugin to define additional scopes like "shot" or "show". But whatever assetId that returns would be defined by the asset plugin.

Should return a more general asset reference to the given asset id. For instance, if scope is "name", returns an asset id that doesn't include a specific version number. This may not make sense in some asset systems, in which case, return the input asset id.

This method must always return an assetId. If the requested scope does not match the given assetId this function must copy the unmodified assetId into ret.

Katana can also request the scope be "version" which may want to add information about the latest version to an assetId that is only for "name".

Other methods getAssetAttributes and setAssetAttributes take a similar scope argument to get the behavior of this method without having to call this directly.

Katana uses this method with a scope of "name" to collapse recently used versions of the same asset name into a single entry in the recently used history. That unversioned string will then be used when loading a recent file with resolveAsset.

It is possible LookFileManager will also use this call with scope always set to "version".