Bases: Shiboken.Object
Helper object to set and get application settings.
self.boolValue(key, defaultValue) -> returns the previously stored value as True or False, named by the key parameter, or the defaultValue parameter
self.boolValue(key) -> returns the previously stored value as True or False, named by the key parameter, or the default value as configured (if configured) by the Hiero code. Use this method if you’re looking up a value used by Hiero internally.
Note: use self.value(key, defaultValue) if you just want to retrieve a string setting
@param key: string name of the value to retrieve
@param defaultValue: the value to return if this setting hasn’t been saved before. Does not save the value to the default.
@return: string
self.setBoolValue(key, value) -> saves the value as True or False with the application’s settings using the key
@param key: string name of the value to retrieve
@param value: the bool (True or False) value to save.
self.setValue(key, value) -> saves the value with the application’s settings using the key
@param key: string name of the value to save
@param value: the value to store
self.value(key, defaultValue=None) -> returns the previously stored string value named by the key parameter, or the defaultValue parameter
@param key: string name of the value to retrieve @param defaultValue: the value to return if this setting hasn’t been saved before. Does not save the value to the default @return: string, unless the defaultValue is set, in which case, the return value will be the same type as the defaultValue (string, int or bool)
Bases: core.Hiero.Python.TrackBase
Object for manipulating audio tracks.
self.addTag(tag) -> adds a tag to the audio track item.
@param tag: the Tag to add to the audio track
@return: Tag object
self.addTrackItem(clip, audioChannel, position) -> if the first parameter is a Clip object, the second and third parameters must be specified and this method creates a new track item with the specified audio channel and adds it to this audio track at the given position.
If the first parameter is a TrackItem, then this method just adds the track item specified.
This method will cut or delete track items that overlap with the one being added.
This method can only be called if the track has already been added to a Sequence.
@param clip: a Clip object or a TrackItem object, to add to this audio track.@param audioChannel: int; audio channel that will be associated with the track item. Do not specify if clip is a TrackItem.@param position: int; insert position. Do not specify if clip is a TrackItem.@return: TrackItem object
self.clone() -> returns a deep copy of this object.
@return: AudioTrack object
self.createTrackItem(name) -> creates a new track item.
@param name: the name of the new track item
@return: TrackItem object
self.items() -> returns a tuple with all of the track items contained by this track.
@return: tuple of TrackItem objects
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
Bases: Shiboken.Object
Container object for BinItem objects (wrapping Clip and Sequence objects) and other Bin objects.
self.addItem(object) -> adds the item to the bin object.
@param object: Bin, BinItem, or Tag object, to be added as a sub item of the bin object@return: Added object
self.bins() -> returns a tuple with all of the sub bins contained by this object.
@return: tuple of Bin objects
self.clips() -> returns a tuple with all of the BinItem’s containing clips contained by this bin.
@return: tuple of BinItem objects
self.importFolder(path) -> imports the media in the path into this bin (needs a project).
@param path: path to the media to import
@return Bin: returns the bin created for imported media
self.importSequence(filename, timeBase=None, frameRate=None, dropFrame=False) -> imports the sequence stored in filename into this bin (needs a project). If the timebase/frame rate for the sequence isnot specified, the project defaults will be used.
@param filename: path to the file to import the sequence from
@param timeBase: optional argument of type TimeBase specifying the timebase for the created sequence
@param frameRate: optional float argument specifying the frame rate for the created sequence
@return: Sequence the created sequence
self.isNull() -> returns True if the object is invalid.
@return: True or False
self.items(typeFilter) -> returns a tuple with all of the objects contained by this bin, filtered by the typeFilter argument, if supplied.
@param typeFilter: combination of Bin.ItemType flags
@return: tuple of BinItem objects
self.name() -> returns the name of the bin.
@return: True or False
self.numChildren() -> returns the number of child objects contained by this bin.
@return: int
self.project() -> returns the Project object that this is attached to, or None if the object is not attached to a project.
@return: Project object
self.reconnectMedia(path) -> connects (or reconnects) all of the media for the Clip, using the specified path.
@param path: path to the folder with the media to connect
self.removeItem(object) -> removes the item from the bin object. If the object is not a child item of the bin object, throws an exception.
@param object: Bin, BinItem, or Tag object to be removed as a sub item of the bin object
self.sequences() -> returns a tuple with all of the BinItem’s containing sequences contained by this bin.
@return: tuple of BinItem objects
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
Bases: Shiboken.Object
Generic object wrapper with shared functionality for sequences and clips.
self.activeItem() -> returns the item contained by this bin item.
self.activeVersion() -> gets the currently active Version object of the bin item.
@return: Version object
self.addSnapshot(comment) -> adds a new snapshot for the object, with a comment.
self.addSnapshot(sequence, comment) -> adds a new snapshot for the object, using the sequence as the new snapshot, setting the comment.
@param comment: a comment string to set on the snapshot
@param sequence: a Sequence object to create the Snapshot from
@return: Snapshot object
self.addVersion(version) -> adds the version parameter to the bin item.
@param version: Version object for the new version
@return: Version object
self.hasVersion(index) -> checks if a given version exists and is valid.
@param index: index of the version to check for
@return: True or False
self.isNull() -> returns True if the object contains a invalid Sequence or Clip object.
@return: True or False
self.items() -> returns a tuple containing all of the different versions of this object.
@return: tuple of Version objects
self.name() -> returns the name of the item.
@return: string
self.numSnapshots() -> returns the number of snapshots that this bin item has.
@return: int
self.numVersions() -> returns the number of versions for this bin item.
@return: int
self.parentBin() -> returns the bin object that contains this bin item.
@return: Bin object
self.project() -> returns the Project object that this object is attached to, or None if the object is not attached to a project.
@return: heiro.core.Project object
self.restoreToSnapshot(index) -> adds a new snapshot for the object, with a comment.
@param index: index of the Snapshot to restore from. Generates an exception if the index is out of range
self.setActiveVersion(version) -> sets the active version to the version parameter.
@return: Version object
self.setActiveVersionIndex(version) -> sets the currently active version by index.
@param index: index of the version to make active
@return: Version object
self.snapshots() -> returns a tuple of all of the snapshots contained by this object.
@return: tuple of Snapshot objects
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
self.version(index) -> gets a Version object for the version of the bin item specified by the index.
@param index: index of the version to get
@return: Version object
self.versionDown() -> decrements the current/active version and returns the newly active Version object of the bin item.
@return: Version object
self.versionMaxAvailable() -> finds the highest version that is currently loaded and does not have missing or offline media and sets it as the active version on this bin item.
@param version: Version object
@return: Version object
self.versionMinAvailable() -> finds the lowest version that is currently loaded and does not have missing or offline media and sets it as the active version on this bin item.
@param version: Version object
@return: Version object
self.versionNextAvailable() -> finds the next (higher) version that is currently loaded and does not have missing or offline media and sets it as the active version on this bin item.
@param version: Version object
@return: Version object
Bases: core.Hiero.Python.SequenceBase
Object representing a clip.
Initialisation:
Clip(mediaSource)
Clip(mediaSource, first, last)
mediaSource may be a MediaSource object or a string containing the media path. If first and last are given, the Clip only plays frames within this range.
self.addTag() -> adds the tag to the set of tags attached to the Clip.@param tag: the tag object to add
@return: Tag object
self.addTagToRange(tag, inTime, outTime) -> adds the tag to the specified range of the Clip.@param tag: the tag object to add
@param inTime: from - time to add tag
@param outTime: to - time to add tag
@return: Tag object
addToNukeScript(self, script, trimmed=True, trimStart=None, trimEnd=None)
Add a Read node to the Nuke script for each media sequence/file used in this clip. If there is no media, nothing is added.
@param script: Nuke script object to add nodes
@param additionalNodes: List of nodes to be added post read
@param additionalNodesCallback: callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence])
@param firstFrame: Custom offset to move start frame of clip
@param trimmed: If True, a FrameRange node will be added to trim the range output by the Read node. The range defaults to the clip’s soft trim range. If soft trims are not enabled on the clip, the range defaults to the clip range. The range can be overridden by passing trimStart and/or trimEnd values.
@param trimStart: Override the trim range start with this value.
@param trimEnd: Override the trim range end with this value.
@param enabled: enabled status of the read node. True by default
self.isNull() -> returns False if this is a valid Clip object, True otherwise.
@return: True or False
self.mediaSource() -> returns the clip’s media source.
@return: MediaSource object
self.isNull() -> returns a copy of the clip’s metadata.
@return: hiero.core.Metadata object
self.numAudioTracks() -> returns number of audio tracks contained by this clip.
@return: int
self.numVideoTracks() -> returns number of video tracks contained by this clip.
@return: int
self.reconnectMedia(path) -> connects (or reconnects) all of the media for the Clip, using the specified path.
@param path: path to the folder with the media to connect
self.refresh() -> updates the clip if the source media has changed.
self.setSourceMediaColourTransform(colourTransform) -> sets the input colour transform for the source media.
@param colourTransform: Colour transform name
self.sourceIn() -> returns the source in value for the clip.
@return: frame
self.sourceMediaColourTransform() -> returns colour transform for the source media.
@return: string
self.sourceOut() -> returns the source out value for the clip.
@return: frame
Bases: Shiboken.Object
Represents a conform rule used by Hiero to make decisions when conforming. Can be derived from in order to make new conform rules.
self.activate() -> adds this conform rule to the list of conform rules. Conform operations done after this call will use the rule.
self.appliesToTrackItems() -> should return True if this conform rule applies to track items.
@return: True or False; default implementation returns True
self.compare(media, candidateMedia) -> should compare media against candidateMedia, and return True if they match, according to this conform rule.
The metadata contains the following keys which can be used for creating matching rules: Conformer.kUmid == ‘umid’ Conformer.kName == ‘name’ Conformer.kTapeName == ‘tapeName’ Conformer.kUrl == ‘url’ Conformer.kAudioChannels == ‘audioChannels’ Conformer.kDuration == ‘duration’ Conformer.kFramerate == ‘framerate’ Conformer.kFramerateIsNtsc == ‘framerateIsNtsc’ Conformer.kSamplerate == ‘samplerate’ Conformer.kMediaType == ‘mediaType’ Conformer.kMasterMediaType == ‘masterMediaType’ Conformer.kStartTime == ‘startTime’ Conformer.kTimecode == ‘timecode’ Conformer.kWidth == ‘width’ Conformer.kHeight == 'height'@return: True for a match, False otherwise; default implementation returns False
self.conformType() -> Get the conform types for which this rule can be used. The default is kConform.
@return: one of the constants kConform, kReconnect, kConformAndReconnect
self.deactivate() -> removes this conform rule from the list of conform rules. Conform operations done after this call will not use the rule.
self.name() -> should return True if the conform rule is invalid.
@return: True for invalid, False otherwise
self.name() -> returns the name of the conform rule (which was passed to the object in it’s initializer).
@return: string
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
Bases: Shiboken.Object
Provides and interface for querying and setting the conform options, such as file pattern filters and active rules.
These options mirror those found in the conforming dialog box in the UI.
self.excludePatterns() -> returns the list of file patterns that are excluded from source media searches.
By default this is empty.
@return: A list containing the file patterns excluded from source media searches.
self.includeAlreadyMatched() -> returns the state of re-conform media flag.
@return: True when the tracks that already have media attached will be re-conformed.
self.includePatterns() -> returns the list of file patterns that are included in source media searches.
By default this is ‘*’, which includes all file types.
@return: A list containing the file patterns included in source media searches.
self.nativeRuleFiltering() -> returns a dictionary with the names of the native conforming rules and whether they are enabled for conforming.
By changing the state of the flags for the rules and submitting the dictionary back to the Conformer the rules can be filterd out.
@return: A dictionary containing the enabled flag for each native rule, keyed by the rule name.
self.nativeRuleNames() -> returns the list of names for the native rules.
This can be used to set rule filtering.
@return: A list containing the names for all of the conform rules built-in to Hiero.
self.pythonRuleFiltering() -> returns a dictionary with the names of the Python conforming rules and whether they are enabled for conforming.
By changing the state of the flags for the rules and submitting the dictionary back to the Conformer the rules can be filterd out.
@return: A dictionary containing the enabled flag for each Python rule, keyed by the rule name.
self.pythonRuleNames() -> returns the list of names for the registered Python rules.
This can be used to set rule filtering.
@return: A list containing the names for all of the conform rules that have been added through the Python API.
self.setExcludePatterns( filepatterns ) -> sets the list of file patterns to exclude from source media searches.
self.setIncludeAlreadyMatched( flag ) -> controls whether to re-connect tracks that already have media matched to them.
self.setIncludePatterns( filepatterns ) -> sets the list of file patterns to include in source media searches.
self.setNativeRuleFiltering( ruleFiltering ) -> uses a dictionary keyed on the names of the native conforming rules to set whether each rule is enabled for conforming.
self.setPythonRuleFiltering( ruleFiltering ) -> uses a dictionary keyed on the names of the Python conforming rules to set whether each rule is enabled for conforming.
Bases: Shiboken.Object
Storage objects for key/value pairs. Generally used to store metadata.
self.dict() -> returns a dictionary of key/value pairs. Can be used to iterate over the items in this collection.
@return: dict
self.hasKey(key) -> returns True if the collection has a value for the key.
@param key: the key to look up
@return: True or False
self.readOnly(key) -> returns True if the collection can be modified.
@return: True or False
self.setValue(key) -> sets the value of the key stored in this collection.
@param key: the key to look up
@param value: value to assign to key
self.toString() -> returns a formatted list of the key/value pairs currently set on this object. Equivalent to str(object).
@return: string
self.value(key) -> returns the value of the key stored in this collection. Throws an exception if the key does not exist.
@param key: the key to look up
@return: string
Bases: Shiboken.Object
Base class to be derived from in order to populate an ExportStructureViewer widget, such as the one used in the Export dialog box. ExportStructureBase objects provides access to a root node, which has to be an object derived from ExportStructureElementBase, which the ExportStructureViewer widget then uses to determine the tree structure to display to the user. For an example of how to derive from this class, see Plugins/site-packages/hiero/core/FnExportStructure.py. For an example use of a derived ExportStructureBase object, see Plugins/site-packages/hiero/exporters/FnShotProcessor.py. It will often be more than sufficient to just use an ExportStructure2 object, instead of subclassing ExportStructureBase directly.
self.childElement(path) -> should return an object derived from ExportStructureElementBase, representing a child with the path specified.
@param path: the path to the new (or existing) child element
@return: ExportStructureElementBase derived object
self.exportRootPath() -> retrieves the root path for the export structure.
@return: string
self.rootElement() -> should return a ExportStructureElementBase super class object, representing the root of the export file structure.
@return: ExportStructureElementBase derived object
self.setExportRootPath(path) -> called when the user has modified the export root path, to inform the object of the new path.
@param path: the new user supplied path to export to.
Bases: Shiboken.Object
Base class to be derived from and used in conjunction with a custom implementation of ExportStructureBase. For an example of how to derive from this class, see Plugins/site-packages/hiero/core/FnExportStructure.py.
self.addChild(newChild) -> should append the new child item to this node’s children, and set the parent on the child to this node.
@param newChild: ExportStructureElementBase object
self.child(index) -> should return the child of this node, based on the index.
@param index: int index of the child to return
@return: ExportStructureElementBase object
self.childCount() -> should return the number of child nodes on this item.
@return: int
self.childIndex(exportElementChild) -> if the parameter is a child of this node, then this method should return the index of that child amongst the node’s other children.
@param exportElementChild: ExportStructureElementBase object
@return: int
self.clearChildren() -> clears all of the children nodes from this node.
self.content() -> should return the stored content of this element.
@return: string
self.createChild(name, isLeaf) -> should create and add a child element with the given name, setting the parent to this node. Should only do so if a child of that name didn’t already exist. Should also handle creating sub children if the name includes slashes, similar to the setName method. Should return the newly created child or the existing child if it didn’t create one.
@param name: the name for the new node
@param isLeaf: True or False value for whether or not this is a leaf node
@return: ExportStructureElementBase object
self.fromXml(xmlText) -> should reinitialize the node from the xml text, and recreate the preset and all child nodes as well. If initialized using taskRegistry._savePresetElement, taskRegistry._loadPresetElement can be used to get data back out.
@param xmlText: xml formatted text, as a result of a call in the past to the toXml method
self.isLeaf() -> should return True if this is a node with no children, otherwise it should return False.
@return: True or False
self.name() -> should return the name of this element.
@return: string
self.parent() -> should return the parent node of this object.
@return: ExportStructureElementBase object
self.path() -> should return the full path to this node, including the path of any parents of this node.
@return: string
self.preset() -> should return an object derived from TaskPreset, representing the task associated with this element of the export structure.
@return: TaskPreset derived object
self.removeChild(child) -> should remove the child from the node’s list of children
@param child: ExportStructureElementBase child object to remove
self.setName(name) -> called to tell the node it’s name. Should create children if the name includes any slashes (/) in it.
@param name: string
self.setParent(newParent) -> should set the parent of this element.
@param newParent: ExportStructureElementBase object
self.setPreset(preset) -> tells the object that the user has selected a new preset for this particular export element.
@param preset: a TaskPreset derived object, which can be used to create a task to process later on during an export.
self.setPresetType(presetType) -> called to tell the object to set the task preset type by name. The taskRegistry can be used with this ‘type’ to create the preset to store.
@param presetType: the name of the task preset to create/use.
self.toXml() -> should return a string of formatted xml which can be sent to the fromXml method later to read it back. The xml should include the preset data for this node, as well as the children, and should be in proper xml format. This can be done easily with xml.etree.cElementTree, especially because the taskRegistry has methods to write out xml for presets and other objects (taskRegistry._savePresetElement)
@return: string
Bases: Shiboken.Object
Stores format related data, such as the width, height, aspect ration, etc.
self.addToNukeScript(self, script, to_type) -> adds a Reformat node matching this Format to the specified script and returns the nuke node object. @param script: Nuke script object to add nodes to, or None to just generate and return the node. @param resize: Type of resize (use constants from nuke.ReformatNode, default is kResizeWidth). @return: hiero.core.nuke.ReformatNode object
self.aspect() -> returns the aspect ratio of this format.
@return: float
self.cleanAperture() -> returns a 4 element tuple with the rectangle (x1, y1, x2, y2) of the clean aperture.
@return: tuple
self.height() -> returns the height of this format.
@return: int
self.isValid() -> returns whether or not this format object has valid data.
@return: True or False
self.name() -> returns the name of this format.
@return: string
self.pixelAspect() -> returns the pixel aspect ratio of this format.
@return: float
self.productionAperture() -> returns a 4 element tuple with the rectangle (x1, y1, x2, y2) of the production aperture.
@return: tuple
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
self.width() -> returns the width of this format
@return: int
Bases: Shiboken.Object
self.bin() -> converts this ItemWrapper to a Bin object. If the item wrapper isn’t wrapping a Bin object, it will return a non-functioning (isNull returns True) TrackItem object (meaning that it has all of the methods of a Bin object, but the methods don’t do anything)
@return: Bin object
self.binItem() -> converts this ItemWrapper to a BinItem object. If the item wrapper isn’t wrapping a BinItem object, it will return a non-functioning (isNull returns True) TrackItem object (meaning that it has all of the methods of a BinItem object, but the methods don’t do anything)
@return: BinItem object
self.clip() -> converts this ItemWrapper to a Clip object. If the item wrapper isn’t wrapping a Clip object, it will return a non-functioning (isNull returns True) Clip object (meaning that it has all of the methods of a Clip object, but the methods don’t do anything)
@return: Clip object
self.isNull() -> returns True if this is a invalid or uninitialized item, or False otherwise
@return: True or False
self.item() -> Return the item contained within this wrapper.
self.name() -> Returns item name.
@return: string
self.root() -> the root is the highest level in the bin selected for export, Root may be null.
@return: Bin object
self.sequence() -> converts this ItemWrapper to a Sequence object. If the item wrapper isn’t wrapping a Sequence object, it will return a non-functioning (isNull returns True) Sequence object (meaning that it has all of the methods of a Sequence object, but the methods don’t do anything)
@return: Sequence object
self.trackItem() -> converts this ItemWrapper to a TrackItem object. If the item wrapper isn’t wrapping a TrackItem object, it will return a non-functioning (isNull returns True) TrackItem object (meaning that it has all of the methods of a TrackItem object, but the methods don’t do anything)
@return: TrackItem object
LUTs() -> returns a tuple with the names of all of the available luts.
@return: tuple of strings
Bases: Shiboken.Object
Object representing a single set of media files on disk.
self.endFrame() -> returns the last frame of the media source contained by this object. Note that for video formats (mov, r3d), this will always be the media’s (duration - 1).
@return: integer frame
self.filename() -> returns a path to a media source on disk. May represent multiple files, as with image sequences. The form will be one of the following, depending on the file extension of the media:
In the case of the image sequence above, the numbers between the brackets represent the first and last frame of the sequence.
@return: string
self.startFrame() -> returns the first frame of the media source contained by this object. Note that for video formats (mov, r3d), this will always be 0.
@return: integer frame
Bases: Shiboken.Object
Represents a media source.
MediaSource.createOfflineVideoMediaSource() -> returns a media source that might be an offline video file. Use this to explicitly set what you expect the start, duration and framerate of the video source to be, once it becomes available.
Raises a RuntimeError if the source path exists but could not be read by Hiero.
@param path: path to where the media will eventually be
@param start: start of the media, in frames
@param duration: duration of the media, in frames
@param frameRate: TimeBase representing the frame rate of the media source
@return: True or False
self.duration() -> returns the duration, in frames.
@return: frames
self.fileinfos() -> returns a tuple of MediaFileInfo objects, which can be used to retrieve all of the file fragments that are used by this MediaSource.
@return: tuple of MediaFileInfo objects
self.filename() -> returns the file name (and just the file name) of the first file used for the MediaSource.
Deprecated; Please use the fileinfos() method instead.
@return: string
self.firstpath() -> returns the full path of the first file used for the MediaSource.
Deprecated; Please use the fileinfos() method instead.
@return: string
self.fragmentFilename(fragmentIndex) -> returns the file name (and just the file name) for the fragment of the MediaSource, specified by the fragmentIndex.
Deprecated; Please use the fileinfos() method instead
@param fragmentIndex: index of the fragment to retrieve
@return: string
self.fragmentPath(fragmentIndex) -> returns the full path for the fragment of the MediaSource, specified by the fragmentIndex.
Deprecated; Please use the fileinfos() method instead.
@param fragmentIndex: index of the fragment to retrieve
@return: string
self.hasAudio() -> True if the source has audio.
@return: True or False
self.hasVideo() -> True if the source has video.
@return: True or False
self.height() -> returns the height of the media.
@return: int
self.isMediaPresent() -> returns True if the media is present.
@return: True or False
self.isNull() -> True if the object points to an invalid source, False otherwise.
@return: True or False
self.isOffline() -> returns True if the media is missing or unavailable for any reason.
@return: True or False
self.metadata() -> returns a hiero.core.Metadata object with metadata for the MediaSource.
@return: hiero.core.Metadata object
self.numFragments() -> returns the number of files used by this MediaSource, or -1 for invalid media. For instance, for mov files, this will return 1; for exr sequences this method will return the number of exr files in the sequence.
Deprecated; Please use the fileinfos() method instead.
@return: int
self.pixelAspect() -> returns the pixel aspect ratio of the media.
@return: float
self.refresh() -> updates source info for latest changes in underlying files
self.singleFile() -> returns True if this MediaSource is comprised of only a single file regardless of how many frames it contains (like a .mov or .r3d).
@return: True or False
self.startTime() -> returns the start time of the media.
@return: int
self.toString(includeMetadata=False) -> returns a string with info for the MediaSource. str(object) is equivalent to object.toString().
@param includeMetadata: True adds metadata to the string, False does not
@return: string
self.width() -> returns the width of the media.
@return: int
Bases: Shiboken.Object
Utility object for extracting names for clips, versions and objects out of clip objects
self.clipName(clip) -> extracts name from clip that will be used for displaying the clip object, based on the underlying file(s).
Redefine this method if desired for customised naming schema. Use default_clipName for default functionality if needed.
@param clip: a clip to extract the name from
@return: string
self.default_clipName(clip) -> extracts name from clip that will be used for displaying the clip object, based on the underlying file(s).
Do not redefine this method. It preserves accessibility to default functionality when redefining clipName.
@param clip: a clip to extract the name from
@return: string
self.default_rootName(clip) -> extracts name from clip that will be used for displaying the bin item object, based on the underlying file(s).
Do not redefine this method. It preserves accessibility to default functionality when redefining rootName.
@param clip: a clip to extract the name from
@return: string
self.default_versionName(clip) -> extracts name from clip that will be used for displaying the version object, based on the underlying file(s).
Do not redefine this method. It preserves accessibility to default functionality when redefining versionName.
@param clip: a clip to extract the name from
@return: string
self.rootName(clip) -> extracts name from clip that will be used for displaying the bin item object, based on the underlying file(s).
Redefine this method if desired for customised naming schema. Use default_rootName for default functionality if needed.
@param clip: a clip to extract the name from
@return: string
self.versionName(clip) -> extracts name from clip that will be used for displaying the version object, based on the underlying file(s).
Redefine this method if desired for customised naming schema. Use default_versionName for default functionality if needed.
@param clip: a clip to extract the name from
@return: string
Bases: Shiboken.Object
Object for manipulating projects. Can be created using newProject() or by the following code:
hiero.core.openProject(projectPath)
project = hiero.core.projects()[-1]
self.audioTrackItems(partialName) -> returns all audio track items in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.
@return: an array of hiero.core.TrackItem objects.
Example: finds all audio track items in a project with 30Sec in the name:
trackItems = myProject.audioTrackItems(‘30Sec’)
self.audioTracks(partialName) -> returns all audio tracks in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.
@return: an array of hiero.core.AudioTrack objects.
Example: finds all audio tracks in a project with 30Sec in the name:
tracks = myProject.audioTracks(‘30Sec’)
self.beginUndo(name) -> starts a new undo action, which will group all other undo actions until self.endUndo() is called. Be aware that this method only works on the main thread, and will throw an exception otherwise.
Note that for operations inside the undo to work Project.endUndo() must be called. It is recommended that you use this in a with block to ensure that this happens. For example:
with project.beginUndo(‘My Undo’):
// Undoable edits
@return: UndoGroup object
self.bins(partialName) -> returns all bins in a project. Searches recursively, so will return bins within other bins in the list. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.
@return: an array of hiero.core.Bin objects.
Example: finds all bins in a project with MyBin in the name:
bins = myProject.bins(‘MyBin’)
buildTrackName() -> get default track name used when building vfx trackthis can be configured in the project settings dialog
self.clips(partialName) -> returns all clips in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.
@return: an array of hiero.core.Clip objects.
Example: finds all clips in a project with 30Sec in the name:
clips = myProject.clips(‘30Sec’)
self.clipsBin() -> returns the bin object containing the top level clips, sequences and bins for this project.
@return: Bin object
self.close() -> closes the project. Be aware that this method will not save the project, even if changes have been made since the last save of the project.
self.deletable() -> returns True if the project can be deleted.
@return: True or False
self.editable() -> returns True if the project can be edited.
@return: True or False
self.endUndo() -> ends an undo action started previously by a call to self.beginUndo(). This will put a new item into the Edit > Undo/Redo menu items.
self.extractSettings() -> returns a dict of the project’s settings. @return: dict
self.isNull() -> returns False if this is a valid Project object, True otherwise.
@return: True or False
self.isRestricted() -> returns whether or not access to the project is restricted.
@return: True or False
self.lutSetting16Bit() -> returns the project’s 16 bit lut setting name.
@return: string
self.lutSetting8Bit() -> returns the project’s 8 bit lut setting name.
@return: string
self.lutSettingFloat() -> returns the project’s float lut setting name.
@return: string
self.lutSettingLog() -> returns the project’s log lut setting name.
@return: string
self.lutSettingsViewer() -> returns the project’s viewer lut setting name.
@return: string
self.name() -> returns the name of the project.
@return: string
self.path() -> returns the path to the project.
@return: string
self.projectRoot() -> Get root path of the project used by default when sending to nuke or using {projectroot} token in export.
@return: string
self.projectShotPreset() -> get Project Shot Preset which is usedwhen sending to nuke or using {projectroot} token in export.
@return: TaskPreset object
self.redo() -> triggers a redo of the next item in the redo stack. Only works on the main thread. If called from any other thread, throws an exception.
self.redoItemText() -> returns the text of the next item on the redo stack. Only works on the main thread. Can be useful for testing that undo/redo works.
@return: string
self.save() -> saves a previously saved project to disk.
self.saveAs(filename) -> saves the project to the path specified by the filename parameter. Throws an exception if the project couldn’t be saved for any reason.
@param filename: path to save the project to
self.sequences(partialName) -> returns all sequences in a project. User can filter by by partial name. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name. @return: an array of hiero.core.Sequence objects.
Example: finds all sequences in a project with 30Sec in the name:
sequences = myProject.sequences(‘30Sec’)
self.setDeletable(deletable) -> sets whether or not a project can be deleted.
@param deletable: True or False
self.setEditable(editable) -> sets whether or not a project can be edited.
@param editable: True or False
self.setProjectRoot() -> Set root path of the project used by default when sending to nuke or using {projectroot} token in export.
@param: path to set as project root
self.tagsBin() -> returns the bin object containing the top level tags for this project.
@return: Bin object
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
self.trackItems(partialName) -> returns all track items in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.
@return: an array of hiero.core.TrackItem objects.
Example: finds all track items in a project with 30Sec in the name:
trackItems = myProject.trackItems(‘30Sec’)
self.tracks(partialName) -> returns all tracks in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.
@return: an array of hiero.core.VideoTrack and hiero.core.AudioTrack objects.
Example: finds all tracks in a project with 30Sec in the name:
tracks = myProject.tracks(‘30Sec’)
self.undo() -> triggers an undo on the last item previously added to the undo stack. Only works on the main thread. If called from any other thread, throws an exception.
self.undoItemText() -> returns the text of the last item on the undo stack. Only works on the main thread. Can be useful for testing that undo/redo works.
@return: string
self.videoTrackItems(partialName) -> returns all video track items in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.
@return: an array of hiero.core.TrackItem objects.
Example: finds all video track items in a project with 30Sec in the name:
trackItems = myProject.videoTrackItems(‘30Sec’)
self.videoTracks(partialName) -> returns all video tracks in a project. @param partialName: optional string with partial name to match against. Will match if this string is anywhere in the name.
@return: an array of hiero.core.VideoTrack objects.
Example: finds all video tracks in a project with 30Sec in the name:
tracks = myProject.videoTracks(‘30Sec’)
Bases: Shiboken.Object
Object representing a the reformatting settings for a track item. This corresponds to the Nuke ‘Reformat’ node.
self.boxForceShape() -> returns the box ‘force shape’ flag.
@return: bool
self.boxPAR() -> returns the box pixel aspect ratio.
@return: double
self.boxSize() -> returns the box size.
@return: QSize
self.resizeCenter() -> returns the resize center flag.
@return: bool
self.resizeFlip() -> returns the resize flip flag.
@return: bool
self.resizeFlop() -> returns the resize flop flag.
@return: bool
self.resizeTurn() -> returns the resize turn flag.
@return: bool
self.resizeType() -> returns the resize type.
@return: string
self.scale() -> returns the scaling factor.
@return: double
self.setBoxForceShape() -> sets the box ‘force shape’ flag if the reformat type is set to ‘to box’.
@param setBoxForceShape: bool
self.setBoxPAR() -> sets the box pixel aspect ratio if the reformat type is set to ‘to box’.
@param PAR: double
self.setBoxSize() -> sets the box size if the reformat type is set to ‘to box’.
@param size: QSize
self.setResizeCenter() -> sets the resize center flag on the track item.
@param center: bool
self.setResizeFlip() -> sets the resize flip flag on the track item.
@param flip: bool
self.setResizeFlop() -> sets the resize flop flag on the track item.
@param flop: bool
self.setResizeTurn() -> sets the resize turn flag on the track item.
@param turn: bool
self.setResizeType() -> sets the resize type of the state.
@param newResizeType: string
self.setScale() -> sets the scaling factor if the reformat type is set to ‘scale’.
@param value: double
self.setType() -> sets the reformat type of the state.
@param newType: string
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
self.type() -> returns the reformat type of the state.
@return: string
Bases: core.Hiero.Python.SequenceBase
Object for Sequences.
Add a clip to a sequence, creating a TrackItem for each video/audio channel in the clip, adding them to the appropriate tracks and linking them together. This has the same effect as dragging a clip from the Bin View to the Timeline View in the Hiero UI.
@param clip: the clip to add @param time: the in time for created track items @param videoTrackIndex: index of the video track to add items to if the clip has video @param audioTrackIndex: index of the audio track to start adding items to if the clip has audio @return: list of created hiero.core.TrackItems
self.addTag(tag) -> add a tag to the Sequence.
@param tag: the tag to add (hiero.core.Tag object)
@return: Tag object
self.addTagToRange(tag, inTime, outTime) -> adds the tag to the specified range of the Sequence.
@param tag: the tag object to add
@param inTime: the first time at which the tag is valid
@param outTime: the last time at which the tag is valid
@return: Tag object
addToNukeScript(self, script) @param script: Nuke script object to add nodes to. @param includeRetimes: @param additionalNodesCallback: callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence]) @return: None
Add nodes representing this Sequence to the specified script. If there are no clips in the Sequence, nothing is added.
self.addTrack(track) -> adds a video or audio track to the Sequence.
@param track: video or audio track to add
self.audioTrack(index) -> returns the audio track for the specified index.
@param index: index of the audio track to return
@return: AudioTrack
self.audioTracks() -> returns a tuple with all of the audio tracks.
@return: tuple of AudioTrack objects
self.changeFramerateKeepFrames(toTimebase) -> changes the timebase of the sequence, keeping frames of track items the same
@param toTimebase: timebase to change to
self.changeFramerateKeepTimecodes(toTimebase, roundingMode) -> changes the timebase of the sequence, keeping timecodes of track items the same, according to the specified rounding mode
@param toTimebase: timebase to change to
@param roundingMode: rounding mode to use when converting timebases (hiero.core.TimeBase.kRoundNearest, TimeBase.kRound32Pulldown)
self.importTracks(filePath) -> imports all of the tracks from the file specified by the filePath argument.
@param filePath: path to the file to import tracks from
@return tracks: tuple of created tracks
self.importTracksFromTimeBaseKeepFrames(filePath, srcTimebase) -> imports all of the tracks from the file specified by the filePath argument using the specified timebase.
@param filePath: path to the file to import tracks from
@param srcTimebase: timebase to use when reading the source file
@return tracks: tuple of created tracks
self.importTracksFromTimeBaseKeepTimecodes(filePath, srcTimebase, roundingMode) -> imports all of the tracks from the file specified by the filePath argument using the specified timebase.
@param filePath: path to the file to import tracks from
@param srcTimebase: timebase to use when reading the source file
@param roundingMode: rounding mode to use when converting timebases (hiero.core.TimeBase.kRoundNearest, TimeBase.kRound32Pulldown)
@return tracks: tuple of created tracks
self.items() -> returns a tuple with all of the video tracks concatenated with all of the audio tracks. Can iterate over the video tracks first by using self.numVideoTracks. The audio tracks follow the video tracks in the tuple returned from this method.
@return: tuple of VideoTrack and AudioTrack objects
self.matchMedia(path) -> match media using the current rule configuration in conformer().
@param path: path to the folder with the media to connect
self.numAudioTracks() -> returns number of audio tracks contained by this sequence.
@return: int
self.numVideoTracks() -> returns number of video tracks contained by this sequence.
@return: int
self.reconnectMedia(path) -> connects (or reconnects) all of the media for the Sequence, using the specified path.
@param path: path to the folder with the media to connect
self.removeTrack(track) -> removes the track from the Sequence.
@param track: track to remove (hiero.core.AudioTrack or VideoTrack object)
self.trackItemAt(time) -> returns the top-most video track item for the specified time that is enabled and has media.
@param time: frame to get the trackitem for
@return: TrackItem
self.trackItemsAt(time, mediaType) -> finds enabled track items for the specified time, ordered from top-track to bottom-track (or for audio, min channel to max channel).
@param time: frame to get the trackitems for
@param mediaType: TrackItem.MediaType value specifying the media type of the track items to look for (defaults to kVideo)
@return: tuple of TrackItem objects
self.videoTrack(index) -> returns the video track for the specified index.
@param index: index of the video track to return
@return: VideoTrack
self.videoTracks() -> returns a tuple with all of the video tracks.
@return: tuple of VideoTrack objects
Bases: Shiboken.Object
Base class for Sequence and Clip objects. Has some methods common to both of those objects. Most likely never used directly.
self.addTag(tag) -> adds a Tag object to the Clip or Sequence.
@param tag: the tag object to add
@return: Tag object
self.addTagToRange(tag, inTime, outTime) -> adds a Tag object to the specified range of the Clip or Sequence.
@param tag: the tag object to add
@param inTime: the first time at which the tag is valid
@param outTime: the last time at which the tag is valid
@return: Tag object
self.binItem() -> returns the parent BinItem this Sequence or Clip belongs to, if any.
@return: BinItem
self.clearRange(start, end, ripple) -> Clears a time range out of the sequence; effectively a razor on any clips straddling the start and end, and a delete of everything else.
@param start: the start of the range to clear
@param end: the end of the range to clear
@param ripple: set to True to shift the remaining track items to the left
self.disableSoftTrims() -> disables soft trims on the object.
self.dropFrame() -> get whether sequence timecode is displayed in drop frame format
self.duration() -> returns the duration of the Clip or Sequence.
@return: int time value
self.editFinished() -> this should be called after finishing editing the sequence to ensure that its internal state is updated properly and to send a signal to all objects listening to changes in this object (e.g. UI views).
self.enableSoftTrims(inTime, outTime) -> enables soft trims on the object.
@param inTime: Time - soft trim in time
@param outTime: Time - soft trim out time
self.format() -> returns the output Format object for this Sequence or Clip.
@return: Format object
self.framerate() -> returns the framerate of the Sequence or Clip.
@return: TimeBase object
self.inTime() -> returns the ‘in’ point set on the clip.
@return: frame
self.isNull() -> returns False if this is a valid Sequence or Clip object, True otherwise.
@return: True or False
self.metadata() -> returns a collection of metadata for the object.
@return: DataCollection object
self.name() -> returns the name of the object.
@return: string
self.outTime() -> returns the ‘out’ point set on the clip.
@return: frame
self.posterFrame() -> get the frame in the sequence used for thumbnails
self.project() -> returns the Project object that this is attached to, or None if the object is not attached to a project.
@return: Project object
self.rawView() -> returns a string representing the raw view of this sequence or clip.
@return: string
self.razorAt(time) -> Creates razor cuts on all of the unlocked tracks for the parameter time(s).
@param time: if a single (integer) value, indicates the razor cut time; if a tuple or list of integer values, then the times to create multiple cuts at
self.setDropFrame(drop) -> set whether sequence timecode is displayed in drop frame format
self.setFormat(format) -> set the format of the Sequence or Clip.
@param format: format value to set
self.setFramerate(framerate) -> set the framerate of the Sequence or Clip.
@param framerate: framerate value to set
self.setInTime(t) -> set the ‘in’ point for the clip to Time t.
@return: None
self.setName() -> set the name of the object.
@param: string new name
self.setOutTime(t) -> set the ‘out’ point for the clip to Time t.
@return: None
self.setPosterFrame(frame) -> set the frame in the sequence used for thumbnails
self.setSoftTrimsInTime(inTime) -> sets the in time for the soft trims. Note: this method does not enable soft trims if they are disabled.
@param inTime: in frame value for the soft trims
self.setSoftTrimsOutTime(outTime) -> sets the out time for the soft trims. Note: this method does not enable soft trims if they are disabled.
@param outTime: out frame value for the soft trims
self.setTimecodeStart(time) -> sets the value of the start timecode by frame. To convert times to frame values, use TimeCode.HMSFToFrames or TimeCode.stringToTime.
self.setTimecodeStart(timecodeValue, hasDropFrames) -> sets the value of the start timecode by formatted string, using the framerate of the Sequence or Clip as the time base. If just passing in a framerate, pass it in as an integer.
@param time: frame value to set the time code to
@param timecodeValue: string of the format “hh:mm:ss:ff”
@param hasDropFrames: True if the timecode includes drop frames, False otherwise
self.softTrimsEnabled() -> returns True if soft trims are enabled, False otherwise.
@return: True or False
self.softTrimsInTime() -> returns the in time set for the soft trims.
@return: frame
self.softTrimsOutTime() -> returns the out time set for the soft trims.
@return: frame
self.tags() -> returns a tuple of all of the tags applied to this object.
@return: tuple of Tag objects
self.thumbnail(frame) -> returns a thumbnail of the frame specified as a QImage object.
@param frame: the frame to get the thumbnail for (defaults to 0)
@param layer: the layer to get the thumbnail for (defaults to colour)
@return: QImage object
self.timecodeStart() -> returns the frame value of the start timecode. To convert this to a time code string, use TimeCode.timeToString.
@return: frame
self.timelineOffset() -> returns the timeline offset value.
@return: frame
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
self.writeAudioToFile() -> Bounce down audio tracks and write to wav file at specified location. File will be created or overwritten.
@param filepath: the filepath of file to be written
@param inTime: in point of the timeline to write
@param outTime: out point of the timeline to write
Bases: Shiboken.Object
Object representing a snapshot of a sequence or clip. Can be created with a Clip or a Sequence object.
self.comment() -> returns the comment set on this snapshot object.
@return: string
self.isNull() -> returns True if the object is invalid, False otherwise.
@return: True or False
self.item() -> returns the clip or sequence stored with this snapshot.
self.name() -> returns the name of this snapshot.
@return: string
self.setComment(comment) -> sets the comment on this snapshot object.
@param comment: string to set the comment to
@return: string
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
Bases: Shiboken.Object
Object representing a tag in Hiero. Can be created with a string name and an optional path to an icon.
self.guid() -> Return the Tag guid.
@return: object guid as string
self.icon() -> returns the tags icon path.
@return: string
self.inTime() -> returns the in time of the tag.
@return: frame
self.isNull() -> returns True if the tag is invalid, False otherwise.
@return: True or False
self.metadata() -> returns the clip’s metadata.
@return: DataCollection object
self.name() -> returns the label of the tag.
@return: string
self.note() -> returns the note on the tag.
@return: string
self.outTime() -> returns the out time of the tag.
@return: frame
self.project() -> returns the Project object that this is attached to, or None if the object is not attached to a project.
@return: Project object
self.setIcon() -> sets the icon on the tag.
@param note: path to icon file
self.setNote() -> sets the note on the tag.
@param note: string note to assign to tag
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
Bases: Shiboken.Object
Object to carry out an export or transcode task. This class should not be used directly; use hiero.core.TaskBase instead.
self.addToQueue() -> adds this task into the task queue.
self.children() -> get a list of child tasks. Note that this list should not change after addToQueue() has been called.
self.clearError() -> clears the error or warning string for this task.
self.destinationDescription() -> Get the destination description.
self.error() -> Get the error string if one has been set.
self.finishTask() -> called by Hiero to tell the Task to that it’s finished. Subclasses should finish processing in their override of this method (close files, clean up).
self.forcedAbort() -> called by Hiero when the user presses the Abort button. Subclasses should do any clean up in their override of this method.
self.formatDescription() -> Get a description of the format that this task writes to.
self.ident() -> called by Hiero to get a unique identifier for this task.
self.progress() -> called by Hiero to find out from the task what it’s progress is, between 0.0 and 1.0.
self.setDestinationDescription(desc) ->
@param desc: string
self.setDuplicate() -> Sets the flag cancelling this task and marking as duplicate.
self.setError(desc) -> sets the error string displayed to the user in the task dialog. Error strings display in red.
@param desc: the text to display
self.setFormatDescription(desc) -> tells Hiero a description of the format that this task writes to.
@param desc: description of the format that this task outputs
self.setSynchronous() -> Flags this task as synchronous. When added to the queue, this task will be executed imediately on the current thread. The Flag must be set prior to adding to queue
self.setTaskDescription(description) -> tells Hiero a descriptive string for the task that it can use to show the user through the user interface and/or store it for reference. Helpful when debugging.
@param desc: description of the task
self.setWarning(desc) -> sets the warning string displayed to the user in the task dialog. Warning strings display in orange.
@param desc: the text to display
self.startTask() -> called by Hiero to tell the Task to start. Subclasses should start processing in their override of this method.
self.taskDescription() -> Get a description of the task.
self.taskStep() -> called by Hiero repeatedly until the progress method returns 1.0 or greater. Step based processing should occur in this method by subclasses of Task.
Bases: Shiboken.Object
Contains all of the settings used for a particular task. This class should not be used directly; use hiero.core.TaskPresetBase instead.
self.supportsAudio() -> returns whether or not this task preset supports audio.
@return: True or False
Bases: Shiboken.Object
Base class for the single Task Registry instance in Hiero. Private, and subject to change. Do not use this class directly.
Bases: Shiboken.Object
Helper object that wraps up time bases (or frame rates). Stores values internally as integer ratios, as opposed to as floating point values.
self.convert(t, from, to) -> returns the time specified by the first parameter converted from from parameter’s time base into the to parameter’s time base.
If either of the time bases is invalid, this method returns the t parameter unchanged.
@param t: the time (frame) to convert from one rate to another
@param from: the time base to convert from
@param to: the time base to convert to
@return: integer
self.convertTime(t, toRate) -> returns the time specified by the first parameter converted from this object’s time base into the second parameter’s time base.
If either of the time bases is invalid, this method returns the t parameter unchanged.
@param t: the time (frame) to convert from one rate to another
@param toRate: the new time time to convert to
@return: integer
self.denominator() -> gets the denominator of the time base.
@return: int
self.fromString(str) -> creates a new time base object from the parameter.
Example:
newTimeBase = TimeBase.fromString(“24.0”)
newTimeBase = TimeBase.fromString(“30000/1001”)
@param numerator: the numerator to set the time base to
@param denominator: the denominator to set the time base to
@param fps: the floating point frames per second value to set the time base to
@return: TimeBase object
self.init(numerator, denominator) -> sets the time base to the parameters.
self.init(fps) -> sets the time base to the parameter.
Example:
t.init(30 * 1000, 1001)
t.init(24.0)
@param numerator: the numerator to set the time base to
@param denominator: the denominator to set the time base to
@param fps: the floating point frames per second value to set the time base to
self.isNTSC() -> returns True if the time base is NTSC (24*1000/1001, 30*1000/1001, or 60*1000/1001).
@return: True or False
self.isValid() -> returns True if the denominator of the time base is non-zero.
@return: True or False
self.numerator() -> gets the numerator of the time base.
@return: int
self.set(numerator, denominator) -> sets the time base to the parameters.
Example:
t.set(30 * 1000, 1001)
@param numerator: the numerator to set the time base to
@param denominator: the denominator to set the time base to
self.setDenominator(value) -> sets the denominator of the time base to the parameter.
Example:
t.setNumerator(30 * 1000)
t.setDenominator(1001)
@param value: the value to set the denominator to
self.setNumerator(value) -> sets the numerator of the time base to the parameter.
Example:
t.setNumerator(30 * 1000)
t.setDenominator(1001)
@param value: the value to set the numerator to
self.supportsDropFrames() -> returns True if the time base supports drop frames (only true for 30 fps NTSC currently).
@return: True or False
self.toBool() -> returns True if the time base value is non-zero, False otherwise.
@return: True or False
self.toFloat() -> returns the time base value expressed as a floating point value.
@return: float
self.toInt() -> returns the time base value, rounded to the nearest integer.
@return: int
self.toRational() -> returns a tuple of the numerator and the denominator of the time base.
@return: tuple of integers
self.toRationalString() -> returns a string containing the time base expressed as a ratio.
@return: string
self.toString() -> returns a string containing the time base as a floating point number. Equivalent to str(object).
@return: string
Bases: Shiboken.Object
Helper module to convert back and forth between (frames and time bases) and time code values.
self.HMSFToFrames(timeBase, dropFrame, h, m, s, f) -> takes a timebase, whether or not it’s got drop frames, an hour, minute, second and frame, and returns a time value.
@param timeBase: the time base to use
@param dropFrames: True if you want drop frames taken into account
@param h: hour to use
@param m: minute to use
@param s: second to use
@param f: frame to use
@return: frame
self.displayTypeFromString(s) -> guesses the display type from a timecode string. This can be inferred from separators (though not guaranteed) or if no separators than just display as frames.
Example:
displayType = Timecode.displayTypeFromString(‘01:00:00:00’)
print displayType # prints out Timecode.kDisplayTimecode
displayType = Timecode.displayTypeFromString(‘01:00:00;00’)
print displayType # prints out Timecode.kDisplayDropFrameTimecode, because of the semi-colon (;)
@param s: string to detect time code format from
@return: Timecode.DisplayType enumeration
self.framesToHMSF(time, timeBase, dropFrames) -> takes a time, timebase and whether or not it’s got drop frames, and returns a tuple of the hour, minute, second and frame.
Example:
hour, minute, second, frame = Timecode.framesToHMSF(0, timeBase, True)
@param time: the frame you want to get the time code for
@param timeBase: the time base to use
@param dropFrames: True if you want drop frames taken into account
@return: tuple of hour, minute, second, frame
self.stringToTime(s, timeBase, displayType, timecodeOffset) -> returns a tuple of hour, minute, second, frame values.
@param s: the string to convert
@param timeBase: the time base to use
@param displayType: how the string was formatted; can be (Timecode.kDisplayTimeCode, Timecode.kDisplayDropFrameTimecode, or Time.kDisplayFrames)
@param timecodeOffset: an offset to apply before converting to a time code string
@return: tuple
self.timeToString(time, timeBase, displayType, includeSign, timecodeOffset) -> returns a string formatted as a time code.
@param time: the frame to use
@param timeBase: the time base to use
@param displayType: how to format the returned string (Timecode.kDisplayTimeCode, Timecode.kDisplayDropFrameTimecode, or Time.kDisplayFrames)
@param includeSign: if True, a ‘+’ will be put in front of positive time codes
@param timecodeOffset: an offset to apply before converting to a time code string
@return: string
Bases: Shiboken.Object
Base class for VideoTrack and AudioTrack objects. This class should never be used directly.
self.addItem(item) -> deprecated; use addTrackItem instead. Adds a track item to this track. Throws an exception if the item overlaps any existing items on the track.
@param item: the TrackItem to add to this track
@return: TrackItem object
self.addTag(tag) -> adds the specified tag to the Track.
@param tag: Tag object to apply to the track
@return: a Tag object
self.addTransition(transition) -> adds a transition to the timeline for the track. Can only be called when the track has been added to a Sequence.
@param transition: the Transition to add to this track
@return: a Transition object
self.clearRange(start, end, ripple) -> Clears a time range out of the track; effectively a razor on any clips straddling the start and end, and a delete of everything else.
@param start: the start of the range to clear
@param end: the end of the range to clear
@param ripple: set to True to shift the remaining track items to the left
self.isEnabled() -> returns True if the Track object is enabled.
@return: True or False
self.isLocked() -> returns True if the Track object is locked.
@return: True or False
self.isNull() -> returns True if the Track object is invalid.
@return: True or False
self.metadata() -> returns the metadata for this Track.
@return: DataCollection object
self.name() -> returns the name of the track. Identical to calling trackName().
@return: string
self.numItems() -> returns the number of items in this track.
@return: int
self.numTransitions() -> returns the number of transitions in this track.
@return: int
self.project() -> returns the Project object that this item is attached to or None if the object is not attached to a project.
@return: Project object
self.razorAt(time) -> Creates razor cuts on a track for the parameter time(s).
@param time: if a single (integer) value, indicates the razor cut time; if a tuple or list of integer values, then the times to create multiple cuts at
self.removeItem(trackItem) -> removes a track item from this track.
@param trackItem: the TrackItem to remove from this track
self.removeTag(tag) -> removes the tag from the track.
@param tag: tag object
self.removeTransition(transition) -> removes a transition from the timeline of this track.
@param transition: the Transition to remove from this track’s timeline
self.setEnabled() -> enables or disables the Track.
self.setLocked() -> locks or unlocks the Track.
@return: True or False
self.setName() -> Sets the name of a track.
@param: string
self.tags() -> returns a tuple of all of the tags applied to this object.
@return: tuple of Tag objects
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
self.trackName() -> returns the name of the track. Identical to calling name().
@return: string
self.transitions() -> returns a tuple of all of the transitions applied to this track object.
@return: tuple of Transition objects
Bases: Shiboken.Object
Represents a specific item on a Track. Can also be created using the createTrackItem method on VideoTrack and AudioTrack objects. Can be converted to a MediaSource object if isSource() returns True, or a Sequence object if isSequence() returns True.
Note that the version functions don’t cause a scan of any directories for other versions of media and will only skip to versions that have already been discovered. For an example of how to do that, see Plugins/site-packages/hiero/ui/ScanForVersions.py.
For an example of how to implement custom versioning scheme, see Plugins/site-packages/hiero/core/versioning_example.py.
self.addTag(tag) -> adds a new tag to the track item.
@param tag: tag object
@return: a Tag object
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.
self.currentVersion() -> returns a version object for the current version set on this track item.
@return: Version object
self.duration() -> returns the timeline duration value for the track item.
@return: frames
self.eventNumber() -> Get the event number of this track item on it’s Sequence.
@return: integer event number
self.handleInLength() -> returns the length of the track item’s in handle.
@return: frames
self.handleInTime() -> returns the track item’s in handle time.
@return: frames
self.handleOutLength() -> returns the length of the track item’s out handle.
@return: frames
self.handleOutTime() -> returns the track item’s out handle time.
@return: frames
self.inTransition() -> returns the in transition for this track item.
@return: Transition object
self.isSequence() -> returns True if the track item is enabled.
@return: True or False
self.isMediaPreset() -> returns True if the track item represent a media source and if the media source is currently available in Hiero (and not offline). Returns False otherwise.
@return: True or False
self.isNull() -> returns True if the track item is invalid.
@return: True or False
self.isSequence() -> returns True if the track item represents a sequence. If it does, you can create a new Sequence object with this track item.
@return: True or False
self.isSource() -> returns True if the track item represents a media source. If it does, you can create a new MediaSource object with this track item.
@return: True or False
self.link(trackItem) -> Links track item with another track item. Both track items must point to the same source.
@param trackItem: track item to link to
self.linkedItems() -> returns a tuple of track item objects linked to this one.
@return: tuple of TrackItem objects
self.mediaType() -> returns media type for the track item.
@return: MediaType object
self.metadata() -> returns the metadata for the track item.
@return: DataCollection object
self.move(time) -> moves the trackitem in the sequence. This will keep the duration.
@param time: frame value. If positive, the trackitem moves right. If negative, the trackitem moves left.
TrackItem.moveTrackItems(trackItems, time) -> moves a group of track items in the sequence.
@param trackItems: sequence of track items to move
@param time: frame value. If positive, the trackitems move right. If negative, the trackitems move left.
self.name() -> returns the track item’s name.
@return: string
self.numVersions() -> returns the total number of versions on this track item currently (nothing to do with the maximum or minimum version number).
@return: int
self.outTransition() -> returns the out transition for this track item.
@return: Transition object
self.parent() -> returns the AudioTrack or VideoTrack that contains this item.
@return: AudioTrack or VideoTrack object
self.playbackSpeed() -> returns the playback speed of this track item.
@return: double
self.project() -> returns the Project object that this is attached to, or None if the object is not attached to a project.
@return: Project object
self.reconnectMedia(path) -> connects (or reconnects) all of the media for the Clip, using the specified path.
@param path: path to the folder with the media to connect
self.reformatState() -> returns the reformat state for the track item.
@return: ReformatState object
self.removeTag(tag) -> removes the tag from the track item.
@param tag: Tag object
self.setCurrentVersion(version) -> sets the current version (by object) on this track item. Note that this method doesn’t check that the versioned media source exists on disk.
@param version: Version object
self.setCurrentVersionIndex(index) -> sets the current version on this track item and returns the new version object. Creates a new version if there wasn’t one before, but doesn’t check that the versioned media source exists on disk.
@param index: the integer index to set the current version on this track item to
@return: Version object
self.isSequence() -> enables or disables the track item.
@return: True or False
self.setName(name) -> sets the name of the track item.
@param name: the value to set the track name to
self.setPlaybackSpeed(newSpeed) -> sets the playback speed of this track item.
@param newSpeed: double
self.setSource(clip, trackIndex=0) -> sets the source Clip for this TrackItem.
If the TrackItem is not already in a Track, the duration will be set to the Clip’s duration.
Note that this method does not affect the undo/redo stack at all right now (meaning it is not currently undoable).
@param clip: the Clip object to set as the source for this track item
@param trackIndex: optional track index, for instance if you are adding an audio Clip and want to use its second audio track
@return: the Clip object passed in
self.setSourceIn(time) -> sets the source in for the track item. This will shrink or grow the duration.
@param time: frame value
self.setSourceMediaColourTransform(colourTransform) -> sets the input colour transform for the source media.
@param colourTransform: Colour transform name
self.setSourceOut(time) -> sets the source out for the track item. This will shrink or grow the duration.
Note that this value depends on speed. For exact editing, edit speed instead in order to avoid rounding errors.
@param time: frame value
self.setTimelineIn(inTime) -> sets the timeline in value. Shrinks or grows the timeline duration, as appropriate.
@param inTime: frame value
self.setTimelineOut(outTime) -> sets the timeline out value. Shrinks or grows the timeline duration, as appropriate.
@param outTime: frame value
self.source() -> depending on the underlying type of the track item, returns a Clip object, a Sequence object or a MediaSource object.
@return: a Clip object, a Sequence object or a MediaSource object
self.sourceDuration() -> returns the source duration value for the track item.
Note that this value depends on speed, and may not be an integer value.
@return: frames
self.sourceIn() -> returns the source in value for the track item.
Note that after a combination of a retime and editing, this value may not be an integer.
@return: frame
self.setSourceMediaColourTransform() -> returns colour transform for the media source.
@return: string
self.sourceOut() -> returns the source out value for the track item.
Note that this value depends on speed, and may not be an integer value.
@return: frame
self.tags() -> returns a tuple of all of the tags applied to this object.
@return: tuple of Tag objects
self.thumbnail(frame) -> returns a thumbnail of the frame specified as a QImage object.
@param frame: the frame to get the thumbnail for (defaults to 0)
@param layer: the layer to get the thumbnail for (defaults to colour)
@return: QImage object
self.timelineIn() -> returns the timeline in value for the track item.
@return: frames
self.timelineOut() -> returns the timeline in value for the track item.
@return: frames
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
self.trimIn(time) -> trims the left end of the trackitem. This will grow or shrink the duration and the sourceDuration, but keep the playback speed.
@param time: frame value. If positive, the trackitem duration shrinks. If negative, the trackitem duration grows.
self.trimOut(time) -> trims the right end of the trackitem. This will grow or shrink the duration and the sourceDuration, but keep the playback speed.
@param time: frame value. If positive, the trackitem duration shrinks. If negative, the trackitem duration grows.
self.unlink(trackItem) -> Unlinks this track item from given track item.
@param trackItem: track item from which this track item is being unlinked
self.versionDown() -> decrements the current version on this track item and returns the new version object. Creates a new version if there wasn’t one before, but doesn’t check that the versioned media source exists on disk.
@return: Version object
self.versionMaxAvailable() -> returns the highest discovered version on this track item.
@return: Version object
self.versionMinAvailable() -> returns the lowest discovered version on this track item.
@return: Version object
self.versionNextAvailable() -> returns the next highest available version on this track item that the application has discovered.
@return: Version object
Bases: Shiboken.Object
Object representing a transition between two clips.
self.alignment() -> returns the alignment mode of this transition. Either kFadeIn, kDissolve, kFadeOut or kUnknown.
@return: alignment type (hiero.core.Transition.Alignments)
self.clone() -> returns a deep copy of this object.
@return: Transition object
self.createDissolveTransition(trackItem1, trackItem2, duration1, duration2) -> creates a new dissolve (kDissolve) Transition between two adjacent track items.
The effect will start at duration frames from the end of the trackItem1 and end at duration frames from the start of trackItem2.
@param trackItem1: the earlier TrackItem object to dissolve from
@param trackItem2: the later TrackItem object to dissolve to
@param duration1: frames for the dissolve from
@param duration2: frames for the dissolve to
@return: Transition object
self.createFadeInTransition(trackItem, duration) -> creates a new fade in (kFadeIn) Transition with the timelineIn of the trackItem and the duration specified.
@param trackItem: TrackItem object to use the timelineIn value from
@param duration: frames
@return: Transition object
self.createFadeOutTransition(trackItem, duration) -> creates a new fade out (kFadeOut) Transition. The in point will be the timelineOut of trackItem, minus the duration specified.
@param trackItem: TrackItem object to use the timelineOut value from
@param duration: frames
@return: Transition object
self.isNull() -> returns True if this object refers to a invalid transition.
@return: True or False
self.parent() -> returns the AudioTrack or VideoTrack that contains this transition.
@return: AudioTrack or VideoTrack object
self.project() -> returns the Project object that this item is attached to, or None if the object is not attached to a project.
@return: Project object
self.setAlignment(alignment) -> sets the alignment mode on this transition.
@param alignment: alignment type (hiero.core.Transition.Alignments), either kFadeIn, kDissolve, or kFadeOut
self.setTimelineIn(inTime) -> sets the in point for this transition. Note that this trims the duration of the transition.
@param inTime: frame for the new in point
self.setTimelineOut(outTime) -> sets the out point for this transition. Note that this trims the duration of the transition.
@param outTime: frame for the new out point
self.timelineIn() -> returns the timeline in of this transition.
@return: frame
self.timelineOut() -> returns the timeline out of this transition.
@return: frame
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
Bases: Shiboken.Object
Helper class for beginning and ending undo on a project. Recommended usage is to create with Project.beginUndo(name), using a with block for exception safety to ensure Project.endUndo() is called. For example:
with project.beginUndo(‘My Undo’):
// Undoable edits
self.beginUndo() -> starts a new undo action on the project with the initialised name. See Project.beginUndo()
self.endUndo() -> ends the undo action on the project
Bases: Shiboken.Object
Object representing a version of a clip or sequence. Can be created with a Clip or Sequence object.
self.isNull() -> returns True if the object is invalid, False otherwise.
@return: True or False
self.item() -> returns the clip or sequence stored with this version.
self.name() -> returns the name of this version.
@return: string
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
self.versionIndex() -> returns a string containing the version’s index.
@return: string
Bases: core.Hiero.Python.TrackBase
Object for manipulating video tracks.
self.addTag(tag) -> adds a tag to the video track item.
@param tag: the Tag to add to the video track.
Add a Read node for each track item to the script with AppendClip nodes to join them in a sequence. Blank Constants nodes are added to pad any gaps between clips.
@param additionalNodesCallback: callback to allow custom additional node per item function([Clip|TrackItem|Track|Sequence])
self.addTrackItem(clip, position) -> if the first parameter is a Clip object, the second parameter must be specified and this method creates a new track item and adds it to this video track at the given position.
If the first parameter is a TrackItem, then this method just adds the track item specified.
This method will cut or delete track items that overlap with the one being added.
This method can only be called if the track has already been added to a Sequence.
@param clip: a Clip object or a TrackItem object, to add to this video track.@param position: int; insert position. Do not specify if clip is a TrackItem.@return: TrackItem object
self.clone() -> returns a deep copy of this object.
@return: VideoTrack object
self.createTrackItem(name) -> creates a new track item.
@param name: the name of the new track item
@return: TrackItem object
self.items() -> returns a tuple with all of the track items contained by this track.
@return: tuple of TrackItem objects
self.toString() -> returns a description of the object. Equivalent to str(object).
@return: string
addPathRemap(windowsPathPrefix -> adds to the table of file path remapping prefixes that Hiero maintains. Pairs of path prefixes added to this table will be used to convert paths between Windows, OSX and Linux. When on Windows, Hiero will replace any Linux or OSX prefixes found with the corresponding Windows prefix. On OSX, Hiero will search for the Windows and Linux path prefixes and replace them with the corresponding OSX prefix. The same applies for OSX/Windows prefixes being replaced on Linux. These can also be configured through the user interface in the General tab of the Preferences dialog.
@param windowsPathPrefix: string
@param osxPathPrefix: string
@param linuxPathPrefix: string
@return: None
addPluginPath(pluginPath) -> adds a new path to the list of plugin paths searched for Python plugins (in Python/Startup and Python/StartupUI folders). The user’s .hiero folder will be the first in this list.
addPluginPath(pluginPath -> the same as above, except that the index specifies which item in the list of paths to place the new one before.
@param pluginPath: the new path to add
@param index: optional; if not specified or negative, the new path will be added to the end of the list
hiero.core.closeProject() -> closes all of the existing projects without saving.
hiero.core.closeProject(bool dontSave) -> same as above, but if the parameter is set to false, unsaved projects will cause Hiero to popup a dialog for each unsaved project, asking the user if they’d like to save.
@param dontSave: True or False
conformer() -> returns an interface for setting the conforming options.
@return: a Conformer object
hiero.core.defaultFrameRates() -> returns the list of frame rates displayed in Hiero’s user interface.
@return: tuple of floats
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):
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.
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):
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.
@param directory: path to the directory to query
@param splitSequences: optional, defaults to False. If set to True, then splits broken image sequences up. Otherwise, broken sequences create only one entry in the returned list
@param returnDirectories: optional, defaults to True. If set to True, sub directories will be included in the returned list
@param returnHiddenFiles: optional, defaults to True. If set to True, hidden/system files will be returned in the list
For a directory with the following items: item1.txt item2.txt quicktime.mov highres1.dpx
You’d get a tuple with the same list of items (txt files are recognized as not being image sequences).
You’d get a tuple with: (“quicktime.mov”, “highres#.dpx 1-4”)
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”)
You’d get a tuple like this: (“highres###.dpx 1-5”)
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.
You’d get this: (“highres###.dpx 99-100”)
Note that in this last example, the 99 is prefixed with 0.
formats() -> returns a tuple with all of the formats currently available.
@return: tuple of Format objects
Deprecated. Do not use. Use hiero.core.filenameList() instead
getLibraryDirectory(subdirectory) -> deprecated; use libraryDirectory() instead.
hiero.core.getPluginPath() -> deprecated; please use hiero.core.pluginPath instead.
libraryDirectory(subdirectory) -> returns the input appended to the location of the user’s .hiero directory.
@param subdirectory: path to append to the .hiero directory
@return: string
newProject() -> creates and returns a new Project object.
@return: 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.
openProjectStartup(path -> for internal use only, hiero.core.openProject(path) should be used instead.
@return: Project object
hiero.core.pluginPath() -> Returns a tuple of the search paths used by Hiero to load Python scripts.
@return: tuple of strings
hiero.core.projects() -> returns a tuple of all of the currently loaded preset projects.
@deprecated: Use hiero.core.projects(Project.kStartupProjects) instead
@return: tuple of hiero.core.Project objects
project(name) -> returns the Project with the specified name, if it can be found, or None.
@return: Project object
projects() -> returns a tuple of currently loaded projects which are user projects (not startup). Same effect as calling the method below passing Project.kUserProjects.
projects(projectTypes) -> returns a tuple of currently loaded projects, filtered according to projectTypes. Use hiero.core.projects()[-1] to get the last loaded project.
@param projectTypes: optional; one of Project.kAllProjects, Project.kUserProjects, Project.kStartupProjects
@return: tuple of Project objects
quit() -> shuts down Hiero, without saving any existing projects. Safer than calling sys.exit(), which doesn’t always clean up properly and can cause Hiero to crash. This version sets the exit code of the Hiero process to 0.
Note that this must be the last line in a script.
quit(exitCode) -> same as the first version of this method, except that this one sets the exit code of the process to the exitCode variable.
@param exitCode: optional; integer value to set the process’s exit code to
remapPath(path) -> uses the platform specific path remapping rules from the user’s preferences and applies them to the input path.
@param path: string path to apply the path remapping rules to
@return: string