Commit Graph

1151 Commits

Author SHA1 Message Date
Campbell Barton 5126677c6f Tests: add batch blend file loading utility
Useful for finding regression in file reading as well as issues reported
by ASAN, including memory leaks.
2023-09-27 16:50:09 +10:00
Campbell Barton 01bc51e7eb Tests: move utilities into their own directory
These programs don't run as part of automated tests but can be useful
utilities for developers to expose issues or bisecting
(in the case of event simulation).
2023-09-27 16:50:09 +10:00
Campbell Barton 224e623e3c Fix bf_animation_fcurves tests failing depending on preferences
User preferences could cause this test to fail,
tests should never read the users configuration.
2023-09-23 21:17:50 +10:00
Campbell Barton d2c271ec84 CMake: use bf_io_ prefix for IO tests
This simplifies running built-in IO tests with:

  ctest -R bf_io_

Also use "bf_io_" prefix for the libraries since it was already used
by some and it's a useful hint the libraries are used for IO.
2023-09-23 20:22:19 +10:00
Lukas Tönne 354915cf3c Nodes: revert the inline (pass-through) socket feature
Inlined sockets in the same vertical space are no longer supported.
This removes `input_output` socket declarations, the inlining feature in
node drawing, and the `Both` option for node group interface sockets.

Versioning code splits existing node group sockets into individual
sockets again. Unfortunately some links may get lost in versioning files
using the feature, because of an unnoticed bug: Socket identifiers have
to be unique in the node group items list but inlined input/output
sockets have the same identifier. This still works for most situations
because uniqueness is only required within input/output lists. Creating
proper unique identifiers will discard any link from the previous output
socket. This cannot easily be fixed without `after_linking` versioning
code, which should be avoided.

Pull Request: https://projects.blender.org/blender/blender/pulls/112560
2023-09-22 16:56:59 +02:00
Lukas Tönne 742f3b233f Nodes: Rename `ui_items` property to `items_tree`
DNA names are unchanged, just affects the RNA API.

Resolves #112523

Pull Request: https://projects.blender.org/blender/blender/pulls/112527
2023-09-18 18:07:26 +02:00
Hans Goudey 1cfed92c84 Fix: Exception creating geometry node group or node group socket
c951464b8a didn't update the uses of the API.
2023-09-18 11:01:05 -04:00
Campbell Barton def4a06fc9 Cleanup: format 2023-09-15 10:44:40 +10:00
Habib Gahbiche 64bd2091cf Realtime Compositor tests: enable keying tests.
Tests are not crashing anymore, so no reason to skip them.

Blend files are already available in svn. Reference images have been updated in svn revision `r63481`

Pull Request: https://projects.blender.org/blender/blender/pulls/112198
2023-09-14 20:27:31 +02:00
Christoph Lendenfeld 8f1bd71992 Fix #112085: Not able to insert keys on subframes
When subframes were enabled, and the time cursor was at a subframe position,
the keying would still insert the key at the full frame.

This was because the value passed to the key insertion
functions was just the full frame value and not the subframe part.
Fixing it by using `BKE_scene_frame_get()` which
returns the floating point frame including the subframe part.

I've added unit tests to ensure that inserting keys at subframe values doesn't cause issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/112131
2023-09-14 15:07:08 +02:00
Campbell Barton b7f3e0d84e Cleanup: spelling & punctuation in comments
Also remove some unhelpful/redundant comments.
2023-09-14 13:25:24 +10:00
Campbell Barton 6d6a99974d Fix script_validate_keymap test failing (mistake parsing --relaxed arg) 2023-09-14 12:38:34 +10:00
Campbell Barton 716d1b9e29 Tests: bl_keymap_validate failure wasn't causing tests to fail
bl_keymap_validate wasn't exiting with a non-zero exit code
on failure since [0] which unintentionally removed the assignment.

