2018-02-27 17:30:28 +01:00

11 lines
346 B
Python

from . import BlendFileBlock
from .dna import FieldPath
def listbase(block: BlendFileBlock, next_path: FieldPath=b'next') -> BlendFileBlock:
"""Generator, yields all blocks in the ListBase linked list."""
while block:
yield block
next_ptr = block[next_path]
block = block.bfile.find_block_from_address(next_ptr)