Commit Graph

26808 Commits

Author SHA1 Message Date
Jacques Lucke
96d2f3430f Merge branch 'blender-v5.0-release' 2025-10-16 19:20:23 +02:00
Jacques Lucke
7075bbc176 Fix #148179: missing node group description in packed asset
The asset meta data containing the description was not packed and hence the
description was lost.

Pull Request: https://projects.blender.org/blender/blender/pulls/148221
2025-10-16 19:19:40 +02:00
Julian Eisel
2e76bb47bb Refactor: BKE: Move icon header to C++
Was trying to use a C++ type (`blender::Span`) in the header but
couldn't. I would rather not use a less safe raw pointer to a buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/148214
2025-10-16 17:45:26 +02:00
Jacques Lucke
6521b448c3 Merge branch 'blender-v5.0-release' 2025-10-16 17:17:49 +02:00
Jacques Lucke
7ed85bfe17 Fix #148032: vertex/weight paint undo broken
The issue was that the data-blocks of two different undo steps were detected to
be identical, even if the attributes changed. That's because even if the
implicitly-shared data was different, they were turned into the same pointer by
cadb3fe5c5 on write.

This patch makes it so that for undo steps, implicitly shared data does not use
the pointer stability feature (in a sense, implicit-sharing itself provides
pointer stability for undo steps already).

The main tricky aspect is that we need to know if a pointer is implicitly shared
in `writestruct_at_address_nr` and oftentimes that's called before the
corresponding shared data is actually written with `BLO_write_shared`. The
solution is to enforce that the blend-write code has to know what pointers are
implicitly-shared before they are written the first time. The simplest way to
ensure that is to call `BLO_write_shared` first. However, that's not always
possible, especially when the pointer is directly embedded in an ID. Therefore,
there is a new `BLO_write_shared_tag` function that can be used in such cases.

The undo performance for the file in #141262 is still fixed with this change.

Pull Request: https://projects.blender.org/blender/blender/pulls/148144
2025-10-16 17:16:05 +02:00
Hans Goudey
6e66b8a242 Merge branch 'blender-v5.0-release' 2025-10-15 10:58:14 -04:00
YimingWu
db96265568 Fix #148061: Prevent unknown socket type from crashing when reading file
`socket.socket_typeinfo()` can be nullptr when reading blend files that
contains custom socket types that are not registered yet. This fix
prevents crashing when this happenes (but the socket will stay
unregistered).

Pull Request: https://projects.blender.org/blender/blender/pulls/148103
2025-10-15 16:54:08 +02:00
Sergey Sharybin
0b6c820aae Merge branch 'blender-v5.0-release' 2025-10-15 16:14:19 +02:00
илья _
7b3737f1e9 Fix: Mesh: Wrong corner edge indices in result of edge generation
Instead of reordering edges to be able to map them with hash sets, new
edges order (since 157e7e0351) is kept as-is in order to not
touch edge attributes. In early return in case of correct mesh this new
ordering was missed. This was found in file from #147694.

Pull Request: https://projects.blender.org/blender/blender/pulls/147872
2025-10-15 15:39:11 +02:00
Bastien Montagne
df4c7a6da2 Merge branch 'blender-v5.0-release' 2025-10-15 15:20:17 +02:00
Sybren A. Stüvel
bbf40d214c Fix #147729: Crash scrubbing w/ snapping to sec and FPS < 0.5
Fix playhead snapping to seconds, when the frame rate is less than 0.5
FPS.

This makes it possible to snap to fractions of frames, to support setups
with multiple seconds per frame. Of course this only has any effect
(apart from not crashing) when sub-frames are enabled.

I've also added unit tests, and verified that the values are the same
from before this refactor.

Pull Request: https://projects.blender.org/blender/blender/pulls/148074
2025-10-15 12:54:36 +02:00
Campbell Barton
da43cbd22a Merge branch 'blender-v5.0-release' 2025-10-15 18:48:37 +11:00
Campbell Barton
be43077b1b Fix: crash printing integers in IDP_reprN
Regression in [0] caused printing integers to crash.
While this function isn't widely used it could crash logging
key-map items.

