Cycles: add function to clear resumable chunk
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 10 May 2019 21:32:58 +0000 (23:32 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 10 May 2019 21:45:51 +0000 (23:45 +0200)
intern/cycles/blender/blender_python.cpp

index ffd1c70..3ab8c8b 100644 (file)
@@ -937,6 +937,15 @@ static PyObject *set_resumable_chunk_range_func(PyObject * /*self*/, PyObject *a
   Py_RETURN_NONE;
 }
 
+static PyObject *clear_resumable_chunk_func(PyObject * /*self*/, PyObject * /*value*/)
+{
+  VLOG(1) << "Clear resumable render";
+  BlenderSession::num_resumable_chunks = 0;
+  BlenderSession::current_resumable_chunk = 0;
+
+  Py_RETURN_NONE;
+}
+
 static PyObject *enable_print_stats_func(PyObject * /*self*/, PyObject * /*args*/)
 {
   BlenderSession::print_render_stats = true;
@@ -992,6 +1001,7 @@ static PyMethodDef methods[] = {
     /* Resumable render */
     {"set_resumable_chunk", set_resumable_chunk_func, METH_VARARGS, ""},
     {"set_resumable_chunk_range", set_resumable_chunk_range_func, METH_VARARGS, ""},
+    {"clear_resumable_chunk", clear_resumable_chunk_func, METH_NOARGS, ""},
 
     /* Compute Device selection */
     {"get_device_types", get_device_types_func, METH_VARARGS, ""},