Added utility function to fetching structs by name

This commit is contained in:
Sybren A. Stüvel 2018-07-03 12:34:00 +02:00
parent f7a18ba07d
commit 6edc15594d

View File

@ -397,6 +397,10 @@ class BlendFile:
except KeyError:
raise exceptions.SegmentationFault('address does not exist', address) from None
def struct(self, name: bytes) -> dna.Struct:
index = self.sdna_index_from_id[name]
return self.structs[index]
@functools.total_ordering
class BlendFileBlock: