hiero.core reference

hiero.core method and class details

class hiero.core.ApplicationSettings

Bases: Shiboken.Object

Helper object to set and get application settings.

boolValue

self.boolValue(key, defaultValue) -> returns the previously stored value as True or False, named by the key parameter, or the defaultValue parameter

self.boolValue(key) -> returns the previously stored value as True or False, named by the key parameter, or the default value as configured (if configured) by the Hiero code. Use this method if you’re looking up a value used by Hiero internally.

Note: use self.value(key, defaultValue) if you just want to retrieve a string setting

@param key: string name of the value to retrieve

@param defaultValue: the value to return if this setting hasn’t been saved before. Does not save the value to the default.

@return: string

setBoolValue

self.setBoolValue(key, value) -> saves the value as True or False with the application’s settings using the key

@param key: string name of the value to retrieve

@param value: the bool (True or False) value to save.

setValue(name, value)

self.setValue(key, value) -> saves the value with the application’s settings using the key

@param key: string name of the value to save

@param value: the value to store

value(name, defaultValue=None)

self.value(key, defaultValue=None) -> returns the previously stored string value named by the key parameter, or the defaultValue parameter

@param key: string name of the value to retrieve @param defaultValue: the value to return if this setting hasn’t been saved before. Does not save the value to the default @return: string, unless the defaultValue is set, in which case, the return value will be the same type as the defaultValue (string, int or bool)

class hiero.core.AudioTrack

Bases: core.Hiero.Python.TrackBase

Object for manipulating audio tracks.

addTag

self.addTag(tag) -> adds a tag to the audio track item.

@param tag: the Tag to add to the audio track

@return: Tag object

addTrackItem

self.addTrackItem(clip, audioChannel, position) -> if the first parameter is a Clip object, the second and third parameters must be specified and this method creates a new track item with the specified audio channel and adds it to this audio track at the given position.

If the first parameter is a TrackItem, then this method just adds the track item specified.

This method will cut or delete track items that overlap with the one being added.

This method can only be called if the track has already been added to a Sequence.

@param clip: a Clip object or a TrackItem object, to add to this audio track.@param audioChannel: int; audio channel that will be associated with the track item. Do not specify if clip is a TrackItem.@param position: int; insert position. Do not specify if clip is a TrackItem.@return: TrackItem object

clone

self.clone() -> returns a deep copy of this object.

@return: AudioTrack object

createTrackItem

self.createTrackItem(name) -> creates a new track item.

@param name: the name of the new track item

@return: TrackItem object

items

self.items() -> returns a tuple with all of the track items contained by this track.

@return: tuple of TrackItem objects

parent

self.parent() -> returns the sequence that contains this track.

@return: Sequence object

removeTag

self.removeTag(tag) -> removes the tag from the audio track.

@param tag: Tag object

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

trackIndex
class hiero.core.Bin

Bases: Shiboken.Object

Container object for BinItem objects (wrapping Clip and Sequence objects) and other Bin objects.

class ItemType

Bases: object

name
Bin.addItem

self.addItem(object) -> adds the item to the bin object.

@param object: Bin, BinItem, or Tag object, to be added as a sub item of the bin object@return: Added object

Bin.bins

self.bins() -> returns a tuple with all of the sub bins contained by this object.

@return: tuple of Bin objects

Bin.clips

self.clips() -> returns a tuple with all of the BinItem’s containing clips contained by this bin.

@return: tuple of BinItem objects

Bin.importFolder

self.importFolder(path) -> imports the media in the path into this bin (needs a project).

@param path: path to the media to import

@return Bin: returns the bin created for imported media

Bin.importSequence

self.importSequence(filename, timeBase=None, frameRate=None, dropFrame=False) -> imports the sequence stored in filename into this bin (needs a project). If the timebase/frame rate for the sequence isnot specified, the project defaults will be used.

@param filename: path to the file to import the sequence from

@param timeBase: optional argument of type TimeBase specifying the timebase for the created sequence

@param frameRate: optional float argument specifying the frame rate for the created sequence

@return: Sequence the created sequence

Bin.isNull

self.isNull() -> returns True if the object is invalid.

@return: True or False

Bin.items

self.items(typeFilter) -> returns a tuple with all of the objects contained by this bin, filtered by the typeFilter argument, if supplied.

@param typeFilter: combination of Bin.ItemType flags

@return: tuple of BinItem objects

Bin.name

self.name() -> returns the name of the bin.

@return: True or False

Bin.numChildren

self.numChildren() -> returns the number of child objects contained by this bin.

@return: int

Bin.parentBin

self.parentBin() -> returns the bin that contains this object.

@return: Bin object

Bin.project

self.project() -> returns the Project object that this is attached to, or None if the object is not attached to a project.

@return: Project object

Bin.reconnectMedia

self.reconnectMedia(path) -> connects (or reconnects) all of the media for the Clip, using the specified path.

@param path: path to the folder with the media to connect

Bin.removeItem

self.removeItem(object) -> removes the item from the bin object. If the object is not a child item of the bin object, throws an exception.

@param object: Bin, BinItem, or Tag object to be removed as a sub item of the bin object

Bin.sequences

self.sequences() -> returns a tuple with all of the BinItem’s containing sequences contained by this bin.

@return: tuple of BinItem objects

Bin.toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

class hiero.core.BinItem

Bases: Shiboken.Object

Generic object wrapper with shared functionality for sequences and clips.

activeItem

self.activeItem() -> returns the item contained by this bin item.

@return: Clip or Sequence object

activeVersion

self.activeVersion() -> gets the currently active Version object of the bin item.

@return: Version object

addSnapshot

self.addSnapshot(comment) -> adds a new snapshot for the object, with a comment.

self.addSnapshot(sequence, comment) -> adds a new snapshot for the object, using the sequence as the new snapshot, setting the comment.

@param comment: a comment string to set on the snapshot

@param sequence: a Sequence object to create the Snapshot from

@return: Snapshot object

addVersion

self.addVersion(version) -> adds the version parameter to the bin item.

@param version: Version object for the new version

@return: Version object

clone

self.clone() -> returns a deep copy of this object.

@return: BinItem object

hasVersion

self.hasVersion(index) -> checks if a given version exists and is valid.

@param index: index of the version to check for

@return: True or False

isNull

self.isNull() -> returns True if the object contains a invalid Sequence or Clip object.

@return: True or False

items

self.items() -> returns a tuple containing all of the different versions of this object.

@return: tuple of Version objects

name

self.name() -> returns the name of the item.

@return: string

numSnapshots

self.numSnapshots() -> returns the number of snapshots that this bin item has.

@return: int

numVersions

self.numVersions() -> returns the number of versions for this bin item.

@return: int

parentBin

self.parentBin() -> returns the bin object that contains this bin item.

@return: Bin object

project

self.project() -> returns the Project object that this object is attached to, or None if the object is not attached to a project.

@return: heiro.core.Project object

restoreToSnapshot

self.restoreToSnapshot(index) -> adds a new snapshot for the object, with a comment.

@param index: index of the Snapshot to restore from. Generates an exception if the index is out of range

setActiveVersion

self.setActiveVersion(version) -> sets the active version to the version parameter.

@return: Version object

setActiveVersionIndex

self.setActiveVersionIndex(version) -> sets the currently active version by index.

@param index: index of the version to make active

@return: Version object

snapshots

self.snapshots() -> returns a tuple of all of the snapshots contained by this object.

@return: tuple of Snapshot objects

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

version

self.version(index) -> gets a Version object for the version of the bin item specified by the index.

@param index: index of the version to get

@return: Version object

versionDown

self.versionDown() -> decrements the current/active version and returns the newly active Version object of the bin item.

@return: Version object

versionMaxAvailable

self.versionMaxAvailable() -> finds the highest version that is currently loaded and does not have missing or offline media and sets it as the active version on this bin item.

@param version: Version object

@return: Version object

versionMinAvailable

self.versionMinAvailable() -> finds the lowest version that is currently loaded and does not have missing or offline media and sets it as the active version on this bin item.

@param version: Version object

@return: Version object

versionNextAvailable

self.versionNextAvailable() -> finds the next (higher) version that is currently loaded and does not have missing or offline media and sets it as the active version on this bin item.

@param version: Version object

@return: Version object

versionPrevAvailable

self.versionPrevAvailable() -> finds the prev (lower) version that is currently loaded and does not have missing or offline media and sets it as the active version on this bin item.

@param version: Version object

@return: Version object

versionUp

self.versionUp() -> increments the current/active version and returns the newly active Version object of the bin item.

@return: Version object

class hiero.core.Clip

Bases: core.Hiero.Python.SequenceBase

Object representing a clip.

Initialisation:

Clip(mediaSource)

Clip(mediaSource, first, last)

mediaSource may be a MediaSource object or a string containing the media path. If first and last are given, the Clip only plays frames within this range.

addTag

self.addTag() -> adds the tag to the set of tags attached to the Clip.@param tag: the tag object to add

@return: Tag object

addTagToRange

self.addTagToRange(tag, inTime, outTime) -> adds the tag to the specified range of the Clip.@param tag: the tag object to add

@param inTime: from - time to add tag

@param outTime: to - time to add tag

@return: Tag object

addToNukeScript(script, additionalNodes=None, additionalNodesCallback=None, trimmed=True, firstFrame=None, trimStart=None, trimEnd=None, colourTransform=None, metadataNode=None, nodeLabel=None, enabled=True)

addToNukeScript(self, script, trimmed=True, trimStart=None, trimEnd=None)

Add a Read node to the Nuke script for each media sequence/file used in this clip. If there is no media, nothing is added.

@param script: Nuke script object to add nodes

@param additionalNodes: List of nodes to be added post read

@param additionalNodesCallback: callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence])

@param firstFrame: Custom offset to move start frame of clip

@param trimmed: If True, a FrameRange node will be added to trim the range output by the Read node. The range defaults to the clip’s soft trim range. If soft trims are not enabled on the clip, the range defaults to the clip range. The range can be overridden by passing trimStart and/or trimEnd values.

@param trimStart: Override the trim range start with this value.

@param trimEnd: Override the trim range end with this value.

@param enabled: enabled status of the read node. True by default

clone

self.clone() -> returns a deep copy of this object.

@return: Clip object

guid
isNull

self.isNull() -> returns False if this is a valid Clip object, True otherwise.

@return: True or False

mediaSource

self.mediaSource() -> returns the clip’s media source.

@return: MediaSource object

metadata

self.isNull() -> returns a copy of the clip’s metadata.

@return: hiero.core.Metadata object

numAudioTracks

self.numAudioTracks() -> returns number of audio tracks contained by this clip.

@return: int

numVideoTracks

self.numVideoTracks() -> returns number of video tracks contained by this clip.

@return: int

reconnectMedia

self.reconnectMedia(path) -> connects (or reconnects) all of the media for the Clip, using the specified path.

@param path: path to the folder with the media to connect

refresh

self.refresh() -> updates the clip if the source media has changed.

removeTag

self.removeTag(tag) -> removes the tag from the clip.

