Commit Graph

1235 Commits

Author SHA1 Message Date
Campbell Barton
c527056f0c Fix #117783: Allow Multiple Negatives in Numerical Inputs with Units
Support multiple unary operators before a number where only a single
negative value worked in the past.

Ref !117827.
2024-02-06 09:28:30 +11:00
Damien Picard
fa77e9142d UI: fix and improve a few messages
- "can not" -> "cannot" in many places (ambiguous, also see
  Writing Style guide).
- "Bezier" -> "Bézier": proper spelling of the eponym.
- Tool keymaps: make "Uv" all caps.
- "FFMPEG" -> "FFmpeg" (official spelling)
- Use MULTIPLICATION SIGN U+00D7 instead of MULTIPLICATION X U+2715.
- "LClick" -> "LMB", "RClick" -> "RMB": this convention is used
  everywhere else.
- "Save rendered the image..." -> "Save the rendered image...": typo.
- "Preserve Current retiming": title case for property.
- Bend status message: punctuation.
- "... class used to define the panel" -> "header": copy-paste error.
- "... class used to define the menu" -> "asset": copy-paste error.
- "Lights user to display objects..." -> "Lights used...": typo.
- "-setaudio require one argument" -> "requires": typo.

Some issues reported by Joan Pujolar and Tamar Mebonia.

