Commit Graph

145937 Commits

Author SHA1 Message Date
Brecht Van Lommel
38a71fc7d1 Cleanup: Various clang-tidy warnings in iksolver
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:18 +01:00
Brecht Van Lommel
941f186e88 Cleanup: Various clang-tidy warnings in io
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:18 +01:00
Brecht Van Lommel
c7502b092d Cleanup: Various clang-tidy warnings in gpu
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:18 +01:00
Brecht Van Lommel
61eedabae9 Cleanup: Various clang-tidy warnings in draw
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:18 +01:00
Brecht Van Lommel
1eb1755e1f Cleanup: Various clang-tidy warnings in compositor
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
3725fad82f Cleanup: Various clang-tidy warnings in editors
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
37b95783fa Cleanup: Various clang-tidy warnings in bmesh
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
d2c688e381 Cleanup: Various clang-tidy warnings in geometry
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
4856ad3efc Cleanup: Various clang-tidy warnings in asset_system
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
ae28102c3f Cleanup: Various clang-tidy warnings in windowmanager
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
b78fa81ed4 Cleanup: Various clang-tidy warnings in render
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
011060aa03 Cleanup: Various clang-tidy warnings in imbuf
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
7d37bd3841 Cleanup: Various clang-tidy warnings in ikplugin
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
936b90ce56 Cleanup: Various clang-tidy warnings in animrig
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
c335ff596c Cleanup: Various clang-tidy warnings in depsgraph
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
9da1778f1a Cleanup: Various clang-tidy warnings in blendthumb
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
ac977826e7 Cleanup: Various clang-tidy warnings in blentranslation
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
c296e668fc Cleanup: Various clang-tidy warnings in blenfont
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
a7e0a9a467 Cleanup: Various clang-tidy warnings in blenloader
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
260dbe4cff Cleanup: Various clang-tidy warnings in modifiers
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
478426c937 Cleanup: Various clang-tidy warnings in blenkernel
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
6b6cd3307b Cleanup: Various clang-tidy warnings in blenlib
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Brecht Van Lommel
1369fa27c6 Cleanup: Compiler warning in lite build 2025-01-31 17:03:17 +01:00
Brecht Van Lommel
c28cc9c965 Cleanup: Add missing braces in DNA_struct_default_get 2025-01-31 17:03:16 +01:00
Brecht Van Lommel
af0c561b15 Clang Tidy: Silence a few more warnings
* 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
2025-01-31 17:03:16 +01:00
Jacques Lucke
795f63e142 Fix #132941: crash due use after-free in properties editor during baking
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
2025-01-31 16:47:54 +01:00
Christoph Lendenfeld
de31cecfaf Fix #133731: Performance issue with many stashed actions
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
2025-01-31 16:38:30 +01:00
Clément Foucault
651ae0e47c Metal: Add OOB coordinate rejection to image atomic functions
These should have been guarded but are not, creating
buffer out of bound access error on Apple devices.
2025-01-31 16:17:58 +01:00
Clément Foucault
636147053d Metal: Add support for repeating byte sequence for buffer clearing
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.
2025-01-31 16:13:56 +01:00
Clément Foucault
067f6767d4 Fix #129571: Metal: Broken texture atomic workaround
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
2025-01-31 16:10:59 +01:00
Philipp Oeser
7397fda92b Fix #133764: Collada crash (editmode + triangulate + apply modifiers)
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
2025-01-31 15:46:12 +01:00
Sybren A. Stüvel
f97c54ff76 Anim: emit liboverride on slot handle when action is changed
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
2025-01-31 15:43:34 +01:00
Sybren A. Stüvel
815337a7da Anim: add ensure parameter to KeyframeStrip.channels(...) RNA function
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
2025-01-31 15:16:10 +01:00
Lukas Tönne
7f5c803a8b Fix #133572: Grease Pencil: Reproject operator raycast instead of depth buffer
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
2025-01-31 14:55:26 +01:00
Bastien Montagne
2612b27e42 Refactor: Move 'need link' and 'need expand' ID tags to runtime readfile data.
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
2025-01-31 14:26:38 +01:00
Pratik Borhade
41e693c43c Fix #133407: Grease Pencil: Support auto merge for Primitives
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
2025-01-31 14:22:30 +01:00
Hans Goudey
e79859ab14 Refactor: Use Map instead of GHash for Python translations cache
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
2025-01-31 14:10:14 +01:00
Sybren A. Stüvel
a058922e68 Refactor: Anim, use std::cout for debug prints instead of printf()
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
2025-01-31 12:48:02 +01:00
Jeroen Bakker
96c9153c5e Fix: Vulkan: Use after free of VkBufferView
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
2025-01-31 11:41:39 +01:00
Christoph Lendenfeld
037c0c74a1 Fix #133786: Crash when modifying a Grease Pencil NLA track
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
2025-01-31 11:31:37 +01:00
Jeroen Bakker
63a6bea4e8 Bump render test 2025-01-31 11:28:31 +01:00
Nathan Vegdahl
b166fa46b8 Anim: set Action.idroot when writing blend file, for forward compat
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
2025-01-31 10:47:16 +01:00
Omar Emara
028506712d Fix #133807: File Output node ignores transforms
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
2025-01-31 10:14:54 +01:00
Omar Emara
3fd894a2d9 Fix #133847: Single value node trees fail in GPU
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
2025-01-31 10:10:22 +01:00
Pratik Borhade
126b3722ae Fix #133656: Grease Pencil: Move to new layer fails with matching names
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
2025-01-31 10:06:24 +01:00
Brecht Van Lommel
bbdd6419ac Fix #133800: View Render Animation leaves play buttons inactive
The operator can get freed late if the window is out of focus. So finish
up everything already when the job ends.

Pull Request: https://projects.blender.org/blender/blender/pulls/133828
2025-01-31 09:40:44 +01:00
Brecht Van Lommel
40ac21e5a5 Refactor: Move OGLRender data structure towards C++
https://projects.blender.org/blender/blender/pulls/133828
2025-01-31 09:40:44 +01:00
Pratik Borhade
7e5749c679 Fix #133314: Grease Pencil: Move strokes to same layer clears wrong data
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
2025-01-31 09:11:56 +01:00
Omar Emara
75f1cbb6dd Refactor: Clarify code around scheduling composite nodes
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
2025-01-31 07:43:00 +01:00
Omar Emara
5fd5685a6a Compositor: Allow repeating in the Translate node
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
2025-01-31 07:41:40 +01:00