Save a modified in game texture to your drive

So, I’ve been playing around, and made a camera, that can take pictures. It saves them over images in game. I’ts pretty neat; I can make the pictures print out and fall to the flooor.

Anyway, anyone know how (if possible) I could make it save the modified images to the physical drive? They’re already over-writing dedicated textures in the game. If there was a “save image” like there is in the viewport outside the game, that’s all I would need.


You can write images to a big buffer, using image plot, and we can save / load with pil and bgl together

I wouldn’t even begin to know where to start with that.

I don’t know what big buffer, image plot or pil means. :stuck_out_tongue:

Could you explain further? It sounds interesting.

Anyone else? Can you save images from in game to the drive? Basically a print screen button, but it over-writes a specific pre-existing image with a new one.

screenshots.blend (112.3 KB)
maybe this help you - if you need save screenshots in hard disk - add to name shot numbers in end or replace script - for recording and assign path for you folders (//folder1/folder2/fodler_images)

Unbelievably simple. I love it. Thank you man, this is exactly what I needed!

Thank you for taking the time to put this together.

Don’t thank me - I wrote this example for my friend a long time ago - he also needed to save screenshots, and I just added a counter for frames so that images from the game were saved in the right amount and one single image was not overwritten

1 Like

Wait, one last question. How can I make it take a screenshot from a specific camera, not from the main camera? I want it to see through the physical, in-game, CannonM50 style camera, not the viewport camera.

you can always get the camera you need - through the scene objects or through the camera switching actuator - if you need to do this with a script - you can write after the condition -
if mouse_left_button.positive:
camera = scene.objects[‘Camera_Photo’]
scene.active_camera = camera

here function screenshot recording

player_camera = scene.objects[‘Camera_Player’]
scene.active_camera = player_camera