Stored undo step data for position changes in sculpt mode are now
automatically compressed. Compression is run in background threads,
reducing memory consumption during sculpting sessions while adding
little performance overhead.
For testing and benchmarks, memory usage is now available through
`bpy.app.undo_memory_info()`. Undo memory usage is now tracked by the
existing automated benchmark tests. Some changes to the web benchmark
visualization present the data a bit better.
ZSTD compression is run asynchronously in a backround task pool.
Compression is only blocking if the data is requested immediately for
undo/redo.
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/141310
Improve handling of runtime defined python RNA properties. Mainly:
* Add `get_transform` and `set_transform` new callbacks.
These allow to edit the value, while still using the default
(IDProperty-based) storage system.
* Read-only properties should now be defined using a new `options` flag,
`READ_ONLY`.
* `get`/`set` should only be used when storing data outside of the
default system now.
* Having a `get` without a `set` defined forces property to be
read-only (same behavior as before).
* Having a `set` without a `get` is now an error.
* Just like with existing `get/set` callbacks, `get_/set_transform`
callbacks must always generate values matching the constraints defined
by their `bpy.props` property definition (same type, within required
range, same dimensions/sizes for the `Vector` properties, etc.).
* To simplify handling of non-statically sized strings, the relevant
RNA API has been modified, to use `std::string` instead of
(allocated) char arrays.
Relevant unittests and benchmarking have been added or updated as part
of this project.
Note: From initial benchmarking, 'transform' versions of get/set are
several times faster than 'real' get/set.
Implements #141042.
Pull Request: https://projects.blender.org/blender/blender/pulls/141303
Update the call signature in the docstring so that it is clear that the
arguments to `bpy.data.user_map()` are all optional:
```
.. method:: user_map(*, subset=None, key_types=None, value_types=None)
```
This is important for Python stubs that are generated from the
docstrings; see https://github.com/michaelgold/buildbpy/issues/3.
This change feels a bit weird, as the function behaves differently
depending on whether the arguments are there or not. For example,
`subset=None` is not actually valid, as it should be a dictionary and
the function will raise a `TypeError`. But documenting `subset=dict()`
is also incorrect, because explicitly passing that will make the
function behave differently: it reports an empty dictionary, instead of
reporting everything. The same goes for the other parameters.
A better approach (IMO) would be to either add "empty dict/set means
'everything'" logic, or to allow `None` values for these parameters so
that the documented call can actually be made.
Note that this is the case for other calls as well, such as
`bpy.data.file_path_map()`. As such, I don't want to address this in
this commit; this is just for making the docstring reflect the optional
nature of the parameters.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/144933
* PROP_COLOR_GAMMA is sRGB, not display space
* Hex colors are always sRGB
* Image byte buffers are in byte_buffer.colorspace
Fixes for sequencer text, image painting, render stamp and tooltips.
The default display space is sRGB, so this change will not be noticed
in most files.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/144565
Moving the python call itself into a dedicated sub-scope allows to
ensure local variables (arguments) do not risk leaking into the
rest of the code after being released.
Also use helper macro `PyTuple_SET_ITEMS`.
Pull Request: https://projects.blender.org/blender/blender/pulls/144798
It's important that frozen types are immutable, add a generic
check that mathutils types can be resized and check the frozen flag.
Also correct the exception types when Vector's cant be resized,
using a ValueError instead of a TypeError as the type is correct.
This follows the other CMake "modernization" commits, this time for
`bf_intern_openvdb` and the OpenVDB dependency itself.
The difference with this one is that `intern/openvdb` becomes an
"optional" dependency itself. This is because downstream consumers often
want to include this dependency rather than openvdb directly, so this
target must also be optional. Optional, in this case, means the target
always exists but may be entirely empty.
Summary
- If you are using BKE APIs to access openvdb features, then use the
`bf::blenkernel` target
- If you are only using `intern/openvdb` APIs then use the
`bf::intern::optional::openvdb` target (rare)
- For all other cases, use the `bf::dependencies::optional::openvdb`
target (rare)
context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/137071
Commit 798f85a710 changed the way the languages menu is generated in
order to improve the items' descriptions. This revealed that items in
`bpy.app.translations.locales` used this description instead of the
identifier, resulting in them looking like:
'Locale code: ca_AD. Translation progress: 100%'
instead of:
'ca_AD'
To use the language code, this commit uses the menu item's identifier
instead of description.
-----
This should be backported to 4.5.
Pull Request: https://projects.blender.org/blender/blender/pulls/144366
The --debug-ffmpeg flag now is the same as --log video, and only exists for
backwards compatibility. The ffmpeg verbosity can now be controlled with
--log-level.
Pull Request: https://projects.blender.org/blender/blender/pulls/143447
On some drivers, the GLSL compiler doesn't reflect the omitted
`local_size_*` of a compute shader inside `gl_WorkGroupSize`.
This lead to the 2D size computation of 1D workgroups to become
0 which was bypassing the parallel reduction algorithms.
Ensuring `local_size_*` are always set fixes the issue.
For clarity, also fix the 1D shaders to not use `gl_WorkGroupSize.y`.
This also fix a copy paste error in the Metal backend.
This issue affected AMD drivers on Windows.
Rel #142046
Candidate for backporting to 4.5 LTS.
Pull Request: https://projects.blender.org/blender/blender/pulls/144056
Methods for `bpy_struct` such as `get()` & `items()` noted that only
some types support custom-properties.
Since these docs were written many more types support custom properties.
Replace the inline list with a link to a generated list since there are
now too many to include inline.
Resolves#141450.
Shader compilation no longer uses the `WM_job` API.
Add a `GPU_shader_batch_is_compiling` function to query if there's any
shader compilation happening, and update `bpy_app_is_job_running` to
handle this as a special case.
Pull Request: https://projects.blender.org/blender/blender/pulls/143559
- BLF font flags were an untyped enum; change to actual enum and
update usages from int to that.
- Move all BLF API enums to their own header, so that if something
needs just the enums they don't have to include whole BLF_api.hh
Pull Request: https://projects.blender.org/blender/blender/pulls/143692