@param tag: Tag object

setSourceMediaColourTransform

self.setSourceMediaColourTransform(colourTransform) -> sets the input colour transform for the source media.

@param colourTransform: Colour transform name

sourceIn

self.sourceIn() -> returns the source in value for the clip.

@return: frame

sourceMediaColourTransform

self.sourceMediaColourTransform() -> returns colour transform for the source media.

@return: string

sourceOut

self.sourceOut() -> returns the source out value for the clip.

@return: frame

class hiero.core.ConformRule

Bases: Shiboken.Object

Represents a conform rule used by Hiero to make decisions when conforming. Can be derived from in order to make new conform rules.

class Type

Bases: object

name
ConformRule.activate

self.activate() -> adds this conform rule to the list of conform rules. Conform operations done after this call will use the rule.

ConformRule.appliesToTrackItems

self.appliesToTrackItems() -> should return True if this conform rule applies to track items.

@return: True or False; default implementation returns True

ConformRule.compare

self.compare(media, candidateMedia) -> should compare media against candidateMedia, and return True if they match, according to this conform rule.

The metadata contains the following keys which can be used for creating matching rules: Conformer.kUmid == ‘umid’ Conformer.kName == ‘name’ Conformer.kTapeName == ‘tapeName’ Conformer.kUrl == ‘url’ Conformer.kAudioChannels == ‘audioChannels’ Conformer.kDuration == ‘duration’ Conformer.kFramerate == ‘framerate’ Conformer.kFramerateIsNtsc == ‘framerateIsNtsc’ Conformer.kSamplerate == ‘samplerate’ Conformer.kMediaType == ‘mediaType’ Conformer.kMasterMediaType == ‘masterMediaType’ Conformer.kStartTime == ‘startTime’ Conformer.kTimecode == ‘timecode’ Conformer.kWidth == ‘width’ Conformer.kHeight == 'height'@return: True for a match, False otherwise; default implementation returns False

ConformRule.conformType

self.conformType() -> Get the conform types for which this rule can be used. The default is kConform.

@return: one of the constants kConform, kReconnect, kConformAndReconnect

ConformRule.deactivate

self.deactivate() -> removes this conform rule from the list of conform rules. Conform operations done after this call will not use the rule.

ConformRule.isNull

self.name() -> should return True if the conform rule is invalid.

@return: True for invalid, False otherwise

ConformRule.name

self.name() -> returns the name of the conform rule (which was passed to the object in it’s initializer).

@return: string

ConformRule.toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

class hiero.core.Conformer

Bases: Shiboken.Object

Provides and interface for querying and setting the conform options, such as file pattern filters and active rules.

These options mirror those found in the conforming dialog box in the UI.

excludePatterns

self.excludePatterns() -> returns the list of file patterns that are excluded from source media searches.

By default this is empty.

@return: A list containing the file patterns excluded from source media searches.

includeAlreadyMatched

self.includeAlreadyMatched() -> returns the state of re-conform media flag.

@return: True when the tracks that already have media attached will be re-conformed.

includePatterns

self.includePatterns() -> returns the list of file patterns that are included in source media searches.

By default this is ‘*’, which includes all file types.

@return: A list containing the file patterns included in source media searches.

nativeRuleFiltering

self.nativeRuleFiltering() -> returns a dictionary with the names of the native conforming rules and whether they are enabled for conforming.

By changing the state of the flags for the rules and submitting the dictionary back to the Conformer the rules can be filterd out.

@return: A dictionary containing the enabled flag for each native rule, keyed by the rule name.

nativeRuleNames

self.nativeRuleNames() -> returns the list of names for the native rules.

This can be used to set rule filtering.

@return: A list containing the names for all of the conform rules built-in to Hiero.

pythonRuleFiltering

self.pythonRuleFiltering() -> returns a dictionary with the names of the Python conforming rules and whether they are enabled for conforming.

By changing the state of the flags for the rules and submitting the dictionary back to the Conformer the rules can be filterd out.

@return: A dictionary containing the enabled flag for each Python rule, keyed by the rule name.

pythonRuleNames

self.pythonRuleNames() -> returns the list of names for the registered Python rules.

This can be used to set rule filtering.

@return: A list containing the names for all of the conform rules that have been added through the Python API.

setExcludePatterns

self.setExcludePatterns( filepatterns ) -> sets the list of file patterns to exclude from source media searches.

setIncludeAlreadyMatched

self.setIncludeAlreadyMatched( flag ) -> controls whether to re-connect tracks that already have media matched to them.

setIncludePatterns

self.setIncludePatterns( filepatterns ) -> sets the list of file patterns to include in source media searches.

setNativeRuleFiltering

self.setNativeRuleFiltering( ruleFiltering ) -> uses a dictionary keyed on the names of the native conforming rules to set whether each rule is enabled for conforming.

setPythonRuleFiltering

self.setPythonRuleFiltering( ruleFiltering ) -> uses a dictionary keyed on the names of the Python conforming rules to set whether each rule is enabled for conforming.

class hiero.core.DataCollection

Bases: Shiboken.Object

Storage objects for key/value pairs. Generally used to store metadata.

dict

self.dict() -> returns a dictionary of key/value pairs. Can be used to iterate over the items in this collection.

@return: dict

hasKey

self.hasKey(key) -> returns True if the collection has a value for the key.

@param key: the key to look up

@return: True or False

readOnly

self.readOnly(key) -> returns True if the collection can be modified.

@return: True or False

setValue

self.setValue(key) -> sets the value of the key stored in this collection.

@param key: the key to look up

@param value: value to assign to key

toString

self.toString() -> returns a formatted list of the key/value pairs currently set on this object. Equivalent to str(object).

@return: string

value

self.value(key) -> returns the value of the key stored in this collection. Throws an exception if the key does not exist.

@param key: the key to look up

@return: string

class hiero.core.ExportStructureBase

Bases: Shiboken.Object

Base class to be derived from in order to populate an ExportStructureViewer widget, such as the one used in the Export dialog box. ExportStructureBase objects provides access to a root node, which has to be an object derived from ExportStructureElementBase, which the ExportStructureViewer widget then uses to determine the tree structure to display to the user. For an example of how to derive from this class, see Plugins/site-packages/hiero/core/FnExportStructure.py. For an example use of a derived ExportStructureBase object, see Plugins/site-packages/hiero/exporters/FnShotProcessor.py. It will often be more than sufficient to just use an ExportStructure2 object, instead of subclassing ExportStructureBase directly.

childElement

self.childElement(path) -> should return an object derived from ExportStructureElementBase, representing a child with the path specified.

@param path: the path to the new (or existing) child element

@return: ExportStructureElementBase derived object

exportRootPath

self.exportRootPath() -> retrieves the root path for the export structure.

@return: string

rootElement

self.rootElement() -> should return a ExportStructureElementBase super class object, representing the root of the export file structure.

@return: ExportStructureElementBase derived object

setExportRootPath

self.setExportRootPath(path) -> called when the user has modified the export root path, to inform the object of the new path.

@param path: the new user supplied path to export to.

class hiero.core.ExportStructureElementBase

Bases: Shiboken.Object

Base class to be derived from and used in conjunction with a custom implementation of ExportStructureBase. For an example of how to derive from this class, see Plugins/site-packages/hiero/core/FnExportStructure.py.

addChild

self.addChild(newChild) -> should append the new child item to this node’s children, and set the parent on the child to this node.

@param newChild: ExportStructureElementBase object

child

self.child(index) -> should return the child of this node, based on the index.

@param index: int index of the child to return

@return: ExportStructureElementBase object

childCount

self.childCount() -> should return the number of child nodes on this item.

@return: int

childIndex

self.childIndex(exportElementChild) -> if the parameter is a child of this node, then this method should return the index of that child amongst the node’s other children.

@param exportElementChild: ExportStructureElementBase object

@return: int

clearChildren

self.clearChildren() -> clears all of the children nodes from this node.

content

self.content() -> should return the stored content of this element.

@return: string

createChild

self.createChild(name, isLeaf) -> should create and add a child element with the given name, setting the parent to this node. Should only do so if a child of that name didn’t already exist. Should also handle creating sub children if the name includes slashes, similar to the setName method. Should return the newly created child or the existing child if it didn’t create one.

@param name: the name for the new node

@param isLeaf: True or False value for whether or not this is a leaf node

@return: ExportStructureElementBase object

fromXml

self.fromXml(xmlText) -> should reinitialize the node from the xml text, and recreate the preset and all child nodes as well. If initialized using taskRegistry._savePresetElement, taskRegistry._loadPresetElement can be used to get data back out.

@param xmlText: xml formatted text, as a result of a call in the past to the toXml method

isLeaf

self.isLeaf() -> should return True if this is a node with no children, otherwise it should return False.

@return: True or False

name

self.name() -> should return the name of this element.

@return: string

parent

self.parent() -> should return the parent node of this object.

@return: ExportStructureElementBase object

path

self.path() -> should return the full path to this node, including the path of any parents of this node.

@return: string

preset

self.preset() -> should return an object derived from TaskPreset, representing the task associated with this element of the export structure.

@return: TaskPreset derived object

removeChild

self.removeChild(child) -> should remove the child from the node’s list of children

@param child: ExportStructureElementBase child object to remove

setName

self.setName(name) -> called to tell the node it’s name. Should create children if the name includes any slashes (/) in it.

@param name: string

setParent

self.setParent(newParent) -> should set the parent of this element.

@param newParent: ExportStructureElementBase object

setPreset

self.setPreset(preset) -> tells the object that the user has selected a new preset for this particular export element.

@param preset: a TaskPreset derived object, which can be used to create a task to process later on during an export.

setPresetType

self.setPresetType(presetType) -> called to tell the object to set the task preset type by name. The taskRegistry can be used with this ‘type’ to create the preset to store.

@param presetType: the name of the task preset to create/use.

toXml

self.toXml() -> should return a string of formatted xml which can be sent to the fromXml method later to read it back. The xml should include the preset data for this node, as well as the children, and should be in proper xml format. This can be done easily with xml.etree.cElementTree, especially because the taskRegistry has methods to write out xml for presets and other objects (taskRegistry._savePresetElement)

@return: string

class hiero.core.Format

Bases: Shiboken.Object

Stores format related data, such as the width, height, aspect ration, etc.

addToNukeScript(script=None, resize='width')

self.addToNukeScript(self, script, to_type) -> adds a Reformat node matching this Format to the specified script and returns the nuke node object. @param script: Nuke script object to add nodes to, or None to just generate and return the node. @param resize: Type of resize (use constants from nuke.ReformatNode, default is kResizeWidth). @return: hiero.core.nuke.ReformatNode object

aspect

self.aspect() -> returns the aspect ratio of this format.

@return: float

cleanAperture

self.cleanAperture() -> returns a 4 element tuple with the rectangle (x1, y1, x2, y2) of the clean aperture.

@return: tuple

height

self.height() -> returns the height of this format.

@return: int

isValid

self.isValid() -> returns whether or not this format object has valid data.

@return: True or False

name

self.name() -> returns the name of this format.

