1 # SPDX-FileCopyrightText: 2009-2023 Blender Authors
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 # Print once every 1000
25 def seek(r
, txt
, recurs
):
30 if not (seek_count
[0] % PRINT_DATA_INT
):
31 print(seek_count
[0], txt
)
38 if recurs
> MAX_RECURSIVE
:
39 # print ("Recursion is over max")
49 if type_r
in {float, int, bool, type(None)}:
51 print(txt
+ ' -> ' + str(r
))
56 print(txt
+ ' -> "' + str(r
) + '"')
66 print(txt
+ '.keys() - ' + str(r
.keys()))
73 for item
in __members__
:
74 if item
.startswith("__"):
78 newtxt
= txt
+ '.' + item
80 if item
== 'rna_type' and VERBOSE_TYPE
is False: # just avoid because it spits out loads of data
83 value
= getattr(r
, item
, None)
85 seek(value
, newtxt
, recurs
+ 1)
90 newtxt
= txt
+ '["' + k
+ '"]'
91 seek(r
.__getitem
__(k
), newtxt
, recurs
+ 1)
99 if VERBOSE
is False and length
>= 4:
100 for i
in (0, length
- 1):
103 print((" " * len(txt
)) + " ... skipping " + str(length
- 2) + " items ...")
106 newtxt
= txt
+ '[' + str(i
) + ']'
107 seek(r
[i
], newtxt
, recurs
+ 1)
109 for i
in range(length
):
111 newtxt
= txt
+ '[' + str(i
) + ']'
112 seek(r
[i
], newtxt
, recurs
+ 1)
115 seek(bpy
.data
, 'bpy.data', 0)
116 # seek(bpy.types, 'bpy.types', 0)
118 for d in dir(bpy.types):
119 t = getattr(bpy.types, d)
122 except AttributeError:
125 seek(r, 'bpy.types.' + d + '.bl_rna', 0)
128 print("iter over ", seek_count
, "rna items")