Commit graph

1902 commits

Author SHA1 Message Date
Hans Goudey
048d17e6dd Mesh: Use Embree for triangles BVH tree
This PR begins to replace the use of Blender's "BLI_kdopbvh" BVH tree
for meshes with Embree. Embree is a much newer implementation and and
has much better performance characteristics. In particular, building
the BVH is over 5 times faster. Raycasting against the BVH and closest
point sampling is faster as well.

With the extensive usage of the old BVH API across Blender, it's
unrealistic to do a complete replacement in a single PR. This change
focuses on the triangle surface BVH, in cases where the replacement
is relatively obvious. The idea is that enough uses are covered so
that in most use cases only the Embree BVH will be needed.

Because Embree is an optional dependency, there also needs to be a
fallback to use the old API. If we ever wanted to remove the old BVH
implementation we could discuss making it a mandatory dependency.

Test results are different in a few cases because Embree chooses a
different triangle for the arbitrary choice of closest triangle on
either side of an edge. I also had to increase the threshold for the
hair dynamics test, where small differences in any intermediate values
are chaotically amplified.

Next steps are described in #161529.

This was investigated before in !108148.

Pull Request: https://projects.blender.org/blender/blender/pulls/156408
2026-08-12 17:26:03 +02:00
Hans Goudey
bb76b9db40 Mesh: Store skin modifier data as generic attributes
Replace the internal storage of skin radius and the "root" and "loose"
flags with generic attributes with names "skin_modifier_{radius/root/
loose}". File format backward and forward compatibility is maintained,
as is API compatibility. Overall this means the data should be
propagated in more places and supported in Geometry Nodes, node tools,
etc. One possible behavior change is that the default value is not
baked into the type anymore, but the existing operators used to create
the data maintain the old default.

Pull Request: https://projects.blender.org/blender/blender/pulls/162049
2026-08-11 14:44:55 +02:00
Campbell Barton
849c01e6b8 Tests: fix bl_keymap_completeness.py test for keymap_hierarchy.py
Restore the keymap completeness test which has been effectively
disabled since [0].

Address various issues that broke `bl_keymap_completeness.py`.

- Ensure the keymap is loaded in background mode.
- Identify key-maps by name, space & region types.
- Add special handling for tool fallback keymaps.

Ref !162440

[0]: d7d9320f09
2026-08-11 16:43:06 +10:00
Campbell Barton
69f5d770c4 Core: support for mixing global undo with other undo systems
Address a long standing limitation with undo: where edit-mode often
prevented edits in other areas from being tracked by undo.

Allows properties in the object/scene to be adjusted while in edit-mode
supporting undo for both edit-mode and global undo steps to co-exist.

Details:

- This works by encoding undo with a "hint"
  that the change includes MEMFILE undo changes.
  - This hint can be created from property edits -
    where we know which kind of property is being edited.
  - It can also be calculated before adding a generic undo step,
    to check if other data needs a global undo step
    (editing a scene or object while in edit-mode for e.g.).
- The undo system checks for this hint and adds a hidden "pre"
  MEMFILE undo step in these cases
  (the initial MEMFILE undo step is already done at times,
  we make use of that).
- Eventually the mode-specific undo step creation can be skipped,
  this has been left out as it's a larger change which impacts
  each undo system.
- Added tests to support mixing edit-mode mesh and 3d text
  with MEMFILE undo.
- When pushing undo steps a check for changes outside
  the mode is performed (in parallel, per ID type),
  in my own tests the ID scanning overhead is negligible,
  even on heavy files.

Resolves: #50423, #75013, #153282.

Ref !161566
2026-08-11 04:01:33 +00:00
Tibo Stans
e4218ae71a Geometry Nodes: Reuse audio readers for sound frequency sampling
Reuse AUDASPACE readers between uncached Sample Sound Frequencies windows
instead of creating a new reader for every window.

Readers are acquired through a small cache associated with the current
`bSound` runtime generation. An RAII lease automatically returns readers after
use, while failed seek or read operations discard potentially invalid readers.

The cache retains at most two idle readers. When all cached readers are in use,
a new reader is created outside the cache lock instead of making concurrent
evaluations wait.

Cached samplers and their reader cache remain alive for evaluations already in
progress when a sound is reloaded or freed.
2026-08-10 18:48:26 +02:00
phantomsoldierking
8538e51023 UI: Add tests for menu search and item execution
Tests for menu search and execution across multiple Blender editors
using `wm.search_single_menu`. These tests help catch regressions
involving Failures in editor-specific add workflows (objects, modifiers,
nodes, sequencer strips, grease pencil layers), Menu search failing to
poll correctly in specific editor contexts etc.

The following UI workflows are now covered:

**3D Viewport**
- Search and execute mesh add operation (`Monkey`)

**Properties Editor**
- Search and add object modifier (`Subdivision Surface`)

**Sequencer**
- Search and add strip (`Adjustment Layer`)
- Search and add strip modifier (`Color Balance`)

**Node Editor**
- Shader node add (`Math`)
- Compositor node add (`RGB Curves`)
- Geometry node add (`Transform Geometry`)
- Node swap search (`Math`)

**Grease Pencil**
- Search and switch active layer (`Layer 2`)

Pull Request: https://projects.blender.org/blender/blender/pulls/160099
2026-08-07 21:19:27 +02:00
Sean Kim
5ddbfb0faa Fix: Sculpt UI primitive_tool_add test broken after recent change
Pull Request: https://projects.blender.org/blender/blender/pulls/162397
2026-08-06 21:44:55 +02:00
Christoph Neuhauser
7d641fe968 Tests: EEVEE: Blocklist volume_instance test for Intel Windows
Previously, the blocklist for volume_instance was only applied to the
OpenGL backend for Intel Windows. While this issue was presumably fixed,
the same issue can also be seen sporadically for the Vulkan backend.
Until the issue has been investigated, it makes sense to blocklist both.

Pull Request: https://projects.blender.org/blender/blender/pulls/162411
2026-08-06 16:16:19 +02:00
Bastien Montagne
e4ffb0dd8c Fix: blendfile/linking related tests after recent changes.
Since direct/indirect linked status is now revalidated also after each
linkig operation (see c596762b20), some test expectations were not
correct anymore.
2026-08-06 16:06:55 +02:00
Dalai Felinto
a9e061dc90 Asset Library: Authentication token support
This introduces access tokens to Asset Libraries.

* The access tokens use the same Bearer Authentication as used by
extensions.

* This reset the token if "use_auth_token" is disabled. Actually it set
it to random values and then set it to null, to avoid it lingering in
memory. This could also be implemented for extensions repository.

Pull Request: https://projects.blender.org/blender/blender/pulls/162163
2026-08-06 12:39:09 +02:00
Bastien Montagne
a91a10d785 Fix: Actually enable link test for io_collection.
Removed the `test_` part of the function name by mistake in 56f45c663b.
2026-08-06 10:52:15 +02:00
Sean Kim
8297ddc635 Fix #161905: External Multires data cleared when exiting Edit Mode
Caused by 8adba33029

When moving the backing of Mesh attributes to `AttributeStorage`,
handling external packed data was missed. This adds explicit support for
it for `CD_MDISPS` data when converting `Mesh` to and from `BMesh`.

Additionally, this fixes a number of issues when handling `.blend` files
that reference external `.btx` files.

* Loading external Multires data in background mode may have failed
  previously if the depsgraph was not up-to-date, as the reading process
  would unset the `MDisps` `totdisps` value, resulting in a failure when
  reading 0 bytes of data
* Saving files to different directories could fail to rebase the
  external filepath correctly, this is because the base filepath was
  calculated from the `Main` of the owning ID, rather than the target
  resulting filepath.