@return: string

pixelAspect

self.pixelAspect() -> returns the pixel aspect ratio of this format.

@return: float

productionAperture

self.productionAperture() -> returns a 4 element tuple with the rectangle (x1, y1, x2, y2) of the production aperture.

@return: tuple

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

width

self.width() -> returns the width of this format

@return: int

class hiero.core.ItemWrapper

Bases: Shiboken.Object

bin

self.bin() -> converts this ItemWrapper to a Bin object. If the item wrapper isn’t wrapping a Bin object, it will return a non-functioning (isNull returns True) TrackItem object (meaning that it has all of the methods of a Bin object, but the methods don’t do anything)

@return: Bin object

binItem

self.binItem() -> converts this ItemWrapper to a BinItem object. If the item wrapper isn’t wrapping a BinItem object, it will return a non-functioning (isNull returns True) TrackItem object (meaning that it has all of the methods of a BinItem object, but the methods don’t do anything)

@return: BinItem object

clip

self.clip() -> converts this ItemWrapper to a Clip object. If the item wrapper isn’t wrapping a Clip object, it will return a non-functioning (isNull returns True) Clip object (meaning that it has all of the methods of a Clip object, but the methods don’t do anything)

@return: Clip object

isNull

self.isNull() -> returns True if this is a invalid or uninitialized item, or False otherwise

@return: True or False

item

self.item() -> Return the item contained within this wrapper.

@return: Sequence | Clip | TrackItem | BinItem

name

self.name() -> Returns item name.

@return: string

root

self.root() -> the root is the highest level in the bin selected for export, Root may be null.

@return: Bin object

sequence

self.sequence() -> converts this ItemWrapper to a Sequence object. If the item wrapper isn’t wrapping a Sequence object, it will return a non-functioning (isNull returns True) Sequence object (meaning that it has all of the methods of a Sequence object, but the methods don’t do anything)

@return: Sequence object

trackItem

self.trackItem() -> converts this ItemWrapper to a TrackItem object. If the item wrapper isn’t wrapping a TrackItem object, it will return a non-functioning (isNull returns True) TrackItem object (meaning that it has all of the methods of a TrackItem object, but the methods don’t do anything)

@return: TrackItem object

hiero.core.LUTs()

LUTs() -> returns a tuple with the names of all of the available luts.

@return: tuple of strings

class hiero.core.MediaFileInfo

Bases: Shiboken.Object

Object representing a single set of media files on disk.

endFrame

self.endFrame() -> returns the last frame of the media source contained by this object. Note that for video formats (mov, r3d), this will always be the media’s (duration - 1).

@return: integer frame

filename

self.filename() -> returns a path to a media source on disk. May represent multiple files, as with image sequences. The form will be one of the following, depending on the file extension of the media:

  • /somepath/file.mov
  • /somepath/imagesequence.######.dpx (1-40)

In the case of the image sequence above, the numbers between the brackets represent the first and last frame of the sequence.

@return: string

startFrame

self.startFrame() -> returns the first frame of the media source contained by this object. Note that for video formats (mov, r3d), this will always be 0.

@return: integer frame

class hiero.core.MediaSource

Bases: Shiboken.Object

Represents a media source.

class MediaType

Bases: object

name
MediaSource.createOfflineVideoMediaSource()

MediaSource.createOfflineVideoMediaSource() -> returns a media source that might be an offline video file. Use this to explicitly set what you expect the start, duration and framerate of the video source to be, once it becomes available.

Raises a RuntimeError if the source path exists but could not be read by Hiero.

@param path: path to where the media will eventually be

@param start: start of the media, in frames

@param duration: duration of the media, in frames

@param frameRate: TimeBase representing the frame rate of the media source

@return: True or False

MediaSource.duration

self.duration() -> returns the duration, in frames.

@return: frames

MediaSource.fileinfos

self.fileinfos() -> returns a tuple of MediaFileInfo objects, which can be used to retrieve all of the file fragments that are used by this MediaSource.

@return: tuple of MediaFileInfo objects

MediaSource.filename

self.filename() -> returns the file name (and just the file name) of the first file used for the MediaSource.

Deprecated; Please use the fileinfos() method instead.

@return: string

MediaSource.firstpath

self.firstpath() -> returns the full path of the first file used for the MediaSource.

Deprecated; Please use the fileinfos() method instead.

@return: string

MediaSource.fragmentFilename

self.fragmentFilename(fragmentIndex) -> returns the file name (and just the file name) for the fragment of the MediaSource, specified by the fragmentIndex.

Deprecated; Please use the fileinfos() method instead

@param fragmentIndex: index of the fragment to retrieve

@return: string

MediaSource.fragmentPath

self.fragmentPath(fragmentIndex) -> returns the full path for the fragment of the MediaSource, specified by the fragmentIndex.

Deprecated; Please use the fileinfos() method instead.

@param fragmentIndex: index of the fragment to retrieve

@return: string

MediaSource.hasAudio

self.hasAudio() -> True if the source has audio.

@return: True or False

MediaSource.hasVideo

self.hasVideo() -> True if the source has video.

@return: True or False

MediaSource.height

self.height() -> returns the height of the media.

@return: int

MediaSource.isMediaPresent

self.isMediaPresent() -> returns True if the media is present.

@return: True or False

MediaSource.isNull

self.isNull() -> True if the object points to an invalid source, False otherwise.

@return: True or False

MediaSource.isOffline

self.isOffline() -> returns True if the media is missing or unavailable for any reason.

@return: True or False

MediaSource.metadata

self.metadata() -> returns a hiero.core.Metadata object with metadata for the MediaSource.

@return: hiero.core.Metadata object

MediaSource.numChannels
MediaSource.numFragments

self.numFragments() -> returns the number of files used by this MediaSource, or -1 for invalid media. For instance, for mov files, this will return 1; for exr sequences this method will return the number of exr files in the sequence.

Deprecated; Please use the fileinfos() method instead.

@return: int

MediaSource.pixelAspect

self.pixelAspect() -> returns the pixel aspect ratio of the media.

@return: float

MediaSource.refresh

self.refresh() -> updates source info for latest changes in underlying files

MediaSource.singleFile

self.singleFile() -> returns True if this MediaSource is comprised of only a single file regardless of how many frames it contains (like a .mov or .r3d).

@return: True or False

MediaSource.startTime

self.startTime() -> returns the start time of the media.

@return: int

MediaSource.timecodeStart
MediaSource.toString

self.toString(includeMetadata=False) -> returns a string with info for the MediaSource. str(object) is equivalent to object.toString().

@param includeMetadata: True adds metadata to the string, False does not

@return: string

MediaSource.width

self.width() -> returns the width of the media.

@return: int

class hiero.core.NamingScheme

Bases: Shiboken.Object

Utility object for extracting names for clips, versions and objects out of clip objects

clipName()

self.clipName(clip) -> extracts name from clip that will be used for displaying the clip object, based on the underlying file(s).

Redefine this method if desired for customised naming schema. Use default_clipName for default functionality if needed.

@param clip: a clip to extract the name from

@return: string

default_clipName()

self.default_clipName(clip) -> extracts name from clip that will be used for displaying the clip object, based on the underlying file(s).

Do not redefine this method. It preserves accessibility to default functionality when redefining clipName.

@param clip: a clip to extract the name from

@return: string

default_rootName()

self.default_rootName(clip) -> extracts name from clip that will be used for displaying the bin item object, based on the underlying file(s).

Do not redefine this method. It preserves accessibility to default functionality when redefining rootName.

@param clip: a clip to extract the name from

@return: string

default_versionName()

self.default_versionName(clip) -> extracts name from clip that will be used for displaying the version object, based on the underlying file(s).

Do not redefine this method. It preserves accessibility to default functionality when redefining versionName.

@param clip: a clip to extract the name from

@return: string

rootName()

self.rootName(clip) -> extracts name from clip that will be used for displaying the bin item object, based on the underlying file(s).

Redefine this method if desired for customised naming schema. Use default_rootName for default functionality if needed.

@param clip: a clip to extract the name from

@return: string

versionName()

self.versionName(clip) -> extracts name from clip that will be used for displaying the version object, based on the underlying file(s).

Redefine this method if desired for customised naming schema. Use default_versionName for default functionality if needed.

@param clip: a clip to extract the name from

@return: string

class hiero.core.Processor

Bases: Shiboken.Object

displayName
startProcessing
validateSelection
class hiero.core.Project

Bases: Shiboken.Object

Object for manipulating projects. Can be created using newProject() or by the following code:

hiero.core.openProject(projectPath)

project = hiero.core.projects()[-1]

audioTrackItems(partialName=None)

self.audioTrackItems(partialName) -> returns all audio track items in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.

@return: an array of hiero.core.TrackItem objects.

Example: finds all audio track items in a project with 30Sec in the name:

trackItems = myProject.audioTrackItems(‘30Sec’)

audioTracks(partialName=None)

self.audioTracks(partialName) -> returns all audio tracks in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.

@return: an array of hiero.core.AudioTrack objects.

Example: finds all audio tracks in a project with 30Sec in the name:

tracks = myProject.audioTracks(‘30Sec’)

beginUndo

self.beginUndo(name) -> starts a new undo action, which will group all other undo actions until self.endUndo() is called. Be aware that this method only works on the main thread, and will throw an exception otherwise.

Note that for operations inside the undo to work Project.endUndo() must be called. It is recommended that you use this in a with block to ensure that this happens. For example:

with project.beginUndo(‘My Undo’):

// Undoable edits

@return: UndoGroup object

bins(partialName=None)

self.bins(partialName) -> returns all bins in a project. Searches recursively, so will return bins within other bins in the list. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.

@return: an array of hiero.core.Bin objects.

Example: finds all bins in a project with MyBin in the name:

bins = myProject.bins(‘MyBin’)

buildTrackName

buildTrackName() -> get default track name used when building vfx trackthis can be configured in the project settings dialog

clips(partialName=None)

self.clips(partialName) -> returns all clips in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.

@return: an array of hiero.core.Clip objects.

Example: finds all clips in a project with 30Sec in the name:

clips = myProject.clips(‘30Sec’)

clipsBin

self.clipsBin() -> returns the bin object containing the top level clips, sequences and bins for this project.

@return: Bin object

close

self.close() -> closes the project. Be aware that this method will not save the project, even if changes have been made since the last save of the project.

deletable

self.deletable() -> returns True if the project can be deleted.

@return: True or False

editable

self.editable() -> returns True if the project can be edited.

@return: True or False

endUndo

self.endUndo() -> ends an undo action started previously by a call to self.beginUndo(). This will put a new item into the Edit > Undo/Redo menu items.

extractSettings()

self.extractSettings() -> returns a dict of the project’s settings. @return: dict

guid
isNull

self.isNull() -> returns False if this is a valid Project object, True otherwise.

@return: True or False

isRestricted

self.isRestricted() -> returns whether or not access to the project is restricted.

@return: True or False

lutSetting16Bit

self.lutSetting16Bit() -> returns the project’s 16 bit lut setting name.

@return: string

