def setCurrent(self,canv): if type(canv) == int and canv in range(len(self.all)): canv = self.all[canv] if canv in self.all: GD.canvas = self.current = canv toolbar.setTransparency(self.current.alphablend) toolbar.setPerspective(self.current.camera.perspective) toolbar.setLight(self.current.lighting) self.current.display()
def setCurrent(self,canv): if type(canv) == int and canv in range(len(self.all)): canv = self.all[canv] # TEST SKIP IF ALREADY CURRENT if self.current == canv: return if canv in self.all: GD.canvas = self.current = canv toolbar.setTransparency(self.current.alphablend) toolbar.setPerspective(self.current.camera.perspective) toolbar.setLight(self.current.lighting) #toolbar.setNormals(self.current.avgnormals) # # TEST WITHOUT DISPLAY GL.glFlush()
def setCurrent(self,canv): """Make the specified viewport the current one. canv can be either a viewport or viewport number. """ # GL.glFlush() if type(canv) == int and canv in range(len(self.all)): canv = self.all[canv] ## if self.current == canv: ## # alreay current ## return if GD.canvas: GD.canvas.focus = False GD.canvas.updateGL() if canv in self.all: GD.canvas = self.current = canv GD.canvas.focus = True toolbar.setTransparency(self.current.alphablend) toolbar.setPerspective(self.current.camera.perspective) toolbar.setLight(self.current.lighting) #toolbar.setNormals(self.current.avgnormals) # GL.glFlush() GD.canvas.updateGL()
def lights(onoff): """Set the lights on or off""" toolbar.setLight(onoff)
def renderMode(mode): GD.canvas.setRenderMode(mode) toolbar.setLight(GD.canvas.lighting) GD.canvas.update() GD.app.processEvents()
def renderMode(mode,avg=False): pf.canvas.setRenderMode(mode) toolbar.setNormals(avg) toolbar.setLight(pf.canvas.lighting) pf.canvas.update() pf.app.processEvents()