exportHook.py contains all the hooks related to exporting clips.
These hooks are used when the user exports from the application.
Export hooks are called in the following order:

Every method in the export hooks has access to two dictionaries, userData and info. userData allows you to pass custom information between methods, with a scope covering the whole export session. info stores system information used by the application's export processes, but with a scope limited to the current method.
#The keys for 'profiles' are the items that appear in the
# contextual menu in the application
def getCustomExportProfiles( profiles ):
profiles['Post for review']= {'exportType':'forReview'} #Adds an entry to the 'userData' dictionary
profiles['Package'] = {'exportType':'packageInternal'} #Adds an entry to the 'userData' dictionary
Once the user selects a custom export option, the next hook that is fired is preCustomExport(), where the information about the export is set, based on the entry the user has selected.
def preCustomExport( info, userData ):
#Test what 'exportType' was select in the UI, by the user
if userData['exportType'] == 'forReview':
#Set the proper 'presetPath' in the info dictionary
#This defines which preset is used for the custom encode job
info['presetPath'] = '/path/to/export/presets/uncompressed_qt.xml'
#Set the 'destinationPath' in the info dictionary
info['destinationPath'] = '/path/to/Flame/exports/' + CURRENT_PROJECT + '/'
if userData['exportType'] == 'Package':
#do something else...
In the above example, the option the user selects from the contextual menu defines the what is performed in the preCustomExport().
Called before a custom export begins. This can be used to fill information that would have normally been extracted from the export window.
def preCustomExport( info, userData ): pass
| Key | Description | Data Type |
|---|---|---|
| destinationHost | Editable. Name of the host where the exported files will be written. Defaults to localhost. | String |
| destinationPath | Editable. Export path root. This path will probably be added to by the actual Preset path. Defaults to /tmp. | String |
| presetPath | Editable. Path to the preset used for the Export. | String |
| useTopVideoTrack | Editable. Use only the top video track and ignore the other ones. False if not defined. | Boolean |
| exportBetweenMarks | Editable. Export between the In and Out marks, excluding the marked frames. Without In, export from start of sequence to Out; without Out, export from the In to the end of the sequence. False if not defined. | Boolean |
| isBackground | Editable. Perform the export in background. True if not defined. | Boolean |
| abort | Editable. Set abort to True to abort the export process. | Boolean |
| abortMessage | Editable. The error message to be displayed to the user when the export process has been aborted. | String |
Called after a custom export ends.
def postCustomExport( info, userData ): pass
| Key | Description | Data Type |
|---|---|---|
| destinationHost | Name of the host where the exported files were written to. | String |
| destinationPath | Root of the export path. | String |
| presetPath | Path to the preset used for the Export. | String |
Called before an export begins
def preExport( info, userData ): pass
| Key | Description | Data Type |
|---|---|---|
| destinationHost | Name of the host where the exported files will be written to. | String |
| destinationPath | Root of the export path. | String |
| abort | Editable. Set abort to True to abort the export process. | Boolean |
| abortMessage | Editable. The error message to be displayed to the user when the export process has been aborted. | String |
Called after an export ends.
def postExport( info, userData ): pass
| Key | Description | Data Type |
|---|---|---|
| destinationHost | Name of the host where the exported files were written to. | String |
| destinationPath | Root of the export path. | String |
Called before an sequence export begins.
def preExportSequence( info, userData ): pass
| Key | Description | Data Type |
|---|---|---|
| destinationHost | Name of the host where the exported files were written to. | String |
| destinationPath | Root of the export path. | String |
| sequenceName | Name of the exported sequence. | String |
| shotNames | Tuple of every shot name in the exported sequence. Note that multiple segments can use the same shot name: segments sharing shot names are part of the same shot. | String |
| abort | Editable. Set abort to True to abort the export process. | Boolean |
| abortMessage | Editable. The error message to be displayed to the user when the export process has been aborted. | String |
Called after a sequence export ends.
def postExportSequence( info, userData ): pass
| Key | Description | Data Type |
|---|---|---|
| destinationHost | Name of the host where the exported files were written to. | String |
| destinationPath | Root of the export path. | String |
| sequenceName | Name of the exported sequence. | String |
| shotNames | Tuple of every shot name in the exported sequence. Note that multiple segments can use the same shot name: segments sharing shot names are part of the same shot. | String |
Called before an asset export begins.
def preExportAsset( info, userData ): pass
| Key | Description | Data Type |
|---|---|---|
| destinationHost | Name of the host where the exported files were written to. | String |
| destinationPath | Root of the export path. | String |
| namePattern | List of optional naming tokens as entered in the application UI. | String |
| resolvedPath | Editable.Path (relative to destinationPath) with the tokens resolved. | String |
| name | Name of the exported asset. | String |
| sequenceName | Name of the sequence to which this asset belongs. | String |
| shotNames | Name of the shot to which this asset belongs. | String |
| assetType | Type of the exported asset. Possible values:
|
String |
| width | Frame width of the exported asset. | Long |
| height | Frame height of the exported asset. | Long |
| aspectRatio | Frame aspect ratio of the exported asset. | Double |
| depth | Bit depth of the exported asset. Possible values:
|
String |
| scanFormat | Scan format of the exported asset. Possible values:
|
String |
| fps | Frame rate of the exported asset. | Double |
| sequenceFps | Frame rate of the sequence to which this asset belongs. | Double |
| sourceIn | The source In point as a frame, using the asset frame rate (the fps key). | Integer |
| sourceOut | The source Out point as a frame, using the asset frame rate (the fps key). | Integer |
| recordIn | The record In point as frame, using the sequence frame rate (the sequenceFps key). | Integer |
| recordOut | The record Out point as a frame, using the sequence frame rate (the sequenceFps key). | Integer |
| handleIn | Head as a frame, using the asset frame rate (fps key). | Integer |
| handleOut | Tail as a frame, using the asset frame rate (fps key). | Integer |
| track | ID of the sequence's track that contains the asset. | String |
| trackName | Name of the sequence's track that contains the asset. | String |
| segmentIndex | Asset index (1 based) in the track. | Integer |
| versionName | Current version name of this export. Empty if unversionned. | String |
| versionNumber | Current version number of this export. Zero if unversionned. | String |
Called after an asset export ends.
def postExportAsset( info, userData ): pass
| Key | Description | Data Type |
|---|---|---|
| destinationHost | Name of the host where the exported files were written to. | String |
| destinationPath | Root of the export path. | String |
| namePattern | List of optional naming tokens as entered in the application UI. | String |
| resolvedPath | Editable.Path (relative to destinationPath) with the tokens resolved. | String |
| name | Name of the exported asset. | String |
| sequenceName | Name of the sequence to which this asset belongs. | String |
| shotNames | Name of the shot to which this asset belongs. | String |
| assetType | Type of the exported asset. Possible values:
|
String |
| width | Frame width of the exported asset. | Long |
| height | Frame height of the exported asset. | Long |
| aspectRatio | Frame aspect ratio of the exported asset. | Double |
| depth | Bit depth of the exported asset. Possible values:
|
String |
| scanFormat | Scan format of the exported asset. Possible values:
|
String |
| fps | Frame rate of the exported asset. | Double |
| sequenceFps | Frame rate of the sequence to which this asset belongs. | Double |
| sourceIn | The source In point as a frame, using the asset frame rate (the fps key). | Integer |
| sourceOut | The source Out point as a frame, using the asset frame rate (the fps key). | Integer |
| recordIn | The record In point as frame, using the sequence frame rate (the sequenceFps key). | Integer |
| recordOut | The record Out point as a frame, using the sequence frame rate (the sequenceFps key). | Integer |
| handleIn | Head as a frame, using the asset frame rate (fps key). | Integer |
| handleOut | Tail as a frame, using the asset frame rate (fps key). | Integer |
| track | ID of the sequence's track that contains the asset. | String |
| trackName | Name of the sequence's track that contains the asset. | String |
| segmentIndex | Asset index (1 based) in the track. | Integer |
| versionName | Current version name of this export. Empty if unversionned. | String |
| versionNumber | Current version number of this export. Zero if unversionned. | String |
Indicates whether postExportAsset should be called from a backburner job or directly from the application.
Not generating a postExportAsset backburner job for exports that are using backburner could result in postExportAsset being called before the export job is complete.
def useBackburnerPostExportAsset(): return True
Returns the custom export profiles to show to the user in the contextual menu that is displayed when right-clicking a clip in the application. These custome export profiles are displayed after the Export... menu item, and are expected to trigger an export.
def getCustomExportProfiles( profiles ): pass