def renderImageTask(self, task): timeElapsed = task.time - self.timeOld if timeElapsed < Settings.RRENDER_INTERVAL: return task.cont self.timeOld = task.time if (self.pnmimage is None) or (Settings.RRENDER_K is None) or (Settings.RRENDER_DISTORT is None): return task.done if not self.visible: return task.done imgcopy = PNMImage() imgcopy.copyFrom(self.pnmimage) # Rerender.rerenderNoWrite( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, self.camParams) Rerender.rerenderNoWriteNoH5( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, Settings.RRENDER_K, Settings.RRENDER_DISTORT ) self.tex.load(imgcopy) return task.cont
def toggleVisibility(self): if (self.visible): self.visible = False self.imageNode.stash() else: self.visible = True self.imageNode.unstash() self.timeOld = 0 imgcopy = PNMImage() imgcopy.copyFrom(self.pnmimage) #Rerender.rerenderNoWrite( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, self.camParams) Rerender.rerenderNoWriteNoH5(self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, Settings.RRENDER_K, Settings.RRENDER_DISTORT) self.tex.load(imgcopy) taskMgr.add(self.renderImageTask, 'renderImageTask')
def renderImageTask(self, task): timeElapsed = task.time - self.timeOld if timeElapsed < Settings.RRENDER_INTERVAL: return task.cont self.timeOld = task.time if (self.pnmimage is None) or (Settings.RRENDER_K is None) or ( Settings.RRENDER_DISTORT is None): return task.done if (not self.visible): return task.done imgcopy = PNMImage() imgcopy.copyFrom(self.pnmimage) #Rerender.rerenderNoWrite( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, self.camParams) Rerender.rerenderNoWriteNoH5(self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, Settings.RRENDER_K, Settings.RRENDER_DISTORT) self.tex.load(imgcopy) return task.cont
def toggleVisibility(self): if self.visible: self.visible = False self.imageNode.stash() else: self.visible = True self.imageNode.unstash() self.timeOld = 0 imgcopy = PNMImage() imgcopy.copyFrom(self.pnmimage) # Rerender.rerenderNoWrite( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, self.camParams) Rerender.rerenderNoWriteNoH5( self.app.selectedObject, self.app.pointcloud.TruPos, imgcopy, Settings.RRENDER_K, Settings.RRENDER_DISTORT, ) self.tex.load(imgcopy) taskMgr.add(self.renderImageTask, "renderImageTask")