Commit Graph

1104 Commits

Author SHA1 Message Date
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
Michael B Johnson 73509d1bc1 Fix #105327: USD import fails to recognize UV map varname
Follow connections when reading the varname attribute of a primvar
reader, and support both string and TfToken types for the varname.

A unit test is also provided.

Authored by Apple: Matt McLin

Pull Request: https://projects.blender.org/blender/blender/pulls/105508
2023-03-18 00:05:39 +01:00
Campbell Barton ce34024681 Merge branch 'blender-v3.5-release' 2023-03-14 16:09:44 +11:00
Campbell Barton 51e5417bd3 Fix #105678: Crash assigning Image.pixels to an undersized sequence
Now only dynamic function parameters that use ParameterDynAlloc support
dynamically sized parameters arrays.

Add tests for both dynamic arrays that don't support resizing
(Image.pixels) and dynamic sized arguments using
(VertexGroup.add(index=[..])).

Regression in [0] which extended support for dynamic sized function
arguments.

[0]: dfb8c5974e
2023-03-14 16:00:24 +11:00
Campbell Barton b4eef99973 Cleanup: use C-style code comments, format 2023-03-03 16:29:22 +11:00
Bastien Montagne ff6ce25926 Add a basic support to BKE library linking code to generate liboverrides.
This commit adds the ability to generate liboverrides of linked data at
the `BKE_blendfile_link_append` BKE level, and through the Python API
(the `BPY_library_load` context manager, aka `bpy.data.libraries.load`).

The python API was updated essentially to allow easy testing of the new
code. This commit also adds tests for the new 'override' behavior, and
for existing basic link one.

Current code only generates 'basic' overrides, without any handing of
hierarchies or dependencies, as for brush assets only the Brush ID needs
to be overridden.

That new feature does not aim at being exposed to user through the
link/append operations in its current state, as it is way too simplistic.

This change is a requirement for the Brush Asset project (#101908).

Pull Request #104746
2023-03-02 17:22:42 +01:00
Campbell Barton e1ab9e352c Cleanup: autopep8 2023-03-01 22:12:18 +11:00
Campbell Barton bd0aa88909 Fix invalid path references after moving tools & scripts 2023-03-01 22:00:46 +11:00
Campbell Barton e65671c1ed Merge branch 'blender-v3.5-release' 2023-03-01 11:21:02 +11:00