Esempio n. 1
0
 def getPublishedVersions(self, show, sequence, branch):
     """Return an array of the versions that were published to editorial
     """
     matches = Mode(show, sequence).getMatches('[sgPublishFolder]',
                                               {'version': '*'})
     versions = []
     for m in matches:
         try:
             versions.append(int(m['version']))
         except ValueError:
             pass
     return versions
Esempio n. 2
0
    def __init__(self):
        self.fileService = fileService
        self.rePath      = RepathDefault()

        self.shotList             = ''

        # load the icon
        iconPath = Mode().get('[FLIX_CONFIG_FOLDER]')+'/plugins/icons/custom_icon.png'
        icon = self.fileService.loadByteArray(iconPath)

        self.init(label     ='Log Shot Markers',
                  icon      =icon,
                  tooltip   ='Logs what shots, markers and markerlists are',
                  group     ='Export',
                  pluginPath='flixConfig.plugins.logShotMarkers.LogShotMarkers')
Esempio n. 3
0
    def __init__(self):
        self.fileService = fileService
        self.rePath = RepathDefault()

        self.shotList = ''

        # load the icon
        iconPath = Mode().get('[FLIX_FOLDER]') + '/assets/custom_icon.png'
        icon = self.fileService.loadByteArray(iconPath)

        self.init(label='BurnIn per Shot',
                  icon=icon,
                  tooltip='BurnIn per Shot',
                  group='Export',
                  pluginPath='flixConfig.plugins.burnInPerShot.BurnInPerShot')
    def __init__(self):
        self.fileService = fileService
        self.rePath      = RepathDefault()

        self.shotList             = ''

        # load the icon
        iconPath = Mode().get('[FLIX_CONFIG_FOLDER]')+'/plugins/icons/custom_icon.png'
        icon = self.fileService.loadByteArray(iconPath)

        self.init(label     ='Log Multiple Shot Edits',
                  icon      =icon,
                  tooltip   ='Logs latest shotedit from every sequence',
                  group     ='Export',
                  pluginPath='flixConfig.plugins.logMultipleShotEdits.LogMultipleShotEdits')
Esempio n. 5
0
    def __init__(self):
        self.fileService = fileService
        self.rePath      = RepathDefault()
        self.flixNuke = FlixNuke()

        self.shotList             = ''

        # load the icon
        iconPath = Mode().get('[FLIX_FOLDER]')+'/assets/custom_icon.png'
        icon = self.fileService.loadByteArray(iconPath)

        self.init(label     ='Quick Nuke Render',
                  icon      =icon,
                  tooltip   ='Quick Nuke Render',
                  group     ='Export',
                  pluginPath='flixConfig.plugins.quickNukeRender.QuickNukeRender')
Esempio n. 6
0
    def __init__(self):
        self.fileService = fileService
        self.rePath = RepathDefault()

        self.shotList = ''
        self.serverFlixFunctions = ServerFlixFunctions()

        # load the icon
        iconPath = Mode().get(
            '[FLIX_CONFIG_FOLDER]') + '/plugins/icons/custom_icon.png'
        icon = self.fileService.loadByteArray(iconPath)

        self.init(
            label='Import Dialogue',
            icon=icon,
            tooltip='Import dialogue to current edit',
            group='Export',
            pluginPath='flixConfig.plugins.importDialogue.ImportDialogue')
Esempio n. 7
0
    def __init__(self):
        self.fileService = fileService
        self.rePath = RepathDefault()
        self.fileServiceLocal = flix.fileServices.fileLocal.FileLocal()
        self.serverFlixFunctions = ServerFlixFunctions()

        self.shotList = ''

        # load the icon
        iconPath = Mode().get(
            '[FLIX_CONFIG_FOLDER]') + '/plugins/icons/custom_icon.png'
        icon = self.fileService.loadByteArray(iconPath)

        self.init(label='Rename Markers',
                  icon=icon,
                  tooltip='Rename Markers',
                  group='Export',
                  pluginPath='flixConfig.plugins.renameMarkers.RenameMarkers')
