disable the readonly state while rna property callbacks run.

This commit is contained in:
2011-06-07 16:08:49 +00:00
parent 53939ee4e9
commit e44ae2c2a9
3 changed files with 19 additions and 0 deletions

View File

@@ -185,9 +185,14 @@ void bpy_prop_update_cb(struct bContext *C, struct PointerRNA *ptr, struct Prope
PyObject *args;
PyObject *self;
PyObject *ret;
const int is_write_ok= pyrna_write_check();
BLI_assert(py_data != NULL);
if(!is_write_ok) {
pyrna_write_set(TRUE);
}
bpy_context_set(C, &gilstate);
py_func= py_data[BPY_DATA_CB_SLOT_UPDATE];
@@ -216,6 +221,10 @@ void bpy_prop_update_cb(struct bContext *C, struct PointerRNA *ptr, struct Prope
}
bpy_context_clear(C, &gilstate);
if(!is_write_ok) {
pyrna_write_set(FALSE);
}
}
static int bpy_prop_callback_check(PyObject *py_func, int argcount)