Commit Graph

1143 Commits

Author SHA1 Message Date
Alaska
01d80cee28 Tests: Add render tests for outputs of the light path node
This commit adds tests for the outputs of the light path node.

This include many typical tests (E.g. Changing the colour of a material
based on if it's a camera ray or not) along with some "unusual" tests.

Examples include:
- Testing many of the light path node outputs on lights.
  - This includes "analytical" lights and mesh lights, which can behave
    differently depending on if Next Event Estimation or forward path
    tracing occurs.
- Adding extra objects using ray portal BSDFs and transparent BSDFs
  just to double check they don't introduce their own issues.

Ref: blender/blender-test-data!55
2025-02-25 04:34:19 +01:00
Habib Gahbiche
4e069f8f5a Tests: Compositor: update failing images only
Previously, when a file output test failed, all images within the same
test case were updated, even images that did not cause the test to fail.

This patch only updates changed/removed images so when the test is run
using `BLENDER_TEST_UPDATE=1 ctest -R compositor_cpu_file_output` git
will only show the modified, added or removed images

Pull Request: https://projects.blender.org/blender/blender/pulls/134852
2025-02-24 12:09:06 +01:00
Sean Kim
8fef9214a7 Tests: Move sculpting render tests out of WITH_GPU_RENDER_TESTS
Adds a new CMake option so that these tests can be run independently of
other tests, and so that existing tests that use WITH_GPU_RENDER_TESTS
are not forced to run these sculpt tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/134893
2025-02-21 20:31:57 +01:00
Miguel Pozo
11390e8f69 Tests: Generate render diffs in parallel
`oiiotool` diff generation is single-threaded and can become a
bottleneck on fast to render tests.

This PR generates diffs in parallel using the `multiprocessing` module.

Overlay tests (local): 90s -> 30s

buildbot +gpu:
macOS: 2020s -> 1808s
Linux: 1901s -> 1327s

Pull Request: https://projects.blender.org/blender/blender/pulls/134938
2025-02-21 19:14:17 +01:00
Miguel Pozo
9f003ee722 Merge branch 'blender-v4.4-release' 2025-02-20 17:21:53 +01:00
Miguel Pozo
ba3749ad47 Overlay: Add tests
This adds support for Overlay tests.

There are some differences with how we handle tests for other engines:
- The renders are captured using `bpy.ops.render.opengl()`, but this
  won't work on our GPU build bots.
- A single blend file can run multiple tests by outputting a txt list
  with the test names.
- Each overlay test blend file requires a matching script file with
  the same name inside `tests/python/overlay/`.
- To reproduce a specific test state you can run
  `blender "(...)/tests/data/overlay/<test>.blend" -P "(...)/tests/python/overlay/<test>.py" -- --test <test-number>`.

Note:
The current test permutations are WIP, so reference images are not
committed to the data repo for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/133879
2025-02-20 17:18:59 +01:00
Clément Foucault
3968be08b5 Merge branch 'blender-v4.4-release' 2025-02-19 11:52:36 +01:00
Clément Foucault
4d17638212 Fix: EEVEE: Broken Metal blocklist
This was the cause of the tests not passing on buildbot.
2025-02-19 11:51:57 +01:00
Hans Goudey
2555f68267 Merge branch 'blender-v4.4-release' 2025-02-18 10:55:49 -05:00
Sybren A. Stüvel
2393d498cb Anim: add RNA function Action.fcurve_ensure_for_datablock(...)
Expose the convenience function `blender::animrig::action_fcurve_ensure()`
to RNA as `Action.fcurve_ensure_for_datablock(...)`.

The function requires that the Action is already assigned to the
data-block. It then takes care of slot assignment / creation, as well as
the creation of a layer and a keyframe strip.

This function call:

```python
fcurve = action.fcurve_ensure_for_datablock(ob_cube, "location", index=2)
```

effectively performs this logic:

```python
# Ensure the slot exists and is assigned:
slot = ob_cube.animation_data.slot
if not slot:
    slot = find_slot_for_keying(action)
if not slot:
    slot = action.slots.new(ob_cube.name)
ob_cube.animation_data.slot = slot

# Ensure a layer exists:
if action.layers:
    layer = action.layers[0]
else:
    layer = action.layers.new("Layer")

# Ensure a keyframe strip exists:
if layer.strips:
    strip = layer.strips[0]
else:
    strip = layer.strips.new('KEYFRAME')

# Ensure the channelbag exists:
channelbag = strip.channelbag(slot, ensure=True)

# Ensure the F-Curve exists:
fcurve = channelbag.fcurves.find("location", index=1)
if not fcurve:
    fcurve = channelbag.fcurves.new("location", index=1)
```

Here `find_slot_for_keying()` represents the logic that's also used when
creating keys via the user interface or the `bpy_struct.keyframe_insert()`
function.

Pull Request: https://projects.blender.org/blender/blender/pulls/134686
2025-02-18 16:04:00 +01:00
Campbell Barton
fa079921ac Tests: add fill_grid tests & update tests/data
Ref !129318.
2025-02-18 13:04:20 +11:00
Campbell Barton
5087246f39 Cleanup: strip trailing space, sort file lists 2025-02-16 20:42:16 +11:00
Alaska
67e34dc74c Merge branch 'blender-v4.4-release' 2025-02-16 18:03:08 +13:00
Alaska
74808ac2c3 Tests: Enable OptiX OSL generated volumetric texture coordinate tests
In a recent commit (1), a bug was fixed where the generated texture
coordinates on volumes in Cycles with OptiX OSL was incorrect.

Due to this fix, OptiX OSL now passes render tests in scenes that use
that feature, so this commit enables those tests on that platform.

(1) 0177537c9a

Pull Request: https://projects.blender.org/blender/blender/pulls/134629
2025-02-16 06:02:04 +01:00
Sean Kim
2266faa962 Merge branch 'blender-v4.4-release' 2025-02-14 15:09:50 -08:00
Sean Kim
3f6bf5ae05 Cleanup: Minor changes for recently added bl_object.py
* Adds SPDX license header
* Resets scene in more standard way

Pull Request: https://projects.blender.org/blender/blender/pulls/134543
2025-02-15 00:09:10 +01:00
Habib Gahbiche
bf4af64809 Cleanup: Tests: remove unnecessary --gpu argument
Pull Request: https://projects.blender.org/blender/blender/pulls/134582
2025-02-14 18:02:31 +01:00
Habib Gahbiche
0db8710df7 Compositor: Regression tests for File Output Node
The patch adds a simple framework to test the File Output Node in the compositor. The main difference to the existing `render_test.py` framework is that multiple output images are supported. Edge cases such as empty output or too many outputs are supported as well.

Tests can be run like other compositor tests, e.g. `ctest -R compositor_cpu_file_output --verbose` or `BLENDER_TEST_UPDATE=1 ctest -R compositor_cpu_file_output` to update failing tests.

Sample output:
```
...
119: [ RUN      ] Running test single_color...
119: [  PASSED  ] Passed
119: [ RUN      ] Running test png_passes...
119: [  PASSED  ] Passed
119: [ RUN      ] Running test mixed...
119: [  FAILED  ] Test directory /home/guest/blender-git/blender/tests/data/compositor/file_output/mixed does not exist
119: [ RUN      ] Updating test mixed...
119: [ RUN      ] Running test no_files...
119: [  PASSED  ] Passed
...
```

Parent task: https://projects.blender.org/blender/blender/issues/125893

Pull Request: https://projects.blender.org/blender/blender/pulls/133663
2025-02-14 16:17:18 +01:00
Sean Kim
9d930c3b0f Tests: Add initial sculpt mesh render test
* Adds new entry into python CMakeLists.txt for running these tests
* Adds `sculpt_brush_render_tests.py` as the report runner and
  test data initializer for the sculpt tests.

This commit adds the ability to do render tests with the Draw brush in
Sculpt mode on a specified mesh by specifying and performing a stroke in
area-space coordinates.

Like other render tests, these tests map a single .blend file to a
single reference image. Currently we test the following cases:

* A "base" mesh.
* A mesh with a Subdiv modifier added but not applied to it.
* A mesh with a basis & relative shape key added.
* A mesh with the multiresolution modifier added.

The associated reference image used is 200x200 pixels, in testing
with the draw brush, even this small resolution was able to detect
differences in detail caused by major regressions.

In total, the new files in the associated assets repository sum up
to roughly 4.5 MB.

Other than the mesh and modifiers, each of the files also contains a
scene with a camera, with workbench settings set to use a matcap for
the final rendering to better highlight curvature differences.

Part of #130772

Pull Request: https://projects.blender.org/blender/blender/pulls/133602
2025-02-14 07:36:00 +01:00
Iliya Katueshenock
a6b394d23b Tests: Add attributes category for render tests
Pull Request: https://projects.blender.org/blender/blender/pulls/134306
2025-02-12 21:54:12 +01:00
Sean Kim
a2b75c87c8 Merge branch 'blender-v4.4-release' 2025-02-11 14:10:10 -08:00
Sean Kim
312579ce82 Fix #134366: object.closest_point_on_mesh always returns no result
Introduced in 024d7d12e2

Pull Request: https://projects.blender.org/blender/blender/pulls/134377
2025-02-11 23:09:20 +01:00
Brecht Van Lommel
2c34786474 Merge branch 'blender-v4.4-release' 2025-02-11 20:43:17 +01:00
Brecht Van Lommel
d8a02dc435 Tests: Update Storm reference renders for USD 25.02 and MaterialX 1.39
Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Clément Foucault
7a284a5eb9 Merge branch 'blender-v4.4-release' 2025-02-10 19:00:09 +01:00
Clément Foucault
4e6f5d43b0 EEVEE: Update Metal Blocklist to make GPU tests pass
`environment_mirror_ball.blend` and `image.blend` are both
failling because of mipmap/anisotropic filtering differences
on apple silicon.

The volume tests has issues with lightprobe baking.

Blocking them until we have a workaround.
2025-02-10 18:58:47 +01:00
Bastien Montagne
4b996baa76 Merge branch 'blender-v4.4-release' 2025-02-10 14:16:47 +01:00
Sergey Sharybin
5437f22faf Fix unknown Cycles test device silently pass
Prevents situation when requested device is HIPRT (while the expected
spelling is HIP-RT).

Pull Request: https://projects.blender.org/blender/blender/pulls/134332
2025-02-10 14:13:42 +01:00
Habib Gahbiche
7a5de7143d Compositor: add test data for pixel nodes
Pull Request: https://projects.blender.org/blender/blender/pulls/134323
2025-02-10 10:40:29 +01:00
Brecht Van Lommel
b66e8bd508 Merge branch 'blender-v4.4-release' 2025-02-06 14:58:18 +01:00
Ray Molenkamp
1540817576 For VFX platform 2025 and more.
Boost (removed!)
Cython 3.0.11
Expat 2.6.4
GMP 6.3.0
MaterialX 1.39.2
Nanobind 2.1.0 (new, for OpenVDB)
NumPy 1.26.4
OpenColorIO 2.4.1
OpenEXR 3.3.2
OpenImageIO 3.0.3.1
OpenVDB 12.0.0
OSL 1.14.3-beta
Python 3.11.11
Robinmap 1.3.0
TBB 2021.13.0
TIFF 4.7.0
USD 25.02
libxml2 2.13.5
zlib 1.3.1

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Jonas Holzman <jonas@holzman.fr>
Co-authored-by: Sebastian Parborg <sebastian@blender.org>

Ref #128577

Pull Request: https://projects.blender.org/blender/blender/pulls/134178
2025-02-06 14:57:02 +01:00
Jeroen Bakker
78c6037741 Vulkan: Render and compositor tests
This PR does some changes to the render and compositor tests

- Compositor test will now test all GPU backends that are compiled
- EEVEE/Workbench render tests will move the GPU backend to the front of the
  test name (eevee_next_opengl_bsdf)
- Blacklist EEVEE render tests that fail on Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/133981
2025-02-06 14:39:15 +01:00
Campbell Barton
115cc6372f Merge branch 'blender-v4.4-release' 2025-02-06 12:40:40 +11:00
Campbell Barton
f62e7c2ef5 Cleanup: add license header & minor changes
- Relocate header text to be the modules doc-string.
- Add `__all__` so linters can detect unused functions.
2025-02-06 12:34:33 +11:00
Bastien Montagne
45f231141d Core: Add info about chain of ancestors (owner data) of a PointerRNA.
The general idea is to store an array of (type, data) pointers of all
PointerRNA ancestors of the current one.

This will help solving cases in our code where the owner (or sometimes
even the owner of the owner) of a random PointerRNA needs to be
accessed. Current solution mainly relies on linear search from the owner
ID, which is sub-optimal at best, and may not even be possible in case a
same data is shared between different owners.

This lead to refactoring quite a bit of existing PointerRNA creation code.

At a high level (i.e. expected usages outside of RNA internals):
* Add `RNA_pointer_create_with_parent` and
  `RNA_pointer_create_id_subdata` to create RNA pointers with
  ancestors info.
* `RNA_id_pointer_create` and `RNA_main_pointer_create` remain
  unchanged, as they should never have ancestors currently.
* Add `RNA_pointer_create_from_ancestor` to re-create a RNA pointer
  from the nth ancestor of another PointerRNA.
* Add basic python API to access this new ancestors data.
* Update internal RNA/bpy code to handle ancestors generation in most
  common generic cases.
  - The most verbose change here is for collection code, as the owner of the
    collection property is now passed around, to allow collection items to get
    a valid ancestors chain.

Internally:
* `PointerRNA` now has an array of `AncestorPointerRNA` data to store
  the ancestors.
* `PointerRNA` now has constructors that take care of setting its data for
  most usual cases, including handling of the ancestor array data.
* Pointer type refining has been fully factorized into a small utils,
  `rna_pointer_refine`, that is now used from all code doing that operation.
* `rna_pointer_inherit_refine` has been replaced by
  `rna_pointer_create_with_ancestors` as the core function taking care of
  creating pointers with valid ancestors info.
  - Its usage outside of `rna_access` has been essentially reduced to custom
    collection lookup callbacks.

Implements #122431.

--------------

Some notes:
* The goal of this commit is _not_ to fully cover all cases creating
  PointerRNA that should also store the ancestors' chain info. It only
  tackles the most generic code paths (in bpyrna and RNA itself mainly).
  The remaining 'missing cases' can be tackle later, as needs be.
* Performances seem to be only marginally affected currently.
* Currently `AncestorPointerRNA` only stores PointerRNA-like data.
  This will help `StructPathFunc` callbacks to more efficiently generate
  an RNA paths when calling e.g. `RNA_path_from_ID_to_property`, but will
  not be enough info to build these paths without these callbacks. And some
  cases may still remain fuzzy. We'd have to add thinks like a `PropertyRNA`
  pointer, and for RNA collection ones, an index and string identifier, to store
  a complete unambiguous 'RNA path' info. This is probably not needed, nor
  worth the extra processing and memory footprint,  for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/122427
2025-02-05 15:45:04 +01:00
Nathan Vegdahl
33b9d54abb Anim: add RNA Channelbag.slot property
This allows Python scripts to easily determine what Slot a Channelbag is
for. This is particularly important because we're trying to discourage
the use of Slot handles in the Python APIs, and before this the only
way to identify which Slot a Channelbag was for was via the Channelbag's
`slot_handle` property.

Pull Request: https://projects.blender.org/blender/blender/pulls/134053
2025-02-04 17:39:03 +01:00
Nathan Vegdahl
f84197f0b9 Anim: ensure correct type prefix when setting Slot.identifier
Previously it was possible to make the type prefix of a Slot's identifier get
out-of-sync with its actual target ID type, by setting the identifier via
Python.

This PR changes `Slot.identifier` assignment to ensure that the type prefix is
set to match `target_id_type`. This now makes it impossible for the identifier
prefix and `target_id_type` to get out of sync, since this API previously was
the only way to accomplish that.

When the prefix that the user attempts to set doesn't match the `target_id_type`
of the Slot, a warning is issued telling the user about the mismatch and that
the identifier has been set with the correct prefix instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/133983
2025-02-04 15:46:22 +01:00
Nathan Vegdahl
eda2f11f7a Anim: change RNA Action.id_root to have backwards-compatible behavior
Most of the old Animato properties on an Action (e.g. FCurve list, Channel
Groups) already act as proxies for the data for the first slot in the first
strip of the first layer. (Say that three times fast!) However, this was not yet
the case for `Action.id_root`.

This PR changes `Action.id_root` to act as a proxy for the first Slot's
`target_id_type` property, both for reading and writing.

If the Action has no Slots, then reading always returns 'UNSPECIFIED', and
writing will create a Slot and set its `target_id_type`.

Note that the ability to write to the first Slot's `target_id_type` via
`Action.id_root` conflicts with `target_id_type` supposedly only being writable
when it's still 'UNSPECIFIED' (#133883). Although that's certainly a little
weird, practically speaking this doesn't break anything for now, and is a
temporary kludge to keep `id_root` working until we can remove it in Blender
5.0. `id_root` will be removed entirely in 5.0, resolving this inconsistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/133823
2025-02-04 13:39:50 +01:00
Christoph Lendenfeld
358a0479e8 Anim: create pose assets to different libraries
Similar to how brush assets are created and managed this
PR allows to export pose assets into a different library.
Because of this there is a limitation to this where each
asset is stored in a separate blend file.
This may be lifted in the future as there are planned changes in
the design phase: #122061

### Create Asset

Now available in the 3D viewport in the "Pose" menu: "Create Pose Asset".
The button in the Dope Sheet will now call this new operator as well.

Clicking either of those will open a popup in which you can:

* Choose the name of the asset, which library and catalog it goes into.
* Clicking "Create" will create a pose asset on disk in the given library.

It is possible to create files into an outside library or add it in the current file.
The latter option does a lot less since it basically just creates the
action and tags it as an asset.

If no Asset Shelf **AND** no Asset Browser is visible anywhere in Blender,
the Asset Shelf will be shown on the 3D viewport from which
the operator was called.

### Adjust Pose Asset

Right clicking a pose asset that has been created in the way described
before will have options to overwrite it.
Only the active object will be considered for updating a pose asset

Available Options (the latter 3 under the "Modify Pose Asset" submenu):
* Adjust Pose Asset: From the selected bones, update ONLY channels that
are also present in the asset. This is the default.
* Replace: Will completely replace the data in the Pose Asset from
the current selection
* Add: Adds the current selection to the Pose Asset. Any already existing
channels have their values updated
* Remove: Remove selected bones from the pose asset

Currently this refreshes the thumbnail. In the case of custom
thumbnails it might not be something want

### Deleting an existing Pose Asset

Right click on a Pose Asset and hit "Delete Pose Asset". Works in the shelf
and in the asset library. Doing so will pop up a confirmation dialog,
if confirming, the asset is gone forever. Deleting a local asset is basically the
same as clearing the asset. This is a bit confusing because you get
two options that basically do the same thing sometimes,
but "Delete" works in other cases as well.
I currently don't see a way around that.

Part of design #131840

Pull Request: https://projects.blender.org/blender/blender/pulls/132747
2025-02-04 11:29:05 +01:00
Campbell Barton
6fcd84721c Cleanup: quiet some warnings from check_pep8 target 2025-02-04 14:51:17 +11:00
Sybren A. Stüvel
226486aa91 Refactor: Anim, rename and adjust ActionKeyframeStrip.channels()
Rename `ActionKeyframeStrip.channels()` to `.channelbag()`, and change
its first parameter from `slot_handle` to `slot`.

This is to be consistent with `ActionKeyframeStrip.channelbags`, which is
the array of channelbags in the keyframe strip. Having a function that's
singluar makes sense for finding a single element in the array.

The change from using the slot handle to using the slot is to be consistent
with `.channelbags.new(slot)`. Furthermore, the Python API should be using
slot handles as little as possible (they're basically meaningless numbers).
Using the slots directly is preferred. If that's not possible, it is
recommended to use the slot identifier (`slot.identifier`) instead, as that
can be used to look up the slot (`action.slots[slot_identifier]`).

This breaks the glTF add-on, which will be fixed in !133915.

Pull Request: https://projects.blender.org/blender/blender/pulls/133868
2025-02-03 20:19:00 +01:00
Jesse Yurkovich
6c11811710 Cleanup: USD: Use the SdfPath type rather than a std::string
Instead of converting to a string immediately, only convert to a string
when necessary, like for trace logging. This reduces the size of the
`USDPrimReader` base class by 24 bytes, makes several Vectors and Maps
smaller at runtime, and reduces some unnecessary string allocations and
conversions in various other places.

The recently added python Hook `get_prim_path` dictionary will now
contain `SdfPath` objects rather than strings; removing the string
conversion cost when calling other USD APIs like `GetPrimAtPath` which
take in `SdfPath` objects to begin with.

This also makes the code a bit more self explanatory since the type
makes it clear what kind of path you are dealing with.

Pull Request: https://projects.blender.org/blender/blender/pulls/133954
2025-02-03 18:44:07 +01:00
Nathan Vegdahl
978011fe43 Anim: use legacy names for data created via legacy APIs
Previously, when use of the legacy Action APIs (specifically the `fcurves` and
`groups` properties) caused a new Slot to be created, it would be named "Slot".

This PR changes things so that Slots created that way are named "Legacy Slot",
just like Slots from upgraded legacy Actions.

The rationale is that Slots created in this way are expected (by the code that
created them) to be used as if the Action were still a legacy Action, and it's
good to reflect that in the name of the data. This also makes it clearer to
users when e.g. scripts and addons they're using may not yet have been updated
to fully work with Slotted Actions.

For consistency, this PR also names Layers created in the same way "Legacy
Layer", the same as Layers from upgraded legacy Actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/133888
2025-02-03 14:48:39 +01:00
Nathan Vegdahl
b5005cd99c Anim: make RNA Slot.target_id_type writable when not yet specified
When loading old blend files, versioned Actions can end up having a slot with an
'UNSPECIFIED' `target_id_type`. Assigning the slot to an ID will then set the
slot's `target_id_type` to match the type of the ID, but there was previously no
way to directly set it via Python if needed.

This PR changes the writability of `target_id_type` to match the extent of its
mutability when assigning a slot to an IDs. Which is to say, it can be set if
it's 'UNSPECIFIED', but not otherwise.

RNA doesn't have a good way to represent this, so we accomplish this with a
custom set function that simply ignores the write if the slot's `target_id_type`
isn't 'UNSPECIFIED'. This isn't ideal, but is the least-bad solution at the
moment.

Pull Request: https://projects.blender.org/blender/blender/pulls/133883
2025-02-03 13:01:47 +01:00
Jesse Yurkovich
3c9a71b46f Fix #132465: Align Alembic/USD crease values with that of OpenSubdiv
In order to better interop with the broader Alembic/USD ecosystem, align
the crease values we export with what we believe is expected by native
OpenSubdiv, a 0-10 range.

On import we will translate the native OpenSubdiv range back into
Blender's 0-1 range.

To account for SubD assets produced by Blender before this change, a
compat check is put in place for both Alembic and USD to use the old
methodology when encountering such files. The compat check makes use
of the Blender version we place inside the format's metadata fields. Old
assets loaded into a new Blender will look ok. New assets loaded into an
old Blender would need to be reworked.

Pull Request: https://projects.blender.org/blender/blender/pulls/132582
2025-02-03 04:38:58 +01:00
Alaska
ce4722a954 Cleanup: Use RenderReport variation in Cycles render tests
In ea7d07098b, the RenderReport base
class was reworked to work better with test variations.

This commit reworks the Cycles render tests file to use the new
variation system for Hardware Ray tracing and OSL tests, avoiding the
custom system put in place in previous commits.

Pull Request: https://projects.blender.org/blender/blender/pulls/133813
2025-02-03 04:16:27 +01:00
Brecht Van Lommel
7f0f8b0e46 Tests: Use descriptive name for tests in reports category 2025-02-01 13:03:39 +01:00
Brecht Van Lommel
4c2fb20e93 Tests: Fix and workaround Metal difference for Storm
* Disable Metal multisampling to match OpenGL.
* Block list all image half/float tests, these can all fail randomly.
* Blocklist tests failing due to issues in OpenUSD Metal implementation.
2025-02-01 13:03:39 +01:00
Sean Kim
f87dd03eb5 Tests: Raise error if global and output directories match
When a given render test defined in CMakeLists.txt with a `--outdir`
parameter ends with a trailing slash, the resulting global report
overwrites the specific test's report. This is because `os.path.dirname`
for a path that ends in a slash returns the same directory, for example,
`os.path.dirname('foo/bar/') => 'foo/bar'

To avoid tests being able to put the report into a weird state, this
commit normalizes the `--outdir` path to strip trailing slashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133791
2025-01-31 22:31:43 +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