lutSetting8Bit

self.lutSetting8Bit() -> returns the project’s 8 bit lut setting name.

@return: string

lutSettingFloat

self.lutSettingFloat() -> returns the project’s float lut setting name.

@return: string

lutSettingLog

self.lutSettingLog() -> returns the project’s log lut setting name.

@return: string

lutSettingViewer

self.lutSettingsViewer() -> returns the project’s viewer lut setting name.

@return: string

name

self.name() -> returns the name of the project.

@return: string

path

self.path() -> returns the path to the project.

@return: string

projectRoot

self.projectRoot() -> Get root path of the project used by default when sending to nuke or using {projectroot} token in export.

@return: string

projectShotPreset

self.projectShotPreset() -> get Project Shot Preset which is usedwhen sending to nuke or using {projectroot} token in export.

@return: TaskPreset object

redo

self.redo() -> triggers a redo of the next item in the redo stack. Only works on the main thread. If called from any other thread, throws an exception.

redoItemText

self.redoItemText() -> returns the text of the next item on the redo stack. Only works on the main thread. Can be useful for testing that undo/redo works.

@return: string

save

self.save() -> saves a previously saved project to disk.

saveAs

self.saveAs(filename) -> saves the project to the path specified by the filename parameter. Throws an exception if the project couldn’t be saved for any reason.

@param filename: path to save the project to

sequences(partialName=None)

self.sequences(partialName) -> returns all sequences in a project. User can filter by by partial name. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name. @return: an array of hiero.core.Sequence objects.

Example: finds all sequences in a project with 30Sec in the name:

sequences = myProject.sequences(‘30Sec’)

setDeletable

self.setDeletable(deletable) -> sets whether or not a project can be deleted.

@param deletable: True or False

setEditable

self.setEditable(editable) -> sets whether or not a project can be edited.

@param editable: True or False

setProjectRoot

self.setProjectRoot() -> Set root path of the project used by default when sending to nuke or using {projectroot} token in export.

@param: path to set as project root

tagsBin

self.tagsBin() -> returns the bin object containing the top level tags for this project.

@return: Bin object

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

trackItems(partialName=None)

self.trackItems(partialName) -> returns all track items in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.

@return: an array of hiero.core.TrackItem objects.

Example: finds all track items in a project with 30Sec in the name:

trackItems = myProject.trackItems(‘30Sec’)

tracks(partialName=None)

self.tracks(partialName) -> returns all tracks in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.

@return: an array of hiero.core.VideoTrack and hiero.core.AudioTrack objects.

Example: finds all tracks in a project with 30Sec in the name:

tracks = myProject.tracks(‘30Sec’)

undo

self.undo() -> triggers an undo on the last item previously added to the undo stack. Only works on the main thread. If called from any other thread, throws an exception.

undoItemText

self.undoItemText() -> returns the text of the last item on the undo stack. Only works on the main thread. Can be useful for testing that undo/redo works.

@return: string

videoTrackItems(partialName=None)

self.videoTrackItems(partialName) -> returns all video track items in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.

@return: an array of hiero.core.TrackItem objects.

Example: finds all video track items in a project with 30Sec in the name:

trackItems = myProject.videoTrackItems(‘30Sec’)

videoTracks(partialName=None)

self.videoTracks(partialName) -> returns all video tracks in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.

@return: an array of hiero.core.VideoTrack objects.

Example: finds all video tracks in a project with 30Sec in the name:

tracks = myProject.videoTracks(‘30Sec’)

class hiero.core.ReformatState

Bases: Shiboken.Object

Object representing a the reformatting settings for a track item. This corresponds to the Nuke ‘Reformat’ node.

boxForceShape

self.boxForceShape() -> returns the box ‘force shape’ flag.

@return: bool

boxPAR

self.boxPAR() -> returns the box pixel aspect ratio.

@return: double

boxSize

self.boxSize() -> returns the box size.

@return: QSize

isNull
resizeCenter

self.resizeCenter() -> returns the resize center flag.

@return: bool

resizeFlip

self.resizeFlip() -> returns the resize flip flag.

@return: bool

resizeFlop

self.resizeFlop() -> returns the resize flop flag.

@return: bool

resizeTurn

self.resizeTurn() -> returns the resize turn flag.

@return: bool

resizeType

self.resizeType() -> returns the resize type.

@return: string

scale

self.scale() -> returns the scaling factor.

@return: double

setBoxForceShape

self.setBoxForceShape() -> sets the box ‘force shape’ flag if the reformat type is set to ‘to box’.

@param setBoxForceShape: bool

setBoxPAR

self.setBoxPAR() -> sets the box pixel aspect ratio if the reformat type is set to ‘to box’.

@param PAR: double

setBoxSize

self.setBoxSize() -> sets the box size if the reformat type is set to ‘to box’.

@param size: QSize

setResizeCenter

self.setResizeCenter() -> sets the resize center flag on the track item.

@param center: bool

setResizeFlip

self.setResizeFlip() -> sets the resize flip flag on the track item.

@param flip: bool

setResizeFlop

self.setResizeFlop() -> sets the resize flop flag on the track item.

@param flop: bool

setResizeTurn

self.setResizeTurn() -> sets the resize turn flag on the track item.

@param turn: bool

setResizeType

self.setResizeType() -> sets the resize type of the state.

@param newResizeType: string

setScale

self.setScale() -> sets the scaling factor if the reformat type is set to ‘scale’.

@param value: double

setType

self.setType() -> sets the reformat type of the state.

@param newType: string

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

type

self.type() -> returns the reformat type of the state.

@return: string

class hiero.core.Sequence

Bases: core.Hiero.Python.SequenceBase

Object for Sequences.

addClip(clip, time, videoTrackIndex=0, audioTrackIndex=-1)

Add a clip to a sequence, creating a TrackItem for each video/audio channel in the clip, adding them to the appropriate tracks and linking them together. This has the same effect as dragging a clip from the Bin View to the Timeline View in the Hiero UI.

@param clip: the clip to add @param time: the in time for created track items @param videoTrackIndex: index of the video track to add items to if the clip has video @param audioTrackIndex: index of the audio track to start adding items to if the clip has audio @return: list of created hiero.core.TrackItems

addTag

self.addTag(tag) -> add a tag to the Sequence.

@param tag: the tag to add (hiero.core.Tag object)

@return: Tag object

addTagToRange

self.addTagToRange(tag, inTime, outTime) -> adds the tag to the specified range of the Sequence.

@param tag: the tag object to add

@param inTime: the first time at which the tag is valid

@param outTime: the last time at which the tag is valid

@return: Tag object

addToNukeScript(script, additionalNodes=[], additionalNodesCallback=None, includeRetimes=False, skipOffline=True)

addToNukeScript(self, script) @param script: Nuke script object to add nodes to. @param includeRetimes: @param additionalNodesCallback: callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence]) @return: None

Add nodes representing this Sequence to the specified script. If there are no clips in the Sequence, nothing is added.

addTrack

self.addTrack(track) -> adds a video or audio track to the Sequence.

@param track: video or audio track to add

audioTrack

self.audioTrack(index) -> returns the audio track for the specified index.

@param index: index of the audio track to return

@return: AudioTrack

audioTracks

self.audioTracks() -> returns a tuple with all of the audio tracks.

@return: tuple of AudioTrack objects

changeFramerateKeepFrames

self.changeFramerateKeepFrames(toTimebase) -> changes the timebase of the sequence, keeping frames of track items the same

@param toTimebase: timebase to change to

changeFramerateKeepTimecodes

self.changeFramerateKeepTimecodes(toTimebase, roundingMode) -> changes the timebase of the sequence, keeping timecodes of track items the same, according to the specified rounding mode

@param toTimebase: timebase to change to

@param roundingMode: rounding mode to use when converting timebases (hiero.core.TimeBase.kRoundNearest, TimeBase.kRound32Pulldown)

clone

self.clone() -> returns a deep copy of this object.

@return: Sequence object

guid
importTracks

self.importTracks(filePath) -> imports all of the tracks from the file specified by the filePath argument.

@param filePath: path to the file to import tracks from

@return tracks: tuple of created tracks

importTracksFromTimeBaseKeepFrames

self.importTracksFromTimeBaseKeepFrames(filePath, srcTimebase) -> imports all of the tracks from the file specified by the filePath argument using the specified timebase.

@param filePath: path to the file to import tracks from

@param srcTimebase: timebase to use when reading the source file

@return tracks: tuple of created tracks

importTracksFromTimeBaseKeepTimecodes

self.importTracksFromTimeBaseKeepTimecodes(filePath, srcTimebase, roundingMode) -> imports all of the tracks from the file specified by the filePath argument using the specified timebase.

@param filePath: path to the file to import tracks from

@param srcTimebase: timebase to use when reading the source file

@param roundingMode: rounding mode to use when converting timebases (hiero.core.TimeBase.kRoundNearest, TimeBase.kRound32Pulldown)

@return tracks: tuple of created tracks

items

self.items() -> returns a tuple with all of the video tracks concatenated with all of the audio tracks. Can iterate over the video tracks first by using self.numVideoTracks. The audio tracks follow the video tracks in the tuple returned from this method.

@return: tuple of VideoTrack and AudioTrack objects

matchMedia

self.matchMedia(path) -> match media using the current rule configuration in conformer().

@param path: path to the folder with the media to connect

numAudioTracks

self.numAudioTracks() -> returns number of audio tracks contained by this sequence.

@return: int

numVideoTracks

self.numVideoTracks() -> returns number of video tracks contained by this sequence.

@return: int

reconnectMedia

self.reconnectMedia(path) -> connects (or reconnects) all of the media for the Sequence, using the specified path.

@param path: path to the folder with the media to connect

removeTag

self.removeTag(tag) -> removes the tag from the sequence.

@param tag: Tag object

removeTrack

self.removeTrack(track) -> removes the track from the Sequence.

@param track: track to remove (hiero.core.AudioTrack or VideoTrack object)

trackItemAt

self.trackItemAt(time) -> returns the top-most video track item for the specified time that is enabled and has media.

@param time: frame to get the trackitem for

@return: TrackItem

trackItemsAt

self.trackItemsAt(time, mediaType) -> finds enabled track items for the specified time, ordered from top-track to bottom-track (or for audio, min channel to max channel).

@param time: frame to get the trackitems for

@param mediaType: TrackItem.MediaType value specifying the media type of the track items to look for (defaults to kVideo)

@return: tuple of TrackItem objects

videoTrack

self.videoTrack(index) -> returns the video track for the specified index.

@param index: index of the video track to return

@return: VideoTrack

videoTracks

self.videoTracks() -> returns a tuple with all of the video tracks.

@return: tuple of VideoTrack objects

class hiero.core.SequenceBase

Bases: Shiboken.Object

Base class for Sequence and Clip objects. Has some methods common to both of those objects. Most likely never used directly.

addTag

self.addTag(tag) -> adds a Tag object to the Clip or Sequence.

@param tag: the tag object to add

@return: Tag object

addTagToRange

