diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-09-21 00:41:30 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-09-21 00:43:08 +0300 |
commit | fb88088203ec478f4c06bd4b755d47492246759d (patch) | |
tree | 8661b9acf87afc5eb352c7ff39da6ade07362e91 /source | |
parent | 5e2c032f1a95d4e890f9df371d18681727c2dfe5 (diff) |
Preserve the actively bound framebuffer after using gpu.offscreen
Otherwise we cannot draw anything after drawing in the offscreen buffer
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/gpu/gpu_py_offscreen.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |