In an add-on I'm developing, I'd like to draw elements (using the GPU module) to a N-key panel. I've looked extensively, but I haven't found a correct answer.
https://blender.stackexchange.com/a/155692/23372 In the "Hard Way" section, it shows a way to draw an image to the screen, but it draws it to the Properties panel, which is not a desired effect.
Is there a way to make elements show/hide (when panels are shown/hidden) and move (when panels are rearranged and not have a fixed position)?
I've seen this done a lot in the node editor (see https://blendermarket.com/products/node-preview, https://docs.animation-nodes.com/release_notes/v2_0/interpolation/#mix-interpolation (with the Interpolation Viewer node)).
Can this be achieved using the N-key panel?

glScissorcan cut the drawing area according to the given position. Unfortunately, I can't figure out how to get the current category. – X Y Aug 06 '22 at 08:58