Commit Graph

121490 Commits

Author SHA1 Message Date
Hans Goudey
cec05ab440 Cleanup: Use mesh helper functions to access vertex group data 2025-07-10 16:17:05 +02:00
Hans Goudey
c21a98d76a Cleanup: Use references for CustomData arguments in data transfer 2025-07-10 16:17:05 +02:00
Hans Goudey
325ceabb09 Fix #141721: Adding curve attributes doesn't invalidate caches
In this report, adding the "resolution" attribute didn't clear the
evaluated positions cache. In some cases capturing an attribute on
the mesh might just add the mesh rather than using an attribute
writer.
2025-07-10 10:02:25 -04:00
Brecht Van Lommel
69862114a6 Fix: Preview render memory leak with new system ID properties
Could be reproduced by going to material properties and changing the
Principled BSDF base color.

Pull Request: https://projects.blender.org/blender/blender/pulls/141679
2025-07-10 15:31:36 +02:00
Nathan Vegdahl
69433a181e Fix #141024: Normalize active vertex group properly
When manually setting a group's vertex weight, auto-normalization would
fail in some circumstances, such as when all other groups are locked.

The root cause of this issue was our approach for ensuring that the
weight specified by the user remained as-is when possible during
normalization. Rather than "when possible", it erroneously *always*
ensured the weight stayed as-is even when that made normalization
impossible. It came down to this:

1. Normalization is done as a post process, with no knowledge of what
   changes were just made to the weights.
2. In order to (try to) make up for that and ensure that the just-set
   weight remains as the user specified, the active group was
   temporarily locked during normalization, which could prevent
   normalization in some cases.

This PR fixes the issue by introducing a new internal-only concept of
"soft locked" vertex groups to the normalization functions, intended to
be used in exactly these cases where there are weights that have just
been set and we want to avoid altering them when possible. Soft-locked
groups are left untouched whenever normalization is achievable without
touching them, but are still modified if normalization can't be achieved
otherwise.

This has been implemented by introducing a new bool array alongside the
"locked" bool array in the core normalization functions.  Although all
uses in this PR only ever specify a single group as "soft locked", using
a bool array will make it easy to use this concept in other weight
painting tools in the future, which may modify more than one group at
once.

Pull Request: https://projects.blender.org/blender/blender/pulls/141045
2025-07-10 14:51:50 +02:00
Nathan Vegdahl
caddde1eb7 Refactor: Clean up and modernize core vertex weight normalize functions
- Add code documentation.
- Use Span and references rather than pointers everywhere.
- Move all core normalization logic into
  `BKE_defvert_normalize_lock_map()`, and have the other variants call
  that. This keeps all the logic in one place, which will help make
  future changes easier since they only need to be made in one place.
- Add unit tests for `BKE_defvert_normalize_lock_map()`.
- Refactor `vgroup_normalize_all()` to be clearer and avoid an
  unnecessary `goto`.
- Make both `vgroup_normalize_all()` and `paint_weight_gradient_exec()`
  only call into a single core vertex normalization function, rather
  than branching into one of many.

No functional change intended.
2025-07-10 14:51:49 +02:00
Bastien Montagne
4ce93a4b4e Merge branch 'blender-v4.5-release' 2025-07-10 14:48:13 +02:00
Bastien Montagne
f7c24c290e Fix #141415: crash when pasting node group node in some cases.
Refactor from e5a921ad9b did not account for the fact that some
`poll_instance` functions may require valid ID pointers in the checked
node. This is the case e.g. of the node group node, as it also checks
all of the nodes inside the referenced nodegroup.

This commit also fixes a logical mistake in the polling check, that
would systematically prevent pasting of nodes with no `poll_instance`
callback.

Pull Request: https://projects.blender.org/blender/blender/pulls/141729
2025-07-10 14:44:42 +02:00
Campbell Barton
aa9eb3dfcb Merge branch 'blender-v4.5-release' 2025-07-10 22:29:24 +10:00
Campbell Barton
8c77f96446 Fix: crash passing in --gpu-backend without an argument 2025-07-10 22:27:04 +10:00
Campbell Barton
ad29066d9c Merge branch 'blender-v4.5-release' 2025-07-10 21:10:20 +10:00
Campbell Barton
ca0929e103 Merge branch 'blender-v4.5-release' 2025-07-10 21:10:15 +10:00
Campbell Barton
841b3e9d81 Fix: avoid divide by zero in the "Stretch To" constraint
A zero scaled axis resulted in the matrix containing NAN values.
Use `safe_divide` to avoid this.

Ref !141654
2025-07-10 21:05:52 +10:00
Pratik Borhade
f4dbe20940 Fix: Grease Pencil: Assert duplicating layer with attributes
When duplicating a layer with layer attribute, caught an assert hit
at `attribute_to_writer()` due to size mismatch between attribute
domain (layers count) and attribute length.
Now fixed by moving `add_node()` prior to `foreach_attribute()`. This way,
extra node already added to runtime data and layer count is updated
inside `ensure_nodes_cache` with the next layers() call

