Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-09-01 10:02:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-09-01 10:02:51 +0300
commitc78c4252669a83c90188d90df6089f6e3a7b31c6 (patch)
tree5c103b00bca72751d654479333a13ef56673e663 /source/blender/python/intern
parent06ba233374dc9f3dfd2efb904d067abc9f04e3de (diff)
PyAPI: expose 'bl_options' for operators in bpy.ops
Useful for checking which operators are only for internal use.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r--source/blender/python/intern/bpy_operator.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 274c1934e9e..6d86d788644 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -436,12 +436,22 @@ static PyObject *pyop_getrna_type(PyObject *UNUSED(self), PyObject *value)
return (PyObject *)pyrna;
}
+static PyObject *pyop_get_bl_options(PyObject *UNUSED(self), PyObject *value)
+{
+ wmOperatorType *ot;
+ if ((ot = ot_lookup_from_py_string(value, "get_bl_options")) == NULL) {
+ return NULL;
+ }
+ return pyrna_enum_bitfield_to_py(rna_enum_operator_type_flag_items, ot->flag);
+}
+
static struct PyMethodDef bpy_ops_methods[] = {
{"poll", (PyCFunction)pyop_poll, METH_VARARGS, NULL},
{"call", (PyCFunction)pyop_call, METH_VARARGS, NULL},
{"as_string", (PyCFunction)pyop_as_string, METH_VARARGS, NULL},
{"dir", (PyCFunction)pyop_dir, METH_NOARGS, NULL},
{"get_rna_type", (PyCFunction)pyop_getrna_type, METH_O, NULL},
+ {"get_bl_options", (PyCFunction)pyop_get_bl_options, METH_O, NULL},
{"macro_define", (PyCFunction)PYOP_wrap_macro_define, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL},
};