Commit Graph

1551 Commits

Author SHA1 Message Date
Campbell Barton
51773a41cc Tests: add options for WITH_UI_TESTS
Support launching Blender in GDB as well as displaying the wayland
session which is useful for troubleshooting tests.
2024-10-17 18:15:33 +11:00
Clément Foucault
2f24879107 EEVEE: Update render tests 2024-10-11 14:05:59 +02:00
Clément Foucault
8dfcd7cf70 EEVEE: Update tests 2024-10-09 19:12:50 +02:00
Falk David
f99735d85c Fix: pyapi_grease_pencil test failiure
Broken by 09ca5a4c5f.
The test needs to be updated to reflect the change.
2024-10-08 14:12:58 +02:00
Chris Clyne
5a27280916 EEVEE: Light & Shadow linking
This adds feature parity with Cycles regarding light and shadow liking.

Technically, this extends the GBuffer header to 32 bits, and uses
the top bits to store the object's light set membership index.
The same index is also added to `ObjectInfo` in place of padding bytes.

For shadow linking, the shadow blocker sets bitmask is stored per
tilemap. It is then used during the GPU culling phase to cull objects
that do not belong to the shadow's sets.

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/127514
2024-10-03 18:41:06 +02:00
Jesse Yurkovich
4a679470b6 Fix: USD: collection creation during import assigned extra fake user
When using the `create_collection` parameter during import, the newly
created Collection would be assigned a fake user which isn't necessary
and caused the user count to be 2 instead of the more natural 1 here.

Remove the fake user and add test coverage for the scenario in general.

Pull Request: https://projects.blender.org/blender/blender/pulls/128348
2024-10-02 19:53:50 +02:00
Sybren A. Stüvel
a380567679 Anim: avoid running LayeredInsertKeyTest in non-experimental build
Avoid running a Python unit test for layered Actions in non-experimental
builds.

Due to a misunderstanding, enabling the user preference for the 'Slotted
Actions' experimental feature is still possible on release builds, which
caused this test to fail on non-experimental builds (because it's
intentionally missing a chunk of experimental code).

No functional changes to Blender itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/128483
2024-10-02 16:32:15 +02:00
Jesse Yurkovich
b05a4fc049 Hydra: Update Storm reference images with recent changes (again) 2024-10-01 19:12:42 -07:00
Jacques Lucke
fd4f864cba Geometry Nodes: improve display of node warnings in modifier
This does the following changes:
* Show info "warnings" in modifier too. Previously those were skipped. The
  different behavior of info/warning/error messages causes confusion.
* Add a new `Warnings` panel that only shows when there are warnings. In its
  title, it shows how many warnings there are.
* In the panel, warnings are sorted by severity and alphabetically.

Pull Request: https://projects.blender.org/blender/blender/pulls/128395
2024-10-01 15:31:50 +02:00
Sybren A. Stüvel
5b9de19345 Anim: respect group parameter of rna_struct.keyframe_insert() func
Add support for `rna_struct.keyframe_insert(…, group="name")` parameter,
when inserting keys into a layered Action.

This simply was never implemented, and the default channel group name
was always used.

Pull Request: https://projects.blender.org/blender/blender/pulls/128383
2024-10-01 10:27:36 +02:00
Sybren A. Stüvel
23d3f692f6 Anim: clean up keyframe insertion unit test
Clean up a keyframe insertion unit test I just committed, as it had some
commented-out code that shouldn't have been commented out. The test
logic could also be simplified, as the complexity was necessary for
replaying the broken test case, but not necessary for testing the actual
underlying behaviour.

No functional changes.

Ref: 2dba943341ce7a7706c3865b4b7b1cfc5d6bb746
Pull Request: https://projects.blender.org/blender/blender/pulls/128379
2024-10-01 10:22:59 +02: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
Jesse Yurkovich
69a936f9f3 Hydra: Update Storm reference images with recent changes 2024-09-30 13:07:31 -07:00
Sybren A. Stüvel
d58176e1e0 Anim: fix bug in action.fcurves.clear() corrupting F-Curve groups
Calling `action.fcurves.clear()` would clear the F-Curves, but didn't
update the F-Curve groups. This meant that the groups data still had their
original length & offsets into the F-Curves array, causing subsequent
F-Curve creation to crash Blender.

The unit test for this also covers the previous commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/128375
2024-09-30 15:42:58 +02:00
Jesse Yurkovich
4426526813 USD: Add tests for multiple materials assigned to single mesh
This includes tests for a "static" mesh where the materials have been
assigned and are expected to remain the same over time.

