Commit Graph

1882 Commits

Author SHA1 Message Date
Alaska
7e7594c7ff Tests: Add Cycles test for transparent spatial splitting artifacts
With the HIPRT backend for Cycles, rays can end up hitting the same
triangle multiple times due to a issue in the spatial splitting
algorithm.

Most of the time this issue isn't visible, but it is quite obvious in
semi-transparent shadows of meshes.

So this commit adds a file that contains a object made up of many
semi-transparent rectangular prisms casting a shadow onto the a plane.

Ref: blender/blender#117527
Ref: blender/blender-test-data!76
2025-03-18 02:01:41 +01:00
Aras Pranckevicius
b20042172c Tests: add more FBX import tests
Add some more import test cases:
- Material animation,
- Automatic bone orientation setting,
- Force connect armature children setting

Pull Request: https://projects.blender.org/blender/blender/pulls/136096
2025-03-17 20:01:19 +01:00
Aras Pranckevicius
c34c1e2812 Tests: more consistently in import test output
- Print negative/positive zeroes the same in more places,
- Sort emitted fcurves, armature bones by name
- More FBX test files from various bug reports

Pull Request: https://projects.blender.org/blender/blender/pulls/136089
2025-03-17 17:30:33 +01:00
Campbell Barton
e4bd387327 Tests: various improvements to the bl_run_operators.py utility
- Use command line arguments to configure options such as random seed,
  running operators on existing blend files & how often the file is
  reset to the initial state.
- Support for generating a script file to replay the actions,
  useful for creating a repeatable script for bug reports.
- Add new context setup functions for edit-mode grease-pencil & hair.
2025-03-16 19:21:15 +11:00
Campbell Barton
73997ee5a9 Cleanup: underscore prefix private functions, use str.format 2025-03-16 16:33:37 +11:00
Campbell Barton
102c454781 Tests: event coordinates for UI tests on macOS with Hi-DPI
Correct the event coordinates by scaling by the pixel_size on macOS.

All the UI tests now pass on macOS.

Ref !136008

Co-authored-by: Sean Kim <SeanCTKim@protonmail.com>
2025-03-16 16:27:39 +11:00
Campbell Barton
f58a054eaf Tests: ui_test_undo.view3d_simple menu search failure
The inclusion of "Add -> Image -> Mesh Plane" causes the menu search
for "Add -> Mesh -> Plane" to attempt to add the image plane.

Workaround the problem by searching for an exact match,
although I think this should be possible to search for menu items
without having to include their shortcuts, especially since these
can be platform dependent.
2025-03-16 16:09:08 +11:00
Maxime-Cots
7d27064870 USD: Add new USD shapes import test
This PR update test data and test case for a few new USD Shapes
(Cylinder_1, Capsule_1, Plane)

Related Links :
* Issue : https://projects.blender.org/blender/blender/issues/134138
* PR: USD: Add Plane Shape import : https://projects.blender.org/blender/blender/pulls/134275
* PR: USD: Add Cylinder_1, Capsule_1 import : https://projects.blender.org/blender/blender/pulls/134944

Test Data PR : https://projects.blender.org/blender/blender-test-data/pulls/58

Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134971
2025-03-15 00:46:16 +01:00
Sean Kim
38870d17e6 Build: Allow UI tests to run locally on all platforms
This commit allows the `WITH_UI_TESTS` CMake option to be used on all
platforms, not only Linux. The existing functionality to use the Weston
compositor was moved into the `WITH_UI_TESTS_HEADLESS` option. When
these tests are run with only `WITH_UI_TESTS`, a visible instance of
Blender is opened up for testing.

Pull Request: https://projects.blender.org/blender/blender/pulls/135889
2025-03-14 22:27:50 +01:00
Alaska
5dadfc7b43 Tests: Add cycles test for baking to a color attribute
This commit adds a file that bakes ambient occlusion to the
color attribute of a mesh, then bakes the color attribute to a texture
and saves that as the test image.