self.addTagToRange(tag, inTime, outTime) -> adds a Tag object to the specified range of the Clip or Sequence.

@param tag: the tag object to add

@param inTime: the first time at which the tag is valid

@param outTime: the last time at which the tag is valid

@return: Tag object

binItem

self.binItem() -> returns the parent BinItem this Sequence or Clip belongs to, if any.

@return: BinItem

clearRange

self.clearRange(start, end, ripple) -> Clears a time range out of the sequence; effectively a razor on any clips straddling the start and end, and a delete of everything else.

@param start: the start of the range to clear

@param end: the end of the range to clear

@param ripple: set to True to shift the remaining track items to the left

disableSoftTrims

self.disableSoftTrims() -> disables soft trims on the object.

dropFrame

self.dropFrame() -> get whether sequence timecode is displayed in drop frame format

duration

self.duration() -> returns the duration of the Clip or Sequence.

@return: int time value

editFinished

self.editFinished() -> this should be called after finishing editing the sequence to ensure that its internal state is updated properly and to send a signal to all objects listening to changes in this object (e.g. UI views).

enableSoftTrims

self.enableSoftTrims(inTime, outTime) -> enables soft trims on the object.

@param inTime: Time - soft trim in time

@param outTime: Time - soft trim out time

format

self.format() -> returns the output Format object for this Sequence or Clip.

@return: Format object

framerate

self.framerate() -> returns the framerate of the Sequence or Clip.

@return: TimeBase object

inTime

self.inTime() -> returns the ‘in’ point set on the clip.

@return: frame

isNull

self.isNull() -> returns False if this is a valid Sequence or Clip object, True otherwise.

@return: True or False

metadata

self.metadata() -> returns a collection of metadata for the object.

@return: DataCollection object

name

self.name() -> returns the name of the object.

@return: string

outTime

self.outTime() -> returns the ‘out’ point set on the clip.

@return: frame

posterFrame

self.posterFrame() -> get the frame in the sequence used for thumbnails

project

self.project() -> returns the Project object that this is attached to, or None if the object is not attached to a project.

@return: Project object

rawView

self.rawView() -> returns a string representing the raw view of this sequence or clip.

@return: string

razorAt

self.razorAt(time) -> Creates razor cuts on all of the unlocked tracks for the parameter time(s).

@param time: if a single (integer) value, indicates the razor cut time; if a tuple or list of integer values, then the times to create multiple cuts at

removeTag

self.removeTag(tag) -> removes the tag from the track.

@param tag: Tag object

setDropFrame

self.setDropFrame(drop) -> set whether sequence timecode is displayed in drop frame format

setFormat

self.setFormat(format) -> set the format of the Sequence or Clip.

@param format: format value to set

setFramerate

self.setFramerate(framerate) -> set the framerate of the Sequence or Clip.

@param framerate: framerate value to set

setInTime

self.setInTime(t) -> set the ‘in’ point for the clip to Time t.

@return: None

setName

self.setName() -> set the name of the object.

@param: string new name

setOutTime

self.setOutTime(t) -> set the ‘out’ point for the clip to Time t.

@return: None

setPosterFrame

self.setPosterFrame(frame) -> set the frame in the sequence used for thumbnails

setSoftTrimsInTime

self.setSoftTrimsInTime(inTime) -> sets the in time for the soft trims. Note: this method does not enable soft trims if they are disabled.

@param inTime: in frame value for the soft trims

setSoftTrimsOutTime

self.setSoftTrimsOutTime(outTime) -> sets the out time for the soft trims. Note: this method does not enable soft trims if they are disabled.

@param outTime: out frame value for the soft trims

setTimecodeStart

self.setTimecodeStart(time) -> sets the value of the start timecode by frame. To convert times to frame values, use TimeCode.HMSFToFrames or TimeCode.stringToTime.

self.setTimecodeStart(timecodeValue, hasDropFrames) -> sets the value of the start timecode by formatted string, using the framerate of the Sequence or Clip as the time base. If just passing in a framerate, pass it in as an integer.

@param time: frame value to set the time code to

@param timecodeValue: string of the format “hh:mm:ss:ff”

@param hasDropFrames: True if the timecode includes drop frames, False otherwise

softTrimsEnabled

self.softTrimsEnabled() -> returns True if soft trims are enabled, False otherwise.

@return: True or False

softTrimsInTime

self.softTrimsInTime() -> returns the in time set for the soft trims.

@return: frame

softTrimsOutTime

self.softTrimsOutTime() -> returns the out time set for the soft trims.

@return: frame

tags

self.tags() -> returns a tuple of all of the tags applied to this object.

@return: tuple of Tag objects

thumbnail

self.thumbnail(frame) -> returns a thumbnail of the frame specified as a QImage object.

@param frame: the frame to get the thumbnail for (defaults to 0)

@param layer: the layer to get the thumbnail for (defaults to colour)

@return: QImage object

timecodeStart

self.timecodeStart() -> returns the frame value of the start timecode. To convert this to a time code string, use TimeCode.timeToString.

@return: frame

timelineOffset

self.timelineOffset() -> returns the timeline offset value.

@return: frame

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

writeAudioToFile

self.writeAudioToFile() -> Bounce down audio tracks and write to wav file at specified location. File will be created or overwritten.

@param filepath: the filepath of file to be written

@param inTime: in point of the timeline to write

@param outTime: out point of the timeline to write

class hiero.core.Snapshot

Bases: Shiboken.Object

Object representing a snapshot of a sequence or clip. Can be created with a Clip or a Sequence object.

comment

self.comment() -> returns the comment set on this snapshot object.

@return: string

isNull

self.isNull() -> returns True if the object is invalid, False otherwise.

@return: True or False

item

self.item() -> returns the clip or sequence stored with this snapshot.

@return: Clip or Sequence object

name

self.name() -> returns the name of this snapshot.

@return: string

setComment

self.setComment(comment) -> sets the comment on this snapshot object.

@param comment: string to set the comment to

@return: string

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

class hiero.core.Tag

Bases: Shiboken.Object

Object representing a tag in Hiero. Can be created with a string name and an optional path to an icon.

guid

self.guid() -> Return the Tag guid.

@return: object guid as string

icon

self.icon() -> returns the tags icon path.

@return: string

inTime

self.inTime() -> returns the in time of the tag.

@return: frame

isNull

self.isNull() -> returns True if the tag is invalid, False otherwise.

@return: True or False

metadata

self.metadata() -> returns the clip’s metadata.

@return: DataCollection object

name

self.name() -> returns the label of the tag.

@return: string

note

self.note() -> returns the note on the tag.

@return: string

outTime

self.outTime() -> returns the out time of the tag.

@return: frame

project

self.project() -> returns the Project object that this is attached to, or None if the object is not attached to a project.

@return: Project object

setIcon

self.setIcon() -> sets the icon on the tag.

@param note: path to icon file

setNote

self.setNote() -> sets the note on the tag.

@param note: string note to assign to tag

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

class hiero.core.Task

Bases: Shiboken.Object

Object to carry out an export or transcode task. This class should not be used directly; use hiero.core.TaskBase instead.

addToQueue

self.addToQueue() -> adds this task into the task queue.

children

self.children() -> get a list of child tasks. Note that this list should not change after addToQueue() has been called.

clearError

self.clearError() -> clears the error or warning string for this task.

destinationDescription

self.destinationDescription() -> Get the destination description.

error

self.error() -> Get the error string if one has been set.

finishTask

self.finishTask() -> called by Hiero to tell the Task to that it’s finished. Subclasses should finish processing in their override of this method (close files, clean up).

forcedAbort

self.forcedAbort() -> called by Hiero when the user presses the Abort button. Subclasses should do any clean up in their override of this method.

formatDescription

self.formatDescription() -> Get a description of the format that this task writes to.

ident

self.ident() -> called by Hiero to get a unique identifier for this task.

progress

self.progress() -> called by Hiero to find out from the task what it’s progress is, between 0.0 and 1.0.

setDestinationDescription

self.setDestinationDescription(desc) ->

@param desc: string

setDuplicate

self.setDuplicate() -> Sets the flag cancelling this task and marking as duplicate.

setError

self.setError(desc) -> sets the error string displayed to the user in the task dialog. Error strings display in red.

@param desc: the text to display

setFormatDescription

self.setFormatDescription(desc) -> tells Hiero a description of the format that this task writes to.

@param desc: description of the format that this task outputs

setSynchronous

self.setSynchronous() -> Flags this task as synchronous. When added to the queue, this task will be executed imediately on the current thread. The Flag must be set prior to adding to queue

setTaskDescription

self.setTaskDescription(description) -> tells Hiero a descriptive string for the task that it can use to show the user through the user interface and/or store it for reference. Helpful when debugging.

@param desc: description of the task

setWarning

self.setWarning(desc) -> sets the warning string displayed to the user in the task dialog. Warning strings display in orange.

@param desc: the text to display

startTask

self.startTask() -> called by Hiero to tell the Task to start. Subclasses should start processing in their override of this method.

taskDescription

self.taskDescription() -> Get a description of the task.

taskStep

self.taskStep() -> called by Hiero repeatedly until the progress method returns 1.0 or greater. Step based processing should occur in this method by subclasses of Task.

class hiero.core.TaskPreset

Bases: Shiboken.Object

Contains all of the settings used for a particular task. This class should not be used directly; use hiero.core.TaskPresetBase instead.

class ItemTypes

Bases: object

name
TaskPreset.getResolveEntryCount
TaskPreset.ident
TaskPreset.markedForDeletion
TaskPreset.name
TaskPreset.project
TaskPreset.propertiesValue
TaskPreset.readOnly
TaskPreset.resolveEntryDescription
TaskPreset.resolveEntryName
TaskPreset.savePath
TaskPreset.setMarkedForDeletion
TaskPreset.setProject
TaskPreset.setPropertiesValue
TaskPreset.setReadOnly
TaskPreset.setSavePath
TaskPreset.summary
TaskPreset.supportedItems
TaskPreset.supportsAudio

self.supportsAudio() -> returns whether or not this task preset supports audio.

@return: True or False

class hiero.core.TaskRegistryBase

Bases: Shiboken.Object

Base class for the single Task Registry instance in Hiero. Private, and subject to change. Do not use this class directly.

assignPresetToProject
copyAndAddProcessorPreset
createAndAddProcessorPreset
createAndAddTaskPreset
createAndExecuteProcessor
getProcessor
getProcessorPreset
getProcessorPresetByName
getTaskPreset
getTaskPresetByName
loadPresets
localPresets
numProcessorPresets
numProcessors
numTaskPresets
numTasks
presetFromXml
presetToPrettyXml
presetToXml
processorByIndex
processorName
processorPresetByIndex
processorPresetByName
processorPresetName
projectPresets
projectUnloaded
registerme
removeProcessorPreset
removeTaskPreset
renameProcessorPreset
renameTaskPreset
revertDefaultPresets
savePresets
submissionNames
taskName
taskPresetName
class hiero.core.TimeBase

Bases: Shiboken.Object

Helper object that wraps up time bases (or frame rates). Stores values internally as integer ratios, as opposed to as floating point values.

