def rna_backup_gen(data, include_props=None, exclude_props=None, root=()):
# only writable properties...
for p in data.bl_rna.properties:
pid = p.identifier
if pid in {'rna_type', }:
continue
path = root + (pid,)
if include_props is not None and path not in include_props:
continue
if exclude_props is not None and path in exclude_props:
continue
val = getattr(data, pid)
if val is not None and p.type == 'POINTER':
# recurse!
yield from rna_backup_gen(val, include_props, exclude_props, root=path)
elif data.is_property_readonly(pid):
continue
else:
yield path, val
评论列表
文章目录