This test is being done to make sure the `bake_offset_towards_center`
function is tested as it is necessary to fix some bugs with
color attribute baking (blender/blender#95969)

Ref: blender/blender-test-data!73
2025-03-14 03:28:44 +01:00
Alaska
24b08e7d09 Tests: Adjust filter glossy on glossy_ashikhmin test to test ashikhmin blur
The Ashikmin Shirley microfacet option for the glossy BSDF has it's own
blurring function for the filter glossy feature.

This commit adjusts the glossy_ashikhmin test to make use of filter
glossy so that this code path can be tested.

Ref: blender/blender-test-data!72
2025-03-13 12:41:38 +01:00
Alaska
42e7a950cd Tests: Add Cycles tests for hidden OSL closures
In Cycles there are three closures (Diffuse Ramp, Phong Ramp,
and Burley diffuse) which are only avaliable through OSL. This commit
adds tests for these closures.

Ref: blender/blender-test-data!70
2025-03-13 08:44:39 +01:00
Alaska
0031f50d6b Test: Add Cycles test for the shading offset feature in Cycles
This commit adds a test for the shading offset feature in Cycles,
testing different material types (Diffuse, Glossy, and Transmissive)
and with different strengths.

Ref: blender/blender-test-data!71
2025-03-13 05:12:29 +01:00
Harley Acheson
e4baefe0d4 Tests: Adding Two Test Font Files
Adding two files to tests/data for BLF tests.
2025-03-12 17:06:43 -07:00
Brecht Van Lommel
49e70c8781 Tests: Update for sequencer soft light changes
The hash was previously updated for this, but the commit was not merged
into the blender-test-data main branch.
2025-03-11 21:59:31 +01:00
Brecht Van Lommel
de821416c7 Cycles: Adaptive subdivision dicing and splitting improvements
* Share vertices between patches instead of using stitch map
* Switch to OpenSubdiv compatible counter-clockwise indexing
* Simplify patch edge reverse direction logic
* Add more comments to splitting and dicing

Pull Request: https://projects.blender.org/blender/blender/pulls/135681
2025-03-11 20:58:33 +01:00
Sybren A. Stüvel
2cdd75def0 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-11 10:38:55 +01:00
Sybren A. Stüvel
064421a02d Anim: expose Action Slot users to RNA
Add a new RNA function `ActionSlot.users()` that returns the
data-blocks that are animated by this slot.

This covers direct assignment of the action & slot, but also use in
the NLA and in Action constraints.

```python
>>> D.actions['SuzanneAction'].slots['OBSuzanne'].users()
[bpy.data.objects['Suzanne']]
```

This was implemented as a function, and not a collection property,
because Blender's bookkeeping of the slot users can be marked 'dirty'.
In that case the slot user list needs to be rebuilt, which happens for
all Actions and all their slots simultaneously. This was considered
too broad a data-changing action to 'hide' inside a getter of a
property. Also it needs a `bmain` pointer, which is not available in
getters, but is available in functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/135734
2025-03-11 10:36:59 +01:00
YimingWu
df346a1b6b Fix #135229: Soft light blending mode for 8 bit colors is wrong
It appears that 8 bit `blend_color_softlight_byte` call used a wrong
blending routing (overlay), while `blend_color_softlight_float` is
correct. Seems that this was never caught. The correct fomula should be
`dst = 2ab + a^2 * (1 - 2b)`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135382
2025-03-11 05:34:21 +01:00
Sean Kim
331df61e32 Tests: Add sculpt.detail_flood_fill operator test
Conveniently, this operator serves as a useful basic test for dyntopo
subdivision.

Pull Request: https://projects.blender.org/blender/blender/pulls/135558
2025-03-10 16:27:08 +01:00
Alaska
149aad072f Test: Update EEVEE reference image for shadow linking with curves test
The shadows of the curves in this test were incorrect. They have since
been fixed and this commit updates the reference images to show case
that.

Ref: blender/blender-test-data!74
2025-03-10 14:57:21 +01:00
Alaska
ffcfd648c3 Tests: Add render tests for polygonal aperture DOF
This commit adds tests for a camera with Depth of field with a
polygonal aperture.

Ref: blender/blender-test-data!64
2025-03-08 11:05:34 +01:00
Alaska
65f3a80036 Tests: Adjust shadow_link_transparency so it shows a recent Cycles regression
After a recent refactor (1), there was a failure case that showed up in
the shadow_link_transparency file (2), but didn't cover enough pixels
to trigger a failure.

This commit adjusts the file so enough pixels are different to trigger
a failure.

(1) blender/blender@e813e46327
(2) blender/blender#135572

Ref: blender/blender-test-data!68
2025-03-08 08:21:41 +01:00
Hans Goudey
06f6d77979 Curves: Fix bounding box ignores radius, add option to geometry node
Unlike the legacy type, the radius isn't included in the bounds for the new
curves type. This hasn't been obvious because the drawing is quite broken
and doesn't use the radius properly.

This commit adds a separate cache for the bounds with the radius, which
is now used by default. The old cache is kept around for backward
compatibility in the bounding box geometry node, where a new
"Use Radius" option accesses the old behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/135584
2025-03-07 17:38:29 +01:00
Alaska
35e214351b Tests: Add render tests for stereoscopic cameras
This commit adds tests for perspective and panoramic
stereoscopic cameras.

These two camera types were chosen as they have a option for
`Spherical Stereo` which takes an alternative code path in Cycles
rendering.

So these test files conver both a general stereoscopic test and these
specific code path tests.

Ref: blender/blender-test-data!66
2025-03-07 09:27:27 +01:00
Alaska
c33b423509 Tests: Add render test for rolling shutter
This commit adds a test for the rolling shutter feature found
in Cycles.

The test contain a few different objects to test different areas:
- A rotating camera, with a changing focal length
- A moving object
- A rotating object
- And a rotating object with motion blur disabled

Ref: blender/blender-test-data!67

Pull Request: https://projects.blender.org/blender/blender/pulls/135562
2025-03-07 05:15:34 +01:00
Hans Goudey
20d8ed64dc Tests: Update hash for recently changed Geometry Nodes tests 2025-03-05 22:08:20 -05:00
Campbell Barton
141da9bd04 License headers: add license header to bl_sculpt.py test 2025-03-06 10:53:19 +11:00
Hans Goudey
55bed5ae2a Tests: Update tests hash for recent Geometry Nodes fix
https://projects.blender.org/blender/blender/pulls/135536
2025-03-05 15:21:22 -05:00
Brecht Van Lommel
65889672e2 Fix #135432: Cycles world light and shadow catcher bug after recent changes
Caused by #134846, e813e46327.

Pull Request: https://projects.blender.org/blender/blender/pulls/135440
2025-03-05 16:27:49 +01:00
Sean Kim
335b9b0388 Cleanup: Minor formatting changes for recently added python tests
* Adds docstrings to `bl_object.py` and `bl_sculpt.py` tests so that
  failure output is more helpful.
* Renames `bl_object.py` class and function to be more inline with other
  test naming

Pull Request: https://projects.blender.org/blender/blender/pulls/135417
2025-03-04 17:32:02 +01:00
Alaska
073872ebab Tests: Add Cycles tests for ray visibility on lights
In a recent refactor (1), ray visibility for lights was accidentally
broken. To help detect issues like this in the future, this commit
adds tests specifically for this case.

Ref: blender/blender-test-data!61
(1) https://projects.blender.org/blender/blender/commit/e813e46327dca72
2025-03-01 05:52:18 +01:00
Alaska
97a1ec8063 Tests: Add a Cycles test for #135200
A recent bug fix to light tree building lead to a issue where some
lights with light linking would incorrectly share nodes in the
light tree.

To help detect failures like this in the future, this commit adds a
test based on the file found in the original report
blender/blender#135200.

Ref: blender/blender-test-data!63
2025-03-01 02:14:44 +01:00
Philipp Oeser
b0d63ff8e1 Merge branch 'blender-v4.4-release' 2025-02-28 17:14:34 +01:00
Philipp Oeser
9855c11d2c Fix #135217: ColorManage Settings RNA paths incomplete/wrong
`ColorManagedDisplaySettings`, `ColorManagedViewSettings`,
`ColorManagedInputColorspaceSettings` were affected since these are used
from multiple places (Scene, File output nodes, ..).

Similar to how we are getting the path for `ImageFormatSettings` (which
pretty much has the distinction logic already), we can do so for the
ColorManage Settings as well (piggbacking on the already correct path to
the `ImageFormatSettings`.

With this, we can also remove these "known failures" from the test
introduced in 4032b853c3.

Pull Request: https://projects.blender.org/blender/blender/pulls/135238
2025-02-28 17:13:43 +01:00
Sean Kim
8afca41fd3 Tests: Add sculpt.mask_from_cavity operator test
Adds a python test for the `sculpt.mask_from_cavity` operator, checking
the function against a grid with a column of lowered points to simulate
a cavity.

Follow up to #135130 and !135139

Pull Request: https://projects.blender.org/blender/blender/pulls/135213
2025-02-27 23:28:43 +01:00
Aras Pranckevicius
02869cc6c8 Color management: Dithering consistency/perf improvements
Float->byte rendered image dithering uses triangle noise algorithm. Keep
the algorithm the same, just make some improvements and fix some issues:

1) The hash function for noise was using "trig" hash from "On generating
random numbers" (Rey 1998), but that is not a great quality hash, plus it
can produce very different results between CPUs/GPUs. Replace it with
"iqint3" (recommended by "Hash Functions for GPU Rendering", JCGT 2020),
which is same performance on GPU, faster on CPU, and much better quality.
This is the same hash as Cycles already uses elsewhere. Also it is purely
integer based, so exactly the same results on all platforms.

2) For the above point, replace `dither_random_value` to take integer
pixel coordinates and adjust calling code accordingly. Some previous
callers were (accidentally?) passing integer coordinates already. Other
places actually get a tiny bit simpler, since they now no longer need an
extra multiplication.

