Refactor depsgraph/render logic to serve evaluated depsgraph to engines
User notes ---------- Compositing, rendering of multi-layers in Eevee should be fully working now. Development notes ----------------- Up until now we were still using the same depsgraph for rendering and viewport evaluation. And we had to go out of our ways to be sure the depsgraphs were updated. Now we iterate over the (to be rendered) view layers and create a depsgraph to each one, fully evaluated and call the render engines (Cycles, Eevee, ...) with this viewlayer/depsgraph/evaluation context. At this time we are not handling data persistency, Depsgraph is created from scratch prior to rendering each frame. So I got rid of most of the partial update calls we had during the render pipeline. Cycles: Brecht Van Lommel did a patch to tackle some of the required Cycles changes but this commit mark these changes as TODOs. Basically Cycles needs to render one layer at a time. Reviewers: sergey, brecht Differential Revision: https://developer.blender.org/D3073
This commit is contained in:
@@ -203,10 +203,10 @@ static PyObject *exit_func(PyObject * /*self*/, PyObject * /*args*/)
|
||||
|
||||
static PyObject *create_func(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
PyObject *pyengine, *pyuserpref, *pydata, *pygraph, *pyscene, *pyregion, *pyv3d, *pyrv3d;
|
||||
PyObject *pyengine, *pyuserpref, *pydata, *pyscene, *pyregion, *pyv3d, *pyrv3d;
|
||||
int preview_osl;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "OOOOOOOOi", &pyengine, &pyuserpref, &pydata, &pygraph, &pyscene,
|
||||
if(!PyArg_ParseTuple(args, "OOOOOOOi", &pyengine, &pyuserpref, &pydata, &pyscene,
|
||||
&pyregion, &pyv3d, &pyrv3d, &preview_osl))
|
||||
{
|
||||
return NULL;
|
||||
@@ -225,10 +225,6 @@ 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);
|
||||
@@ -253,7 +249,7 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
|
||||
int width = region.width();
|
||||
int height = region.height();
|
||||
|
||||
session = new BlenderSession(engine, userpref, data, graph, scene, v3d, rv3d, width, height);
|
||||
session = new BlenderSession(engine, userpref, data, scene, v3d, rv3d, width, height);
|
||||
}
|
||||
else {
|
||||
/* override some settings for preview */
|
||||
@@ -265,7 +261,7 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
|
||||
}
|
||||
|
||||
/* offline session or preview render */
|
||||
session = new BlenderSession(engine, userpref, data, graph, scene);
|
||||
session = new BlenderSession(engine, userpref, data, scene);
|
||||
}
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
|
||||
Reference in New Issue
Block a user