Improved BFB.set() a bit, not yet tested at all.

This commit is contained in:
Sybren A. Stüvel 2018-02-23 12:24:26 +01:00
parent 934a8e210e
commit efc60f437b

View File

@ -441,15 +441,11 @@ class BlendFileBlock:
hsh = zlib.adler32(str(v).encode(), hsh) hsh = zlib.adler32(str(v).encode(), hsh)
return hsh return hsh
def set(self, path, value, def set(self, path: dna.FieldPath, value): # TODO(Sybren): port to BAT
sdna_index_refine=None, dna_struct = self.bfile.structs[self.sdna_index]
): # TODO(Sybren): port to BAT self.bfile.fileobj.seek(self.file_offset, os.SEEK_SET)
dna_struct = self._get_struct(sdna_index_refine)
self.bfile.handle.seek(self.file_offset, os.SEEK_SET)
self.bfile.is_modified = True self.bfile.is_modified = True
return dna_struct.field_set( return dna_struct.field_set(self.bfile.header, self.bfile.fileobj, path, value)
self.bfile.header, self.bfile.handle, path, value)
def get_pointer( def get_pointer(
self, path: dna.FieldPath, self, path: dna.FieldPath,