Commit Graph

955 Commits

Author SHA1 Message Date
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
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
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
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
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
Richard Antalik
8fed15b15d FFmpeg: Add test case for #126865 2024-08-30 00:36:13 +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
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
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
Campbell Barton
08d5eb8f9c Cleanup: cmake formatting 2024-08-21 23:20:34 +10: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
2c52852116 Tests: add initial grease pencil geometry nodes test 2024-08-17 13:31:51 +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
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
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
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
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
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
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
Sybren A. Stüvel
efbdc4e1fa Anim: ChannelBag F-Curve management functions (C++/RNA)
Add F-Curve management functions on ChannelBags
(`channelbag.fcurves.xxx`) that are very similar to the legacy Action
functions `Action.fcurves.xxx`.

```python
channelbag = strip.channelbags.new(slot)
fcurve = channelbag.fcurves.new("rotation_quaternion", index=1)
assert channelbag.fcurves[0] == fcurve
channelbag.fcurves.remove(fcurve)
channelbag.fcurves.clear()
```

Pull Request: https://projects.blender.org/blender/blender/pulls/124987
2024-07-18 17:06:12 +02:00
Christoph Lendenfeld
6ef77a0d22 Anim: Deselect Keys before inserting new keys
This commit changes the keying code to deselect keyframes when inserting new keys.
This has been discussed in the Animation & Rigging module meeting [1].
There is also an RCS post about that [2].
Doing this brings key creation in line with object creation,
where only the newly created object is selected.
There has been a previous attempt [3] to do a similar thing.

### Changes
When inserting keys by pressing `I` in the viewport or choosing a keying set,
all keys of the `Action` get deselected before inserting new keys.
New keys are selected by default.
Python RNA functions are **NOT** affected, meaning addons using
those functions will not deselect any keys by default.
The developer has to choose to do so.
To make that easier, there is a new RNA function on the action
`deselect_keys`

[1]: https://devtalk.blender.org/t/2024-05-02-animation-rigging-module-meeting/34493#patches-review-decision-time-5
[2]: https://blender.community/c/rightclickselect/K0hbbc
[3]: https://archive.blender.org/developer/D11623

Pull Request: https://projects.blender.org/blender/blender/pulls/121908
2024-07-18 14:48:00 +02:00
Sybren A. Stüvel
7360ce4bcc Anim: add RNA code for ChannelBags
RNA API for creating & removing channelbags, as well as a path function
to construct RNA paths for channelbags.

```python
action = bpy.data.actions.new('TestAction')

slot = action.slots.new()
slot.name = 'OBTest'

layer = action.layers.new(name="Layer")
strip = layer.strips.new(type='KEYFRAME')

# New in this commit:
channelbag = strip.channelbags.new(slot)
strip.channelbags.remove(channelbag)
```

Pull Request: https://projects.blender.org/blender/blender/pulls/124793
2024-07-18 11:14:15 +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
Alaska
ef010da315 Cycles tests: Enable MNEE test on Metal on supported macOS version
MNEE tests were disabled on Metal due to the feature not being
supported in macOS < 13.

This commit enables MNEE tests on Metal GPUs if they are using
macOS >= 13, otherwise leave it disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/124709
2024-07-16 09:46:12 +02:00
Clément Foucault
e0474c4bd3 Merge branch 'blender-v4.2-release' 2024-07-09 16:47:16 +02:00
Clément Foucault
ee94e84ab2 EEVEE: Make tests pass on all platforms
Increase fail threshold for tests with platform
dependent noise.
Blacklist `principled_thinfilm_transmission` as
the IOR is very small and isn't packed to the GBuffer
with the same precision on every platform.
2024-07-09 16:46:06 +02:00
Falk David
2efc3e8db2 Cleanup: Formatting 2024-07-09 15:12:58 +02:00
Clément Foucault
acf7eab3b5 Merge branch 'blender-v4.2-release'
# Conflicts:
#	tests/data
2024-07-09 14:52:34 +02:00