Hello,
I am trying to make a screenshot of the displayed scene, so I tried three solutions I found in this forum.
The problem is, I don’t get the expected result:
- Solution #1 and #3: I obtain an image with my main menu (pixel2d) even if I called the method to close it before. So it seems the saved image doesn’t represent the latest state of the buffer.
- Solution #2: I obtain an image without my main menu (pixel2d), but the image is way too dark compared to what I see on screen
I also tried this (https://discourse.panda3d.org/t/asynchronous-screenshot-grabbing/29024) but I get a python exception, so I assume this option is not yet in the latest stable release.
First one (https://discourse.panda3d.org/t/headless-screenshots/5819/2):
direct.showbase.ShowBase.ShowBase.screenshot(self.main,
defaultFilename=False,
namePrefix=fullpath)
Second one (https://discourse.panda3d.org/t/offscreen-screenshot-with-background-image/28563):
direct.showbase.ShowBase.ShowBase.screenshot(self.main,
source=self.main.camNode.getDisplayRegion(0),
defaultFilename=False,
namePrefix=fullpath)
Third one (https://discourse.panda3d.org/t/taking-screenshots-in-a-thread/12413):
screenshot = self.main.win.getScreenshot()
screenshot.write(fullpath)
Is there another method to get clean screenshots?
Thanks for your help!