Commit Graph

1991 Commits

Author SHA1 Message Date
Bastien Montagne
d251f8af30 Tests: Add 'with ASAN' knowledge to Linux release checks.
Builds with sanitizer will get addition asan/ubsan libraries linked in,
these need to be allowed in the static binaries check.

Pull Request: https://projects.blender.org/blender/blender/pulls/133319
2025-01-21 09:40:50 +01:00
Campbell Barton
18783c5699 Cleanup: correct RST syntax, spelling & adjust quotes 2025-01-21 16:51:40 +11:00
Alaska
b9ebd96539 Fix #133229: Remove camera size optimization from SSS shader in Cycles
In Cycles, the subsurface scattering shader will switch to a
diffuse shader under a few different conditions to improve performance
and reduce noise.

This commit removes the "switch back to diffuse if the scattering
radius is less than a quarter of a pixel" optimization because in some
scenes, this can result in noticable lines as the shader transitions
between subsurface scattering and diffuse.

Pull Request: https://projects.blender.org/blender/blender/pulls/133245
2025-01-21 04:31:43 +01:00
Bastien Montagne
2d7068a0d3 Add file_path_map function to bpy.data.
Similar to `bpy.data.user_map`, it returns a mapping of IDs to all the
filepaths they use.

Fairly basic still, may need to be refined with more options to
control which filepaths are included etc.

Mainly intended to make handling of a production blendfile dependencies
more easy.

Also adds some basic testing of the new feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/127252
2025-01-20 17:39:25 +01:00
Nathan Vegdahl
9f2ab9cba0 Anim: rename RNA Slot.id_root to Slot.target_id_type
The name `id_root` was not descriptive, and was just a hold-over from the
equivalent (now deprecated) property on the Action itself.  `target_id_type`
is more clear, reflecting that this is the type of ID the Slot is intended
to animate.

This PR also renames the corresponding `id_root_icon` to
`target_id_type_icon`.

Note that this PR updates the GLTF import/export core addon to adhere to
these name changes as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/133164
2025-01-20 15:24:08 +01:00
Alaska
786a601cc8 Tests: Enable OptiX OSL window test
The window coordinate test was on the block list due to the
world shader rendering it incorrectly.

This has since been fixed, so this test can be removed from the
blocklist.

Ref: blender/blender#123012
Ref: blender/blender@4f0aef1fde
2025-01-20 05:06:13 +01:00
Alaska
f85ff21ed0 Tests: Add render tests for texture nodes
Enable render tests in the `texture` folder.

Ref #123012
2025-01-19 00:52:22 +01:00
Bastien Montagne
b802c328b5 Refactor: Tests: bl_blendfile: Use unittest module instead of asserts.
Pull Request: https://projects.blender.org/blender/blender/pulls/133217
2025-01-17 21:05:39 +01:00
Brecht Van Lommel
a6b293daac Python Module: Bundle VFX library python bindings
When calling bpy.utils.expose_bundled_modules(), these modules are
added to sys.path.

