[UPBGE0.36]Taking Screenshot

Опубликовано: 19 Май 2026
на канале: Blender [BGE] (Light Rays Underwater)
69
5

Download .blends' files
https://drive.google.com/drive/folder...


import bge

def take_screenshot():
Get the current scene and the object with the property
cont = bge.logic.getCurrentController()
obj = cont.owner

Initialize the screenshot counter if it doesn't exist
if "screenshot_count" not in obj:
obj["screenshot_count"] = 1

Set the file path and name for the screenshot, incrementing the counter each time
screenshot_number = obj["screenshot_count"]
file_path = f"//screenshot_{screenshot_number}.png" # saves to the same directory as your .blend file
bge.render.makeScreenshot(file_path)
print(f"Screenshot saved at {file_path}")

Increment the screenshot count for the next screenshot
obj["screenshot_count"] += 1

Call the function
take_screenshot()