Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2015-10-27 16:27:26 +0300
committerDalai Felinto <dfelinto@gmail.com>2015-10-27 16:29:21 +0300
commit3f85eeddaa8c6ab076c3d6e59b43d9915bcd9592 (patch)
treefd92cc1861ca06b9a9de34538b88d63d05a254bb /source/blender/python
parent505a31bd22e530825e6abd4ed61b0ad143b14820 (diff)
View3D offscreen buffer was interferring with view navigation
the RegionView3D matrices need to be re-set after drawing. Review and touch ups by Campbell Barton
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/gpu_offscreen.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/intern/gpu_offscreen.c b/source/blender/python/intern/gpu_offscreen.c
index f8285c6139f..ed31ac052c6 100644
--- a/source/blender/python/intern/gpu_offscreen.c
+++ b/source/blender/python/intern/gpu_offscreen.c
@@ -29,6 +29,8 @@
#include <Python.h>
+#include "MEM_guardedalloc.h"
+
#include "BLI_utildefines.h"
#include "WM_types.h"
@@ -200,6 +202,7 @@ static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *a
ARegion *ar;
GPUFX *fx;
GPUFXSettings fx_settings;
+ void *rv3d_mats;
BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
@@ -221,6 +224,8 @@ static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *a
ED_view3d_draw_offscreen_init(scene, v3d);
+ rv3d_mats = ED_view3d_mats_rv3d_backup(ar->regiondata);
+
GPU_offscreen_bind(self->ofs, true); /* bind */
ED_view3d_draw_offscreen(
@@ -233,6 +238,9 @@ static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *a
GPU_fx_compositor_destroy(fx);
GPU_offscreen_unbind(self->ofs, true); /* unbind */
+ ED_view3d_mats_rv3d_restore(ar->regiondata, rv3d_mats);
+ MEM_freeN(rv3d_mats);
+
Py_RETURN_NONE;
}