Commit Graph

1507 Commits

Author SHA1 Message Date
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
Richard Antalik
8fed15b15d FFmpeg: Add test case for #126865 2024-08-30 00:36:13 +02:00
Alaska
84bab7f300 Fix #126592: Cycles light tree subtended angle not covering the entire bounding box
Use a bounding sphere instead of the corners of a bounding box to
compute the subtended angle of a light tree node.

Using the corners of the bounding box was an underestimate in some
scenes, causing some light tree nodes being incorrectly skipped.

Using the subtended angle of a bounding sphere is an overestimate, but
it covers the entire node and would not skip any valid contribution,
and no other reliable algorithm to compute the minimal enclosing angle
is known to us.

We expect some increase in noise due to overestimation, but this has
not been observed yet, in our benchmark scenes only a difference in
noise is visible.

Thanks to Weizhen for the suggestion to use the bounding sphere.

Pull Request: https://projects.blender.org/blender/blender/pulls/126625
2024-08-28 11:53:53 +02:00
Jesse Yurkovich
7205e1ab8c USD: Add tests for python hooks
Adds test coverage for the USD python hook machinery:
- Ensure processing occurs correctly when returning False or throwing
  exceptions from all the hooks
- Validates that the hook arguments are valid (UsdStage, depsgraph, and
  material parameters)
- Tests unregister to ensure hooks are fully removed from processing

Pull Request: https://projects.blender.org/blender/blender/pulls/126809
2024-08-27 05:38:55 +02:00
Jeroen Bakker
95d6efdae0 Testing: Updated to latest tests/data 2024-08-26 12:46:25 +02:00
Jesse Yurkovich
b265161aea USD: Add more thorough testing of various material setups
Newly validates the following:
- Image mapping transforms on import and export
- Typical normal map setups on import and export
- Alpha-clip node setups on import (was already tested for export)

Pull Request: https://projects.blender.org/blender/blender/pulls/126776
2024-08-26 03:26:32 +02:00
Jesse Yurkovich
409abccadd USD: Test coverage for custom properties, xform ops, and orientation
Additional coverage for the following scenarios:
- Ensures custom properties are exported and imported correctly
- Ensures that xform op modes and scene orientation options are properly
  respected during export

Pull Request: https://projects.blender.org/blender/blender/pulls/126723
2024-08-24 06:58:27 +02:00
Campbell Barton
de0feaf08c Cleanup: white-space edit so license-checker passes 2024-08-23 09:58:30 +10:00
Nathan Vegdahl
df02e7a5e5 Anim: add channel groups to layered actions
This PR adds channel groups (also known as fcurve groups or action groups) to
layered actions.  For layered actions, these groups belong to the `ChannelBag`s
and can vary by bag.

From a user perspective, the goal is for these to function just like channel
groups from legacy actions.  However, internally they are implemented a little
differently: legacy actions store both channel groups and fcurves in a listbase,
and groups indicate what fcurves are in them with a listbase that points
directly into the larger fcurve listbase.  Layered actions, on the other hand,
store both fcurves and channel groups in an array, and groups indicate what
fcurves are in them by indexing into the fcurve array.

Despite taking this different approach, we still reuse the `bActionGroup` struct
for the new channel groups, just adding the necessary fields for index-based
fcurve membership as described above.

This PR does not implement all of the functionality needed to reach feature
parity with legacy action channel groups, but implements the main core and gets
them basically working.

It's easier to list the things that *haven't* been implemented yet:

- Operators for letting the user manually create/remove/move channel groups.
- Keyframe selection in the action/dopesheet editor on channel group rows
  themselves are not yet working correctly.
- Handling channel groups in legacy/layered action conversion operators.
- Making the legacy `action.groups` property work on single-layer-single-strip
  layered actions.

Those are left for future PRs.  Other than that, in theory everything should be
working now.

Pull Request: https://projects.blender.org/blender/blender/pulls/125774
2024-08-22 17:13:12 +02:00
Aras Pranckevicius
246a0ec46a Fix #126394: ffmpeg on win64 is built without SIMD optimizations
Since ee1b2f53cc the ffmpeg libraries for Windows x64 are built effectively
without CPU specific SIMD optimizations. `--arch=x64` is not an architecture
that ffmpeg configure understands, so it falls back to "nothing is known,
turn any architecture specific bits off" code path.

Pull Request: https://projects.blender.org/blender/blender/pulls/126396
2024-08-22 10:36:18 +02:00
Campbell Barton
08d5eb8f9c Cleanup: cmake formatting 2024-08-21 23:20:34 +10:00
Weizhen Huang
be0d2e19b5 Fix #115998: Cycles volume too dark when shadow ray visibility is off
when tracing shadow ray through a volume and no hit is registered, we
consider the whole ray segment inside the volume.

