Operating system: Windows 10 Home 19041
Graphics card: Geforce GTX 1060
Instead of glReadPixels reading from entire screen as seen in 2.8x, it seems like it's more limited in 2.9. Is there a reason for this, and how to map entire window for reading to a buffer?
Exact steps for others to reproduce the error
Here's a test script. Run it and open resulting image - it usually only shows the header of one of the panels and nothing else.
import bpy import bgl import numpy as np myWidth = 500 myHeight = 500 screen_buffer = bgl.Buffer(bgl.GL_FLOAT, [myWidth, myHeight,4]) bgl.glReadPixels(0, 0,myWidth,myHeight,bgl.GL_RGBA,bgl.GL_FLOAT,screen_buffer) channels = np.array(screen_buffer).reshape(myWidth * myHeight * 4) channels[3::4] = 1.0 newImage = bpy.data.images.new(name = 'newImage',width=myWidth,height=myHeight,alpha=True, float_buffer=True) newImage.pixels = channels newImage.pack()