Also add tests for IDP_reprN.

Ref !148109

[0]: 92cf9dd2f2
2025-10-15 07:46:58 +00:00
Sean Kim
34c7fb95d1 Merge branch 'blender-v5.0-release' 2025-10-14 10:39:34 -07:00
Sean Kim
8d1688383e Fix #147774: Newly created brush causes crash when used
While uncommon, brush initialization does happen in some addon
workflows. Prior changes to use custom pressure curves in more places
did not initialize the `CurveMapping` struct correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/147840
2025-10-14 19:38:41 +02:00
Hans Goudey
0e796fd33e Merge branch 'blender-v5.0-release' 2025-10-14 10:58:36 -04:00
илья _
db6bb01938 Fix #147797: Geometry Nodes: Assertion in edge calculation for import mesh
To scatter all map edges for original indices we don't need to take
a slice of destination edges.

Pull Request: https://projects.blender.org/blender/blender/pulls/147874
2025-10-14 16:56:48 +02:00
Falk David
0ec4e23fa6 Merge branch 'blender-v5.0-release' 2025-10-13 18:30:17 +02:00
Falk David
1b73a53d0c Fix #139501: VSE: Build separate dependency graph for scene strip previews
Currently, the scene strip preview uses the existing dependency
graph built for that scene. This was not a big issue before
the sequencer scene was introduced, because the user would have
to create two main Blender windows to run into problems.
Now with the sequencer scene, it's possible to look at the scene
of a scene strip within the same window.
When the user is editing the scene (e.g. moving an animated object)
any open sequencer preview will cause the edits to be flushed.
This can e.g. result in visual jumping of animated objects, and more.

This PR attempts to fix the issue in a straightforward way: Use
a separate dependency graph for rendering the sequencer preview.
While this fixes the immediate issues, there are some consequences:
* The memory usage of the scene dependency graph _can_ roughly
  double (since there are now likely two instances of the same
   dependency graph). Because of implicit sharing, unmodified data
   will not be copied. But for example modifiers on meshes would
   currently create two copies of the evaluated data in the two
   dependency graphs.
* Creating the dependency graph can be costly, which will cause the
  first frame that the scene has to render to be slower.

Note: The current code changes some properties of the original scene
like the frame, subframe etc. before rendering and then restores
the original state. In theory, this part of the code can be removed,
but may be a bit too risky for just a fix. This should be improved
at a later stage.

Also resolves #146769, #139501.

Pull Request: https://projects.blender.org/blender/blender/pulls/147457
2025-10-13 18:29:28 +02:00
Jacques Lucke
51fbcd84ce Merge branch 'blender-v5.0-release' 2025-10-13 18:25:36 +02:00
Jacques Lucke
d690ffd44f Fix #146949: Geometry Nodes: cache usage inference on modifier
This speeds up drawing of the UI of the Geometry Nodes modifier, especially for
very large node trees like in the files from #146949.

A couple previous commits and #147883 speed up the inferencing significantly
already. However, there is a certain limit to how fast this can be on large
complex node trees. While there is some more optimization potential, this patch
implements a cache on the Geometry Nodes modifier level. This means that as long
as the inputs and the node tree stays the same, the inferencing only has to
happen once, instead of on every redraw.

The main difficulty with this cache is that we don't have a good way to
invalidate it eagerly when any of the modifier inputs changes. That can
hopefully become simpler with #138117. For now, we have to check all input
values on redraw to check if anything has changed compared to the last redraw
and recompute the cache if there is any change.

Pull Request: https://projects.blender.org/blender/blender/pulls/147930
2025-10-13 18:23:50 +02:00
Hans Goudey
1d372bdc8b Refactor: Split CustomData attribute and newer attribute headers
Avoid including DNA_customdata_types.h everywhere we include the
attributes header. Over time the older attribute header should be
used less and less.

Part of #122398