However, no hit registered could also happen when the volume is
invisible to shadow ray. We should explicitly check this case and skip
rendering the volume segment instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/126139
2024-08-19 15:52:35 +02:00
Jesse Yurkovich
2e395d2aac USD: Add test to verify Shape prim import
Verifies all currently supported USD Shape prim types are successfully
imported. Each prim has time sample data authored so the presence of a
Mesh Sequence Cache modifier is also checked.

Pull Request: https://projects.blender.org/blender/blender/pulls/126449
2024-08-18 03:09:57 +02:00
Jacques Lucke
cc01e8a74e Tools: support reference data in coverage report
This adds initial support for showing the difference between old and new coverage
data. The difference is only shown in index.html currently. This is mainly useful
when adding new tests right now, to see the impact.

To use this, rename the `coverage/analysis` folder in the build directory to
`reference`. It will automatically be used by the report script if that reference
folder exists.
2024-08-17 13:36:42 +02:00
Jacques Lucke
2c52852116 Tests: add initial grease pencil geometry nodes test 2024-08-17 13:31:51 +02:00
Jacques Lucke
daeaac0b1c Fix: Tools: correct default open path in coverage report summary
The `/blender` prefix was specific to my local setup and may be different
for others.
2024-08-17 11:33:00 +02:00
Jacques Lucke
5819ba40f0 Fix: Tools: fix coverage summary page when open paths don't exist anymore 2024-08-17 11:29:41 +02:00
Jesse Yurkovich
6932351e23 USD: Add test data for upcoming PointCloud and Shape tests 2024-08-16 13:25:15 -07:00
Jacques Lucke
bb8460da9e Tests: support generating code coverage report
This only works with GCC and has only been tested on Linux. The main goal is to
automatically generate the code coverage reports on the buildbot and to publish
them. With some luck, this motivates people to increase test coverage in their
respective areas. Nevertheless, it should be easy to generate the reports
locally too (at least on supported software stacks).

Usage:
1. Create a **debug** build using **GCC** with **WITH_COMPILER_CODE_COVERAGE**
   enabled.
2. Run tests. This automatically generates `.gcda` files in the build directory.
3. Run `make/ninja coverage-report` in the build directory.

If everything is successful, this will open a browser with the final report
which is stored in `build-dir/coverage/report/`. For a bit more control one can
also run `coverage.py` script directly. This allows passing in the
`--no-browser` option which may be benefitial when running it on the buildbot.
Running `make/ninja coverage-reset` deletes all `.gcda` files which resets the
line execution counts.

The final report has a main entry point (`index.html`) and a separate `.html`
file for every source code file that coverage data was available for. This also
contains some code that is not in Blender's git repository. We could filter
those out, but it also seems interesting (to me anyway), so I just kept it in.

Doing the analysis and writing the report takes ~1 min. The slow part is running
all tests in a debug build which takes ~12 min for me. Since the coverage data
is fairly large and the report also includes the entire source code, file
compression is used in two places:
* The intermediate analysis results for each file are stored in compressed zip
  files. This data is still independent from the report html and could be used
  to build other tools on top of. I could imagine storing the analysis data for
  each day for example to gather greater insights into how coverage changes over
  time in different parts of the code.
* The analysis data and source code is compressed and base64 encoded embedded
  into the `.html` files. This makes them much smaller than embedding the data
  without compression (5-10x).

Pull Request: https://projects.blender.org/blender/blender/pulls/126181
2024-08-15 12:17:55 +02:00
Falk David
ed3c16624b GPv3: High level python API
This extends the `GreasePencilDrawing` rna type using python.
The goal is to add an API that allows developers to transition to
the new grease pencil API a bit more smoothly.

Adds the following endpoints to the `GreasePencilDrawing`:
* `drawing.strokes`: Returns a list/slice of `GreasePencilStroke`s in the drawing.

Adds a python class `GreasePencilStroke`:
* `stroke.points`: Returns a list/slice of `GreasePencilStrokePoint`s.
* Getters/Setters of attributes for this stroke:
   * `stroke.cyclic`
   * `stroke.material_index`
   * `stroke.select`
   * `stroke.softness` (used to be `hardness`)
   * `stroke.start_cap`
   * `stroke.end_cap`
   * `stroke.curve_type`: The type of curve: `POLY`,`BEZIER`,`CATMULL_ROM`,`NURBS`.
   * `stroke.aspect_ratio`
   * `stroke.fill_opacity`
   * `stroke.fill_color`
   * `stroke.time_start`
* High-level functions:
   * `stroke.add_points(count)`: Adds `count` points at the end of the stroke.
  * `stroke.remove_points(count)`: Removes `count` points from the end of the stroke. Note that this will not remove the stroke if the count is greater than the number of points in the stroke. A stroke has at least 1 point. Removing strokes can be done from the drawing.