Pull Request: https://projects.blender.org/blender/blender/pulls/162110
2026-08-06 04:25:33 +02:00
Oxicid
51efbf159a PyAPI: Add useful exceptions to CollectionProperty.move()
The lack of exceptions for invalid indices makes bugs harder
to track down.

Also includes additional tests.

Ref !161833
2026-08-06 09:27:38 +10:00
Tibo Stans
a873bd6561 Fix #161953: Avoid copying edit mesh wrapper for shape keys
Entering Edit Mode on a mesh with shape keys could copy the final
mesh component after it had already been shared with the edit cage.

The generic component copy did not preserve all
runtime state required by the Edit Mode BMesh wrapper.
The copied final result was subsequently handled by
`MeshRenderData` through the regular `MeshExtractType::Mesh` path,
as though it were an array-backed mesh.
Viewport extraction then attempted to access mesh arrays that
were not available and asserted in `Mesh::faces()`.

Assign the evaluated shape key before sharing the final mesh
component with either the explicit or fallback cage. In Object Mode,
retrieve the final mesh pointer after potential writable
access so copy-on-write cannot leave a stale pointer.

Also add an undo test that would have caught this regression.

Ref !161986
2026-08-06 09:17:12 +10:00
Sean Kim
db305b6a08 Fix #162097: Crash when displaying loose edges after Sculpt hide
When a hide face set operation is performed in Sculpt Mode, the
`.hide_poly` values are eventually flushed to the `.hide_edge` and
`.hide_vert` attributes. If the mesh has loose elements, and these
attributes are newly created, it's possible that these attribute arrays
will miss initializing some values.

If these values are then used as part of rendering, we may invoke UB and
ultimately a crash.

To fix this, if the attributes are newly created, explicitly fill the
loose elements with the default value of `false`

Pull Request: https://projects.blender.org/blender/blender/pulls/162169
2026-08-05 21:44:50 +02:00
Bastien Montagne
56f45c663b Fix: Collection Import: Incomplete 'make linked' on imported data.
`BKE_main_merge_as_archive_library` would not properly propagate the new
library to embedded IDs, and would miss adding the direct/indirect tag
to all IDs.

Also enable the `link_after_import` related disabled test.

Pull Request: https://projects.blender.org/blender/blender/pulls/162354
2026-08-05 13:59:51 +02:00
Jesse Yurkovich
710d7de3e4 Revert "Fix: IO: Embedded IDs were missing their library after collection import"
This reverts commit d769b0ee1e.

Recent ID changes have broken the test again.

Pull Request: https://projects.blender.org/blender/blender/pulls/162336
2026-08-04 21:54:10 +02:00
Tibo Stans
ef8ef3f36b Fix #161987: Avoid compositor modifier UI crash with one input
The Sequencer Compositor modifier UI checked whether the node group had
at least one interface input before accessing the second input used for
the optional mask.

A node group with exactly one input therefore caused an out-of-bounds
access when an ID mask was assigned and the Strip Modifiers panel was
redrawn.

Require at least two interface inputs before validating the mask input.

Pull Request: https://projects.blender.org/blender/blender/pulls/162031
2026-08-04 21:18:56 +02:00
Jesse Yurkovich
d769b0ee1e Fix: IO: Embedded IDs were missing their library after collection import
Embedded IDs were missing their library after collection import which
caused asserts inside `BKE_main_id_indirect_linked_update`.

Pull Request: https://projects.blender.org/blender/blender/pulls/162298
2026-08-04 20:02:23 +02:00
phantomsoldierking
8b2f90d536 UI: Add workspace tool activation regression tests
Activates all tools in the 3D view, sequencer, node editor and image
editor. This can help finding regressions in tool activation, drawing
code or other related code.

Note that the sequencer test fails on Windows AMD64 Intel buildbot
workers. This same failure is already present in another test and seems
related to either a driver issue or the GPU module.