Esempio n. 8
0
    def __init__(self):
        self.fileService = fileService
        self.rePath = RepathDefault()

        self.shotList = ''
        self.sg = None
        self.sgShow = ''
        self.sgSeq = ''
        self.sgShot = ''
        self.sgTask = ''

        # load the icon
        iconPath = Mode().get('[FLIX_FOLDER]') + '/assets/20px-shotgun.png'
        icon = self.fileService.loadByteArray(iconPath)

        self.init(label='Shotgun GEAH',
                  icon=icon,
                  tooltip='Shotgun GEAH',
                  group='Editorial',
                  pluginPath='flixConfig.plugins.toShotgunGEAH.ToShotgunGEAH')
Esempio n. 9
0
    def execute(self, shotCutList, selection, additionalData=None):
        if not additionalData is None:
            referenceCutList = additionalData.get('reference', None)
            comment = additionalData.get('comment', "")

        show = shotCutList.show
        sequence = shotCutList.sequence
        version = shotCutList.version
        branch = shotCutList.branch
        mode = Mode(show, sequence)

        log("To Avid: Publishing: %s %s %s %s Comment: %s" %
            (show, sequence, branch, version, comment),
            isInfo=True)

        # get path to cutlist to publish
        shotCutListPath = flix.core2.shotCutList.ShotCutList.getDefaultPath( \
            mode, version, branch)

        # check if reference cutlist is required
        referenceCutListPath = None
        referenceVersion = -2
        if referenceCutList is not None:
            referenceVersion = referenceCutList.version
        if referenceVersion == -2:
            referenceCutListPath = self.getMostRecentPublishedEdit( \
                show, sequence, version, branch)
        elif referenceVersion > 0:
            referenceCutList.load()
            referenceCutListPath = flix.core2.shotCutList.ShotCutList.getDefaultPath( \
                mode, referenceVersion, branch)

        # publish the cutlist
        avidWorkflow = AvidWorkflow()
        result = avidWorkflow.publish(shotCutListPath, referenceCutListPath,
                                      comment)

        if referenceCutList is None:
            referenceCutList = shotCutList

        self.__shotCutList = shotCutList
        self.__shotCutList.load()
        self.__referenceCutList = referenceCutList
        self.__newShots = avidWorkflow.newShots
        self.__errors = avidWorkflow.errors
        self.__encodingTime = avidWorkflow.encodingTime
        self.__comment = comment
        self._dialogueErrors = avidWorkflow.dialogueErrors

        self.saveAle(shotCutList)

        # email publish summary
        self.emailSummary()
        self.flixCore = FlixCore()
        importMedia = self.flixCore.examineFLEForNewAAFs(
            show, sequence, version, branch)
        log("importMedia: %s" % importMedia)
        destinationFolder = shotCutList.mode.get('[AAFDestinationFolder]')
        log("destinationFolder: %s" % destinationFolder)
        if self.fileService.exists(destinationFolder):
            self.flixCore.importAAFs(show, sequence, version, branch,
                                     destinationFolder)
        else:
            # self.editorialLog("AAF copy directory does not\nexist. Set a valid directory and try again.")
            # self.execMessage("\nExecuted Avid Plugin Successfully\nRefer to e-mail for more info.\nCould not find AAF destination folder, please import AAFs manually.")
            self._execMessage += "\nCould not find AAF destination folder, please import AAFs manually."
            log("Could not find AAF destination folder: %s" %
                destinationFolder)

        # Automatically create a PDF file during publish
        if shotCutList.mode.get('[avidAutoGeneratePDF]') == '1':
            # convert new shots into indices
            newPanelIndices = []
            index = 0
            panelIndex = 0
            for newShot in avidWorkflow.newShots:
                while index < len(shotCutList):
                    shot = shotCutList[index]
                    if shot.isMarker():
                        index += 1
                        continue
                    if shot.label == newShot.label:
                        newPanelIndices.append(panelIndex)
                        break
                    index += 1
                    panelIndex += 1

            toPDF = flix.plugins.toPDF.ToPDF9()
            toPDF.execute(shotCutList, [], {'newShots': newPanelIndices})

        log("To Avid:: Publish Complete with status: %s" % result)

        return "%s" % result
