Cycles: Initialize "headless" flags on engine initialization
This flag is global for all the sessions and never changes. so it doesn't really make sense to pass it around to all sessions and synchronization routines. Switched to a static member of BlenderSession now, but it's probably more logical to introduce some sort of BlenderGlobals. Doesn't currently worth a hassle for a single boolean flag tho.
This commit is contained in:
@@ -73,8 +73,9 @@ static const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
|
||||
static PyObject *init_func(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *path, *user_path;
|
||||
int headless;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "OO", &path, &user_path)) {
|
||||
if(!PyArg_ParseTuple(args, "OOi", &path, &user_path, &headless)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -84,16 +85,18 @@ static PyObject *init_func(PyObject *self, PyObject *args)
|
||||
Py_XDECREF(path_coerce);
|
||||
Py_XDECREF(user_path_coerce);
|
||||
|
||||
BlenderSession::headless = headless;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject *create_func(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *pyengine, *pyuserpref, *pydata, *pyscene, *pyregion, *pyv3d, *pyrv3d;
|
||||
int preview_osl, headless;
|
||||
int preview_osl;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "OOOOOOOii", &pyengine, &pyuserpref, &pydata, &pyscene,
|
||||
&pyregion, &pyv3d, &pyrv3d, &preview_osl, &headless))
|
||||
if(!PyArg_ParseTuple(args, "OOOOOOOi", &pyengine, &pyuserpref, &pydata, &pyscene,
|
||||
&pyregion, &pyv3d, &pyrv3d, &preview_osl))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -147,7 +150,7 @@ static PyObject *create_func(PyObject *self, PyObject *args)
|
||||
}
|
||||
|
||||
/* offline session or preview render */
|
||||
session = new BlenderSession(engine, userpref, data, scene, headless);
|
||||
session = new BlenderSession(engine, userpref, data, scene);
|
||||
}
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
|
||||
Reference in New Issue
Block a user