hiero.core reference
hiero.core method and class details
- class hiero.core.Annotation
Class for objects that can hold multiple stroke and/or text elements to provide annotation functionality. Annotation is derived from SubTrackItem and thus Annotation objects can be placed and trimmed on VideoTrack subtracks. Strokes and/or text can be added to an annotation by creating AnnotationStroke and/or AnnotationText objects and using addElement().
- addElement() Adds the specified AnnotationElement, which should be an instance of an AnnotationElement sub-class, i.e. either
an AnnotationStroke or an AnnotationText object.
- Returns:
If there was no error, returns the added element.
- addToNukeScript(script, offset=0, inputs=0, cliptype=None)
- deserialize() restore the annotation from XML data
- elements() returns a tuple with all of the elements contained in this annotation.
- Returns:
tuple of hiero.core.Element sub-class objects
- serialize() serialize the annotation object to XML
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- class hiero.core.AnnotationElement
Base class for types of elements that may be added to an Annotation. This class shold not be used directly and AnnotationElement objects should not be created.
- color() returns a tuple containing the color for this annotation element in the form (red, green, blue, alpha),
with the components represented as floating point values in the range [0, 1].
- Returns:
tuple of (red, green, blue, alpha)
- isNull()
- setColor() None
Sets the color and alpha of the element. Each component must be a floating point value in the range [0, 1].
- Parameters:
red – The new red component.
green – The new green component.
blue – The new blue component.
alpha – The new alpha component.
- toString() string
Returns a description of the object. Equivalent to str(object).
- Returns:
A string describing the object.
- class hiero.core.AnnotationStroke
A class, derived from AnnotationElement, storing a set of 2d points to represent a single stroke within an annotation.
- isNull()
- lineWidth()
- points()
self.points -> Returns a variable tuple containing the 2d points forming the stroke. Each point is represented as a 2 component tuple, with the x and y components of the point as floating point values.
- Returns:
tuple of 2 component tuples, each of the form (x, y)
- setLineWidth()
- setPoints()
self.setPoints -> Sets the points that make up this stroke, replacing any points the stroke already had. The points must be specified as a list (not tuple) of 2d points, each point being a 2 component tuple of floats or integers, e.g. [(100, 200), (123.456, 300)].
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- class hiero.core.AnnotationText
A class, derived from AnnotationElement, storing a single item of text within an annotation.
- class HorizontalJustification
- eHCenter = core.Hiero.Python.AnnotationText.HorizontalJustification.eHCenter
- eHJustify = core.Hiero.Python.AnnotationText.HorizontalJustification.eHJustify
- eHLeft = core.Hiero.Python.AnnotationText.HorizontalJustification.eHLeft
- eHRight = core.Hiero.Python.AnnotationText.HorizontalJustification.eHRight
- name
- values = {'eHCenter': core.Hiero.Python.AnnotationText.HorizontalJustification.eHCenter, 'eHJustify': core.Hiero.Python.AnnotationText.HorizontalJustification.eHJustify, 'eHLeft': core.Hiero.Python.AnnotationText.HorizontalJustification.eHLeft, 'eHRight': core.Hiero.Python.AnnotationText.HorizontalJustification.eHRight}
- class VerticalJustification
- eVBaseline = core.Hiero.Python.AnnotationText.VerticalJustification.eVBaseline
- eVBottom = core.Hiero.Python.AnnotationText.VerticalJustification.eVBottom
- eVCenter = core.Hiero.Python.AnnotationText.VerticalJustification.eVCenter
- eVTop = core.Hiero.Python.AnnotationText.VerticalJustification.eVTop
- name
- values = {'eVBaseline': core.Hiero.Python.AnnotationText.VerticalJustification.eVBaseline, 'eVBottom': core.Hiero.Python.AnnotationText.VerticalJustification.eVBottom, 'eVCenter': core.Hiero.Python.AnnotationText.VerticalJustification.eVCenter, 'eVTop': core.Hiero.Python.AnnotationText.VerticalJustification.eVTop}
- box()
self.box -> Returns a tuple containing the position and size of the text box, as floating point values.
The position is that of the box’s lower left corner.
- Returns:
The text box position and size in the form (x, y, width, height)
- eHCenter = core.Hiero.Python.AnnotationText.HorizontalJustification.eHCenter
- eHJustify = core.Hiero.Python.AnnotationText.HorizontalJustification.eHJustify
- eHLeft = core.Hiero.Python.AnnotationText.HorizontalJustification.eHLeft
- eHRight = core.Hiero.Python.AnnotationText.HorizontalJustification.eHRight
- eVBaseline = core.Hiero.Python.AnnotationText.VerticalJustification.eVBaseline
- eVBottom = core.Hiero.Python.AnnotationText.VerticalJustification.eVBottom
- eVCenter = core.Hiero.Python.AnnotationText.VerticalJustification.eVCenter
- eVTop = core.Hiero.Python.AnnotationText.VerticalJustification.eVTop
- fontPath() string
Returns the current font path for this annotation text object.
- Returns:
A string containing the current font path.
- fontSize()
- horizontalJustification()
Returns the horizontal justification of the text.
- Returns:
One of eHLeft, eHCenter, eHRight, eHJustify.
- isNull()
- rotation()
self.rotation -> float
Returns the rotation angle of the text, as a floating point value in degrees.
- Returns:
The text’s rotation angle.
- setBox(x, y, width, height) None
Sets the text box for this annotation text object. The text box determines the position and layout of the text (the layout also being affected by the alignment). The size of the text box does not affect the size of the glyphs that make up the text, that’s determined by the font size - see setFontSize() and fontSize().
- Parameters:
x – The new x-component of the bottom left corner of the text box, before any rotation.
y – The new y-component of the bottom left corner of the text box, before any rotation.
width – The new width of the text box.
height – The new height of the text box.
- setFontPath() None
Sets the path to the file from which to load the font for use with this annotation text object.
- setFontSize()
- setHorizontalJustification()
self.setHorizontalJustification -> None
Set the horizontal justification of the text.
- Parameters:
justify – One of eHLeft, eHCenter, eHRight, eHJustify.
- setRotation()
self.setRotation -> None
Sets the rotation angle of the text, with a floating point value, replacing the previous angle.
- Parameters:
rotation – The new rotation angle, in degrees.
- setText() None
Sets the text for this annotation text object.
- Parameters:
text – The new text string.
- setVerticalJustification()
self.setVerticalJustification -> None
Set the vertical justificaiton of the text.
- Parameters:
justify – One of eVBaseline, eVTop, eVCenter, eVBottom.
- text() string
- Returns:
A string containing the current text for this annotation text object.
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- verticalJustification()
Returns the vertical justification of the text.
- Returns:
One of eVBaseline, eVTop, eVCenter, eVBottom.
- class hiero.core.ApplicationSettings
Helper object to set and get application settings.
- boolValue(key, defaultValue) returns the previously stored value as True or False, named by the key parameter, or the defaultValue parameter
- 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
- Parameters:
key – string name of the value to retrieve
defaultValue – the value to return if this setting hasn’t been saved before. Does not save the value to the default.
- Returns:
string
- setBoolValue(key, value) saves the value as True or False with the application's settings using the key
- Parameters:
key – string name of the value to retrieve
value – the bool (True or False) value to save.
- setValue(key, value) saves the value with the application's settings using the key
- Parameters:
key – string name of the value to save
value – the value to store
- value(key, defaultValue=None) returns the previously stored string value named by the key parameter, or the defaultValue parameter
- Parameters:
key – string name of the value to retrieve
defaultValue – the value to return if this setting hasn’t been saved before. Does not save the value to the default
- Returns:
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
Object for manipulating audio tracks.
- addTag(tag) adds a tag to the audio track item.
- Parameters:
tag – the hiero.core.Tag to add to the audio track
- Returns:
hiero.core.Tag object
- 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.
- Parameters:
clip – a hiero.core.Clip object or a hiero.core.TrackItem object, to add to this audio track.
audioChannel – int; audio channel that will be associated with the track item. Do not specify if clip is a TrackItem.
position – int; insert position. Do not specify if clip is a TrackItem.
- Returns:
hiero.core.TrackItem object
- clone() returns a deep copy of this object.
- Returns:
hiero.core.AudioTrack object
WARNING - DEPRECATED ( clone ): This method is deprecated and will not be present in future versions of the Python API. This method has been replaced by copy().
- copy() returns a deep copy of this object.
- Returns:
hiero.core.AudioTrack object
- createTrackItem(name) creates a new track item.
- Parameters:
name – the name of the new track item
- Returns:
hiero.core.TrackItem object
- items() returns a tuple with all of the track items contained by this track.
- Returns:
tuple of hiero.core.TrackItem objects
- parent() returns the sequence that contains this track.
- Returns:
hiero.core.Sequence object
- removeTag(tag) removes the tag from the audio track.
- Parameters:
tag – hiero.core.Tag object
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- trackIndex()
- class hiero.core.BackgroundRenderObserver
Observer of background renders.
- isNull()
- onFrameRenderCancelled()
- onFrameRenderError()
- onFrameRenderInProgress()
- onFrameRenderQueued()
- onFrameRendered()
- onRenderQueued()
- class hiero.core.Bin
Container object for hiero.core.BinItem objects (wrapping hiero.core.Clip and hiero.core.Sequence objects) and other hiero.core.Bin objects.
- class ItemType
- kBin = core.Hiero.Python.Bin.ItemType.kBin
- kClip = core.Hiero.Python.Bin.ItemType.kClip
- kNone = core.Hiero.Python.Bin.ItemType.kNone
- kSequence = core.Hiero.Python.Bin.ItemType.kSequence
- kTag = core.Hiero.Python.Bin.ItemType.kTag
- name
- values = {'kBin': core.Hiero.Python.Bin.ItemType.kBin, 'kClip': core.Hiero.Python.Bin.ItemType.kClip, 'kNone': core.Hiero.Python.Bin.ItemType.kNone, 'kSequence': core.Hiero.Python.Bin.ItemType.kSequence, 'kTag': core.Hiero.Python.Bin.ItemType.kTag}
- addItem(object) adds the item to the bin object.
- Parameters:
object – hiero.core.Bin, hiero.core.BinItem, or hiero.core.Tag object, to be added as a sub item of the bin object
- Returns:
Added object
- bins() returns a tuple with all of the sub bins contained by this object.
- Returns:
tuple of hiero.core.Bin objects
- clips() returns a tuple with all of the BinItem's containing clips contained by this bin.
- Returns:
tuple of hiero.core.BinItem objects
- color() Get the bin display color, or an invalid QColor if not set.
- Returns:
PySide2.QtGui.QColor
- createClip(path, **knobs) Construct a clip from a path and optional knob values, and add it to the bin.
- Parameters:
path – path to use, may contain expressions
knobs – keyword args for specifying additional knobs to set
- Returns:
the created Clip
- deserializeChildItem()
- displayColor() Returns the bin's color if one is set, otherwise returns the preference color associated with this bin.
- Returns:
PySide2.QtGui.QColor
- guid()
- importFolder(path) imports the media in the path into this bin (needs a project).
- Parameters:
path – path to the media to import
- Return Bin:
returns the bin created for imported media
- 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.
- Parameters:
filename – path to the file to import the sequence from
timeBase – optional argument of type hiero.core.TimeBase specifying the timebase for the created sequence
frameRate – optional float argument specifying the frame rate for the created sequence
- Returns:
hiero.core.Sequence the created sequence
- isNull() returns True if the object is invalid.
- Returns:
True or False
- items(typeFilter) returns a tuple with all of the objects contained by this bin, filtered by the typeFilter argument, if supplied.
- Parameters:
typeFilter – combination of hiero.core.Bin.ItemType flags
- Returns:
tuple of hiero.core.BinItem objects
- kBin = core.Hiero.Python.Bin.ItemType.kBin
- kClip = core.Hiero.Python.Bin.ItemType.kClip
- kNone = core.Hiero.Python.Bin.ItemType.kNone
- kSequence = core.Hiero.Python.Bin.ItemType.kSequence
- kTag = core.Hiero.Python.Bin.ItemType.kTag
- moveItem()
- name() returns the name of the bin.
- Returns:
True or False
- numChildren() returns the number of child objects contained by this bin.
- Returns:
int
- parentBin() returns the bin that contains this object.
- Returns:
hiero.core.Bin object
- project() returns the Project object that this is attached to, or None if the object is not attached to a project.
- Returns:
hiero.core.Project object
- reconnectMedia(path) For any Clips or Sequences in the bin, reconnects media found in the specified path.
- Parameters:
path – path containing media to reconnect to
- removeItem(object) removes the item from the bin object. If the object is not a child item of the bin object, throws an exception.
- Parameters:
object – hiero.core.Bin, hiero.core.BinItem, or hiero.core.Tag object to be removed as a sub item of the bin object
- sequences() returns a tuple with all of the BinItem's containing sequences contained by this bin.
- Returns:
tuple of hiero.core.BinItem objects
- serialize()
- setColor(color) Set the bin display color.
- Parameters:
color – the color to set, as a PySide2.QtGui.QColor, a string (e.g. ‘#ff0000’) or an integer containing the RGB components (e.g. 0x11aa33).
- setName(name) set the name of the bin.
- syncName(name) set the name of the bin without sending additional notifications.
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- class hiero.core.BinItem
Generic object wrapper with shared functionality for sequences and clips.
- activeItem() returns the item contained by this bin item.
- Returns:
hiero.core.Clip or hiero.core.Sequence object
- activeVersion() gets the currently active Version object of the bin item.
- Returns:
hiero.core.Version object
- addSnapshot(comment) adds a new snapshot for the object, with a comment.
- addSnapshot(sequence, comment) adds a new snapshot for the object, using the sequence as the new snapshot, setting the comment.
- Parameters:
comment – a comment string to set on the snapshot
sequence – a hiero.core.Sequence object to create the Snapshot from
- Returns:
hiero.core.Snapshot object
- addVersion(version) adds the version parameter to the bin item.
- Parameters:
version – hiero.core.Version object for the new version
position – position at which the new Version must be inserted, if -1 then insert at end
- Returns:
hiero.core.Version object
- clone() returns a deep copy of this object.
- Returns:
hiero.core.BinItem object
WARNING - DEPRECATED ( clone ): This method is deprecated and will not be present in future versions of the Python API. This method has been replaced by copy().
- color() Get the bin item display color, or an invalid QColor if not set.
- Returns:
PySide2.QtGui.QColor
- copy() returns a deep copy of this object.
- Returns:
hiero.core.BinItem object
- createClipVersion(position, path, **knobs) Construct a clip from a path and optional knob values, and add it as a new version. Raises RuntimeError if creating the clip fails or the path already exists as a version.
- Parameters:
position – position at which the new Version must be inserted, if -1 then insert at end
path – path to use, may contain expressions
knobs – keyword args for specifying additional knobs to set
- Returns:
the created Version
- deserializeChildItem()
- displayColor() Returns the item's color if one is set, otherwise returns the preference color associated with this item type.
- Returns:
PySide2.QtGui.QColor
- guid()
- hasVersion(index) checks if a given version exists and is valid.
- Parameters:
index – index of the version to check for
- Returns:
True or False
- isClipVersion(index) checks if a given clip belongs to this BinItem as a version.
- Parameters:
clip – Clip to look for
- Returns:
True or False
- isNull() returns True if the object contains a invalid hiero.core.Sequence or hiero.core.Clip object.
- Returns:
True or False
- items() returns a tuple containing all of the different versions of this object.
- Returns:
tuple of hiero.core.Version objects
- maxVersion() finds the maximum (last) version and sets it as the active version on this bin item and any linked TrackItems. Offline versions and hidden versions will be ignored during the search.
- Returns:
hiero.core.Version object
- minVersion() finds the minimum (first) version and sets it as the active version on this bin item and any linked TrackItems. Offline versions and hidden versions will be ignored during the search.
- Returns:
hiero.core.Version object
- name() returns the name of the item.
- Returns:
string
- nextVersion() finds the next version and sets it as the active version on this bin item and any linked TrackItems. Offline versions and hidden versions will be ignored during the search.
- Returns:
hiero.core.Version object
- numSnapshots() returns the number of snapshots that this bin item has.
- Returns:
int
- numVersions() returns the number of versions for this bin item.
- Returns:
int
- parentBin() returns the bin object that contains this bin item.
- Returns:
hiero.core.Bin object
- prevVersion() finds the previous version and sets it as the active version on this bin item and any linked TrackItems. Offline versions and hidden versions will be ignored during the search.
- Returns:
hiero.core.Version object
- project() returns the Project object that this object is attached to, or None if the object is not attached to a project.
- Returns:
heiro.core.Project object
- removeVersion(version) remove a version from the BinItem. The version must not currently be in use in the project.
- Parameters:
version – hiero.core.Version object to be removed
- restoreToSnapshot(index) adds a new snapshot for the object, with a comment.
- Parameters:
index – index of the Snapshot to restore from. Generates an exception if the index is out of range
- serialize()
- setActiveVersion(version) sets the active version to the version parameter.
- Returns:
hiero.core.Version object
- setActiveVersionIndex(version) sets the currently active version by index.
- Parameters:
index – index of the version to make active
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( setActiveVersionIndex ): This method is deprecated and will not be present in future versions of the Python API. Version indices are no longer unique identifiers and should not be used as such. Please use BinItem.setActiveVersion() instead.
- setColor(color) Set the bin item display color.
- Parameters:
color – the color to set, as a PySide2.QtGui.QColor, a string (e.g. ‘#ff0000’) or an integer containing the RGB components (e.g. 0x11aa33).
- setName(name) set the name of the item.
- snapshots() returns a tuple of all of the snapshots contained by this object.
- Returns:
tuple of hiero.core.Snapshot objects
- syncName(name) set the name of the item without sending additional notifications.
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- version(index) gets a Version object for the version of the bin item specified by the index.
- Parameters:
index – index of the version to get
- Returns:
hiero.core.Version object
- versionDown() decrements the current/active version and returns the newly active Version object of the bin item.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionDown ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from BinItem. To find new versions, please use hiero.core.VersionScanner. To obtain the next version, please use BinItem.prevVersion().
- 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.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionMaxAvailable ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from BinItem. This method has been replaced by BinItem.maxVersion().
- 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.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionMinAvailable ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from BinItem. This method has been replaced by BinItem.minVersion().
- 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.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionNextAvailable ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from BinItem. This method has been replaced by BinItem.nextVersion().
- 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.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionPrevAvailable ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from BinItem. This method has been replaced by BinItem.prevVersion().
- versionUp() increments the current/active version and returns the newly active Version object of the bin item.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionUp ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from BinItem. To find new versions, please use hiero.core.VersionScanner. To obtain the next version, please use BinItem.nextVersion().
- class hiero.core.Clip
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.
- class LocalisationPolicy
- kAlwaysLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kAlwaysLocalise
- kAutoLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kAutoLocalise
- kNeverLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kNeverLocalise
- kOffLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kOffLocalise
- kOnDemandLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kOnDemandLocalise
- kOnLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kOnLocalise
- name
- values = {'kAlwaysLocalise': core.Hiero.Python.Clip.LocalisationPolicy.kAlwaysLocalise, 'kAutoLocalise': core.Hiero.Python.Clip.LocalisationPolicy.kAutoLocalise, 'kNeverLocalise': core.Hiero.Python.Clip.LocalisationPolicy.kNeverLocalise, 'kOffLocalise': core.Hiero.Python.Clip.LocalisationPolicy.kOffLocalise, 'kOnDemandLocalise': core.Hiero.Python.Clip.LocalisationPolicy.kOnDemandLocalise, 'kOnLocalise': core.Hiero.Python.Clip.LocalisationPolicy.kOnLocalise}
- class LocalizationPolicy
- kAlwaysLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kAlwaysLocalize
- kAutoLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kAutoLocalize
- kNeverLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kNeverLocalize
- kOffLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kOffLocalize
- kOnDemandLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kOnDemandLocalize
- kOnLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kOnLocalize
- name
- values = {'kAlwaysLocalize': core.Hiero.Python.Clip.LocalizationPolicy.kAlwaysLocalize, 'kAutoLocalize': core.Hiero.Python.Clip.LocalizationPolicy.kAutoLocalize, 'kNeverLocalize': core.Hiero.Python.Clip.LocalizationPolicy.kNeverLocalize, 'kOffLocalize': core.Hiero.Python.Clip.LocalizationPolicy.kOffLocalize, 'kOnDemandLocalize': core.Hiero.Python.Clip.LocalizationPolicy.kOnDemandLocalize, 'kOnLocalize': core.Hiero.Python.Clip.LocalizationPolicy.kOnLocalize}
- addAnnotationsToNukeScript(script, firstFrame, trimmed, trimStart=None, trimEnd=None)
Add the annotations inside a clip to a Nuke script. This is separated from Clip.addToNukeScript() so it’s easier to control where in the script the annotations are placed. The parameters are used to determine the frame range for the annotations.
- addTag() adds the tag to the set of tags attached to the Clip.
- Parameters:
tag – the tag object to add
- Returns:
hiero.core.Tag object
- addTagToRange(tag, inTime, outTime) adds the tag to the specified range of the Clip.
- Parameters:
tag – the tag object to add
inTime – from - time to add tag
outTime – to - time to add tag
- Returns:
hiero.core.Tag object
- 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.
- Parameters:
script – Nuke script object to add nodes
additionalNodes – List of nodes to be added post read
additionalNodesCallback – callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence])
firstFrame – Custom offset to move start frame of clip
trimmed – If True, a TimeClip 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.
trimStart – Override the trim range start with this value.
trimEnd – Override the trim range end with this value.
colourTransform – if specified, is set as the color transform for the clip
metadataNode – node containing metadata to be inserted into the script
includeMetadataNode – specifies whether a metadata node should be added to the script
nodeLabel – optional label for the Read node
enabled – enabled status of the read node. True by default
includeEffects – if True, soft effects in the clip are included
beforeBehaviour – What to do for frames before the first ([hold|loop|bounce|black])
afterBehaviour – What to do for frames after the last ([hold|loop|bounce|black])
- clone() returns a deep copy of this object.
- Returns:
hiero.core.Clip object
WARNING - DEPRECATED ( clone ): This method is deprecated and will not be present in future versions of the Python API. This method has been replaced by copy().
- copy() returns a deep copy of this object.
- Returns:
hiero.core.Clip object
- entityReference() returns this clip's asset management system entity reference.
- Returns:
string
- getAvailableOcioColourTransforms() returns colour transform for the source media.
- Returns:
string
- getReadInfo(firstFrame=None)
Get information (filename and start at value) for any Read Node in this clip.
- Parameters:
firstFrame – Custom offset to move start frame of clip
- guid()
- hasError() check if the clip is in error state
- hasMultipleViews() returns true if the Clip has multiple views available for display given the current settings of the project it belongs to.
- Returns:
bool
- isLocalised() returns whether the clip is completely localised.
[DEPRECATION WARNING] function will be removed in Nuke 12 use ‘isLocalized’ instead.
- Returns:
bool
- isLocalizationOutdated() Returns whether the source media has changed.
- Returns:
bool
- isLocalized() returns whether the clip is completely localized.
- Returns:
bool
- isNull() returns False if this is a valid Clip object, True otherwise.
- Returns:
True or False
- kAlwaysLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kAlwaysLocalise
- kAlwaysLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kAlwaysLocalize
- kAutoLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kAutoLocalise
- kAutoLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kAutoLocalize
- kNeverLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kNeverLocalise
- kNeverLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kNeverLocalize
- kOffLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kOffLocalise
- kOffLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kOffLocalize
- kOnDemandLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kOnDemandLocalise
- kOnDemandLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kOnDemandLocalize
- kOnLocalise = core.Hiero.Python.Clip.LocalisationPolicy.kOnLocalise
- kOnLocalize = core.Hiero.Python.Clip.LocalizationPolicy.kOnLocalize
- localisationPolicy() returns the localisation policy of the clip.
[DEPRECATION WARNING] function will be removed in Nuke 12 use ‘localizationPolicy’ instead.
- Returns:
LocalisationPolicy
- localisationProgress() returns the localisation progress of the clip, where 0 is totally non-localised and 1 is completely localised.
[DEPRECATION WARNING] function will be removed in Nuke 12 use ‘localizationProgress’ instead.
- Returns:
double
- localizationPolicy() returns the localization policy of the clip.
- Returns:
LocalizationPolicy
- localizationPriority() returns localization priority value which determines the order in which files are localized
- Returns:
int
- localizationProgress() returns the localization progress of the clip, where 0 is totally non-localized and 1 is completely localized.
- Returns:
double
- mediaSource() returns the clip's media source.
- Returns:
hiero.core.MediaSource object
- metadata()
self.isNull() -> returns a copy of the clip’s metadata.
- Returns:
hiero.core.Metadata object
- numAudioTracks() returns number of audio tracks contained by this clip.
- Returns:
int
- numVideoTracks() returns number of video tracks contained by this clip.
- Returns:
int
- readNode() returns the Read node representing the Clip's media
- Returns:
nuke.Node
- reconnectMedia(path) Reconnect the Clip with media found in the specified path.
- Parameters:
path – path containing media to reconnect to
- refresh() updates the clip if the source media has changed.
- removeTag(tag) removes the tag from the clip.
- Parameters:
tag – hiero.core.Tag object
- rescan() updates the clip and rescan the frame range if the source media has changed.
- setCameraColourTransform(colourTransform) sets the camera colour transform for the source media.
- Parameters:
colourTransform – Colour transform name
- setEntityReference(location) set this clip's (asset management system) entity reference.
- Parameters:
location – Asset management system’s string identifier for the entity.
- setFrameRange() Sets the clip frame range to the specified values.
- setLocalisationPolicy() sets the localisation policy to the clip.
[DEPRECATION WARNING] function will be removed in Nuke 12 use ‘setLocalizationPolicy’ instead.
- Parameters:
localisationPolicy – localisation policy to apply to the clip
- setLocalizationPolicy(policy) sets the localization policy to the clip.
- Parameters:
policy – localization policy to apply to the clip
- setLocalizationPriority(priority) sets localization priority value which determines the order in which files are localized
- Param:
priority int
- setSourceMediaColourTransform(colourTransform) sets the input colour transform for the source media.
- Parameters:
colourTransform – Colour transform name
- sourceIn() returns the source in value for the clip.
- Returns:
frame
- sourceMediaColourTransform() returns colour transform for the source media.
- Returns:
string
- sourceOut() returns the source out value for the clip.
- Returns:
frame
- subTrackItems()
- views() get the list of views available for the clip. If it uses a path with %v/%V, this will return all the views for which media exists. If the source media contains multiple named views, it will return those (note this does not work for mov files). Otherwise returns an empty list.
return: list(str)
- class hiero.core.ConformRule
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
- kConform = core.Hiero.Python.ConformRule.Type.kConform
- kConformAndReconnect = core.Hiero.Python.ConformRule.Type.kConformAndReconnect
- kReconnect = core.Hiero.Python.ConformRule.Type.kReconnect
- name
- values = {'kConform': core.Hiero.Python.ConformRule.Type.kConform, 'kConformAndReconnect': core.Hiero.Python.ConformRule.Type.kConformAndReconnect, 'kReconnect': core.Hiero.Python.ConformRule.Type.kReconnect}
- activate() adds this conform rule to the list of conform rules. Conform operations done after this call will use the rule.
- appliesToTrackItems() should return True if this conform rule applies to track items.
- Returns:
True or False; default implementation returns True
- 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’
- Returns:
True for a match, False otherwise; default implementation returns False
- conformType() Get the conform types for which this rule can be used. The default is kConform.
- Returns:
one of the constants kConform, kReconnect, kConformAndReconnect
- deactivate() removes this conform rule from the list of conform rules. Conform operations done after this call will not use the rule.
- isNull()
self.name() -> should return True if the conform rule is invalid.
- Returns:
True for invalid, False otherwise
- kConform = core.Hiero.Python.ConformRule.Type.kConform
- kConformAndReconnect = core.Hiero.Python.ConformRule.Type.kConformAndReconnect
- kReconnect = core.Hiero.Python.ConformRule.Type.kReconnect
- name() returns the name of the conform rule (which was passed to the object in it's initializer).
- Returns:
string
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- class hiero.core.Conformer
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.
- excludeNonOverlappingTimecode() returns the state of the exclude non-overlapping timecode flag.
- Returns:
True when media which does not have timecode overlapping track items is excluded from matching.
- excludePatterns() returns the list of file patterns that are excluded from source media searches.
By default this is empty.
- Returns:
A list containing the file patterns excluded from source media searches.
- includeAlreadyMatched() returns the state of re-conform media flag.
- Returns:
True when the tracks that already have media attached will be re-conformed.
- includePatterns() returns the list of file patterns that are included in source media searches.
By default this is ‘*’, which includes all file types.
- Returns:
A list containing the file patterns included in source media searches.
- 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.
- Returns:
A dictionary containing the enabled flag for each native rule, keyed by the rule name.
- nativeRuleNames() returns the list of names for the native rules.
This can be used to set rule filtering.
- Returns:
A list containing the names for all of the conform rules built-in to Hiero.
- 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.
- Returns:
A dictionary containing the enabled flag for each Python rule, keyed by the rule name.
- pythonRuleNames() returns the list of names for the registered Python rules.
This can be used to set rule filtering.
- Returns:
A list containing the names for all of the conform rules that have been added through the Python API.
- setExcludeNonOverlappingTimecode(flag) controls whether matching is done on media which does not have timecode which overlaps the track item.
- setExcludePatterns(filepatterns) sets the list of file patterns to exclude from source media searches.
- setIncludeAlreadyMatched(flag) controls whether to re-connect tracks that already have media matched to them.
- setIncludePatterns(filepatterns) sets the list of file patterns to include in source media searches.
- setNativeRuleFiltering(ruleFiltering) uses a dictionary keyed on the names of the native conforming rules to set whether each rule is enabled for conforming.
- setPythonRuleFiltering(ruleFiltering) uses a dictionary keyed on the names of the Python conforming rules to set whether each rule is enabled for conforming.
- setUseBestTimecodeMatch(flag) controls whether to accept the best timecode match if no rules match.
- useBestTimecodeMatch() returns the state of the use best timecode match flag.
- Returns:
True when the best timecode match will be accepted if no rules match.
- class hiero.core.DataCollection
Storage objects for key/value pairs. Generally used to store metadata.
- dict() returns a dictionary of key/value pairs. Can be used to iterate over the items in this collection.
- Returns:
dict
- hasKey(key) returns True if the collection has a value for the key.
- Parameters:
key – the key to look up
- Returns:
True or False
- keys() returns keys in the collection.
- Returns:
list of strings which are keys in the collection
- readOnly(key) returns True if the collection can be modified.
- Returns:
True or False
- setValue(key) sets the value of the key stored in this collection.
- Parameters:
key – the key to look up
value – value to assign to key
- toString() returns a formatted list of the key/value pairs currently set on this object. Equivalent to str(object).
- Returns:
string
- value(key) returns the value of the key stored in this collection. Throws an exception if the key does not exist.
- Parameters:
key – the key to look up
- Returns:
string
- class hiero.core.EffectTrackItem
Class representing an effect on a sequence. EffectTrackItem is derived from SubTrackItem and thus EffectTrackItem objects can be placed and trimmed on VideoTrack subtracks. The effect’s node can be accessed with effect.node(), which can then be manipulated through the nuke Node API.To create effects, it is recommended you use the hiero.core.VideoTrack.createEffect() method.
Usage: EffectTrackItem(effectType) EffectTrackItem(effectType, timelineIn, timelineOut)
- addToNukeScript(script, offset=0, inputs=1, startHandle=0, endHandle=0, addLifetime=True)
- clone() returns a deep copy of this object but, unlike copy(), this clones the underlying Nuke node so that the knobs are shared.
- copy() returns a deep copy of this object.
- declone() Declones the effect item. Has no effect if the item is not a clone.
- isRetimeEffect()
Check if an EffectTrackItem applies a retime. Currently this only applies to TimeWarp effects.
- isValid() Returns true if the effect item is in a valid state and position and false otherwise.
- name() Get the name of the effect's node.
- Returns:
string
- node() Node
Get the node used to apply the effect.
- Returns:
The effect node.
- setName() Set the name of the effect's node.
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- class hiero.core.ExportStructure2[source]
ExportStructure2 is the implementation of the datastructure used to represent the export tree, each node within the tree is represented by an ExportStructureElement. Although this matches how the export presets are viewed in the UI, when it comes running an export, or persisting the structure, it is flattened into a list of paths and task presets.
- exportRootPath()[source]
Returns the exportRootPath, the root of the export into which the export structure is built
- class hiero.core.ExportStructureElement(name, isFolder)[source]
ExportStructureElement represents a node within the export structure
- addPathChangedCallback(callback)[source]
Add a callback to be notified when the path of this element has changed, callbacks should take the arguments (oldPath, newPath).
- childIndex(element)[source]
Given a child element, identify and return the index of the child within the children array. Returns -1 if child not found.
- findElementsByPath(path)[source]
Search recursively through the element tree finding elements which match path. Returns a list.
- pathChanged(oldPath)[source]
Notify children and any observers that the element’s path has changed.
- class hiero.core.FlipbookManager
Object for Flipbook manager
- createClip(filepath) creates and return a flipbook clip for the defined filepath.
- Returns:
hiero.core.Clip
- createEffectItem(effectType, timelineIn, timelineOut) creates and return a flipbook Soft Effect with defiend effectType,
covering the specified timeline in and out range.
- Returns:
hiero.core.EffectTrackItem
- createSequence(framerate, outputformat) creates and returns a flipbook sequence with the defined framerate and ouput formar.
- Returns:
hiero.core.Sequence
- setWorkingSpace(workingSpace) sets the colorspace to use as the working space.
- Returns:
None
- updateOCIOConfig(ocioConfigPath) updates the flipbook OCIO setting with the defined ocio config filename.
- Returns:
None
- class hiero.core.FolderTaskPreset(name, properties)[source]
Preset which can be used for creating an empty folder.
- class hiero.core.Format
Object containing width, height, pixel aspect, and name of a Clip/Sequence format.
Initialisation: Format(width, height, pixel_aspect, name)
Format(formatStr)
- Param:
width - the format’s width in pixels (integer)
- Param:
height - the format’s height in pixels (integer)
- Param:
pixel_aspect - the format’s pixel aspect ratio (float)
- Param:
name - the display name of the format (string)
- Param:
formatStr - the string representation of the format in the form returned by str(format)
Examples: F = hiero.core.Format(2048, 400, 2.37, ‘MyFormat’), F = hiero.core.Format(‘2048 400 0 0 2048 400 2.37 MyFormat’)
- 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). @parm black_outside: Value for the black_outside knob. @return: hiero.core.nuke.ReformatNode object
- aspect() returns the aspect ratio of this format.
- Returns:
float
- cleanAperture() returns a 4 element tuple with the rectangle (x1, y1, x2, y2) of the clean aperture.
- Returns:
tuple
- height() returns the height of this format.
- Returns:
int
- isValid() returns whether or not this format object has valid data.
- Returns:
True or False
- name() returns the name of this format.
- Returns:
string
- pixelAspect() returns the pixel aspect ratio of this format.
- Returns:
float
- productionAperture() returns a 4 element tuple with the rectangle (x1, y1, x2, y2) of the production aperture.
- Returns:
tuple
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- width() returns the width of this format
- Returns:
int
- class hiero.core.IExportStructure
- childElement()
- exportRootPath()
- rootElement()
- setExportRootPath()
- class hiero.core.IExportStructureElement
- addChild()
- child()
- childCount()
- childIndex()
- clearChildren()
- createChildFolder()
- createChildTask()
- fromXml()
- isLeaf()
- name()
- parent()
- path()
- preset()
- removeChild()
- setName()
- setPreset()
- setPresetType()
- toXml()
- class hiero.core.IExporterRegistry
IExporterRegistry provides a simple interface for our C++ Application to access python instance of hiero.core.TaskRegistry.
This class should not be used directly; use hiero.core.TaskRegistry instead.
- assignPresetToProject(hiero.core.TaskPreset, hiero.core.Project) Called by the C++ application to assign a TaskPreset to .
a null hiero.core.Project will remove the project assignment and revernt the preset to local ownership.
- Param:
hiero.core.TaskPreset
- Param:
hiero.core.Project
- copyAndAddProcessorPreset() Called by the C++ application to duplicate a preset.
- Param:
hiero.core.TaskPreset instance for duplication
- Returns:
new hiero.core.TaskPreset instance
- copyAndAddProjectPreset() Called by the C++ application to duplicate a preset and assign it to a new project.
- Param:
hiero.core.TaskPreset instance for duplication
- Param:
hiero.core.Project to which cloned preset should be assigned
- Returns:
new hiero.core.TaskPreset instance
- createAndAddProcessorPreset(string, hiero.core.TaskPreset) Called by the C++ application to create a new preset, using typetemplate as a template.
- Param:
string - Preset name
- Returns:
hiero.core.TaskPreset instance as type template
- createAndExecuteProcessor(hiero.core.TaskPreset, [hiero.core.ItemWrapper, ]string) Called by the C++ application to instantiate the Processor associated with specified preset and execute on the selected items.
- Param:
hiero.core.TaskPreset
- Param:
list of items for export
- Param:
name of submission object used for dispatching job to renderfarm
- discardPresetChanges()
self.startPresetChanges(hiero.core.Project) -> Discard any changes to the presets since startPresetChanges() was called.
- Param:
hiero.core.Project)
- loadPresets(string) Called by the C++ application to load presets from a specified path.
- Param:
path as string
- localPresets()
self.projectPresets() -> Returns a list of local presets assigned to the specified Project.
- Returns:
list of TaskPreset instances
- localPresetsChanged() Called by the C++ application to check whether local presets have changed since last save.
- Returns:
bool changed state
- nukeShotExportPresets(hiero.core.Project) Get a list of presets which are contain Nuke shot exports.
- Returns:
list of TaskPreset instances
- presetFromXml(string) Called by the C++ application to ask the TaskRegistry to deserialize a Task preset from xml.
- Param:
string - Preset XML
- Returns:
hiero.core.TaskPreset instance
- presetToPrettyXml(hiero.core.TaskPreset) Called by the C++ application to ask the TaskRegistry to serialize a Task preset to human friendly formatted xml.
- Param:
hiero.core.TaskPreset instance
- Returns:
string - Preset XML
- presetToXml(hiero.core.TaskPreset) Called by the C++ application to ask the TaskRegistry to serialize a Task preset to xml.
- Param:
hiero.core.TaskPreset instance
- Returns:
string - Preset XML
- presetsSubDirectory() Get the sub-directory in the plugin paths to search for presets.
- projectDuplicated(hiero.core.Project, hiero.core.Project) Called by the C++ application to notify the TaskRegistry that a project has been duplicated and its associated Presets should be duplicated and assigned to the new project.
- Param:
hiero.core.Project - original project
- Param:
hiero.core.Project - new project
- projectExportHistoryXml(hiero.core.Project) Returns a list of XML fragments containing the project export history.
- Parameters:
hiero.core.Project – project
- Returns:
list of strings
- projectPresets(hiero.core.Project) Returns a list of project presets assigned to the specified Project.
- Param:
hiero.core.Project
- Returns:
list of TaskPreset instances
- projectPresetsChanged(hiero.core.Project) Called by the C++ application to check whether project presets have changed since project last save.
- Param:
hiero.core.Project
- projectUnloaded(hiero.core.Project) Called by the C++ application to notify the TaskRegistry that a project has been unloaded and its associated Presets should be released.
- Param:
hiero.core.Project
- registerme() Called from python implimentation of TaskRegistry to register instance as the Application Task Registry.
- removeProcessorPreset(hiero.core.TaskPreset) Called by the C++ application to remove a preset from the registry.
- Param:
hiero.core.TaskPreset
- renameProcessorPreset(hiero.core.TaskPreset, string) Called by the C++ application to rename a preset in the registry.
- Param:
hiero.core.TaskPreset
- restoreProjectExportHistoryXml(hiero.core.Project, list) Restore the export history for a project.
- Parameters:
hiero.core.Project – project
list – list of strings containing export history
- revertDefaultPresets(string) Called by the C++ application reconstruct the default presets.
- Param:
path as string
- savePresets(string) Called by the C++ application to save presets to a specified path.
- Param:
path as string
- startPresetChanges(hiero.core.Project) Called when the user might start editing the presets, so the changes can be reverted if necessary.
- Param:
hiero.core.Project)
- submissionChanged(string, hiero.core.Project) Called by the C++ application when the submission choice changes in the Export Dialog.
- Param:
submission name as a string
- submissionNames() Called by the C++ application to get a list of the available Submission objects. Submission objects are used to manage render farm renders.
- Returns:
list of name strings
- validateExport(hiero.core.TaskPreset[, hiero.core.ItemWrapper]) Called by the C++ application to determinate if preset and selected items have valid resolution according the application mode.
A warning message will be shown in case of any invalid output resolution.
- Param:
hiero.core.TaskPreset
- Param:
list of items for export
- Returns:
An error string if disallowed, otherwise an empty string.
- class hiero.core.ITask
ITask provides a simple interface for our C++ Application to access Python instances of TaskBase.
This class should not be used directly; use hiero.core.TaskBase instead.
- addToQueue() adds this task into the task queue.
- children() get a list of child tasks. Note that this list should not change after addToQueue() has been called.
- clearError() clears the error or warning string for this task.
- destinationDescription() Get the destination description.
- error() Get the error string if one has been set.
- 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() called by Hiero when the user presses the Abort button. Subclasses should do any clean up in their override of this method.
- formatDescription() Get a description of the format that this task writes to.
- getExportDuration() Return the time this task took to export in milliseconds. Will return 0 until the task has finished exporting.
- ident() called by Hiero to get a unique identifier for this task.
- progress() called by Hiero to find out from the task what it's progress is, between 0.0 and 1.0.
- setDestinationDescription(desc)
- Parameters:
desc – string
- setDuplicate() Sets the flag cancelling this task and marking as duplicate.
- setError(desc) sets the error string displayed to the user in the task dialog. Error strings display in red.
- Parameters:
desc – the text to display
- setExportDuration()
For internal use only. Do not use.
- setFormatDescription(desc) tells Hiero a description of the format that this task writes to.
- Parameters:
desc – description of the format that this task outputs
- 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(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.
- Parameters:
desc – description of the task
- setWarning(desc) sets the warning string displayed to the user in the task dialog. Warning strings display in orange.
- Parameters:
desc – the text to display
- startTask() called by Hiero to tell the Task to start. Subclasses should start processing in their override of this method.
- synchronous() Returns the state of the Synchronous flag. If True, wheb added to the queue, this task will be executed imediately on the current thread.
- taskDescription() Get a description of the task.
- 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.ITaskPreset
ITaskPreset provides a simple interface for our C++ Application to access Python instances of TaskPreset.
This class should not be used directly; use hiero.core.TaskPresetBase instead.
- class ItemTypes
- kAllItems = core.Hiero.Python.ITaskPreset.ItemTypes.kAllItems
- kAudioTrackItem = core.Hiero.Python.ITaskPreset.ItemTypes.kAudioTrackItem
- kClip = core.Hiero.Python.ITaskPreset.ItemTypes.kClip
- kSequence = core.Hiero.Python.ITaskPreset.ItemTypes.kSequence
- kTrackItem = core.Hiero.Python.ITaskPreset.ItemTypes.kTrackItem
- name
- values = {'kAllItems': core.Hiero.Python.ITaskPreset.ItemTypes.kAllItems, 'kAudioTrackItem': core.Hiero.Python.ITaskPreset.ItemTypes.kAudioTrackItem, 'kClip': core.Hiero.Python.ITaskPreset.ItemTypes.kClip, 'kSequence': core.Hiero.Python.ITaskPreset.ItemTypes.kSequence, 'kTrackItem': core.Hiero.Python.ITaskPreset.ItemTypes.kTrackItem}
- getResolveEntryCount() called by Hiero to get the number of resolve tokens available on this TaskPreset.
- ident() called by Hiero to get a unique identifier for the Task related to this TaskPreset.
- isDeprecated() returns whether or not this task preset is using a deprecated configuration.
- Returns:
True or False
- kAllItems = core.Hiero.Python.ITaskPreset.ItemTypes.kAllItems
- kAudioTrackItem = core.Hiero.Python.ITaskPreset.ItemTypes.kAudioTrackItem
- kClip = core.Hiero.Python.ITaskPreset.ItemTypes.kClip
- kSequence = core.Hiero.Python.ITaskPreset.ItemTypes.kSequence
- kTrackItem = core.Hiero.Python.ITaskPreset.ItemTypes.kTrackItem
- markedForDeletion() called by Hiero to check if the preset is marked for deletion.
- name() called by Hiero to get the preset name.
- project() called by Hiero to discover which Project (if any), this preset is assigned to
- readOnly() called by Hiero to discover if this preset is marked ReadOnly.
- resolveEntryDescription() called by Hiero to get a resolve token description by index.
- resolveEntryName() called by Hiero to get a resolve token ({shot}) by index.
- setMarkedForDeletion() called by Hiero to mark this preset for deletion. The delete is not performed until presets are saved.
- setProject() called by Hiero to assign a preset to a Project.
- setReadOnly() called by Hiero to mark this preset as ReadOnly.
- summary() called by Hiero to get the preset description.
- supportedItems() called by Hiero to establish what types of object this export task operates on (Clips, Sequences, TrackItems).
- supportsAudio() returns whether or not this task preset supports audio.
- Returns:
True or False
- class hiero.core.ItemWrapper
- bin() -> converts this ItemWrapper to a hiero.core.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)
- Returns:
hiero.core.Bin object
- binItem() -> converts this ItemWrapper to a hiero.core.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)
- Returns:
hiero.core.BinItem object
- clip() -> converts this ItemWrapper to a hiero.core.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)
- Returns:
hiero.core.Clip object
- ignore()
- isNull() returns True if this is a invalid or uninitialized item, or False otherwise
- Returns:
True or False
- item() Return the item contained within this wrapper.
- Returns:
hiero.core.Sequence | hiero.core.Clip | hiero.core.TrackItemBase | hiero.core.BinItem
- name() Returns item name.
- Returns:
string
- root() the root is the highest level in the bin selected for export, Root may be null.
- Returns:
hiero.core.Bin object
- sequence() -> converts this ItemWrapper to a hiero.core.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)
- Returns:
hiero.core.Sequence object
- setTrackItemsForViews()
- trackItem() -> converts this ItemWrapper to a hiero.core.TrackItemBase 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)
- Returns:
hiero.core.TrackItem object
- trackItemsForViews()
- class hiero.core.Keys
- kAssetEntityReference = 'foundry.asset.entityReference'
- kClipComment = 'foundry.timeline.comment'
- kColorSpace = 'foundry.timeline.colorSpace'
- kDDImageRootNodeName = 'media.'
- kEdlComments = 'foundry.edl.comments'
- kEdlEditNumber = 'foundry.edl.editNumber'
- kEdlEditString = 'foundry.edl.editString'
- kEdlEffect = 'foundry.edl.effect'
- kEdlMode = 'foundry.edl.mode'
- kEdlName = 'foundry.edl.name'
- kEdlRetime = 'foundry.edl.retime'
- kEdlSourceReel = 'foundry.edl.sourceReel'
- kEdlSrcIn = 'foundry.edl.srcIn'
- kEdlSrcOut = 'foundry.edl.srcOut'
- kEdlSrcTimecode = 'foundry.edl.timecode'
- kEdlTimelineIn = 'foundry.edl.dstIn'
- kEdlTimelineOut = 'foundry.edl.dstOut'
- kMXFPreferredTransfer = 'mxf.thefoundry.PreferredTransfer'
- kMediaAudioChannels = 'audioChannels'
- kMediaDuration = 'duration'
- kMediaForceTimecode = 'forceTimecode'
- kMediaFramerate = 'framerate'
- kMediaFramerateIsNtsc = 'framerateIsNtsc'
- kMediaHeight = 'height'
- kMediaIsStillFrame = 'stillFrame'
- kMediaMasterMediaType = 'masterMediaType'
- kMediaMediaType = 'mediaType'
- kMediaName = 'name'
- kMediaSamplerate = 'samplerate'
- kMediaStartTime = 'startTime'
- kMediaTapeName = 'tapeName'
- kMediaTimecode = 'timecode'
- kMediaUmid = 'umid'
- kMediaUrl = 'url'
- kMediaWidth = 'width'
- kNukePixelEncodingMatrix = 'uk.co.thefoundry.YCbCrMatrix'
- kPlayerTrack = 'foundry.track.player'
- kQuickTimeColourspace = 'quicktime.thefoundry.Colorspace'
- kQuickTimeGamma = 'com.apple.quicktime.gamma'
- kQuickTimePixelEncoding = 'com.apple.quicktime.codec_pixel_encoding'
- kQuickTimePreferredMatrix = 'com.apple.quicktime.preferred_matrix'
- kQuickTimePreferredTransfer = 'com.apple.quicktime.preferred_transfer'
- kReadParams = 'foundry.timeline.readParams'
- kSourceAudioBitDepth = 'foundry.source.audiobitdepth'
- kSourceBitmapSize = 'foundry.source.bitmapsize'
- kSourceDuration = 'foundry.source.duration'
- kSourceFormat = 'foundry.source.format'
- kSourceFramerate = 'foundry.source.framerate'
- kSourceGamma = 'foundry.source.gamma'
- kSourceHasDefaultView = 'foundry.source.hasDefaultView'
- kSourceHeight = 'foundry.source.height'
- kSourceInputColourTransform = 'foundry.source.colourtransform'
- kSourceLayers = 'foundry.source.layers'
- kSourceNumAudioChannels = 'foundry.source.numaudiochannels'
- kSourceNumSamples = 'foundry.source.numsamples'
- kSourceOriginalSamplerate = 'foundry.source.originalsamplerate'
- kSourcePixelAspectRatio = 'foundry.source.pixelAspect'
- kSourceReelId = 'foundry.source.reelID'
- kSourceSamplerate = 'foundry.source.samplerate'
- kSourceShootTime = 'foundry.source.shoottime'
- kSourceShortFileName = 'foundry.source.shortfilename'
- kSourceSize = 'foundry.source.size'
- kSourceStartTime = 'foundry.source.starttime'
- kSourceTimecode = 'foundry.source.timecode'
- kSourceTimecodeDropFrame = 'foundry.source.timecodedropframe'
- kSourceUmid = 'foundry.source.umid'
- kSourceViewUnspecifiedPostfix = ']'
- kSourceViewUnspecifiedPrefix = '['
- kSourceViews = 'foundry.source.views'
- kSourceViewsDelimiter = ','
- kSourceWidth = 'foundry.source.width'
- kTimelineAudioSynced = 'foundry.timeline.audiosynced'
- kTimelineDuration = 'foundry.timeline.duration'
- kTimelineFramerate = 'foundry.timeline.framerate'
- kTimelineIn = 'foundry.timeline.in'
- kTimelineName = 'foundry.timeline.name'
- kTimelineOut = 'foundry.timeline.out'
- kTimelineOutputFormat = 'foundry.timeline.outputformat'
- kTimelineOverrideOutputFormat = 'foundry.timeline.overrideoutputformat'
- kTimelinePoster = 'foundry.timeline.poster'
- kTimelinePosterLayer = 'foundry.timeline.posterLayer'
- kTimelineSamplerate = 'foundry.timeline.samplerate'
- kTrackBlendEnabled = 'foundry.track.blendEnabled'
- kTrackBlendMode = 'foundry.track.blendMode'
- kTrackDuration = 'foundry.track.duration'
- kTrackEnabled = 'foundry.track.enabled'
- kTrackLocked = 'foundry.track.locked'
- kTrackMaskBlendEnabled = 'foundry.track.maskBlendEnabled'
- kTrackVolume = 'foundry.track.volume'
- hiero.core.LUTGroup()
- hiero.core.LUTs() returns a tuple with the names of all of the available luts.
- Returns:
tuple of strings
- class hiero.core.MediaFileInfo
Object representing a single set of media files on disk.
- 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).
- Returns:
integer frame
- 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.
- Returns:
string
- 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.
- Returns:
integer frame
- class hiero.core.MediaSource
Represents a media source.
- class MediaType
- kAudio = core.Hiero.Python.MediaSource.MediaType.kAudio
- kVideo = core.Hiero.Python.MediaSource.MediaType.kVideo
- name
- values = {'kAudio': core.Hiero.Python.MediaSource.MediaType.kAudio, 'kVideo': core.Hiero.Python.MediaSource.MediaType.kVideo}
- associatedFilePaths() Return a list of file paths associated with the 'main' file, this is used with r3d clips where there are multiple r3ds in sequence, or rmd files.
- Returns:
list of path strings
- static 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.
- Parameters:
path – path to where the media will eventually be
start – start of the media, in frames
duration – duration of the media, in frames
frameRate – TimeBase representing the frame rate of the media source
startTimecode – start timecode of the media
- Returns:
Created MediaSource
- duration() returns the duration, in frames.
- Returns:
frames
- fileinfos() returns a tuple of hiero.core.MediaFileInfo objects, which can be used to retrieve all of the file fragments that are used by this MediaSource.
- Returns:
tuple of hiero.core.MediaFileInfo objects
- 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.
- Returns:
string
- filenameHead() returns the portion of filename before the frame index for an image sequence.
- Returns:
string
- filenamePadding()
self.filenameHead() -> returns the number characters used for frame index. -1 if not an image sequence.
- Returns:
int
- firstpath() returns the full path of the first file used for the MediaSource.
Deprecated; Please use the fileinfos() method instead.
- Returns:
string
- 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
- Parameters:
fragmentIndex – index of the fragment to retrieve
- Returns:
string
- fragmentPath(fragmentIndex) returns the full path for the fragment of the MediaSource, specified by the fragmentIndex.
Deprecated; Please use the fileinfos() method instead.
- Parameters:
fragmentIndex – index of the fragment to retrieve
- Returns:
string
- hasAudio() True if the source has audio.
- Returns:
True or False
- hasVideo() True if the source has video.
- Returns:
True or False
- height() returns the height of the media.
- Returns:
int
- isMediaPresent() returns True if the media is present.
- Returns:
True or False
- isNull() True if the object points to an invalid source, False otherwise.
- Returns:
True or False
- isOffline() returns True if the media is missing or unavailable for any reason.
- Returns:
True or False
- kAudio = core.Hiero.Python.MediaSource.MediaType.kAudio
- kVideo = core.Hiero.Python.MediaSource.MediaType.kVideo
- metadata() returns a hiero.core.Metadata object with metadata for the MediaSource.
- Returns:
hiero.core.Metadata object
- numChannels()
- 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.
- Returns:
int
- pixelAspect() returns the pixel aspect ratio of the media.
- Returns:
float
- refresh() updates source info for latest changes in underlying files but doesn't update the frame range
- 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).
- Returns:
True or False
- startTime() returns the start time of the media.
- Returns:
int
- timecodeStart()
- toString(includeMetadata=False) returns a string with info for the MediaSource. str(object) is equivalent to object.toString().
- Parameters:
includeMetadata – True adds metadata to the string, False does not
- Returns:
string
- width() returns the width of the media.
- Returns:
int
- class hiero.core.NamingScheme
Utility object for extracting names for clips, versions and objects out of clip objects
- static 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 customized naming schema. Use default_clipName for default functionality if needed.
- Parameters:
clip – a clip to extract the name from
- Returns:
string
- static 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.
- Parameters:
clip – a clip to extract the name from
- Returns:
string
- static 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.
- Parameters:
clip – a clip to extract the name from
- Returns:
string
- static default_trackItemName(clip) extracts name from clip that will be used for naming track items when added to a sequence.
Do not redefine this method. It preserves accessibility to default functionality when redefining trackItemName.
- Parameters:
clip – a clip to extract the name from
- Returns:
string
- static 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.
- Parameters:
clip – a clip to extract the name from
- Returns:
string
- static 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 customized naming schema. Use default_rootName for default functionality if needed.
- Parameters:
clip – a clip to extract the name from
- Returns:
string
- static trackItemName(clip) extracts name from clip that will be used for naming track items when added to a sequence.
Redefine this method if desired for customized naming schema. Use default_trackItemName for default functionality if needed.
- Parameters:
clip – a clip to extract the name from
- Returns:
string
- static 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 customized naming schema. Use default_versionName for default functionality if needed.
- Parameters:
clip – a clip to extract the name from
- Returns:
string
- class hiero.core.ProcessorBase(preset, submission, synchronous=False)[source]
ProcessorBase is the base class from which all Processors should derive. The Processor object is responible for taking the object selection and spawning Tasks with the appropriate parameters.
- errors()[source]
Get an error string from the processor. Iterates over child tasks and adds their error messages to the string. Returns None if there were no errors.
- processTaskPreQueue()[source]
processTaskPreQueue() Walk Tasks in submission and mark any duplicates.
- class hiero.core.ProcessorPreset(parentType, presetName)[source]
ProcessorPreset is the base class from which all Processor Presets must derrive The purpose of a Processor Preset is to store and data which must be serialized to file and shared between the Processor and ProcessorUI user interface component
- class hiero.core.Project
Object for manipulating projects. Can be created using hiero.core.newProject() or by the following code: hiero.core.openProject(projectPath) project = hiero.core.projects()[-1]
- class OpenFlags
- kProjectOpenDontAddToRecent = core.Hiero.Python.Project.OpenFlags.kProjectOpenDontAddToRecent
- kProjectOpenNoFlags = core.Hiero.Python.Project.OpenFlags.kProjectOpenNoFlags
- kProjectOpenStartup = core.Hiero.Python.Project.OpenFlags.kProjectOpenStartup
- name
- values = {'kProjectOpenDontAddToRecent': core.Hiero.Python.Project.OpenFlags.kProjectOpenDontAddToRecent, 'kProjectOpenNoFlags': core.Hiero.Python.Project.OpenFlags.kProjectOpenNoFlags, 'kProjectOpenStartup': core.Hiero.Python.Project.OpenFlags.kProjectOpenStartup}
- class PosterFrameSetting
- eCustom = core.Hiero.Python.Project.PosterFrameSetting.eCustom
- eFirst = core.Hiero.Python.Project.PosterFrameSetting.eFirst
- eLast = core.Hiero.Python.Project.PosterFrameSetting.eLast
- eMiddle = core.Hiero.Python.Project.PosterFrameSetting.eMiddle
- name
- values = {'eCustom': core.Hiero.Python.Project.PosterFrameSetting.eCustom, 'eFirst': core.Hiero.Python.Project.PosterFrameSetting.eFirst, 'eLast': core.Hiero.Python.Project.PosterFrameSetting.eLast, 'eMiddle': core.Hiero.Python.Project.PosterFrameSetting.eMiddle}
- class SaveFlags
- kProjectSaveAsShowFileDialog = core.Hiero.Python.Project.SaveFlags.kProjectSaveAsShowFileDialog
- kProjectSaveDontAddToRecent = core.Hiero.Python.Project.SaveFlags.kProjectSaveDontAddToRecent
- kProjectSaveDontChangeProjectPath = core.Hiero.Python.Project.SaveFlags.kProjectSaveDontChangeProjectPath
- kProjectSaveKeepName = core.Hiero.Python.Project.SaveFlags.kProjectSaveKeepName
- kProjectSaveNoFlags = core.Hiero.Python.Project.SaveFlags.kProjectSaveNoFlags
- name
- values = {'kProjectSaveAsShowFileDialog': core.Hiero.Python.Project.SaveFlags.kProjectSaveAsShowFileDialog, 'kProjectSaveDontAddToRecent': core.Hiero.Python.Project.SaveFlags.kProjectSaveDontAddToRecent, 'kProjectSaveDontChangeProjectPath': core.Hiero.Python.Project.SaveFlags.kProjectSaveDontChangeProjectPath, 'kProjectSaveKeepName': core.Hiero.Python.Project.SaveFlags.kProjectSaveKeepName, 'kProjectSaveNoFlags': core.Hiero.Python.Project.SaveFlags.kProjectSaveNoFlags}
- addView(name, color) Appends a view to this project's list of views. Returns False if name is empty or a view already exists with the same name.
- Parameters:
name – string
color – optional; string in the format #RGB, #RRGGBB, #RRRGGGBBB, #RRRRGGGGBBBB or a name from the list of colors defined in the list of SVG color keyword names
- Returns:
True or False
- audioTrackItems(partialName) returns all audio track items in a project.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
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) returns all audio tracks in a project.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
an array of hiero.core.AudioTrack objects.
Example: finds all audio tracks in a project with 30Sec in the name:
tracks = myProject.audioTracks(‘30Sec’)
- autosave() if the project has been modified create an autosave file
- 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
- Returns:
UndoGroup object
- bins(partialName) returns all bins in a project. Searches recursively, so will return bins within other bins in the list.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
an array of hiero.core.Bin objects.
Example: finds all bins in a project with MyBin in the name:
bins = myProject.bins(‘MyBin’)
- buildTrackName() get default track name used when building vfx trackthis can be configured in the project settings dialog
- cancelUndo() cancels an undo action started previously by a call to self.beginUndo().
- clearUnusedLocalFiles() clear all localised files that are not in any currently open project. This requires localisation to be enabled
- clips(partialName) returns all clips in a project.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
an array of hiero.core.Clip objects.
Example: finds all clips in a project with 30Sec in the name:
clips = myProject.clips(‘30Sec’)
- clipsBin() returns the bin object containing the top level clips, sequences and bins for this project.
- Returns:
hiero.core.Bin object
- 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.
- customExportDirectory() Get the custom directory used for exports if useCustomExportDirectory() is set to True.
- Returns:
string
- deletable() returns True if the project can be deleted.
- Returns:
True or False
- deleteView(name) Removes the view with the matching name from this project's list of views. Returns False if no matching view is found or if the view to be deleted is the only view in the project.
- Parameters:
name – string
- Returns:
True or False
- eCustom = core.Hiero.Python.Project.PosterFrameSetting.eCustom
- eFirst = core.Hiero.Python.Project.PosterFrameSetting.eFirst
- eLast = core.Hiero.Python.Project.PosterFrameSetting.eLast
- eMiddle = core.Hiero.Python.Project.PosterFrameSetting.eMiddle
- editable() returns True if the project can be edited.
- Returns:
True or False
- 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.
- exportRootDirectory() The root directory to use for exports. This will return either self.projectDirectory(True) or self.customExportDirectory() depending on the self.useCustomExportDirectory() setting.
- Returns:
string
- extractSettings() returns a dict of the project's settings. @return: dict
- framerate() project's default framerate for new sequences
- Returns:
TimeBase
- guid()
- heroView() Get the name of the hero view set on the project
- Returns:
str
- isLocalisationEnabled() return whether localisation is enabled
- Returns:
whether localisation is enabled
- isNull() returns False if this is a valid Project object, True otherwise.
- Returns:
True or False
- isRestricted() returns whether or not access to the project is restricted.
- Returns:
True or False
- kAllProjects = 0
- kProjectOpenDontAddToRecent = core.Hiero.Python.Project.OpenFlags.kProjectOpenDontAddToRecent
- kProjectOpenNoFlags = core.Hiero.Python.Project.OpenFlags.kProjectOpenNoFlags
- kProjectOpenStartup = core.Hiero.Python.Project.OpenFlags.kProjectOpenStartup
- kProjectSaveAsShowFileDialog = core.Hiero.Python.Project.SaveFlags.kProjectSaveAsShowFileDialog
- kProjectSaveDontAddToRecent = core.Hiero.Python.Project.SaveFlags.kProjectSaveDontAddToRecent
- kProjectSaveDontChangeProjectPath = core.Hiero.Python.Project.SaveFlags.kProjectSaveDontChangeProjectPath
- kProjectSaveKeepName = core.Hiero.Python.Project.SaveFlags.kProjectSaveKeepName
- kProjectSaveNoFlags = core.Hiero.Python.Project.SaveFlags.kProjectSaveNoFlags
- kStartupProjects = 2
- kUserProjects = 1
- lutSetting16Bit() returns the project's 16 bit lut setting name.
- Returns:
string
- lutSetting8Bit() returns the project's 8 bit lut setting name.
- Returns:
string
- lutSettingFloat() returns the project's float lut setting name.
- Returns:
string
- lutSettingLog() returns the project's log lut setting name.
- Returns:
string
- lutSettingMonitorOut() returns the project's Monitor Out lut setting name.
- Returns:
string
- lutSettingThumbnail() returns the project's Thumbnail lut setting name.
- Returns:
string
- lutSettingViewer()
self.lutSettingsViewer() -> returns the project’s viewer lut setting name.
- Returns:
string
- lutSettingWorkingSpace() returns the project's Working Space lut setting name.
- Returns:
string
- lutUseOCIOForExport() returns the project setting for using OCIO in nuke script export.
- Returns:
bool
- modifiedSinceLastSave() Check if the project has been modified since it was last saved
- name() returns the name of the project.
- Returns:
string
- ocioConfigName() returns the ocio config name loaded by NukeStudio. When using a custom ocio config an empty string is returned.
- Returns:
string
- ocioConfigPath() returns the project settings for the ocio config path.
- Returns:
string
- outputFormat() gets project's default outputFormat for new sequences.
- Returns:
Format
- path() returns the path to the project.
- Returns:
string
- posterFrameSettings() Get the poster frame settings used for clips added to the project.
- Returns:
tuple of poster frame setting and custom frame number
- projectDirectory() Get the project directory used for resolving relative paths and the exportRootDirectory() (if useCustomExportDirectory() is False).
- Parameters:
expanded – whether expressions in the path are expanded
- Returns:
string
- projectRoot()
[DEPRECATION WARNING] hiero.core.Project.projectRoot() will be removed in Nuke 12, use exportRootDirectory() instead. self.projectRoot() -> Get root path of the project used for exports by default.
- Returns:
string
- 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() 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.
- Returns:
string
- save() saves a previously saved project to disk.
- 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.
- Parameters:
filename – path to save the project to
- sequences(partialName) returns all sequences in a project. User can filter by by partial name.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
an array of hiero.core.Sequence objects.
Example: finds all sequences in a project with 30Sec in the name:
sequences = myProject.sequences(‘30Sec’)
- setCustomExportDirectory() Set the custom directory used for exports if useCustomExportDirectory() is set to True.
- Parameters:
path – path
- setDeletable(deletable) sets whether or not a project can be deleted.
- Parameters:
deletable – True or False
- setEditable(editable) sets whether or not a project can be edited.
- Parameters:
editable – True or False
- setFramerate(TimeBase) sets project's default framerate for new sequences.This will persist when the application is restarted
- Param:
TimeBase
- setHasMigratedSequenceProperties() Mark the project as having had deprecated sequence properties converted into soft effects.
- setLocalisationEnabled() set whether localisation is enabled. This will persist when the application is restarted.
- Parameters:
isEnabled – whether localisation should be enabled
- setModified() Set the project as modified even if just saved or loaded
- setOcioConfigPath(path) set the ocio config for the project
- setOutputFormat(Format) sets project's default output format for new sequences.
- setOutputFormat(width, height, pixelAspect, name) sets project's default output format for new sequences. This will persist when the application is restarted
- Parameters:
width – width for the output format
height – height for the output format
pixelAspect – float for pixel aspect ratio
name – string for the format name
- setPath(path) set the path a project saves to without saving it
- setPosterFrameSettings() Set the poster frame settings used for clips added to the project.
- Parameters:
setting – the mode for setting poster frames
customFrame – the frame number if mode is set to ePosterFrameCustom
- setProjectDirectory(string) Set the project directory used for resolving relative paths and the exportRootDirectory() (if useCustomExportDirectory() is False).
- Parameters:
path – the path or expression to set
- setProjectRoot()
[DEPRECATION WARNING] hiero.core.Project.setProjectRoot() will be removed in Nuke 12, use setProjectDirectory() or setCustomExportDirectory() instead. self.setProjectRoot() -> Set root path of the project used for exports by default.
- Parameters:
path – to set as project root
- setShotPresetName() set the name of Shot Preset which is usedwhen sending to nuke or creating a comp.
- Parameters:
name –
- setShowViewColors() Set if colors set for views are shown in the UI.
- setStartTimecode(Time) sets project's default start timecode for new sequences. This will persist when the application is restarted
- Parameters:
startTime – TimeBase start timecode for sequence
- setTimeDisplayFormat() sets project's default displayType for new sequences. This will persist when the application is restarted
- Parameters:
displayType – DisplayType to use
- setTrackItemVersionsLinkedToBin(linked) Set whether track item versions are linked by default
- setUseCustomExportDirectory() Set if the export root directory should be a custom directory, or use the project directory.
- Parameters:
custom –
- setViews(views) Set the project's views.
- Parameters:
views – this can be either a list of view names, or a list of tuples with (name, color)
- setViewsForStereo() Replaces the project's views with two views named "left" and "right".
- shotPresetName() get the name of Shot Preset which is usedwhen sending to nuke or creating a comp.
- Returns:
string
- showViewColors() Get if colors set for views are shown in the UI.
- startTimecode() gets project's default start frame for new sequences.
- Returns:
Time
- tagsBin() returns the bin object containing the top level tags for this project.
- Returns:
hiero.core.Bin object
- timeDisplayFormat() gets project's default displayType for new sequences. @return: DisplayType
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- trackItemVersionsLinkedToBin() Get whether track item versions are linked by default
- trackItems(partialName) returns all track items in a project.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
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) returns all tracks in a project.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
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() 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() 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.
- Returns:
string
- useCustomExportDirectory() Get if the export root directory should be a custom directory, or use the project directory.
- Returns:
bool
- static useOCIOEnvironmentOverride() returns whether the OCIO config has been overriden in the environment.
- Returns:
bool
- videoTrackItems(partialName) returns all video track items in a project.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
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) returns all video tracks in a project.
- Parameters:
partialName – optional string with partial name to match against. Will match if this string is anywhere in the name.
- Returns:
an array of hiero.core.VideoTrack objects.
Example: finds all video tracks in a project with 30Sec in the name:
tracks = myProject.videoTracks(‘30Sec’)
- views() Returns a list of this project's views.
- Returns:
list of strings
- viewsAndColors() Returns a list of this project's views and corresponding colors.
- Returns:
list of (str, PySide2.QtGui.QColor) tuples
- class hiero.core.ReformatState
Object representing a the reformatting settings for a track item. This corresponds to the Nuke ‘Reformat’ node.
- boxForceShape() returns the box 'force shape' flag.
- Returns:
bool
- boxPAR() returns the box pixel aspect ratio.
- Returns:
double
- boxSize() returns the box size.
- Returns:
QSize
- isNull()
- originalResizeFlip() returns the original resize flip flag, which may be a deprecated value if it was loaded from an old project.
- Returns:
bool
- originalResizeFlop() returns the original resize flop flag, which may be a deprecated value if it was loaded from an old project.
- Returns:
bool
- originalResizeTurn() returns the original resize turn flag, which may be a deprecated value if it was loaded from an old project.
- Returns:
bool
- originalType() returns the original reformat type of the state, which may be a deprecated value if it was loaded from an old project.
- Returns:
string
- resizeCenter() returns the resize center flag.
- Returns:
bool
- resizeFlip() returns the resize flip flag. Note: the flip option has been removed, this method should not be called.
- Returns:
bool
- resizeFlop() returns the resize flop flag. Note: the flop option has been removed, this method should not be called.
- Returns:
bool
- resizeTurn() returns the resize turn flag. Note: the turn option has been removed, this method should not be called.
- Returns:
bool
- resizeType() returns the resize type.
- Returns:
string
- scale() returns the scaling factor. Note: the scale option has been removed, this method should not be called.
- Returns:
double
- setBoxForceShape() sets the box 'force shape' flag if the reformat type is set to 'to box'.
- Parameters:
setBoxForceShape – bool
- setBoxPAR() sets the box pixel aspect ratio if the reformat type is set to 'to box'.
- Parameters:
PAR – double
- setBoxSize() sets the box size if the reformat type is set to 'to box'.
- Parameters:
size – QSize
- setResizeCenter() sets the resize center flag on the track item.
- Parameters:
center – bool
- setResizeFlip() the flip option has been removed, this method exists only for compatibility reasons
- setResizeFlop() the flop option has been removed, this method exists only for compatibility reasons
- setResizeTurn() the turn option has been removed, this method exists only for compatibility reasons
- setResizeType() sets the resize type of the state.
- Parameters:
newResizeType – string
- setScale() the scale option has been removed, this method exists only for compatibility reasons
- setType() sets the reformat type of the state.
- Parameters:
newType – string
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- type() returns the reformat type of the state.
- Returns:
string
- class hiero.core.RenderProgressObserver
Observer for tracking the progress of renders on the frame server.
- isNull()
- updateProgress() called on progress of frame renders
- Parameters:
progressList – list of lists containing [filePath, frame, progress]
- class hiero.core.RenderTaskPreset(taskType, name, properties)[source]
RenderTaskPreset is a specialization of the TaskPreset which contains parameters associated with generating Nuke render output.
- class hiero.core.ResolveTable[source]
Used to store name/value pairs that can be resolved in strings. Example: Assuming the resolve table has an item “{filename}” that resolves to example.mov, Then calling resolveTable.resolve(taskObject, “someprefix_{filename}”) will return “someprefix_example.mov” To use, create an object, call addResolver on it with whatever key/value pairs you want, and then you can call resolve on the object to resolve a string. You can also merge two ResolveTable objects, replacing existing key’s with those in the ResolveTable passed in. And you can use functions to do the resolve. These take one parameter, the task that the resolve is applying to. For an example of how to use this, see FnExporterBase.py.
- entryDescription(index) returns a description of the item, which can be used to populate a dialog to the user when they are picking keywords. [source]
- class hiero.core.Sequence
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.
- Parameters:
clip – the clip to add
time – the in time for created track items
videoTrackIndex – index of the video track to add items to if the clip has video
audioTrackIndex – index of the audio track to start adding items to if the clip has audio
- Returns:
list of created hiero.core.TrackItems
- addToNukeScript(self, script)
- Parameters:
script – Nuke script object to add nodes to.
includeRetimes – True/False include retimes
retimeMethod – “Motion”, “Blend”, “Frame” - Knob setting for OFlow retime method
additionalNodesCallback – callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence])
offset – Optional, Global frame offset applied across whole script
skipOffline – If True, offline clips are not included in the export
mediaToSkip – List of MediaSources which should be excluded from the export
disconnected – If True, tracks other than that containing the masterTrackItem are not connected to any inputs
masterTrackItem – Used for controlling the script output if disconnected is specified
includeAnnotations – If True, annotations are included in the exported script
includeEffects – If True, soft effects are included in the exported script
outputToFormat – Format to use for output. If not specified, the sequence’s own format is used.
- Returns:
None
Add nodes representing this Sequence to the specified script. If there are no clips in the Sequence, nothing is added.
- addTrack(track) adds a video or audio track to the Sequence.
- Parameters:
track – video or audio track to add
- audioTrack(index) returns the audio track for the specified index.
- Parameters:
index – index of the audio track to return
- Returns:
hiero.core.AudioTrack
- audioTracks() returns a tuple with all of the audio tracks.
- Returns:
tuple of hiero.core.AudioTrack objects
- changeFramerateKeepFrames(toTimebase) changes the timebase of the sequence, keeping frames of track items the same
- Parameters:
toTimebase – timebase to change to
- changeFramerateKeepTimecodes(toTimebase, roundingMode) changes the timebase of the sequence, keeping timecodes of track items the same, according to the specified rounding mode
- Parameters:
toTimebase – timebase to change to
roundingMode – rounding mode to use when converting timebases (hiero.core.TimeBase.kRoundNearest, hiero.core.TimeBase.kRound32Pulldown)
- clone() returns a deep copy of this object.
- Returns:
hiero.core.Sequence object
WARNING - DEPRECATED ( clone ): This method is deprecated and will not be present in future versions of the Python API. This method has been replaced by copy().
- copy() returns a deep copy of this object.
- Returns:
hiero.core.Sequence object
- deserialize() restore the sequence state from XML data
- Parameters:
rangeMin – The beginning of the timeline range effected by this change
rangeMax – The end of the timeline range effected by this change
- guid()
- importTracks(filePath) imports all of the tracks from the file specified by the filePath argument.
- Parameters:
filePath – path to the file to import tracks from
- Return tracks:
tuple of created tracks
- importTracksFromTimeBaseKeepFrames(filePath, srcTimebase) imports all of the tracks from the file specified by the filePath argument using the specified timebase.
- Parameters:
filePath – path to the file to import tracks from
srcTimebase – timebase to use when reading the source file
- Return tracks:
tuple of created tracks
- importTracksFromTimeBaseKeepTimecodes(filePath, srcTimebase, roundingMode) imports all of the tracks from the file specified by the filePath argument using the specified timebase.
- Parameters:
filePath – path to the file to import tracks from
srcTimebase – timebase to use when reading the source file
roundingMode – rounding mode to use when converting timebases (hiero.core.TimeBase.kRoundNearest, hiero.core.TimeBase.kRound32Pulldown)
- Return tracks:
tuple of created tracks
- 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.
- Returns:
tuple of hiero.core.VideoTrack and hiero.core.AudioTrack objects
- matchMedia(path) match media using the current rule configuration in hiero.core.conformer().
- Parameters:
path – path to the folder with the media to connect
- numAudioTracks() returns number of audio tracks contained by this sequence.
- Returns:
int
- numVideoTracks() returns number of video tracks contained by this sequence.
- Returns:
int
- reconnectMedia(path) For each of the Clips used by this Sequence, reconnects media found in the specified path.
- Parameters:
path – path containing media to reconnect to
- removeTrack(track) removes the track from the Sequence.
- Parameters:
track – track to remove (hiero.core.AudioTrack or VideoTrack object)
- replaceClips(path) For each of the TrackItems in this sequence, replace it's Clip with media found in the specified path.
- Parameters:
path – path containing media to replace with
- serialize() serialize the sequence object to XML
- trackItemAt(time) returns the top-most video track item for the specified time that is enabled and has media.
- Parameters:
time – frame to get the trackitem for
- Returns:
hiero.core.TrackItem
- 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).
- Parameters:
time – frame to get the trackitems for
mediaType – TrackItem.MediaType value specifying the media type of the track items to look for (defaults to kVideo)
- Returns:
tuple of hiero.core.TrackItem objects
- videoTrack(index) returns the video track for the specified index.
- Parameters:
index – index of the video track to return
- Returns:
hiero.core.VideoTrack
- videoTracks() returns a tuple with all of the video tracks.
- Returns:
tuple of hiero.core.VideoTrack objects
- class hiero.core.SequenceBase
Base class for Sequence and Clip objects. Has some methods common to both of those objects. Most likely never used directly.
- addTag(tag) adds a hiero.core.Tag object to the Clip or Sequence.
- Parameters:
tag – the tag object to add
- Returns:
hiero.core.Tag object
- addTagToRange(tag, inTime, outTime) adds a hiero.core.Tag object to the specified range of the Clip or Sequence.
- Parameters:
tag – the tag object to add
inTime – the first time at which the tag is valid
outTime – the last time at which the tag is valid
- Returns:
hiero.core.Tag object
- binItem() returns the parent BinItem this Sequence or Clip belongs to, if any.
- Returns:
BinItem
- clearInTime(t) clear the 'in' point for the clip to Time t.
- Returns:
None
- clearOutTime()
self.clearInTime(t) -> clear the ‘out’ point for the clip to Time t.
- Returns:
None
- 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.
- Parameters:
start – the start of the range to clear
end – the end of the range to clear
ripple – set to True to shift the remaining track items to the left
- disableSoftTrims() disables soft trims on the object.
- dropFrame() get whether sequence timecode is displayed in drop frame format
- duration() returns the duration of the Clip or Sequence.
- Returns:
int time value
- editFinished(trackItems) 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).This function optionally takes a list of track items that is used to selectively rebuild only those sections of the timeline.This allows a faster update when the edited track items are known.
- Parameters:
trackItems – optional, the track items to be updated
- enableSoftTrims(inTime, outTime) enables soft trims on the object.
- Parameters:
inTime – Time - soft trim in time
outTime – Time - soft trim out time
- format() returns the output Format object for this Sequence or Clip.
- Returns:
hiero.core.Format object
- framerate() returns the framerate of the Sequence or Clip.
- Returns:
hiero.core.TimeBase object
- getAnnotationsTrack() Returns the annotations track for the Clip or Sequence. If one does not already exist, it will be created.
- inOutEnabled() Checks if the 'in' and 'out' points are enabled in the Sequence or Clip.
- Returns:
bool
- inTime() returns the 'in' point set on the clip.
- Returns:
frame
- isNull() returns False if this is a valid Sequence or Clip object, True otherwise.
- Returns:
True or False
- metadata() returns a collection of metadata for the object.
- Returns:
hiero.core.DataCollection object
- name() returns the name of the object.
- Returns:
string
- outTime() returns the 'out' point set on the clip.
- Returns:
frame
- posterFrame() get the frame in the sequence used for thumbnails
- project() returns the Project object that this is attached to, or None if the object is not attached to a project.
- Returns:
hiero.core.Project object
- rawView() returns a string representing the raw view of this sequence or clip.
- Returns:
string
- razorAt(time) Creates razor cuts on all of the unlocked tracks for the parameter time(s).
- Parameters:
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
- refreshInOutEnabled() Automatically set the sequence in/out enabled based on the current in/out values.
- Returns:
None
- removeTag(tag) removes the tag from the track.
- Parameters:
tag – hiero.core.Tag object
- setDropFrame(drop) set whether sequence timecode is displayed in drop frame format
- setFormat(format) set the format of the Sequence or Clip.
- Parameters:
format – a hiero.core.Format object to set for the Clip or Sequence.
Example: myClipSequence.setFormat( hiero.core.Format(2048, 400, 2.37, ‘MyFormat’) )
- setFramerate(framerate) set the framerate of the Sequence or Clip.
- Parameters:
framerate – framerate value to set
- setInOutEnabled(enable) Enable/Disable the 'in' and 'out' points.
- Returns:
None
- setInTime(t) set the 'in' point for the clip to Time t.
This will also enable the In/Out lock.
- Returns:
None
- setName() set the name of the object.
- Param:
string new name
- setOutTime(t) set the 'out' point for the clip to Time t.
This will also enable the In/Out lock.
- Returns:
None
- setPosterFrame(frame) set the frame in the sequence used for thumbnails
- setSoftTrimsInTime(inTime) sets the in time for the soft trims. Note: this method does not enable soft trims if they are disabled.
- Parameters:
inTime – in frame value for the soft trims
- setSoftTrimsOutTime(outTime) sets the out time for the soft trims. Note: this method does not enable soft trims if they are disabled.
- Parameters:
outTime – out frame value for the soft trims
- setTimecodeStart(time) sets the value of the start timecode by frame. To convert times to frame values, use TimeCode.HMSFToFrames or TimeCode.stringToTime.
- 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.
- Parameters:
time – frame value to set the time code to
timecodeValue – string of the format “hh:mm:ss:ff”
hasDropFrames – True if the timecode includes drop frames, False otherwise
- softTrimsEnabled() returns True if soft trims are enabled, False otherwise.
- Returns:
True or False
- softTrimsInTime() returns the in time set for the soft trims.
- Returns:
frame
- softTrimsOutTime() returns the out time set for the soft trims.
- Returns:
frame
- tags() returns a tuple of all of the tags applied to this object.
- Returns:
tuple of hiero.core.Tag objects
- thumbnail(frame, layer) returns a thumbnail of the frame specified as a QImage object.
- Parameters:
frame – the frame to get the thumbnail for (defaults to 0)
layer – the layer to get the thumbnail for (defaults to colour)
- Returns:
QImage object
- timecodeStart() returns the frame value of the start timecode. To convert this to a time code string, use TimeCode.timeToString.
- Returns:
frame
- timelineOffset() returns the timeline offset value.
- Returns:
frame
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- writeAudioToFile() Bounce down audio tracks and write to wav file at specified location. File will be created or overwritten.
- Parameters:
filepath – the filepath of file to be written
inTime – in point of the timeline to write
outTime – out point of the timeline to write
numChannels – number of audio channels
sampleRate – the sample rate to export to
bitDepth – sample bit depth (PCM only)
bitRate – audio bitrate in bits (compressed formats only)
- class hiero.core.Snapshot
Object representing a snapshot of a sequence or clip. Can be created with a Clip or a Sequence object.
- comment() returns the comment set on this snapshot object.
- Returns:
string
- isNull() returns True if the object is invalid, False otherwise.
- Returns:
True or False
- item() returns the clip or sequence stored with this snapshot.
- Returns:
hiero.core.Clip or hiero.core.Sequence object
- name() returns the name of this snapshot.
- Returns:
string
- setComment(comment) sets the comment on this snapshot object.
- Parameters:
comment – string to set the comment to
- Returns:
string
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- class hiero.core.SubTrackItem
Base class for items that exist in sub-tracks, e.g. Annotation objects. This class should never be used directly.
- descString()
- setTimelineIn(inTime) sets the in point for this SubTrackItem. Note that this trims the duration of the SubTrackItem.
- Parameters:
inTime – frame for the new in point
- setTimelineOut(outTime) sets the out point for this SubTrackItem. Note that this trims the duration of the SubTrackItem.
- Parameters:
outTime – frame for the new out point
- subTrackIndex() get the index of the item's parent sub-track.
- Returns:
int index, -1 if the item has not been added to a track
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- class hiero.core.Tag
Object representing a tag in Hiero. Can be created with a string name, an optional path to an icon and an optional editable (in gui) boolean parameter
- copy()
- guid() Return the Tag guid.
- Returns:
object guid as string
- icon() returns the tags icon path.
If the file doesn’t exist, it will search for it in the plugin paths and the project folder and return the located file.
- Returns:
string
- inTime() returns the in time of the tag.
- Returns:
frame
- isNull() returns True if the tag is invalid, False otherwise.
- Returns:
True or False
- metadata() returns the clip's metadata.
- Returns:
hiero.core.DataCollection object
- name() returns the label of the tag.
- Returns:
string
- note() returns the note on the tag.
- Returns:
string
- outTime() returns the out time of the tag.
- Returns:
frame
- parentBin()
- project() returns the Project object that this is attached to, or None if the object is not attached to a project.
- Returns:
hiero.core.Project object
- serialize()
- setIcon() sets the icon on the tag.
- Parameters:
note – path to icon file
- setInTime(time) set the in time of the tag.
- Parameters:
time – the in time
- setName() sets the name label of the tag.
- Parameters:
name – name to assign to tag
- setNote() sets the note on the tag.
- Parameters:
note – string note to assign to tag
- setOutTime(time) set the out time of the tag.
- Parameters:
time – the out time
- setVisible() sets the visiblity of the tag.
- Parameters:
visible – visibility state
- syncName(name) set the name of the tag without sending additional notifications.
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- visible() gets the visiblity state of the tag.
- Returns:
bool
- class hiero.core.TaskBase(initDictionary)[source]
TaskBase is the base class from which all Tasks must derrive.
- addToQueue(self)[source]
Called by the processor in order to add the Task to the ExportQueue If derrived classes impliment this function, this base function must be called.
Populates name, description and destination fields in the export queue
- availableOutputHandles()[source]
Get the available output handles, based on self._cutHandles. If outputting to sequence time, the start handle is clamped to prevent going into negative frames.
- deleteTemporaryFile(filePath)[source]
Delete a file which is an artifact of the export, but should be removed after it’s finished. Returns whether the file was successfully deleted.
- editId(self)[source]
Returns a str containing the id of this edit. See hiero.core.TrackItem.eventNumber().
- edlEditId(self)[source]
Returns the id taken from the EDL used to create this edit, if there was one.
- filehead(self)[source]
Returns the source filename excluding image sequence frame padding and extension, if applicable
- filepadding(self)[source]
Returns the padding used in source file if an image sequence, empty string otherwise
- finishTask()[source]
Called once Task has signaled completion. Sub-classes should call this base implementation.
- inputRange()[source]
Returns the input frame range (as a tuple) for this task if applicable
- Param:
ignoreHandles - If True calculate Input Range excluding export handles
- Param:
ignoreRetimes - If True calculate Input Range without taking retimes into account
- Param:
clampToSource - If True the input range will be clamped to the available media range
- isExportingItem(item)[source]
Check if this task is already including an item in its export. Used for preventing duplicates when collating shots into a single script.
- outputHandles(ignoreRetimes=False)[source]
Return a tuple of the in/out handles generated by this task. Handles may be cropped such as to prevent negative frame indexes. Note that both handles are positive, i.e. if 12 frames of handles are specified, this will return (12, 12) Sub-classes should reimplement _outputHandles() rather than this method.
- Returns:
(in_handle, out_handle) tuple
- outputRange()[source]
Returns the output file range (as tuple) for this task, if applicable. This default implementation works if the task was initialised with a Clip or TrackItem
- outputSequenceTime()[source]
Test if the output frame range should be in sequence time rather than source. This only applies when a TrackItem is being exported.
NOTE: This option has been disabled for the time being. The code is left in place in case we want to re-enable it, but it is not available to users.
- postSequence()[source]
preSequence() This function serves as hook for custom scripts to add functionality on completion of exporting the contents of the sequence
- preSequence()[source]
This function serves as hook for custom scripts to add functionality before a task starts exporting anything with the sequence
- progress()[source]
Returns a float value 0..1 to indicate progress of task. The task is considered complete once the progress is reported as 1.
- projectRoot(self)[source]
Returns the project root export path, used for resolving the {projectroot} token
- sequenceName(self)[source]
Returns the name of the sequence or parent sequence (if exporting a track item)
- setError(desc)[source]
setError(self, desc) Call to set the state of this task to error, with a description of the error. If the task is synchronous, raise exception
- shotNameIndex(self)[source]
Returns the index string for the shot, if there are multiple shots with the same name on the sequence.
- supportedType(item)[source]
Interface for defining what type of items a Task Supports. Return True to indicate item is of supported type
- taskStep()[source]
Called every frame until task completes. Return True value to indicate task requires more steps. Return False value to indicate synchronous processing of the task is complete. The task may continue to run in the background.
- timeStampString(localtime)[source]
Convert a tuple or struct_time representing a time as returned by gmtime() or localtime() to a string formated YEAR/MONTH/DAY TIME.
- updateItem(originalItem, localtime)[source]
updateItem - This is called by the processor prior to taskStart, crucially on the main thread.
This gives the task an opportunity to modify the original item on the main thread, rather than the clone.
- class hiero.core.TaskData(preset, item, exportRoot, shotPath, version, exportTemplate, project, cutHandles=None, resolver=None, retime=False, startFrame=None, startFrameSource=None, submission=None, skipOffline=True, presetId=None, shotNameIndex='', mediaToSkip=[])[source]
TaskData is used as a seed for creating classes, wrapping up all of the parameters and making it simpler to add new ones
- kCutHandles = 'cutHandles'
- kExportRoot = 'exportRoot'
- kExportTemplate = 'exportTemplate'
- kItem = 'item'
- kMediaToSkip = 'mediaToSkip'
- kPreset = 'preset'
- kPresetId = 'presetId'
- kProject = 'project'
- kResolver = 'resolver'
- kRetime = 'retime'
- kShotNameIndex = 'shotNameIndex'
- kShotPath = 'shotPath'
- kSkipOffline = 'skipOffline'
- kStartFrame = 'startFrame'
- kStartFrameSource = 'startFrameSource'
- kSubmission = 'submission'
- kVersion = 'version'
- class hiero.core.TaskPresetBase(parentType, presetName)[source]
TaskPreset is the base class from which all Task Presets must derrive The purpose of a Task Preset is to store and data which must be serialized to file and shared between the Task and TaskUI user interface component
- addCustomResolveEntries(self, resolver)[source]
Impliment this function on custom export tasks to add resolve entries specific to that class.
- Parameters:
resolver – ResolveTable object
- addDefaultResolveEntries(self, resolver)[source]
Create resolve entries for default resolve tokens shared by all task types.
- Parameters:
resolver – ResolveTable object
- addUserResolveEntries(self, resolver)[source]
Override this function to add user specific resolve tokens. When adding task specific tokens in derrived classes use TaskBase.addCustomResolveEntries(). This is reserved for users to extend the available tokens.
- Parameters:
resolver – ResolveTable object
- createResolver(self)[source]
Instantiate ResolveTable, add default and custom resolve entries return ResolveTable object
- getResolveEntryCount(self) (DEPRICATED)[source]
Return the number of resolve entries in the resolve table
- initialiseCallbacks(exportStructure)[source]
When parent ExportStructure is opened in the ui, initialise is called for each preset. Register any callbacks here.
- isDeprecated()[source]
Determines whether the preset is deprecated. Any configuration that is deprecated should be tested here.
- markedForDeletion()[source]
Return True if this preset is marked for deletion. Delete will be performed at save
- nonPersistentProperties()[source]
Return the dictionary which contains properties not persisted within the preset. Properties which are only relevant during a single session.
- Returns:
dict
- parentType(self)[source]
Returns a the parent Task type for this TaskPreset.
- Returns:
TaskPreet class type
- project()[source]
Return the Project with which this preset is associated. If this is a local preset returns None
- properties()[source]
Return the dictionary which is used to persist data within this preset.
- Returns:
dict
- savePath(self)[source]
Return the path from which this preset was loaded. Will return None if this preset was not loaded from file
- setMarkedForDeletion(markedForDeletion=True)[source]
Set this preset as marked for deletion. Delete will be performed at save
- setSavePath(self, path)[source]
Set the save path of the preset in order to ensure it is saved to the path it was loaded from
- setSkipOffline(skip)[source]
skipOffline(bool) Set flag to skip offline TrackItems during export.
- Parameters:
bool –
- class hiero.core.TaskRegistry[source]
-
- addPresetToProjectExportHistory(project, preset)[source]
Add a preset to the export history for a project.
- assignPresetToProject(preset, project)[source]
Assign preset to project and ensure name is unique within project. Project may be None in which case preset will be assigned ‘local’
- copyAndAddProcessorPreset() Called by the C++ application to duplicate a preset. [source]
- Param:
hiero.core.TaskPreset instance for duplication
- Returns:
new hiero.core.TaskPreset instance
- copyAndAddProjectPreset(preset, project)[source]
Duplicate a preset and assign it to a project imediately to prevent name clashes
- createAndAddProcessorPreset(string, hiero.core.TaskPreset) Called by the C++ application to create a new preset, using typetemplate as a template. [source]
- Param:
string - Preset name
- Returns:
hiero.core.TaskPreset instance as type template
- createAndExecuteProcessor(preset, items, submissionName=None, synchronous=False)[source]
Instantiate the Processor associated with preset and startProcessing items
- createProcessor(preset, submissionName=None, synchronous=False)[source]
Create the processor for an export and return it. This doesn’t start the export.
- discardPresetChanges(project)[source]
self.startPresetChanges(hiero.core.Project) -> Discard any changes to the presets since startPresetChanges() was called.
- Param:
hiero.core.Project)
- findPresetInProjectExportHistory(project, presetId)[source]
Attempt to find a preset in a project’s export history.
- isNukeShotExportPreset(preset)[source]
Check if a preset is valid for Nuke shot export. To be considered valid, the preset must contain a NukeShotExporter and a NukeRenderTask (write node).
- localPresetsChanged()[source]
Check if the local task presets have changed since startPresetChanges() was called.
- nukeShotExportPresets(project)[source]
Get a list of presets which can export shots as Nuke scripts. Includes local presets and those in the project.
- presetFromXml(xml, register=True)[source]
Deserialize preset from xml string. Requires derived TaskPreset classes to be registered.
- presetToXml(preset)[source]
Serialise a TaskPreset to XML and return as string. Returns an empty string on failure.
- processorPresetByName(name, project=None)[source]
Returns the preset with specified name associated with project. If project is None preset will be searched for in local presets
- projectDuplicated(project, newProject)[source]
Called on project clone to duplicate the associated project presets
- projectExportHistoryXml(project)[source]
Get the project export history as a list of xml fragments. Use the xml to avoid problems with reference counting the preset objects when calling from C++.
- projectPresets(project)[source]
Returns a list of preset names associated with the specified project
- projectPresetsChanged(project)[source]
Check if the task presets for the given project have changed since startPresetChanges(project) was called.
- projectUnloaded(project)[source]
Called on project unload to remove presets associated with project
- registerPreset(parentType, preset)[source]
Register a preset instance and association with parentType
- registerProcessor(preset, processor)[source]
Register the association between a Processor and ProcessorPreset
- restoreProjectExportHistoryXml(project, presetsXml)[source]
Set the project export history as a list of xml fragments. Use the xml to avoid problems with reference counting the preset objects when calling from C++.
- revertDefaultPresets(string) Called by the C++ application reconstruct the default presets. [source]
- Param:
path as string
- startPresetChanges(hiero.core.Project) Called when the user might start editing the presets, so the changes can be reverted if necessary. [source]
- Param:
hiero.core.Project)
- submissionChanged(string, hiero.core.Project) Called by the C++ application when the submission choice changes in the Export Dialog. [source]
- Param:
submission name as a string
- class hiero.core.TimeBase
Helper object that wraps up time bases (or frame rates). Stores values internally as integer ratios, as opposed to floating point values.
Can be initialised with an int, float, or str. In addition, you can construct a TimeBase using TimeBase.fromRational(numerator, denominator), or use the predefined TimeBase values, for example TimeBase.k30NTSC.
- class RoundingMode
- kRound32Pulldown = core.Hiero.Python.TimeBase.RoundingMode.kRound32Pulldown
- kRoundNearest = core.Hiero.Python.TimeBase.RoundingMode.kRoundNearest
- name
- values = {'kRound32Pulldown': core.Hiero.Python.TimeBase.RoundingMode.kRound32Pulldown, 'kRoundNearest': core.Hiero.Python.TimeBase.RoundingMode.kRoundNearest}
- static 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.
- Parameters:
t – the time (frame) to convert from one rate to another
from – the time base to convert from
to – the time base to convert to
- Returns:
integer
- 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.
- Parameters:
t – the time (frame) to convert from one rate to another
toRate – the new time time to convert to
- Returns:
integer
- denominator() gets the denominator of the time base.
- Returns:
int
- static fromRational(numerator, denominator) creates a new TimeBase object from the given parameters.
For example: newTimeBase = TimeBase.fromRational(25, 1) newTimeBase = TimeBase.fromRational(30000, 1001)
- static fromString(str) deprecated; a TimeBase can now be constructed directly from a str, e.g. TimeBase('30'). Construct a TimeBase object using a str as input.
- For example:
newTimeBase = TimeBase.fromString(‘25’) newTimeBase = TimeBase.fromString(‘30000 / 1001’)
- Returns:
TimeBase
- isNTSC() returns True if the time base is NTSC (24*1000/1001, 30*1000/1001, or 60*1000/1001).
- Returns:
True or False
- isValid() returns True if the denominator of the time base is non-zero.
- Returns:
True or False
- k24 = 24
- k24NTSC = 23.98
- k25 = 25
- k30 = 30
- k30NTSC = 29.97
- k50 = 50
- k60 = 60
- k60NTSC = 59.94
- kRound32Pulldown = core.Hiero.Python.TimeBase.RoundingMode.kRound32Pulldown
- kRoundNearest = core.Hiero.Python.TimeBase.RoundingMode.kRoundNearest
- numerator() gets the numerator of the time base.
- Returns:
int
- supportsDropFrames() returns True if the time base supports drop frames (only true for 30 or 60 fps NTSC currently).
- Returns:
True or False
- toFloat() returns the time base value expressed as a floating point value.
- Returns:
float
- toInt() returns the time base value, rounded to the nearest integer.
- Returns:
int
- toRational() returns a tuple of the numerator and the denominator of the time base.
- Returns:
tuple of integers
- toRationalString() returns a string containing the time base expressed as a ratio, for example '30000/1001'.
- Returns:
string
- toString() returns a string containing the time base as a floating point number. Equivalent to str(object).
- Returns:
string
- class hiero.core.Timecode
Helper module to convert back and forth between (frames and time bases) and time code values.
- class DisplayType
- kDisplayDropFrameTimecode = core.Hiero.Python.Timecode.DisplayType.kDisplayDropFrameTimecode
- kDisplayFrames = core.Hiero.Python.Timecode.DisplayType.kDisplayFrames
- kDisplayTimecode = core.Hiero.Python.Timecode.DisplayType.kDisplayTimecode
- name
- values = {'kDisplayDropFrameTimecode': core.Hiero.Python.Timecode.DisplayType.kDisplayDropFrameTimecode, 'kDisplayFrames': core.Hiero.Python.Timecode.DisplayType.kDisplayFrames, 'kDisplayTimecode': core.Hiero.Python.Timecode.DisplayType.kDisplayTimecode}
- static 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.
- Parameters:
timeBase – the time base to use
dropFrames – True if you want drop frames taken into account
h – hour to use
m – minute to use
s – second to use
f – frame to use
- Returns:
frame
- static 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 hiero.core.Timecode.kDisplayTimecode
displayType = Timecode.displayTypeFromString(‘01:00:00;00’) print( displayType ) # prints out hiero.core.Timecode.kDisplayDropFrameTimecode, because of the semi-colon (;)
- Parameters:
s – string to detect time code format from
- Returns:
hiero.core.Timecode.DisplayType enumeration
- static 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)
- Parameters:
time – the frame you want to get the time code for
timeBase – the time base to use
dropFrames – True if you want drop frames taken into account
- Returns:
tuple of hour, minute, second, frame
- kDisplayDropFrameTimecode = core.Hiero.Python.Timecode.DisplayType.kDisplayDropFrameTimecode
- kDisplayFrames = core.Hiero.Python.Timecode.DisplayType.kDisplayFrames
- kDisplayTimecode = core.Hiero.Python.Timecode.DisplayType.kDisplayTimecode
- static stringToTime(s, timeBase, displayType, timecodeOffset) returns a tuple of hour, minute, second, frame values.
- Parameters:
s – the string to convert
timeBase – the time base to use
displayType – how the string was formatted; can be (Timecode.kDisplayTimeCode, Timecode.kDisplayDropFrameTimecode, or Time.kDisplayFrames)
timecodeOffset – an offset to apply before converting to a time code string
- Returns:
tuple
- static timeToString(time, timeBase, displayType, includeSign, timecodeOffset) returns a string formatted as a time code.
- Parameters:
time – the frame to use
timeBase – the time base to use
displayType – how to format the returned string (Timecode.kDisplayTimeCode, Timecode.kDisplayDropFrameTimecode, or Time.kDisplayFrames)
includeSign – if True, a ‘+’ will be put in front of positive time codes
timecodeOffset – an offset to apply before converting to a time code string
- Returns:
string
- class hiero.core.TrackBase
Base class for VideoTrack and AudioTrack objects. This class should never be used directly.
- Flags for controlling behavior when removing items, these can be combined with bitwise or:
TrackBase.eRemoveLinkedItems: removing an item will also remove any items it is linked to TrackBase.eDontRemoveLinkedItems: removing an item will not remove linked items TrackBase.eDontCollapseSubTracks: removing a sub-track item will not cause empty sub-tracks to be removed
- class RemoveItemOptions
- eDontCollapseSubTracks = core.Hiero.Python.TrackBase.RemoveItemOptions.eDontCollapseSubTracks
- eDontRemoveLinkedItems = core.Hiero.Python.TrackBase.RemoveItemOptions.eDontRemoveLinkedItems
- eRemoveLinkedItems = core.Hiero.Python.TrackBase.RemoveItemOptions.eRemoveLinkedItems
- name
- values = {'eDontCollapseSubTracks': core.Hiero.Python.TrackBase.RemoveItemOptions.eDontCollapseSubTracks, 'eDontRemoveLinkedItems': core.Hiero.Python.TrackBase.RemoveItemOptions.eDontRemoveLinkedItems, 'eRemoveLinkedItems': core.Hiero.Python.TrackBase.RemoveItemOptions.eRemoveLinkedItems}
- 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.
- Parameters:
item – the hiero.core.TrackItem to add to this track
- Returns:
hiero.core.TrackItem object
- addTag(tag) adds the specified tag to the Track.
- Parameters:
tag – Tag object to apply to the track
- Returns:
a hiero.core.Tag object
- addTransition(transition) adds a transition to the timeline for the track. Can only be called when the track has been added to a Sequence.
Note that a transition can only be added to a single track. Calling this function with a Transition object which already belongs to a Track will result in an error. Transition items can be reomoved from a track using the removeTransition function.
- Parameters:
transition – the hiero.core.Transition to add to this track
- Returns:
a hiero.core.Transition object
- 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.
- Parameters:
start – the start of the range to clear
end – the end of the range to clear
ripple – set to True to shift the remaining track items to the left
- eDontCollapseSubTracks = core.Hiero.Python.TrackBase.RemoveItemOptions.eDontCollapseSubTracks
- eDontRemoveLinkedItems = core.Hiero.Python.TrackBase.RemoveItemOptions.eDontRemoveLinkedItems
- eRemoveLinkedItems = core.Hiero.Python.TrackBase.RemoveItemOptions.eRemoveLinkedItems
- guid()
- isEnabled() returns True if the Track object is enabled.
- Returns:
True or False
- isLocked() returns True if the Track object is locked.
- Returns:
True or False
- isNull() returns True if the Track object is invalid.
- Returns:
True or False
- metadata() returns the metadata for this Track.
- Returns:
hiero.core.DataCollection object
- name() returns the name of the track. Identical to calling trackName().
- Returns:
string
- numItems() returns the number of items in this track.
- Returns:
int
- numTransitions() returns the number of transitions in this track.
- Returns:
int
- project() returns the Project object that this item is attached to or None if the object is not attached to a project.
- Returns:
hiero.core.Project object
- razorAt(time) Creates razor cuts on a track for the parameter time(s).
- Parameters:
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(trackItem, option=eRemoveLinkedItems) removes a track item from this track.
- Parameters:
trackItem – the hiero.core.TrackItem to remove from this track
option – options controlling the remove behavior. By default linked items are also removed. Note that if linked effects are not removed, this will put them in an invalid state.
- removeTag(tag) removes the tag from the track.
- Parameters:
tag – tag object
- removeTransition(transition) removes a transition from the timeline of this track.
- Parameters:
transition – the hiero.core.Transition to remove from this track’s timeline
- setEnabled() enables or disables the Track.
- setLocked() locks or unlocks the Track.
- Returns:
True or False
- setName() Sets the name of a track.
- Param:
string
- tags() returns a tuple of all of the tags applied to this object.
- Returns:
tuple of hiero.core.Tag objects
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- trackIndex()
- trackName() returns the name of the track. Identical to calling name().
- Returns:
string
- transitions() returns a tuple of all of the transitions applied to this track object.
- Returns:
tuple of hiero.core.Transition objects
- class hiero.core.TrackItem
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
- kAudio = core.Hiero.Python.TrackItem.MediaType.kAudio
- kUnknown = core.Hiero.Python.TrackItem.MediaType.kUnknown
- kVideo = core.Hiero.Python.TrackItem.MediaType.kVideo
- name
- values = {'kAudio': core.Hiero.Python.TrackItem.MediaType.kAudio, 'kUnknown': core.Hiero.Python.TrackItem.MediaType.kUnknown, 'kVideo': core.Hiero.Python.TrackItem.MediaType.kVideo}
- addTag(tag) adds a new tag to the track item.
- Parameters:
tag – tag object
- Returns:
a hiero.core.Tag object
- addToNukeScript(script=, firstFrame=None, additionalNodes=[], additionalNodesCallback=None, includeRetimes=False, retimeMethod=None, startHandle=None, endHandle=None, colourTransform=None, offset=0, nodeLabel=None, includeAnnotations=False, includeEffects=True, outputToSequenceFormat=False)
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.
- Parameters:
retimeMethod – “Motion”, “Blend”, “Frame” - Knob setting for OFlow retime method
offset – Optional, Global frame offset applied across whole script
- currentVersion() returns a version object for the current version set on this track item.
- Returns:
hiero.core.Version object
- eventNumber() Get the event number of this track item on it's Sequence.
- Returns:
integer event number
- getAvailableOcioColourTransforms()
self. getAvailableOcioColourTransforms() -> returns colour transform for the media source.
- Returns:
string
- handleInLength() returns the length of the track item's in handle.
- Returns:
frames
- handleInTime() returns the track item's in handle time.
- Returns:
frames
- handleOutLength() returns the length of the track item's out handle.
- Returns:
frames
- handleOutTime() returns the track item's out handle time.
- Returns:
frames
- inTransition() returns the in transition for this track item.
- Returns:
hiero.core.Transition object
- 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.
- Returns:
True or False
- kAudio = core.Hiero.Python.TrackItem.MediaType.kAudio
- kUnknown = core.Hiero.Python.TrackItem.MediaType.kUnknown
- kVideo = core.Hiero.Python.TrackItem.MediaType.kVideo
- link(trackItem) Links track item with another track item. Both track items must point to the same source.
- Parameters:
trackItem – track item to link to
- mapSourceToTimeline()
self.mapTimelineToSource(time) -> Map from the track item’s source time to timeline time.
- Parameters:
time – time to map
- Returns:
mapped time
- mapTimelineToSource(time) Map from timeline time to the track item's source time.
- Parameters:
time – time to map
- Returns:
mapped time
- maxVersion() sets the highest available version on this TrackItem. If versionLinkedToBin() is set, changes the version on all linked objects.
- Returns:
hiero.core.Version object
- mediaType() returns media type for the track item.
- Returns:
MediaType object
- metadata() returns the metadata for the track item.
- Returns:
hiero.core.DataCollection object
- minVersion() sets the lowest available version on this TrackItem. If versionLinkedToBin() is set, changes the version on all linked objects.
- Returns:
hiero.core.Version object
- name() returns the track item's name.
- Returns:
string
- nextVersion() sets the next available version on this TrackItem. If versionLinkedToBin() is set, changes the version on all linked objects.
- Returns:
hiero.core.Version object
- numVersions() returns the total number of versions on this track item currently (nothing to do with the maximum or minimum version number).
- Returns:
int
- outTransition() returns the out transition for this track item.
- Returns:
hiero.core.Transition object
- playbackSpeed() returns the playback speed of this track item.
- Returns:
double
- prevVersion() sets the next available version on this TrackItem. If versionLinkedToBin() is set, changes the version on all linked objects.
- Returns:
hiero.core.Version object
- reconnectMedia(path) Reconnects media for the Clip used by the TrackItem, using the specified path.
- Parameters:
path – path containing media to reconnect to
- reformatState() returns the reformat state for the track item.
- Returns:
hiero.core.ReformatState object
- removeTag(tag) removes the tag from the track item.
- Parameters:
tag – hiero.core.Tag object
- replaceClips(path) Find a new Clip from the specified path, and replace the TrackItem's existing Clip with it.
- Parameters:
path – path containing media to replace with
- setCameraColourTransform(colourTransform) sets the camera colour transform for the source media.
- Parameters:
colourTransform – Colour transform name
- 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.
- Parameters:
version – hiero.core.Version object
- 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.
- Parameters:
index – the integer index to set the current version on this track item to
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( setCurrentVersionIndex ): This method is deprecated and will not be present in future versions of the Python API. Version indices are no longer unique identifiers and should not be used as such. Please use TrackItem.setActiveVersion() instead.
- setName(name) sets the name of the track item.
- Parameters:
name – the value to set the track name to
- setPlaybackSpeed(newSpeed) sets the playback speed of this track item.
- Parameters:
newSpeed – double
- 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.
- Parameters:
clip – the hiero.core.Clip object to set as the source for this track item
trackIndex – optional track index, for instance if you are adding an audio Clip and want to use its second audio track
- Returns:
the hiero.core.Clip object passed in
- setSourceIn(time) sets the source in for the track item. This will shrink or grow the duration.
- Parameters:
time – frame value
- setSourceMediaColourTransform(colourTransform) sets the input colour transform for the source media.
- Parameters:
colourTransform – Colour transform name
- 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.
- Parameters:
time – frame value
- setTimelineIn(inTime) sets the timeline in value. Shrinks or grows the timeline duration, as appropriate.
- Parameters:
inTime – frame value
- setTimelineOut(outTime) sets the timeline out value. Shrinks or grows the timeline duration, as appropriate.
- Parameters:
outTime – frame value
- setTimes(timelineIn, timelineOut, sourceIn, sourceOut) sets the timeline and source times for the track item.
- Parameters:
timelineIn – timeline in frame
timelineOut – timeline out frame
sourceIn – source in frame
sourceOut – source out frame
- setVersionLinkedToBin(linked) link the TrackItem's version to that of it's associated BinItem. The TrackItem's version will be updated if updateVersion is set to trueon the BinItem or any linked TrackItems.
- Parameters:
linked – The linked state to be set on the TrackItem
updatedVersion – Whether or not the TrackItems version will be updated
- source() depending on the underlying type of the track item, returns a hiero.core.Clip object, a hiero.core.Sequence object or a hiero.core.MediaSource object.
- Returns:
a hiero.core.Clip object, a hiero.core.Sequence object or a hiero.core.MediaSource object
- sourceDuration() returns the source duration value for the track item.
Note that this value depends on speed, and may not be an integer value.
- Returns:
frames
- 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.
- Returns:
frame
- sourceMediaColourTransform()
self.setSourceMediaColourTransform() -> returns colour transform for the media source.
- Returns:
string
- sourceOut() returns the source out value for the track item.
Note that this value depends on speed, and may not be an integer value.
- Returns:
frame
- tags() returns a tuple of all of the tags applied to this object.
- Returns:
tuple of hiero.core.Tag objects
- thumbnail(frame, layer) returns a thumbnail of the frame specified as a QImage object.
- Parameters:
frame – the frame to get the thumbnail for (defaults to 0)
layer – the layer to get the thumbnail for (defaults to colour)
- Returns:
QImage object
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- unlink(trackItem) Unlinks this track item from given track item.
- Parameters:
trackItem – track item from which this track item is being unlinked
- unlinkAll() Unlink all track items that are linked to this one.
- 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.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionDown ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from TrackItem. To find new versions, please use hiero.core.VersionScanner. To obtain the next version, please use TrackItem.prevVersion().
- versionLinkedToBin() get if the TrackItem's version is linked to the associated BinItem
- Returns:
bool
- versionMaxAvailable() returns the highest discovered version on this track item.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionMaxAvailable ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from TrackItem. This method has been replaced by TrackItem.maxVersion().
- versionMinAvailable() returns the lowest discovered version on this track item.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionMinAvailable ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from TrackItem. This method has been replaced by TrackItem.minVersion().
- versionNextAvailable() returns the next highest available version on this track item that the application has discovered.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionNextAvailable ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from TrackItem. This method has been replaced by TrackItem.nextVersion().
- versionPrevAvailable() returns the next lowest version on this track item that the application has discovered.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionPrevAvailable ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from TrackItem. This method has been replaced by TrackItem.prevVersion().
- 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.
- Returns:
hiero.core.Version object
WARNING - DEPRECATED ( versionUp ): This method is deprecated and will not be present in future versions of the Python API. Only available versions can now be obtained from TrackItem. To find new versions, please use hiero.core.VersionScanner. To obtain the next version, please use TrackItem.nextVersion().
- class hiero.core.TrackItemBase
Base class for objects which can exist on a timeline track which provides some common methods. Not to be used directly.
- clone() returns a deep copy of this object.
WARNING - DEPRECATED ( clone ): This method is deprecated and will not be present in future versions of the Python API. This method has been replaced by copy().
- copy() returns a deep copy of this object.
- duration() returns the timeline duration value for the item.
- Returns:
frames
- guid()
- isEnabled() returns True if the track item is enabled.
- Returns:
True or False
- isNull() returns True if the track item is invalid.
- Returns:
True or False
- linkedItems() returns a tuple of track item objects linked to this one.
- Returns:
tuple of linked items
- move(time) moves the item in the sequence. This will keep the duration.
- Parameters:
time – frame value. If positive, the item moves right. If negative, the item moves left.
- static moveTrackItems(trackItems, time) moves a group of track items in the sequence.
- Parameters:
trackItems – sequence of track items to move
time – frame value. If positive, the trackitems move right. If negative, the trackitems move left.
- parent() returns the AudioTrack or VideoTrack that contains this item.
- Returns:
hiero.core.AudioTrack or hiero.core.VideoTrack object
- parentSequence()
- parentTrack()
- project() returns the Project object that this is attached to, or None if the object is not attached to a project.
- Returns:
hiero.core.Project object
- sequence() returns the Sequence object that this is attached to, or None if the object is not attached to a project.
- Returns:
hiero.core.Project object
- setEnabled(enabled) enables or disables the track item.
- Returns:
True or False
- setTimelineIn(inTime) sets the timeline in value. Shrinks or grows the timeline duration, as appropriate.
- Parameters:
inTime – frame value
- setTimelineOut(outTime) sets the timeline out value. Shrinks or grows the timeline duration, as appropriate.
- Parameters:
outTime – frame value
- timelineIn() returns the timeline in value for the track item.
- Returns:
frames
- timelineOut() returns the timeline in value for the track item.
- Returns:
frames
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- trimIn(time) trims the left end of the item. This will grow or shrink the duration and the sourceDuration, but keep the playback speed.
- Parameters:
time – frame value. If positive, the item duration shrinks. If negative, the item duration grows.
- trimOut(time) trims the right end of the item. This will grow or shrink the duration and the sourceDuration, but keep the playback speed.
- Parameters:
time – frame value. If positive, the item duration shrinks. If negative, the item duration grows.
- class hiero.core.Transition
Object representing a transition between two clips.
- class Alignments
- kDissolve = core.Hiero.Python.Transition.Alignments.kDissolve
- kFadeIn = core.Hiero.Python.Transition.Alignments.kFadeIn
- kFadeOut = core.Hiero.Python.Transition.Alignments.kFadeOut
- kUnknown = core.Hiero.Python.Transition.Alignments.kUnknown
- name
- values = {'kDissolve': core.Hiero.Python.Transition.Alignments.kDissolve, 'kFadeIn': core.Hiero.Python.Transition.Alignments.kFadeIn, 'kFadeOut': core.Hiero.Python.Transition.Alignments.kFadeOut, 'kUnknown': core.Hiero.Python.Transition.Alignments.kUnknown}
- alignment() returns the alignment mode of this transition. Either kFadeIn, kDissolve, kFadeOut or kUnknown.
- Returns:
alignment type (hiero.core.Transition.Alignments)
- static createAudioCrossfadeTransition(trackItem1, trackItem2, duration1, duration2) creates a new audio crossfade (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.
- Parameters:
trackItem1 – the earlier hiero.core.TrackItem object to dissolve from. Must be an Audio TrackItem.
trackItem2 – the later hiero.core.TrackItem object to crossfade to. Must be an Audio TrackItem.
duration1 – frames for the crossfade from
duration2 – frames for the crossfade to
- Returns:
hiero.core.Transition object
- Seealso:
createDissolveTransition for Video equivalent
- static createAudioFadeInTransition(trackItem, duration) creates a new fade in (kFadeIn) Transition with the timelineIn of the trackItem and the duration specified.
- Parameters:
trackItem – hiero.core.TrackItem object to use the timelineIn value from. Must be an Audio TrackItem.
duration – frames
- Returns:
hiero.core.Transition object
- Seealso:
createFadeInTransition for Video equivalent
- static createAudioFadeOutTransition(trackItem, duration) creates a new fade out (kFadeOut) Transition. The in point will be the timelineOut of trackItem, minus the duration specified.
- Parameters:
trackItem – hiero.core.TrackItem object to use the timelineOut value from. Must be an Audio TrackItem.
duration – frames
- Returns:
hiero.core.Transition object
- Seealso:
createFadeOutTransition for Video equivalent
- static 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.
- Parameters:
trackItem1 – the earlier hiero.core.TrackItem object to dissolve from. Must be a Video TrackItem.
trackItem2 – the later hiero.core.TrackItem object to dissolve to. Must be a Video TrackItem.
duration1 – frames for the dissolve from
duration2 – frames for the dissolve to
- Returns:
hiero.core.Transition object
- Seealso:
createAudioCrossTransition for Audio equivalent
- static createFadeInTransition(trackItem, duration) creates a new fade in (kFadeIn) Transition with the timelineIn of the trackItem and the duration specified.
- Parameters:
trackItem – hiero.core.TrackItem object to use the timelineIn value from. Must be a Video TrackItem.
duration – frames
- Returns:
hiero.core.Transition object
- Seealso:
createAudioFadeInTransition for Audio equivalent
- static createFadeOutTransition(trackItem, duration) creates a new fade out (kFadeOut) Transition. The in point will be the timelineOut of trackItem, minus the duration specified.
- Parameters:
trackItem – hiero.core.TrackItem object to use the timelineOut value from. Must be a Video TrackItem.
duration – frames
- Returns:
hiero.core.Transition object
- Seealso:
createAudioFadeOutTransition for Audio equivalent
- dissolveNode() Returns the Dissolve node which controls the transition curve.
- Returns:
nuke.Node
- guid()
- inTrackItem() Get the in track item for this transition.
return: hiero.core.TrackItem
- kDissolve = core.Hiero.Python.Transition.Alignments.kDissolve
- kFadeIn = core.Hiero.Python.Transition.Alignments.kFadeIn
- kFadeOut = core.Hiero.Python.Transition.Alignments.kFadeOut
- kUnknown = core.Hiero.Python.Transition.Alignments.kUnknown
- outTrackItem() Get the out track item for this transition.
return: hiero.core.TrackItem
- parent() returns the AudioTrack or VideoTrack that contains this transition.
- Returns:
hiero.core.AudioTrack or hiero.core.VideoTrack object
- project() returns the Project object that this is attached to, or None if the object is not attached to a project.
- Returns:
hiero.core.Project object
- setAlignment(alignment) sets the alignment mode on this transition.
- Parameters:
alignment – alignment type (hiero.core.Transition.Alignments), either kFadeIn, kDissolve, or kFadeOut
- setTimelineIn(inTime) sets the in point for this transition. Note that this trims the duration of the transition.
- Parameters:
inTime – frame for the new in point
- setTimelineOut(outTime) sets the out point for this transition. Note that this trims the duration of the transition.
- Parameters:
outTime – frame for the new out point
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- class hiero.core.UndoGroup
Helper class for beginning and ending undo on a project. Recommended usage is to create with hiero.core.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() -> starts a new undo action on the project with the initialised name. See hiero.core.Project.beginUndo()
- endUndo() ends the undo action on the project
- isNull()
- class hiero.core.Version
Object representing a version of a clip or sequence. Can be created with a Clip or Sequence object.
- guid()
- isHidden()
- isNull() returns True if the object is invalid, False otherwise.
- Returns:
True or False
- item() returns the clip or sequence stored with this version.
- Returns:
hiero.core.Clip or hiero.core.Sequence object
- name() returns the name of this version.
- Returns:
string
- parent() returns the bin item that contains this version.
- Returns:
hiero.core.BinItem object
- serialize()
- setHidden()
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- versionIndex() returns a string containing the version's index.
- Returns:
string
WARNING - DEPRECATED ( versionIndex ): This method is deprecated and will not be present in future versions of the Python API. Version indices are no longer unique identifiers and should not be used as such.
- class hiero.core.VideoTrack
Object for manipulating video tracks.
- addSubTrackItem(subTrackItem, subTrackIndex) Add a subtrack item to the track on the given sub-track index.
This method will cut or delete sub-track items that overlap with the one being added.
- Parameters:
subTrackItem – a hiero.core.SubTrackItem object to add.
subTrackIndex – the index of the sub-track to add to.
- Returns:
the added item
- addTag(tag) adds a tag to the video track item.
- Parameters:
tag – the hiero.core.Tag to add to the video track.
- addToNukeScript(script=, additionalNodes=[], additionalNodesCallback=None, includeRetimes=False, retimeMethod=None, offset=0, skipOffline=True, mediaToSkip=[], disconnected=False, includeAnnotations=False, includeEffects=True)
Add a Read node for each track item to the script with Merge or Dissolve nodes to join them in a sequence. TimeClip nodes are added to pad any gaps between clips.
- Parameters:
script – Nuke script object to add nodes to.
additionalNodes – List of nodes to be added post read, passed on to track items
additionalNodesCallback – callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence])
includeRetimes – True/False include retimes
retimeMethod – “Motion”, “Blend”, “Frame” - Knob setting for OFlow retime method
offset – Optional, Global frame offset applied across whole script
skipOffline – If True, offline clips are not included in the export
mediaToSkip – List of MediaSources which should be excluded from the export
disconnected – If True, items on the track are not connected and no constant nodes are added to fill gaps
includeAnnotations – If True, clip-level annotations will be included in the output
includeEffects – If True, clip-level soft effects will be included in the output
- 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.
- Parameters:
clip – a hiero.core.Clip object or a hiero.core.TrackItem object, to add to this video track.
position – int; insert position. Do not specify if clip is a TrackItem.
- Returns:
hiero.core.TrackItem object
- blendMode() returns a string representing the blend-mode as it appears in the Nuke Merge Node, if the VideoTrack object has blending enabled.
- Returns:
String containing the blend-mode
- clone() returns a deep copy of this object.
- Returns:
hiero.core.VideoTrack object
WARNING - DEPRECATED ( clone ): This method is deprecated and will not be present in future versions of the Python API. This method has been replaced by copy().
- copy() returns a deep copy of this object.
- Returns:
hiero.core.VideoTrack object
- createEffect(trackItem=None, timelineIn=None, timelineOut=None, subTrackIndex=None) Create an effect item and add it to the track.
The effect’s node will be of type effectType or if cloneFrom is given, will be a clone of that. It will use timing either based on trackItem if given or timelineIn and timelineOut. If none of these are specified, the effect will cover the full duration of the track’s parent sequence.
- Parameters:
effectType – the node type to create a soft effect for
cloneFrom – if given, the new effect item will be cloned from this
copyFrom – if given, the new effect item will be copied from this
trackItem – if specified, the effect will be linked to the track item and use the same timing
timelineIn – the effect start time
timelineOut – the effect end time
subTrackIndex – if specified, will be placed on the appropriate sub-track, otherwise will be placed on a new sub-track
- Returns:
the created EffectTrackItem object
- createTrackItem(name) creates a new track item.
- Parameters:
name – the name of the new track item
- Returns:
hiero.core.TrackItem object
- isBlendEnabled()
self.isEnabled() -> returns True if the VideoTrack object has blending enabled.
- Returns:
True or False
- isBlendMaskEnabled() returns True if the VideoTrack object has blend-masking enabled.
- Returns:
True or False
- items() returns a tuple with all of the track items contained by this track.
- Returns:
tuple of hiero.core.TrackItem objects
- parent() returns the sequence that contains this track.
- Returns:
hiero.core.Sequence object
- removeSubTrackItem(subTrackItem, option=eRemoveLinkedItems) removes a sub-track item from this track.
- Parameters:
subTrackItem – the hiero.core.SubTrackItem to remove from this track
option – options controlling the remove behavior. By default linked items are also removed.
- removeTag(tag) removes the tag from the video track.
- Parameters:
tag – hiero.core.Tag object
- setAllViews() assigns all views to a VideoTrack in the form of an empty string since that represents all views.
An error is raised if the track doesn’t have a project with multiple views.
- setBlendEnabled()
self.setEnabled() -> enables or disables blending on the VideoTrack, if it is not locked or restricted. An error is raised if the track is locked or restricted.
- setBlendMaskEnabled() sets whether blend-masking is enabled or not, if it is not locked or restricted.
An error is raised if the track is locked or restricted.
- setBlendMode() sets the blend mode to be used, if it is not locked or restricted. Expected strings are NUKE Merge Node operations.
An error is raised if the track is locked or restricted.
- setView() assigns a view on a VideoTrack.
An error is raised if the track doesn’t have a project with multiple views, or the specified view is invalid.
- splitViewsToTracks() split the views to separate tracks on the Timeline.
An error is raised if the track doesn’t have a project with multiple views.
- subTrackItems() returns a tuple with an entry for each sub track in this track, each entry being a tuple of items
on the corresponding sub track.
- Returns:
tuple of hiero.core.SubTrackItem sub-class objects
- toString() returns a description of the object. Equivalent to str(object).
- Returns:
string
- trackIndex()
- view() returns a string representing the view assigned to the VideoTrack. An empty string is returned if the track has multiple views assigned.
- Returns:
String containing the view name
- hiero.core.ViewerProcessNameFromDisplayTransformName()
- hiero.core.addPathRemap(windowsPathPrefix, osxPathPrefix, linuxPathPrefix) 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.
- Parameters:
windowsPathPrefix – string
osxPathPrefix – string
linuxPathPrefix – string
- Returns:
None
- hiero.core.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 .nuke folder will be the first in this list.
- hiero.core.addPluginPath(pluginPath, index) the same as above, except that the index specifies which item in the list of paths to place the new one before.
- Parameters:
pluginPath – the new path to add
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.
- Parameters:
dontSave – True or False
- hiero.core.conformer() returns an interface for setting the conforming options.
- Returns:
a hiero.core.Conformer object
- hiero.core.defaultFrameRates() returns the list of frame rates displayed in Hiero's user interface. [source]
- Returns:
tuple of floats
- hiero.core.executeInMainThread(call, *args, **kwargs)[source]
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)[source]
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, returnDirectories, returnHiddenFiles) Returns a list of strings representing the items found in the specified directory, putting image sequences together as one element. [source]
- Parameters:
directory – path to the directory to query
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
returnDirectories – optional, defaults to True. If set to True, sub directories will be included in the returned list
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.findItemByGuid(guid, *args, **kwargs)[source]
Find an item matching a guid. This searches all open projects. The other arguments are the same as those to findItemsInProject.
- hiero.core.findItems(proj=None, filter=None, partialName=None, verbose=0)
findItemsInProject -> Returns all items in a Project’s clipsBin. User can filter by a specific type(s) or by partial name, and optionally print a verbose log to the output window. Takes up to 4 keyword arguments : Project object, a string, a type or an array of strings for filter type, partial name of item, and a bool to enable/disable verbose mode Returns an array of items. Note: to find Tags in a Project, use the findProjectTags method.
- Parameters:
proj – hiero.core.Project object, to find the items on. If None, then the last project in the currently loaded projects will be used.
filter – optional. Used to filter the returned list. Can be None, a case insensitive single string or type, or a list of case insensitive strings and types.
partialName – optional string. If specified, objects will only be returned if their name contains this string.
verbose – optional value. If not None/False/0, findItems will print out information as it searches.
- Returns:
list of objects.
Example uses:
allItems = findItemsInProject(myProj) allSeqsAndTracksWith30SecInName = findItemsInProject(myProj, [‘sequences’, ‘Tracks’], ‘30Sec’, 1) allTracks = findItemsInProject(myProj, “Track”) videoTracks = findItemsInProject(myProj, “VideoTrack”) sequences = findItemsInProject(myProj, “Sequence”) # Can also use plural: ‘Sequences’ sequences = findItemsInProject(myProj, hiero.core.Sequence) sequencesAndClips = findItemsInProject(myProj, [hiero.core.Sequence, hiero.core.Clip]) binsOnly = findItemsInProject(myProj, hiero.core.Bin)
hiero.core.findItems is deprecated. Please use hiero.core.findItemsInProject instead.
- hiero.core.findItemsByGuid(guids, *args, **kwargs)[source]
Find all items matching a list of guids. This searches all open projects. The other arguments are the same as those to findItemsInProject.
- hiero.core.findItemsInBin(rootBin, filter=None, partialName=None, verbose=0) Returns all items recursively in a Bin, found in rootBin. [source]
- Parameters:
rootBin – hiero.core.Bin object, to find the items on.
filter – optional. Used to filter the returned list. Can be None, a case insensitive single string or type, or a list of case insensitive strings and types.
partialName – optional string. If specified, objects will only be returned if their name contains this string.
verbose – optional value. If not None/False/0, findItems will print out information as it searches.
- Returns:
list of objects.
Example uses: myBin = hiero.core.projects()[0].clipsBin()[0] # A hiero.core.Bin object allItemsInMyBin = findItemsInBin(myBin) allClipsAndSequencesInMyBin = findItemsInBin(myBin, filter = [hiero.core.Sequence, hiero.core.Clip]) allClipsWithPartialName = findItems(myProj, ‘clips’, ‘C00’) allSubBinsOnly = findItems(myProj, hiero.core.Bin)
- hiero.core.findItemsInProject(proj=None, filter=None, partialName=None, verbose=0)[source]
findItemsInProject -> Returns all items in a Project’s clipsBin. User can filter by a specific type(s) or by partial name, and optionally print a verbose log to the output window. Takes up to 4 keyword arguments : Project object, a string, a type or an array of strings for filter type, partial name of item, and a bool to enable/disable verbose mode Returns an array of items. Note: to find Tags in a Project, use the findProjectTags method.
- Parameters:
proj – hiero.core.Project object, to find the items on. If None, then the last project in the currently loaded projects will be used.
filter – optional. Used to filter the returned list. Can be None, a case insensitive single string or type, or a list of case insensitive strings and types.
partialName – optional string. If specified, objects will only be returned if their name contains this string.
verbose – optional value. If not None/False/0, findItems will print out information as it searches.
- Returns:
list of objects.
Example uses:
allItems = findItemsInProject(myProj) allSeqsAndTracksWith30SecInName = findItemsInProject(myProj, [‘sequences’, ‘Tracks’], ‘30Sec’, 1) allTracks = findItemsInProject(myProj, “Track”) videoTracks = findItemsInProject(myProj, “VideoTrack”) sequences = findItemsInProject(myProj, “Sequence”) # Can also use plural: ‘Sequences’ sequences = findItemsInProject(myProj, hiero.core.Sequence) sequencesAndClips = findItemsInProject(myProj, [hiero.core.Sequence, hiero.core.Clip]) binsOnly = findItemsInProject(myProj, hiero.core.Bin)
hiero.core.findItems is deprecated. Please use hiero.core.findItemsInProject instead.
- hiero.core.findProjectTags(proj=None, tagName=None, iconName=None, verbose=0)[source]
findProjectTags -> Returns all Tags in a project. User can filter by tag name, icon name, and optionally print a verbose log to the output window. Takes up to 4 arguments : Project object, partial name of Tag, partial icon name, and a bool to enable/disable verbose mode Returns a list of Tag objects.
- Parameters:
proj – hiero.core.Project object, to find the items on. If None, then the last project in the currently loaded projects will be used.
tagName – optional string. If specified, Tags will only be returned if their name contains this string.
iconName – optional string. If specified, Tags will only be returned if their icon path contains this string.
verbose – optional value. If not None/False/0, findProjectTags will print out information as it searches.
- Returns:
list of Tag objects.
Example uses:
allTags = findItems(myProj) allTagsWithNameLens = findItems(myProj, tagName = ‘Lens’) allTagsWithIconPath = findItems(myProj, iconName = ‘lens.png’)
- hiero.core.formats() returns a tuple with all of the formats currently available.
- Returns:
tuple of hiero.core.Format objects
- hiero.core.getBundledNukePath() return the bundled Nuke executable [source]
- Returns:
A string containing the bundled Nuke executable path.
- hiero.core.getBundledPythonPath() return the bundled Python executable [source]
- Returns:
A string containing the bundled Python executable path.
- hiero.core.getFilenameList()
Deprecated. Do not use. Use hiero.core.filenameList() instead
- hiero.core.getLibraryDirectory(subdirectory) deprecated; use hiero.core.libraryDirectory() instead.
- hiero.core.getPluginPath() deprecated; please use hiero.core.pluginPath instead.
- hiero.core.getRoleColorspace()
- hiero.core.isHieroPlayer()
- hiero.core.isIndie()
- hiero.core.isNC()
- hiero.core.isQuickTimeFileExtension(fileExtension)[source]
Returns True if the fileExtension is a recognised QuickTime extension, False otherwise.
- hiero.core.isVideoFileExtension(fileExtension)[source]
Returns True if the fileExtension is a recognised video format extension, i.e not an image Sequence (QuickTime/MXF/R3D media)
- hiero.core.libraryDirectory(subdirectory) returns the input appended to the location of the user's .nuke directory.
- Parameters:
subdirectory – path to append to the .nuke directory
- Returns:
string
- hiero.core.newProject(name=None) creates and returns a new Project object. A name can optionally be given for the project.
- Returns:
hiero.core.Project object
- 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.pathRemappings() returns the path remappings specified in the application preferences, or added through addPathRemap().
- Returns:
a list of path remappings each containing the mapping for (windows, osx, linux)
- hiero.core.pluginPath() Returns a tuple of the search paths used by Hiero to load Python scripts.
- Returns:
tuple of strings
- hiero.core.presetProjects()[source]
hiero.core.projects() -> returns a tuple of all of the currently loaded preset projects.
- Deprecated:
Use hiero.core.projects(Project.kStartupProjects) instead
- Returns:
tuple of hiero.core.Project objects
- hiero.core.project(name) returns the Project with the specified name, if it can be found, or None.
- Returns:
hiero.core.Project object
- hiero.core.projects() returns a tuple of currently loaded projects which are user projects (not startup). Same effect as calling the method below passing Project.kUserProjects.
- hiero.core.projects(projectTypes) returns a tuple of currently loaded projects, filtered according to projectTypes. Use hiero.core.projects()[-1] to get the last loaded project.
- Parameters:
projectTypes – optional; one of Project.kAllProjects, Project.kUserProjects, Project.kStartupProjects
- Returns:
tuple of hiero.core.Project objects
- hiero.core.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. hiero.core.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.
- Parameters:
exitCode – optional; integer value to set the process’s exit code to
- hiero.core.redo()
- hiero.core.redoSize()
- hiero.core.remapPath(path) uses the platform specific path remapping rules from the user's preferences and applies them to the input path.
- Parameters:
path – string path to apply the path remapping rules to
- Returns:
string
- hiero.core.setLocalisationForAllVersionsInProject(proj, policy)[source]
Sets localisation policy for all Versions of All Clips in a project
- Parameters:
proj – hiero.core.Project
- Param:
policy - the localisation policy from hiero.core.Clip. Options: kOnLocalize, kAutoLocalize, kOnDemandLocalize, kOffLocalize
- hiero.core.setLocalisationPolicyOnBin(bin, policy, recursive=True)[source]
Sets localisation policy for all Clips found in a Bin and recursively found in all Sub-Bins
- Param:
clipList - a list of hiero.core.Clip objects
- Param:
policy - the localisation policy from hiero.core.Clip. Options: kOnLocalize, kAutoLocalize, kOnDemandLocalize, kOffLocalize
- Param:
recursive (optional, default = True) - localises all Clips found recursively in a Bin Structure
- hiero.core.setLocalisationPolicyOnSequence(sequence, policy)[source]
Sets localisation policy for all Clips used by TrackItems in a Sequence with a given policy.
- Param:
sequence - a hiero.core.Sequence object
- Param:
policy - the localisation policy from hiero.core.Clip. Options: kOnLocalize, kAutoLocalize, kOnDemandLocalize, kOffLocalize
- hiero.core.setLocalisationPolicyOnTrack(track, policy)[source]
Sets localisation policy for all Clips used by TrackItems in a Track with a given policy.
- Param:
track - a hiero.core.Track object
- Param:
policy - the localisation policy from hiero.core.Clip. Options: kOnLocalize, kAutoLocalize, kOnDemandLocalize, kOffLocalize
- hiero.core.setLocalisationPolicyOnTrackItem(trackItem, policy)[source]
Sets localisation policy for the source Clip of a TrackItem
- Param:
track - a hiero.core.TrackItem object
- Param:
policy - the localisation policy from hiero.core.Clip. Options: kOnLocalize, kAutoLocalize, kOnDemandLocalize, kOffLocalize
- hiero.core.stopScriptAndQuit()
- hiero.core.undo()
- hiero.core.undoSize()