Pull Request: https://projects.blender.org/blender/blender/pulls/161585
2026-08-04 18:24:30 +02:00
Le Gia Bao
51daedddde Fix #129533: EEVEE: Dither film accumulation to avoid shadow banding
Since the same pixel gets used every sample,
the rounding error accumulates and biases the
result instead of averaging out, as we're using
a fixed offset.

Fix by dithering the rounding offset per
sample instead of using a fixed value.

Pull Request: https://projects.blender.org/blender/blender/pulls/161958
2026-08-04 14:23:01 +02:00
Bastien Montagne
6035c1baa3 Fix: Core: ammend asserts on linked status of unlinkable ID types.
Unlinkable ID types (like shape keys) used to always be indirectly
linked. This is not more true with packed linked data, where they can be
considered as directly linked. Addapt related asserts accordingly.

Also added a shapekey to generic blenfile generated to test linking etc.
Shapekey have a special status in Blender, and just having them there
helps catching issues related to them.

See also
https://projects.blender.org/llm-test/llm-reports/src/branch/main/llm_review/log_2026_w32.md#fix-core-packed-ids-read-from-main-blendfile-not-tagged-as-directly-linked
2026-08-04 12:51:13 +02:00
Jesse Yurkovich
a44964a6f2 Tests: Add collection import tests
Add an initial set of Collection import tests, validating what's there
today and leaving room for what will soon be added/fixed.

Of note, the `test_link_after_import` test is disabled since the
recently committed bb67052433 is causing
asserts. Still debugging the root of the problem.

And the `test_import_multi` test is disabled because I'll need to rework
the Library handling to properly account for this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/162252
2026-08-03 22:53:37 +02:00
Oxicid
e81d8ae45a PyAPI: support 2D KDTree's for mathutils.kdtree.KDTree
Support 2D KDTree's as well as 3D, allowing KDTree's to be built
from 2D data, using 2D coordinates for lookups/searching.

- Add dimension keyword argument for new KDTree's.
- Add KDTree.dimension read-only accessor.
- Add `Doxygen` documentation.
- Update tests.

Ref !159342
2026-08-01 09:24:10 +10:00
Guillermo Venegas
ad89bd72d7 UI: WM: Add python API for activating RNA buttons
This adds a `WindowManager::try_activate_rna_button` method for
activating RNA buttons with an specific state (only `Highlight`,
`WaitKeyEvent`,`NumEditing`, `TextEditing` are support by now) and
returns the center point of the button  in window coordinates when
successfully activated (or just highlighted). Any other active button
would be deactivated when activating a button.

This also adds tests for text buttons interactions.
Note: `Ctrl + mouse wheel up/down` string value cycling was not tested
since is not supported in side panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/152910
2026-07-28 21:35:33 +02:00
Sybren A. Stüvel
22c6712a5e Assets: encode minimal/until Blender versions in asset blend file name
Add support for setting the minimal/until Blender versions for assets
with markers in the filename. This makes it possible to replace assets
for newer versions of Blender, while keeping the older versions around
for backward compatibility.

The minimal required version of Blender can be encoded in the filename
by using a `@bX_Y` marker, for example `filename@b5_3.blend` if the
assets in that file require Blender 5.3 or newer. This also has an
effect on the file `filename.blend` if it exists, as assets from that
file will get their 'until' field set to 5.3 as well.

A concrete example with three files:

- `filename.blend`: used on Blender versions older than 5.3.
- `filename@b5_3.blend`: used from 5.3 until 6.0 (exclusive).
- `filename@b6_0.blend`: used from 6.0 onward.

This naming scheme has the advantage that the `filename.blend` file
itself does not have to change (and thus does not need re-downloading)
when a successor is added to the library. The only thing that changes is
its asset listing.

Finer granularity than major & minor versions is not possible, so this
does not work to replace an asset between versions 5.3.0 and 5.3.1.

Blender 5.2 already supports the `min` and `until` fields that this
mechanism sets. This PR just adds the functionality to the listing
generator, so that Blender 5.3's generator can be used in a way that
hides incompatible assets from Blender 5.2.

