Commit Graph

122322 Commits

Author SHA1 Message Date
Jesse Yurkovich
0240a1f32f Cleanup: CMake: Modernize bf_intern_openvdb dependencies
This follows the other CMake "modernization" commits, this time for
`bf_intern_openvdb` and the OpenVDB dependency itself.

The difference with this one is that `intern/openvdb` becomes an
"optional" dependency itself. This is because downstream consumers often
want to include this dependency rather than openvdb directly, so this
target must also be optional. Optional, in this case, means the target
always exists but may be entirely empty.

Summary
- If you are using BKE APIs to access openvdb features, then use the
  `bf::blenkernel` target
- If you are only using `intern/openvdb` APIs then use the
  `bf::intern::optional::openvdb` target (rare)
- For all other cases, use the `bf::dependencies::optional::openvdb`
  target (rare)

context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/137071
2025-08-12 21:26:38 +02:00
Harley Acheson
42b6c7f804 Fix #132460: Remove File Browser Path Validation
This PR removes validation of saved bookmarks and system paths in File
Browser. The act of checking validity of a path can result in a timeout
that can last many seconds. Blender will have a very long startup time
if any such items are disconnected, invalid, offline, or removed. Even
if these paths are not used during the Blender session, like network
shares used only at work, web storage for some non-Blender use, a
shortcut to a USB drive, etc. Items will not be greyed out, and
clicking on one will result in a timeout _at that time_ but this seems
like expected behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/138218
2025-08-12 21:22:52 +02:00
Jacques Lucke
cea51d82be Refactor: Geometry Nodes: remove bNodeSocketType::geometry_nodes_cpp_type
This type was the same for every socket type supported by Geometry Nodes.
It's always `SocketValueVariant` now. Therefore, it was unnecessary to s
tore an explicit pointer to it.

Pull Request: https://projects.blender.org/blender/blender/pulls/144458
2025-08-12 20:09:52 +02:00
Mohamed Hassan
ce7759bae6 Compositor: Removing Sun Beams node
This patch removes the Sun Beams node since it is now part of the
Glare node. It is versioned using a Glare node of Sun Beams type.

Pull Request: https://projects.blender.org/blender/blender/pulls/144110
2025-08-12 19:53:54 +02:00
Jacques Lucke
69cf5e1ad7 Refactor: Geometry Nodes: use SocketValueVariant to get value from socket
This moves us closer to removing `geometry_nodes_cpp_type` which is
always `SocketValueVariant` now.

Pull Request: https://projects.blender.org/blender/blender/pulls/144445
2025-08-12 19:11:05 +02:00
Falk David
5f721c2e2e Fix: VSE: Scene Strip template ID "new" function not working
In the `Strip` panel in the scene template ID, the "new/duplicate"
operator would duplicate the active scene in the window instead
of the selected scene in the strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/144453
2025-08-12 18:55:26 +02:00
Hans Goudey
cfb8696a73 Curves: Add cyclic curve offsets cache
This will be used to simplify the rendering of cyclic curves and improve
the performance. The cache is just a prefix sum of the cyclic attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/144444
2025-08-12 18:21:52 +02:00
Christoph Lendenfeld
809f7abfb6 Fix #144364: Incorrect RNA update function called for Bones
The issue was that an rna function was called on `Bone`
that expected an `EditBone`. Because the pointer was just casted,
this means it would write into wrong bytes on the struct.

Caused by a43359eb88

Pull Request: https://projects.blender.org/blender/blender/pulls/144447
2025-08-12 17:40:08 +02:00
Leon Schittek
520eaa76ff Fix #144168: Ignore mouse event when creating search popups
When search popups are created at the bottom of the screen, they are
repositioned to stay within the bounds of the main window. This
can cause the cursor to hover over one of the search results, causing
it to become active.

Since some searches put recently searched items at the top of the
result list, the first search result should always be active by default.

This is achieved by ignoring the mouse event after the creation of
the popup by checking if the mouse has actually moved.

