Commit graph

1902 commits

Author SHA1 Message Date
Julien Duroure
bb34238209 Test: glTF: check recursively on input directories
This is a preparation for getting Khronos Tests done on Blender tests

Pull Request: https://projects.blender.org/blender/blender/pulls/150594
2025-11-25 18:33:54 +01:00
Hans Goudey
a909604a66 Fix #150483: Joining mesh objects loses some data-block options
Caused by 340f9d7ff3

Pull Request: https://projects.blender.org/blender/blender/pulls/150530
2025-11-24 19:36:49 +01:00
Habib Gahbiche
142264dbe2 Fix: Compositor: Backward compatibility for Composite node
Blend files saved in 4.5 with compositing node trees containing group
output nodes may result in the wrong group output node being active when
opened in 5.0.
See PR for example blend file file and how to reproduce.

The issue is that the versioning code assumes there are no existing
Group Output node. To fix this, we set the newly created Group Output
node that replaces the Composite node to be the active output.  Also add
a regression test that covers this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/149930
2025-11-24 10:40:24 +01:00
Jesse Yurkovich
095e23773c USD: Process point cloud and point instancer ID values
These Ids are required for correct in-camera motion blur so read and
write them as appropriate for both point clouds and point instancers.

The incoming USD Ids are 64-bit but Blender only supports 32-bit Ids so
the values will be narrowed. This will potentially produce different or
duplicate Ids depending on how far the value is outside the
[-2147483648, 2147483647] range.

Pull Request: https://projects.blender.org/blender/blender/pulls/149666
2025-11-18 00:35:15 +01:00
Miguel Pozo
d14e71d9b9 EEVEE: Add tests for untested EEVEE-specific features
Part of #148449

This also adds a way to skip certain parts of the EEVEE_render_test
setup by storing (optional) boolean properties in the scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/149471
2025-11-17 18:07:13 +01:00
Michael B Johnson
1d1af1400a Fix #139235: Update USD mesh export to write indexed UVs
This change updates the USD mesh export to write indexed UVs rather
than the previous unindexed (per face vertex) UVs to preserve UV
connectivity information.

Details:

Previously the USD export of mesh UVs was not preserving any
information about the UV connectivity. This meant that importing
the USD into another DCC that relies on indexed UVs for connectivity
would treat each face as a separate UV island.

With this change, the `BKE_mesh_uv_vert_map_create` function is
used to determine the UV connectivity during the USD export and
to write indexed UVs.

Authored by Apple: Dan Knowlton

Co-authored-by: Dan Knowlton <d_knowlton@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/149677
2025-11-15 00:12:24 +01:00
Jesse Yurkovich
93c0c63415 Cleanup: USD: Make use of newly exposed mesh validation API
Make use of the newly exposed mesh validation API to replace the custom
duplicate vertex index check.

Also, strengthen the test for this by using a mesh which should only
lose 2 of its 4 faces due to validation. The prior test only had 2 faces
and both would be destroyed. This guards against future problems like
issue #149429.

Pull Request: https://projects.blender.org/blender/blender/pulls/149882
2025-11-14 18:54:30 +01:00
Brecht Van Lommel
044c81efd8 Merge branch 'blender-v5.0-release' 2025-11-13 12:06:31 +01:00
Falk David
cab24d5785 Fix: Failing test_workspace.sanity_check_storyboarding
The test got broken by 5f32e14d7f.

Pull Request: https://projects.blender.org/blender/blender/pulls/149709
2025-11-12 17:43:33 +01:00
Julien Duroure
3752e7fff3 Tests: glTF: Add 3 scenarii (I/O/roundtrip) and 3 simple examples
This adds code for the following 3 glTF I/O tests:
- 1 import
- 1 export
- 1 roundtrip

For Export & Roundtrip, this uses the new system from I/O Report defined in #149385

- Use of general IO Report system with following info
    -  add a callback function that define how to generate the description of exported file
    - The exported file is generated in a tmp directory, so deleted at end of test

This PR also adds a simple example for each of these 3 tests

Pull Request: https://projects.blender.org/blender/blender/pulls/149387
2025-11-12 17:11:18 +01:00
Campbell Barton
eac260efcb Merge branch 'blender-v5.0-release' 2025-11-11 14:56:56 +11:00
Campbell Barton
74070855b6 Merge branch 'blender-v5.0-release' 2025-11-11 14:56:53 +11:00
Campbell Barton
f4af7d6851 Fix #149604: Regression sub-classing mathutils types
Regression in [0] which removed `__new__`, which broke
sub-class instancing.

Resolve by adding back `__new__` which wraps `tp_vectorcall`.
The speed-up from [0] remains as direct calls to mathutils types
still use `tp_vectorcall`.

