Commit Graph

117 Commits

Author SHA1 Message Date
Sean Kim
f99b35463a Tests: Remove suite level apply_modifiers option for modifier tests
The `apply_modifiers` property of the `RunTest` class overrides
all of the test level `apply_modifier` properties. This prevents
modifiers from manually specifying when a modifier is applied and forces
the modifier to be applied immediately after it is added.

The vast majority of tests do not override the `apply_modifier`
property, the primary usecase for this property is to work in
combination with the `do_compare` property to allow examining the
corresponding .blend file to debug test failures.

This commit simplifies the settings by removing this parameter. It now
only disables applying the modifier if `do_compare` is set to False.

Pull Request: https://projects.blender.org/blender/blender/pulls/140893
2025-06-24 19:27:36 +02:00
Aras Pranckevicius
ba0b1acb4e Fix #139656: FBX importer does not set normalmap textures as "non-color"
Normal maps (and generally all other non-color textures) were not
marked as non-color in the new FBX importer.

Pull Request: https://projects.blender.org/blender/blender/pulls/139725
2025-06-02 15:15:05 +02:00
Aras Pranckevicius
8e8d2e7aec Fix: Make new FBX importer support Light exposure
7e0dad0580 added Light exposure import to Python FBX importer,
but not to the new C++ one

Pull Request: https://projects.blender.org/blender/blender/pulls/139292
2025-05-22 20:31:56 +02:00
Jacques Lucke
16ad67d34c Tests: have test_object active by default in regression test files
When opening Geometry Nodes regression test files I always find a bit annoying
that the `expected_object` and not the `test_object` is active. That's because
only the `test_object` contains the modifier or node tree that is being tested.
Therefore, usually my first step when opening these files is to select the
`test_object` first.

This patch changes it so that when mesh tests are updated, the `test_object` is
made active in the end before the file is saved again.

Pull Request: https://projects.blender.org/blender/blender/pulls/139088
2025-05-19 15:38:17 +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
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
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
илья _
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
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
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
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
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
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
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
Campbell Barton
6fcd84721c Cleanup: quiet some warnings from check_pep8 target 2025-02-04 14:51:17 +11: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
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
Sean Kim
2e7db9c167 Fix: Remove missed device parameter
Missed in ea7d07098b

Pull Request: https://projects.blender.org/blender/blender/pulls/133794
2025-01-30 05:44:20 +01:00
Alaska
ea7d07098b Tests: Disable --cycles-device arguments on non-Cycles tests
This commit reworks the RenderReport base class to avoid adding
`--cycles-device` device arguments to non Cycles tests.

This reduces some warnings that can show up with EEVEE and
Workbench tests that accidentally used these arguments.

Pull Request: https://projects.blender.org/blender/blender/pulls/133724
2025-01-30 04:15:27 +01:00
Sean Kim
aee2add84a Tests: Error on no test files being found for render_report.py
This commit checks the total number of files being processed for
rendering tests and causes it to emit a failure if none are found. This
has the benefit of loudly failing if there is a configuration error
instead of succeeding.

Pull Request: https://projects.blender.org/blender/blender/pulls/133691
2025-01-29 23:53:31 +01:00
Aras Pranckevicius
f5c2aecd8b Tests: emit more information in import tests templates
- Bone matrices,
- Material viewport settings (colors, backfaces etc.)
- Improved handling of relative paths of material images

Pull Request: https://projects.blender.org/blender/blender/pulls/133658
2025-01-27 18:19:04 +01:00
Jesse Yurkovich
d4c2d73864 USD: Add test coverage for parent-child transforms during animation
Makes use of recently added test data to ensure proper handling of child
objects, with animated transform constraints, parented to other objects
who also have animated transform constraints.

Also uses the `colored_print` module to better segment the test output.

Pull Request: https://projects.blender.org/blender/blender/pulls/133600
2025-01-26 04:43:16 +01:00
Aras Pranckevicius
342235616a Tests: emit more details in import test .txt templates
- Animation keyframes now contain left/right handle information
- More fcurves are emitted
- Material textures emit whether their colorspace is "data"
- More files in fbx test coverage

Pull Request: https://projects.blender.org/blender/blender/pulls/133526
2025-01-24 10:24:33 +01:00
Aras Pranckevicius
1ad083dabf Tests: Add FBX import tests, switch OBJ/PLY/STL import tests to the same machinery
"Expected textual data output" comparison based tests for FBX,
OBJ, PLY, STL import.