Pull Request: https://projects.blender.org/blender/blender/pulls/144296
2025-08-12 17:33:26 +02:00
Clément Foucault
a2515f68b8 Fix: Overlay: Missing fragment output for curve edit overlays 2025-08-12 16:55:42 +02:00
Clément Foucault
f0cff4ff46 Fix: GPU: Shader: Preprocess tests 2025-08-12 16:55:41 +02:00
Habib Gahbiche
d485c2a6d0 Fix: Compositor: Wrong tooltip for Crop Node 2025-08-12 15:36:50 +01:00
Jacques Lucke
951d2d2b3a Refactor: Geometry Nodes: use SocketValueVariant instead of raw pointers
Refactor to get us closer to being able to remove `bNodeSocketType::geometry_nodes_cpp_type`
which is always `SocketValueVariant` now.

Pull Request: https://projects.blender.org/blender/blender/pulls/144419
2025-08-12 16:03:09 +02:00
Aras Pranckevicius
4204609770 VSE: Improve Histogram scope for HDR content
For HDR (float) content, previously the Histogram scope was displaying
-0.25..+1.25 value range. Negative range display is not really useful,
and the upper bound of 1.25 is not really large enough for HDR.

Change the histogram to:
- Display 0..12 range for HDR content, with the same amount of
  uniformly distributed histogram bins (256 bins for 0..1 range, so
  3072 bins for HDR range). Larger amount of bins does not affect
  histogram calculation performance in a measurable way.
- Histogram scale is so that horizontal image range is 0..1 (LDR) part
  of the histogram; HDR part extends to the right. When displaying the
  histogram, the preview area zoom aspect ratio is not locked, so the
  user can arbitrarily change it. Frame All/Selected operators,
  while showing the histogram, frame the entire range.
- Draw maximum R/G/B values as semitransparent vertical lines in the
  histogram.
- Display each bin as a rectangle, instead of lines joining next and
  previous bin values. This feels better especially for isolated bins.
- For vertical grid lines, make the line stop below the text label,
  instead of going through it.

Images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/143537
2025-08-12 16:01:31 +02:00
Jeroen Bakker
ea83567811 Vulkan: Destroy resources in submission thread
This PR moves the responsibility of destroying discarded resources to
the submission thread. Previous implementation could be blocked and
would not always run.

This solves memory leak when rendering in background and keeps the
overall memory usage lower as all is done in a single location.

Pull Request: https://projects.blender.org/blender/blender/pulls/144440
2025-08-12 15:58:49 +02:00
Omar Emara
d2d77a38a1 Compositor: Allow menu sockets for pixel nodes
This patch extends the support for menu sockets in the compositor to
also include pixel nodes. Menu sockets are not yet used in any node, so
this has no apparent effect.

Pull Request: https://projects.blender.org/blender/blender/pulls/144436
2025-08-12 15:36:48 +02:00
Damien Picard
a166db31a9 Fix #144306: I18n: Wrong values in bpy.app.translations.locales
Commit 798f85a710 changed the way the languages menu is generated in
order to improve the items' descriptions. This revealed that items in
`bpy.app.translations.locales` used this description instead of the
identifier, resulting in them looking like:

  'Locale code: ca_AD. Translation progress: 100%'

instead of:

  'ca_AD'

To use the language code, this commit uses the menu item's identifier
instead of description.

-----

This should be backported to 4.5.

Pull Request: https://projects.blender.org/blender/blender/pulls/144366
2025-08-12 15:02:47 +02:00
Bastien Montagne
cbf763e700 LibOverride: Prevent matching collection items only by their index if a name and ID are provided.
If an item name (and ID) is provided, never successfully match only
based on the item index.

This can lead to matching to a complete different ID than the intended
one, which can be catastrophic for the integrity of the next resync.

Also, do not require sucessful match on both source and destination
data, this will always fail in case e.g. an item is removed from a
collection, and can prevent detecting required resync from that
collection then.

This commit also enables new 'harder' test in unittests, added in
previous commit, which is now expected to pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/144429
2025-08-12 14:10:44 +02:00
Bastien Montagne
00375abc38 LibOverride: Fix recursive resync incorrectly clearing hierarchy info.
Recursive resync would validate hierarchy info of all IDs in Main, when
it should only handle the ones in its currently processed 'library level'.

