Allows the access to the currently set Asset Management System plugin.
More...
#include <FnDefaultAssetPlugin.h>
List of all members.
Static Public Member Functions |
| static bool | isAssetId (const std::string &str, bool throwOnError=false) |
| | Return whether the input string represents a valid asset id.
|
| static bool | containsAssetId (const std::string &str, bool throwOnError=false) |
| | Return whether the input string contains a valid asset id anywhere within it.
|
| static std::string | resolveAsset (const std::string &assetId, bool throwOnError=false) |
| | Lookup asset id in asset system and return path (or other string) that it references.
|
| static std::string | resolveAllAssets (const std::string &inputString, bool throwOnError=false) |
| static std::string | resolvePath (const std::string &path, int frame, bool throwOnError=false) |
| | Resolve env vars in input path string, then resolve asset ids and file sequences.
|
| static bool | getAssetAttributes (const std::string &assetId, const std::string &scope, std::map< std::string, std::string > &attributesMap, bool throwOnError=false) |
| static bool | checkPermissions (const std::string &assetId, const std::map< std::string, std::string > &context, bool throwOnError=false) |
| static std::string | resolveAssetVersion (const std::string &assetId, const std::string &versionTag=std::string(), bool throwOnError=false) |
| static std::string | getAssetDisplayName (const std::string &assetId, bool throwOnError=false) |
| static bool | getAssetVersions (const std::string &assetId, std::vector< std::string > &versions, bool throwOnError=false) |
| static bool | getAssetFields (const std::string &assetId, bool includeDefaults, std::map< std::string, std::string > &returnFields, bool throwOnError=false) |
| static std::string | buildAssetId (const std::map< std::string, std::string > &fields, bool throwOnError=false) |
| static std::string | getAssetIdForScope (const std::string &assetId, const std::string &scope, bool throwOnError=false) |
Detailed Description
Allows the access to the currently set Asset Management System plugin.
This class can be used when a plugin (a Scenegraph Generator, for example) needs to resolve or publish assets using the Asset Management System Plugin set on the current scene (regardless if it is implemented in C++ or Python)....
Member Function Documentation
| static std::string Foundry::Katana::DefaultAssetPlugin::buildAssetId |
( |
const std::map< std::string, std::string > & |
fields, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Builds and return a new asset id using the given fields.
- Parameters:
-
| fields | A map of fields used to build the new asset id. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- The new asset id, on success. Otherwise an empty string.
| static bool Foundry::Katana::DefaultAssetPlugin::checkPermissions |
( |
const std::string & |
assetId, |
|
|
const std::map< std::string, std::string > & |
context, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Returns whether permissions for the given asset id are valid in the given context.
- Parameters:
-
| assetId | The id of the asset to check permission for. |
| context | |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
| static bool Foundry::Katana::DefaultAssetPlugin::containsAssetId |
( |
const std::string & |
str, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Return whether the input string contains a valid asset id anywhere within it.
Should parse the input string to determine whether it contains a valid asset id. Should not attempt to determine whether any asset ids found in the string actually exist in the asset database.
- Parameters:
-
| str | The string to test. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- True if the string contains a valid asset id.
| static bool Foundry::Katana::DefaultAssetPlugin::getAssetAttributes |
( |
const std::string & |
assetId, |
|
|
const std::string & |
scope, |
|
|
std::map< std::string, std::string > & |
attributesMap, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Gets metadata associated with an asset or a scoped item in the asset hierarchy.
- Parameters:
-
| assetId | The id of the asset to search for metadata. |
| scope | A scoped item name. |
| attributesMap | A map to be filled with the metadata attributes of the given asset. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
| static std::string Foundry::Katana::DefaultAssetPlugin::getAssetDisplayName |
( |
const std::string & |
assetId, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Returns a name suitable for displaying to the user for the given asset id.
- Parameters:
-
| assetId | The asset id to look for display name. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- The display name of the given asset.
| static bool Foundry::Katana::DefaultAssetPlugin::getAssetFields |
( |
const std::string & |
assetId, |
|
|
bool |
includeDefaults, |
|
|
std::map< std::string, std::string > & |
returnFields, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Convert from asset id to a set of named string fields defining the asset.
The minimum set of fields are "name" and "version". Other fields are preserved but ignored by Katana.
- Parameters:
-
| assetId | Input asset id. |
| includeDefaults | If true, return the full set of fields for this asset system, including defaults not specified in the asset id. If false, return only the fields specified in the asset id. |
| returnFields | A map to be filled with the asset fields. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- True on success.
| static std::string Foundry::Katana::DefaultAssetPlugin::getAssetIdForScope |
( |
const std::string & |
assetId, |
|
|
const std::string & |
scope, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Gets an asset id scoped to the specified level in the asset hierarchy.
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.
- Parameters:
-
| assetId | The input asset id. |
| scope | A string specifying scope for result asset id, such as "name" or "version". |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- A string containing the result asset id.
| static bool Foundry::Katana::DefaultAssetPlugin::getAssetVersions |
( |
const std::string & |
assetId, |
|
|
std::vector< std::string > & |
versions, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Gets a list of all the available versions of the given asset.
- Parameters:
-
| assetId | The asset id to look for available versions. |
| versions | The vector to be filled with the available versions of the given asset. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- True on success.
| static bool Foundry::Katana::DefaultAssetPlugin::isAssetId |
( |
const std::string & |
str, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Return whether the input string represents a valid asset id.
Should parse the input string to determine whether it is a valid asset id. Should not attempt to determine whether the asset actually exists in the asset database.
- Parameters:
-
| str | The string to test. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- True if the string is valid asset id syntax.
| static std::string Foundry::Katana::DefaultAssetPlugin::resolveAllAssets |
( |
const std::string & |
inputString, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Replace any asset ids found in the given input string with resolved asset strings.
- Parameters:
-
| inputString | The string to be searched for asset ids. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- The string with all asset ids replaced with resolved asset strings.
| static std::string Foundry::Katana::DefaultAssetPlugin::resolveAsset |
( |
const std::string & |
assetId, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Lookup asset id in asset system and return path (or other string) that it references.
- Parameters:
-
| assetId | Asset id to resolve. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- The resolved asset string.
| static std::string Foundry::Katana::DefaultAssetPlugin::resolveAssetVersion |
( |
const std::string & |
assetId, |
|
|
const std::string & |
versionTag = std::string(), |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Returns the version for a given asset id. If it is a partial asset id (which does not have a version) then an empty string is returned.
- Parameters:
-
| assetId | The asset id to resolve. |
| versionTag | An optional version tag to use for determining the resulting version. Can be an explicit version number or a special tag such as "latest" or "approved". |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- String with the integer version number that this asset id resolves to, or an empty string if an error occurs.
| static std::string Foundry::Katana::DefaultAssetPlugin::resolvePath |
( |
const std::string & |
path, |
|
|
int |
frame, |
|
|
bool |
throwOnError = false |
|
) |
| [static] |
Resolve env vars in input path string, then resolve asset ids and file sequences.
File sequence will most likely be resolved using default file sequence plugin from host. This is a good candidate for some base functionality in the C++ wrappers on the plugin side.
- Parameters:
-
| path | Input path string to resolve. |
| frame | Frame number to resolve file sequences with. |
| throwOnError | Boolean setting whether to throw an exception on error. |
- Returns:
- The resolved path string.
The documentation for this class was generated from the following file: