Commit Graph

1991 Commits

Author SHA1 Message Date
Omar Emara
d764fd7200 Compositor: Disable anisotropic filtering tests on GPU
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.
2024-12-19 17:44:10 +02:00
Richard Antalik
8ce5356522 VSE: Text editing in preview
This commit implements most features needed for simple text editing.

Active text strip can be edited in preview by pressing tab key, which
enabled text editing mode. With this mode active, outline matches text
boundary box and cursor is drawn.

Cursor can be moved with usual keys. Pressing shift starts selection.
Selection and navigation works when text is scaled or rotated. Mirrored
text is not supported in this PR. it can be done, but the text is
unreadable that way, so I kept it simple.

Multi line text is supported. Pressing return key starts new line.

Copy/paste operator uses OS copy paste buffer, so text from other apps
can be pasted.

Text is still limited to 512 characters. Text string property still
exists in side panel and is limited to single line. Individual
characters can not be styled in different way like in 3D viewport, but
the code is mostly ready for such feature.

Ref: #126547

Pull Request: https://projects.blender.org/blender/blender/pulls/127239
2024-12-19 15:56:54 +01:00
Omar Emara
2a53debc73 Cleanup: Rename COMPOSITOR_REALTIME to GPU_COMPOSITOR
Pull Request: https://projects.blender.org/blender/blender/pulls/132118
2024-12-19 14:39:55 +01:00
Omar Emara
ae6ee3398d Cleanup: Make format 2024-12-19 15:12:38 +02:00
Omar Emara
b4230d84dc Compositor: Unify references between CPU and GPU tests
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.
2024-12-19 14:35:20 +02:00
Omar Emara
0a6b43c827 Compositor: Make transformed realized domains symmetric
This patch changes how transformations are realized by adjusting the
computed size of the new domain after transformation. Previously, this
was computed with the lower left corner of the domain as the origin of
transformation, while now, the center of the domain is used as the
origin. Consequently, domains shrinks/grows around their center, which
results in a more stable output as transforms are animated.

A consequence of this change is that we can no longer scale odd sized
domains to even sized domains or vice versa, since it grows/shrinks by
the same amount on both sides. Supporting this case requires further
investigation and will probably require passing down information to the
realization functions themselves.
2024-12-19 12:48:44 +02:00
Miguel Pozo
e4989ff391 Workbench: Update reference images
Pull Request: https://projects.blender.org/blender/blender/pulls/132068
2024-12-18 17:11:46 +01:00
YimingWu
6191bc4f22 Object: Conversion of Font/Legacy curves to Curves and Grease Pencil
This patch implements Font to Curves, Legacy curves to Grease Pencil and
Font to Grease Pencil conversions.

Note that Font to Grease Pencil is done by converting Font to Curves
then converting Curves to Grease Pencil. Currently we do not have
direct conversion APIs.

Part of #131595 and #130518

Pull Request: https://projects.blender.org/blender/blender/pulls/131612
2024-12-18 15:38:55 +01:00
Jesse Yurkovich
1a01275aa9 Hydra: Update tests to allow bots to pass
Contains the following changes:
- Uses new `render_layer` images in test repo
- Excludes known broken tests with Hydra Storm from USD 24.05
  - packed float and packed half images show corruption
  - USD export doesn't support the current light-tree .blend
- Bump the `image_colorspace` and `image_mapping` thresholds to
  account for image filtering differences from OS/drivers

Pull Request: https://projects.blender.org/blender/blender/pulls/132044
2024-12-18 05:22:01 +01:00
Jeroen Bakker
28ea90f127 GPU: Split GPU backend and Draw manager unit tests
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
2024-12-17 13:28:21 +01:00
Aras Pranckevicius
59871814ff Cleanup: remove various mentions of "realtime compositor"
Some variable renames, some comment edits.

Pull Request: https://projects.blender.org/blender/blender/pulls/132014
2024-12-17 13:00:50 +01:00
Alaska
a669decca8 Tests: Add Cycles test for instances with two sets of transformation
With the HIP-RT BVH on AMD GPUs, instances that have undergone
two sets of transformations will not render properly.
This manifests as:
- Incorrect mesh normals
- Improperly positioned, scaled, or rotated meshes
- Missing intersections

This commit adds a test for this issue to make it easier to test,
and so we can hopefully catch similar issues if we ever add more
BVH options in the future.

Original report: blender/blender#117567
Ref: blender/blender-test-data!29

Pull Request: https://projects.blender.org/blender/blender/pulls/131352
2024-12-17 12:28:42 +01:00
Alaska
d1c9637470 Cycles: Enable OptiX OSL render tests
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
2024-12-17 06:48:38 +01:00
Alaska
43e0a5dcf1 Tests: Add render test for volume with at least one channel with zero extinction
A bug report was made about the odd rendering of volumes that have one
or more of it's colour channels set to zero. blender/blender#131723

This issue was fixed recently in 4.4 and this commit adds a render test
to make sure we don't accidentally break it again in the future.

Ref: blender/blender-test-data!34
Ref: blender/blender#123012

Pull Request: https://projects.blender.org/blender/blender/pulls/131960
2024-12-17 05:20:18 +01:00
Jesse Yurkovich
e19f9b32a8 USD: Add test for particle hair export/import
Until the newer Hair Curves system can fully replace particle hair, add
a small test to ensure this continues to work.

Since the hair is exported as cubic bspline curves, we can also use this
same file to test bspline import now too.

Pull Request: https://projects.blender.org/blender/blender/pulls/131997
2024-12-17 01:19:51 +01:00
Jesse Yurkovich
afe0ebeb74 Fix: properly export metaballs to USD
While adding tests I found that metaball export has been broken since
Blender 3.4. It would export each metaball geometry twice.

This looks to have been a side effect of a change to `object_dupli.cc`
which no longer sets the `no_draw` flag for metaballs[1]. With the flag
unset we would end up visiting this particular object twice.

Use a direct check for Metaballs now and add test coverage for the
scenario in general.

[1] eaa87101cd

Pull Request: https://projects.blender.org/blender/blender/pulls/131984
2024-12-16 22:11:07 +01:00
Jesse Yurkovich
db4303353a USD: Add test data for upcoming metaballs and particle hair tests 2024-12-16 10:06:28 -08:00
Jeroen Bakker
9991ff83b3 Vulkan: Disable render tests
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
2024-12-16 16:18:06 +01:00
Aras Pranckevicius
0dd995aeb2 Tests: tweak VSE modifier tests to pass on win arm64
Change BrightRings exr file to not contain nan/inf pixels. Testing for
nan/inf in input just gives too many headaches across different
platforms, and is arguably a very corner case.

Pull Request: https://projects.blender.org/blender/blender/pulls/131926
2024-12-15 13:08:06 +01:00
Alaska
56463df0b2 Tests: Add Cycles test for file that renders improperly with fassociative-math
During the development of Blender 4.3, the fassociative-math option
was enabled for CPU rendering on Linux.

This resulted in artifacts with a specific combination of settings
that was reported to blender/blneder#130389

This commit adds a test for this specific issue.

Ref: blender/blender-test-data!24
Pull Request: https://projects.blender.org/blender/blender/pulls/130825
2024-12-14 11:12:57 +01:00
Clément Foucault
b07835c9b4 EEVEE: Increase number of samples for hair closeup tests 2024-12-13 17:41:57 +01:00
Hans Goudey
203ad8ad4b Cleanup: Formatting 2024-12-13 11:15:15 -05:00
Clément Foucault
1646ad9e51 EEVEE: Update render tests blocklist
Blocklist tests that are currently failing and that are not
regressions.
2024-12-13 16:41:54 +01:00
Michael Kowalski
74512cc5cb USD: on_material_import() and texture IO hooks
Supporting a new on_material_import() USDHook callback.

Also added support for import_texture() and export_texture()
utility functions which can be called from on_material_import() and
on_material_export() Python implementations, respectively.

Pull Request: https://projects.blender.org/blender/blender/pulls/131559
2024-12-13 16:36:22 +01:00
Aras Pranckevicius
7e7f4f0cee Cleanup: Remove WITH_COMPOSITOR_CPU option (compositor is always in)
Compositor is a required feature and parts of it have been always
included anyway. Remove WITH_COMPOSITOR_CPU build option.

Pull Request: https://projects.blender.org/blender/blender/pulls/131838
2024-12-13 14:54:19 +01:00
Clément Foucault
654c1deb22 EEVEE: Update tangent tests to not use opensubdiv GPU backend 2024-12-13 14:10:44 +01:00
Alaska
bbd4aef629 Tests: Rename Principled folder to Principled BSDF
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
2024-12-13 12:22:12 +01:00
Aras Pranckevicius
82f0578ca3 Compositor: always use the new CPU compositor
Part of #125968: this makes the new CPU compositor always be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/131783
2024-12-12 20:17:36 +01:00
Clément Foucault
79b0ea17a4 EEVEE: Update camera ortho reference image 2024-12-12 20:07:39 +01:00
Clément Foucault
8cdeecaef8 EEVEE: Increase samples of shadow_link_transparency 2024-12-12 19:56:02 +01:00
Clément Foucault
48a752dee4 EEVEE: Increase threashold for certain render tests
This avoid test failure because of platform difference.
2024-12-12 19:55:52 +01:00
Clément Foucault
f160bc0806 EEVEE: Test: Add condition to skip lightprobe baking in some render tests
This allows to workaround some issues (that have been reported) about
hanging and broken test when baking the lightprobe volumes.
2024-12-12 18:49:58 +01:00
Alaska
337e992d7d Tests: Add Cycles test for baking from the active camera
For a while now Cycles has had the ability to bake a texture from the
perspective of the active camera.

