Exemplo n.º 1
0
	def captureScreen(self, widget=None, path=None, zoom=0, crop=True):
		silent = True
		if not path:
			path = os.path.join(logic.tempFilePath, 'media', "{0}.png".format(time.asctime()))
			silent = False

		try:
			if zoom == 0:
				if crop:
					render.makeScreenshot(path, *self.dimension)
				else:
					render.makeScreenshot(path)
			else:
				d=[
				self.dimension[0]+self.dimension[2]*zoom,
				self.dimension[1]+self.dimension[3]*zoom,
				self.dimension[2]-self.dimension[2]*zoom,
				self.dimension[3]-self.dimension[3]*zoom
				]
				d = [int(i) for i in d]
				render.makeScreenshot(path, *d)
				
		except Exception as E:
			if useDebug:
				print("Warning: Cropping screenshot not supported in this version of Blender", E)
			render.makeScreenshot(path)

		if not silent:
			self.screenshotList.append(path)
			logic.registeredFunctions.append(self.captureScreenVerifier)
Exemplo n.º 2
0
def main():
    cont = logic.getCurrentController()
    own = cont.owner

    F12 = cont.sensors["F12"].positive

    if F12:
        shotname = NameGen() + ".png"
        # put into a screenshots folder
        file = "..\screenshots/%s" % (shotname)

        render.makeScreenshot(file)

        print("screenshot", shotname, "saved.")
def main():
    cont = logic.getCurrentController()
    own = cont.owner

    F12 = cont.sensors["F12"].positive

    if F12:
        shotname = NameGen() + '.png'
        #put into a screenshots folder
        file = '..\screenshots/%s' % (shotname)

        render.makeScreenshot(file)

        print('screenshot', shotname, 'saved.')