Otherwise, it could incorrectly clear hierarchy info from 'more local'
liboverrides that were still to be resynced, leading to issues like
left-over 'orphaned'/unused liboverrides, needless renames, etc.

Also contains a few 'logical mistakes' fixes in the resync code, though
these did not seem to have any known practical effect.
2025-08-12 14:10:43 +02:00
Clément Foucault
cae6c6d81a GPU: Remove Shader Draw Parameter workaround
With 5.0 we start requiring this extension for GL and VK.
All of our target hardware supports it with up to date
drivers.

Some old drivers were disabling this extension because of
buggy behavior. We simply drop support for them in 5.0.

This allows us to remove a lot of code and the last
shader create info override done at startup. This will
unlock more refactoring of the shader create info into
static classes to reduce binary size and other benefits.

## TODO:
- [x] Remove checks for ARB_shader_draw_parameters
- [x] Remove checks for ARB_clip_control
- [x] Check for the extension on startup for OpenGL
- [x] Check for the extension on startup for Vulkan
- [x] ~~Add user facing popup message about minimum
      requirements not being met.~~ Done using the same
      popup as old hardware.

Pull Request: https://projects.blender.org/blender/blender/pulls/142334
2025-08-12 14:04:41 +02:00
Aras Pranckevicius
9fbc1a5259 Fix #144432: VSE scopes sometimes stop updating during playback
Address it by not only checking whether the image pointer is the same,
but also whether the timeline frame is the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/144433
2025-08-12 14:02:50 +02:00
Christoph Lendenfeld
b06d534148 Refactor: simplify and test ANIM_unit_mapping_get_factor()
Simplify ANIM_unit_mapping_get_factor() by returning early and reducing
cognitive complexity. This will make it significantly simpler to expand it
for other RNA property (sub)types.

Also I added a unit test for rotation conversion between radians and
degrees.

No functional changes.

This is intended as a cleanup for !143880.

Taken over from #144140

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/144427
2025-08-12 12:28:49 +02:00
Jeroen Bakker
42c3f35780 Vulkan: Swap to system memory for device local memory
This PR will swap device local memory to system ram. It relies on
VK_EXT_external_memory and VK_EXT_pageable_device_local_memory
extensions to be supported by the system.

Most platforms support these extensions.

Pull Request: https://projects.blender.org/blender/blender/pulls/144422
2025-08-12 11:51:40 +02:00
Campbell Barton
d278e7d424 Fix #144270: Edge slide fails when moving towards a single triangle
Technically a regression in [0] however even before this commit
there where no check to prevent an intersection being used which
is far outside triangle the vertex is sliding towards.

Resolve by only using the line-line intersection if the intersection
points lie within a conical region defined by the edge pair the user
is sliding towards (see code-comment for details).

Ref !144418

[0]: 49ab0bb844
2025-08-12 09:12:45 +00:00
Lukas Tönne
dab6b45336 Fix #143551: Cache invalidation causes crash when changing node tree item properties
Changing a node tree item property (such as the default value) was using a very
broad and generic "tag" function which invalidates the runtime items cache.
This also invalidates any python iterators due to the API using the runtime
cache. Changing node tree items in a loop will then crash.

It's not necessary to invalidate the runtime items cache when the actual item
pointers have not changed. Most RNA updates only change superficial properties,
or at most require a recursive node tree update due to change of identifiers or
types.

This PR introduces a simpler "tag" function to only tag for tree updates by not
rebuild the entire runtime items cache. It also renames existing functions and
docstrings to better explain what each of them does and should be used for.

The `NodeTreeInterfaceChangedFlag` is removed completely because it is only ever
used as a simple boolean indicator of "item changes" that require a cache
rebuild. It is replaced with an atomic bool like flags used for runtime caches.