class RoundingMode

Bases: object

name
class TimeBase.StandardTimebase

Bases: object

name
TimeBase.convert()

self.convert(t, from, to) -> returns the time specified by the first parameter converted from from parameter’s time base into the to parameter’s time base.

If either of the time bases is invalid, this method returns the t parameter unchanged.

@param t: the time (frame) to convert from one rate to another

@param from: the time base to convert from

@param to: the time base to convert to

@return: integer

TimeBase.convertTime

self.convertTime(t, toRate) -> returns the time specified by the first parameter converted from this object’s time base into the second parameter’s time base.

If either of the time bases is invalid, this method returns the t parameter unchanged.

@param t: the time (frame) to convert from one rate to another

@param toRate: the new time time to convert to

@return: integer

TimeBase.denominator

self.denominator() -> gets the denominator of the time base.

@return: int

TimeBase.fromString()

self.fromString(str) -> creates a new time base object from the parameter.

Example:

newTimeBase = TimeBase.fromString(“24.0”)

newTimeBase = TimeBase.fromString(“30000/1001”)

@param numerator: the numerator to set the time base to

@param denominator: the denominator to set the time base to

@param fps: the floating point frames per second value to set the time base to

@return: TimeBase object

TimeBase.init

self.init(numerator, denominator) -> sets the time base to the parameters.

self.init(fps) -> sets the time base to the parameter.

Example:

t.init(30 * 1000, 1001)

t.init(24.0)

@param numerator: the numerator to set the time base to

@param denominator: the denominator to set the time base to

@param fps: the floating point frames per second value to set the time base to

TimeBase.isNTSC

self.isNTSC() -> returns True if the time base is NTSC (24*1000/1001, 30*1000/1001, or 60*1000/1001).

@return: True or False

TimeBase.isValid

self.isValid() -> returns True if the denominator of the time base is non-zero.

@return: True or False

TimeBase.numerator

self.numerator() -> gets the numerator of the time base.

@return: int

TimeBase.set

self.set(numerator, denominator) -> sets the time base to the parameters.

Example:

t.set(30 * 1000, 1001)

@param numerator: the numerator to set the time base to

@param denominator: the denominator to set the time base to

TimeBase.setDenominator

self.setDenominator(value) -> sets the denominator of the time base to the parameter.

Example:

t.setNumerator(30 * 1000)

t.setDenominator(1001)

@param value: the value to set the denominator to

TimeBase.setNumerator

self.setNumerator(value) -> sets the numerator of the time base to the parameter.

Example:

t.setNumerator(30 * 1000)

t.setDenominator(1001)

@param value: the value to set the numerator to

TimeBase.supportsDropFrames

self.supportsDropFrames() -> returns True if the time base supports drop frames (only true for 30 fps NTSC currently).

@return: True or False

TimeBase.toBool

self.toBool() -> returns True if the time base value is non-zero, False otherwise.

@return: True or False

TimeBase.toFloat

self.toFloat() -> returns the time base value expressed as a floating point value.

@return: float

TimeBase.toInt

self.toInt() -> returns the time base value, rounded to the nearest integer.

@return: int

TimeBase.toRational

self.toRational() -> returns a tuple of the numerator and the denominator of the time base.

@return: tuple of integers

TimeBase.toRationalString

self.toRationalString() -> returns a string containing the time base expressed as a ratio.

@return: string

TimeBase.toString

self.toString() -> returns a string containing the time base as a floating point number. Equivalent to str(object).

@return: string

class hiero.core.Timecode

Bases: Shiboken.Object

Helper module to convert back and forth between (frames and time bases) and time code values.

class DisplayType

Bases: object

name
Timecode.HMSFToFrames()

self.HMSFToFrames(timeBase, dropFrame, h, m, s, f) -> takes a timebase, whether or not it’s got drop frames, an hour, minute, second and frame, and returns a time value.

@param timeBase: the time base to use

@param dropFrames: True if you want drop frames taken into account

@param h: hour to use

@param m: minute to use

@param s: second to use

@param f: frame to use

@return: frame

Timecode.displayTypeFromString()

self.displayTypeFromString(s) -> guesses the display type from a timecode string. This can be inferred from separators (though not guaranteed) or if no separators than just display as frames.

Example:

displayType = Timecode.displayTypeFromString(‘01:00:00:00’)

print displayType # prints out Timecode.kDisplayTimecode

displayType = Timecode.displayTypeFromString(‘01:00:00;00’)

print displayType # prints out Timecode.kDisplayDropFrameTimecode, because of the semi-colon (;)

@param s: string to detect time code format from

@return: Timecode.DisplayType enumeration

Timecode.framesToHMSF()

self.framesToHMSF(time, timeBase, dropFrames) -> takes a time, timebase and whether or not it’s got drop frames, and returns a tuple of the hour, minute, second and frame.

Example:

hour, minute, second, frame = Timecode.framesToHMSF(0, timeBase, True)

@param time: the frame you want to get the time code for

@param timeBase: the time base to use

@param dropFrames: True if you want drop frames taken into account

@return: tuple of hour, minute, second, frame

Timecode.stringToTime()

self.stringToTime(s, timeBase, displayType, timecodeOffset) -> returns a tuple of hour, minute, second, frame values.

@param s: the string to convert

@param timeBase: the time base to use

@param displayType: how the string was formatted; can be (Timecode.kDisplayTimeCode, Timecode.kDisplayDropFrameTimecode, or Time.kDisplayFrames)

@param timecodeOffset: an offset to apply before converting to a time code string

@return: tuple

Timecode.timeToString()

self.timeToString(time, timeBase, displayType, includeSign, timecodeOffset) -> returns a string formatted as a time code.

@param time: the frame to use

@param timeBase: the time base to use

@param displayType: how to format the returned string (Timecode.kDisplayTimeCode, Timecode.kDisplayDropFrameTimecode, or Time.kDisplayFrames)

@param includeSign: if True, a ‘+’ will be put in front of positive time codes

@param timecodeOffset: an offset to apply before converting to a time code string

@return: string

class hiero.core.TrackBase

Bases: Shiboken.Object

Base class for VideoTrack and AudioTrack objects. This class should never be used directly.

addItem

self.addItem(item) -> deprecated; use addTrackItem instead. Adds a track item to this track. Throws an exception if the item overlaps any existing items on the track.

@param item: the TrackItem to add to this track

@return: TrackItem object

addTag

self.addTag(tag) -> adds the specified tag to the Track.

@param tag: Tag object to apply to the track

@return: a Tag object

addTransition

self.addTransition(transition) -> adds a transition to the timeline for the track. Can only be called when the track has been added to a Sequence.

@param transition: the Transition to add to this track

@return: a Transition object

clearRange

self.clearRange(start, end, ripple) -> Clears a time range out of the track; effectively a razor on any clips straddling the start and end, and a delete of everything else.

@param start: the start of the range to clear

@param end: the end of the range to clear

@param ripple: set to True to shift the remaining track items to the left

guid
isEnabled

self.isEnabled() -> returns True if the Track object is enabled.

@return: True or False

isLocked

self.isLocked() -> returns True if the Track object is locked.

@return: True or False

isNull

self.isNull() -> returns True if the Track object is invalid.

@return: True or False

metadata

self.metadata() -> returns the metadata for this Track.

@return: DataCollection object

name

self.name() -> returns the name of the track. Identical to calling trackName().

@return: string

numItems

self.numItems() -> returns the number of items in this track.

@return: int

numTransitions

self.numTransitions() -> returns the number of transitions in this track.

@return: int

project

self.project() -> returns the Project object that this item is attached to or None if the object is not attached to a project.

@return: Project object

razorAt

self.razorAt(time) -> Creates razor cuts on a track for the parameter time(s).

@param time: if a single (integer) value, indicates the razor cut time; if a tuple or list of integer values, then the times to create multiple cuts at

removeItem

self.removeItem(trackItem) -> removes a track item from this track.

@param trackItem: the TrackItem to remove from this track

removeTag

self.removeTag(tag) -> removes the tag from the track.

@param tag: tag object

removeTransition

self.removeTransition(transition) -> removes a transition from the timeline of this track.

@param transition: the Transition to remove from this track’s timeline

setEnabled

self.setEnabled() -> enables or disables the Track.

setLocked

self.setLocked() -> locks or unlocks the Track.

@return: True or False

setName

self.setName() -> Sets the name of a track.

@param: string

tags

self.tags() -> returns a tuple of all of the tags applied to this object.

@return: tuple of Tag objects

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

trackIndex
trackName

self.trackName() -> returns the name of the track. Identical to calling name().

@return: string

transitions

self.transitions() -> returns a tuple of all of the transitions applied to this track object.

@return: tuple of Transition objects

class hiero.core.TrackItem

Bases: Shiboken.Object

Represents a specific item on a Track. Can also be created using the createTrackItem method on VideoTrack and AudioTrack objects. Can be converted to a MediaSource object if isSource() returns True, or a Sequence object if isSequence() returns True.

Note that the version functions don’t cause a scan of any directories for other versions of media and will only skip to versions that have already been discovered. For an example of how to do that, see Plugins/site-packages/hiero/ui/ScanForVersions.py.

For an example of how to implement custom versioning scheme, see Plugins/site-packages/hiero/core/versioning_example.py.

class MediaType

Bases: object

name
TrackItem.addTag

self.addTag(tag) -> adds a new tag to the track item.

@param tag: tag object

@return: a Tag object

TrackItem.addToNukeScript(script, firstFrame=None, additionalNodes=[], additionalNodesCallback=None, includeRetimes=False, startHandle=None, endHandle=None, trimStart=None, colourTransform=None, nodeLabel=None)

This is a variation on the Clip.addToNukeScript() method that remaps the Read frame range to the range of the this TrackItem rather than the Clip’s range. TrackItem retimes and reverses are applied via Retime and OFlow nodes if needed. The additionalNodes parameter takes a list of nodes to add before the source material is shifted to the TrackItem timeline time and trimmed to black outside of the cut. This means timing can be set in the original source range and adding channels, etc won’t affect frames outside the cut length.

TrackItem.clone

self.clone() -> returns a deep copy of this object.

@return: TrackItem object

TrackItem.currentVersion

self.currentVersion() -> returns a version object for the current version set on this track item.

@return: Version object

TrackItem.duration

self.duration() -> returns the timeline duration value for the track item.

@return: frames

TrackItem.eventNumber

self.eventNumber() -> Get the event number of this track item on it’s Sequence.

@return: integer event number

TrackItem.guid
TrackItem.handleInLength

self.handleInLength() -> returns the length of the track item’s in handle.

@return: frames

TrackItem.handleInTime

self.handleInTime() -> returns the track item’s in handle time.

@return: frames

TrackItem.handleOutLength

self.handleOutLength() -> returns the length of the track item’s out handle.

@return: frames

TrackItem.handleOutTime

self.handleOutTime() -> returns the track item’s out handle time.

@return: frames

TrackItem.inTransition

self.inTransition() -> returns the in transition for this track item.

@return: Transition object

TrackItem.isEnabled

self.isSequence() -> returns True if the track item is enabled.

@return: True or False

TrackItem.isMediaPresent

self.isMediaPreset() -> returns True if the track item represent a media source and if the media source is currently available in Hiero (and not offline). Returns False otherwise.

@return: True or False

TrackItem.isNull

self.isNull() -> returns True if the track item is invalid.

@return: True or False

TrackItem.isSequence

self.isSequence() -> returns True if the track item represents a sequence. If it does, you can create a new Sequence object with this track item.

@return: True or False

TrackItem.isSource

self.isSource() -> returns True if the track item represents a media source. If it does, you can create a new MediaSource object with this track item.

@return: True or False

self.link(trackItem) -> Links track item with another track item. Both track items must point to the same source.

@param trackItem: track item to link to

TrackItem.linkedItems

self.linkedItems() -> returns a tuple of track item objects linked to this one.

@return: tuple of TrackItem objects

TrackItem.mediaType

self.mediaType() -> returns media type for the track item.

@return: MediaType object

TrackItem.metadata

self.metadata() -> returns the metadata for the track item.

@return: DataCollection object

TrackItem.move

self.move(time) -> moves the trackitem in the sequence. This will keep the duration.

@param time: frame value. If positive, the trackitem moves right. If negative, the trackitem moves left.

TrackItem.moveTrackItems()

TrackItem.moveTrackItems(trackItems, time) -> moves a group of track items in the sequence.

@param trackItems: sequence of track items to move

@param time: frame value. If positive, the trackitems move right. If negative, the trackitems move left.

TrackItem.name

self.name() -> returns the track item’s name.

@return: string

TrackItem.numVersions

self.numVersions() -> returns the total number of versions on this track item currently (nothing to do with the maximum or minimum version number).

@return: int

TrackItem.outTransition

self.outTransition() -> returns the out transition for this track item.

@return: Transition object

TrackItem.parent

self.parent() -> returns the AudioTrack or VideoTrack that contains this item.

@return: AudioTrack or VideoTrack object

TrackItem.parentSequence
TrackItem.parentTrack
TrackItem.playbackSpeed

self.playbackSpeed() -> returns the playback speed of this track item.

@return: double

TrackItem.project

self.project() -> returns the Project object that this is attached to, or None if the object is not attached to a project.

@return: Project object

TrackItem.reconnectMedia

self.reconnectMedia(path) -> connects (or reconnects) all of the media for the Clip, using the specified path.

@param path: path to the folder with the media to connect

TrackItem.reformatState

self.reformatState() -> returns the reformat state for the track item.

@return: ReformatState object

TrackItem.removeTag

self.removeTag(tag) -> removes the tag from the track item.

@param tag: Tag object

TrackItem.sequence
TrackItem.setCurrentVersion

self.setCurrentVersion(version) -> sets the current version (by object) on this track item. Note that this method doesn’t check that the versioned media source exists on disk.

@param version: Version object

TrackItem.setCurrentVersionIndex

self.setCurrentVersionIndex(index) -> sets the current version on this track item and returns the new version object. Creates a new version if there wasn’t one before, but doesn’t check that the versioned media source exists on disk.

@param index: the integer index to set the current version on this track item to

@return: Version object

TrackItem.setEnabled

self.isSequence() -> enables or disables the track item.

@return: True or False

TrackItem.setName

self.setName(name) -> sets the name of the track item.

@param name: the value to set the track name to

TrackItem.setPlaybackSpeed

self.setPlaybackSpeed(newSpeed) -> sets the playback speed of this track item.

@param newSpeed: double

TrackItem.setSource

self.setSource(clip, trackIndex=0) -> sets the source Clip for this TrackItem.

If the TrackItem is not already in a Track, the duration will be set to the Clip’s duration.

Note that this method does not affect the undo/redo stack at all right now (meaning it is not currently undoable).

@param clip: the Clip object to set as the source for this track item

@param trackIndex: optional track index, for instance if you are adding an audio Clip and want to use its second audio track

@return: the Clip object passed in

TrackItem.setSourceIn

self.setSourceIn(time) -> sets the source in for the track item. This will shrink or grow the duration.

@param time: frame value

TrackItem.setSourceMediaColourTransform

self.setSourceMediaColourTransform(colourTransform) -> sets the input colour transform for the source media.

@param colourTransform: Colour transform name

TrackItem.setSourceOut

self.setSourceOut(time) -> sets the source out for the track item. This will shrink or grow the duration.

Note that this value depends on speed. For exact editing, edit speed instead in order to avoid rounding errors.

@param time: frame value

TrackItem.setTimelineIn

self.setTimelineIn(inTime) -> sets the timeline in value. Shrinks or grows the timeline duration, as appropriate.

@param inTime: frame value

TrackItem.setTimelineOut

self.setTimelineOut(outTime) -> sets the timeline out value. Shrinks or grows the timeline duration, as appropriate.

@param outTime: frame value

TrackItem.source

self.source() -> depending on the underlying type of the track item, returns a Clip object, a Sequence object or a MediaSource object.

@return: a Clip object, a Sequence object or a MediaSource object

TrackItem.sourceDuration

self.sourceDuration() -> returns the source duration value for the track item.

Note that this value depends on speed, and may not be an integer value.

@return: frames

TrackItem.sourceIn

self.sourceIn() -> returns the source in value for the track item.

Note that after a combination of a retime and editing, this value may not be an integer.

@return: frame

TrackItem.sourceMediaColourTransform

self.setSourceMediaColourTransform() -> returns colour transform for the media source.

@return: string

TrackItem.sourceOut

self.sourceOut() -> returns the source out value for the track item.

Note that this value depends on speed, and may not be an integer value.

@return: frame

TrackItem.tags

self.tags() -> returns a tuple of all of the tags applied to this object.

@return: tuple of Tag objects

TrackItem.thumbnail

self.thumbnail(frame) -> returns a thumbnail of the frame specified as a QImage object.

@param frame: the frame to get the thumbnail for (defaults to 0)

@param layer: the layer to get the thumbnail for (defaults to colour)

@return: QImage object

TrackItem.timelineIn

self.timelineIn() -> returns the timeline in value for the track item.

@return: frames

TrackItem.timelineOut

self.timelineOut() -> returns the timeline in value for the track item.

@return: frames

TrackItem.toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

TrackItem.trimIn

self.trimIn(time) -> trims the left end of the trackitem. This will grow or shrink the duration and the sourceDuration, but keep the playback speed.

@param time: frame value. If positive, the trackitem duration shrinks. If negative, the trackitem duration grows.

TrackItem.trimOut

self.trimOut(time) -> trims the right end of the trackitem. This will grow or shrink the duration and the sourceDuration, but keep the playback speed.

@param time: frame value. If positive, the trackitem duration shrinks. If negative, the trackitem duration grows.

self.unlink(trackItem) -> Unlinks this track item from given track item.

@param trackItem: track item from which this track item is being unlinked

TrackItem.versionDown

self.versionDown() -> decrements the current version on this track item and returns the new version object. Creates a new version if there wasn’t one before, but doesn’t check that the versioned media source exists on disk.

@return: Version object

TrackItem.versionMaxAvailable

self.versionMaxAvailable() -> returns the highest discovered version on this track item.

@return: Version object

TrackItem.versionMinAvailable

self.versionMinAvailable() -> returns the lowest discovered version on this track item.

@return: Version object

TrackItem.versionNextAvailable

self.versionNextAvailable() -> returns the next highest available version on this track item that the application has discovered.

@return: Version object

TrackItem.versionPrevAvailable

self.versionPrevAvailable() -> returns the next lowest version on this track item that the application has discovered.

@return: Version object

TrackItem.versionUp

self.versionUp() -> increments the current version on this track item and returns the new version object. Creates a new version if there wasn’t one before, but doesn’t check that the versioned media source exists on disk.

@return: Version object

class hiero.core.Transition

Bases: Shiboken.Object

Object representing a transition between two clips.

class Alignments

Bases: object

name
Transition.alignment

self.alignment() -> returns the alignment mode of this transition. Either kFadeIn, kDissolve, kFadeOut or kUnknown.

@return: alignment type (hiero.core.Transition.Alignments)

Transition.clone

self.clone() -> returns a deep copy of this object.

@return: Transition object

Transition.createDissolveTransition()

self.createDissolveTransition(trackItem1, trackItem2, duration1, duration2) -> creates a new dissolve (kDissolve) Transition between two adjacent track items.

The effect will start at duration frames from the end of the trackItem1 and end at duration frames from the start of trackItem2.

@param trackItem1: the earlier TrackItem object to dissolve from

@param trackItem2: the later TrackItem object to dissolve to

@param duration1: frames for the dissolve from

@param duration2: frames for the dissolve to

@return: Transition object

Transition.createFadeInTransition()

self.createFadeInTransition(trackItem, duration) -> creates a new fade in (kFadeIn) Transition with the timelineIn of the trackItem and the duration specified.

@param trackItem: TrackItem object to use the timelineIn value from

@param duration: frames

@return: Transition object

Transition.createFadeOutTransition()

self.createFadeOutTransition(trackItem, duration) -> creates a new fade out (kFadeOut) Transition. The in point will be the timelineOut of trackItem, minus the duration specified.

@param trackItem: TrackItem object to use the timelineOut value from

@param duration: frames

@return: Transition object

Transition.guid
Transition.isNull

self.isNull() -> returns True if this object refers to a invalid transition.

@return: True or False

Transition.parent

self.parent() -> returns the AudioTrack or VideoTrack that contains this transition.

@return: AudioTrack or VideoTrack object

Transition.project

self.project() -> returns the Project object that this item is attached to, or None if the object is not attached to a project.

@return: Project object

Transition.setAlignment

self.setAlignment(alignment) -> sets the alignment mode on this transition.

@param alignment: alignment type (hiero.core.Transition.Alignments), either kFadeIn, kDissolve, or kFadeOut

Transition.setTimelineIn

self.setTimelineIn(inTime) -> sets the in point for this transition. Note that this trims the duration of the transition.

@param inTime: frame for the new in point

Transition.setTimelineOut

self.setTimelineOut(outTime) -> sets the out point for this transition. Note that this trims the duration of the transition.

@param outTime: frame for the new out point

Transition.timelineIn

self.timelineIn() -> returns the timeline in of this transition.

@return: frame

Transition.timelineOut

self.timelineOut() -> returns the timeline out of this transition.

@return: frame

Transition.toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

class hiero.core.UndoGroup

Bases: Shiboken.Object

Helper class for beginning and ending undo on a project. Recommended usage is to create with Project.beginUndo(name), using a with block for exception safety to ensure Project.endUndo() is called. For example:

with project.beginUndo(‘My Undo’):

// Undoable edits
beginUndo

self.beginUndo() -> starts a new undo action on the project with the initialised name. See Project.beginUndo()

endUndo

self.endUndo() -> ends the undo action on the project

isNull
class hiero.core.Version

Bases: Shiboken.Object

Object representing a version of a clip or sequence. Can be created with a Clip or Sequence object.

