Exemplo n.º 1
0
def getShotsForActiveSequence(taggedShotsOnly=False):
  """
  Returns a list of shots from the active sequence.
  Optionally returns only shots which are Tagged by setting taggedShotsOnly to True
  """
  sequence = None
  try:
    sequence = activeSequence()
  except:
    sequence = activeView().selection()[0].parentSequence()

  if not sequence:
    return

  # Get all Tracks in the Sequence...
  tracks = sequence.items()
  shots = []
  if not taggedShotsOnly:
    for track in tracks:
      shots+=[item for item in track.items() if isinstance(item, TrackItem)]
  else:
    for track in tracks:
      shots+=[item for item in track.items() if isinstance(item, TrackItem) and len(item.tags())>0]

  return shots
def getShotsForActiveSequence(taggedShotsOnly=False):
    """
  Returns a list of shots from the active sequence.
  Optionally returns only shots which are Tagged by setting taggedShotsOnly to True
  """
    sequence = None
    try:
        sequence = activeSequence()
    except:
        sequence = activeView().selection()[0].parentSequence()

    if not sequence:
        return

    # Get all Tracks in the Sequence...
    tracks = sequence.items()
    shots = []
    if not taggedShotsOnly:
        for track in tracks:
            shots += [
                item for item in track.items() if isinstance(item, TrackItem)
            ]
    else:
        for track in tracks:
            shots += [
                item for item in track.items()
                if isinstance(item, TrackItem) and len(item.tags()) > 0
            ]

    return shots
Exemplo n.º 3
0
    def FrameioUploadSelectionAction(self):
        """Presents the Frame.io Widget with the active selection of Bin items"""
        selection = activeView().selection()
        if not selection:
            return

        print "Presenting the Frame.io view controller with %s" % str(selection)

        hiero.core.frameioDelegate.showFrameioWidgetWithSelection(selection=selection)
Exemplo n.º 4
0
    def showFrameIODialog(self):
        """
        Presents the Frame.io Widget with the active selection of Bin items
        (selection currently not used)
        """
        selection = activeView().selection()
        if not selection:
            return

        nuke.frameioDelegate.showFrameioDialogWithSelection(selection=selection)
Exemplo n.º 5
0
    def showFrameIODialog(self):
        """
        Presents the Frame.io Widget with the active selection of Bin items
        (selection currently not used)
        """
        selection = activeView().selection()
        if not selection:
            return

        nuke.frameioDelegate.showFrameioDialogWithSelection(
            selection=selection)
Exemplo n.º 6
0
  def writeAllShotsReportCSVForActiveSequence(self):

    # Get the active Sequence
    try:
      sequence = activeSequence()
    except:
      sequence = activeView().selection()[0].parentSequence()

    # Get all Tracks in the Sequence...
    tracks = sequence.items()
    shots = []
    for track in tracks:
      shots+=[item for item in track.items() if isinstance(item, TrackItem)]

    self.writeCSVTagReportFromShotSelection(shotSelection=shots, taggedShotsOnly=False)
Exemplo n.º 7
0
    def showFrameIODialog(self):
        """
        Presents the Frame.io Widget with the active selection of Bin items
        (selection currently not used)
        """
        view = activeView()

        if not view:
            return

        selection = None
        if hasattr(view, 'selection'):
            selection = view.selection()

        nuke.frameioDelegate.showFrameioDialog()
Exemplo n.º 8
0
    def showFrameIODialog(self):
        """
        Presents the Frame.io Widget with the active selection of Bin items
        (selection currently not used)
        """
        view = activeView()

        if not view:
            return

        selection = None
        if hasattr(view, 'selection'):
            selection = view.selection()

        nuke.frameioDelegate.showFrameioDialog()
    def writeAllShotsReportCSVForActiveSequence(self):

        # Get the active Sequence
        try:
            sequence = activeSequence()
        except:
            sequence = activeView().selection()[0].parentSequence()

        # Get all Tracks in the Sequence...
        tracks = sequence.items()
        shots = []
        for track in tracks:
            shots += [
                item for item in track.items() if isinstance(item, TrackItem)
            ]

        self.writeCSVTagReportFromShotSelection(shotSelection=shots,
                                                taggedShotsOnly=False)
Exemplo n.º 10
0
def getSelectedShotsForActiveView(taggedShotsOnly=False):
  """
  Returns a list of selected shots in the active View
  Optionally returns only shots which are Tagged by setting taggedShotsOnly to True
  """
  view = activeView()
  if not hasattr(view, "selection"):
    # If we're here bail out, something has gone wron
    return

  selection = view.selection()
  # Filter the list of shots from the active selection
  if not taggedShotsOnly:
    shotSelection = [item for item in selection if isinstance(item, TrackItem)]
  else:
    shotSelection = [item for item in selection if isinstance(item, TrackItem) and len(item.tags())>0]

  return shotSelection
Exemplo n.º 11
0
  def doitGetSelection(self):

    self.selectedTrackItems = []
    view = activeView()
    if not view:
      return
    if not hasattr(view,'selection'):
      return

    s = view.selection()
    if s is None:
      return

    # Ignore transitions from the selection
    self.selectedTrackItems = [item for item in s if isinstance(item, (hiero.core.TrackItem, hiero.core.SubTrackItem))]
    if not self.selectedTrackItems:
      return

    self.doit()
Exemplo n.º 12
0
    def doitGetSelection(self):

        self.selectedTrackItems = []
        view = activeView()
        if not view:
            return
        if not hasattr(view, 'selection'):
            return

        s = view.selection()
        if s is None:
            return

        # Ignore transitions from the selection
        self.selectedTrackItems = [
            item for item in s if isinstance(item, (hiero.core.TrackItem,
                                                    hiero.core.SubTrackItem))
        ]
        if not self.selectedTrackItems:
            return

        self.doit()
def getSelectedShotsForActiveView(taggedShotsOnly=False):
    """
  Returns a list of selected shots in the active View
  Optionally returns only shots which are Tagged by setting taggedShotsOnly to True
  """
    view = activeView()
    if not hasattr(view, "selection"):
        # If we're here bail out, something has gone wron
        return

    selection = view.selection()
    # Filter the list of shots from the active selection
    if not taggedShotsOnly:
        shotSelection = [
            item for item in selection if isinstance(item, TrackItem)
        ]
    else:
        shotSelection = [
            item for item in selection
            if isinstance(item, TrackItem) and len(item.tags()) > 0
        ]

    return shotSelection