Include tests to ensure sub-typing mathutils types works as expected.

Ref !149685

[0]: b2176bfdd7
2025-11-11 03:54:46 +00:00
Campbell Barton
dc3cad21d0 Fix: error checking keyword arguments for mathutils types
Regression in [0] failed to account for keywords being changed from
a dict to a tuple.

Include a test to ensure keyword arguments are ignored.

Ref !149685

[0]: b2176bfdd7
2025-11-11 03:54:45 +00:00
Campbell Barton
1417230823 Cleanup: remove outdated Python type hinting minor corrections
Also improve readability for for multi-line functions.
2025-11-09 12:34:32 +11:00
Habib Gahbiche
6909397f4a Merge branch 'blender-v5.0-release' 2025-11-08 17:35:01 +01:00
Habib Gahbiche
4c60178e12 Fix #146470: Gradient Texture node not clamped
Clamp output values of Gradient Texture between 0 and 1.

- Compositor: CPU is now clamped. CPU and GPU are now unified.
No versioning done so old files would render differently
- Geometry nodes: Output of Gradient Texture is now clamped between 0
and 1. In versioning the texture node is removed and replaced by math
nodes (placed on top of each other).
- Shader: No changes

Test files for geometry nodes were created in 4.5 to verify that the
behavior didn't change. Compositor test result was created using this
PR to verify CPU and GPU have the same result.

Pull Request: https://projects.blender.org/blender/blender/pulls/149276
2025-11-08 17:33:23 +01:00
Julien Duroure
eaff727695 Tests: I/O report new feature: roundtrip and export support
The PR adds a new feature on I/O report tests: it can now perform
roundtrip or export tests.

- The `import_and_check` method calls `generate_and_check` so current
  callers are unchanged
- As the current system only manages importer & use a common description
  of .blend data, I keep this system, but renamed
  `generate_main_data_desc` to `generate_generic_data_desc`
- The io_report can now accept an optional callback function to generate
  the generated data description. This function is used, if defined,
  instead of `generate_generic_data_desc`
- We also passing an optional parameter to get the expected filename of
  generated data (was not existing in current system for importer tests,
  as we directly generate data from .blend file)
- avoid double `ref_desc == got_desc` check by returning the result from
  `_add_test_result`

Pull Request: https://projects.blender.org/blender/blender/pulls/149385
2025-11-06 18:20:53 +01:00
Hans Goudey
b11a66dda2 Tests: Add a few more subdivision surface node/modifier tests
Add tests for loose vertices/edges, custom normals propagation,
and vertex group propagation. Also rename the folder "subdivision"
instead of "subdivision_tests"

Pull Request: https://projects.blender.org/blender/blender/pulls/149421
2025-11-05 20:33:55 +01:00
Sean Kim
b72b204390 Mesh: Add validation of CD_MDISPS tangent vector data
This commit adds support for validating and correcting Multires tangent
data stored in CD_MDISPS when called via `BKE_mesh_validate` when
importing or on demand when users call `mesh.validate()` via the Python
API.

Any non-finite values are set to 0. While this will result in likely odd
looking data on a multires mesh, it will prevent further propagation of
bad float data and will allow users to restore their mesh to a workable
state in the case of data corruption.

Ref: #149205

Pull Request: https://projects.blender.org/blender/blender/pulls/149320
2025-11-04 22:42:09 +01:00
Brecht Van Lommel
eb6b325d4d Merge branch 'blender-v5.0-release' 2025-11-03 17:45:32 +01:00
Beckham, Verena
14908ce174 Fix: ctest prints command line that is not copy-pasteable
If you use BLENDER_VERBOSE=1, ctest prints out the blender command line
that was invoked, but it would fail if you just copy/pasted it into a
command prompt, because the "python-expr" argument contained spaces.
This fix surrounds the "python-expr" argument with quote marks, so you
can copy/paste it without modification.

Tested on Windows Command Prompt, Powershell and nushell.

Pull Request: https://projects.blender.org/blender/blender/pulls/147537
2025-11-03 17:44:56 +01:00
Campbell Barton
0fe91bd2d9 Core: add --no-window-frame command line option
Add a command line option to load Blender without a window frame.

Currently this is only used on Wayland, enabled for WITH_UI_TESTS since
attempting to load LIBDECOR caused the tests to crash on start on Fedora.
For tests there is no need to use LIBDECOR, so disable the window frame.
This can also be used by users who don't want to use the X11 fallback if
LIBDECOR can't be found.

Back-ported from main so users can workaround: #144919
which won't be fixed for 5.0 release.

- 3349b97987
- eedf15e3b7