Esempio n. 10
0
    def execute(self, shotCutList, selection, additionalData=None):
        if not additionalData is None:
            referenceCutList = additionalData.get('reference', None)
            comment = additionalData.get('comment', "")
        else:
            comment = ''

        comment = unicode(urllib.unquote_plus(comment))
        self.shotList = flix.core2.shotCutList.ShotCutList.fromFile(
            shotCutList.defaultPath())
        self.kargs = {
            'show': self.shotList.show,
            'sequence': self.shotList.sequence,
            'branch': self.shotList.branch,
            'version': self.shotList.version
        }
        self.mode = self.shotList.mode
        self.markerShotLists = self.getMarkerList(self.shotList)
        # Get the editorial movie path
        self.addProgress(4)
        self.movDir = self.mode.get("[editorialMOVFolder]")

        movieFileName = self.shotList.refVideoFilename
        if movieFileName is None:
            raise flix.exceptions.FlixException(
                msg="Current version does not have an editorial movie.",
                notify=True)
        else:
            movieFile = "%s/%s" % (self.movDir, movieFileName)
            log("Movie File: %s" % movieFile)
        shotInfoObject = ShotInfo(self.shotList)
        shotsInfo = shotInfoObject.getShotsInfo()
        toMovPerShotObject = ToMovPerShot(self.shotList)
        self.addProgress(len(shotsInfo))
        shotMovies = toMovPerShotObject.toMovPerShot(shotsInfo, movieFile)

        self.removeProgress()
        self.sg = self._connectToSG(self.mode)
        self.removeProgress()

        self.seqUrl = self.getSequenceUrl()

        # validate that all information for Flix has an equivalent in shotgun
        self.sgShow = self._validateShow(self.shotList.show)
        if int(Mode(self.shotList.show).get('[isEpisodic]')):
            episodeName = self.shotList.sequence.split("_")[0]
            self.sgEp = self._validateEp(episodeName)
            sequenceName = "_".join(self.shotList.sequence.split("_")[1:])
            self.sgSeq = self._validateSeqs(sequenceName)
        else:
            self.sgEp = None
            self.sgSeq = self._validateSeqs(self.shotList.sequence)

        self.removeProgress()

        # check for shots to create movies and upload to shotgun as version
        # if shots don't exists yet create a movie of the entire sequence and upload to shotgun as version

        if not self.markerShotLists:
            self.markerShotLists.append(self.shotList)

        self.addProgress(len(self.markerShotLists))
        for markerShot in self.markerShotLists:
            index = self.markerShotLists.index(markerShot)
            if markerShot.isMarker:
                self.sgShot = self._validateShot(markerShot)
                self._validateVersion(markerShot)
                # dialogue = shotsInfo[index][5]
                movie = shotMovies[index]
                mp3 = movie.replace(".mov", ".mp3")
                AudioUtils().localConvertAudio(movie, mp3)
                if not self.sgShot:
                    # self.sgShot = self.createSgShot(markerShot)
                    self.sgShot = self.createSgShot(markerShot,
                                                    shotsInfo[index])
                sgVersion = self.uploadSeqVersion(self.rePath.localize(movie),
                                                  self.rePath.localize(mp3),
                                                  self.sgShot,
                                                  comment=comment)
            else:
                self._validateVersion(markerShot)
                self.sgTask = self._validateTask()
                movie = self.createMov(markerShot)
                mp3 = movie.replace(".mov", ".mp3")
                AudioUtils().localConvertAudio(movie, mp3)
                sgVersion = self.uploadSeqVersion(self.rePath.localize(movie),
                                                  self.rePath.localize(mp3),
                                                  self.sgSeq,
                                                  self.sgTask,
                                                  comment=comment)

            # Validate that a FLIX playlist exists or else create one
            self.playlist = self._validatePlaylist()

            # update the FLIX playlist to add the new sgVersion
            self.updatePlaylist(self.playlist, sgVersion)
            self.removeProgress()

        ToShotgunGEAH.toFile(self, **self.kargs)

        autoMarkOmittedShots = self.mode['[sgAutoMarkOmittedShots]'] == "1"

        if autoMarkOmittedShots:
            self.autoMarkOmittedShots()

        self.removeProgress()