3) The CPU dithering path was wrongly introducing bias, i.e. making the
image lighter. The CPU path also needs dither noise to be in [-1..+1]
range (not [-0.5..+1.5]!) just like GPU path does, since the later
float->byte conversion already does rounding.

4) The CPU dithering path was using thread-slice-local Y coordinate,
meaning the dithering pattern was repeating vertically. The more CPU cores
you use, the worse the repetition.

5) Change the way that uniform noise is converted to triangle noise.
Previous implementation was based on one shadertoy from 2015, change it
to another shadertoy from 2020. The new one fixes issues with the old way,
and it just works on the CPU too, so now both CPU and GPU code paths are
exactly the same.

6) Cleanup: remove DitherContext, just a single float is enough

Performance and image comparisons in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/135224
2025-02-27 15:52:45 +01:00
Sergey Sharybin
1a2590afed Fix missing report about crashed render tests
Tricky non-obvious regression introduced by #133879: crashed test
was never appended to the test results.

Pull Request: https://projects.blender.org/blender/blender/pulls/135176
2025-02-26 17:05:44 +01:00
Weizhen Huang
7b3f7ccae0 Merge branch 'blender-v4.4-release' 2025-02-26 15:51:55 +01:00
Weizhen Huang
9ee9a2b789 Fix #135145: object visible to volume scatter when ray visibility is off
The comment was added in e0857ad152, and volume scatter visibility is
supported since cdd1d5a93c.

