Commit Graph

1921 Commits

Author SHA1 Message Date
Jacques Lucke
c11055c1cf Geometry Nodes: enable closure regression tests
Some special care had to be taken because these tests require an experimental
feature to be turned on to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/137414
2025-04-13 13:55:23 +02:00
Sean Kim
5cacb7cedd Tests: Overhaul Sculpt performance tests
This commit makes a number of changes to the sculpt performance tests,
aimed at measuring more consistent data and making it easier to extend
the test cases.

* Repeats tests a minimum of 5 times up to 100 times, with a timeout
  of 5 seconds for a given test case to run, averaging the duration of
  the brush strokes to stabilize the value
* Sets the brush from the script instead of having it defined in each
  file, preventing the need to duplicate benchmark files.
* Uses the newly defined `override_location` property to allow defining
  the stroke in screen-space and repeating strokes multiple times
  without regenerating the base mesh
* Adds tests for the smooth brush, as basic neighbor calculations
* Adds tests for dyntopo sculpting
* Renames the base mesh tests to have a "mesh_" prefix as the data is
  inherently discontinuous here.

Related benchmark PR: blender/blender-benchmarks#2

Part of #133926

Pull Request: https://projects.blender.org/blender/blender/pulls/133841
2025-04-11 05:26:25 +02:00
Sean Kim
898e6f3687 Paint: Ensure brushes are loaded when requested while in background mode
Depending on internal details of how Blender is run, attempting to load
elements from the asset library may either execute as synchronous &
blocking or asynchronously.

When executing a script in background mode, prior to this commit,
operators that are dependent on the asset system will not execute
correctly due to the loading not being complete.

Busy-waiting for this by repeatedly calling the operator over and over
again in python does not resolve. To match behavior of other operators
when called from python scripts such as the quadriflow remesh, this
commit changes the `brush.asset_activate` operator and dependent code to
force a blocking call instead of optionally using the wmJob background
abstraction system.

Related to #117399

Pull Request: https://projects.blender.org/blender/blender/pulls/134203
2025-04-10 22:09:06 +02:00
Brecht Van Lommel
4970bac061 Tests: Properly disable tests when data directory is missing
And clean up cmake output to be less verbose.
2025-04-07 16:29:14 +02:00
Campbell Barton
f48b4e3abf Cleanup: wrap long lines for CMake 2025-04-05 20:30:37 +11:00
илья _
f3f9aaf4f7 Fix: Tests: Geometry Nodes tests ignore threshold value
Base constructor ask test name as the third argument,
so threshold have to be named parameter in case test name is not mentioned

Pull Request: https://projects.blender.org/blender/blender/pulls/134300
2025-04-04 11:52:16 +02:00
Christoph Lendenfeld
28d0bef706 Fix: Retain slot name when baking action
Previously when an action was baked, the slot name was not retained.
This causes problems when switching between actions because the slot
will not automatically be assigned.

This is now fixed by ensuring that the name of the last assigned slot
is used to create the new slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/136814
2025-04-03 10:18:15 +02:00
Campbell Barton
62ab0837b3 Cleanup: exclude code_layout_diagram.py from mypy check
Also update bl_run_operators.py based as #136156 is fixed.
2025-04-03 13:51:52 +11:00
Sean Kim
f1c87d1bd2 Fix: Multi-window UI tests can produce inconsistent results
After creating a new scene in a separate window when performing UI
tests, the respective view layer for the window may not be updated
immediately in the event loop.

Previously, this was mitigated with a single `yield` statement that
would delay processing by a single tick. To fix this issue, this commit
adds the capability to yield for a specific `timedelta` and waits this
amount of time for the two affected tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/136012
2025-04-02 21:38:05 +02:00
Campbell Barton
f89cf19ba6 Cleanup: indentation for CMake files, strip trailing space 2025-04-02 03:01:59 +00:00
Alaska
8e7640df6a Tests: Update reference images for stereo cameras
Due to changes in the bump mapping system, various tests had to be
updated.

It seems like the reference images for the stereo camera tests
weren't properly updated. So this commit fixes that.

Ref: blender/blender-test-data!79
2025-04-01 10:50:29 +02:00
Brecht Van Lommel
ac5dc94c40 Fix #136619: Stereo image saving has wrong colorspace
The logic about which buffer it's going to use for saving is quite confusing.
This simply restores the logic from before 7584ccc28d while still guarding
against accessing null buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/136659
2025-03-28 13:58:03 +01:00
Alex Fuller
a1b7ce1d22 Cycles: Move UV tangent computation into the core
This makes it available in Cycles standalone, and the implementation
can be shared with Blender. This also makes it possible to compute
tangents after tessellation for adaptive subdivision.

There is a difference in UV map tangents when there are no UVs. They
are now generated from object space coordinates instead of auto
texture space coordinates. This is more efficient, and a corner case
that we don't have to keep compatible.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/cycles/pulls/25
2025-03-27 22:07:50 +01:00
Christoph Lendenfeld
e4d3a52ed6 Anim: Unit Tests for baking code
No functional changes.