Pull Request: https://projects.blender.org/blender/blender/pulls/147980
2025-10-13 15:38:26 +02:00
Lukas Stockner
c0bec1d068 Merge branch 'blender-v5.0-release' 2025-10-13 01:08:43 +02:00
Lukas Stockner
d458416f4d Fix #146850: Assert when removing custom camera after loading file 2025-10-13 01:07:13 +02:00
Hans Goudey
241849e397 Merge branch 'blender-v5.0-release' 2025-10-12 10:37:21 -04:00
W_Cloud
ef58bd609b Fix: Nodes: String node initialization regression with link-drag-search
I think the special handling for string input node, added in #139478,
was broken by #146033. The early check for src_value (`if (!src_value)`)
caused the string-specific logic to be skipped. This PR moves the
string-specific handling before the src_value check.

Pull Request: https://projects.blender.org/blender/blender/pulls/147697
2025-10-12 16:33:50 +02:00
Campbell Barton
c4b2c1c19e Cleanup: spelling (check_spelling_*), trailing spaces in comments 2025-10-12 12:12:46 +11:00
Hans Goudey
53cdcf3042 Cleanup: Formatting in attribute type conversion
Just making the sections easier to read.

Pull Request: https://projects.blender.org/blender/blender/pulls/147830
2025-10-10 19:40:26 +02:00
Hans Goudey
410f57da5d Cleanup: Improve documentation in AttrType / eCustomDataType conversion
This list can be used as a source of truth for what needs to be
supported in CustomData vs. AttributeStorage for some ongoing work.
These comments just make it a bit more useful.
2025-10-10 12:46:32 -04:00
Bastien Montagne
3b86057be9 Document why resync failure is never expected in liboverride creation code. 2025-10-10 12:18:51 +02:00
Sergey Sharybin
5f64692e0c Fix: Compilation error due to a typo in variable 2025-10-10 12:03:07 +02:00
Bastien Montagne
270c8c89ba Fix warning in release builds. 2025-10-10 11:53:22 +02:00
Richard Antalik
881b122ccc Merge branch 'blender-v5.0-release' 2025-10-10 10:23:27 +02:00
Richard Antalik
61033de969 Fix #146493: Crash after starting playback
Root cause is, that reverse playback would not call
`BKE_sound_play_scene()`, however `BKE_sound_stop_scene()` was called
always.

There was some weird logic in `ED_screen_animation_play()` where
condition for what sound scene was to be stopped exactly was inverted
for sequencer and duplicated for non-sequencer scene. This may also
be incorrect if somebody manages to start playback in active scene, then
create sequencer scene and stop it there.

Fortunately `ScreenAnimData` keeps pointer to scene which started
playback, so this is used to also stop the playback.

To make this code bit more readable, the function was split into
functions starting and stopping the playback, so the logic can also be
simplified a bit.

Finally, `sound_device_use_end_after()` was modified to do sanity check.
If the number of users is already 0, it does nothing and returns.
There assertion to catch this in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/147613
2025-10-10 10:22:55 +02:00
Omar Emara
2f745308ed Nodes: Mix alpha in Mix node Mix mode
This patch mixes the alpha channel of the color in the Mix mode of the
Mix node. This has no effect on EEVEE/Cycles since they do not support
alpha, but affects the Compositor, Geometry Nodes, and Texture Nodes.

Previously, the alpha of the first color was assumed, which meant mixing
two images with transparency using a mask in the compositor resulted in
part of the image having bad alpha and required manually mixing of the
alpha channel. And this is the main motivation of this patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/146461
2025-10-10 08:00:01 +02:00
Sean Kim
919605bd9e Cleanup: Fix typos
Pull Request: https://projects.blender.org/blender/blender/pulls/147660
2025-10-09 21:16:13 +02:00
Sean Kim
0b37bbd8ac Cleanup: Remove unnecessary enum prefix in function declaration 2025-10-09 21:16:12 +02:00
Falk David
d975766c58 Merge branch 'blender-v5.0-release' 2025-10-09 15:46:31 +02:00
Jacques Lucke
6bf69766aa Fix: making packed data-blocks local does not clear the packed-flag
This fixes the root cause of #147541. However, the file in the report is still
in a bad shape. It needs to be resaved after this patch so that appending the
node group works as expected.