isNull

self.isNull() -> returns True if the object is invalid, False otherwise.

@return: True or False

item

self.item() -> returns the clip or sequence stored with this version.

@return: Clip or Sequence object

name

self.name() -> returns the name of this version.

@return: string

parent

self.parent() -> returns the bin item that contains this version.

@return: BinItem object

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

versionIndex

self.versionIndex() -> returns a string containing the version’s index.

@return: string

class hiero.core.VideoTrack

Bases: core.Hiero.Python.TrackBase

Object for manipulating video tracks.

addTag

self.addTag(tag) -> adds a tag to the video track item.

@param tag: the Tag to add to the video track.

addToNukeScript(script, additionalNodes=[], additionalNodesCallback=None, includeRetimes=False, skipOffline=True)

Add a Read node for each track item to the script with AppendClip nodes to join them in a sequence. Blank Constants nodes are added to pad any gaps between clips.

@param additionalNodesCallback: callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence])

addTrackItem

self.addTrackItem(clip, position) -> if the first parameter is a Clip object, the second parameter must be specified and this method creates a new track item and adds it to this video track at the given position.

If the first parameter is a TrackItem, then this method just adds the track item specified.

This method will cut or delete track items that overlap with the one being added.

This method can only be called if the track has already been added to a Sequence.

@param clip: a Clip object or a TrackItem object, to add to this video track.@param position: int; insert position. Do not specify if clip is a TrackItem.@return: TrackItem object

clone

self.clone() -> returns a deep copy of this object.

@return: VideoTrack object

createTrackItem

self.createTrackItem(name) -> creates a new track item.

@param name: the name of the new track item

@return: TrackItem object

items

self.items() -> returns a tuple with all of the track items contained by this track.

@return: tuple of TrackItem objects

parent

self.parent() -> returns the sequence that contains this track.

@return: Sequence object

removeTag

self.removeTag(tag) -> removes the tag from the video track.

@param tag: Tag object

toString

self.toString() -> returns a description of the object. Equivalent to str(object).

@return: string

trackIndex
hiero.core.addPathRemap()

addPathRemap(windowsPathPrefix -> adds to the table of file path remapping prefixes that Hiero maintains. Pairs of path prefixes added to this table will be used to convert paths between Windows, OSX and Linux. When on Windows, Hiero will replace any Linux or OSX prefixes found with the corresponding Windows prefix. On OSX, Hiero will search for the Windows and Linux path prefixes and replace them with the corresponding OSX prefix. The same applies for OSX/Windows prefixes being replaced on Linux. These can also be configured through the user interface in the General tab of the Preferences dialog.

@param windowsPathPrefix: string

@param osxPathPrefix: string

@param linuxPathPrefix: string

@return: None

hiero.core.addPluginPath()

addPluginPath(pluginPath) -> adds a new path to the list of plugin paths searched for Python plugins (in Python/Startup and Python/StartupUI folders). The user’s .hiero folder will be the first in this list.

addPluginPath(pluginPath -> the same as above, except that the index specifies which item in the list of paths to place the new one before.

@param pluginPath: the new path to add

@param index: optional; if not specified or negative, the new path will be added to the end of the list

hiero.core.closeAllProjects()

hiero.core.closeProject() -> closes all of the existing projects without saving.

hiero.core.closeProject(bool dontSave) -> same as above, but if the parameter is set to false, unsaved projects will cause Hiero to popup a dialog for each unsaved project, asking the user if they’d like to save.

@param dontSave: True or False

hiero.core.conformer()

conformer() -> returns an interface for setting the conforming options.

@return: a Conformer object

hiero.core.defaultFrameRates()

hiero.core.defaultFrameRates() -> returns the list of frame rates displayed in Hiero’s user interface.

@return: tuple of floats

hiero.core.executeInMainThread(call, args=(), kwargs={})

Execute the callable ‘call’ with optional arguments ‘args’ and named arguments ‘kwargs’ in the main thread and return immediately. Note that this method expects a single item for args or a tuple, and a dictionary for kwargs. It will not accept anything else.

Examples of how to use this method (that work):

def someMethod(firstParameter, kwArg0=None, kwArg1=None)
print firstParameter

executeInMainThread(someMethod, “First positional parameter”) executeInMainThread(someMethod, “First positional parameter”, {‘kwArg0’: “arg0”}) executeInMainThread(someMethod, (“First positional parameter”, “kwArg0 passed as positional parameter”)) executeInMainThread(someMethod, (“First positional parameter”, “kwArg0 passed as positional parameter”), {‘kwArg1’: “arg1 as well”}) executeInMainThread(someMethod, “First positional parameter”, {‘kwArg1’: “arg1”})

An example of what won’t work:

executeInMainThread(someMethod, “First positional parameter”, “Second positional parameter”)

The above fails because the second parameter to executeInMainThread must be a dictionary.

hiero.core.executeInMainThreadWithResult(call, args=(), kwargs={})

Execute the callable ‘call’ with optional arguments ‘args’ and named arguments ‘kwargs’ in the main thread and wait for the result. Note that this method expects a single item for args or a tuple, and a dictionary for kwargs. It will not accept anything else.

Examples of how to use this method (that work):

def someMethod(firstParameter, kwArg0=None, kwArg1=None)
print firstParameter return kwArg1

result = executeInMainThreadWithResult(someMethod, “First positional parameter”) result = executeInMainThreadWithResult(someMethod, “First positional parameter”, {‘kwArg0’: “arg0”}) result = executeInMainThreadWithResult(someMethod, (“First positional parameter”, “kwArg0 passed as positional parameter”)) result = executeInMainThreadWithResult(someMethod, (“First positional parameter”, “kwArg0 passed as positional parameter”), {‘kwArg1’: “arg1 as well”}) result = executeInMainThreadWithResult(someMethod, “First positional parameter”, {‘kwArg1’: “arg1”})

An example of what won’t work:

result = executeInMainThreadWithResult(someMethod, “First positional parameter”, “Second positional parameter”)

The above fails because the second parameter to executeInMainThread must be a dictionary.

hiero.core.filenameList(directory, splitSequences=False, returnDirectories=True, returnHiddenFiles=True)

hiero.core.filenameList(directory, splitSequences, returnDirectories, returnHiddenFiles) -> Returns a list of strings representing the items found in the specified directory, putting image sequences together as one element.

@param directory: path to the directory to query

@param splitSequences: optional, defaults to False. If set to True, then splits broken image sequences up. Otherwise, broken sequences create only one entry in the returned list

@param returnDirectories: optional, defaults to True. If set to True, sub directories will be included in the returned list

@param returnHiddenFiles: optional, defaults to True. If set to True, hidden/system files will be returned in the list

For a directory with the following items: item1.txt item2.txt quicktime.mov highres1.dpx

You’d get a tuple with the same list of items (txt files are recognized as not being image sequences).

With a directory with the following items:
  • quicktime.mov
  • highres1.dpx
  • highres2.dpx
  • highres3.dpx
  • highres4.dpx
  • highres5.dpx

You’d get a tuple with: (“quicktime.mov”, “highres#.dpx 1-4”)

If you had the following in a directory:
  • highres1.dpx
  • highres2.dpx
  • highres4.dpx
  • highres5.dpx

Note the missing 3 in the above list. If you set splitSequences to False, you’d get: (“highres#.dpx 1-5”)

If instead you set splitSequences to True, you’d get: (“highres#.dpx 1-3”, “highres#.dpx 4-5”)

If you had a directory with this:
  • highres001.dpx
  • highres002.dpx
  • highres003.dpx
  • highres004.dpx
  • highres005.dpx

You’d get a tuple like this: (“highres###.dpx 1-5”)

If you had a directory with this:
  • highres99.dpx
  • highres100.dpx

You’d get this: (“highres#.dpx 99-100”)

In the above example, the sequence number crosses over from 2 digits to 3, so it is treated as one and the number of hashes (#) is put to 1, which means the number is wild.

If instead you had a directory with this:
  • highres099.dpx
  • highres100.dpx

You’d get this: (“highres###.dpx 99-100”)

Note that in this last example, the 99 is prefixed with 0.

hiero.core.formats()

formats() -> returns a tuple with all of the formats currently available.

@return: tuple of Format objects

hiero.core.getFilenameList()

Deprecated. Do not use. Use hiero.core.filenameList() instead

hiero.core.getLibraryDirectory()

getLibraryDirectory(subdirectory) -> deprecated; use libraryDirectory() instead.

hiero.core.getPluginPath()

hiero.core.getPluginPath() -> deprecated; please use hiero.core.pluginPath instead.

hiero.core.isQuickTimeFileExtension(fileExtension)
hiero.core.isVideoFileExtension(fileExtension)
hiero.core.libraryDirectory()

libraryDirectory(subdirectory) -> returns the input appended to the location of the user’s .hiero directory.

@param subdirectory: path to append to the .hiero directory

@return: string

hiero.core.newProject()

newProject() -> creates and returns a new Project object.

@return: Project object

hiero.core.openProject(path)

hiero.core.openProject(path) Opens the project found at the specified path. Must be called on the main thread. Throws an exception on failure. @param path: Path to the project file (*.hrox). @return: Opened project.

hiero.core.openProjectStartup()

openProjectStartup(path -> for internal use only, hiero.core.openProject(path) should be used instead.

@return: Project object

hiero.core.overrideApplicationSettingsSetValue()
hiero.core.pluginPath()

hiero.core.pluginPath() -> Returns a tuple of the search paths used by Hiero to load Python scripts.

@return: tuple of strings

hiero.core.presetProjects()

hiero.core.projects() -> returns a tuple of all of the currently loaded preset projects.

@deprecated: Use hiero.core.projects(Project.kStartupProjects) instead

@return: tuple of hiero.core.Project objects

hiero.core.project()

project(name) -> returns the Project with the specified name, if it can be found, or None.

@return: Project object

hiero.core.projects()

projects() -> returns a tuple of currently loaded projects which are user projects (not startup). Same effect as calling the method below passing Project.kUserProjects.

projects(projectTypes) -> returns a tuple of currently loaded projects, filtered according to projectTypes. Use hiero.core.projects()[-1] to get the last loaded project.

@param projectTypes: optional; one of Project.kAllProjects, Project.kUserProjects, Project.kStartupProjects

@return: tuple of Project objects

hiero.core.quit()

quit() -> shuts down Hiero, without saving any existing projects. Safer than calling sys.exit(), which doesn’t always clean up properly and can cause Hiero to crash. This version sets the exit code of the Hiero process to 0.

Note that this must be the last line in a script.

quit(exitCode) -> same as the first version of this method, except that this one sets the exit code of the process to the exitCode variable.

@param exitCode: optional; integer value to set the process’s exit code to

hiero.core.remapPath()

remapPath(path) -> uses the platform specific path remapping rules from the user’s preferences and applies them to the input path.

@param path: string path to apply the path remapping rules to

@return: string

hiero.core.stopScriptAndQuit()

Table Of Contents

Previous topic

API Reference

Next topic

hiero.ui reference