Esempio n. 11
0
    def execute(self, shotCutList, selection, additionalData=None):
        if not additionalData is None:
            referenceCutList = additionalData.get('reference', None)
            comment = additionalData.get('comment', "")
        else:
            comment = ''

        comment = unicode(urllib.unquote_plus(comment))
        self.shotList = flix.core2.shotCutList.ShotCutList.fromFile(
            shotCutList.defaultPath())
        self.kargs = {
            'show': self.shotList.show,
            'sequence': self.shotList.sequence,
            'branch': self.shotList.branch,
            'version': self.shotList.version
        }
        self.mode = self.shotList.mode

        self.addProgress(4)

        markerShotLists = self.getMarkerList(self.shotList)

        self.removeProgress()
        self.sg = self._connectToSG(self.mode)
        self.removeProgress()

        self.seqUrl = self.getSequenceUrl()

        # validate that all information for Flix has an equivalent in shotgun
        self.sgShow = self._validateShow(self.shotList.show)
        if int(Mode(self.shotList.show).get('[isEpisodic]')):
            episodeName = self.shotList.sequence.split("_")[0]
            self.sgEp = self._validateEp(episodeName)
            sequenceName = self.shotList.sequence.split("_")[1]
            self.sgSeq = self._validateSeqs(sequenceName)
        else:
            self.sgEp = None
            self.sgSeq = self._validateSeqs(self.shotList.sequence)

        self.removeProgress()

        # check for shots to create movies and upload to shotgun as version
        # if shots don't exists yet create a movie of the entire sequence and upload to shotgun as version

        if not markerShotLists:
            markerShotLists.append(self.shotList)

        self.addProgress(len(markerShotLists))
        self.markIn = 1
        self.markOut = 0
        for markerShot in markerShotLists:
            if markerShot.isMarker:
                for shot in markerShot:
                    self.markOut += int(round(shot.duration))
                self.sgShot = self._validateShot(markerShot)
                self._validateVersion(markerShot)
                tupleMarker = (markerShot, self.getShotsIndex(markerShot))
                movie = self.createMov(tupleMarker)
                self.markIn += self.markOut
                if not self.sgShot:
                    self.sgShot = self.createSgShot(markerShot)
                sgVersion = self.uploadSeqVersion(movie,
                                                  self.sgShot,
                                                  comment=comment)
            else:
                self._validateVersion(markerShot)
                self.sgTask = self._validateTask()
                movie = self.createMov(markerShot)
                sgVersion = self.uploadSeqVersion(movie,
                                                  self.sgSeq,
                                                  self.sgTask,
                                                  comment=comment)

            # Validate that a FLIX playlist exists or else create one
            self.playlist = self._validatePlaylist()

            # update the FLIX playlist to add the new sgVersion
            self.updatePlaylist(self.playlist, sgVersion)
            self.removeProgress()

        ToShotgunCustom.toFile(self, **self.kargs)

        autoMarkOmittedShots = self.mode['[sgAutoMarkOmittedShots]'] == "1"

        if autoMarkOmittedShots:
            self.autoMarkOmittedShots()

        self.removeProgress()