[#20288] FBX exporter fails

* disallow registering operators that have properties starting with an underscore which caused this problem.
This commit is contained in:
2009-12-11 00:51:14 +00:00
parent 98dff9b1c7
commit cff8de339d
2 changed files with 14 additions and 10 deletions

View File

@@ -3719,11 +3719,15 @@ static int deferred_register_prop(StructRNA *srna, PyObject *item, PyObject *key
if(PyTuple_CheckExact(item) && PyTuple_GET_SIZE(item)==2) {
PyObject *py_func_ptr, *py_kw, *py_srna_cobject, *py_ret;
PyObject *(*pyfunc)(PyObject *, PyObject *, PyObject *);
if(PyArg_ParseTuple(item, "O!O!", &PyCObject_Type, &py_func_ptr, &PyDict_Type, &py_kw)) {
PyObject *(*pyfunc)(PyObject *, PyObject *, PyObject *);
if(*_PyUnicode_AsString(key)=='_') {
PyErr_Format(PyExc_ValueError, "StructRNA \"%.200s\" registration error: %.200s could not register because the property starts with an '_'\n", RNA_struct_identifier(srna), _PyUnicode_AsString(key));
Py_DECREF(dummy_args);
return -1;
}
pyfunc = PyCObject_AsVoidPtr(py_func_ptr);
py_srna_cobject = PyCObject_FromVoidPtr(srna, NULL);