Pull Request: https://projects.blender.org/blender/blender/pulls/143932
2025-08-12 11:00:10 +02:00
YimingWu
c3ae3926da Fix #144392: LineArt: End job explicitly when not baking in background
Previously the baking job is not properly ended when not baking in
background, this means when the bake is called from the script, the
interface lock is not properly reset, then parts of the interface can
stay locked afterwards. This fix adds `lineart_bake_endjob` to the
foreground code path so the interface will be unlocked properly.

Pull Request: https://projects.blender.org/blender/blender/pulls/144405
2025-08-12 10:39:45 +02:00
Jeroen Bakker
3b8ea045da Vulkan: Disable descriptor buffers
There are stability issues with the vulkan backend. Some scenes indicate
that there is no space left to allocate the next descriptor buffer. For
stability reasons we will disable descriptor buffers and look into a
better solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/144421
2025-08-12 10:28:28 +02:00
Janne Nylander
c95aa8dbd1 Fix #139258: Grease Pencil: Strokes lose deform groups when moved to another layer
Strokes would lose their deform group values after moving them to a
different layer, because `vertex_group_names` weren't transferred to
the newly created `CurvesGeometry` inside `execute_realize_curve_tasks`.

This commit adds another version of `copy_vertex_group_names` for
Curves, and separates the duplicate code into `copy_vertex_group_name`,
which is used by both meshes and curves.

This also fixed strokes losing deform weights in multiple situations, such as:
- When performing a layer merge.
- When applying generative modifiers like Mirror or Array

Pull Request: https://projects.blender.org/blender/blender/pulls/142881
2025-08-12 10:25:47 +02:00
Clément Foucault
831969f4f0 GPU: Shader: Rewrite default_argument_mutation using parser
This avoid failure cases from the regex.

Pull Request: https://projects.blender.org/blender/blender/pulls/144386
2025-08-12 10:10:12 +02:00
Jacques Lucke
33cc0eb805 Cleanup: remove dead code
This file should have been removed earlier when the bundle storage was
moved to the nodes module.
2025-08-12 09:27:31 +02:00
Jacques Lucke
fbd29acaa2 Cleanup: Geometry Nodes: avoid unnecessary void pointer
All socket types use `SocketValueVariant` now, so using `void *` is not necessary anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/144415
2025-08-12 09:12:08 +02:00
Omar Emara
8d1e26865d Compositor: Support strings sockets
This patch adds support for String sockets in the compositor. The
sockets are not yet used anywhere, but are added to aid development.

Pull Request: https://projects.blender.org/blender/blender/pulls/144327
2025-08-12 08:54:13 +02:00
Jacques Lucke
fa7b8b8532 Cleanup: GeometryNodes: avoid unnecessary void pointer
Pull Request: https://projects.blender.org/blender/blender/pulls/144412
2025-08-12 08:19:40 +02:00
Jacques Lucke
7c5f7434f2 Refactor: Geometry Nodes: use SocketValueVariant in bake api
This simplifies the bake API used by Geometry Nodes by using `SocketValueVariant`
 instead of raw pointers. This is possible now, because all socket types use
`SocketValueVariant` under the hood.

Pull Request: https://projects.blender.org/blender/blender/pulls/144410
2025-08-12 07:59:18 +02:00
Jacques Lucke
d9410660ca Refactor: Geometry Nodes: simplify parameter access
Now that every socket type uses `SocketValueVariant` since #144355, the
parameter access code can be simplified a bit.

This also adds a new `GeoNodesMultiInput<T>` type that's used to access the list
of inputs value multi-input sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/144409
2025-08-12 07:45:03 +02:00
Campbell Barton
f96a73961a Cleanup: avoid "nullptr" in Python strings & error messages
This is a C++ term not expected in exceptions and messages.
2025-08-12 13:32:41 +10:00
Campbell Barton
570eb9c60a PyAPI: minor clarification to error 2025-08-12 13:32:01 +10:00
Campbell Barton
5a22993253 Cleanup: remove redundant parenthesis 2025-08-12 13:32:01 +10:00
Mattias Fredriksson
ffd4c0afb2 Curves: Parallelize NURBS basis cache evaluation with O(n) complexity
Parallelizes implementation for computing the NURBS basis cache.
Removing the unnecessary linear 'find span' search. Due to formulation
of the span find implementation, breakpoints are now evaluated in the
following span rather then in the previous. This does not affect the
point evaluation results, but adjusts how they are computed in the
basis cache.