Adds a python class `GreasePencilStrokePoint`:
* Getters/Setters of attributes for this point:
   * `position`
   * `radius`
   * `opacity`
   * `select`
   * `vertex_color`
   * `rotation`
   * `delta_time`

Note that `GreasePencilStroke` and `GreasePencilStrokePoint` are not stored in the file and don't have an RNA API. This means that they are not compatible with e.g. `layout.prop`.

This API should not be used for performance critical code. It's likely
even slower than the python API from 4.2.

There will be migration documentation for addon developers here:
https://developer.blender.org/docs/release_notes/4.3/grease_pencil/#python-api-changes

Pull Request: https://projects.blender.org/blender/blender/pulls/125599
2024-08-15 10:58:21 +02:00
Alaska
3cd26916f4 Cycles render test: Enable OIDN tests
OIDN tests were temporarily disabled as platforms were updating to
OIDN 2.3. Now that the update is done, re-enable OIDN tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/126214
2024-08-14 17:15:36 +02: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
Jesse Yurkovich
8cc3808330 USD: Add tests for mesh export triangulation
Pull Request: https://projects.blender.org/blender/blender/pulls/126265
2024-08-13 08:07:15 +02:00
Jesse Yurkovich
cb9ca2f7a7 Fix: USD: Write vertex crease data correctly and add tests
While adding test coverage for mesh subdivision surface scenarios, a few
problems were noticed with vertex crease support.

This PR fixes:
- Used incorrect `crease_sharpnesses` instead of `corner_sharpnesses`
- Used incorrect value for an "infinitely sharp" vertex crease
- Unnecessarily wrote out Blender's `crease_vert` attribute as a primvar

Tests are added which validate everything we support.

Pull Request: https://projects.blender.org/blender/blender/pulls/126209
2024-08-12 01:50:34 +02:00
Jesse Yurkovich
56779c7bb0 Fix: USD: Ensure mesh velocity data is written sparsely and add tests
The mesh velocity data was not using the UsdUtilsSparseValueWriter and
was writing out data for all frames even if the velocity didn't change.

Adds test coverage for this scenario as well as other situations where a
MeshSequenceCache (MSC) would be required:
- Ensures that when positions vary a MSC is added
- Ensures that when velocities vary a MSC is added (see blender/blender@c862d40e09)
- Ensures that when attributes vary a MSC is added (see blender/blender@3c394d39f2)

Pull Request: https://projects.blender.org/blender/blender/pulls/126208
2024-08-11 23:36:40 +02:00
Jesse Yurkovich
b2f65b9bcb USD: Add additional attribute and sub-d test files 2024-08-11 13:40:30 -07:00
Jesse Yurkovich
2dcf3467ce USD: Add tests for additional light setups
Adds test coverage for a few, minor, missing cases for USD Light export:
- Spot lights with the special case of a 0 radius
- Area lights of type SQUARE (RECTANGLE was already tested)
- Area lights of type ELLIPSE (DISK was already tested)

Pull Request: https://projects.blender.org/blender/blender/pulls/126203
2024-08-11 20:29:14 +02:00
Aras Pranckevicius
983687ebfc Tests: extend OBJ test coverage for #126065 2024-08-09 14:49:17 +03:00
Falk David
2eba062ac0 GPv3: Add initial tests for Python API
This adds some initial tests for the Grease Pencil Python API:
 - Testing Grease Pencil ID
 - Testing Grease Pencil layer API

Pull Request: https://projects.blender.org/blender/blender/pulls/126090
2024-08-08 14:42:24 +02:00
Christoph Lendenfeld
77f75353b0 Anim: Remove empty FCurves from layered Actions
This changes the behavior when deleting the last key of an FCurve on layered actions.
Previously the FCurve would continue to exist, whereas now it is deleted.
This makes it consistent with legacy actions.

I modified the "Clear Keyframes" operator in this PR as well to make it work with layered actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/125327
2024-08-08 11:06:49 +02:00
Sergey Sharybin
35198ec363 Fix: Typo in the OptiX ttests lbocklist 2024-08-07 11:46:58 +02:00
Jesse Yurkovich
3ea292db8d Hydra: Update Storm reference images for sub-d and asset resolver fixes 2024-08-06 12:40:35 -07:00
Jesse Yurkovich
892bdf3134 USD: support color4f types in addition to color3f
Support the USD `color4f` (and related) types during import and use this
type when writing out Blender's color attributes.