Ref !147716
2025-11-02 20:29:55 +11:00
Sean Kim
010ed58ac6 Cleanup: Tests: Update UI test comments
* Corrects reference in helper `test_*.py` files
* Clarifies `run_blender_setup.py` usage  by other scripts

Pull Request: https://projects.blender.org/blender/blender/pulls/148899
2025-11-01 23:21:23 +01:00
Sean Kim
50276459f5 Merge branch 'blender-v5.0-release' 2025-10-30 14:04:05 -07:00
Sean Kim
d17fcdbd3b Tests: Add ability to blocklist UI tests
This commit adds the ability to block certain UI tests from running,
while also honoring the `BLENDER_TEST_IGNORE_BLOCKLIST` env variable.

Currently the only entries are for Windows with Intel GPUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/148609
2025-10-30 22:02:19 +01:00
Sean Kim
ce2000769a Merge branch 'blender-v5.0-release' 2025-10-27 23:06:10 -07:00
Sean Kim
8be3eb1ef4 Tests: Add delay for multi window UI tests
This commit changes the constant, fixed time delay when running UI
tests that use multiple windows to one that waits until either a second
has elapsed or the created windows have different view layers by
idling in increments of 1/60th of a second.

This is strictly a fix to get the test to work again on both buildbots
and developer workstations, further root-causing and fixes will happen
separately.

Fixes #148877

Pull Request: https://projects.blender.org/blender/blender/pulls/148623
2025-10-28 07:05:29 +01:00
Brecht Van Lommel
3dd54e9952 Merge branch 'blender-v5.0-release' 2025-10-27 13:11:49 +01:00
Brecht Van Lommel
ca18fdc7e5 Fix: Black noise texture results with MaterialX export
Clamp octaves to be at least 1 to avoid having no noise at all, and clamp
the maximum to avoid precision issues and NaNs on some GPUs.

Blocklist white noise 256 samples tests entirely for Storm, as we don't
support multiple samples and can't test converting to grey. Increase the
grid size in the 1 sample white noise test to make it more clear.

Pull Request: https://projects.blender.org/blender/blender/pulls/148525
2025-10-27 13:11:04 +01:00
Jesse Yurkovich
f300a8c796 Merge branch 'blender-v5.0-release' 2025-10-24 14:42:47 -07:00
Jesse Yurkovich
fab9993ca8 Fix: Improper duplicate material handling in USD import
Part 1/2 for #148569

The map used to de-duplicate incoming materials was filled with the
wrong material names which eventually resulted in a situation where we
were adding 2 different materials with the same name to the map which is
unexpected.

This also contains a fix for Material ID user counts that was
incorrectly changed as part of the unrelated refactor 1b4daf9d2e.

Added further test coverage to validate both situations now.

Pull Request: https://projects.blender.org/blender/blender/pulls/148757
2025-10-24 23:41:01 +02:00
Jesse Yurkovich
dd8daf8837 Merge branch 'blender-v5.0-release' 2025-10-22 13:27:39 -07:00
Jesse Yurkovich
67752cc66e Fix #148436: Incorrect legacy hair offset with USD export
The report in question uncovered two sources of issues. The primary one
being that there was an accidental double-transform from placing the
basis curves prim under the main Xform of the mesh too. This is solved
by considering the inverse of mesh's world transform when writing out
the curve points.

The second was exposed with the new, more correct, viewport drawing of
curves that showed that we were exporting the wrong curve type. This
would manifest as a disappearing curve segment at the beginning and end
of the curve. Fixed by explicitly writing out catmull-rom, pinned,
curves for the hair rather than using bsplines.

As a result the Storm-USD tests now match much closer to the native
Storm-Hydra variants.

Pull Request: https://projects.blender.org/blender/blender/pulls/148543
2025-10-22 22:26:28 +02:00
Christoph Neuhauser
44c27536f2 Merge branch 'blender-v5.0-release' 2025-10-22 11:07:26 +02:00
Christoph Neuhauser
94e2fe320d Tests: Pass rasterization dependent Storm tests on Intel Linux
This PR slightly raises the accepted noise level for the Storm tests
"autosmooth custom normals" (mesh) and "sss hair" (sss). They failed
due to what likely is acceptable differences in rasterization.

Pull Request: https://projects.blender.org/blender/blender/pulls/148506
2025-10-22 11:04:46 +02:00
Brecht Van Lommel
1514298cc2 Revert "Tests: Temporarily disable test_undo.compositor_make_group"
This reverts commit ed5a4528cf.

It was fixed in the meantime by d27dacfc54.
2025-10-22 01:47:07 +02:00
Brecht Van Lommel
ed5a4528cf Tests: Temporarily disable test_undo.compositor_make_group
This is failing on macOS, and causing no new daily builds to be uploaded.