On top of the threading improvement, removal of the linear search
also means the computational complexity goes from O(n^2) to O(n).
For a very large NURBS curve (250K points), performance is increased
by roughly 40 000 times, and is now interactive!

For cases with large number of small curves. Tests with 25K curves
and 10 control points per curve also indicated a slight performance
improvement, with roughly a 13% reduction in execution time.

Pull Request: https://projects.blender.org/blender/blender/pulls/144000
2025-08-12 04:49:05 +02:00
Campbell Barton
66803e4441 Cleanup: use function style casts 2025-08-12 02:46:51 +00:00
Campbell Barton
6430d486cb Cleanup: quiet unused warning 2025-08-12 12:17:45 +10:00
Hans Goudey
d2cbb42937 Cleanup: Add null check in node tools eval log
Though this is always non-null currently AFAIK, there's no reason
not to add a null check for some safety in the rare case that no
logging evaluation happens before displaying the UI.
2025-08-11 21:57:51 -04:00
Namit Bhutani
4a8490f5bd Fix #144385: "Reorder Mesh Spatially" broken with loose vertices
Fixes missing isolated vertices in `mesh_apply_spatial_organization` by
ensuring non-added vertices (ones not forming a face) are appended to
new_vert_order, preserving correct vertex ordering for meshes with
disconnected geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/144388
2025-08-12 03:53:03 +02:00
Campbell Barton
1dd1073166 Cleanup: sort CMake file lists 2025-08-12 10:24:31 +10:00
Campbell Barton
c00dfded27 Cleanup: consistently hyphenate the term "swap-chain" 2025-08-12 10:12:19 +10:00
Campbell Barton
ab1027c777 Cleanup: capitalization of the term "VSync"
Follow the convention widely used by AMD/Intel/Nvidia.
2025-08-12 10:03:28 +10:00
Philipp Oeser
a5c402792d Fix #139182: Cannot remove material slot in certain case
One thing to keep in mind is that while `ob->actcol` is one-based (if
materials are assigned), `active_material_index` is zero-based so we
have a couple of places to make sure whenever materials are assigned,
we should always be in the range of `1..totcol` for `ob->actcol`.

In the particular case of the report, the last remaining material slot
was removed (`ob->actcol` gets rightfully zero then), but assigning a
material from the `template_ID` then calls `BKE_object_material_assign`
with zero as the active index.

The internal `act` number was corrected [ `std::max<int>(act, 1)` ],
but did not end up in `ob->actcol`.

`BKE_object_material_resize` [which all code assigning/removing/...
materials eventually comes down to] used to do the "sanitizing" actually
(but exited early when `totcol` didn't actually change).
There were other places to, clamping to a proper upper or lower bound.

So to resolve, move the code for sanitizing into its own function and
use it after `BKE_object_material_resize` (and from a couple of places).

Ref !143196
2025-08-12 09:48:49 +10:00
Jesse Yurkovich
5a5f768938 Tests: USD: Replace USDZ export test with another for better validation
Move the existing USDZ export test from C++ to Python for better
validation. The resulting file is now run through the `usdchecker`
system and we also check the contents of the resulting archive for the
expected texture file. This helped uncover a pathing issue in the
resulting archive where the 'textures' directory was misnamed on win32;
though it was still functional.

Pull Request: https://projects.blender.org/blender/blender/pulls/144176
2025-08-12 00:21:04 +02:00
Sean Kim
baf21e61f8 Fix: Use correct mode for pressure sensitivity in Vertex & Weight paint
Note, the previous state shouldn't have resulted in odd behavior, as
neither mode would be defined as a grab tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/144379
2025-08-11 21:59:12 +02:00
Brecht Van Lommel
402080f938 Tests: Remove broken image path in tests
This causes EEVEE tests to fail now that these are logged as errors and
`--debug-exit-on-error` is used when running tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/144376
2025-08-11 21:18:38 +02:00