The `min` field is set to the maximum of the marker and the version of
Blender that was used to write the file. So when a file
`filename@b5_3.blend` was written with Blender 5.4, it will still
require Blender 5.4. The generator will log a warning when this occurs.
In this example, the assets in `filename.blend` will be used until 5.3,
as per the marker in the filename.

Pull Request: https://projects.blender.org/blender/blender/pulls/161998
2026-07-28 16:35:49 +02:00
Campbell Barton
2573c5b331 Tests: add test to ensure UV selection face syncing works
Address issue from #162004.
2026-07-28 14:09:26 +10:00
Campbell Barton
9b68c5aec8 Tests: remove debug file-save from bl_pyapi_bmesh 2026-07-28 13:38:07 +10:00
Sean Kim
d33e9593a4 Tests: Make Sculpt UI tests more resiliant to small viewport changes
Avoid comparing against exact numbers for gesture based tools, as there
may be slight differences in the viewport based on movement and initial
positioning that make these test too flakey to compare for exact values.

Pull Request: https://projects.blender.org/blender/blender/pulls/161925
2026-07-27 16:58:43 +02:00
Sean Kim
e0f0db2797 Tests: Add UI test for Sculpt undo with no-op memfile step
Pull Request: https://projects.blender.org/blender/blender/pulls/161436
2026-07-23 23:05:29 +02:00
Campbell Barton
5273d6c33c Cleanup: use ASCII characters for code-comments 2026-07-23 15:52:00 +10:00
Jesse Yurkovich
0a22996773 Fix: USD: Correctly handle text, metaball, and NURBS surface instances
Text, metaball, and NURBS surface objects get converted to meshes as
part of depsgraph evaluation and will be detected as a "dupli" which
were then excluded for export; as otherwise we'd get double exports.

However, this exclusion needs to be more selective because such objects
would then be excluded incorrectly if they were inside an instanced
Collection or when instanced through point clouds. Only exclude them if
they are the same original object, preventing duplicate exports but
allowing true instancing to work.

Added new test which instances a Collection of these object types using
both collection instances and point instancing.

Pull Request: https://projects.blender.org/blender/blender/pulls/161710
2026-07-23 05:03:11 +02:00
Campbell Barton
ad97ae3401 Fix: foreach_get requested a read-only buffer it then wrote into
The buffer was requested without `PyBUF_WRITABLE` so read-only buffers
were accepted (`bytes` for example), then written into by
`RNA_property_collection_raw_get`.

Request a writable buffer so read-only buffers fail the request and fall
back to the sequence path, will raise an exception
(assuming it is read-only too).

Ref !161723
2026-07-23 10:42:06 +10:00
Tibo Stans
de622bf216 Fix #161775: Crash in bpy.app.handlers.render_stats in animation render
RenderStats::infostr can legitimately be null for render-stat updates
that only refresh timing and UI information.

The Python render stats callback added in f7aeda7c0f forwarded this
null value to BKE_callback_exec_string, causing a crash during
animation rendering when a bpy.app.handlers.render_stats handler was
registered.

Skip Python callback dispatch when no render stats string is available.
This matches the existing behavior of the background render callback and
avoids generating an artificial empty-string event.

Pull Request: https://projects.blender.org/blender/blender/pulls/161786
2026-07-22 21:06:17 +02:00
Hans Goudey
c24df3a6af Tests: Geometry Nodes: Add regression tests for dynamics assets
Two simple tests for the dynamics assets. Also replace the specific
simulation test Python code with a test for a specific custom property
on the scene which tells the test code to run through the frame range
before applying modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/159118
2026-07-22 20:56:35 +02:00
Tibo Stans
64588da11d Fix #161532: Undoing from Texture Paint into Particle Edit corrupts data
Particle Edit undo restored its mode by calling
`ED_object_particle_edit_mode_enter_ex()` directly.

