User a Blender wrapper `tests/utils/blender_headless.py` to runs a
graphical instance of Blender within a headless weston compositor.
Currently only WAYLAND is supported as a back-end, support for other
platforms is possible. The tests can run from X11 since the tests don't
depend on existing instances of X11 or WAYLAND.
- Each test runs a separate headless instance of WESTON
since the overhead is minimal, this allows tests to run in parallel
without interfering with each other.
- There is a CMake option WESTON_BIN, when left empty the weston
from LIBDIR is used. Otherwise this can point to the weston binary
installed on the users system.
- In most cases simulated events are needed to implement these tests
(running blender with `--enable-event-simulate`).
- This commit adds 14 undo tests - simulating user interaction as well
as undo/redo actions, ensuring the desired result is reached.
Other kinds of UI tests could be added in the future.
Ref !114164
This wrapper script can be used instead of executing "blender"
to launch blender in it's own display server which is closed
when Blender quits.
The BLENDER_BIN environment variable is used to run Blender,
forwarding arguments & passing the exit-code back to the script.
This can be used to run automated graphical-tests while still being
in background (from a user perspective).
This has the advantage that windows don't popup in the foreground,
or on servers/VM's that aren't running a graphical session.
Running many Blender instances, each in their own display server
is also supported, allowing for tests to make use of multiple jobs.
Tested with graphical undo tests which have not yet been made part of
CTests (needs further investigation).
Currently this only supports WAYLAND however it can run on X11
since it launches it's own WAYLAND compositor instance for each
Blender session. The wrapper has been written with the intention of
adding support for other back-ends in the future (if practical).
Use the WESTON compositor since it's widely available and has a
headless server, any other WAYLAND-server could likely be used without
much trouble.
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
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
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
Printing that a library is found every time CMake runs isn't helpful.
Restrict these messages for the first execution so messages are limited
to information developers may need to know such as features being
disabled because of incompatible configurations.
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
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
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.
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.
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).
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.
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
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
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
bl_keymap_validate wasn't exiting with a non-zero exit code
on failure since [0] which unintentionally removed the assignment.
[0]: 167c4c6962c96b281f40ea1b540b1bf1223a5277
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
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
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.
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