Pull Request: https://projects.blender.org/blender/blender/pulls/117856
2024-02-05 17:08:17 +01:00
Brecht Van Lommel
03e92a9d28 Tests: Temporarily increase OpenImageDenoise test threshold for upgrade
So that both the current and upcoming version pass tests. To be lowered
again when all platforms have upgraded.
2024-02-02 18:12:45 +01:00
Aras Pranckevicius
0bfffdaf82 VSE: bilinear upscaling no longer adds transparent border around the image
Part of overall "improve image filtering situation" (#116980), this PR addresses
two issues:
- Bilinear (default) image filtering makes half a source pixel wide transparent
  border around the image. This is very noticeable when scaling images/movies up
  in VSE. However, when there is no scaling up but you have slightly rotated
  image, this creates a "somewhat nice" anti-aliasing around the edge.
- The other filtering kinds (e.g. cubic) do not have this behavior. So they do
  not create unexpected transparency when scaling up (yay), however for slightly
  rotated images the edge is "jagged" (oh no).

More detail and images in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/117717
2024-02-02 16:28:51 +01:00
Clément Foucault
a682d12015 Fix: EEVEE-Next: Wrong lightcache bake command 2024-02-02 15:14:41 +01:00
Jeroen Bakker
4b3254279c RenderTests: Enable EEVEE-Next Raytracing
Allow testing of material refractions. Also set the reflection probe to match
the raytracing pipeline closely.

Pull Request: https://projects.blender.org/blender/blender/pulls/117662
2024-01-30 10:44:04 +01:00
Miguel Pozo
0c23f1ac2a Fix: EEVEE render tests python syntax
The script still fails, though.
2024-01-29 20:13:50 +01:00
Jeroen Bakker
324ef0cbf4 RenderTest: GPU Render Tests Pass Silently
Add silently fail option to GPU based render tests. This is a pre-requisite to enable
render tests on the buildbot. By default these render tests will pass silently.

* Test will pass when using the `--pass-silently` arguments.
* Only crashes will be reported as failed tests.
* To find out failing test, review the test reports.

`WITH_GPU_RENDER_TESTS_SILENT` compile option can be used to let tests pass (default)
or fail (default for developers).

Although some tests fail, they still passed. In the generated render report,
the silently passed failures are correctly reported to be failures.

Pull Request: https://projects.blender.org/blender/blender/pulls/117629
2024-01-29 15:39:14 +01:00
Aras Pranckevicius
b5f3e40eb2 Tests: add sequencer filter render tests
Data files in svn r63628

Pull Request: https://projects.blender.org/blender/blender/pulls/117605
2024-01-28 20:26:44 +01:00
Brecht Van Lommel
3f0f26ee8a Tests: make reports summary HTML work with relative links
So that downloading the test results from the buildbot has working links.
2024-01-26 17:04:22 +01:00
Jeroen Bakker
af25e2d5df RenderTests: Disable Cycles Only Tests for other Engines
This PR disables cycles only render tests for the gpu/viewport based
render engines. These render engines include EEVEE, Workbench, but
also the Hydra viewport engines. Disabling those test would reduce
test time.

Tests that are being disabled are features that are only supported
by Cycles.
- Light groups
- Light linking
- Shadow catcher
- Denoising
- Path guiding
- Reports

Pull Request: https://projects.blender.org/blender/blender/pulls/117540
2024-01-26 14:46:04 +01:00
Jeroen Bakker
49d07653f9 RenderTests: Fix Incorrect Command in Report
When running the render test for EEVEE-Next the command printed on
the report to update the reference images was incorrect. In stead of
displaying
`BLENDER_TEST_UPDATE=1 ctest -R eevee_next` it displayed
`BLENDER_TEST_UPDATE=1 ctest -R eevee next`.

The cause of this is that the title of the report is used to create
the command. EEVEE-Next has a space in its title which generates
an incorrect command.

A quick fix would be to replace spaces with underscores. But it would
be better to fix this more clearly by adding an attribute containing the
engine name.

This PR adds a `set_engine_name` method to the Report class. By
default the engine name is set based on the title.

Pull Request: https://projects.blender.org/blender/blender/pulls/117503
2024-01-25 18:55:28 +01:00
Sergey Sharybin
9fdf3bc1f4 Fix missing generation of alpha difference images in render tests
The part of the patch wasn't properly applied from a working branch,
and it wasn't very visible because the development environment already
had all files on disk.

Pull Request: https://projects.blender.org/blender/blender/pulls/117504
2024-01-25 14:20:30 +01:00
Sergey Sharybin
f11292104d Render Tests: Separate difference of Color and Alpha
This change fixes confusion situation when the render output
is an RGBA image: the difference in color was not visible in
the report because alpha channel was all zeros. This is due
to idiff performing per-channel difference.

The solution to this problem is to have separate images for
color and alpha difference, which makes it clear where the
difference actually is coming from.
2024-01-25 10:04:16 +01:00
Campbell Barton
6aede44fb7 PyAPI: remove checks for add-ons pre 2.8x
This made sense when migrating from 2.7x, now 2.8x add-ons may also
have issues in 4.1 so this check isn't so relevant.
2024-01-25 13:00:48 +11:00
Campbell Barton
c5dd51a4dc Fix syntax error in workbench_render_tests
Correct even if the test isn't used, since syntax errors can trip up
checking tools.
2024-01-25 10:37:30 +11:00
Jeroen Bakker
481bc7a777 EEVEE: Update Render tests script
Last month we have been in the process of fixing the render tests of EEVEE-Next.
These render tests had some issues. Currently we are in a state that render
differences can be explained or related to an existing issue.

Having these render tests will also enable testing differences between Metal and OpenGL.

The new setup alters the position of the reflection probe so it doesn't intersect the ground
or the sphere at the same time. An offset was added, which adds a small difference
between cycles and eevee-next renders.

There is a known issue with the HiZ buffers when render size is too small. We change the
reflection probe render size as a temporary fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/117447
2024-01-23 15:11:15 +01:00
Christoph Lendenfeld
5e28601d69 Anim: Separate keying flags
Splits the flag `..._FLAG_INSERTNEEDED` between autokey and
manual keying. The fact that this flag was shared between the two
systems has been the cause of issues in the past. It wouldn't
let you insert a keyframe even though you explicitly used an operator
to do so.

In order to be clearer what options are used where, the user preferences
have been reordered.

By default "Only Insert Needed" will be enabled for auto-keying, but not for manual keying.
The versioning code will enable both if it was enabled previously.

# Code side changes

The keying system has flags that define the behavior
when keys are inserted. Some of those flags were shared
between keying and auto-keying. Some were only used for
auto-keying.
To clarify that, prefix flags that used exclusively in one or the other
system with `AUTOKEY`/`MANUALKEY`

Also the flag name on the user preferences and the tool settings was renamed.
Previously it was called `autokey_flag`. To indicated that it is not only used
for autokeying, rename it `keying_flag`.

Fixes: #73773

Pull Request: https://projects.blender.org/blender/blender/pulls/115525
2024-01-19 16:26:10 +01:00
Omar Emara
2bff75c303 Tests: Enable blacklisted GPU compositor tests
Those tests are now expected to work.
2024-01-19 16:36:31 +02:00
Brecht Van Lommel
9c8a9662c0 Tests: Cache revision builds in benchmark script
In the mode where the script automatically builds Blender at given git
hashes, cache the builds instead of rebuilding them before running.
2024-01-18 21:28:23 +01:00
Hans Goudey
55131f6f90 Tests: Enable new triangulate geometry node test files 2024-01-16 15:59:33 -05:00
laurynas
a6fd1f5034 Fix: Curves extrude with all points selected
CurvesGeometry has no ".selection" attribute when all control points
are selected. The earlier code assumed that the attribute always exists.
Also Python tests are added for the "extrude" operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/117095
2024-01-16 21:59:15 +01:00
Lukas Tönne
83d3ba8a58 Fix #116477: Node group sockets with subtypes have broken idnames
Loading pre-4.0.20 node groups with sockets using subtypes causes
broken socket identifiers. This is because the node tree interface now
expects sockets to use the base identifiers ("NodeSocketFloat" instead
of "NodeSocketFloatFactor" etc.).

To correct this the conversion code now replaces socket idnames that
include a subtype suffix with their base names. This fix is also applied
to files between versions 4.0.20 and 4.1.10, where the socket types
may have been converted incorrectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/117133
2024-01-16 15:32:33 +01:00
Jeroen Bakker
6e2572116d EEVEE: Fix running render tests
Render test would hide objects from probes. It still referred to
the old name of the spherical probes. This change will replace it
with the correct name.

It also hides objects from the planar probes as they were also
recently added.

Pull Request: https://projects.blender.org/blender/blender/pulls/116093
2024-01-15 08:36:56 +01:00
Thomas Barlow
5139a9c064 Fix: foreach_get/set does not work on multidimensional arrays
The foreach_get/foreach_set methods of bpy_prop_array get/set the entire
contents of the array, but they were checking that the length of the
input sequence was equal to the length of the current array dimension
rather than the total length of all dimensions of the array.

This would read/write memory after the end of the passed in sequence
when the property was a multidimensional array. Performing
`foreach_get` with a Python list with length matching the length of the
current dimension of a multidimensional array would crash a debug build
due to the trailing pad bytes of the temporarily allocated array being
overwritten.

This patch fixes `pyprop_array_foreach_getset` by changing the function
used to get the expected sequence size, to the RNA function that gets
the total length of the array across all its dimensions.

The tests have be updated to additionally test multidimensional array
properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/116457
2024-01-12 18:38:32 +01:00
135b42c3c4 Anim: fix Python bone collection unit tests
The bone collection unit tests in Python were failing, but this failure
was not propagated to `ctest` and thus went unnoticed.

Both issues are now fixed.
2024-01-11 14:37:11 +01:00
Dyvine57
eca14d5b40 Nodes: add int and bool to shader nodegroups
These are handled as floats by Cycles and EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/115026
2024-01-10 20:09:37 +01:00
Alexander Gavrilov
d0ef66ddff Drivers: implement fallback values for RNA path based variables.
As discussed in #105407, it can be useful to support returning
a fallback value specified by the user instead of failing the driver
if a driver variable cannot resolve its RNA path. This especially
applies to context variables referencing custom properties, since
when the object with the driver is linked into another scene, the
custom property can easily not exist there.

This patch adds an optional fallback value setting to properties
based on RNA path (including ordinary Single Property variables
due to shared code and similarity). When enabled, RNA path lookup
failures (including invalid array index) cause the fallback value
to be used instead of marking the driver invalid.

A flag is added to track when this happens for UI use. It is
also exposed to python for lint type scripts.

When the fallback value is used, the input field containing
the property RNA path that failed to resolve is highlighted in red
(identically to the case without a fallback), and the driver
can be included in the With Errors filter of the Drivers editor.
However, the channel name is not underlined in red, because
the driver as a whole evaluates successfully.

Pull Request: https://projects.blender.org/blender/blender/pulls/110135
2024-01-08 15:24:59 +01:00
Campbell Barton
5dd91346e1 Cleanup: remove unused imports 2024-01-08 11:40:53 +11:00
Hans Goudey
e90d844dd7 Cleanup: Grammar in comments
"it's own" -> "its own" again. Start new sentences properly.
2024-01-06 09:02:56 -05:00
Bastien Montagne
3e744db9fe Tests: Refactor handling of environment variables when invoking tests.
The current handling had a fairly bad issue: multiple calls to
`set_tests_properties` to set envvars of a same test.

This does not work, only the last call is effective, all previous
ones have absolutely no effect.

This has been addressed by moving all 'set envvar for test' logic into a
single CMake function, `blender_test_set_envvars`.

This function takes optional extra envvars if needed, and define a set
of default ones (currently, `PATH` from `PLATFORM_ENV_INSTALL` if
defined, and the 'nuke' `exitcode=0` `LSAN_OPTIONS` if relevant).

NOTE: The way `blender_test_set_envvars` handles extra envvars passed to
it as parameter is fairly basic and unsafe, in that there is no check
whether a same envvar is defined more than once. Think for now this is
an acceptable limitation.

NOTE: Although this commit _should_ be a non-functional change one, the
unification of the handling of all envvars makes it hard to ensure there is no
side effects.
The `PATH` envvar e.g. was set to either `PLATFORM_ENV_INSTALL` if defined,
or a copy of that variable's definition, but only in Windows case. So technically,
the behavior for this envvar is changed.
2024-01-05 21:13:54 +01:00
66cdc112fc Anim: Bone Collections, replace .move_to_parent() with .child_number
Instead of moving bone collections by absolute index, they can now be
moved by manipulating `.child_number`. This is the relative index of the
bone collection within the list of its siblings.

This replaces the much more cumbersome `collections.move_to_parent()`
function. Since that function is now no longer necessary (it's been
replaced by assignment to `.parent` and `.child_number`), it's removed
from RNA. Note that this function was never part of even a beta build of
Blender.
2024-01-05 16:54:46 +01:00
Christoph Lendenfeld
73f968dbe5 Refactor: keyframing unit tests
This PR changes two things

Move setup/cleanup code into `setUp`/`tearDown`

Change the `_fcurve_paths_match` to raise an error instead of returning a bool.
That makes it easier to see what the actual error is.

Pull Request: https://projects.blender.org/blender/blender/pulls/116816
2024-01-05 13:38:45 +01:00
Christoph Lendenfeld
03a66af318 Anim: Unit tests for "Insert Needed"
Add unit tests for the user preference option "Insert Needed"

Basic tests for objects and bones that check if autokeying in
combination with "Insert Needed" only
* keys all location channels on the first key
* keys only the modified channel on the second key

It is supposed to add only keyframes that have been affected
by the used transform operation.
E.g. translating an object will only add keys on translation keys.

The behavior of keying all property array channels first, and then
only add keys on values that have actually changed may change
in the future. Ideally it would only key actual changes to begin
with. But there is no way to do this right now.

Pull Request: https://projects.blender.org/blender/blender/pulls/116419
2024-01-05 09:52:22 +01:00
29be81ec23 Anim: make RNA property bone_collection.parent writable
Moving a bone collection to another parent is now possible in Python by
assigning to `bone_collection.parent`.

Thanks to Sergey for the implementation.
2024-01-04 15:41:19 +01:00
Brecht Van Lommel
364beee159 Tests: add option to build one binary per GTest file
Bundling many tests in a single binary reduces build time and disk space
usage, but is less convenient for running individual tests command line
as filter flags need to be used.

This adds WITH_TESTS_SINGLE_BINARY to generate one executable file per
source file. Note that enabling this option requires a significant amount
of disk space.

Due to refactoring, the resulting ctest names are a bit different than
before. The number of tests is also a bit different depending if this
option is used, as one uses gtests discovery and the other is organized
purely by filename, which isn't always 1:1.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/114604
2024-01-03 18:35:50 +01:00
65d25ed813 Anim: add bone_collection.bones_recursive property
Add a `bone_collection.bones_recursive` property that returns the set of
bones assigned to that bone collection or any of its child collections.

This property is implemented in Python, as that made it considerably
simpler to create the set semantics.
2024-01-02 16:55:55 +01:00
99d43c9198 Anim: add test for bone_collection.bones
Add Python test for access to `bone_collection.bones`.
2024-01-02 16:55:55 +01:00
bb7468260c Anim: tests, load factory-startup homefile in unit tests
Use `bpy.ops.wm.read_homefile(use_factory_startup=True)` to load the
default 'homefile'. Otherwise Blender will load the saved-as-default file,
which can be quite different from the default startup file.
2024-01-02 16:55:55 +01:00
9f38c6e887 Anim: Add bone_collection.parent accessor to RNA
Add a read-only property `bone_collection.parent` to RNA that returns
the parent bone collection.

This performs two scans of the array (one to find the bone collection's
index, and the other to find the parent index). This might look bad, but
as long as `Object.children` still loops, in Python, over all of
`bpy.data.objects`, this should also be acceptable.
2024-01-02 12:49:04 +01:00
2aac1528f2 Anim: add unit test for armature bone collections
Add a Python unit test that covers some of the armature/bone collections.
Some of these tests cover the same functionality as the C++ tests, albeit
via the Python/RNA API.

Another test was added to check that joining armatures works as expected.
2023-12-29 12:31:38 +01:00
Jeroen Bakker
d37f9e6587 Cleanup: Make format 2023-12-21 10:47:42 +01:00
Christoph Lendenfeld
de61ec3e6f Anim: Unit Tests for "Insert Available"
In preparation to the upcoming refactor of the keying set code,
extend the unit tests with more sophisticated
tests for "Insert Available".

This PR tests
* key available using the preference setting with autokeying on an object and a bone
* key available using the keyingset "Available"

Pull Request: https://projects.blender.org/blender/blender/pulls/116327
2023-12-21 10:22:21 +01:00
Bastien Montagne
25ab53a4af Cleanup: Remove LibOverride Template experimental feature.
This was added at the start of the project, as a way for the source
library to control what would be overridable by the user of the data
(production files).

The implementation never went beyond the experimental area, and only
exposed in the python API then. The idea has been superseeded by the
'cherry-pick' design, so there is no point in keeping this code any
longer.
2023-12-20 17:57:24 +01:00
Lukas Tönne
92cf9dd2f2 ID properties: Support enum values with items
Add support for enum values in ID properties.

This is needed for the "Menu Switch" node implementation (#113445) which
relies on ID properties for the top-level modifier UI.

Enums items can optionally be added to the UI data of integer
properties. Each property stores a full set of the enum items to keep
things simple.

Enum items can be added to properties using the `id_properties_ui`
function in the python API. A detailed example can be found in the
`bl_pyapi_idprop.py` test.

There is currently no support yet for editing enum items through the UI.
This is because the "Edit Property" feature is implemented entirely
through a single operator (`WM_OT_properties_edit`) and its properties.
Buttons to add/remove/move items would be operators changing another
operator's properties. A refactor of the custom properties UI is likely
required to make this work.

Pull Request: https://projects.blender.org/blender/blender/pulls/114362
2023-12-15 10:20:44 +01:00
Jeroen Bakker
c11004579e GPU: Remove the Word OpenGL from Build Scripts
The build scripts are still referring to gpu tests as being opengl.
Although they can also use Metal or Vulkan. This PR only replaces
the work `opengl` with `gpu` for build options.

Special note is that the windows argument `with_opengl_tests` is
also replaced with `with_gpu_tests` for consistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/116030
2023-12-12 16:02:29 +01:00
dupoxy
e67a0b9350 Cleanup: Correct path used in example help text for bl_run_operators_event_simulate.py
It was using tests/python instead of the tests/utils directory where the script is now hosted.

Pull Request: https://projects.blender.org/blender/blender/pulls/113873
2023-11-27 23:42:12 +01:00
Hans Goudey
db17c4bff5 Cleanup: Remove redundant selection comparison from mesh tests
The `unit_test_compare` function already compares selection attributes.
2023-11-27 13:36:20 -05:00
Bastien Montagne
9b08352b21 RNA: Expose ID type identifier in ID structs, add coherence test.
Expose the ID type identifier as defined by the `rna_enum_id_type_items`
enum items as `ID.id_type` in RNA.

Add some test to `id_management` ensuring that all ID types exposed in
`bpy.data` have a valid `id_type` value, i.e. that they have a matching
entry in `rna_enum_id_type_items`.

This will hopefully prevent future cases like #115151 .
2023-11-21 18:54:00 +01:00
Christoph Lendenfeld
09e93ecc23 Anim: Add basic autokey tests
Add basic unit tests for the auto keying system.

Part of #113278

Pull Request: https://projects.blender.org/blender/blender/pulls/115064
2023-11-21 16:08:16 +01:00