|
Katana Plug-in APIs 0.1
|
Public Member Functions | |
| void | reset () |
| Reset will be called when Katana flushes its caches, giving the plugin a chance to reset. | |
| bool | isAssetId (const std::string &name) |
| Return whether the input string represents a valid asset id. | |
| bool | containsAssetId (const std::string &name) |
| Return whether the input string contains a valid asset id anywhere within it. | |
| bool | checkPermissions (const std::string &assetId, const StringMap &context) |
| Returns whether permissions for the given asset id are valid in the given context. | |
| bool | runAssetPluginCommand (const std::string &assetId, const std::string &command, const StringMap &commandArgs) |
| Runs a custom command for the given asset id. | |
| void | resolveAsset (const std::string &assetId, std::string &ret) |
| Lookup asset id in asset system and return path (or other string) that it references. | |
| void | resolveAllAssets (const std::string &str, std::string &ret) |
| Replace any asset ids found in input string with resolved asset strings. | |
| void | resolvePath (const std::string &str, const int frame, std::string &ret) |
| Resolve env vars in input path string, then resolve asset ids and file sequences. | |
| void | resolveAssetVersion (const std::string &assetId, std::string &ret, const std::string &versionStr=std::string()) |
| Return the version that this asset id resolves to. | |
| void | getUniqueScenegraphLocationFromAssetId (const std::string &assetId, bool includeVersion, std::string &ret) |
| Return a valid scenegraph location path that uniquely represents the input asset id. | |
| void | getAssetDisplayName (const std::string &assetId, std::string &ret) |
| Returns a string that can be used in GUIs, for example. | |
| void | getAssetVersions (const std::string &assetId, StringVector &ret) |
| Returns a vector of strings listing the available versions for the given asset. | |
| void | getRelatedAssetId (const std::string &assetId, const std::string &relation, std::string &ret) |
| Return asset id that is related to input asset, given a relationship type. | |
| void | getAssetFields (const std::string &assetId, bool includeDefaults, StringMap &returnFields) |
| Convert from asset id to a set of named string fields defining the asset. | |
| void | buildAssetId (const StringMap &fields, std::string &ret) |
| Convert from asset fields to asset id. | |
| void | getAssetAttributes (const std::string &assetId, const std::string &scope, StringMap &returnAttrs) |
| Get metadata associated with an asset or a scoped item in the asset hierarchy. | |
| void | setAssetAttributes (const std::string &assetId, const std::string &scope, const StringMap &attrs) |
| Set metadata associated with an asset or a scoped item in the asset hierarchy. | |
| void | getAssetIdForScope (const std::string &assetId, const std::string &scope, std::string &ret) |
| Get partial asset id scoped to the specified level in the asset hierarchy. | |
| void | createAssetAndPath (FnKat::AssetTransaction *txn, const std::string &assetType, const StringMap &assetFields, const StringMap &args, bool createDirectory, std::string &assetId) |
| Create asset and optional directory path. | |
| void | postCreateAsset (FnKat::AssetTransaction *txn, const std::string &assetType, const StringMap &assetFields, const StringMap &args, std::string &assetId) |
| Creates an asset after the creation of the files to be published. | |
| void FileAsset::buildAssetId | ( | const StringMap & | fields, |
| std::string & | ret | ||
| ) | [virtual] |
Convert from asset fields to asset id.
The inverse of getAssetFields, this takes a set of asset fields and returns an asset id string.
| fields | String map containing key/value strings representing asset fields. |
| ret | Set to asset id. |
Implements Foundry::Katana::Asset.
| bool FileAsset::checkPermissions | ( | const std::string & | assetId, |
| const StringMap & | context | ||
| ) | [virtual] |
Returns whether permissions for the given asset id are valid in the given context.
| assetId | Asset id to check permissions for. |
| context | Additional strings used to specify more details about permissions to be checked. Examples include current user or current show environment. |
Implements Foundry::Katana::Asset.
| bool FileAsset::containsAssetId | ( | const std::string & | str | ) | [virtual] |
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.
| str | The string to test. |
Implements Foundry::Katana::Asset.
| void FileAsset::createAssetAndPath | ( | FnKat::AssetTransaction * | txn, |
| const std::string & | assetType, | ||
| const StringMap & | assetFields, | ||
| const StringMap & | args, | ||
| bool | createDirectory, | ||
| std::string & | assetId | ||
| ) | [virtual] |
Create asset and optional directory path.
| txn | Handle to transaction object. If null, asset/directory creation is done immediately. |
| assetType | Type of Katana asset to create (e.g. katana scene, image, shadow, etc) |
| assetFields | GroupAttribute representing asset fields for asset to create (same as getAssetFields output). |
| args | Additional args used to specify more details (may differ based on assetType). Examples include "versionUp", which is a boolean determining whether to version up an existing asset or "colorspace" if the assetId is of the type "image" (in which if this is provided it should be seen as an Attribute to be associated with the asset) |
| createDirectory | Boolean specifying whether to create the directory associated with this asset. |
| assetId | Set to the asset id created (or that will be created on transaction commit). |
Implements Foundry::Katana::Asset.
| void FileAsset::getAssetAttributes | ( | const std::string & | assetId, |
| const std::string & | scope, | ||
| StringMap & | returnAttrs | ||
| ) | [virtual] |
Get metadata associated with an asset or a scoped item in the asset hierarchy.
This differs from the above "asset fields" which are the fields that uniquely define the asset itself. This metadata may include fields such as asset creator, creation time, etc.
| assetId | Asset for which to return metadata. |
| scope | Optional string specifying scope for metadata lookup, such as "name" or "version". |
| returnAttrs | Fill with key/value strings representing metadata attributes. |
Implements Foundry::Katana::Asset.
| void FileAsset::getAssetDisplayName | ( | const std::string & | assetId, |
| std::string & | ret | ||
| ) | [virtual] |
Returns a string that can be used in GUIs, for example.
| assetId | The asset for which the display name is required |
| ret | Return value with the display name. |
Implements Foundry::Katana::Asset.
| void FileAsset::getAssetFields | ( | const std::string & | assetId, |
| bool | includeDefaults, | ||
| StringMap & | returnFields | ||
| ) | [virtual] |
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.
| 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 | Fill map with key/value strings representing asset fields. |
Implements Foundry::Katana::Asset.
| void FileAsset::getAssetIdForScope | ( | const std::string & | assetId, |
| const std::string & | scope, | ||
| std::string & | ret | ||
| ) | [virtual] |
Get partial 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", return 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.
| assetId | Input asset id. |
| scope | String specifying scope for result asset id, such as "name" or "version". |
| ret | Set to result asset id. |
Implements Foundry::Katana::Asset.
| void FileAsset::getAssetVersions | ( | const std::string & | assetId, |
| StringVector & | ret | ||
| ) | [virtual] |
Returns a vector of strings listing the available versions for the given asset.
| assetId | The asset who's versions we want |
| ret | The string vector of available versions |
Implements Foundry::Katana::Asset.
| void FileAsset::getRelatedAssetId | ( | const std::string & | assetId, |
| const std::string & | relation, | ||
| std::string & | ret | ||
| ) | [virtual] |
Return asset id that is related to input asset, given a relationship type.
A general function for getting related assets. An current example in Katana is an "argsxml" asset defining the UI for a renderer procedural asset.
| assetId | Input asset id for which to find related asset. |
| relation | String representing relationship type. |
| ret | Set to related assed id (or empty string if no related asset is found). |
Implements Foundry::Katana::Asset.
| void FileAsset::getUniqueScenegraphLocationFromAssetId | ( | const std::string & | assetId, |
| bool | includeVersion, | ||
| std::string & | ret | ||
| ) | [virtual] |
Return a valid scenegraph location path that uniquely represents the input asset id.
This will be used as the default location for look file materials loaded into the Katana scene, for example. (Example: /name/version/other/fields).
| assetId | Input asset id to represent as scenegraph location path. |
| includeVersion | allows to specify if the scenegraph location path should contain the asset version |
| ret | Set to scenegraph location path. |
Implements Foundry::Katana::Asset.
| bool FileAsset::isAssetId | ( | const std::string & | str | ) | [virtual] |
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.
| str | The string to test. |
Implements Foundry::Katana::Asset.
| void FileAsset::postCreateAsset | ( | FnKat::AssetTransaction * | txn, |
| const std::string & | assetType, | ||
| const StringMap & | assetFields, | ||
| const StringMap & | args, | ||
| std::string & | assetId | ||
| ) | [virtual] |
Creates an asset after the creation of the files to be published.
| txn | Handle to transaction object. If null, asset/directory creation is done immediately. |
| assetType | Type of Katana asset to create (e.g. katana scene, image, shadow, etc) |
| assetFields | GroupAttribute representing asset fields for asset to create (same as getAssetFields output). |
| args | Additional args used to specify more details (may differ based on assetType). Examples include "versionUp", which is a boolean determining whether to version up an existing asset. |
| assetId | Set to the asset id created (or that will be created on transaction commit). |
Implements Foundry::Katana::Asset.
| void FileAsset::resolveAllAssets | ( | const std::string & | str, |
| std::string & | ret | ||
| ) | [virtual] |
Replace any asset ids found in input string with resolved asset strings.
| str | Input string to resolve. |
| ret | Set to resolved asset string. |
Implements Foundry::Katana::Asset.
| void FileAsset::resolveAsset | ( | const std::string & | assetId, |
| std::string & | ret | ||
| ) | [virtual] |
Lookup asset id in asset system and return path (or other string) that it references.
| assetId | Asset id to resolve. |
| ret | Set to resolved asset string. |
Implements Foundry::Katana::Asset.
| void FileAsset::resolveAssetVersion | ( | const std::string & | assetId, |
| std::string & | ret, | ||
| const std::string & | versionStr = std::string() |
||
| ) | [virtual] |
Return the version that this asset id resolves to.
| assetId | Input asset id resolve. |
| ret | Returns the version that this asset id resolves to. |
| versionStr | In some asset management systems the version can be specified by keywords (example: latest, aproved, etc) that might be associated to a specific version number. If versionStr is specified, then the plugin will try to return (on ret) the resolved string number for the assetId specified by str and the given version keyword (the versionStr value). |
Implements Foundry::Katana::Asset.
| void FileAsset::resolvePath | ( | const std::string & | str, |
| const int | frame, | ||
| std::string & | ret | ||
| ) | [virtual] |
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.
| str | Input path string to resolve. |
| frame | Frame number to resolve file sequences with. |
| ret | Set to resolved path string. |
Implements Foundry::Katana::Asset.
| bool FileAsset::runAssetPluginCommand | ( | const std::string & | assetId, |
| const std::string & | command, | ||
| const StringMap & | commandArgs | ||
| ) | [virtual] |
Runs a custom command for the given asset id.
| assetId | Asset id the command will be run on. |
| command | Name of the command to run. |
| commandArgs | Key-string pair representing the command arguments. |
Implements Foundry::Katana::Asset.
| void FileAsset::setAssetAttributes | ( | const std::string & | assetId, |
| const std::string & | scope, | ||
| const StringMap & | attrs | ||
| ) | [virtual] |
Set metadata associated with an asset or a scoped item in the asset hierarchy.
This differs from the above "asset fields" which are the fields that uniquely define the asset itself. This metadata may include fields such as asset creator, creation time, etc.
| assetId | Asset for which to set metadata. |
| scope | Optional string specifying scope for metadata lookup, such as "name" or "version". |
| attrs | String map containing key/value strings representing metadata attributes. |
Implements Foundry::Katana::Asset.
1.7.3