Merge branch 'master' into blender2.8
[blender.git] / source / blender / python / intern / gpu_offscreen.c
index 3c340d14e3f7792f0c100e7a777ac70abc6dd702..6c16c274234f521c3d56239da987ac182f1f7344 100644 (file)
@@ -162,12 +162,15 @@ PyDoc_STRVAR(pygpu_offscreen_draw_view3d_doc,
 );
 static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *args, PyObject *kwds)
 {
-       static const char *kwlist[] = {"scene", "view3d", "region", "projection_matrix", "modelview_matrix", NULL};
+       /* TODO: This doesn't work currently because of eval_ctx. */
+#if 0
+       static const char *kwlist[] = {"scene", "render_layer", "view3d", "region", "projection_matrix", "modelview_matrix", NULL};
 
        MatrixObject *py_mat_modelview, *py_mat_projection;
-       PyObject *py_scene, *py_region, *py_view3d;
+       PyObject *py_scene, *py_scene_layer, *py_region, *py_view3d;
 
        Scene *scene;
+       SceneLayer *sl;
        View3D *v3d;
        ARegion *ar;
        GPUFX *fx;
@@ -177,11 +180,12 @@ static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *a
        BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
 
        if (!PyArg_ParseTupleAndKeywords(
-               args, kwds, "OOOO&O&:draw_view3d", (char **)(kwlist),
-               &py_scene, &py_view3d, &py_region,
+               args, kwds, "OOOOO&O&:draw_view3d", (char **)(kwlist),
+               &py_scene, &py_scene_layer, &py_view3d, &py_region,
                Matrix_Parse4x4, &py_mat_projection,
                Matrix_Parse4x4, &py_mat_modelview) ||
            (!(scene    = PyC_RNA_AsPointer(py_scene, "Scene")) ||
+            !(sl       = PyC_RNA_AsPointer(py_scene_layer, "SceneLayer")) ||
             !(v3d      = PyC_RNA_AsPointer(py_view3d, "SpaceView3D")) ||
             !(ar       = PyC_RNA_AsPointer(py_region, "Region"))))
        {
@@ -192,14 +196,14 @@ static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *a
 
        fx_settings = v3d->fx_settings;  /* full copy */
 
-       ED_view3d_draw_offscreen_init(scene, v3d);
+       ED_view3d_draw_offscreen_init(scene, sl, v3d);
 
        rv3d_mats = ED_view3d_mats_rv3d_backup(ar->regiondata);
 
        GPU_offscreen_bind(self->ofs, true); /* bind */
 
        ED_view3d_draw_offscreen(
-               scene, v3d, ar, GPU_offscreen_width(self->ofs), GPU_offscreen_height(self->ofs),
+               scene, sl, v3d, ar, GPU_offscreen_width(self->ofs), GPU_offscreen_height(self->ofs),
                (float(*)[4])py_mat_modelview->matrix, (float(*)[4])py_mat_projection->matrix,
                false, true, true, "",
                fx, &fx_settings,
@@ -212,6 +216,10 @@ static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *a
        MEM_freeN(rv3d_mats);
 
        Py_RETURN_NONE;
+#else
+       UNUSED_VARS(self, args, kwds);
+#endif
+       return NULL;
 }
 
 PyDoc_STRVAR(pygpu_offscreen_free_doc,