This provides a solution/workaround to two problems:
* Using bpy together with packages like usd-core is problematic. Besides
  crashing due to C++ symbol conflicts, it's just impossible to import
  different versions of the same module, or to have distinct environment
  variables for both. (#127132)
* Blender add-ons using these VFX modules do not currently work with
  the bpy module.

This adds about 15MB to the bpy package.

Pull Request: https://projects.blender.org/blender/blender/pulls/133082
2025-01-17 10:13:31 +01:00
Brecht Van Lommel
ae6b47f346 MaterialX: Support linking color directly to surface shader
Matching Cycles and EEVEE.

Also changes some Color4 to Color3, since shader nodes don't use this alpha.

Pull Request: https://projects.blender.org/blender/blender/pulls/132907
2025-01-17 10:09:18 +01:00
Jesse Yurkovich
1ceaaeeff7 USD: Write extents out for Curves and more consistently for other types
Cleanup and enhance our export of the USD `extent` attribute.

This does the following:
- The existing `author_extents` function now uses recently added common
  code to write out the extents attribute
- A new `author_extents` overload allows the use of Blender's native
  bounds for the types that support it. We now use this rather than
  asking USD to recompute it for us.
- Meshes will now have their extents correctly written during animations
- Curves will now have their extents written as they were not doing so
  prior to this PR
- Hair, Lights, Points, and Volumes make use of the `author_extents`
  functions now

Since Curves need their extents tested, this PR also moves the test from
C++ to Python. Python tests allow for faster iteration, are more
straightforward to write, and allow usage of the USD validator.

Pull Request: https://projects.blender.org/blender/blender/pulls/132531
2025-01-17 03:28:13 +01:00
Alaska
7a4d0ab9fa Tests: Add a Cycles render test for the sample subset feature
This test consists of 4 lights in a scene with the light tree disabled.
This means a sample count that's a multiple of 4 must be used to get a
relatively clean result.

The maximum sample count is set to 4, with the sample subset option
turned on. The subset offset is set to 2 to test the offset,
and a length of 4, which will be internally clamped to 2.
The length of 4 was chosen to test the sample subset length clamping.

Ref: blender/blender-test-data!43
Ref: blender/blender@f09fd9bdef
2025-01-16 06:22:48 +01:00
Jesse Yurkovich
49ae7ffc9c USD: Support additional animated Basis Curves data during import/export
Export
Like we do for Mesh and PointCloud, export any "velocity" attribute on
the Point domain as native USD "velocities". While testing, a few
additional blender-internal attributes were discovered being exported
which are now excluded during export.

Import
Add the cache modifier as appropriate when we detect that UsdBasisCurve
data is animated. This includes time-varying positions, widths,
velocities, and general attribute values. Before this PR, only the
positions were considered. And like Export, the native USD "velocities"
attribute is now processed.

Adds test coverage as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/133027
2025-01-15 23:29:42 +01:00
Bastien Montagne
7fb3179c1f Add tests for bpy.data.user_map.
These are based on data generated for liblink tests, so part of this
code is also refactored to move data generation into `bl_blendfile_utils.py`.

NOTE: Work done also to add tests to upcoming filepath mapping utils
(see !127252).

Pull Request: https://projects.blender.org/blender/blender/pulls/133110
2025-01-15 18:13:32 +01:00
Aras Pranckevicius
1ad083dabf Tests: Add FBX import tests, switch OBJ/PLY/STL import tests to the same machinery
"Expected textual data output" comparison based tests for FBX,
OBJ, PLY, STL import.

- There's a tests/python/modules/io_report.py that can produce
  a "fairly short text description of the scene" (meshes, objects,
  curves, cameras, lights, materials, armatures, actions, images).
  About each object, it lists some basic information (e.g. number
  of vertices in the mesh), plus a small slice of "data" (e.g.
  first few values of each mesh attribute).
    - Custom import parameters, if needed, can be provided by
      having a sidecar .json file next to imported file (same
      basename, json extension), that would have a single json
      object with custom arguments.
- Add FBX test coverage, with 46 fairly small files (total size 3.8MB)
  covering various possible cases (meshes, animations, materials,
  hierarchies, cameras, etc. etc.).
- Switch OBJ/PLY/STL import tests to the above machinery, remove C++
  testing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/132624
2025-01-15 05:52:15 +01:00
YimingWu
9d509de52a Grease Pencil: Convert from mesh to Grease Pencil
Convert mesh objects to grease pencil, optionally preserve mesh faces as
filled shapes, and convert crease edges into strokes. Following options
are available:

- Whether to convert faces to filled strokes.
- Stroke thickness.
- Stroke offset (Using normal direction to lift strokes out of mesh
  surfaces).

Note that "Crease Angle" option from legacy grease pencil is not ported
to this implementation. This option is deemed more suitable for using
geometry nodes to achieve.

Resolves #126480

Pull Request: https://projects.blender.org/blender/blender/pulls/131854
2025-01-14 08:28:52 +01:00
Alaska
2703bbe147 Tests: Add a render test for a complex scene that can sometimes have missing shadows
While testing the RX 5700XT with HIP on Linux, I noticed that under
specific conditions, shadows would not render properly. The specific
conditions being a combination of:
- Curve rendering
- Subsurface Scattering
- Custom mesh light shaders
- Specific GPU and HIP compiler combinations

This specific combination was not present in the render test suite.
This commit adds a heavily simplified verion of a file that is affected
(Cosmos Laundromat demo) to the test suite to test for this specific
issue.

Ref: blender/blender-test-data!41
2025-01-11 04:31:09 +01:00
Alaska
5985f04a88 Tests: Add a render test for triangle light sampling
The Cycles render engine switches between two triangle light sampling
methods depending on the distance to the triangle, and the size of the
triangle.

In a earlier version of Blender, one of the sampling methods was broken
during a refactor. This commit adds a test scene that clearly shows off
both sampling systems so if it breaks again, it will easily
and clearly be shown in the test results.

References:
Original bug report: blender/blender#117771
Fix commit: blender/blender@583af2a6e5
Test repository PR: blender/blender-test-data!42
2025-01-11 04:27:42 +01:00
Jesse Yurkovich
75f3fab268 USD: Add test for the export_texture_mode option
Add tests covering the PRESERVE and KEEP export_texture_mode options.

Pull Request: https://projects.blender.org/blender/blender/pulls/132885
2025-01-10 06:34:27 +01:00
Alaska
9f6d605743 Tests: Add render tests for a few missing simple shader tests
There are a few simple shader nodes that were missing test files.
This commit adds tests for those nodes:
- Camera data
- Fresnel
- Layer weight
- Hue/Saturation/Value
- Invert
- Normal
- Wavelength

Ref: blender/blender-test-data!39
2025-01-10 02:44:13 +01:00
Sean Kim
e2d6517109 Sculpt: Allow running performance test in 4.3 releases
Unfortunately, the tests as they are right now will likely not work with
4.2 and previous versions, as the brush asset changes will need to be
accounted for.

Pull Request: https://projects.blender.org/blender/blender/pulls/132827
2025-01-09 19:27:20 +01:00
Bastien Montagne
4032b853c3 RNA: Add basic tests for the path_from_id() function.
Simply load factory startup file, and recursively iterate over
all (valid) `POINTER` and `COLLECTION` properties of all IDs.

NOTE: A few cases are currently returning invalid rna paths (at least
from quick look), these are skipped for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/132809
2025-01-09 16:46:37 +01:00
Alaska
2874da3f25 Tests: Add Cycles test for baking from selected object
This scene consists of two spheres (shade flat and shade smooth)
having their normals baked onto a plane using the "Bake from selected"
option.

Ref: blender/blender#132716
Ref: blender/blender-test-data!37
2025-01-09 13:38:51 +01:00
Sean Kim
a3f523fd61 Sculpt: Add multires version of current performance benchmarks
This commit modifies the `performance/api/sculpt.py` test to add a new
set of tests that run with the multires modifier present. New tests
have `multires_` prepended to the brush name to group them separately
from the existing mesh tests.

Part of #130772

Pull Request: https://projects.blender.org/blender/blender/pulls/132822
2025-01-08 21:32:57 +01:00
Sean Kim
56128cdf9a Cleanup: Add developer docs link in benchmark.py for more information
Pull Request: https://projects.blender.org/blender/blender/pulls/132814
2025-01-08 20:35:51 +01:00
Alaska
7a5c46194a Tests: Update Texture coordinate tests so they produce more useful hydra results
The hydra render engine can not render a colour connected directly
to a material output. This was used a lot in the texture coordinate
tests, and as such these tests produced blank results.

This commit adds a emission shader between the colour and the output
so hydra can produce more useful results.

There is no change in the output for Cycles and EEVEE, so those
reference images are not updated.
2025-01-08 10:54:57 +01:00
Aras Pranckevicius
5ef08c2a96 Fix #112586: VSE can't use multi-layer EXR images
The rest of blender does handle multi-layer EXR images, using the
"combined" or RGBA/RGB layers when the visual result is needed. Make
VSE do the same.

While fixing this, I found several issues in other not well tested code
and had to fix them:

- IMB_buffer_float_from_float_threaded was wrongly using source channels
  as destination channels, producing garbage result.
- IMB_scale_into_new was not assigning channels to destination image.

Pull Request: https://projects.blender.org/blender/blender/pulls/132790
2025-01-08 10:45:24 +01:00
Sybren A. Stüvel
63adbb19fb Anim: Always name the slot "Legacy Slot" when versioning legacy Actions
When creating Action Slots for legacy Actions, always name those slots
"Legacy Slot". Before this commit, the slot was named after the ID that
is animated by the Action; this matches what Blender will do when
animating that ID from scratch.

The old versioning behaviour caused issues when dealing with legacy
Actions: if there are multiple Actions in a file (for example multiple
run cycle animations) and only one of those was assigned to the
character (the rest has a fake user), Blender would only name that one
action slot after the character. The "fake user" Actions would just be
get a slot named "Slot".

This causes issues when toggling between the different Actions, as
Blender will not automatically assign a slot when switching from the
character- named one to the "Slot" one.

Ref: #129563, #130261

Pull Request: https://projects.blender.org/blender/blender/pulls/131425
2025-01-07 15:34:53 +01:00
Omar Emara
a2fffd8852 Compositor: Update tests for Glare node
Update tests references for Glare node for changes in the commit
004e3d39fa.
2025-01-07 12:56:57 +02:00
Sybren A. Stüvel
c6d6efaaa2 Fix #132606: ActionSlots can be created with too long names
The max length of the RNA property `ActionSlot.identifier` was set
incorrectly. The setter code did manage the length properly, but the
getter was checking agains that incorrect max length, and rightfully
complained.

Pull Request: https://projects.blender.org/blender/blender/pulls/132691
2025-01-06 13:55:07 +01:00
Omar Emara
b3623feab2 Compositor: Support node integer sockets
This patch adds support for using integer sockets in compositor nodes.
This involves updating the Result class, node tree compiler, implicit
conversion operation, multi-function procedure operation, shader
operation, and some operations that supports multiple types.

Shader operation internally treats integers as floats, doing conversion
to and from int when reading and writing. That's because the GPUMaterial
compiler doesn't support integers. This is also the same workaround used
by the shader system. Though the GPU module are eyeing adding support
for integers, so we will update the code once they do that.

Domain realization is not yet supported for integer types, but this is
an internal limitation so far, as we do not plan to add nodes that
outputs integers soon. We are not yet sure how realization should happen
with regards to interpolation and we do not have base functions to
sample integer images, that's why I decided to delay its implementation
when it is actually needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132599
2025-01-06 10:09:26 +01:00
Campbell Barton
4f1817cc18 Cleanup: declare __all__ for Python scripts
Declare all to make public public API's explicit and
help detect unused code.
2025-01-06 16:45:36 +11:00
Campbell Barton
bea3b41fc2 Cleanup: remove disabled IO tests
These have been disabled for years, in general checking the checksum on
exported files is too fragile and isn't a practical way to test IO.
2025-01-06 12:43:14 +11:00
Campbell Barton
c5203ef7fd Cleanup: use context-manager for opening files 2025-01-04 22:26:18 +11:00
Alaska
9aa385174c Tests: Add render tests for sphere lights in volume
In a recent version of Blender, Cycles and EEVEE gained support for
true sphere lights.

This commit adds tests for these sphere lights inside of volumes.

Ref: blender/blender#123012
Ref: blender/blender-test-data!32
2025-01-04 12:18:19 +01:00
Aaron Carlisle
1bcc01519a Cleanup: Spelling: "Explicitly" 2025-01-03 22:35:05 -05:00
Alaska
38ce90da59 Tests: Add more transparent shadow bounce render tests
Test more combinations of rendering transparent shadows with different
bounce limits.

Ref:
blender/blender#123012
blender/blender#125093
2025-01-04 04:02:26 +01:00
Brecht Van Lommel
d0c2e68e5f Refactor: Cycles: Automated clang-tidy fixups in Cycles
* Use .empty() and .data()
* Use nullptr instead of 0
* No else after return
* Simple class member initialization
* Add override for virtual methods
* Include C++ instead of C headers
* Remove some unused includes
* Use default constructors
* Always use braces
* Consistent names in definition and declaration
* Change typedef to using

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:55 +01:00
Alaska
7d5ec0c441 Tests: Add Texture coordinate render tests for common mesh configurations
This commit adds render tests for the outputs of the
texture coordinate node tested on:
- A scaled and rotated mesh
- A instanced scaled and rotated mesh
- A mesh with and without smooth shading
- A mesh with a volumetric shader
- The world background chader

And a few extra objects for specific outputs. Examples including:
- A deformed mesh for the `Generated` output
- View meshes through a reflection for view dependent outputs
- Instanced meshes using the old instancing system to test the
"from instancer" option with the UV and Generated outputs
- Additional objects with extra UV maps to ensure the correct UV map
is loaded
- And more

There are other aspects that we would ideally test
(E.g. Point clouds and hair), but these will be handled by a
separate commit and set of tests.

Ref blender/blender-test-data!30

Pull Request: https://projects.blender.org/blender/blender/pulls/132512
2025-01-03 05:38:17 +01:00
Campbell Barton
33e38c605f Cleanup: correct indentation for CMake files, strip trailing space 2025-01-03 13:23:38 +11:00
Charles Wardlaw
0c544974d1 USD: option to convert the scene's meters per unit value
This rescales the whole scene by its root transform to match the same
visual size while not forcing the user to wait for scale to be applied to
each object.

This is requested by studios whose main applications / USD scenes are
in CM, because referencing and payloading scenes from disparate scales
can cause issues at resolution time.

If "Apply Unit Scale Conversion" is unchecked on import, the user now
has the ability to bring the objects in with a scale factor of 1.0, so that the
objects may be edited as if Blender's scene units matches the imported
stage's.

At export time, a "Stage Meters Per Unit" value can be chosen from a list
of common measurements, as well as setting a custom value.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/122804
2025-01-02 22:04:58 +01:00
Christoph Lendenfeld
2d1fc1bcdd Fix #132195: Unable to key mesh attributes
The issue is that certain RNA paths cannot be generated to come
from an ID and `RNA_path_from_ID_to_property` will return no value.
We are using that function in the keyframing code to allow passing
in a pointer to a bone and a path relative to that bone.
Since there is currently no good way to find the path from the ID to an arbitrary
struct pointer (see #122427), this patch is a workaround that uses
the struct_pointer IF that happens to be an ID pointer.
Of course that still has the core limitation in place but until a
better solution is available on the RNA side this is the best we can do.

Pull Request: https://projects.blender.org/blender/blender/pulls/132552
2025-01-02 16:39:21 +01:00
Sergey Sharybin
ba4c79feee Fix: Huang hair sampling does not advance LCG
The reason for this probably was the const nature of the shader data.
However, this is something counter-intuitive, as it potentially leads
to multiple BSDFs re-using the same LCG state.

Pull Request: https://projects.blender.org/blender/blender/pulls/132456
2024-12-31 10:25:19 +01:00
Alaska
dd5a1522b7 Tests: Speed up volume render tests
In a previous commit I accidentally added a test that had
these properties:
- High resolution (512x512)
- High sample count (512)
- Had high quality denoising enabled

By reducing the resolution to 128x128 and sample count to 32
and disabling denoising, the test will hopefully be 256x faster.
2024-12-28 06:27:46 +01:00
Aras Pranckevicius
95233ecf65 Tests: cover more VSE blend effects
Alpha Under, Over Drop, Add, Multiply
2024-12-27 20:26:49 +02:00
Bastien Montagne
2c9ab53273 Add 'system python' validation for some py scripts.
The goal of this test is to try to import some critical py scripts with the
system python of the building machine.
The main target is to ensure that these py scripts remain usable by all
buildbot machines, as some of them are using fairly outdated python
versions.

Current status:
* Scripts in `build_files` and `docs` are checked.
* Some python scripts in `build_files` were 'reverted' to be compatible
  with older required python version currently (3.6).
* A few scripts are excluded from the test, mostly because they use Blender's
  `bpy` module, which means they are only intended to be ran with Blender's
  python anyway.
* The test is only enabled for Linux buildbots currently, as they use the
  oldest Python by far.

Notes:
* Some more scripts are likely to be moved around in the future.
* Whether these tests need to be enabled on windows or macos platforms remains
  an open question.

Pull Request: https://projects.blender.org/blender/blender/pulls/130746
2024-12-24 11:55:29 +01:00
Bastien Montagne
2040b8e864 Re-enable big endian versioning tests for MacOS.
As can be seen in https://builder.blender.org/admin/#/builders/134/builds/8983 and https://builder.blender.org/admin/#/builders/135/builds/8835, MacOS buildbots ran these tests 101 times without any issue. b0eeae782eba7f5 can be used to do that test again locally if needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132273
2024-12-24 11:54:54 +01:00
Omar Emara
00ee917fdf Fix #129319: Movie Distortion node is cropped
The Movie Distortion node output is cropped to the bounds of the
original input. This patch fixes that by extending the bounds depending
on how the distortion extends the image bounds.
2024-12-23 11:25:05 +02:00
Jesse Yurkovich
9ebb73070d USD: Enable 'quatf' Primvar types during Import
Importing USD `quatf` types was erroneously left disabled after recent
work this past summer for better attribute support. It is already
correctly enabled and validated for Export.

The `half` and `double` variants must still be skipped for now though.

Pull Request: https://projects.blender.org/blender/blender/pulls/132252
2024-12-22 23:02:41 +01:00
Jesse Yurkovich
175ad18368 USD: Import subdivision edge creases and UV/Boundary smoothing options
Import edge crease values and properly configure any added subdivision
modifiers with correct UV and boundary settings. These were already
exported so this now completes our subdivision support.

Pull Request: https://projects.blender.org/blender/blender/pulls/131569
2024-12-20 01:31:31 +01:00