- There's a tests/python/modules/io_report.py that can produce
  a "fairly short text description of the scene" (meshes, objects,
  curves, cameras, lights, materials, armatures, actions, images).
  About each object, it lists some basic information (e.g. number
  of vertices in the mesh), plus a small slice of "data" (e.g.
  first few values of each mesh attribute).
    - Custom import parameters, if needed, can be provided by
      having a sidecar .json file next to imported file (same
      basename, json extension), that would have a single json
      object with custom arguments.
- Add FBX test coverage, with 46 fairly small files (total size 3.8MB)
  covering various possible cases (meshes, animations, materials,
  hierarchies, cameras, etc. etc.).
- Switch OBJ/PLY/STL import tests to the above machinery, remove C++
  testing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/132624
2025-01-15 05:52:15 +01:00
Campbell Barton
4f1817cc18 Cleanup: declare __all__ for Python scripts
Declare all to make public public API's explicit and
help detect unused code.
2025-01-06 16:45:36 +11:00
Falk David
f6c30bfe45 Curves: Add python function to compare curve geometries
This adds a `unit_test_compare` function to `Curves`.

Compares the curves. Curves are the same if:
* The number of points matches.
* The number of curves matches.
* The attribute names are the same and have the same type.
* The point attribute values are within the `threshold`.
* The curve topology matches (e.g. the curve sizes are the same).
* The curve attribute values are within the `threshold`.
* The indices of the points and curves are the same (can be ignored if this should be treated as the same).

The implementation reuses the same functions as the existing
comparison function for meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131164
2024-12-03 11:11:27 +01:00
Campbell Barton
a7ab81d927 PyAPI: remove use of BaseException
BaseException was used as a catch-all in situations where it
didn't make sense and where "Exception" is more appropriate
based on Python's documentation & error checking tools,
`pylint` warns `broad-exception-caught` for e.g.

BaseException includes SystemExit, KeyboardInterrupt & GeneratorExit,
so unless the intention is to catch calls to `sys.exit(..)`,
breaking a out of a loop using Ctrl-C or generator-exit,
then it shouldn't be used.

Even then, it's preferable to catch those exceptions explicitly.
2024-10-01 13:18:46 +10:00
Alaska
1330d0ddda Cycles render tests: Add the option to test with OSL enabled
This commit adds a new cmake variable `WITH_CYCLES_TEST_OSL`
that runs every Cycles test a second time with OSL enabled.

At the moment only CPU OSL is enabled. There are plans to enable
OptiX OSL in the future when stability issues with OptiX OSL
have been resolved.

Some render tests have been blocked from running until we can figure
out a fix. The most notiable being all the Pricincipled BSDF tests
as some of them are failing due to noise differences.

Ref #123012

Pull Request: https://projects.blender.org/blender/blender/pulls/124601
2024-08-14 17:00:48 +02:00
Alaska
935c49f1cf Render tests: Use blocklist name for blocked tests
Pull Request: https://projects.blender.org/blender/blender/pulls/124960
2024-07-18 17:31:52 +02:00
Alaska
2724f296b2 Render test: Add option to ignore block list
Add a option to ignore Cycles render test black list, controlled via
BLENDER_TEST_IGNORE_BLOCKLIST environment variable.

Useful for testing to see if anything is seriously broken in a test
that's black listed. (E.g. See if some particle rendering tests are
seriously broken on the GPU)

It would be recommened that this be used to test GPU compiler updates.
Or the enablement of certain features like custom curve rendering on
custom BVH.

Pull Request: https://projects.blender.org/blender/blender/pulls/124662
2024-07-17 16:59:25 +02:00
Hans Goudey
68000660d2 Tests: Add option to allow index changes for certain mesh comparison tests
Currently the mesh boolean code is producing a different index order on the latest
version of XCode on macOS. This is proving very difficult to investigate, and it's
preventing developers from spending time on more important things.

As a compromise for now, allow configuring certain geometry nodes tests to make
meshes with a different index order still pass the test. This can be done by adding
a boolean custom property with the name `allow_index_change` to the test object
and setting it to "True". Allow the index change on different platforms is unfortunate,
spending time on working on a replacement exact boolean algorithm is a more
valuable use of time currently.

