diff --git a/blender_asset_tracer/blendfile/__init__.py b/blender_asset_tracer/blendfile/__init__.py index ffae9b5..4ecf343 100644 --- a/blender_asset_tracer/blendfile/__init__.py +++ b/blender_asset_tracer/blendfile/__init__.py @@ -102,9 +102,9 @@ class BlendFile: self.sdna_index_from_id = {} self.block_from_addr = {} - self.load_dna1_block() + self._load_blocks() - def load_dna1_block(self): + def _load_blocks(self): """Read the blend file to load its DNA structure to memory.""" while True: block = BlendFileBlock(self) @@ -118,14 +118,12 @@ class BlendFile: self.blocks.append(block) self.code_index[block.code].append(block) + self.block_from_addr[block.addr_old] = block if not self.structs: raise exceptions.NoDNA1Block("No DNA1 block in file, not a valid .blend file", self.filepath) - self.block_from_addr = {block.addr_old: block for block in self.blocks - if block.code != b'ENDB'} - def __repr__(self): clsname = self.__class__.__qualname__ if self.filepath == self.raw_filepath: