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
Deprecation meta-data support for RNA properties.
- Properties may have a deprecated note and version.
- Warnings shown when these are accessed from Python.
- A note is included in the generated documentation.
Support for marking functions as deprecated can be added in the future.
Ref !139487
Show warnings for debug builds or when `--debug-python` is passed in.
Without this, only scripts running in the `__main__` namespace
show warnings - hiding warnings for almost all scripts & add-ons.
This is also needed so deprecation warnings can be shown, see !139487.
* Replace G.quiet by CLG_quiet_set/get
* CLOG_INFO_NOCHECK prints are now suppressed when quiet, these were
typically inside a if (!G.quiet) conditional already.
* Change some prints for blend files, color management and rendering to
use CLOG, that were previously using if (!G.quiet) printf().
Pull Request: https://projects.blender.org/blender/blender/pulls/143138
- Adding `/` to signatures to indicate that arguments are accepted only
as positional.
- Document default values and optional arguments in consistent way with
other docs.
- Use `Literal` for strings to indicate set of allowed string values
(later it can also be used in typing stubs).
- Document some undocumented arguments.
Ref !143278