diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-01 03:32:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-01 03:32:50 +0300 |
commit | 11d61383fa446b53794c9800ba24f4ecc8a8bcfd (patch) | |
tree | 16a888825ad61e85931865aabf9ffb054cd4b93d /source/blender/python/intern/bpy_operator.c | |
parent | e8f7f42c1d8421d8112d9f9c67b8cb4ed231877e (diff) |
workaround [#25845] Empty UI panels
- now writing to RNA is disabled when inside render() call.
- disallow calling operators when writes are disabled.
Rendering runs in a thread so running operators from the thread is not safe unless rendering becomes a blocking operator again.
Diffstat (limited to 'source/blender/python/intern/bpy_operator.c')
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index d5446b11349..2130dd60f12 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -138,6 +138,11 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) return NULL; } + if(!pyrna_write_check()) { + PyErr_Format(PyExc_SystemError, "Calling operator \"bpy.ops.%s\" error, can't modify blend data in this state (drawing/rendering)", opname); + return NULL; + } + if(context_str) { if(RNA_enum_value_from_id(operator_context_items, context_str, &context)==0) { char *enum_str= BPy_enum_as_string(operator_context_items); |