def __init__(self): self._addMarkerAction = createMenuAction("Add Marker", self.addMarkerToCurrentFrame) self._addMarkerAction.setShortcut( "M" ) self._addMarkerAction.setObjectName("foundry.timeline.addMarker") registerAction(self._addMarkerAction) self._clearAllMarkersAction = createMenuAction("Clear All Markers", self.clearAllMarkers) self._clearAllMarkersAction.setObjectName("foundry.timeline.clearAllMarkers") registerAction(self._clearAllMarkersAction) self._clearMarkersInOutAction = createMenuAction("Clear Markers In/Out Range", self.clearMarkersInActiveRange) self._clearMarkersInOutAction.setObjectName("foundry.timeline.clearMarkersInOut") registerAction(self._clearMarkersInOutAction) hiero.core.events.registerInterest("kShowContextMenu/kTimeline", self.eventHandler) hiero.core.events.registerInterest("kShowContextMenu/kViewer", self.eventHandler)
def __init__(self): self._addMarkerAction = createMenuAction("Add Marker", self.addMarkerToCurrentFrame) self._addMarkerAction.setShortcut("Alt+Shift+M") self._addMarkerAction.setObjectName("foundry.timeline.addMarker") registerAction(self._addMarkerAction) self._clearAllMarkersAction = createMenuAction("Clear All Markers", self.clearAllMarkers) self._clearAllMarkersAction.setObjectName( "foundry.timeline.clearAllMarkers") registerAction(self._clearAllMarkersAction) self._clearMarkersInOutAction = createMenuAction( "Clear Markers In/Out Range", self.clearMarkersInActiveRange) self._clearMarkersInOutAction.setObjectName( "foundry.timeline.clearMarkersInOut") registerAction(self._clearMarkersInOutAction) hiero.core.events.registerInterest("kShowContextMenu/kTimeline", self.eventHandler) hiero.core.events.registerInterest("kShowContextMenu/kViewer", self.eventHandler)
# This creates an action with an icon and effect named 'Awesome OCIO' action = QAction(QIcon("icons:TCStop.png"), "Slug", None) # Soft effect actions can be found by prefixing the QAction's objectName with: 'foundry.timeline.effect' action.setObjectName("foundry.timeline.effect.addSlug") # You can optionally set a tooltip for this action action.setToolTip("Will apply a Slug Gizmo") # Setting of Data here will point to the Nuke node class name. # Here, we assume there is a plugin with a Class name 'AwesomeOCIO' # Note: for soft effects to work, the Nuke node must use a gpuEngine implementation. action.setData("Slug") # This registers your custom action with the Effects Menu registerAction(action) # This creates an action with an icon and effect named 'SuperGrade' action = QAction(QIcon("icons:LUT.png"), "SuperGrade", None) # Soft effect actions can be found by prefixing the QAction's objectName with: 'foundry.timeline.effect.' action.setObjectName("foundry.timeline.effect.addCustomGrade") # You can optionally set a tooltip for this action action.setToolTip("Will apply a Custom Grade soft effect") action.setData("SuperGrade") # This registers your custom action with the Effects Menu registerAction(action)
self.eventHandler) self.setObjectName("foundry.viewer.setPosterFrame") self.setShortcut("Shift+P") self.currentViewer = None def setPosterFrameForActiveSequence(self): if not self.currentViewer: self.currentViewer = currentViewer() currentTime = self.currentViewer.time() activeSequence = self.currentViewer.player().sequence() if activeSequence and currentTime: activeSequence.setPosterFrame(int(currentTime)) self.currentViewer = None def eventHandler(self, event): enabled = event.sender.player().sequence() is not None for a in event.menu.actions(): if a.text().lower().strip() == "mark": self.setEnabled(enabled) insertMenuAction(self, a.menu()) # Instantiate the action, add it to the Viewer menu and register it. action = SetPosterFrameAction() v = findMenuAction("foundry.menu.viewer") insertMenuAction(action, v.menu(), after='foundry.viewer.clearInOut') registerAction(action)