2.5: Python operators now have a working poll() function,

solved by wrapping all polling in WM_operator_poll and
adding a special callback for python.
This commit is contained in:
2009-09-18 13:02:20 +00:00
parent 854ea35a24
commit 26836bf44f
10 changed files with 39 additions and 33 deletions

View File

@@ -65,7 +65,7 @@ static PyObject *pyop_call( PyObject * self, PyObject * args)
return NULL;
}
if(ot->poll && (ot->poll(C) == FALSE)) {
if(WM_operator_poll((bContext*)C, ot) == FALSE) {
PyErr_SetString( PyExc_SystemError, "bpy.__ops__.call: operator poll() function failed, context is incorrect");
return NULL;
}