Ref #148535
2025-10-22 01:44:11 +02:00
Lukas Tönne
8f01070f26 Merge branch 'blender-v5.0-release' 2025-10-21 11:35:46 +02:00
Christoph Neuhauser
a2301e0b6e Fix: Tests: Pass EEVEE triangle light sampling test on Intel GPUs
This PR slightly raises the accepted noise level for the EEVEE test
"triangle light sampling" that was likely incorrectly marked as failed
on Intel GPUs. The previous bump in
https://projects.blender.org/blender/blender/pulls/147628 seems to not
have been sufficient, as the test still failed on a Lunar Lake system.

Pull Request: https://projects.blender.org/blender/blender/pulls/148486
2025-10-21 11:06:57 +02:00
Nick Alberelli
61da6403be USD: Add new get_prim_map API for the on_export hook
Similar to: 0df5d8220b

For consistency sake, we should have the `get_prim_map` function working
on the export side of USD hooks as well as the import side.

Pull Request: https://projects.blender.org/blender/blender/pulls/147242
2025-10-19 22:36:07 +02:00
Hans Goudey
6a829d78fa Mesh: Rewrite validation code
Rewrite the "mesh is valid" and "validate mesh" functions to be more
agnostic of the custom data storage system, align with the changes to
topology storage in the last 5 years, be much clearer overall, more
reusable.

Each check is implemented as a separate pass over the remaining
valid geometry in the mesh, producing an IndexMask of the invalid
elements it finds. At the cost of some extra iteration over mesh elements,
this should make each requirement clearer and make it easier to
optimize and reuse each check if needed.

The code is roughly twice as fast as it was before. I measured 92ms
instead of 200ms for a 1 million vertex cube on a Ryzen 7950X.
There's a bit of low hanging fruit for further optimization too.

There are now automated tests just for the validation code as well.
For now they are very basic but they could be extended in the future.

Some non-obvious points:
- The new face offsets storage (replacing `MPoly`) upholds more
  invariants by itself. Previously faces could easily overlap or leave
  corners unreferenced. That doesn't really happen anymore, but
  bad offset values are a more "global" problem.
- The validation code for the old "MFace" storage was removed. It is
  just rebuilt when it's needed at runtime anyway, so there isn't much
  point in validating it.
- The versioning code for 2.90.1 was calling the mesh validation code
  to fix an issue where the extrude manifold tool could generate bad faces.
  Unfortunately keeping that would mean being unable to remove the old
  code, so now there's a warning to open and save the file in a previous
  version instead.
- One of the main goals of the new code is better const correctness, and
  working better with implicit sharing. The code now only requests mutable
  copies of the mesh data if it has to change.

Part of #122398

Pull Request: https://projects.blender.org/blender/blender/pulls/148063
2025-10-16 19:55:24 +02:00
Brecht Van Lommel
ab7c817509 Merge branch 'blender-v5.0-release' 2025-10-16 18:03:58 +02:00
Brecht Van Lommel
a1fde8bed8 Tests: Blocklist failing Storm tests on AMD and Intel
Pull Request: https://projects.blender.org/blender/blender/pulls/148148
2025-10-16 18:03:18 +02:00
Brecht Van Lommel
dbfab80943 Tests: Move GPU vendor query function to module, remove dead code for EEVEE
The implementation of this was broken and not actually used for the EEVEE
tests, as there is currently no separate reference directory for AMD.

Move it to the render report module so it can be reused by different tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/148148
2025-10-16 18:03:17 +02:00
Lukas Tönne
443ced685e Merge branch 'blender-v5.0-release' 2025-10-16 12:15:44 +02:00
Christoph Neuhauser
91e83d94c5 Fix: Tests: Pass noise dependent EEVEE render tests on Intel GPUs
This PR slightly raises the accepted noise level for the following EEVEE
tests that were likely incorrectly marked as failed on Intel GPUs:
- render_layer: aov_transparency
- light: triangle_light_sampling
- bsdf: metallic_thinfilm_physical, metallic_thinfilm_f82
- principled_bsdf: principled_bsdf_transmission
2025-10-16 10:39:24 +02:00
Sean Kim
59746fde64 Merge branch 'blender-v5.0-release' 2025-10-15 19:32:24 -07:00
Sean Kim
e059c75ef5 Tests: Add delay for UI multi window tests on Windows
Similar to #146143, the `view3d_edit_mode_multi_window` currently fails
on the Windows build bot. This commit extends the platforms that
require an extra delay to avoid failures.

Pull Request: https://projects.blender.org/blender/blender/pulls/148078
2025-10-16 04:30:56 +02:00
Sergey Sharybin
5ee406a743 Merge branch 'blender-v5.0-release' 2025-10-15 17:13:54 +02:00