Noticed it during review of !141090

Pull Request: https://projects.blender.org/blender/blender/pulls/141722
2025-07-10 12:13:30 +02:00
Aras Pranckevicius
f6e2afb82a Fix #141715: VSE video proxies lose video rotation
ffmpeg_copy_display_matrix needs to be done after avcodec_parameters_from_context
call, since that one (re)initializes all the parameters.

Pull Request: https://projects.blender.org/blender/blender/pulls/141716
2025-07-10 11:42:24 +02:00
Sergey Sharybin
3f6861f8f3 Merge branch 'blender-v4.5-release' 2025-07-10 11:37:27 +02:00
Sergey Sharybin
413d8e5406 Fix #141651: VSE: The Channel setting does not work independently in multiple areas
Make display channel part of the key for the final cache.

The prefetch uses display channel of 0, which is the default. It might
need to be adjusted, but it is unclear whether it was behaving different
prior to the 9e4c26574a.

Pull Request: https://projects.blender.org/blender/blender/pulls/141670
2025-07-10 11:35:39 +02:00
YimingWu
69da277dcb Fix #141693: Grease Pencil: Restore jitter behaviour
The line to get `jitter_settings_` was accidentally removed by
cac2806ee2. This patch adds that back so
strokes will still have the correct jitter settings when drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/141707
2025-07-10 11:03:07 +02:00
Mohamed Hassan
148eb703e1 Compositor: Integrate Sun Beams node into Glare node
This patch integrate the Sun Beams node into the Glare node as a new
mode. This is done because the Sun Beams node is mostly useless on its
own because it does no thresholding or addition, making it very hard to
use. On the other hand, the Glare node already does thresholding and
addition, so Sun Beams fits perfectly in it.

Pull Request: https://projects.blender.org/blender/blender/pulls/141424
2025-07-10 10:43:05 +02:00
Campbell Barton
ec4556ee98 Merge branch 'blender-v4.5-release' 2025-07-10 18:15:38 +10:00
Campbell Barton
7d4dc48c17 Merge branch 'blender-v4.5-release' 2025-07-10 18:15:34 +10:00
Campbell Barton
9f666b3ca8 Fix #139982: Subdivide curves doesn't interpolate curve tilt
Correct bezier curve interpolation & support tilt for bezier & nurbs
curves.
2025-07-10 18:07:51 +10:00
Aras Pranckevicius
077bd15387 Fix #141652: python exception when adding VSE Fade
Keep invalidate_cache('COMPOSITE') working, and map that to invalidation
of final frame & intra-frame caches of the strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/141714
2025-07-10 09:51:53 +02:00
Guillermo Venegas
f22ea2e0ae Refactor: UI: Remove uiItemEnumO* functions
Similar to other removed UI layout functions, this removes uiItemEnumO*
functions and replaces them by calling `uiLayout::op` and writing enum
properties to the returned RNA pointer.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/141632
2025-07-10 07:57:21 +02:00
Campbell Barton
96b47a12fc Merge branch 'blender-v4.5-release' 2025-07-10 15:32:48 +10:00
Campbell Barton
68f559db5d Fix #141663: Wrong help-line displayed when rotating the camera
When transforming a camera show a helper line from the frame center.
2025-07-10 05:29:47 +00:00
Jesse Yurkovich
4fdf760412 Cleanup: format 2025-07-10 03:49:24 +02:00
Campbell Barton
aabedd8ad1 Merge branch 'blender-v4.5-release' 2025-07-10 10:52:19 +10:00
Campbell Barton
4a68512db9 Fix #141612: Boolean crash with NAN mesh vertex coordinates
Resolve crash caused from initializing `mpq3` values with NAN.