After this commit lands, someone who can reproduce the failing test on their
computer should update tests to include that custom property as necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/123204
2024-06-14 14:50:26 +02:00
Campbell Barton
6a937d646b Cleanup: remove unused variables 2024-03-21 10:11:54 +11:00
Habib Gahbiche
f9cb2eb988 Cleanup: Tests: update message to refer to git instead of svn
Pull Request: https://projects.blender.org/blender/blender/pulls/119577
2024-03-17 09:47:40 +01:00
Brecht Van Lommel
c28038d970 Merge branch 'blender-v4.1-release' into main 2024-02-20 19:19:00 +01:00
Brecht Van Lommel
a3ffb51da6 Tests: Silence unnecessary oiiotool warning messages 2024-02-20 19:18:22 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Harley Acheson
7d1747819f Merge branch 'blender-v4.1-release' 2024-02-16 08:40:51 -08:00
Brecht Van Lommel
66c6cbb598 Tests: Silence warning about missing alpha channel in render tests
Having this repeated many times makes it hard to spot actual issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/118355
2024-02-16 16:36:21 +01:00
Campbell Barton
2119d271e0 Cleanup: remove "-noaudio" argument in background mode
This is no longer needed as background mode implies -noaudio.
2024-02-14 00:13:38 +11:00
Jeroen Bakker
324ef0cbf4 RenderTest: GPU Render Tests Pass Silently
Add silently fail option to GPU based render tests. This is a pre-requisite to enable
render tests on the buildbot. By default these render tests will pass silently.

* Test will pass when using the `--pass-silently` arguments.
* Only crashes will be reported as failed tests.
* To find out failing test, review the test reports.

`WITH_GPU_RENDER_TESTS_SILENT` compile option can be used to let tests pass (default)
or fail (default for developers).

Although some tests fail, they still passed. In the generated render report,
the silently passed failures are correctly reported to be failures.

Pull Request: https://projects.blender.org/blender/blender/pulls/117629
2024-01-29 15:39:14 +01:00
Brecht Van Lommel
3f0f26ee8a Tests: make reports summary HTML work with relative links
So that downloading the test results from the buildbot has working links.
2024-01-26 17:04:22 +01:00
Jeroen Bakker
49d07653f9 RenderTests: Fix Incorrect Command in Report
When running the render test for EEVEE-Next the command printed on
the report to update the reference images was incorrect. In stead of
displaying
`BLENDER_TEST_UPDATE=1 ctest -R eevee_next` it displayed
`BLENDER_TEST_UPDATE=1 ctest -R eevee next`.

The cause of this is that the title of the report is used to create
the command. EEVEE-Next has a space in its title which generates
an incorrect command.

A quick fix would be to replace spaces with underscores. But it would
be better to fix this more clearly by adding an attribute containing the
engine name.

This PR adds a `set_engine_name` method to the Report class. By
default the engine name is set based on the title.

Pull Request: https://projects.blender.org/blender/blender/pulls/117503
2024-01-25 18:55:28 +01:00
Sergey Sharybin
9fdf3bc1f4 Fix missing generation of alpha difference images in render tests
The part of the patch wasn't properly applied from a working branch,
and it wasn't very visible because the development environment already
had all files on disk.

Pull Request: https://projects.blender.org/blender/blender/pulls/117504
2024-01-25 14:20:30 +01:00
Sergey Sharybin
f11292104d Render Tests: Separate difference of Color and Alpha
This change fixes confusion situation when the render output
is an RGBA image: the difference in color was not visible in
the report because alpha channel was all zeros. This is due
to idiff performing per-channel difference.

The solution to this problem is to have separate images for
color and alpha difference, which makes it clear where the
difference actually is coming from.
2024-01-25 10:04:16 +01:00
Hans Goudey
db17c4bff5 Cleanup: Remove redundant selection comparison from mesh tests
The `unit_test_compare` function already compares selection attributes.
2023-11-27 13:36:20 -05:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
89811cb96f Cleanup: unused-imports in tests/ 2023-07-25 21:43:53 +10:00
Jeroen Bakker
7d122ff82b Cleanup: make format 2023-06-16 15:15:27 +02:00
Jacques Lucke
9535248911 Tests: support simulation nodes regression tests
Geometry nodes supports simulation nodes which allows later frames to depend
on previous frames. The existing geometry nodes regression tests only evaluated
the node tree at a single frame and therefore couldn't test the correct behavior of
simulations.

This adds a new kind of regression test that evaluates the scene at multiple
consecutive frames and then checks if the last frame matches.

Pull Request: https://projects.blender.org/blender/blender/pulls/109046
2023-06-16 10:00:55 +02:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00