# Dont embed TC encoder = Draft.VideoEncoder(params['outFile'], fps=framerate, width=outWidth, height=outHeight, quality=100, codec=toCodec) # # Create the anotations # # Set text's color and point size annotationInfo = Draft.AnnotationInfo() annotationInfo.Color = Draft.ColorRGBA(1.0, 1.0, 1.0, 1.0) # color white annotationInfo.PointSize = int(outHeight * 0.045) # # Creating the burn in data # ## For the composite operations compOperation = Draft.CompositeOperator.OverCompositeOp if params['projectAppendSlate'] == "True": print "Creating the burn in data" # Set up the text for the slate frame slateText = [("JOB", params["projectName"].replace("%20", " ")), ("SHOT", params["entity"]), ("VERSION", params['version']), ("FRAMES", params['frameList']), ("ARTIST", params['username']),
def UpdateImage(self): global stickyImage global resolutionWidth global resolutionHeight global backgroundRedColor global backgroundGreenColor global backgroundBlueColor self.img = None self.imgOrig = None path = self.GetValue("DraftImageFileBrowser").strip() if self.GetValue("DraftImageRadio") and len(path) != 0: try: self.imgOrig = Draft.Image.ReadFromFile(path) stickyImage = path except RuntimeError: self.ShowMessageBox( "The image file:\n\"" + path + "\"\n is unable to be displayed. Please select another image file or set the resolution manually.", "Warning") self.SetValue("DraftImageFileBrowser", "") self.SetValue("DraftBlankRadio", True) stickyImage = "" except Exception as e: self.ShowMessageBox( "Unable to read the image file. " + str(e) + "\nPlease select another image file or set the resolution manually.", "Warning") self.SetValue("DraftImageFileBrowser", "") self.SetValue("DraftBlankRadio", True) stickyImage = "" if self.GetValue("DraftBlankRadio") or len(path) == 0: stickyImage = "" resolution = self.GetValue("DraftResolution") if resolution != "Custom": dimensions = self.resolutionsDict[resolution] width = dimensions[0] height = dimensions[1] else: width = self.GetValue("DraftCustomWidthBox") height = self.GetValue("DraftCustomHeightBox") resolutionWidth = width resolutionHeight = height self.imgOrig = Draft.Image.CreateImage(width, height) self.imgOrig.SetToColor( Draft.ColorRGBA(backgroundRedColor, backgroundGreenColor, backgroundBlueColor, 1)) self.imgOrig.SetChannel('A', 1) self.img = copy.deepcopy(self.imgOrig) self.imageViewer.setImage(self.img) self.ResetAnnotationBoxPositions() self.UpdateAllAnnotations() zoomFactor = min( DraftAnnotationDialog.defaultImageHeightInViewer / self.img.height, 5.0) self.zoomSlider.setValue(zoomFactor * 100) self.imageViewer.zoomImage(zoomFactor) if not self.keepFitBtn.isChecked(): self.keepFitBtn.setChecked(True) self.FitViewport()