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
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
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
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
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
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
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
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
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
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
The patch adds a simple framework to test the File Output Node in the compositor. The main difference to the existing `render_test.py` framework is that multiple output images are supported. Edge cases such as empty output or too many outputs are supported as well.
Tests can be run like other compositor tests, e.g. `ctest -R compositor_cpu_file_output --verbose` or `BLENDER_TEST_UPDATE=1 ctest -R compositor_cpu_file_output` to update failing tests.
Sample output:
```
...
119: [ RUN ] Running test single_color...
119: [ PASSED ] Passed
119: [ RUN ] Running test png_passes...
119: [ PASSED ] Passed
119: [ RUN ] Running test mixed...
119: [ FAILED ] Test directory /home/guest/blender-git/blender/tests/data/compositor/file_output/mixed does not exist
119: [ RUN ] Updating test mixed...
119: [ RUN ] Running test no_files...
119: [ PASSED ] Passed
...
```
Parent task: https://projects.blender.org/blender/blender/issues/125893
Pull Request: https://projects.blender.org/blender/blender/pulls/133663
* Adds new entry into python CMakeLists.txt for running these tests
* Adds `sculpt_brush_render_tests.py` as the report runner and
test data initializer for the sculpt tests.
This commit adds the ability to do render tests with the Draw brush in
Sculpt mode on a specified mesh by specifying and performing a stroke in
area-space coordinates.
Like other render tests, these tests map a single .blend file to a
single reference image. Currently we test the following cases:
* A "base" mesh.
* A mesh with a Subdiv modifier added but not applied to it.
* A mesh with a basis & relative shape key added.
* A mesh with the multiresolution modifier added.
The associated reference image used is 200x200 pixels, in testing
with the draw brush, even this small resolution was able to detect
differences in detail caused by major regressions.
In total, the new files in the associated assets repository sum up
to roughly 4.5 MB.
Other than the mesh and modifiers, each of the files also contains a
scene with a camera, with workbench settings set to use a matcap for
the final rendering to better highlight curvature differences.
Part of #130772
Pull Request: https://projects.blender.org/blender/blender/pulls/133602
This PR does some changes to the render and compositor tests
- Compositor test will now test all GPU backends that are compiled
- EEVEE/Workbench render tests will move the GPU backend to the front of the
test name (eevee_next_opengl_bsdf)
- Blacklist EEVEE render tests that fail on Vulkan.
Pull Request: https://projects.blender.org/blender/blender/pulls/133981
Similar to how brush assets are created and managed this
PR allows to export pose assets into a different library.
Because of this there is a limitation to this where each
asset is stored in a separate blend file.
This may be lifted in the future as there are planned changes in
the design phase: #122061
### Create Asset
Now available in the 3D viewport in the "Pose" menu: "Create Pose Asset".
The button in the Dope Sheet will now call this new operator as well.
Clicking either of those will open a popup in which you can:
* Choose the name of the asset, which library and catalog it goes into.
* Clicking "Create" will create a pose asset on disk in the given library.
It is possible to create files into an outside library or add it in the current file.
The latter option does a lot less since it basically just creates the
action and tags it as an asset.
If no Asset Shelf **AND** no Asset Browser is visible anywhere in Blender,
the Asset Shelf will be shown on the 3D viewport from which
the operator was called.
### Adjust Pose Asset
Right clicking a pose asset that has been created in the way described
before will have options to overwrite it.
Only the active object will be considered for updating a pose asset
Available Options (the latter 3 under the "Modify Pose Asset" submenu):
* Adjust Pose Asset: From the selected bones, update ONLY channels that
are also present in the asset. This is the default.
* Replace: Will completely replace the data in the Pose Asset from
the current selection
* Add: Adds the current selection to the Pose Asset. Any already existing
channels have their values updated
* Remove: Remove selected bones from the pose asset
Currently this refreshes the thumbnail. In the case of custom
thumbnails it might not be something want
### Deleting an existing Pose Asset
Right click on a Pose Asset and hit "Delete Pose Asset". Works in the shelf
and in the asset library. Doing so will pop up a confirmation dialog,
if confirming, the asset is gone forever. Deleting a local asset is basically the
same as clearing the asset. This is a bit confusing because you get
two options that basically do the same thing sometimes,
but "Delete" works in other cases as well.
I currently don't see a way around that.
Part of design #131840
Pull Request: https://projects.blender.org/blender/blender/pulls/132747
Emit a 'diff' for the `animdata.slot_handle` property whenever the
`.action` property is changed through a library override.
The slot handle is only meaningful within the context of the assigned
action. So when a liboverride changes the assigned action, the slot
handle should also get an override.
This is necessary even when the numerical value of the slot handle
happens to be the same in both actions, as the newly chosen slot is
different from the slot that was chosen in the library file.
This applies to direct Action assignment, NLA strips, and Action
constraints.
Pull Request: https://projects.blender.org/blender/blender/pulls/133727
The opengl_draw_tests.py render test had a number of issues when
running, likely due to test data restructuring:
* Invalid CMakeLists.txt specification preventing tests from being added
* Invalid parameters to the `screenshot` function
This commit fixes both issues as well as renames the related files and
folders to better indicate their usage.
Pull Request: https://projects.blender.org/blender/blender/pulls/132838
These are based on data generated for liblink tests, so part of this
code is also refactored to move data generation into `bl_blendfile_utils.py`.
NOTE: Work done also to add tests to upcoming filepath mapping utils
(see !127252).
Pull Request: https://projects.blender.org/blender/blender/pulls/133110
"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
Simply load factory startup file, and recursively iterate over
all (valid) `POINTER` and `COLLECTION` properties of all IDs.
NOTE: A few cases are currently returning invalid rna paths (at least
from quick look), these are skipped for now.
Pull Request: https://projects.blender.org/blender/blender/pulls/132809
The goal of this test is to try to import some critical py scripts with the
system python of the building machine.
The main target is to ensure that these py scripts remain usable by all
buildbot machines, as some of them are using fairly outdated python
versions.
Current status:
* Scripts in `build_files` and `docs` are checked.
* Some python scripts in `build_files` were 'reverted' to be compatible
with older required python version currently (3.6).
* A few scripts are excluded from the test, mostly because they use Blender's
`bpy` module, which means they are only intended to be ran with Blender's
python anyway.
* The test is only enabled for Linux buildbots currently, as they use the
oldest Python by far.
Notes:
* Some more scripts are likely to be moved around in the future.
* Whether these tests need to be enabled on windows or macos platforms remains
an open question.
Pull Request: https://projects.blender.org/blender/blender/pulls/130746
This patch disables compositor tests that rely on anisotropic filtering
for GPU testing. This is done until we make sure they pass universally
by not relying on hardware filtering.
Test files that rely on anisotropic filtering were moved to their own
tests to be able to disable them for GPU only.
This patch removes the references for the GPU tests and uses the CPU
references for both CPU and GPU, since they are expected to match. This
also unifies the tests scripts into a single script with an argument
for execution device.
Both the draw manager and gpu backend used the same compilation
directive for enablement. This PR seperates them into
`WITH_GPU_DRAW_TESTS` for draw manager related tests and
`WITH_GPU_BACKEND_TESTS` for gpu backend related tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/132018
OptiX OSL tests were previously disabled due to a GPU driver bug
resulting in many tests failing unexpectedly.
The new driver version is now out with the fix so we can now enable
OptiX OSL testing.
This commit also updates the OptiX OSL block list with better comments,
and more tests that are known to fail and need investigating.
Ref: #123012
Pull Request: https://projects.blender.org/blender/blender/pulls/129280
Render tests can still fail. This change will disable them until they
are in a better shape. Reduces confusion when running cycles GPU render
tests.
Known issues:
- Render in batch can take forever due to a locking issue
- Headless rendering is still in development
- Particle hair rendering is broken.
Pull Request: https://projects.blender.org/blender/blender/pulls/131964
In a previous commit the Principled BSDF tests were renamed from
`principled_...` to `principled_bsdf_...`. The proposal was made to
also rename the folder these tests were in to `principled_bsdf` for the
sake of consistency. This is what this commit does.
Pull Request: https://projects.blender.org/blender/blender/pulls/131771
Some changes to how argparse is used in render tests:
1. Use the common approach of one dash for single-letter options (`-b`)
and two dashes for longer options (`--blender`). In this commit that
just means changing single-dashed (`-testdir`) to double-dashed
(`--testdir`).
2. Remove unnecessary `nargs` arguments. The code was telling `argparse`
to put CLI arguments into a list of one item, and then had code to
turn that one-item list into the item itself. I've just removed the
`nargs` argument altogether, as that just produces the desired
value without requiring more code.
I've also removed `nargs="+"` from the handling of the `--blender`
parameter, as that allowed for multiple occurrences of `--blender
{path}` but was silently ignoring all of those except the first.
To ensure that required arguments are present, the code now uses
`required=True` instead of `nargs`.
3. Add a `description` parameter so that `--help` shows what the
test script actually does. Also it helps people (like me) who want
to figure out which blend file is actually being opened by the
test, without making the test itself more verbose.
No functional changes, except that you now cannot add multiple
`--blender` arguments any more (the CLI invocation will fail). This wasn't
used anywhere I could find, though.
Pull Request: https://projects.blender.org/blender/blender/pulls/131666