When the undo step was decoded while Texture Paint was active, the
previous mode was not exited first. Since Particle Edit mode entry adds
its mode bit with `|=`, the object ended up with the invalid combined
mode `48` (`TEXTURE_PAINT | PARTICLE_EDIT`).

Exit the current mode through its normal lifecycle before restoring
Particle Edit, following the same pattern used by sculpt undo.

Files that were already saved with mode `48` crashed during editor
initialization because `object_mode_op_string()` returned `nullptr`.
Unsupported saved modes are now rejected safely, leaving the object in
Object Mode while preserving its particle and hair data so the file can
be resaved.

Pull Request: https://projects.blender.org/blender/blender/pulls/161542
2026-07-21 21:01:47 +02:00
Miguel Pozo
a6b708c1f2 Workbench: Hardware raytraced shadows
Implement optional hardware raytraced shadows for the Workbench engine.

They can be enabled in the `Preferences > Viewport > Quality` settings.
The option will be shown as inactive if the current backend/GPU doesn't
support hardware ray queries (only Vulkan is supported ATM).
A new `gpu.capabilities.ray_query_support_get()` has been added to the
Python API to support this UI functionality.

The visual results are the same as the stencil shadows implementation,
but it provides a significant performance boost on modern hardware.

The raytracing functionality has been implemented in a fragment shader
that mimics the output of stencil-based implementation, so the render
pipeline stays mostly the same.

Co-authored by: Jeroen Bakker

Pull Request: https://projects.blender.org/blender/blender/pulls/161047
2026-07-21 16:57:31 +02:00
Christoph Lendenfeld
4c1b8d11ac Anim: Improved AnimData rename API
Through a convoluted logic the previous AnimData renaming code
basically did:
* For any given ID
* check all FCurves it uses directly for the rename string
(includes owned drivers)
* check all other AnimData in Main if the given ID is being used as
a driver target

When doing that in a loop for many IDs, things can slow down
considerably. The solution is to build a map of ID to the drivers using
it as a target beforehand.
That way, we only have to do loop main once to build the map and
can then reuse it to subsequent calls to the rename function
(which only looks at the given ID)

### Implementation

**Removed `BKE_animdata_fix_paths_rename`**:
Since this function doesn't check for driver targets by looping main,
it missed to rename them leaving invalid drivers behind. When renaming
anything that can be animated it is never correct to ignore driver
targets which is why I removed it. Replaced with calls to
`BKE_animdata_fix_paths`.

**Removed `BKE_animdata_fix_paths_rename_all_ex` and `BKE_animdata_fix_paths_rename_all`**:
This has been replaced with a combination of
`BKE_animdata_build_driver_target_map` and `BKE_animdata_fix_paths`.
By splitting this up we can get the performance
gains when doing many renames at once.

**Added `RNA_path_name_to_infix` and `RNA_path_number_to_infix`**:
The new functions no longer assume anything about the rename string
they are given. Instead the caller has to format the strings accordingly
which is done with this function.
Doing so removes a boolean argument from the API.

In order to get the un-escaped name (which is needed for drivers
targeting pose bones by name) I added `infix_to_name`. This function
is not public because it makes a few assumptions
about the structure of the given string.

**`driver_target_path_fix` no longer verifies the path**
RNA paths for drivers can contain a trailing number like `[0]` to
indicate the array index. For regular rna paths this is usually a
separate integer which is why such paths won't resolve. Verifying the
path would mean that driver targets are not correctly updated, as
confirmed by the unit test that was disabled.
This is now fixed and the unit test was enabled.

### Fixed Issues

Fixes #155262
Fixes #159712
Fixes unreported: Drivers targeting VSE strips break if strip is renamed

Depending on the file, this is up to 27x times faster.

Part of #160849

