diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-28 01:41:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-28 01:41:17 +0400 |
commit | a09feb738627abfce71026352214e1512d40bcb8 (patch) | |
tree | 8557089d05d3fddd12b69d96f33cb0ac98d34c83 /source/blender/python/intern | |
parent | d30c7356b7a3d9db803c227617a784dee7054371 (diff) |
option so operators can be executed with undo enabled (and redo).
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 10562271941..7375ad454a0 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -147,6 +147,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) /* note that context is an int, python does the conversion in this case */ int context = WM_OP_EXEC_DEFAULT; + int is_undo = FALSE; /* XXX Todo, work out a better solution for passing on context, * could make a tuple from self and pack the name and Context into it... */ @@ -157,7 +158,8 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) return NULL; } - if (!PyArg_ParseTuple(args, "sO|O!s:_bpy.ops.call", &opname, &context_dict, &PyDict_Type, &kw, &context_str)) + if (!PyArg_ParseTuple(args, "sO|O!si:_bpy.ops.call", + &opname, &context_dict, &PyDict_Type, &kw, &context_str, &is_undo)) return NULL; ot = WM_operatortype_find(opname, TRUE); @@ -236,7 +238,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) PyThreadState *ts = PyEval_SaveThread(); #endif - operator_ret = WM_operator_call_py(C, ot, context, &ptr, reports); + operator_ret = WM_operator_call_py(C, ot, context, &ptr, reports, is_undo); #ifdef BPY_RELEASE_GIL /* regain GIL */ |