Commit Graph

741 Commits

Author SHA1 Message Date
Michael B Johnson b262655d39 USD: export to a single root prim by default
This PR adds the following changes:

A single root is always set as default. After talking to Wave and
Spiff, we settled on root being the best default. Users who don't
want a single root prim inserted, can choose to clear the field
The root prim no longer requires the user to prefix the field with /.
It will implicitly insert that for them.

On export, the root_prim hierarchy is now defined all as Xform
instead of just the final prim in the path. Each prim also has
custom metadata added to show that it was generated by Blender.
This follows convention in other DCCs as well.

On import, the code now finds the hierarchy of generated prims
using that metadata. It then skips importing them. This means that
you can roundtrip hierarchies even with an inserted root.

Co-authored-by: Dhruv Govil <dgovil2@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113187
2023-10-20 10:58:40 -04:00
Bastien Montagne b684864561 Fix USD I/O crashing on reports by using new wmJob report system.
Calling `WM_report` & co API from wmJob worker thread is utterly unsafe,
and should never have been done. It 'worked' so far presumably because
worker threads were barely (if ever) reporting anything that way, but
now USD IO code is spamming reports in some cases, leading to fairly
common crashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113883
2023-10-20 11:08:27 +02:00
Miguel Pozo 1ba16edaf0 EEVEE-Next: Rename light probes
Update to the new naming convention for `Light Probes`:

`Reflection Cubemap` -> `Sphere`
`Reflection Plane` -> `Plane`
`Irradiance Grid` -> `Volume`

Note that this breaks the Python API (`bpy.types.LightProbe.type`).

Pull Request: https://projects.blender.org/blender/blender/pulls/113452
2023-10-11 19:38:42 +02:00
Brecht Van Lommel f9bf2a71b4 Merge branch 'blender-v4.0-release' into main 2023-10-06 21:43:56 +02:00
Brecht Van Lommel 60ffec5a91 Tests: add dedicated directory for principled BSDF tests 2023-10-06 21:17:50 +02:00
Jeroen Bakker 79ca1b16ab Cleanup: Make format 2023-10-06 07:40:26 +02:00
Brecht Van Lommel 9e8ded92e5 Merge branch 'blender-v4.0-release' into main 2023-10-05 20:00:07 +02:00
Denis Kovacs 7a9284107d USD: Improve camera import/export and round-tripping
Fix various issues in import and export of cameras.

* Wrong units and flipped shift values on import
* Wrong clip start lower range on import
* Wrong units for aperture and focal length properties on export
* Issue with auto sensor fit and height > width on export

Pull Request: https://projects.blender.org/blender/blender/pulls/112905
2023-10-05 19:47:11 +02:00
Miguel Pozo b4de568cc4 EEVEE-Next: Tests support
Enable tests for EEVEE Next.

As a workaround for allowing the use of EEVEE Next (still an
experimental feature) with `--factory-startup`, `arg_handle_engine_set`
enables the feature when `-E BLENDER_EEVEE_NEXT` is used.
In addition, EEVEE Next is always registered, so it's available when
calling `WM_init`.
If it's actually disabled, it will be immediately unregistered after that.

Notes:
- `get_gpu_device_type` always fails with error:
  > GPU API is not available in background mode
- Setup and tests are the same as EEVEE. There are many tests that
  only make sense for Cycles, and many EEVEE Next features that are
  not actually tested.

Pull Request: https://projects.blender.org/blender/blender/pulls/112161
2023-10-05 16:02:49 +02:00
Campbell Barton 9d20632925 Cleanup: ensure trailing newline, delete trailing space 2023-10-05 13:57:14 +11:00
Brecht Van Lommel 61f982f0d1 Cleanup: make format 2023-10-04 21:30:41 +02:00
Bastien Montagne 3d5c6dc218 Tests: Add test to open all blendfiles in current `/lib/tests/` repository.
This is fairly brute force and rough, but there are quite a few old
files in there, helps a bit with versioning and readfile code testing.

Note: Five files are currently excluded since failing in debug builds
at least, most of the time for memleaks issues. The two other 'errors'
may also not be actual issues, but this needs to be investigated further.

Also, in the future, when time allows, it may be better to generate a
set of dedicated testing files, with as many official releases versions
as possible?

Re. #112649.
2023-10-04 14:15:06 +02:00
Campbell Barton 93aa1654be Fix crash caused by bl_keymap_validate clearing key-maps
The fix for disabling add-ons #113206 caused a crash when the
bl_keymap_validate test exited.

This happened because add-on unregister would try to remove key-map
items that had been freed.

Resolve by disabling all addons instead of clearing the keymaps.
2023-10-04 22:20:38 +11:00
Lukas Tönne 8a20bd4182 Test fix: Node groups outputs now placed before inputs
#113060 enforces output/input ordering of node group sockets.
The bf_node_group_interface test needs to be updated to reflect
these changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113213
2023-10-03 17:24:12 +02: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
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