Changes to the drawings array require an update of the `drawing_index`
stored in frames. Subsequently the frame storage data (for writing to
files) also needs to be updated. This was missing in the
`remove_drawings_with_no_users` function, which can lead to invalid
`drawing_index` after loading the file again.
A regression test has been added for this case.
Also fixed a minor memory leak when all the drawings are removed.
The drawing array ends up empty but still has a pointer allocated.
Fixes should avoid this (nullptr when `drawing_array_num` is zero) but
also make sure the array pointer is handled anyway instead of assuming
nullptr.
Pull Request: https://projects.blender.org/blender/blender/pulls/118569
Ideally the operator itself should be renamed, but I went the conservative approach
since themes are not supported yet. Once they are supported I suppose the operators
could be unified.
There were some places in the code that wrote to the frames,
but didn't tag the changes. This could result in the changes
getting lost when the file is saved (or changes getting lost during undo).
Given current tag/flag handling situation (see also #88555 and #90610),
it is not yet possible to ensure matching tags between embedded data and
their owner ID. Furthermore, a non-main Scene should also tag its master
collection as non-main, so current test was not correct anyway.
This will allow for more control over which ID should actually be marked
as unused/to be deleted.
Also some general minor cleanups and refactor, most notably:
* Add a constructor to internal `UnusedIDsData` struct, which can
directly use the public `LibQueryUnusedIDsData` parameters struct.
* Add default values to trivial data in `LibQueryUnusedIDsData`.
No expected behavioral changes in this commit.
This PR adds support for the `SCULPT_OT_dyntopo_detail_size_edit`
operator for the `Brush Detail` and `Relative Detail` modes,
replacing the old generic radial menu.
## Changes
* Triangle grid shown for all detailing modes
* Support for modal left / right scaling and sampling added
* Status bar updates with current value while editing the parameter.
## Limitations
* The brush size percent value is no longer shown in the 3D viewport
when using this modal.
This will be added with later functionality in #106243
Addresses #108111
Pull Request:
https://projects.blender.org/blender/blender/pulls/118403
The CPU compositor always adds a filter for normal and albedo even if
they don't contain any data, that is, when they are not connected to
anything, by inflating a buffer with the editor value, which is not even
accesible to the user. In anycase, such a solid color will not help do
anything in the denoise operation.
This patch aligns the implementation by only adding the abeldo and
normal filter if they contain actual data, speeding up the operation in
the process.
Pull Request: https://projects.blender.org/blender/blender/pulls/118553
PR #118382 exposed an issue where creating a catalog with non-existing
parents would trigger an endless recursion. When creating the missing
parents, the tree would be rebuilt, which would again try to create the
missing parents, for which the tree would be rebuild, etc. It just
happend to work fine for creating single catalogs with existing parents.
Rather than rebuilding the tree immediately, tag the asset library as
having "dirty" catalog data, and let code requiring the up-to-date
catalog tree (node tool menus) ensure the tree is updated if needed.
The asset library loading API should be made clearer and generally
better defined/designed, currently it's all a bit messy & confusing.
Pull Request: https://projects.blender.org/blender/blender/pulls/118463
Towards #118493: make movie writing functionality take ImBuf instead
of int* to pixel data.
While at it, make other bMovieHandle functions use "bool" return type
when it is strictly a success/failure result.
Pull Request: https://projects.blender.org/blender/blender/pulls/118559
When a sync primitive signal existed
in its own command buffer, the command
buffer execution was skipped as the empty
flag was previously still set to true.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/118557
IMB_double_x, IMB_double_y, IMB_double_fast_x, IMB_double_fast_y,
imb_filterx are not used by anything. Looks like they all come
from "initial revision, 22 years ago" and probably unused for decades.
Caused by 1c0f374ec3
When `EDBM_edge_find_nearest_ex` does not find a nearest edge in
`loopcut_mouse_move`, then `loopcut_update_edge` will set
`RingSelOpData` `ob` to nullptr (rightfully so).
This would then crash in `ringsel_draw` (because we are trying to call
`object_to_world()` on the nullptr).
Prior to 1c0f374ec3 this was also "wrong", but
`EDBM_preselect_edgering_draw` would early out before using garbage
data.
Now guard against this and dont call `EDBM_preselect_edgering_draw` at
all if we dont have valid input.
Pull Request: https://projects.blender.org/blender/blender/pulls/118549
The voronoi texture node only sets the first 3 components of the
color. The alpha value is never set. Normally this is covered
when using it in a shader node, but when directly connected to
the AOV output, the color was stored as a pure emissive color.
This resulted in incorrect colors in the viewport and image renders.
This is a partial fix for #118494
Pull Request: https://projects.blender.org/blender/blender/pulls/118497
Fluid (Smoke/Liquid) has its own UI (uses `PHYSICS_PT_cache` in
`properties_physics_fluid.py`), does not use `point_cache_ui` at all.
It seems 4235fe37d6 should have done this already.
Afaict, this is also not relevant for loading old (e.g. 2.79) files with
the old smoke system (since their caches wont be read anyways).
Pull Request: https://projects.blender.org/blender/blender/pulls/117404
This adds an option `WITH_EXPERIMENTAL_FEATURES` which is `ON` by default.
Sometimes it's usefull to be able to turn off all experimental features
during development for testing purposes. This option is still enforced to be
`OFF` for release cycles other than `alpha`.
Pull Request: https://projects.blender.org/blender/blender/pulls/118513
This patch unifies the implementation of the separable Blur operation
across CPU and GPU. The difference is due to the fact that the CPU code
ignores pixels that are across the image boundary and adjusts the
weights accordingly, while the GPU code assumes extended boundaries.
Like the rest of the Blur nodes the CPU implementation is adjusted to
assume extended boundaries until an option to change the boundary
condition is added. The alpha version of this operation will be handled
in a separate patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/118517
Currently, the Hue Correct node uses the adjusted hue when adjusting the
saturation and value of the input, so if the user adjusted the reds to
become blue, in order to change the saturation of the same area, one
would need to adjust the blues, which would overlap with the existing
blues.
This is contrary to how other compositing software like GIMP and Natron
do it, and it is less intuitive. So this patch changes the node to use
the original hue to the saturation and value curves as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/118487
Initialize a remote repository pointing to
https://extensions.blender.org and a local repository to use for
local (side-loaded) extensions installed from the file-system.
Register the last held key when activating a window
(not only modifiers keys) under Wayland.
This resolves a bug where holding the D-key and clicking on a window
wouldn't activate grease pencil drawing.
When using a square color picker you can drag it very wide in an RGB
node. Once over a threshold the round cursor in the color canvas will
turn into a vertical bar. Caused by (dumb) proportion test. Replaced
with a proper check for gradient type.
Pull Request: https://projects.blender.org/blender/blender/pulls/118542
This allows better roughness approximation for glass
materials when not using raytracing.
The fit was done by rendering a checkerboard
with a refractive plane and an orthographic camera.
Same setup with a reflective plane gave the
reference roughness to match.
Rendering a few hundred of small images with
Cycles and then finding a curve fit manually
by matching blur level.
Rel #118256
Pull Request: https://projects.blender.org/blender/blender/pulls/118533
People running `make update` first time, will not have a lib
folder yet, and get a warning about python being missing, this
sends some of them off onto somewhat of a wild goose chase
installing python when this is really not needed since it's
included in our libraries.
This change, changes the warning to only emit when the lib
folder exists, but python is missing in the lib folder and
there actually is likely an issue with the lib folder.
Previously, the alignment of structs that use `MEM_CXX_CLASS_ALLOC_FUNCS`
were not taken into account when doing the allocation. This can cause some data
to be mis-aligned and leads to crashes when cpu instructions or code expect the
data to be aligned.
The fix is to provide an overload of `operator new` that accepts the alignment as parameter.
More info: https://en.cppreference.com/w/cpp/language/new (search for `align_val_t`).
Pull Request: https://projects.blender.org/blender/blender/pulls/118526
Solo'ing bone collections was only possible from the Armature properties
panel. However, the bone collections shown on the Bone properties panel
should have the same functionality.
Pull Request: https://projects.blender.org/blender/blender/pulls/118512
Add some comments that clarify that `StringRefNull` can be compared with
other `StringRefNull` and with `StringRef` instances.
Add unit tests that cover these cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/118515