Download Amazon VERSION 2.0V1 User guide
Transcript
27 ASSET MANAGEMENT SYSTEM PLUG-IN API | PUBLISHING AN ASSET A dictionary containing additional information about what asset type to create. For example, should we increment the asset version? Is it an image, is it a Katana file? This is populated directly by the caller of createAssetAndPath () and varies with the asset type. • createDirectory A Boolean indicating that a new directory for the asset needs to be created. createAssetAndPath() should return the Asset ID of the newly created asset. This may be different to the serialized Asset ID representation of the fields passed in. For example, if createAssetAndPath() were to versionUp the asset the returned Asset ID would likely be different to the serialized fields passed in. The returned Asset ID can be stored as a parameter on the node using this plug-in (if it is being used by a node). The important arguments are assetType, fields and args. There are no rules for how the args dictionary is populated. It depends on the calling context and the Asset Type that createAssetAndPath() was invoked for. postCreateAsset() postCreateAsset() is invoked after Katana has finished writing to an asset file and is used to finalize the publication of the asset. The args dictionary for this type contains: • txn The Asset Transaction. • assetType A string representing which of the supported asset types is published. See Asset Types and Contexts for a list of the asset types, and contexts. • fields The fields that represent the location of the asset. These fields are the identical to those given to createAssetAndPath(). • args A dictionary of strings containing additional information about what asset type to create. For example, should we increment the asset version? If it is an image, what resolution should it be? Examples Selecting File > Version Up and Save triggers createAssetAndPath() to be invoked with an args dictionary, in which the versionUp and publish keys are set to ’True’. This results in a different Asset ID to that of the serialized fields passed in. versionUp indicates that a new version of the asset should be published. Selecting File > Save triggers createAssetAndPath(), invoked with versionUp and publish set to False, unless a custom asset browser has been written. In that case, versionUp and publish are based on the values returned from the getExtraOptions() method of a custom browser class. See Configuring the Asset Browser for more on this. 208
Related documents