Pull Request: https://projects.blender.org/blender/blender/pulls/135168
2025-02-26 15:45:58 +01:00
Clément Foucault
5805c27f75 EEVEE: Update pointcloud tests after radius fix
Rel #135123
2025-02-26 13:05:11 +01:00
Sean Kim
956a0fad80 Sculpt: Expose location parameter for sculpt.mask_by_color
Currently, there is no way to call the sculpt.mask_by_color operator
from the python API without simulating mouse events. This makes writing
python tests harder than it needs to be.

This commit does the following:
* Adds an exec callback for the mask_by_color operator.
* Adds new `location` property, an int array defined in region space
  coordinates to represent the mouse location.
* Extracts logic into a helper function so that the `invoke` and `exec`
  paths are functionally equivalent.

Pull Request: https://projects.blender.org/blender/blender/pulls/134964
2025-02-26 01:28:24 +01:00
Brecht Van Lommel
655ccf1d7a Fix #135086: Light ray visibility not taken into account without light tree
Re-enable tests that were temporarily disabled for this.

Caused by #134846, e813e46327
2025-02-25 17:24:04 +01:00
Christoph Lendenfeld
6e4413d50f Merge branch 'blender-v4.4-release' 2025-02-25 12:14:52 +01:00
Christoph Lendenfeld
5100a80f7f Fix #110650: Drivers not removed if removing their container
This applies to modifiers, constraints and shape keys.
Any driver on such data was not removed with it,
leaving invalid drivers on objects.

With this patch, the drivers are removed, but animation is left untouched.
This is because animation might be reused somewhere else and we don't
want to introduce potential side effects there.

This also adds unit tests for the fixed cases

Pull Request: https://projects.blender.org/blender/blender/pulls/134511
2025-02-25 12:11:15 +01:00
Alaska
88989ed921 Tests: Temporarily block glossy light path tests
Glossy light path tests are unexpectedly failing on build bot.
My current guess is that something changed between when the reference
images were made and when the tests were committed.

While an investigation into what's causing it is going on, these tests
have been temporarily added to the blocklist to avoid unexpected
failures for other developers.
2025-02-25 17:51:48 +13:00
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