This patch adds unit tests for the animation baking code in `anim_utils.py`.
It is by no means exhaustive but it is a start to figure out what this function
is actually doing.
With the usage of the legacy python API I was worried things might not work as
expected but all added tests pass.
Also, the tests document the current behavior without any attempt of declaring
that behavior as good or correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/135583
2025-03-27 12:56:46 +01:00
Aras Pranckevicius
812bf5473e Tests: emit 2d and 4d custom properties, more bone flags
Pull Request: https://projects.blender.org/blender/blender/pulls/136595
2025-03-27 11:21:45 +01:00
Campbell Barton
61d857eba4 Tests: add Hyper modifier support to the "easy_keys" module 2025-03-27 12:13:29 +11:00
Alaska
7a47762c20 Benchmark: Enable OSL in Cycles performance benchmark tool
This commit gives users of the Cycles performance benchmark tool the
option to run performance benchmarks with OSL enabled for CPUs
and OptiX devices.

This can be done by adding `-OSL` to the device name:
`CPU-OSL`
`OPTIX-OSL_0`

Pull Request: https://projects.blender.org/blender/blender/pulls/136506
2025-03-26 23:52:14 +01:00
Weizhen Huang
1f12244f73 Fix: EEVEE bump height connecting to the wrong link after recent change
Pull Request: https://projects.blender.org/blender/blender/pulls/136546
2025-03-26 14:36:24 +01:00
Brecht Van Lommel
a7026e817c Fix: EEVEE bump node issue after filter width addition
Ref #136465

Pull Request: https://projects.blender.org/blender/blender/pulls/136519
2025-03-25 21:03:44 +01:00
nubnubbud
5e2afb3f6f Cycles: Replace bump correction algorithm to better respect normal maps
The new correction avoids washed out areas near the shadow terminator,
preserving more detail from normal and bump maps.

It implements the method from the paper "A Microfacet-Based Shadowing
Function to Solve the Bump Terminator Problem" by Alejandro Conty Estevez,
Pascal Lecocq, and Clifford Stein.

Pull Request: https://projects.blender.org/blender/blender/pulls/135380
2025-03-25 18:01:01 +01:00
Brecht Van Lommel
f987ef7b6e Shaders: Add Filter Width input to Bump node
This makes it possible to restore previous Blender 4.3 behavior of bump
mapping, where the large filter width was sometimes (ab)used to get a bevel
like effect on stepwise textures.

For bump from the displacement socket, filter width remains fixed at 0.1.

Ref #133991, #135841

Pull Request: https://projects.blender.org/blender/blender/pulls/136465
2025-03-25 16:29:13 +01:00
Alaska
76f3888162 Tests: Update EEVEE camera central cylindrical reference images
The output of the mentioned test was slightly off from what main
currently produces, so update the reference image to resolve test
failures.

Ref: blender/blender-test-data!78
2025-03-25 15:16:30 +01:00
Hans Goudey
1ed50d3813 Tests: Update tests for Curve to Points propagation fix
https://projects.blender.org/blender/blender/pulls/136452
2025-03-25 10:11:19 -04:00
Sybren A. Stüvel
a7d787f5b9 Fix #136347: Keyframe interpolation behavior changed for BoolProperty
F-Curve interpolation uses the `FCURVE_INT_VALUES` and
`FCURVE_DISCRETE_VALUES` flags, which were not set in the keyframe
insertion function for slotted Actions. This is now resolved by making
the RNA property type part of the `FCurveDescriptor`.

Existing code has been refactored a bit, mostly to allow calling
`update_autoflags_fcurve_direct()` with just the RNA property type,
instead of passing the property itself. This avoided the need to include
pointers to RNA properties in `FCurveDescriptor`, which I think is a
slightly nicer design. It also makes it more explicit which aspect of
the property is used.

Because there's now another `std::optional<>` in the `FCurveDescriptor`,
I've also changed some `std::nullopt` to `{}` for brevity of the code,
as repeating that another time would have caused longer lines with more
rewrapping.

Pull Request: https://projects.blender.org/blender/blender/pulls/136446
2025-03-25 10:34:19 +01:00
Sergey Sharybin
60ca0742cb Benchmark: Support running benchmark with HW RT enabled
Similar to the regression tests it is possible to append -RT suffix
to the compute type to enable hardware ray-tracing.

For example HIP_0 will run benchmark on first HIP device without
hardware ray-tracing, HIP-RT_0 will run benchmark on the same device
but will enable hardware ray-tracing.

The downside of this change is that it will make it so METAL device
will no longer use HW-RT on M3 and aboce, and explicit METAL-RT is
to be used. This is because benchmark was relying on the Auto
configuration which has different behavior depending on the device
generation.

Pull Request: https://projects.blender.org/blender/blender/pulls/136308
2025-03-24 15:47:42 +01:00
Sergey Sharybin
5ce4e91a80 Fix #136319: Incorrect transparent bounce count with spatial splits
The transparent bounce test was too optimistic in regards to the intersection
being considered. The check needs to happen after it has been validated that
it is not duplicate.