This commit adds two tests for one, one with a glossy sphere with
flat shading, and one with smooth shading.

Ref: blender/blender-test-data!27

Pull Request: https://projects.blender.org/blender/blender/pulls/131083
2024-12-12 04:03:08 +01:00
Alaska
2a40964638 Fix: Storm render tests fail to run
An oversight in b7028617ad lead to Storm
render tests failing due to a missing argument.

This commit fixes that.

Pull Request: https://projects.blender.org/blender/blender/pulls/131740
2024-12-12 01:27:04 +01:00
Charles Flèche
0df5d8220b USD: Add new get_prim_map API callable from python on_import hooks
When importing an USD, the Blender object names do not necessarily match
Prim names:

```
#usda 1.0
def Xform "xform1"
{
  def Mesh "MyObject"  # Will be imported as "MyObject"
}
def Xform "xform2"
{
  def Mesh "MyObject"  # Will be imported as "MyObject.001"
}
def Xform "xform2"
{
  def Mesh "MyObject"  # Will be imported as "MyObject.002"
}
```

This makes it difficult in the [USD Import Hooks]
(https://docs.blender.org/api/current/bpy.types.USDHook.html) to link a
Blender object back to its source Prim for additional processing. A
typical use cases for games is to generate UVs, create and apply a
material on the fly when importing a collision shape that does not have
a visual representation (hence no materials) based on some Prim
attributes, but that the artist needs to differenciate in Blender's
viewport.

The Import context exposes a new method `get_prim_map()` that returns a
`dict` of `prim path` / `list of Blender ID`.

For example, given the following USD scene,
```
/
 |--XformThenCube [def Xform]
 |   `--Cube [def Cube]
 |--XformThenXformCube [def Xform]
 |   `--XformIntermediate [def Xform]
 |       `--Cube [def Mesh]
 |--Cube [def Cube]
 `--Material [def Material]
     `--Principled_BSDF [def Shader]
```

the `get_prim_map()` method will return a map as:

```python
@static_method
def on_import(import_context):
  pprint(import_context.get_prim_map())
```

```json
{
  "/Cube": [bpy.data.objects["Cube.002"], bpy.data.meshes["Cube.002"]],
  "/XformThenCube": [bpy.data.objects["XformThenCube"]],
  "/XformThenCube/Cube": [bpy.data.objects["Cube"], bpy.data.meshes["Cube"]],
  "/XformThenXformCube": [bpy.data.objects["XformThenXformCube"]],
  "/XformThenXformCube/XformIntermediate": [bpy.data.objects["XformIntermediate"]],
  "/XformThenXformCube/XformIntermediate/Cube": [bpy.data.objects["Cube.001"], bpy.data.meshes["Cube.001"]],
  "/Material": [bpy.data.materials["Material"]],
}
```

Co-authored-by: Odréanne Breton <odreanne.breton@ubisoft.com>
Co-authored-by: Sttevan Carnali Joga <sttevan.carnali-joga@ubisoft.com>
Co-authored-by: Charles Flèche <charles.fleche@ubisoft.com>
2024-12-11 21:36:09 +01:00
Sybren A. Stüvel
b7028617ad Refactor: render tests, change how argparse is used
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
2024-12-10 14:52:34 +01:00
Aras Pranckevicius
f4b1e169aa Fix: VSE white balance modifier undefined results for HDR colors
Commit 073ce98231 back in 2016 changed white balance math to do
a pow based pixel operation instead of multiplication. However
pow on negative numbers (which would happen on any HDR input) is
undefined. Until some better math is decided upon, at least ensure
the input is not negative.
2024-12-10 10:21:24 +02:00
Alaska
6a23d9d7e9 Tests: Update outdated EEVEE volume tests
During the PR that added the relevant Volume tests, the .blend file
was changed but the corresponding volume reference image was not.

This commit fixes that.
2024-12-10 07:34:06 +01:00
Alaska
8756ebb25a Tests: Rename all Principled tests to Principled BSDF
While looking into something else, I noticed that the OSL render tests
were not testing the Principled Volume tests.

This is because when running OSL tests, we skip all Principled BSDF
tests by ignoring all tests that start with `principled_`
(this was done due to noise differences between SVM and OSL).

However this had the knock on effect of skipping tests like
- `principled_absorption`
- `principled_blackbody`
- `principled_smoke`

in the volumetric test suite.

This commit fixes this issue by renaming all Principled BSDF tests to
`principled_bsdf_` and updating the block list to use this new name.

Ref: blender/blender-test-data!31
Pull Request: https://projects.blender.org/blender/blender/pulls/131540
2024-12-10 06:44:07 +01:00
Michael Kowalski
ba6043fb86 USD: test files for material import hook
Pull Request: https://projects.blender.org/blender/blender/pulls/131559
2024-12-09 18:27:34 -05:00
Hans Goudey
f9c4204b9f Tests: Add test for Set Curve Normal node with Normal input
Regression test for #131621.
2024-12-09 17:05:46 -05:00
Hans Goudey
b7fe1ee1d6 Tests: Add test for "Set Handle Position" node 2024-12-07 12:20:04 -05:00
Jesse Yurkovich
f92bfe0f0b USD: Write sparse values for Camera, Light, and Skeleton attribute data
Make use of our sparse value writer in more places. Namely, when using
animated Camera or Light properties, this will prevent a needless stream
of unchanging values being written into the USD file [1]. Skeletons and
armatures benefit too but less so as typically the primary benefit only
applies to the comparatively small `scale` transform attribute, which
typically remains unchanged from frame to frame.

The newly added `set_attribute` common code can, and eventually will, be
used to reduce boilerplate elsewhere where we do the same sparse writing
dance.

Ref #130759

Pull Request: https://projects.blender.org/blender/blender/pulls/131333
2024-12-07 00:15:08 +01:00
Jesse Yurkovich
76c699ada5 Fix: vertex crease data was imported incorrectly from USD
While adding tests for subd import I discovered that our vertex crease
data was imported incorrectly.

This PR adds tests and fixes:
- We tried to read crease sharpness data as ints instead of floats. This
  caused the import process to early-return, meaning we never load any
  data at all
- Empty USD data would still cause us to create the `crease_vert`
  attribute unnecessarily
- Sharpness data needs clamped to 0-1 to handle USD's SHARPNESS_INFINITE
  value of 10.0
- We need to fill the `crease_vert` span with 0's since incoming USD
  data may not have values set for all the verts

Pull Request: https://projects.blender.org/blender/blender/pulls/131516
2024-12-06 22:19:31 +01:00
Aras Pranckevicius
dc063d8a80 Fix #131106: VSE strip mask inconsistencies between byte and float images
If a strip mask was used several times in the same frame, and it needed
to do byte->float conversion (e.g. mask is produced by a byte-color
strip, but then used in both a byte-color strip, and later on in a
float-color strip), then that byte->float mask image conversion was
introducing two inconsistencies:
- It was making mask alpha channel affect the result, which was not
  happening with regular byte mask images, and
- It was converting float mask to scene linear space, which was
  resulting in different image than with a byte mask.

Fix those issues by ensuring that all VSE modifiers can take either
byte or float mask as-is, without extra conversions. Previously, some
of the modifiers were done in a way where they only handled "(byte
image + byte mask) or (float image + float mask)" cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/131355
2024-12-06 18:43:52 +01:00
Aras Pranckevicius
ba0f9906ef Tests: Add more VSE modifiers render tests 2024-12-06 11:32:37 +02:00
Jesse Yurkovich
69c63311fa Fix #130907: Use Blender Action name as the UsdSkelAnimation name
Rather than using a default "Anim" name when exporting armature
animations, use the animation's Action name instead. Likewise use the
UsdSkelAnimation name for the Action's name during import.

Blendshapes/shapekeys still use the default "Anim" name as there's no
action for these situations.

Pull Request: https://projects.blender.org/blender/blender/pulls/131021
2024-12-04 23:43:07 +01:00
Alaska
615ab676a7 Tests: Add Cycles test for a volume with a zero angle distant light
During Blender 4.2's development, a bug was introduced that lead to
volumes rendering incorrectly if:
- There was a distant light with a zero angle spread
- The light tree was enabled

This was reported to blender/blender#129420 and fixed in 4.3.

This commit adds a render test for this situation.

Ref: blender/blender#123012
Ref: blender/blender-test-data!26

Pull Request: https://projects.blender.org/blender/blender/pulls/131079
2024-12-04 02:09:35 +01:00
Alaska
42f8ffbb4c Tests: Add render test for Principled BSDF with a colored zero weight coat
Ref: blender/blender-test-data!20
Ref: blender/blender!124856
Ref: blender/blender#123012

Pull Request: https://projects.blender.org/blender/blender/pulls/130608
2024-12-04 02:00:21 +01: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