Ref !141655
2025-07-10 10:47:15 +10:00
Campbell Barton
5dd160c39c Cleanup: indentation in cmake, sort files 2025-07-10 00:40:42 +00:00
Campbell Barton
16e06a29f0 Cleanup: typo, spelling 2025-07-10 00:38:09 +00:00
Campbell Barton
96c214b0d2 Build: add missing include for Linux & GCC15 2025-07-10 10:38:03 +10:00
Lukas Stockner
cf92af3ac4 Cycles: Support Thin Film iridescence in the Glass BSDF
Supporting this on the Metallic BSDF will require some extra work,
and on the Glossy BSDF it doesn't make much sense conceptually
(for that kind of shader setup, we'll want to support layering in SVM),
but Glass BSDF just needs to be hooked up so might as well do that.

Pull Request: https://projects.blender.org/blender/blender/pulls/140832
2025-07-09 22:07:24 +02:00
Sean Kim
cd567f15af Cleanup: Remove unused includes in sculpt_* and paint_* files
Pull Request: https://projects.blender.org/blender/blender/pulls/141687
2025-07-09 21:37:04 +02:00
Brecht Van Lommel
bc507861f2 Logging: Some tweaks to capitalization and log levels
For NDOF, Vulkan context, operators and events.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:27 +02:00
Brecht Van Lommel
d7cc940825 Logging: Log GHOST backend, GPU backend and GPU device
Important information that could not be found directly in the logs yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:27 +02:00
Brecht Van Lommel
4653b65f7c Logging: Add DEBUG, TRACE severity, replace numeric levels
The numeric levels have no obvious meaning. This removes the distinction
between severity and levels, instead there is a single list of named levels
with defined meaning.

Debug means information that's mainly useful for developers, and trace is for
very verbose code execution tracing.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Brecht Van Lommel
8d8e61fefd Logging: Change various categories and log levels
* Remove bke, ed and wm prefixes
* Add prefixes like: geom, object, blend, lib.
* Shorten some category names
* A few log level changes to improve --log-level info output

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Brecht Van Lommel
15d5f957ac Logging: Use CLOG for render progress
* Add render category, which is automatically enabled when using -f or -a
  command line flags for background rendering.
* Add extra logs to mention scene, view layer and frame ahead of time rather
  than including it in every line.
* Remaining time was removed from Cycles, this will be added back for animations
  at the render pipeline level.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Brecht Van Lommel
d5f84d0016 Logging: Revamp default behavior and command line arguments
* Modify --log-level to accept error/warning/info/debug string values
* Add --log-show-source, now hidden by default
* Remove --log-show-basename, path is now on own line
* Add --log-show-memory
* Remove --log-show-timestamp, now always shown

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Brecht Van Lommel
9e0e860835 Logging: Redirect BKE_report prints to CLOG
For more consistent formatting of logs.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:25 +02:00
Brecht Van Lommel
8392ca915b Cycles: Remove glog dependency, redirect logs to CLOG
* Add own simple logging system to replace glog, which is no longer
  maintained by Google.
* When building in Blender, integrate with CLOG and print all messages
  through that system instead.
* --log cycles now replaces --debug-cycles. The latter still works but
  is no longer documented.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:24 +02:00
Brecht Van Lommel
9a3a090dbc Refactor: Clog: Port to C++
This is the last remaining C file that uses MEM_guardedalloc.h.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:23 +02:00
Hans Goudey
5bdec246ea Cleanup: Fix build error from missing include in threads.cc
`<algorithm>` was missing for me, though the build passed on the
build bots. Also remove some unused includes.
2025-07-09 14:32:30 -04:00
Sean Kim
06efb20b78 Cleanup: Extract paint.sample_color operator to separate file
Pull Request: https://projects.blender.org/blender/blender/pulls/141641
2025-07-09 20:29:11 +02:00
Miguel Pozo
f46aa9a1ea Core: Add BLI_thread_queue priority and cancel support
Add functionality required for using BLI_thread_queue for shader compilation, as
discussed in #140214.

Pull Request: https://projects.blender.org/blender/blender/pulls/140992
2025-07-09 18:04:51 +02:00
Miguel Pozo
6d9ad29c2a Merge branch 'blender-v4.5-release' 2025-07-09 15:16:46 +02:00
Miguel Pozo
88f812bf9a Fix #141253: Bring back the global Draw lock
Alternative solution to #141392 / #141564.

As a recap, the DST global lock (which prevented running drawing code
from multiple threads concurrently) was removed for 4.5 (#134690).
One unforeseen issue is that Images (and their GPUTextures) are shared
across dependency graphs (and therefore multiple threads), meaning we
are running into data race issues with them.

@fclem did #141392 and I continued it #141564. However, this is only a
partial solution, parts of the GPUTexture API and the whole BKE_image
API are still unsafe.
Trying to solve all the possible underlying issues seems unrealistic for
4.5 given the time frame and that the extension of the code affected by
this issue is quite large.

So this PR just brings the 4.4 locking behavior instead, which, while
risky on its own, seems much safer to me than the alternative.

This effectively undoes the improvements from #134690 by disabling
concurrent rendering, but instead of reverting all the code, it just
ensures we hold the lock in the same places we did in 4.4.
This means there's some redundant code that is not technically needed
anymore, like the `submission_mutex`, but it's probably best to make as
few modifications as possible, given how close we are to release and
that this is only intended as a temporary measure.

Pull Request: https://projects.blender.org/blender/blender/pulls/141618
2025-07-09 15:11:29 +02:00
Jeroen Bakker
4d9c5ebd97 Vulkan: Move Wayland/HDR support out of experimental
This PR moves Wayland/HDR support out of experimental.
This allows more people to test and provide feedback. We
can always decide later to disable it for the release, but so
far we only got positive feedback.

Pull Request: https://projects.blender.org/blender/blender/pulls/141666
2025-07-09 13:24:31 +02:00
Thomas Dinges
82f75f22ef Release: Bump 4.5 to release candidate 2025-07-09 12:56:08 +02:00