Skip to content
Peter Shinners edited this page Apr 13, 2021 · 5 revisions
void  getAssetFields(const std::string& assetId, bool includeDefaults,
        StringMap& returnFields)
  • @param assetId Input asset id.
  • @param 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.
  • @param returnFields Fill map with key/value strings representing asset fields.

Returns a dictionary of fields from a given asset ID.

Convert from asset id to a set of named string fields defining the asset. The dictionary values and keys should both be strings.

The minimum set of fields are "name" and "version". Other fields are preserved but ignored by Katana.

If includeDefaults is 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.

Convert from asset id to a dictionary of strings defining the asset. If includeDefaults is true, include default values for fields not explicitly specified by the assetId.

The fields of an asset are the key components needed to retrieve an asset from an asset management system. Katana assumes that an asset has a name field and - if provided - also uses a version field.

Note: It is fine to leave this method unimplemented if your asset management system has no use for it.

This should return the individual tokens or field names that compose the asset id, generally not complete nids to anything.

The "File, Version Up And Save" main menu option will be enabled if the current file path "version" exists in getAssetFields(path, True) (This should always be true anyways, since when includeDefaults=True all possible keys should be defined, meaning there will be a "version", it doesn't matter what the value is, just as long as the key exists.)

The 'name' fields gets placed into the root "katanaSceneName" when saved. This is the result of KatanaFile.GetKatanaSceneName().

Args: assetId (str) : String to evaluate includeDefaults (bool) : Include additional undefined values

Returns: (dict) Fields that describe an asset id

Clone this wiki locally