From fb88088203ec478f4c06bd4b755d47492246759d Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 20 Sep 2018 21:41:30 +0000 Subject: Preserve the actively bound framebuffer after using gpu.offscreen Otherwise we cannot draw anything after drawing in the offscreen buffer --- source/blender/python/gpu/gpu_py_offscreen.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/python') diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c index fc1bc274845..866a98bbb9f 100644 --- a/source/blender/python/gpu/gpu_py_offscreen.c +++ b/source/blender/python/gpu/gpu_py_offscreen.c @@ -227,6 +227,8 @@ static PyObject *bpygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *a rv3d_mats = ED_view3d_mats_rv3d_backup(ar->regiondata); + GPUFrameBuffer *active = GPU_framebuffer_active_get(); + GPU_offscreen_bind(self->ofs, true); /* bind */ ED_view3d_draw_offscreen(depsgraph, @@ -246,6 +248,7 @@ static PyObject *bpygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *a NULL); GPU_offscreen_unbind(self->ofs, true); /* unbind */ + GPU_framebuffer_bind(active); ED_view3d_mats_rv3d_restore(ar->regiondata, rv3d_mats); MEM_freeN(rv3d_mats); -- cgit v1.2.3