Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_operator.c
| Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | PyErr_Format(PyExc_TypeError, | ||||
| opname, Py_TYPE(context_dict)->tp_name); | opname, Py_TYPE(context_dict)->tp_name); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| context_dict_back = CTX_py_dict_get(C); | context_dict_back = CTX_py_dict_get(C); | ||||
| CTX_py_dict_set(C, (void *)context_dict); | CTX_py_dict_set(C, (void *)context_dict); | ||||
| Py_XINCREF(context_dict); /* so we done loose it */ | Py_XINCREF(context_dict); /* so we done loose it */ | ||||
| /* main purpose of thsi function */ | /* main purpose of this function */ | ||||
| ret = WM_operator_poll_context((bContext *)C, ot, context) ? Py_True : Py_False; | ret = WM_operator_poll_context((bContext *)C, ot, context) ? Py_True : Py_False; | ||||
| /* restore with original context dict, probably NULL but need this for nested operator calls */ | /* restore with original context dict, probably NULL but need this for nested operator calls */ | ||||
| Py_XDECREF(context_dict); | Py_XDECREF(context_dict); | ||||
| CTX_py_dict_set(C, (void *)context_dict_back); | CTX_py_dict_set(C, (void *)context_dict_back); | ||||
| return Py_INCREF_RET(ret); | return Py_INCREF_RET(ret); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 359 Lines • Show Last 20 Lines | |||||