Pull Request: https://projects.blender.org/blender/blender/pulls/160988
2026-07-21 08:07:41 +02:00
Christoph Lendenfeld
db9fd84d4e Anim: Convert animation between rotation modes
This adds code to convert animation from one rotation mode to another.
There are multiple ways to do the conversion:
* Using Ctrl+R in pose mode
* In the 3D viewport, open the "Object" or "Pose" menu, under
"Animation" there is a new entry "Convert Rotation Mode"
* Using the python API `convert_rotation_mode()` either on bones or
objects

**Important Behavior**
* The result of the operation is always a fully keyed rotation, even
if previously only a single channel was keyed. This is the only way
to ensure that the rotations line up.
* Interpolation may not match. In fact it is expected not to.
This is desired for animators for when they are running into gimbal
lock and they just want to try if a different rotation mode works better.
* In case interpolation *has to* match, there is an option to insert
keys on every frame before the conversion.
* key types are somewhat preserved. We assume that for any given
frame, all rotation keys are the same type.
* keys on all related actions are converted, that includes the NLA

Even though the animation data conversion could be triggered
automatically by changes to the rotation_mode RNA property, I chose not
to do that for a reason.
This may be set directly via python in an addon and we shouldn't
include the costly (and maybe unexpected) side effect of converting
animation.

This adds a new operator `anim.rotation_mode_convert` instead of
modifying the existing `pose.rotation_mode_set`.
Since the operator now works with objects as well, it's probably better
to move it out of the `pose` category.
`pose.rotation_mode_set` and `pose.convert_rotation` from rigify are
deprecated with a warning that pops up every time you execute them.

**Implementation**
The core of the changes are in `anim_convert.cc`.

* `convert_to_rotation_mode` is a high level function that converts
the rotation for a single transformable.
* `build_rotation_fcurve_map` and `convert_rotation_keys` are two
functions that work in concert. The first builds the data structure
to quickly find FCurves by their RNA path and the second consumes
that data to do the conversion.
* `bake_rotation_fcurves` utility function to bake FCurves before
converting their rotation.

This uses the `AnimTransformable` class to make this functionality
available to objects and bones at the same time.
When dealing with multiple transformables, we would need to iterate
the action for each to find the FCurves for it.
To avoid that I added `ChannelbagFCurveMap` which is created by
`build_rotation_fcurve_map`.
With that we can easily iterate iterate the FCurves of each Channelbag
sorted by RNA path.

`KeyframeIterator`
Is a new helper class to iterate all frames with keys of N FCurves.

**Deprecates** the existing `POSE_OT_convert_rotation` operator and
removes it from the pose menu.

Resolves #149607
Resolves #159131

Design: #137281

UI improvements will be handled in a separate PR: !159981

Pull Request: https://projects.blender.org/blender/blender/pulls/154309
2026-07-20 15:31:01 +02:00
Tibo Stans
7847f65137 Fix #161194: Restore implicit UV map selection for legacy textures
Legacy texture evaluation falls back to the active tessface UV layer
when no UV map is explicitly specified.

After active and default UV map state moved to `Mesh`, legacy tessface
conversion still tried to copy the corresponding indices from corner
`CustomData`. This left the generated `CD_MTFACE` layers using index 0,
so textures with an empty UV map name could sample the wrong UV map.

Resolve the active and default UV map names from the mesh when
generating legacy tessface data, restoring the previous implicit
active-UV fallback.

Pull Request: https://projects.blender.org/blender/blender/pulls/161347
2026-07-16 22:22:55 +02:00
Campbell Barton
b0e13d1422 Tests: add corrupt .blend reader files
Add blend files with corrupt SDNA, the files are referenced
from bl_blendfile_versioning `invalid_files` collection.

Ref !161341
2026-07-14 17:55:46 +10:00
Tibo Stans
e0bffa0a9a Fix #158108: Clear stale liquid mesh after failed cache load
When a liquid mesh cache file was missing or failed to load,
`MANTA::readMesh()` returned without clearing mesh data from the
previously loaded frame.

The stale mesh nodes, triangles, and velocities could then be reused as
valid geometry. This made direct frame jumps inconsistently show either
an older liquid surface or the fluid domain bounds, depending on the
previous evaluation state.

