Commit Graph

1112 Commits

Author SHA1 Message Date
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
Campbell Barton 65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Sergey Sharybin 3806f3020b Merge branch 'blender-v3.6-release' 2023-06-14 18:11:55 +02:00
Sergey Sharybin fc440c4fa0 Fix monster performance benchmark run on Windows
The scene contains some interesting names, which requires to be
written as utf-8. And on Windows file descriptor is not guaranteed
to be using utf-8. Or, will error out if the invalid utf-8 sequence
is written.

This change makes it so running benchmarks on windows it fully successful.

Pull Request: https://projects.blender.org/blender/blender/pulls/108982
2023-06-14 18:11:22 +02:00
Campbell Barton 49594c37ae License headers: use SPDX-FileCopyrightText for CMake files 2023-06-14 23:36:23 +10:00
Sergey Sharybin 2ad4156f74 Merge branch 'blender-v3.6-release' 2023-06-14 12:41:46 +02:00
Sergey Sharybin 5115afaca2 Rename benchmark to benchmark.py
Windows does not really have an idea of shebangs, and it needs to
go via a file extension to see that the script is to be executed
by Python.

This change simplifies execution from `python3 benchmark ...`
to `benchmark.py ...`.

Pull Request: https://projects.blender.org/blender/blender/pulls/108971
2023-06-14 12:41:24 +02:00
Hans Goudey 7d935f94f3 Cleanup: Grammar: it's vs its 2023-06-13 14:51:49 -04:00
Aras Pranckevicius 23afc6161c IO: remove OBJ and PLY Python add-ons (#104503, #104504)
With C++ based built-in implementations having both more features
and way better performance, it's time to retire the add-ons. Implements
#104503 and #104504.

Pull Request: https://projects.blender.org/blender/blender/pulls/108440
2023-05-30 21:41:26 +02:00
Sergey Sharybin ec7c1a6e0a Add light group tests category to Cycles
Pull Request: https://projects.blender.org/blender/blender/pulls/108424
2023-05-30 14:37:42 +02:00
Bastien Montagne 14fdd92067 Merge branch 'blender-v3.6-release' 2023-05-30 12:21:28 +02:00
Bastien Montagne 80430f6c50 Cleanup: docstrings arguments part.
Docstring argument part needs to be separated from description by an
empty line, otherwise it is not properly recognized by Sphinx.
2023-05-30 11:55:08 +02:00
Campbell Barton 9ff94a79e5 Fix library override test on WIN32
Committed to main but should have been committed to the 3.6 branch.
2023-05-30 12:58:11 +10:00
Campbell Barton 019362bd96 Test: ensure __builtins__ can't workaround secure driver evaluation 2023-05-27 15:44:57 +10:00
Campbell Barton 30c1efad84 Fix library override test on WIN32 2023-05-27 14:57:57 +10:00
Campbell Barton d133d622c1 Merge branch 'blender-v3.6-release' 2023-05-27 13:47:02 +10:00
Campbell Barton aa6414c8c8 Cleanup: format 2023-05-27 13:45:03 +10:00
Bastien Montagne 9c15058d0b Merge branch 'blender-v3.6-release' 2023-05-26 18:53:47 +02:00
Bastien Montagne 4c5998ee0b Unittest: Add very basic 'old file loading' test.
Use existing `lib/tests/libraries_and_linking/library_test_scene.blend`
essentially as 'file loads without error' test. Also does very basic
proxy -> liboverrides conversion check.

This test could be extended a lot, but just opening this file already
allowed to identify three bugs in current 3.6/main code, and an issue in
an upcoming refactor of the readfile code...
2023-05-26 18:43:19 +02:00
Sergey Sharybin ba3f26fac5 Cycles: light and shadow linking
With light linking, lights can be set to affect only specific objects in the
scene. Shadow linking additionally gives control over which objects acts a
shadow blockers for a light.

Usage:
https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Cycles

Implementation:
https://wiki.blender.org/wiki/Source/Render/Cycles/LightLinking

Ref #104972
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
2023-05-24 14:11:47 +02:00
Campbell Barton ac263a9bce PyAPI: remove context override argument from bpy.ops
Remove deprecated context override argument to operator execution and
poll() method in favor of context.temp_override().
2023-05-23 14:34:09 +10:00
Sergey Sharybin 8bca0e1075 Cleanup: Format python after recent changes
Pull Request: https://projects.blender.org/blender/blender/pulls/108086
2023-05-19 18:20:27 +02:00
Sergey Sharybin 8cc22d2809 Workaround Cycles regression test failures
The failure happens since the recent changes in the make_orthonormals.

The only difference is the underwater caustics test file, and the
difference seems to be a noise floor.

There seems to be nothing wrong with the math in the function itself:
the return values are all without quite small epsilon when comparing
Linux with M2 macOS. The thing is: the very first input is already a
bit different on different platforms. So the difference is already
somewhere else.

For now increase the threshold to avoid confusion of the rest of the
team, and to allow builds to be deployed.

Pull Request: https://projects.blender.org/blender/blender/pulls/108080
2023-05-19 16:42:08 +02:00
Campbell Barton 0099f51cdd Cleanup: sort file, uppercase booleans, add missing headers
Also update files to ignore for check_cmake.
2023-05-17 13:13:10 +10:00
Chris Blackbourn 48abc09d84 Cleanup: format 2023-05-05 23:44:56 +12:00
Sergey Sharybin ecb8d7f8ab Tests: Add test for broken EXR files
To make sure non-trivial cases like #106977 are not re-introduced.

Pull Request: https://projects.blender.org/blender/blender/pulls/107643
2023-05-05 11:00:54 +02:00
Campbell Barton 6a5ab77dcc Cleanup: format 2023-05-02 08:41:10 +10:00
Michael B Johnson 3c74575dac Fix #107062: support opacityThreshold when exporting USD
This PR addresses issue “USD export does not respect opacity threshold for clip alpha blend mode #107062”

This commit extends the USD Preview Surface material support to author the opacityThreshold attribute of materials on export, when the Alpha Clip blend mode is selected.

When authoring alpha cutouts in Blender, one sets the Blend Mode to "Alpha Clip", and the Clip Threshold to some value greater than zero.
When this case is detected on export, we now author the opacityThreshold attribute to match the specified clip threshold.

Note that opacityThreshold is already handled correctly on import, so this change allows the feature to be fully round-tripped.

Co-authored-by: Matt McLin <mmclin@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/107149
2023-05-01 17:28:23 +02:00
Campbell Barton d302901ce0 Fix bl_run_operators test running without a window context
While technically valid, a context without a window set can't access
the active object or view layer, causing object mode setting to fail,
making the checks not all that useful.

Use Context.temp_override(..) to set the context's window.
2023-04-30 15:08:27 +10:00
Ankit Meel ed590e9181 macOS/GTests: simplify blender_test library linking
Reverts dcb2821292 but handles
the linker error by relying on target_link_libraries deduplication.

Reverts 18a15bafe8 but handles
blender_test linking after dependency change by passing
lib to target_link_libraries itself.

Closes #107033
2023-04-19 09:05:43 +05:30
Jesse Yurkovich 1bb77d9eae Cleanup: Better logging for imbuf tests
Recent failures requiring investigation have exposed some shortcomings
that this addresses:
- When creating the diff image for offline comparison, use a higher
  threshold to prevent idiff from printing more output which will often
  contradict the primary failure output just above it (very confusing)
- For metadata failures, make sure these get printed so it's obvious
  what kind of failure we're dealing with

Pull Request: https://projects.blender.org/blender/blender/pulls/107058
2023-04-18 03:32:20 +02:00
Campbell Barton e9d4e571d0 Cleanup: use identity comparisons with False 2023-04-14 20:14:06 +10:00
Jesse Yurkovich aa3bdfd76a Image: Use OpenImageIO for loading and saving a variety of image formats
This checkin will use OIIO to replace the image save/load code for BMP,
DDS, DPX, HDR, PNG, TGA, and TIFF.

This simplifies our build environment, reduces binary duplication,
removes large amounts of hard to maintain code, and fixes some bugs
along the way.

It should also help reduce rare differences between Blender and Cycles
which already uses OIIO for most situations. Or potentially makes them
easier to solve once discovered.

This is a continuation of the work for #101413

Pull Request: https://projects.blender.org/blender/blender/pulls/105785
2023-04-12 05:22:26 +02:00
Brecht Van Lommel 1658b8ab46 Fix Cycles Metal failing when run in parallel, always run serial
The command buffer fails to execute, the cause is unknown. It does not
appear to be related to the binary archive cache as disabling that does
not prevent the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/106328
2023-03-30 19:46:49 +02:00
Sergey Sharybin a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
Sergey Sharybin 18a15bafe8 Fix blender_test not re-linked on macOS after changes
The Linux worked due to the libraries provided as a dependency
via `EXTRA_LIBS "${TEST_LIBS}"` with extra whole archive.

While on Windows and macOS the whole-archive is not needed the
dependency from the library to the blender_test is still needed.

Solves the issue when modifying asset_catalog_test.cc on macOS
does not make blender_test to be relinked.

Pull Request: https://projects.blender.org/blender/blender/pulls/106051
2023-03-24 14:11:46 +01:00
Hans Goudey cef82a1d39 Cleanup: Grammar: "it's" vs "its" 2023-03-24 08:34:21 -04:00
Bastien Montagne a2600e0a76 Merge branch 'blender-v3.5-release' 2023-03-20 15:30:14 +01:00
Bastien Montagne a60f651502 Address #105786: How to handle linked data with 'fake user' set.
133dde41bb changed how 'fake user' flag is handled with linked data.

Previous behavior was a bug/inconsistency, in that the 'directly linked'
tag would be 'over-set' and never cleared, forcing saving references to
a lot of unused linked data.
Note that ideally, 'Fake user' flag should be ignored, and the only way
to decide whether to keep or not a linked ID should be whether it's
actually used by some local data.

However, #103867 and #105687 show that this is causing issues in some cases,
where users wrongly relied on the linked data's pre-defined 'Fake user' flag
to keep their linked data in their production files, even if said data had no
real user.

While not ideal, for now we should consider 'fake user' flag for linked data
as a real usage case. A better handling of this edge-case is related to
wider designs aboud handling of 'non used' data on file save, whether
linked IDs should keep track of being explicitly or implicitly linked by
the user, etc.
2023-03-20 15:29:24 +01:00
Hans Goudey 45c4a0b1ef Merge branch 'blender-v3.5-release' 2023-03-18 19:57:58 -04:00