Removed find_block_from_address() in favour of dereference_pointer()
This commit is contained in:
parent
9c9323b170
commit
9af913d69a
@ -229,15 +229,6 @@ class BlendFile:
|
|||||||
assert isinstance(code, bytes)
|
assert isinstance(code, bytes)
|
||||||
return self.code_index[code]
|
return self.code_index[code]
|
||||||
|
|
||||||
def find_block_from_address(self, address: int) -> typing.Optional['BlendFileBlock']:
|
|
||||||
"""Return the block at that address, or None if not found.
|
|
||||||
|
|
||||||
:param address: the BlendFileBlock.addr_old value
|
|
||||||
"""
|
|
||||||
# TODO(Sybren): mark as deprecated in favour of dereference_pointer().
|
|
||||||
assert type(address) is int
|
|
||||||
return self.block_from_addr.get(address)
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
"""Close the blend file.
|
"""Close the blend file.
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,9 @@ def listbase(block: BlendFileBlock, next_path: FieldPath = b'next') \
|
|||||||
while block:
|
while block:
|
||||||
yield block
|
yield block
|
||||||
next_ptr = block[next_path]
|
next_ptr = block[next_path]
|
||||||
block = block.bfile.find_block_from_address(next_ptr)
|
if next_ptr == 0:
|
||||||
|
break
|
||||||
|
block = block.bfile.dereference_pointer(next_ptr)
|
||||||
|
|
||||||
|
|
||||||
def sequencer_strips(sequence_editor: BlendFileBlock) \
|
def sequencer_strips(sequence_editor: BlendFileBlock) \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user