Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_rna.c
| Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | |||||
| #ifdef USE_PEDANTIC_WRITE | #ifdef USE_PEDANTIC_WRITE | ||||
| static bool rna_disallow_writes = false; | static bool rna_disallow_writes = false; | ||||
| static bool rna_id_write_error(PointerRNA *ptr, PyObject *key) | static bool rna_id_write_error(PointerRNA *ptr, PyObject *key) | ||||
| { | { | ||||
| ID *id = ptr->id.data; | ID *id = ptr->id.data; | ||||
| if (id) { | if (id) { | ||||
| const short idcode = GS(id->name); | const short idcode = GS(id->name); | ||||
| if (!ELEM(idcode, ID_WM, ID_SCR)) { /* may need more added here */ | if (!ELEM(idcode, ID_WM, ID_SCR, ID_WS)) { /* may need more added here */ | ||||
| const char *idtype = BKE_idcode_to_name(idcode); | const char *idtype = BKE_idcode_to_name(idcode); | ||||
| const char *pyname; | const char *pyname; | ||||
| if (key && PyUnicode_Check(key)) pyname = _PyUnicode_AsString(key); | if (key && PyUnicode_Check(key)) pyname = _PyUnicode_AsString(key); | ||||
| else pyname = "<UNKNOWN>"; | else pyname = "<UNKNOWN>"; | ||||
| /* make a nice string error */ | /* make a nice string error */ | ||||
| BLI_assert(idtype != NULL); | BLI_assert(idtype != NULL); | ||||
| PyErr_Format(PyExc_AttributeError, | PyErr_Format(PyExc_AttributeError, | ||||
| ▲ Show 20 Lines • Show All 7,833 Lines • Show Last 20 Lines | |||||