Commit Graph

1965 Commits

Author SHA1 Message Date
Aras Pranckevicius
6a0e6f5cff Fix: New FBX importer was not handling blender specific FullWeights
- Update to latest ufbx version that adds support for FullWeights
- Handle that in the same way as the Python importer did
- Add test files from ufbx test suite

Pull Request: https://projects.blender.org/blender/blender/pulls/138811
2025-05-13 15:43:08 +02:00
Alaska
9890ad2653 Fix: Render test failure when building without ocean sim
There was one test in the volume render test folder that made use of
the ocean sim modifier to add some detail. This lead to test failures
when building Blender without ocean sim.

To fix this issue, this commit applies the ocean sim modifier. This
means it's no longer used, but the render results are the same,
meaning there is no need to update the reference images.

Pull Request: https://projects.blender.org/blender/blender/pulls/138729
2025-05-13 05:07:58 +02:00
Alaska
1c1e2f1371 Fix: Render test failures when building without fluid modifier
When building Blender WITH_MOD_FLUID=OFF, the OpenVDB render tests
would fail as some of them make use of the WITH_MOD_FLUID features.

This commit fixes this by disabling OpenVDB render tests unless
WITH_MOD_FLUID is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/138728
2025-05-13 05:07:45 +02:00
Mattias Fredriksson
d0cf7dd8b5 Fix: Improve OBJ NURBS IO, support exporting custom knots
Corrects behavior with NURBS knot values in .obj exporter. Knot values
denoting the curve parameter range and values at the boundary region
in the span ends had hardcoded knot values. It also implemented its own
knot calculation, which is not ideal...

Importer is updated to not try to second guess the knot values.
Not entirely sure what it was trying to do but it used wrong indices
and missed writing the end of the knot vector. Combined the changes
should make it possible to import and export a simple NURBS curve with
custom knots and leaving it intact.

This replaces some of the erronous behavior using functions from [new]
Curves implementation. Mixing new and legacy curve implementation is not
ideal but exporter is exporting POLY curves as NURBS while legacy method
does not support computing the knot vector. To avoid introducing
additional branch cases nor update legacy functions, using the new
functions seems to be the correct choice. These functions should be
functionally equivalent but is not identical (e.g. legacy curve returns
knots in [0, 1] range). It should also make it easier to transition to
exporting new Curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/138732
2025-05-12 16:51:21 +02:00
Ray Molenkamp
2c5b9e182b CMake: Add code coverage support for clang
Pretty bare bones but gets the job done, unlike the gcc
tooling, this will work for release builds, the performance cost
of it is on the high side of things, the full test suite tests take over
an hour for me with code coverage support enabled on a release build.
I have not timed a debug build. Given developers can just run their
tests to get coverage data over what they are working on, I feel this
is still useful tooling to have.

This adds the 3 targets for clang and adds a single gcc target

coverage-reset - this removes the collected code coverage data and
report

coverage-report - This merges the collected data and generates the
report (new for gcc)

coverage-show - This merges the collected data and generates the report
and opens it in the browser

This relies on llvm-cov and llvm-profdata being available if not found
code coverage is disabled.

Note: A full test run requires an obscene amount of disk space, a
complete test run takes about 125GB and takes 12 minutes to merge, so
provision the COMPILER_CODE_COVERAGE_DATA_DIR folder accordingly

Example report in PR
2025-05-12 16:28:41 +02:00
Aras Pranckevicius
a96ecd2834 Fix #137768: new FBX importer does not import some animations correctly
- FBX "root bone" should become the Armature object itself, and not
  an extra bone (follow same logic as Python importer did).
- "World to armature matrix" was not correct for armatures that are
  parented under some other objects with transforms.