This roundtrips Blender data correctly and will properly load data from
many more USD files as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/125839
2024-08-04 04:34:15 +02:00
Bill Spitzak
ef1d22aea5 Fix #124842: Translation leaves empty pixels at edges
The Translate node leaves empty pixels at the boundary of the image.
This caused by incorrect clipping when sampling the pixels. To fix this,
we adjust COM_MemoryBuffer::read to read using Extend or Repeat using
BLI interpolation, then multiply that by a clipping rectangle. The
read_elem_sampled function is now defined in terms of the read method.

This also coincidentally fixes off by half a pixel error in nearest
neighbour interpolation.
2024-08-01 14:06:50 +03:00
Lukas Tönne
1ea09e514b Fix hash for test data submodule. 2024-07-30 18:13:12 +02:00
Clément Foucault
abe5a9d001 EEVEE: Fix test data hash 2024-07-30 17:43:44 +02:00
Clément Foucault
811c1d50f3 EEVEE: Update shader tests after changes to vector_math_refract 2024-07-30 17:34:12 +02:00
Alaska
8650068f0c Fix: NaN in vector math node in refract mode
Fix a NaN that can occur in the vector math node when set to
refract mode with a 'normal' input of length zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/125374
2024-07-26 12:04:58 +02:00
Aras Pranckevicius
160f27330f Fix #124922: VSE text strip shadow now casts shadow of the outline
As well as takes text color transparency into account. That is, text
"shadow" now virtually casts shadow of however the text itself + outline
looks like. The result is blurred, and extra shadow color tint and
transparency is applied.

Performance testing: seems to be slightly faster than before in my tests.
Probably because the shadow "image" that is now blurred only contains
one byte per pixel (the transparency), instead of full uchar4 per pixel
(with only the "transparency" being blurred).

I have extended sequencer render tests to better cover various text
outline/shadow/box combinations.

Pull Request: https://projects.blender.org/blender/blender/pulls/125445
2024-07-26 10:49:10 +02:00
Campbell Barton
b4d5c6eea5 Cleanup: remove unused imports 2024-07-26 10:26:11 +10:00
Sybren A. Stüvel
a8ee0b9a05 Anim: add Action Slot selector to Action editor
Add an Action Slot selector to the Action editor's header, next to the
Action selector. The selector shows all slots in the action that are
suitable for animating objects (as the Action editor itself is limited
to showing the Action of the active object).

This also considerably simplifies the 'Animation Debug' panel, as some
debugging code has been removed, as well as the display of any animation
layers. The latter can be reintroduced (if necessary) when multi-layer
animation support is added. Most importantly, it removes the
WindowManager property that was used as a hack to assign layered Actions
to objects.

API change: the RNA property `AnimData.slot` is now a pointer property
that reflects the actual slot (it used to be an enum property).

Some small changes to the UI code were necessary to make the selector
show the slot's display name (and not their internal name).

Pull Request: https://projects.blender.org/blender/blender/pulls/125416
2024-07-25 17:20:27 +02:00
Bill Spitzak
b3e62d3052 Fix #124133: Compositor transforms are off by 0.5 pixels
The GPU compositor transforms are off by half a pixel in some cases.
That's because the realization shader was to perform transforms, and it
includes logic to move images by half a pixel if the domain and image
had different even/odd sizes. To fix this, we only move by half a pixel
if we are doing realization, while transforms are left as is.
2024-07-25 17:23:25 +03:00
Aras Pranckevicius
6432d54ef7 Fix #125043: VSE text outline is wrongly inside the actual text shape
This is only visible when text color has transparency or is fully
transparent. Desired behavior is that the outline would only be
"outside" the actual text.

Pull Request: https://projects.blender.org/blender/blender/pulls/125372
2024-07-25 14:32:26 +02:00
Sybren A. Stüvel
d4984216de Anim: Backward compatibility API for Action.fcurves
These functions can now be called on layered Actions:

- `action.fcurves.new(data_path, array_index)`
- `action.fcurves.find(data_path, array_index)`
- `action.fcurves.remove(fcurve)`
- `action.fcurves.clear()`

These will operate on the first keyframe strip (searching layers bottom
to top), and then its channelbag for the first slot.

If necessary, `fcurves.new()` will create the layer, keyframe strip,
channelbag, and slot.

This backward compatibility layer only kicks in if either of these is
true:

- The Action is empty AND the experimental flag is enabled, or
- The Action already has a layer or a slot (i.e. is already considered
  'layered').

If none of these conditions hold, `action.fcurves` just gives access to
the legacy data.

Ref: #124714
Pull Request: https://projects.blender.org/blender/blender/pulls/124996
2024-07-25 12:06:23 +02:00
Bill Spitzak
b76603b6bf Fix: Scale node is off by half a pixel
The Scale node was off by half a pixel because pixels were not evaluated
at their center. To fix this, we scale the pixels at their center.
2024-07-25 12:06:32 +03:00