From 636baa598a5698d84eca89d17c67a74092cef4d0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 31 Aug 2017 23:32:21 +1000 Subject: RNA: Limit which classes struct-map contains Only add subclasses of: Menu, Panel, Header, UIList, Operator This helps avoid unnecessary naming collisions, See T52599 for details --- source/blender/python/intern/bpy_operator_wrap.c | 2 +- source/blender/python/intern/bpy_rna.c | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'source/blender/python/intern') diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 9d57adca946..3afde45195c 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -53,7 +53,7 @@ static void operator_properties_init(wmOperatorType *ot) * * Note the 'no_struct_map' function is used since the actual struct name is already used by the operator. */ - RNA_def_struct_identifier_no_struct_map(ot->srna, ot->idname); + RNA_def_struct_identifier(&BLENDER_RNA, ot->srna, ot->idname); if (pyrna_deferred_register_class(ot->srna, py_class) != 0) { PyErr_Print(); /* failed to register operator props */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index afc082db3d5..dfd643319e5 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -6927,15 +6927,7 @@ static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self) RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) { StructRNA *srna = itemptr.data; - StructRNA *srna_base = RNA_struct_base(itemptr.data); - /* skip own operators, these double up [#29666] */ - if (srna_base == &RNA_Operator) { - /* do nothing */ - } - else { - /* add to python list */ - PyList_APPEND(ret, PyUnicode_FromString(RNA_struct_identifier(srna))); - } + PyList_APPEND(ret, PyUnicode_FromString(RNA_struct_identifier(srna))); } RNA_PROP_END; -- cgit v1.2.3