Clear the previous mesh data when the requested cache is unavailable or
fails to load, allowing evaluation to correctly fall back to the domain
geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/161305
2026-07-13 16:20:31 +02:00
Christoph Lendenfeld
323d5a0758 Anim: Replace with duplicate Action operator
Add a new operator `Replace with duplicate Action`.
Similar to `Replace with new Action` this looks at the action
of the active object and replaces all users of that action with
a duplicate.

Pull Request: https://projects.blender.org/blender/blender/pulls/158258
2026-07-13 11:44:31 +02:00
Miguel Pozo
2e99eccf5e Tests: Add many lights render test
A scene with 512 lights inside a box, to test that we handle scenes
with many lights correctly.

Disabled in Cycles due to high noise variance between platforms even at
high samples.

Pull Request: https://projects.blender.org/blender/blender/pulls/161009
2026-07-10 19:37:48 +02:00
phantomsoldierking
b9cb979b9e UI: Add tests for pie menus
These tests validate pie menu interactions triggered through simulated
keyboard + cursor drag events across several editors and modes.

This should help find plenty of regressions as it covers a lot of cases
touching many modules.

Covers pies in the 3D View, Graph Editor, Dope Sheet, Sequencer, NLA,
Image Editor, File Browser, Node Editor and Clip Editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/160761
2026-07-10 08:59:59 +02:00
Mark van de Ruit
36b9b24ada GPU: Pass gpu_backend to get_gpu_device_vendor in render tests
As the vulkan backend is now default, `get_gpu_device_vendor()` returns
the selected GPU for Vulkan. In the rare case that OpenGL uses a
different GPU, this causes render tests to use incorrect tolerances and
possibly fail. The PR adds the GPU backend argument to
`get_gpu_device_vendor()` to avoid this\*.

> \* this = confusing me

Pull Request: https://projects.blender.org/blender/blender/pulls/161255
2026-07-09 14:36:38 +02:00
Julian Eisel
468a45c767 Merge branch 'blender-v5.2-release' 2026-07-07 19:27:55 +02:00
Sybren A. Stüvel
18f7719010 Fix #161128: asset downloading can write to unwanted locations
This fixes two related issues:

1. System files could be replaced when downloading assets. A malicious
   asset listing could be constructed that overwrites its own files when
   specific assets are downloaded. This was dangerous, because the
   listing downloader performs various safety checks while the asset
   downloader doesn't (because it's not made for downloading the
   listing). The asset downloader now refuses to download any file when
   that would potentially overwrite a 'system file' (listing file, file
   hash database, those kind of files).
2. Converting asset paths from the listing to a relative path, so they
   can safely be concatenated to the local asset cache path, is now more
   thorough. It now also properly handles Windows paths that are
   drive-relative; these were considered 'relative' by Python's
   PureWindowsPath.is_absolute(), but still can cause the downloaded
   file to escape the path it is meant to be saved to.

Pull Request: https://projects.blender.org/blender/blender/pulls/161198
2026-07-07 19:24:34 +02:00
Sergey Sharybin
84515ec017 Fix #147659: Shadow rays for hair don't support colored transparency
Cycles used a single float for the baked transparency.
Change it to RGBE, so that it is colored, and does not increase the
state size.

Pull Request: https://projects.blender.org/blender/blender/pulls/160680
2026-07-06 16:24:00 +02:00
Brecht Van Lommel
13bf4f3264 Fix: Cycles OSL test failures with default Vulkan Backend
Use OpenGL for these tests for now, until we fix this in LLVM or OSL.
Initializing Vulkan is somehow affecting memory allocating so that the
LLVM JIT is not placing code and data sections within 4GB of each other,
which is a requirement on Windows.

Ref #152968

Pull Request: https://projects.blender.org/blender/blender/pulls/160984
2026-07-02 20:37:57 +02:00