Upgrade `zstandard` to `0.16`, because that is what's used in the oldest
still-supported Blender (4.2-LTS).
This also upgrades Pytest to 7.4.4 and Pytest-cov to 4.1.0. Still a
conservative upgrade, but at least it gets rid of various deprecation
warnings.
The oldest still-supported version of Blender is 4.2-LTS, which uses
Python 3.11, so that's what's now the required Python version for BAT.
Make the build system depend on `poetry-core` instead of `poetry`, to
make package builds faster (especially important when using Tox for
testing in various environments).
This also re-generates the `poetry.lock` file, so updates the
dependencies to their latest version compatible with the `project.toml`
file.
As addresses typically represented everywhere as hex values.
Before:
```
Biggest ARegion-DATA block is 304 B at address 1585888006560
Finding what points there
<BlendFileBlock.ScrArea (DATA), size=184 at 0x1713e4acd60> (b'regionbase', b'first')
<BlendFileBlock.ARegion (DATA), size=304 at 0x1713e4a9020> b'prev'
```
After:
```
Biggest ARegion-DATA block is 304 B at address 0x1713e4a91a0
Finding what points there
<BlendFileBlock.ScrArea (DATA), size=184 at 0x1713e4acd60> (b'regionbase', b'first')
<BlendFileBlock.ARegion (DATA), size=304 at 0x1713e4a9020> b'prev'
```
Reviewed-on: https://projects.blender.org/blender/blender-asset-tracer/pulls/92900
Extend `Struct.field_set()` so that the `path` type can be a
`dna.FieldPath`, to mirror `Struct.field_get`'s `path` type, and allow
users to set file-block's subproperties. For example this allows
setting `object_block[(b'id', 'name')]`.
Also, along the way, added a test for getting subproperty value.
Reviewed-on: https://projects.blender.org/blender/blender-asset-tracer/pulls/92899
Add an `array_index` parameter to `block.get(property_name)` to get a
specific item from an array.
Example:
```python
verts = self.bf.block_from_addr[verts_ptr]
assert verts.get(b"co") == [-1.0, -1.0, -1.0] # index 0
assert verts.get(b"co", array_index=1) == [-1.0, -1.0, 1.0]
```
Reviewed-on: https://projects.blender.org/blender/blender-asset-tracer/pulls/92898
Add support for geometry node simulation cache files.
This also adds support for dealing with dynamic arrays in Blender's
DNA, because `modifier.bakes` is a pointer to such an array.
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Reviewed-on: https://projects.blender.org/blender/blender-asset-tracer/pulls/92890
BlendFileBlock attributes:
Explicit annotation on BlendFileBlock are needed because otherwise
e.g. `block.add_old` type was imprecisely inferred from the
assignments as `int | Any`, where `Any` comes from `.unpack` returning
`tuple[Any, ...]`.
Ideally unpack should be somehow connected to the returned types, but
this solution should work for now just to avoid typing errors.
dna_io - add some missing annotations:
Some annotations were needed to ensure `block.code` will be inferred
as `bytes` and not `bytes | Unknown`.
Reviewed-on: https://projects.blender.org/blender/blender-asset-tracer/pulls/92897
Reviewed-by: Sybren A. Stüvel <sybren@blender.org>
There was an error running `twine check` (`KeyError: 'license'`) that was
fixed by upgrading to 5.0. This version was chosen as it's the one in
the current Ubuntu LTS release.
This is mostly the same as blender/blender!140195. The header parsing code has
been updated to be able to read old and new .blend file headers.
There is a new test file which is the same as the existing `basic_file.blend`,
but saved with the new header format. A new unit test has been added to check
that this file is read correctly as well.
Pull Request: https://projects.blender.org/blender/blender-asset-tracer/pulls/92893
Add support for the Dynamic Paint modifier point cache.
I added a walker to iterate through all surfaces on a canvas to get each surface's point cache.
Reviewed-on: https://projects.blender.org/blender/blender-asset-tracer/pulls/92889
Reviewed-by: Sybren A. Stüvel <sybren@blender.org>
Allows to use `python3 path/to/cli.py my args` just from source code,
without requiring to set up a whole venv for that. Much simpler when
only 'regular' debuging in code logic itself is needed.