* bugprone-signed-char-misuse: Not relevant because of -funsigned-char.
* bugprone-switch-missing-default-case: Not necessarily better to add default.
* bugprone-multi-level-implicit-pointer-conversion: Common pattern.
* bugprone-assignment-in-if-condition: Common pattern, not against guidelines.
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
The crash happens because some layout drawing code accesses the evaluated data
which is being generated by the baking thread. This access is not thread safe
currently.
This patch simply locks the UI of the properties editor when the interface is
locked using `WM_set_locked_interface` which is done during baking. The same is
done for the 3d view, node editor and spreadsheet already.
Pull Request: https://projects.blender.org/blender/blender/pulls/133867
When duplicating an action, it is stashed in the NLA on a muted track.
Over time this can slow down blender, because certain code will look at every
FCurve in every action in the NLA.
To fix the performance issue, we can take advantage of the fact that
stashed actions are put onto a muted NLA track.
With this patch any strip on a muted NLA track is ignored in the
Depsgraph evaluation.
Measurements of `DEG_graph_relations_update`
| - | Before | After |
| - | - | - |
| 50 actions | ~140 ms | ~10.0 ms |
| 100 actions | ~250 ms | ~10.7 ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/133864
This allows to run with the --debug-gpu option (which
does NAN and 0xF0F0F0F0 clearing) without asserts
even when the texture atomic workaround is enabled.
The refactor 9c0321ae9b
had the wrong mental model of the backing texture
layout for the atomic workaround.
For 3D textures, the layout is breaking the 3D texture
and reinterpreting the linear location as its 2D
linear location. This breaks the 3D texture Z slices
into non contiguous regions in 2D.
Comments have been added to avoid future confusion.
Pull Request: https://projects.blender.org/blender/blender/pulls/133830
Exposed by bc0b86797c
(but even before we had Asserts in a debug build -- also crashed
WITH_ASSERT_ABORT OFF)
The call to ensure Mesh data from a mesh in edit mode needs
to happen before the triangulation which uses Mesh. This gets rid of
the crash and also previous asserts.
Pull Request: https://projects.blender.org/blender/blender/pulls/133859
Emit a 'diff' for the `animdata.slot_handle` property whenever the
`.action` property is changed through a library override.
The slot handle is only meaningful within the context of the assigned
action. So when a liboverride changes the assigned action, the slot
handle should also get an override.
This is necessary even when the numerical value of the slot handle
happens to be the same in both actions, as the newly chosen slot is
different from the slot that was chosen in the library file.
This applies to direct Action assignment, NLA strips, and Action
constraints.
Pull Request: https://projects.blender.org/blender/blender/pulls/133727
Add `ensure` boolean parameter to the `ActionKeyframeStrip.channels()` RNA
function. Passing `ensure=True` will ensure the channelbag for the given
action slot handle exists. This makes it more straight-forward to create
F-Curves for a slot regardless of whether there already was a channelbag
for those F-Cuves:
```python
strip = action.layers[0].strips[0]
slot = action.slots[0]
# Old:
channelbag = strip.channels(slot.handle)
if not channelbag:
channelbag = strip.channelbags.new(action_slot)
ob_loc_x = channelbag.fcurves.new('location', index=0)
# New:
channelbag = strip.channels(slot.handle, ensure=True)
ob_loc_x = channelbag.fcurves.new('location', index=0)
```
Pull Request: https://projects.blender.org/blender/blender/pulls/133678
The reproject operator in GPv3 was implemented using the depth buffer instead of
using the transform snap functions that are based on raycasts. This causes
problems with accuracy and does not account for possible animation of objects.
This patch reintroduces the raycast method.
Pull Request: https://projects.blender.org/blender/blender/pulls/133863
Also adds a new `BLO_readfile_id_runtime_tags_for_write` accessor to
ensure readfile data is created before assigning a tag value.
Followup to 2ec1b6887d. Should cover the last existing ID tags that
can be moved to temp runtime readfile ID data.
Pull Request: https://projects.blender.org/blender/blender/pulls/133715
Auto-merge with nearby strokes seems to only implemented for stroke drawing.
Code has been copied from `on_stroke_done()` that handles the
auto-merging, this will allow to join the primitive shape with nearest stroke.
Pull Request: https://projects.blender.org/blender/blender/pulls/133420
This makes the code simpler, aligns it with the builtin translations in
messages.cc, and should improve performance as well. My motivation
for the change is to allow returning StringRef/StringRefNull from the
translation functions instead of char pointers.
To test the change I used the Sun Position addon which includes
translations and toggled different languages in the preferences.
Pull Request: https://projects.blender.org/blender/blender/pulls/133827
Use streaming to `std::cout` for debug prints, rather than using
`printf()`. Different compilers disagree on the `printf()` format string
for `int64_t`: GCC thinks it should be `%ld` while Clang says `%lld`,
and either will emit a warning when the other's preference is used.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/133857
VkBufferViews could be used after they were freed. The reason is that
they were not managed by the discard pool. Detected when looking in
failing render tests (pointcloud_motion.blend).
This part of the API is used by motion blur in EEVEE. Fixes the next
render tests
- `eevee_next_motion_blur_vulkan`
- `eevee_next_pointcloud_vulkan`
- `eevee_next_hair_vulkan`
Related: #133546
Pull Request: https://projects.blender.org/blender/blender/pulls/133856
The issue is that `ANIM_animdata_filter` with the flag `ANIMFILTER_ANIMDATA`
did not actually return only animdata.
The reason for this is in `animdata_filter_grease_pencil_data`,
where there is special handling for this flag.
It seems that returning non-animdata things is expected for Grease Pencil.
So my solution is to just verify the type of `bAnimListElem` before use.
Pull Request: https://projects.blender.org/blender/blender/pulls/133853
When writing an Action to a blend file, for forward compatability
reasons the animation data in the first slot is also written to the old
Animato Action storage locations. That way, loading the Action in an
older version of Blender will still at least have that animation data.
However, we overlooked `Action.idroot`, which indicates which ID
type the Action is for, and therefore all Actions have an unspecified
`idroot` when loaded in pre-layered-action versions of Blender.
This PR fixes that by also setting the `idroot` to match the target ID
type of the first slot when writing to disk.
Pull Request: https://projects.blender.org/blender/blender/pulls/133819
The File Output node sometime ignores the transformations of their
inputs. That's due to the fact that transforms are now delayed and the
File Output node does not realize its inputs on its domain in case it
was not multi-layer.
To fix this, add another realization mode for transforms only. And use
that in the File Output node, as well as the Bokeh Blur, UV Map, and
Plane Track Deform, which also need this fix.
Pull Request: https://projects.blender.org/blender/blender/pulls/133850
Nodes that process single values can fail to work for GPU compositing.
That's because multi-function procedures writes to the single values but
never uploads them to the GPU, which is what this patch does.
Pull Request: https://projects.blender.org/blender/blender/pulls/133851
When creating a layer, suffix is added to the new layer name. In move to
layer operation, the target layer is searched based on the old name,
results in transferring strokes to wrong layer. Now fixed with correct
target layer.
Pull Request: https://projects.blender.org/blender/blender/pulls/133697
When moving strokes to same layer, curve at wrong index is removed at
the end of operation. This seems to happen due to wrong order of
geometryset component.
Pull Request: https://projects.blender.org/blender/blender/pulls/133359
There is a special case in the compositor code where viewer nodes are
treated as composite nodes. This patch renames relevant methods and
updates comments to clarify this use case.
Pull Request: https://projects.blender.org/blender/blender/pulls/133811
This patch changes how the Wrap option in the Translate node works. It
now repeats infinitely when realized, and not just in its own domain.
This is essentially how it used to work prior to version 4.2, so we are
reverting that change. We also rename Wrap to Repeat for clarity.
This is part of an ongoing to project to allow the user to control how
boundaries and empty areas are filled after transformations. So similar
options will be added to all transform nodes. But this patch is the
first step, since the functionality is already there, we just need to
extend it to work in all domains.
Pull Request: https://projects.blender.org/blender/blender/pulls/133766