Commit Graph

13 Commits (master)

Author SHA1 Message Date
Josiah a05118462e
improve block loading 2021-07-25 16:04:47 -05:00
Josiah 8eb543155c
clarify error messages
The old error messages displayed valid values as unicode strings, but the displayed actual value was in bytes. The new error messages display the valid values as bytes now to avoid confusion.
2021-07-24 23:12:35 -05:00
Josiah 32ddaaf109
improve header loading
The header is now loaded according to a struct, and all of its fields are validated. The same commit also changes BlendStruct to subclass collections.abc.Mapping.
2021-07-24 23:07:18 -05:00
Josiah c618ab5d35
it's messy but it works
Implement construction of integer values and characters. One-dimensional arrays are handled but are not constructed. I've also added an inspect() method to the BlendStruct class, which prints a nicely formatted dict with json.
2021-07-24 18:24:03 -05:00
Josiah 6739b9d471
add BlendStruct
The BlendStruct class handles the representation of a blender structure, which may be loaded or unloaded, and which may contain nested blend structs. This allows for loading specific structures in the tree to save memory.
2021-07-24 11:03:44 -05:00
Josiah a1d8ba6b8e
load SDNA structures 2021-07-23 08:37:59 -05:00
Josiah 01c051ce14
fix offset bug
The offset was being read after the block code, causing the offset to be off by 4 bytes.
2021-07-22 17:13:30 -05:00
Josiah 0ded5249d8
stub block loading functions 2021-07-22 16:47:27 -05:00
archfan eb971d6905
Merge pull request #1 from JosiahWI/main
Offset caching for file blocks
2021-07-19 16:36:58 +00:00
Josiah 07fb196f30
implement block offset cache 2021-07-19 11:30:08 -05:00
Josiah 53e099e63b
subclass FileIO
Blendfile is essentially a wrapper on top of io.FileIO, and besides the high level commands it adds, it also needs to open and close the underlying stream properly. It is logical to subclass io.FileIO, and makes it very convenient to use the wrapper. I am not sure whether allowing users to read from the underlying object is a good idea, but it shouldn't effect the behavior of the high level API.
2021-07-19 10:50:43 -05:00
archfan ad74f53617
Add blendparse.py 2021-07-17 22:03:38 +00:00
archfan f2bf112ff9
Initial commit 2021-07-17 22:01:29 +00:00