Esempio n. 1
0
 def timelineEventHandler(self,event):
   enableSelectionActions = True
   if len(event.sender.selection()) == 0:
     enableSelectionActions = False
   self._firstFrameAction.setEnabled(enableSelectionActions)
   self._middleFrameAction.setEnabled(enableSelectionActions)
   self._lastFrameAction.setEnabled(enableSelectionActions)
   self._currentFrameAction.setText(self.kCurrentFrame)
   insertMenuAction(self._menu.menuAction(), event.menu)
Esempio n. 2
0
 def timelineEventHandler(self, event):
     enableSelectionActions = True
     if len(event.sender.selection()) == 0:
         enableSelectionActions = False
     self._firstFrameAction.setEnabled(enableSelectionActions)
     self._middleFrameAction.setEnabled(enableSelectionActions)
     self._lastFrameAction.setEnabled(enableSelectionActions)
     self._currentFrameAction.setText(self.kCurrentFrame)
     insertMenuAction(self._menu.menuAction(), event.menu)
Esempio n. 3
0
 def eventHandler(self, event):
   """Add these actions to the Mark sub-menu"""
   for a in event.menu.actions():
     if a.text().lower().strip() == "mark":
       insertMenuAction( self._addMarkerAction, a.menu())
       insertMenuAction( self._clearAllMarkersAction, a.menu())
       insertMenuAction( self._clearMarkersInOutAction, a.menu())
Esempio n. 4
0
 def eventHandler(self, event):
     """Add these actions to the Mark sub-menu"""
     for a in event.menu.actions():
         if a.text().lower().strip() == "mark":
             insertMenuAction(self._addMarkerAction, a.menu())
             insertMenuAction(self._clearAllMarkersAction, a.menu())
             insertMenuAction(self._clearMarkersInOutAction, a.menu())
Esempio n. 5
0
  def eventHandler(self, event):

    if not hasattr(event.sender, 'selection'):
      # Something has gone wrong, we should only be here if raised
      # by the timeline view which gives a selection.
      return
    s = event.sender.selection()

    # Return if there's no Selection. We won't add the Tags Menu.
    if s == None:
      return

    # Filter the selection to only act on TrackItems, not Transitions etc.
    shotSelection = self.getShotSelectionForActiveView()

    # We only enable Paste operations if ONE shot is in the hiero.core.shotClipboard

    enablePaste = (len(hiero.core.shotClipboard) == 1)
    self._pasteTCAction.setEnabled(enablePaste)
    self._pasteTCSpecialAction.setEnabled(enablePaste)
    
    # Insert the Tags menu with the Clear Tags Option
    insertMenuAction(self._timecodeMenu.menuAction(),  event.menu)
    def eventHandler(self, event):

        if not hasattr(event.sender, 'selection'):
            # Something has gone wrong, we should only be here if raised
            # by the timeline view which gives a selection.
            return
        s = event.sender.selection()

        # Return if there's no Selection. We won't add the Tags Menu.
        if s == None:
            return

        # Filter the selection to only act on TrackItems, not Transitions etc.
        shotSelection = self.getShotSelectionForActiveView()

        # We only enable Paste operations if ONE shot is in the hiero.core.shotClipboard

        enablePaste = (len(hiero.core.shotClipboard) == 1)
        self._pasteTCAction.setEnabled(enablePaste)
        self._pasteTCSpecialAction.setEnabled(enablePaste)

        # Insert the Tags menu with the Clear Tags Option
        insertMenuAction(self._timecodeMenu.menuAction(), event.menu)
Esempio n. 7
0
        if tag.inTime() >= inTime and tag.outTime() <= outTime:
          activeSequence.removeTag(tag)

    hiero.ui.markersPanel.updateTableView()

  def eventHandler(self, event):
    """Add these actions to the Mark sub-menu"""
    for a in event.menu.actions():
      if a.text().lower().strip() == "mark":
        insertMenuAction( self._addMarkerAction, a.menu())
        insertMenuAction( self._clearAllMarkersAction, a.menu())
        insertMenuAction( self._clearMarkersInOutAction, a.menu())

markerActions = MarkerActions()
hiero.ui.clearAllTimelineMarkers = markerActions.clearAllMarkers
hiero.ui.clearMarkersInActiveRange = markerActions.clearMarkersInActiveRange

hiero.ui.markersPanel = MarkersPanel()
hiero.ui.markersPanel.__doc__ = "The Markers panel object. Call hiero.ui.markersPanel.updateTableView() to refresh the panel."
registerPanel( "uk.co.thefoundry.markers", hiero.ui.markersPanel )

wm = hiero.ui.windowManager()
wm.addWindow( hiero.ui.markersPanel )

# Add action to Timeline menu so it can be given a Global keyboard shortcut
timelineMenu = findMenuAction("foundry.menu.sequence")

if timelineMenu:
  insertMenuAction( markerActions._addMarkerAction, timelineMenu.menu(), after="foundry.timeline.markClip" )
  insertMenuAction( markerActions._clearAllMarkersAction, timelineMenu.menu(), after="foundry.timeline.addMarker" )
  insertMenuAction( markerActions._clearMarkersInOutAction, timelineMenu.menu(), after="foundry.timeline.clearAllMarkers" )
Esempio n. 8
0
 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())
Esempio n. 9
0
      QAction.__init__(self, "Set Poster Frame", None)
      self.triggered.connect(self.setPosterFrameForActiveSequence)
      hiero.core.events.registerInterest("kShowContextMenu/kViewer", 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)
Esempio n. 10
0
        for a in event.menu.actions():
            if a.text().lower().strip() == "mark":
                insertMenuAction(self._addMarkerAction, a.menu())
                insertMenuAction(self._clearAllMarkersAction, a.menu())
                insertMenuAction(self._clearMarkersInOutAction, a.menu())


markerActions = MarkerActions()
hiero.ui.clearAllTimelineMarkers = markerActions.clearAllMarkers
hiero.ui.clearMarkersInActiveRange = markerActions.clearMarkersInActiveRange

hiero.ui.markersPanel = MarkersPanel()
hiero.ui.markersPanel.__doc__ = "The Markers panel object. Call hiero.ui.markersPanel.updateTableView() to refresh the panel."
registerPanel("uk.co.thefoundry.markers", hiero.ui.markersPanel)

wm = hiero.ui.windowManager()
wm.addWindow(hiero.ui.markersPanel)

# Add action to Timeline menu so it can be given a Global keyboard shortcut
timelineMenu = findMenuAction("foundry.menu.sequence")

if timelineMenu:
    insertMenuAction(markerActions._addMarkerAction,
                     timelineMenu.menu(),
                     after="foundry.timeline.markClip")
    insertMenuAction(markerActions._clearAllMarkersAction,
                     timelineMenu.menu(),
                     after="foundry.timeline.addMarker")
    insertMenuAction(markerActions._clearMarkersInOutAction,
                     timelineMenu.menu(),
                     after="foundry.timeline.clearAllMarkers")
Esempio n. 11
0
 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())
Esempio n. 12
0
        hiero.core.events.registerInterest("kShowContextMenu/kViewer",
                                           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)