It was already the case for Metal and HIP-RT, but not for Embree and BVH2.

Tests updated by: Alaska <Alaskayou01@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/136325
2025-03-22 04:51:42 +01:00
Jesse Yurkovich
01ddb320dd Fix #124263: Generate unique names during Alembic and USD export
While object names in Blender are already unique, the names themselves
may be "unsafe" for use in the various file formats. During processing
we make the names "safe". However, we did not guarantee that these new
safe names were themselves unique wrt each other. Consider object names
"Test 1" and "Test-1" which both become "Test_1" after being made safe.
These will collide during export; only 1 object would be exported and
it's undefined which object's data would "win".

To rectify this we add another name map to the hierarchy iterator which
is then used to handle collisions as they happen. The map is per-
hierarchy meaning that a name can appear more than once as long as its
under a different hierarchy. E.g.
- `/root/A/X` and another `/root/B/X` is OK
- `/root/A/X` and another `/root/A/X` is NOT OK

Pull Request: https://projects.blender.org/blender/blender/pulls/135418
2025-03-21 21:29:08 +01:00
Aras Pranckevicius
850d67829c Tests: emit more information in import test templates
- Object parent type & parent bones
- Pose information that is not trivial (i.e. print posed bones that
  have either non-identity pose matrix, or custom properties)
- Make sure custom properties are output sorted by name

Pull Request: https://projects.blender.org/blender/blender/pulls/136321
2025-03-21 20:16:47 +01:00
Clément Foucault
485167dd02 EEVEE: Update tests after new geometric normal 2025-03-21 19:08:15 +01:00
Omar Emara
d6fa68eb58 Compositor: Add boolean socket support
This patch adds support for boolean sockets in the compositor. This
involves adding a new Bool ResultType and handling it in relevant code.
For shader operations, booleans are passes as floats since GPUMaterial
does not yet support boolean types.

Pull Request: https://projects.blender.org/blender/blender/pulls/136296
2025-03-21 12:03:09 +01:00
Sean Kim
d9ec8c531f Tests: Update submodule hash
blender/blender-test-data#65

Pull Request: https://projects.blender.org/blender/blender/pulls/135544
2025-03-20 18:22:27 +01:00
Campbell Barton
bf87333701 Correct redundant call in bl_run_operators.py
Also correct type in comment.
2025-03-20 13:33:53 +11:00
Campbell Barton
858862657f Tests: improvements to bl_run_operators.py, update suppression list
- The context setup functions now reset the file to factory settings
  before setting up the context - for a predictable context.
- Split operator suppression lists into groups based on the reason
  for being disabled to avoid having to note this in code-comments.
- The suppression list is validated, warning if items aren't used.
- Disable operators which crash in background-mode which don't have
  obvious fixes & aren't useful in background-mode.
2025-03-20 13:16:47 +11:00
Alaska
c771dc3a00 Tests: Add additional camera render tests
This commit edits and adds new tests for missing camera tests bringing
the code coverage for camera projection to basically 100%.

The changes include:
- Adding a test for the central cylindrical camera type
- And editing the other camera tests to include a object with a
`Window` texture coordinate system in view.
  - Modifications to these tests were done in the version of Blender
  closest to when the original test was made. For most tests this was
  Blender 3.1.

Ref: blender/blender-test-data!69
2025-03-19 15:47:35 +01:00
Brecht Van Lommel
9e1d8e349d Cycles: Adaptive subdivision no longer doubles up with Blender levels
Use the mesh wrapper mechanism from GPU subdivision to get the base mesh.
This can significantly reduce memory usage and render setup time if the
level was not manually set to zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/135895
2025-03-19 14:10:20 +01:00
Habib Gahbiche
3c984667e8 Tests: Fix hash from latest compositor tests
Commit fdfcbb2ffe was pushed from a remote branch that was not up to date with main. This fixes the issue by pushing the tests to `tests/main` first.

Pull Request: https://projects.blender.org/blender/blender/pulls/136180
2025-03-19 14:07:34 +01:00
Habib Gahbiche
fdfcbb2ffe Tests: Add test cases for new common compositor nodes
Ref PR: https://projects.blender.org/blender/blender/pulls/135300

Pull Request: https://projects.blender.org/blender/blender/pulls/136177
2025-03-19 13:44:38 +01:00
Alaska
281b58f19f Tests: Add a render test for a large combined motion blur
This commit adds a test file containing a combined rotation,
translation, and scale transformation on a coloured cube,
with motion blur enabled, all with a low motion blur step count.

This test is being added to make sure various backends interpolate
this combined motion correctly.

Ref: blender/blender#135659
Ref: blender/blender-test-data!75
2025-03-19 06:38:12 +01:00
Aras Pranckevicius
944c7733e3 Tests: emit more animation data in I/O test template output
Previously only "legacy style" (no action layers, slots etc.)
were emitted for import tests

Pull Request: https://projects.blender.org/blender/blender/pulls/136133
2025-03-18 19:13:09 +01:00
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