def snapshot(self): """ @raise AnimationPluginError: """ startFrame, endFrame = mutils.selectedRange() if startFrame == endFrame: endFrame = self.endFrame() startFrame = self.startFrame() self.validateFrameRage() if self.settings().get("byFrameDialog") and self.duration( ) > 100 and self.byFrame() == 1: msg = '''To help speed up the playblast you can set the "by frame" to a greater number than 1. eg: If the "by frame" is set to 2 it will playblast every second frame. Would you like to show this message again?''' result = self.window().questionDialog(msg, "Tip") if result == QtGui.QMessageBox.Cancel: raise Exception("Playblast cancelled!") elif result == QtGui.QMessageBox.No: self.settings().set("byFrameDialog", False) # path = studiolibrary.tempDir(make=True, clean=True) tempDir = studiolibrary.TempDir(clean=True) self._thumbnail = tempDir.path() + "/thumbnail.jpg" self._sequence = tempDir.path() + "/sequence/thumbnail.jpg" try: self._sequence = mutils.snapshot(path=self._sequence, start=startFrame, end=endFrame, step=self.byFrame()) except mutils.SnapshotError, e: self.record().window().setError(str(e)) raise
def snapshot(self): """ :raise: AnimationPluginError """ startFrame, endFrame = mutils.selectedRange() if startFrame == endFrame: self.validateFrameRange() endFrame = self.endFrame() startFrame = self.startFrame() self.showByFrameDialog() try: step = self.byFrame() iconPath, sequencePath = Plugin.createTempIconSequence( startFrame=startFrame, endFrame=endFrame, step=step) except Exception, msg: title = "Error while taking snapshot" QtGui.QMessageBox.critical(None, title, str(msg)) raise
def snapshot(self): """ :raise AnimationPluginError: """ startFrame, endFrame = mutils.selectedRange() if startFrame == endFrame: endFrame = self.endFrame() startFrame = self.startFrame() if startFrame is None or endFrame is None: msg = 'Please choose a start frame and an end frame.' import traceback traceback.print_exc() QtGui.QMessageBox.critical(self, 'Error', msg) raise AnimationPluginError(msg) if self.settings().get('byFrameDialog') and self.duration( ) > 100 and self.byFrame() == 1: msg = 'To help speed up the playblast you can set the "by frame" to a greater number than 1.\neg: If the "by frame" is set to 2 it will playblast every second frame.\nWould you like to show this message again?' result = self.window().questionDialog(msg, 'Tip') if result == QtGui.QMessageBox.Cancel: raise AnimationPluginError('Playblast cancelled!') elif result == QtGui.QMessageBox.No: self.settings().set('byFrameDialog', False) path = studioLibrary.tempDir(make=True, clean=True) self._thumbnail = path + '/thumbnail.jpg' self._sequence = path + '/sequence/thumbnail.jpg' try: self._sequence = mutils.snapshot(path=self._sequence, start=startFrame, end=self.endFrame(), step=self.byFrame()) except mutils.SnapshotError as e: self.record().window().setError(str(e)) raise shutil.copyfile(self._sequence, self._thumbnail) self.setSnapshot(self._thumbnail) self.ui.sequenceWidget.setDirname(os.path.dirname(self._sequence))
def setStartFrame(self): """ """ start, end = mutils.selectedRange() self.ui.startFrameEdit.setText(str(start))
def setEndFrame(self): """ """ start, end = mutils.selectedRange() self.ui.endFrameEdit.setText(str(end))