Merge branch 'master' into blender2.8
[blender.git] / intern / cycles / blender / blender_python.cpp
index 792597cbad5a2e2738c094a9e2381f2c5783bba7..9ade27d57d76aab7b3895ae6e00b74cb9c7502bd 100644 (file)
@@ -203,10 +203,10 @@ static PyObject *exit_func(PyObject * /*self*/, PyObject * /*args*/)
 
 static PyObject *create_func(PyObject * /*self*/, PyObject *args)
 {
-       PyObject *pyengine, *pyuserpref, *pydata, *pyscene, *pyregion, *pyv3d, *pyrv3d;
+       PyObject *pyengine, *pyuserpref, *pydata, *pygraph, *pyscene, *pyregion, *pyv3d, *pyrv3d;
        int preview_osl;
 
-       if(!PyArg_ParseTuple(args, "OOOOOOOi", &pyengine, &pyuserpref, &pydata, &pyscene,
+       if(!PyArg_ParseTuple(args, "OOOOOOOOi", &pyengine, &pyuserpref, &pydata, &pygraph, &pyscene,
                             &pyregion, &pyv3d, &pyrv3d, &preview_osl))
        {
                return NULL;
@@ -225,6 +225,10 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
        RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr);
        BL::BlendData data(dataptr);
 
+       PointerRNA graphptr;
+       RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pygraph), &graphptr);
+       BL::Depsgraph graph(graphptr);
+
        PointerRNA sceneptr;
        RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pyscene), &sceneptr);
        BL::Scene scene(sceneptr);
@@ -249,7 +253,7 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
                int width = region.width();
                int height = region.height();
 
-               session = new BlenderSession(engine, userpref, data, scene, v3d, rv3d, width, height);
+               session = new BlenderSession(engine, userpref, data, graph, scene, v3d, rv3d, width, height);
        }
        else {
                /* override some settings for preview */
@@ -261,7 +265,7 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
                }
 
                /* offline session or preview render */
-               session = new BlenderSession(engine, userpref, data, scene);
+               session = new BlenderSession(engine, userpref, data, graph, scene);
        }
 
        python_thread_state_save(&session->python_thread_state);
@@ -327,9 +331,9 @@ static PyObject *bake_func(PyObject * /*self*/, PyObject *args)
 
 static PyObject *draw_func(PyObject * /*self*/, PyObject *args)
 {
-       PyObject *pysession, *pyv3d, *pyrv3d;
+       PyObject *pysession, *pygraph, *pyv3d, *pyrv3d;
 
-       if(!PyArg_ParseTuple(args, "OOO", &pysession, &pyv3d, &pyrv3d))
+       if(!PyArg_ParseTuple(args, "OOOO", &pysession, &pygraph, &pyv3d, &pyrv3d))
                return NULL;
        
        BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);