- Parenting imported meshes under an Armature was not taking into
  account that the mesh bind transform might not be the same as the
  current mesh node transform (i.e. was not setting "matrix parent
  inverse" to compensate like the Python importer did).
- The repro file in #137768 also exposed an issue that importing custom
  vertex normals was not working correctly in the new importer, when
  mesh is partially invalid (validation alters the mesh, custom normals
  have to be set afterwards).

Pull Request: https://projects.blender.org/blender/blender/pulls/138736
2025-05-12 10:56:07 +02:00
Ian Yoo
e0dc538854 Tests: Add non-rotation regression test for glare_simple_star filter
The current regression tests for the Glare Node cover most but not all
of the code. In this case, the simple_star test only tested for 45
degree rotation offset of the glare highlight.
This will add a simple_star_no_rotation.blend regression test and its
corresponding output_render png to cover the no offset case.

The function, line, and region coverage have improved by about ~9-10%

Pull Request: https://projects.blender.org/blender/blender/pulls/138587
2025-05-11 15:34:24 +02:00
Jesse Yurkovich
2b4eb5ccfd Fix: USD: Don't attempt to export the special sharp_face attribute
While it hasn't seemed to affect anything currently, it's unnecessarily
wasteful in the resulting file and risky to be importing back in.

Pull Request: https://projects.blender.org/blender/blender/pulls/138699
2025-05-10 08:08:16 +02:00
Jacques Lucke
18365a88bd Geometry Nodes: initial Import node regression tests
This adds some basic tests for the Import OBJ/STL/PLY nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/138700
2025-05-10 07:24:33 +02:00
Alexandre-Cardaillac
921c2b9d61 Shader: New Volume Coefficients Shader
Add a new shader node to control volume coefficients (scattering,
absorption and emission) directly, making it easier to model existing
volumes with measured data.

Pull Request: https://projects.blender.org/blender/blender/pulls/136287
2025-05-08 19:19:35 +02:00
Hans Goudey
92de7a4cbf Fix #138279: Realize instances node with depth input can crash
When not all the meshes referenced by the instances recursively
are realized because of the limit of the depth input, and those
meshes have vertex groups, a crash is possible because of an
un-checked VectorSet lookup. `all_meshes_info.order` includes
all meshes regardless of the depth and mask arguments.

Pull Request: https://projects.blender.org/blender/blender/pulls/138519
2025-05-07 02:15:04 +02:00
Weizhen Huang
64dc9cc98c Fix: Cycles: Inconsistency in transparent bounces for NEE and forward path
Note: this is a partial fix, that makes NEE and forward path consistent
only when `max_transparent_bounce > 0`. It is much more involved to make
forward path tracing support a max transparent bounce of 0, but since we
don't expect people to set up a very low number of transparent bounces,
it is less important to support that specific case.

Pull Request: https://projects.blender.org/blender/blender/pulls/138098
2025-05-05 18:38:02 +02:00
Weizhen Huang
157979167b Fix: correct path for overlay test 2025-05-05 18:34:28 +02:00
Sergey Sharybin
bbfc97ad6f Move tests/data and assets to the main repository
This change moves the tests data files and publish folder of assets
repository to the main blender.git repository as LFS files.

The goal of this change is to eliminate toil of modifying tests,
cherry-picking changes to LFS branches, adding tests as part of a
PR which brings new features or fixes.

More detailed explanation and conversation can be found in the
design task.

Ref #137215

Pull Request: https://projects.blender.org/blender/blender/pulls/137219
2025-05-05 15:10:22 +02:00
Falk David
fb45d97ad4 Tests: Updated Grease Pencil render tests 2025-05-02 15:22:59 +02:00
Jesse Yurkovich
bf6c847464 Tests: USD: Run the compliance validator for the MaterialX export test
We recently pulled in the upstream patch to address the incorrect
validation error we were experiencing. This was the only test which
previously required the validator to be disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/138289
2025-05-02 06:19:28 +02:00
Clément Foucault
877abbe9f7 Cleanup: EEVEE: Remove next from EEVEE-Next from tests suite
It makes no sense to keep this suffix now that eevee-next is default.

Pull Request: https://projects.blender.org/blender/blender/pulls/138271
2025-05-01 17:54:22 +02:00
Omar Emara
a31dcdf5b5 Compositor: Remove Variable Size blur option
This patch removes the Variable Size blur option from the Blur and Bokeh
Blur nodes. So now, whatever the user connects to the size input will be
used, be it variable or constant.

The option previously could be used to force the node to ignore variable
size inputs and assume a size of 1, so it was useless.

Versioning would be difficult, as we don't know if incoming links to the
size input is variable or single. So this is a breaking change. But I
can't think of a real reason why the user might use this option, so this
seems safe from a practical point of view.

Pull Request: https://projects.blender.org/blender/blender/pulls/138261
2025-05-01 14:58:10 +02:00
Michael B Johnson
79c318f692 Fix #137973: Add MaterialX version info on USD export
This change adds MaterialX version information to the exported MaterialX
USD materials.

Details:

In USD 25.02, the MaterialXConfigAPI schema was introduced to allow
recording the MaterialX version used to author a material. When loading
MaterialX documents into USD, this schema is automatically applied and
the associated version attribute is created on the material.

Due to how the MaterialX export works (via copying the composed
MaterialX spec from a temporary stage), the MaterialXConfigAPI needs to
be explicitly applied to the final material being exported.

This change applies this MaterialXConfigAPI schema and copies the
version attribute from the temporary MaterialX stage to the final stage.

Authored by Apple: Dan Knowlton

Co-authored-by: Dan Knowlton <d_knowlton@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/137974
2025-04-30 19:54:17 +02:00
Aras Pranckevicius
9315af2170 Fix: some cases of bone scale were not handled correctly in new FBX importer
- Was not consistently adjusting for bone adjust_post_scale
- Map fbx node "igore parent scale" to Blender bone "inherit scale: none"

Pull Request: https://projects.blender.org/blender/blender/pulls/138204
2025-04-30 16:03:00 +02:00
Aras Pranckevicius
4b161093b4 Fix: Do not create completely empty animation curves in new FBX importer
Some files have animated properties that do not have any actual
animation curve data. Do not try to create f-curves for those. Fixes
a crash on some files.

Pull Request: https://projects.blender.org/blender/blender/pulls/138118
2025-04-29 11:02:33 +02:00
Lukas Stockner
be4268ec1c Tests: Cycles: Remove OSL-specific displacement test after fix to match SVM
Since commit 175686f2, the behavior of OSL now matches SVM, so instead of this
separate test this is handled by the regular test and the "does OSL match SVM"
checks.
2025-04-28 14:53:05 +02:00
Lukas Stockner
54b156bf16 Cycles: Add support for automatic bump mapping on OptiX OSL
All the required parts are already there, just needs to be hooked up.
This is essentially just copying what `osl_eval_nodes<SHADER_TYPE_SURFACE>`
does on the CPU.

Fixes #104276.

Pull Request: https://projects.blender.org/blender/blender/pulls/138044
2025-04-28 12:47:31 +02:00
Clément Foucault
8338aaf44f EEVEE: Update tests for shadow terminator 2025-04-25 20:10:33 +02:00
Jesse Yurkovich
ba60868477 USD: Animated camera property import
Imports in the following animated data from UsdGeomCameras:
- Focal length
- DOF distance
- DOF fstop
- Clip start, Clip end
- Tilt shift x, Tilt shift y
- Aperture sizes (with caveats)

Implementation wise, it's more complicated than I'd like due to needing
to read in both non-animated and animated data for each property. And
because I've tried to reduce the duplication of various transforms we
have to do on each value. E.g. scaling values by "tenth of scene units"
or the extraction of the USD clipping range from a GfVec2f into 2
separate properties, and 2 separate fcurves, in Blender etc. The current
approach was the best I could come up with so far.

Aperture sizes remain problematic for import, with animation data and
without, due to how Blender selects the largest sensor dimension to base
downstream calculations on and for which there's no concept in USD to
strictly dictate which dimension to use. Additionally, changing the
sensor size will impact the Tilt values as well. This means that if the
Aperture sizes are animated, we must also animate the tilt values; leads
to more fcurves being created than perhaps expected.

The `projection` attribute (perspective and orthographic) remains
unchanged (non animated only) due to differences in how USD<>Blender
interoperate with the Orthographic projection method. Note: Blender only
exports perspective cameras due to the same reason.

Pull Request: https://projects.blender.org/blender/blender/pulls/137487
2025-04-25 19:57:12 +02:00
Sean Kim
e27be7cfc6 CMake: Rename and expose 'USE_EXPERIMENTAL_TESTS' option
The `USE_EXPERIMENTAL_TESTS` variable was not exposed as an option, so
the two tests that use the option to check whether tests should be run
had to be manually enabled by changing `tests/python/CMakeLists.txt`.

This commit renames the variable to `WITH_TESTS_EXPERIMENTAL`, defaults
the option to `OFF`, and marks it as an advanced option.

Pull Request: https://projects.blender.org/blender/blender/pulls/133831
2025-04-24 06:11:30 +02:00
Sean Kim
83f5480be0 Fix: Revert accidential test submodule hash change
Introduced in 840ed03d92
2025-04-23 15:50:42 -07:00
Sean Kim
840ed03d92 Cleanup: make format 2025-04-23 13:22:03 -07:00
Howard Trickey
38459c9508 Tests: New tests/data version to include boolean manifold test. 2025-04-23 07:22:51 -04:00
Alaska
d2704076b7 Tests: Small adjustments to the principled_bsdf_bevel_emission test
This commit makes two small adjustments to the
principled_bsdf_bevel_emission test:
- The IOR on the material that has the bevel shader was increased.
  - With this change, RDNA4 GPUs in Blender 4.4.X now fail this test.
- The exr environment texture is swapped for a noise texture.
  - This reduces the file size by about 200kb.

Ref: blender/blender-test-data!87
2025-04-22 06:26:18 +02:00
Alaska
0e144463e8 Tests: Add adaptive subdivision tests with problematic geometry features
As reported in blender/blender#137517, a regression was introduced
where certain features (Normals, tangents, window) would not render
properly when using adaptive subdivision. Presumably this issue slipped
through testing, so this commit adds a test to test this.

Ref: blender/blender-test-data!85
2025-04-18 07:00:24 +02:00
Sean Kim
24f6719d00 Tests: Add sculpt rebuild bvh performance tests
Using the same sized grids as the brush tests, this commit uses the
`sculpt.optimize` operator to approximate the cost of rebuilding the BVH
for a given base mesh grid, multires grid, and dyntopo grid.

Pull Request: https://projects.blender.org/blender/blender/pulls/137690
2025-04-18 06:08:41 +02:00
Brecht Van Lommel
df053e290d Fix #137621: Cycles curve info random gives wrong value
Caused by filter width changes in 5ce239cc229931b8225.

Pull Request: https://projects.blender.org/blender/blender/pulls/137671
2025-04-17 19:15:05 +02:00
Brecht Van Lommel
d53fdfc7c3 Fix #137517: Cycles adaptive subdivision doesn't use flat normals
Pull Request: https://projects.blender.org/blender/blender/pulls/137677
2025-04-17 19:13:22 +02:00
Falk David
3a7b2f713f Fix #137523: Grease Pencil: Crash in realize instance node
In the function `gather_attributes_to_propagate` all the instance
attributes were set to be propagated to the `Point` domain.

For Grease Pencil, we want to make sure to propagate these
attributes to the `Layer` domain instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/137665
2025-04-17 18:43:43 +02:00
Hans Goudey
6e8c82ef3c Tests: Update tests hash for Geometry Nodes fix
https://projects.blender.org/blender/blender/pulls/137614
2025-04-17 08:38:30 -04:00
Sean Kim
8b7b9380a7 Fix: Sculpt performance test doesn't run
Incomplete fix in ed91a298c0

`StrEnum` is also a concept that doesn't exist in python 3.9

Pull Request: https://projects.blender.org/blender/blender/pulls/137624
2025-04-16 23:08:45 +02:00
Aras Pranckevicius
67063d3c4d Tests: switch FBX import tests to use the new importer
Pull Request: https://projects.blender.org/blender/blender/pulls/137590
2025-04-16 13:01:46 +02:00
Sean Kim
65b84a97de Tests: Add tests for object.voxel_remesh
Pull Request: https://projects.blender.org/blender/blender/pulls/137378
2025-04-16 07:01:24 +02:00
Sean Kim
ed91a298c0 Fix: Sculpt performance test does not run
The runner for the performance tests / benchmarks uses python 3.9, so
the `match` statement is invalid as a concept.

Pull Request: https://projects.blender.org/blender/blender/pulls/137563
2025-04-15 23:16:24 +02:00
Clément Foucault
dde18802a5 GPU: Remove WITH_GPU_RENDER_TESTS_SILENT option
This was introduced during EEVEE-next developement
cycle to not make the buildbot fail because of EEVEE
render tests.

These have stabilized now and we can remove this option.

Pull Request: https://projects.blender.org/blender/blender/pulls/137545
2025-04-15 17:56:16 +02:00
Clément Foucault
ba757c36d6 EEVEE: Update reference images after #137485 2025-04-15 16:39:03 +02:00
Alaska
21add72f31 Tests: Add Cycles test for RDNA1 Principled BSDF rendering issue
This commit adds a render test for the issue reported in
blender/blender#137420.

Ref: blender/blender-test-data!84
2025-04-15 09:20:09 +02:00
Jacques Lucke
ee8713d567 Geometry Nodes: add closure pass through test 2025-04-14 20:15:43 +02:00
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