Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/api2_2x/Window.c')
-rw-r--r--source/blender/python/api2_2x/Window.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c
index 9acf91211f4..ab014977468 100644
--- a/source/blender/python/api2_2x/Window.c
+++ b/source/blender/python/api2_2x/Window.c
@@ -765,17 +765,20 @@ static PyObject *M_Window_GetViewMatrix(PyObject *self)
static PyObject *M_Window_EditMode(PyObject *self, PyObject *args)
{
short status = -1;
+ char *undo_str = "From script";
+ int undo_str_len = 11;
- if (!PyArg_ParseTuple(args, "|h", &status))
+ if (!PyArg_ParseTuple(args, "|hs#", &status, &undo_str, &undo_str_len))
return EXPP_ReturnPyObjError (PyExc_TypeError,
- "expected nothing or an int (bool) as argument");
+ "expected nothing or an int (bool) and a string as arguments");
if (status >= 0) {
if (status) {
if (!G.obedit) enter_editmode();
}
else if (G.obedit) {
- undo_push_mesh("From script"); /* use better solution after 2.34 */
+ if (undo_str_len > 63) undo_str[63] = '\0'; /* 64 is max */
+ undo_push_mesh(undo_str); /* use better solution after 2.34 */
exit_editmode(1);
}
}