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>2021-04-23 10:05:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-04-23 10:25:49 +0300
commitdc1e98d8a041e161a7bbda97cfac3df57d0ff320 (patch)
tree577c1049869473dac127b14735d3054bc3019bec
parent0817763624dbcb095dd172910cc39144f840e19c (diff)
Fix T86765: Custom properties are included in `__dir__`
Remove custom properties from `__dir__` method result since these can't be accessed using `__getattr__`. Introduced in the 2.5x Python API update.
-rw-r--r--source/blender/python/intern/bpy_rna.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index b9ab0ce4c29..354aa9b6986 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -4207,6 +4207,10 @@ static void pyrna_dir_members_rna(PyObject *list, PointerRNA *ptr)
iterprop = RNA_struct_iterator_property(ptr->type);
RNA_PROP_BEGIN (ptr, itemptr, iterprop) {
+ /* Custom-properties are exposed using `__getitem__`, exclude from `__dir__`. */
+ if (RNA_property_is_idprop(itemptr.data)) {
+ continue;
+ }
nameptr = RNA_struct_name_get_alloc(&itemptr, name, sizeof(name), &namelen);
if (nameptr) {