[0]: 167c4c6962
2023-09-13 15:11:38 +10:00
Campbell Barton 6adc6675ad Fix bl_keymap_validate.py failure caused by add-on key-maps 2023-09-13 15:09:54 +10:00
Campbell Barton 48950ff934 Cleanup: format 2023-09-06 19:15:47 +10:00
Lukas Tönne 851a32adb5 Nodes: New test for node group versioning
This simply loads a blend file and tests that the node group interface
as well as a node group instance have all the expected sockets and
default values.

Pull Request: https://projects.blender.org/blender/blender/pulls/111800
2023-09-05 14:27:20 +02:00
Clément Foucault 2637bbf016 EEVEE-Next: Add LUT test
This avoid the generation code to become desync with
the precomputed tabled.

This is also a good way to test any changes to them.
2023-09-03 16:42:53 +02:00
Lukas Tönne e071288ab2 Nodes: Panels integration with blend files and UI
Part 3/3 of #109135, #110272

Switch to new node group interfaces and deprecate old DNA and API.
This completes support for panels in node drawing and in node group
interface declarations in particular.

The new node group interface DNA and RNA code has been added in parts
1 and 2 (#110885, #110952) but has not be enabled yet. This commit
completes the integration by
* enabling the new RNA API
* using the new API in UI
* read/write new interfaces from blend files
* add versioning for backward compatibility
* add forward-compatible writing code to reconstruct old interfaces

All places accessing node group interface declarations should now be
using the new API. A runtime cache has been added that allows simple
linear access to socket inputs and outputs even when a panel hierarchy
is used.

Old DNA has been deprecated and should only be accessed for versioning
(inputs/outputs renamed to inputs_legacy/outputs_legacy to catch
errors). Versioning code ensures both backward and forward
compatibility of existing files.

The API for old interfaces is removed. The new API is very similar but
is defined on the `ntree.interface` instead of the `ntree` directly.
Breaking change notifications and detailed instructions for migrating
will be added.

A python test has been added for the node group API functions. This
includes new functionality such as creating panels and moving items
between different levels.

This patch does not yet contain panel representations in the modifier
UI. This has been tested in a separate branch and will be added with a
later PR (#108565).

Pull Request: https://projects.blender.org/blender/blender/pulls/111348
2023-08-30 12:37:21 +02:00
Bastien Montagne e20a284cb9 Fix #111488: Copying object crashes Blender after recent refactor.
Caused by 8bb5916183.

Trivial mistake, would have been caught by a basic test, so also added
said test for the 'write partial' feature.
2023-08-25 11:04:03 +02:00
Campbell Barton 3de8900ed6 Cleanup: spelling in comments 2023-08-25 09:40:42 +10:00
Campbell Barton a13823057c Cleanup: format 2023-08-24 11:37:29 +10:00
Sergey Sharybin cf8ea05e71 CMake: Rename compositor tests option to WITH_COMPOSITOR_REALTIME_TESTS
It follows the naming convention of other unit-test variables.

Pull Request: https://projects.blender.org/blender/blender/pulls/111437
2023-08-23 16:03:12 +02:00
Zijun Zhou a9053f7efb Color management: Add AgX view transform and make it default
On a user level this view transform provides much better handling of colors in
the over-exposed areas.

With this configuration the following display devices are available, including
AgX view transform for them:
* sRGB
* Display P3
* Rec.1886
* Rec.2020

NOTE: There is no Filmic view transform available for the newly added display
devices.

AgX also brings an implementation of False Colors view transform, which replaces
Filmic-based, and is available for all display devices.

The backward compatibility is preserved. The new files will default to AgX view
transform, which makes it non-forward compatible.

More technical details is available in the original PR #106355.
Please note that the PR has been split into more incremental changes when
was landing.

Pull Request: https://projects.blender.org/blender/blender/pulls/111099
2023-08-22 12:53:15 +02:00
Campbell Barton 8df5205028 Fix RNA path resolving failing to lookup empty string properties
An empty string is a valid ID property name, when set, RNA's
internal lookup function (rna_path_token_in_brackets), considered
the path invalid.

Now quoted tokens are allowed to be empty.

This fixes Python exceptions being thrown in the custom property editor
with empty custom property names.
2023-08-22 13:31:26 +10:00
Campbell Barton e044c5f12b Tests: add ID-property TestRNAData.test_custom_properties_access
Ensures RNA/ID-property key lookups are compatible.
2023-08-22 13:31:05 +10:00
Bastien Montagne f052b18a65 Always clear 'fake user' flag from linked data.
Using this flag from linked data is always a double-edge sword, in one
end some user have been relying on it to keep around data that is not
really used as ID (like e.g. text data-blocks, node trees, see
e.g.  #103687, #105687). On the other end, it often causes over-keeping
of linked data reference in production files.

From now on, when an unused linked data is to be kept around, users
should create an ID property to reference it.

Implements #106321.

Pull Request: https://projects.blender.org/blender/blender/pulls/111042
2023-08-21 15:33:25 +02:00
Sergey Sharybin f0a8c19461 Compositor: Increase tolerance for matte tests
The test is very susceptible to exact input values, and recent
change from Filmic to Standard view for those test changed values.

This change is similar to #110897

Pull Request: https://projects.blender.org/blender/blender/pulls/111339
2023-08-21 12:12:12 +02:00
Habib Gahbiche 9d08be1eec Realtime Compositor: add regression tests
Tests must be enabled manually using the CMake flag `WITH_COMPOSITOR_REALTIME_TEST`. Reasons are F12 for realtime compositor is experimental and buildbots have no GPU. Failing tests are excluded.

Pull Request: https://projects.blender.org/blender/blender/pulls/109878
2023-08-19 15:00:54 +02:00
Weizhen Huang 639223d92f Fix Cycles hair orientation test failing on Linux/Windows
Increase samples per pixel

Pull Request: https://projects.blender.org/blender/blender/pulls/111262
2023-08-18 15:33:41 +02:00
Weizhen Huang c40e3dd142 Workaround failing hair test on Linux/Windows
temporarily disable the test before proper fix
2023-08-18 14:14:07 +02:00
Campbell Barton bf35eb9cbc Cleanup: format 2023-08-18 08:38:02 +10:00
Michael Kowalski 6f4cb9bc56 USD: Skeleton and blend shape import
Added support for UsdSkel animation import.

This addresses #110076.

Added USDSkeletonReader class which imports UsdSkelSkeleton primitives
as armatures.

Extended USDMeshReader to import UsdSkelBlendShape as shape keys.

Extended USDMeshReader to import USD skinning data as as deform groups
and an armature modifier on the mesh object.

Added USDMeshReader::get_local_usd_xform() to override the transform
computation to account for the binding transformation for skinned meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/110912
2023-08-17 20:11:51 +02:00
Campbell Barton 5478798526 Cleanup: use lowercase cmake commands
The `Find*.cmake` modules originally used uppercase commands to match
CMake's own conventions. Since then CMake uses lower-case and even
within our own find modules, using all uppercase wasn't done
consistently. Opt for lowercase everywhere.
2023-08-17 13:15:56 +10:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Bastien Montagne 6a86dd5f34 LibOverride: Add ID pointer to operations over ID pointers.
In RNA collections storing ID references, the name of the collection
item may not always be unique, when several IDs from different libraries
are present.

While rare, this situation can become deadly to liboverride, by causing
random but exponential liboverride hierarchies corruptions.

This has already been alleviated by using preferably both name and index
in items lookup (a05419f18b) and by reducing the risk of name collision
in general between liboverrides and their linked reference (b9becc47de).

This commit goes further, by ensuring that references to items of RNA
collections of IDs stored in liboverride operations become completely
unambiguous. This is achieved by storing an extra pointer to the item's
ID itself, when relevant.

Lookup then requires a complete match `name + ID` to be successful,
which is guaranteed to match at most a single item in the whole RNA
collection (since RNA collection of IDs do not allow duplicates, and
the ID pointer is always unique).

Note that this ID pointer is implemented as an `std::optional` one
(either directly in C++ code, or using an new liboverride operation `flag`
in DNA). This allows to smoothly transition from existing data to the
added ID pointer info (when needed), without needing any dedicated
versioning. This solution also preserves forward compatibility as much
as possible.

It may also provide marginal performances improvements in some cases, as
looking up for ID items in RNA collections will first check for the
ID pointer, which should be faster than a string comparision.

Implements #110421.

Pull Request: https://projects.blender.org/blender/blender/pulls/110773
2023-08-10 12:41:20 +02:00
Sergey Sharybin af101ad3f8 Compositor: Increase tolerance for matte tests
The node_keying_matte.blend test is very sensitive to the exact
pixel values in the input image. It is hard to match the output
between SSE and non-SEE codepaths of sRGB-to-linear conversion,
especially when it is done form the OCIO side.

Note that even without OCIO the match could be very difficult to
achieve, since BLI also implements SSE optimization (although, we
are in better control over there, so might increase the accuracy).

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/110897
2023-08-07 16:45:49 +02:00
Brecht Van Lommel fa34d893f1 Fix wrong render test comparison for Storm USD and Hydra 2023-08-07 15:13:03 +02:00
Jeroen Bakker 8c0591459e Cleanup: Make Format 2023-08-07 09:20:26 +02:00
Bastien Montagne 93728fee53 LibOverride: Extend unittest to cover more advanced/complex cases.
These tests now have basic coverage of:
* Linking data and creating liboverride hierarchy from it.
* Linking that liboverride again.
* Creating liboverride of liboverride.
* Modifying data hierarchy in the library, and testing (recursive)
  resync of it.
* ID name collision handling (between modified linked data and
  existing overrides).
2023-08-06 23:11:19 +02:00
Brecht Van Lommel 647f2053a9 Tests: add automated regressions tests for Hydra Storm
These are meant to test Hydra integration. Currently they are only enabled
for WITH_OPENGL_RENDER_TESTS=ON due to similar reasons as Eevee and
Workbench, which is that they require a GPU and results can be platform
dependent due to hardware and driver differences.

There are separate tests for USD and Hydra export paths. The goal is to
make these identical, but they aren't yet. So for that reason they have
separate reference renders, and there is a HTML page to compare them.

Ref #110765
2023-08-04 17:01:09 +02:00
Campbell Barton 89811cb96f Cleanup: unused-imports in tests/ 2023-07-25 21:43:53 +10:00
Campbell Barton 932a85a24f Fix tests failing from errors in the users startup file
Tests should never depend on the users startup.blend which can have
settings that interfere with tests.

Failure to load the user startup.blend for e.g. prevented
bl_alembic_io_test from passing.
2023-07-25 21:20:10 +10:00
Jacques Lucke 3d73b71a97 Geometry Nodes: new Repeat Zone
This adds support for running a set of nodes repeatedly. The number
of iterations can be controlled dynamically as an input of the repeat
zone. The repeat zone can be added in via the search or from the
Add > Utilities menu.

The main use case is to replace long repetitive node chains with a more
flexible alternative. Technically, repeat zones can also be used for
many other use cases. However, due to their serial nature, performance
is very  sub-optimal when they are used to solve problems that could
be processed in parallel. Better solutions for such use cases will
be worked on separately.

Repeat zones are similar to simulation zones. The major difference is
that they have no concept of time and are always evaluated entirely in
the current frame, while in simulations only a single iteration is
evaluated per frame.

Stopping the repetition early using a dynamic condition is not yet
supported. "Break" functionality can be implemented manually using
Switch nodes in the  loop for now. It's likely that this functionality
will be built into the repeat zone in the future.
For now, things are kept more simple.

Remaining Todos after this first version:
* Improve socket inspection and viewer node support. Currently, only
  the first iteration is taken into account for socket inspection
  and the viewer.
* Make loop evaluation more lazy. Currently, the evaluation is eager,
  meaning that it evaluates some nodes even though their output may not
  be required.

Pull Request: https://projects.blender.org/blender/blender/pulls/109164
2023-07-11 22:36:10 +02:00
Ray Molenkamp 57ad866d81 Cleanup: CMake: Modernize bf_guardedalloc dependencies
Pretty straightforward

- Removes any guardedalloc paths from INC
- Adds a dependency though LIB

Pull Request: https://projects.blender.org/blender/blender/pulls/109925
2023-07-10 18:44:19 +02:00
Sergey Sharybin baeb314eb7 Fix incorrect EXPECT_M4_NEAR
Seems to be a copy-paste error: the first 3 columns
were only compared as float3, not as float4.

Only affected validness of regression tests which might have
missed an actual mismatch between matrices. Likely, all tests
were valid, and this change did not discover failures.
2023-07-03 19:18:28 +02:00
Ray molenkamp eff9e2f4ce CMake: plumbing for modern CMake usage
This is the minimal change required to start using modern CMake in the
blender build system. This change is designed to allow small
incremental changes to the build system rather than doing it in one
big bang which would be unmaintainable (for me)

The biggest functional change is, previously all libraries in the
`LIB` section of a `blender_add_lib` call had the `INTERFACE` scope,
which is rarely, if ever the correct scope. This diff changes this to
`PRIVATE`

Concrete implications of this diff :

The `LIB`, `INC` and `INC_SYS` sections of an `blender_add_lib` call
now allow scoping keywords (`PUBLIC`, `PRIVATE,` `INTERFACE`) to
declare the scope of the dependency.

Right now the only library using any modern cmake is
`bf_intern_atomic` which is an header only interface library that will
just advertise its include directories.

This allows us to clean up any `CMakeLists.txt` that adds
`../../../intern/atomic` to its `INC` section to remove it in `INC` by
adding a `PRIVATE bf_intern_atomic` to the `LIB` section.

Pull Request: https://projects.blender.org/blender/blender/pulls/107858
2023-06-27 20:57:50 +02:00
Jeroen Bakker 7d122ff82b Cleanup: make format 2023-06-16 15:15:27 +02:00
Jacques Lucke 9535248911 Tests: support simulation nodes regression tests
Geometry nodes supports simulation nodes which allows later frames to depend
on previous frames. The existing geometry nodes regression tests only evaluated
the node tree at a single frame and therefore couldn't test the correct behavior of
simulations.

This adds a new kind of regression test that evaluates the scene at multiple
consecutive frames and then checks if the last frame matches.

Pull Request: https://projects.blender.org/blender/blender/pulls/109046
2023-06-16 10:00:55 +02:00
Sergey Sharybin 4f9a9abcf1 Merge branch 'blender-v3.6-release' 2023-06-15 13:40:38 +02:00
Sergey Sharybin 2d3c9bcee8 Benchmark: Pack python expression into a single line
There should be no functional changes for the typical usecase,
but it allows to have more tricky setups like pointing to a
BAT script to override some configuration.

The issue is that BAT scripts do not support new lines in the
command line arguments. That's where single-line python expression
helps.

For example, it is possible to point benchmark script to a blender.bat
which contains

    blender.exe --python-expr "import bpy; bpy.context.preferences.addons['cycles'].preferences.use_oneapirt = False" %*

to have side-by-side numbers of oneAPI with and without HW RT.

Without this change the %* is which did not work: the BAT
script did not "see" part of the command line past the new line.

Pull Request: https://projects.blender.org/blender/blender/pulls/109006
2023-06-15 13:40:17 +02:00