The test scenario also includes a "dynamic" mesh where both new faces
and new materials are assigned to the same mesh over time (inspired by
#118754). However, that cannot be tested right now due to missing
features of both the MeshSequenceCache and our USD IO code. No testing
will occur for that case until the features are implemented.

Pull Request: https://projects.blender.org/blender/blender/pulls/128341
2024-09-29 23:53:11 +02:00
Christoph Lendenfeld
bcd0d14943 Versioning for layered actions
This implements versioning code to go from legacy to layered action.
The versioning is only triggered when the experimental flag for
Multi-Slot actions is enabled.

All the actions are converted in place, which should be fine because
of backwards and forwards compatibility with layered actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/127842
2024-09-26 15:45:53 +02:00
Aras Pranckevicius
70247df9b9 Fix: VSE tonemap effect is_point_inside_quad check was wrong
+0.5 should be added to integer pixel coordinate (sampling at pixel
center). This is only really visible in very specific scenarios, but
is more correct.
2024-09-26 10:17:31 +03:00
Jesse Yurkovich
2fddf4116a USD: Add explicit coverage for armatures controlling multiple meshes
An additional scenario was added which tests multiple meshes with shape
keys being animated by a single armature. The meshes purposely use the
same shape key name to ensure we also correctly account for that.

Additionally, because the existing shape key and armature test coverage
comes from already written .usd files, this test will first export from
Blender so we can better validate a full Blender-to-Blender roundtrip.

Pull Request: https://projects.blender.org/blender/blender/pulls/128160
2024-09-26 06:50:12 +02:00
Jesse Yurkovich
7ec12a784b Tests: Update hash for updated geometry nodes triangulate test 2024-09-25 15:06:49 -07:00
Hans Goudey
2ba0828de0 Tests: Update hash for updated geometry nodes triangulate test 2024-09-25 17:32:45 -04:00
Jesse Yurkovich
2cdbe7b5f3 Fix: USD: Support color attributes on all relevant domains
Color primvars/attributes were historically treated as a special case
for both import and export. This was mostly done to align with how
painting and viewport display works in Blender. Export would generally
ignore color attributes except when they were found on a Mesh's Point or
FaceCorner domains. And import went out of its way to map incoming color
primvars to the FaceCorner domain in more situations than necessary.

To facilitate better roundtripping in Blender<=>USD workflows, and to
reduce code duplication, this PR teaches the common attribute utilities
how to handle color types. The color attributes will now work on all
relevant Mesh and Curve domains.

There were tests in place for this already but they were set to verify
the inverse state, i.e. the technically broken state, until this could
be fixed.

There remains one special case: "displayColor" primvars and attributes.
The "displayColor" is a special primvar in USD and is the de-facto way
to set a simple viewport color in that ecosystem. It must also be a
color3f type. In order to not regress import, if a "displayColor"
primvar is found on the Face domain we will map it to FaceCorner instead
so it can be displayed in the viewport; which has been the case for the
past several releases. We can drop this special-case if/when Blender can
display Face colors through the Viewport Shading "Attribute" color type.
Additionally, Blender will export this, and only this, color attribute
as a color3f.

Note: As was the case prior to this PR, the following 2 discrepancies
still prevent "perfect" round-trips:
- USD does not have an equivalent to Blender's byte colors; they are
  treated as float during IO
- Blender does not have an equivalent to USD's color3 types; they are
  treated as color4 during IO

Pull Request: https://projects.blender.org/blender/blender/pulls/127784
2024-09-24 19:05:55 +02:00
Jacques Lucke
6e5e01e630 Geometry Nodes: new For Each Geometry Element zone
This adds a new type of zone to Geometry Nodes that allows executing some nodes
for each element in a geometry.

## Features

* The `Selection` input allows iterating over a subset of elements on the set
  domain.
* Fields passed into the input node are available as single values inside of the
  zone.
* The input geometry can be split up into separate (completely independent)
  geometries for each element (on all domains except face corner).
* New attributes can be created on the input geometry by outputting a single
  value from each iteration.
* New geometries can be generated in each iteration.
    * All of these geometries are joined to form the final output.
    * Attributes from the input geometry are propagated to the output
      geometries.

## Evaluation

The evaluation strategy is similar to the one used for repeat zones. Namely, it
dynamically builds a `lazy_function::Graph` once it knows how many iterations
are necessary. It contains a separate node for each iteration. The inputs for
each iteration are hardcoded into the graph. The outputs of each iteration a
passed to a separate lazy-function that reduces all the values down to the final
outputs. This final output can have a huge number of inputs and that is not
ideal for multi-threading yet, but that can still be improved in the future.

## Performance

There is a non-neglilible amount of overhead for each iteration. The overhead is
way larger than the per-element overhead when just doing field evaluation.
Therefore, normal field evaluation should be preferred when possible. That can
partially still be optimized if there is only some number crunching going on in
the zone but that optimization is not implemented yet.

However, processing many small geometries (e.g. each hair of a character
separately) will likely **always be slower** than working on fewer larger
geoemtries. The additional flexibility you get by processing each element
separately comes at the cost that Blender can't optimize the operation as well.
For node groups that need to handle lots of geometry elements, we recommend
trying to design the node setup so that iteration over tiny sub-geometries is
not required.

An opposite point is true as well though. It can be faster to process more
medium sized geometries in parallel than fewer very large geometries because of
more multi-threading opportunities. The exact threshold between tiny, medium and
large geometries depends on a lot of factors though.

Overall, this initial version of the new zone does not implement all
optimization opportunities yet, but the points mentioned above will still hold
true later.

Pull Request: https://projects.blender.org/blender/blender/pulls/127331
2024-09-24 11:52:02 +02:00
Jesse Yurkovich
295cb653ea USD: Add tests for USDZ image processing
More thoroughly test certain image processing behavior of USDZ IO.
Namely that regular and UDIM images are imported back when using either
the packed or the copy import modes. Along the way ensure that we have
coverage for image downscaling on export as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/127985
2024-09-22 21:51:32 +02:00
Hans Goudey
aba9f8a593 Tests: Add geometry nodes test for realize instance single geometry
Test file to ensure #127867 doesn't change behavior.
2024-09-20 22:20:45 -04:00
Jesse Yurkovich
460aa3c231 USD: Point Cloud export support
Export Blender Point Clouds as `UsdGeomPoints` primitives.

Summary
- Adds the `USDPointsWriter` class
- Adds tests to ensure that animated positions, velocities, radii, and
  regular attributes are all written correctly (in a sparse format)
- Adds a new `export_points` operator property, mirroring the existing
  `import_points` option

Pull Request: https://projects.blender.org/blender/blender/pulls/126389
2024-09-20 19:57:12 +02:00
Bastien Montagne
3e03576b09 Add more control over ID renaming behavior.
This commit adds low-level logic in BKE to support three behaviors in
case of name conflict when renaming an ID:
1. Always tweak new name of the renamed ID (never modify the other ID
  name).
2. Always set requested name in renamed ID, modifying as needed the
  other ID name.
3. Only modify the other ID name if it shares the same root name with the
  current renamed ID's name.

It also adds quite some changes to IDTemplate, Outliner code, and
RNA-defined UILayout code, and the lower-level UI button API, to allow
for the new behavior defined in the design (i.e. option three from above list).

When renaming from the UI either 'fails' (falls back to adjusted name) or forces
renaming another ID, an INFO report is displayed.

This commit also fixes several issues in existing code, especially
regarding undo handling in rename operations (which could lead to saving
the wrong name in undo step, and/or over-generating undo steps).

API wise, the bahavior when directly assigning a name to the `ID.name`
property remains unchanged (option one from the list above). But a new
API call `ID.rename` has been added, which offers all three behaviors.

Unittests were added to cover the new implemented behaviors (both at
BKE level, and the RNA/Py API).

This commit implements #119139 design.

Pull Request: https://projects.blender.org/blender/blender/pulls/126996
2024-09-20 13:36:50 +02:00
Aras Pranckevicius
e0ce6ce28a Tests: enable VSE blend modes tests
The actual files for them and reference results were added several
years ago, but the tests themselves were never enabled

Pull Request: https://projects.blender.org/blender/blender/pulls/127898
2024-09-20 12:56:57 +02:00
Aras Pranckevicius
cb6d0dca40 Tests: bump to updated VSE blend modes render tests 2024-09-20 11:46:12 +03:00
Sybren A. Stüvel
615cb46412 Anim: add Action Slot selector to Action Constraint
Add slotted Actions support to Action constraints.

The user interface can be improved once #127751 lands.

Ref: #120406
Pull Request: https://projects.blender.org/blender/blender/pulls/127749
2024-09-20 08:07:15 +02:00
Campbell Barton
30bbd1583f Cleanup: replace the term "folder" with "directory" for CMake files
This was already more common an in keeping with cmake's own naming.
2024-09-14 12:35:02 +10:00
Sybren A. Stüvel
f1d440a4b6 Refactor: Anim NLA test, clear the scene at every test
Clear the entire scene at the start of every test case. Previously this
happened only at the start of the test suite. This should make tests
more independent.

No functional changes to the actual tests.
2024-09-13 12:34:48 +02:00
Campbell Barton
e79b901cc5 Docs: add code-comment that bl_blendfile_versioning can fail randomly 2024-09-13 14:15:40 +10:00
Hans Goudey
97e8389bc9 Cleanup: Formatting 2024-09-12 13:01:34 -04:00
Alaska
bcf53fd5da Cycles render test: Add ability to control hardware raytracing
Add the ability to control whether or not Hardware Ray Tracing (HWRT)
is enabled during render tests.

This is done by adding `-RT` to the end of the device name in the
Cycles device list. E.g. `HIP-RT`. This is supported with HIP, oneAPI,
and Metal.

Change in behaviour:
If you do not specify `-RT`, then HWRT will be disabled. This results
in a change in behaviour:
1. `METAL` device tests on M3 or newer Macs no longer using MetalRT
2. `ONEAPI` device tests no longer use Embree GPU.

Note: Some tests are failing on some platforms/configurations that can
now be easily tested due to this commit. This does not effect the
build bot automated testing as it does not test these configurations.

These tests have not been blocked from running, primarily to help
developers investigate and fix the issues.

Ref #123012

Pull Request: https://projects.blender.org/blender/blender/pulls/125082
2024-09-12 17:56:31 +02:00
Weizhen Huang
ee2fe7fa6c Fix: Cycles: reuse random number for sampling color channel in volume
The same random number was used for sampling color channel at each step,
which leads to bias. Fixed by rescaling the random number.

Another possibility would be to scramble `rng_offset` and use a new
random number each time, similar as in subsurface scattering, but
rescaling random number should be faster than computing a new one, and
is favorable here since the precision here is not very important

Pull Request: https://projects.blender.org/blender/blender/pulls/127454
2024-09-12 14:27:56 +02:00
Aras Pranckevicius
88921eb061 Tests: add VSE Tonemap modifier render test 2024-09-11 14:24:06 +03:00
Sybren A. Stüvel
e897b184e4 Anim: Add backward-compatible RNA API for Action.groups
The `Action.groups` RNA functions now work with layered Actions as well.
They just expose / operate on the groups of the channelbag that belongs
to the first slot of the Action.

Pull Request: https://projects.blender.org/blender/blender/pulls/127241
2024-09-06 14:33:58 +02:00
Bastien Montagne
3d2408fb4e Tests: blendfile versioning: print loaded file/linked ID by default.
This makes the logs fairly verbose, but it is not displayed by default
anyway, and it is the only easy way to find out exactly which file or ID
is breaking the test.
2024-09-05 14:29:40 +02:00
Jeroen Bakker
eeefd9a69c Vulkan: Enable render tests
This PR enabled backend specific rendertest for EEVEE and Workbench.
Some changes that have been made are:
- Add suffix to the test identifying the backend (_opengl, _vulkan, _metal)
- Vulkan render tests are compared with the opengl results.

Most EEVEE tests run as expected there are some issues in the Vulkan
backend that needs to be addressed:
- Fully smooth reflective materials miss lighting.
- Tangent normals are off

None of the workbench tests pass. It has to do with downloading the depth
buffer. In Workbench they are stored as GPU_DEPTH32F_STENCIL8 and downloaded
as FLOAT. We didn't implement it in the vulkan backend yet and currently asserts.

The Vulkan render test run faster compared to OpenGL. On my system around
25-50% faster.

Pull Request: https://projects.blender.org/blender/blender/pulls/126784
2024-09-05 13:58:14 +02:00
Campbell Barton
352c69f437 Revert "Tests: only disable big endian checks on macOS/x64"
This reverts commit 9786d7603a.

While the test passed when I checked, it's unreliable enough to keep
disabled.
2024-09-05 20:40:36 +10:00
Campbell Barton
9786d7603a Tests: only disable big endian checks on macOS/x64 2024-09-05 15:10:56 +10:00
Campbell Barton
afff3918db Tests: add tests/data/io_tests/blend_big_endian/ files
Add big endian files for `blendfile_versioning_*` tests.
2024-09-05 13:12:20 +10:00
Campbell Barton
16df642c2a Tests: exclude big-endian tests on macOS
In preparation for adding big-endian tests, disable them on macOS
where many are failing, although it looks like the cause of failure
may not relate to endian conversion, it needs further investigation.
2024-09-05 13:07:03 +10:00
Campbell Barton
4a9d67df0e Cleanup: format tests 2024-09-05 13:07:03 +10:00
Aras Pranckevicius
0bda704eee Tests: update VSE color balance test to cover masking 2024-09-03 21:02:16 +03:00
Campbell Barton
e34d9eeac7 Cleanup: use C-style comments, double quote Python text 2024-09-03 21:22:34 +10:00
Aras Pranckevicius
0e999f3786 Tests: fix Mac arm64 failure on recently added VSE render tests 2024-09-03 14:05:04 +03:00
Aras Pranckevicius
f40e6c28bf Tests: VSE Color Balance and Curve modifier render tests 2024-09-03 12:40:39 +03:00
Weizhen Huang
41d394e72c Tests: add test files for Metallic BSDF and Light Tree 2024-09-03 11:34:09 +02:00
Jeroen Bakker
f7ea83a32d Bumped data/tests 2024-08-30 15:00:28 +02:00