The issue was that making a data-block local did not clear the
`ID_FLAG_LINKED_AND_PACKED` flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/147603
2025-10-09 14:36:34 +02:00
Jacques Lucke
3fe28cbfab Merge branch 'blender-v5.0-release' 2025-10-09 11:23:45 +02:00
Jacques Lucke
17954b8d8d Fix #147484: crash when opening window while rendering
The issue here was that the node-tree-update code was accessing data in `bmain`
when it shouldn't. The fix is to just use the correct API for this use-case when
updating a temporary node tree. It doesn't need `bmain` in this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/147611
2025-10-09 11:02:00 +02:00
Hans Goudey
25766a0220 Cleanup: Reorder code in attribute renaming function
Similar to the previous commit, but this one makes more sense
on its own too; there aren't multiple checks for the attribute owner
type anymore. Part of #122398.

Pull Request: https://projects.blender.org/blender/blender/pulls/147662
2025-10-09 03:24:57 +02:00
Hans Goudey
8a903c3eec Refactor: Reorder attribute owner checks to handle mesh first
On its own this change is just noise and not really worth it. The point
is to make a future diff for #122398 smaller and more legible. Also it's
semantically more consistent with the way we usually handle early
returns: the "special case" comes first, then the expected normal path
continues un-indented.
2025-10-09 03:24:56 +02:00
Jacques Lucke
15a75eff9d Merge branch 'blender-v5.0-release' 2025-10-08 19:40:21 +02:00
Jacques Lucke
66dd8beef3 Fix #147037: copying node referencing packed id does not work
The solution is to remember the deep hash of the copied data-block pointers
instead of just relying on the library file path.

Pull Request: https://projects.blender.org/blender/blender/pulls/147275
2025-10-08 19:39:53 +02:00
Hans Goudey
397e28923b Merge branch 'blender-v5.0-release' 2025-10-08 13:27:08 -04:00
Hans Goudey
dd75c0b5ec Fix #147429: Set Resolution node doesn't use default for unselected curves
The fix in this case is to properly use the stored builtin attribute defaults
when capturing the field on the mesh. I extracted that to a function so
the code would read better with early returns.

Pull Request: https://projects.blender.org/blender/blender/pulls/147646
2025-10-08 19:26:12 +02:00
Bastien Montagne
9bb9814862 Fix #147565: Prevent viewlayer resync during threaded liboverride process.
Code executing in parallelized context should never attempt to resync
viewlayers, this is just not safe.

So instead, explicitly call `BKE_main_view_layers_synced_ensure` and
forbid further updates before entering the multi-threaded part of
`BKE_lib_override_library_main_operations_create`.

This should make issues like #147565 less likely to happen in the
future.
2025-10-08 18:39:12 +02:00
Bastien Montagne
a165a324b8 Fix ViewLayer resync wrongly assuming success in some cases.
`BKE_view_layer_synced_ensure` would report success and clear the 'out
of sync' flag of the viewlayer, even if the call to `BKE_layer_collection_sync`
could not actually perform the resync (e.g. because resync is forbidden
by one or more calls to `BKE_layer_collection_resync_forbid`).

While logically fairly bad, this issue did not seem to have any
practical consequences. So would rather not  backport this to the 5.0 beta
branch.

This fix also reveals at least one place where the usage of
`BKE_view_layer_synced_ensure` and related is muddy and not ideal: the
Scene's `foreach_id' code. This is patched as best as possible in this
commit, but is something that will have to be properly fixed at some
point most likely.

Also add some documentation to this API - although the whole thing needs
a real reafctor at some point still, name-wise and organization-wise.

Pull Request: https://projects.blender.org/blender/blender/pulls/147635
2025-10-08 17:16:23 +02:00
Miguel Pozo
71f4277467 GPU: Codegen: Native support for repeat zones
Support loops at the GLSL level instead of relying on
NOD_shader_nodes_inline.
This improves compilation and runtime performance, avoids causing
recompilations on iteration count changes, and allows supporting
dynamic iteration counts.

(EEVEE-only)

Pull Request: https://projects.blender.org/blender/blender/pulls/145269
2025-10-08 16:38:14 +02:00