def exportPanels(self, settings, deletePoses=False): log('##### exportPanels') if not self.testInfo.getShotEdit(): log("Cannot use an export plugin when no edit is saved for this sequence; exiting...", "error") return if self.testInfo.OS == "mac": log("exportPanels is only supported on Windows at the moment. Exiting...", "error") return if deletePoses: pyUtils.deleteLocalPoses(self.testInfo) if settings['format'] == 'jpeg': plugin = 'exportJpegs.png' outputPath = self.jpgOutputDir elif settings['format'] == 'psd': plugin = 'exportPsds.png' outputPath = self.psdOutputDir else: self.testInfo.failed('%s is not a valid format. Must be \'psd\' or \'jpeg\'.' % settings['format']) return if os.path.isdir(outputPath): shutil.rmtree(outputPath) os.makedirs(outputPath) if self.testInfo.flixVersion < '5.2': pluginLocation = sikuliUtils.switchPlugin('export', plugin) click(settings['panels'][0]) if len(settings['panels']) != 1: for panel in settings['panels'][1:]: sikuliUtils.ctrlClick(panel) if self.testInfo.flixVersion < '5.2': click(pluginLocation) else: sikuliUtils.switchPlugin('export', plugin) if not exists('exportFileBrowser.png', 10): self.testInfo.failed('Could not find the File Browser.') click('exportFileBrowserFolder.png') type(outputPath.replace('/', '\\')); wait(1) type(sikuli.Key.ENTER); wait(1) type(sikuli.Key.BACKSPACE) type(sikuli.Key.ENTER) self.exportCheck.exportPanelsCheck(settings) sikuliUtils.closeExplorerWindow('%ss' % settings['format'])
def __publishFromFlix(self, methodName, comment, checkMethod, windowName="fcp", importAAFs=False, createSgSeq=False): """Method that will select the specified editorial plugin, publish with a comment and call the relevant check method :param methodName: Name of the method calling me :param comment: Comment to add to the publish :param checkMethod: Method to call to check the publish results :param windowName: Name of the Explorer window Flix reveals after publishing :param importAAFs: Set to True to import AAFs after Avid publish (not relevant for other editorial publishes) :param createSgSeq: Set to True to create the Flix sequence in Shotgun (only relevant for Shotgun publish) :return: None """ log("##### toEditorial: %s" % methodName) if methodName == "toShotgun" and createSgSeq: sikuliUtils.createShotgunSequence(self.testInfo) if self.testInfo.flixVersion < '5.2': click(sikuliUtils.switchPlugin('editorial', '%s.png' % methodName)); wait(1) else: sikuliUtils.switchPlugin('editorial', '%s.png' % methodName); wait(1) click('publishComment.png'); wait(1) type(comment); wait(1) type(sikuli.Key.TAB); wait(.5) type(sikuli.Key.ENTER) # Assuming .5 sec/frame is enough to publish an edit to editorial # timeout = self.testInfo.getDurationFromShotEdit()/2 # Assuming 2 sec/panel for stills and 1.5 sec/frame for animated panels is enough to publish an edit stillPanels = len(self.testInfo.editPanels["p"]) + len(self.testInfo.editPanels["s"]) animPanels = self.testInfo.editPanels["a"] animFrames = 0 for panel in animPanels: animFrames += self.testInfo.getPanelDurationFromShotEdit(panel) if methodName == "toAvid": stillTimeout = 2 animFrameTimeout = 1.5 else: stillTimeout = 0.5 animFrameTimeout = 0.5 timeout = int((stillTimeout*stillPanels) + (animFrameTimeout*animFrames)) if timeout < 20: timeout = 20 checkMethod(timeout) if methodName in ["toSbp", "toPremiere"]: sikuliUtils.closeExplorerWindow("%s" % windowName) elif importAAFs: self.launch.openEditorialGUI(10) self.editorialProjectBrowser.selectEditorialProject() self.__importToAvid()
def exportQuickTime(self, timeout=100): log('##### exportQuickTime') if not self.testInfo.getShotEdit(): log("Cannot use an export plugin when no edit is saved for this sequence; exiting...", "error") return if os.path.isdir(self.fleMovDir): shutil.rmtree(self.fleMovDir) if self.testInfo.flixVersion < '5.2': click(sikuliUtils.switchPlugin('export', 'exportQuicktime.png')) else: sikuliUtils.switchPlugin('export', 'exportQuicktime.png') self.exportCheck.exportQuickTimeCheck(timeout) sikuliUtils.closeExplorerWindow('fleMov')