Commit Graph

1090 Commits

Author SHA1 Message Date
Alaska
ea7d07098b Tests: Disable --cycles-device arguments on non-Cycles tests
This commit reworks the RenderReport base class to avoid adding
`--cycles-device` device arguments to non Cycles tests.

This reduces some warnings that can show up with EEVEE and
Workbench tests that accidentally used these arguments.

Pull Request: https://projects.blender.org/blender/blender/pulls/133724
2025-01-30 04:15:27 +01:00
Sean Kim
aee2add84a Tests: Error on no test files being found for render_report.py
This commit checks the total number of files being processed for
rendering tests and causes it to emit a failure if none are found. This
has the benefit of loudly failing if there is a configuration error
instead of succeeding.

Pull Request: https://projects.blender.org/blender/blender/pulls/133691
2025-01-29 23:53:31 +01:00
Jesse Yurkovich
7f5965716d USD: Add additional test for scene instancing Import
This pairs with the recently added Export test and reuses the same
.blend file. While there happens to be an instancing related rendering
test, that happens to cover Import, it's better to have a direct test
for it.

Future improvements to both Export and Import to account for the recent
"hidden layer" visibility bug would be good to do as a follow-up.

Pull Request: https://projects.blender.org/blender/blender/pulls/133782
2025-01-29 23:15:39 +01:00
Howard Trickey
b2998848c5 Fix #109765 - Prevent Dissolve Edges from dissolving verts...
that are unrelated to the selected edge,
See https://projects.blender.org/blender/blender/issues/109765 .
This comes from PR https://projects.blender.org/blender/blender/pulls/131645
by jcwenger.
2025-01-29 16:26:46 -05:00
Jesse Yurkovich
a6ad8f4fd9 Cleanup: USD: Pass struct by ref and add more tests for scaling options
- There's only a few unit conversion options, just test all of them
- Use reference instead of pointer when passing export settings struct
- Organize scaling struct fields to keep similar options together

Pull Request: https://projects.blender.org/blender/blender/pulls/133774
2025-01-29 20:03:36 +01:00
Michael Kowalski
319c64205d USD: Scene graph instancing export
Refactored USD instancing export to support instanceable references.

With this change, it's now possible to instance object hierarchies and
geometry types other than meshes (e.g., curves, point clouds, etc.).

No longer marking mesh prims as instances in
USDGenericMeshWriter::write_mesh().

USDTransformWriter::do_write() now marks the Xform as instanceable
with a reference to the prototype's Xform when the Blender object is
an instance.

In USDAbstractWriter::mark_as_instance() the target prim is now marked
as instanceable.

Added AbstractHierarchyIterator virtual functions include_data_writers()
and include_child_writers() to allow pruning children of instanceable Xforms
in AbstractHierarchyIterator::make_writers(). These functions return true
in the base class implementation, so that the iterator behavior for Alembic
exports is unaffected.  In the USDHierarchyIterator subclass, these functions
are overridden to return false if instancing is enabled and the objects are
instances.

Added virtual function AbstractHierarchyIterator::should_determine_duplication_references()
which returns true if duplication references should be resolved for children
of a given context.  This function is overridden in USDHierarchyIterator to
skip processing children of instances, which is more efficient for USD export,
since children of instances are pruned during traversal for writing.  For nested
instances where the original prototype is not included in the export, this also
avoids designating a duplicated object parented to an instance as "the original",
which would cause USD errors since defining a prim under an instance
proxy is not allowed.

Extended logic in `AbstractHierarchyIterator::determine_duplication_references()`
to identify prototypes.

Added new function `HierarchyContext::is_prototype()`.

Disallowing merging with parent for instances and prototypes, since
the Xforms cannot be discarded in those cases.

Extended `USDWriterAbstract::ensure_usd_material()` with special logic
to ensure materials for prototype prims are defined in the subtree of the
prototype.  This helps ensure the hierarchical encapsulation requirement
for prototypes and is required by certain renderers (e.g., Houdini's Karma)
for instance materials to render.

Added a new `process_scene_graph_instances()` function to ensure
prototypes are exported as abstract prims.

Added python tests test_export_native_instancing_true and
test_export_native_instancing_false.

Pull Request: https://projects.blender.org/blender/blender/pulls/131707
2025-01-28 15:51:56 +01:00
Aras Pranckevicius
f5c2aecd8b Tests: emit more information in import tests templates
- Bone matrices,
- Material viewport settings (colors, backfaces etc.)
- Improved handling of relative paths of material images

Pull Request: https://projects.blender.org/blender/blender/pulls/133658
2025-01-27 18:19:04 +01:00
Sybren A. Stüvel
dd67b355ee Anim: do not set slot ID type when Action is linked
When an action slot does not have an ID type, and it is assigned to some
ID, the slot is bound to that ID's type. This now no longer happens when
the Action is linked, because linked data should not be modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/133670
2025-01-27 17:51:23 +01:00
Hans Goudey
e05a1871db Fix #133551: Crash accessing scene.tool_settings.uv_sculpt
After e3894f0a07, the UV sculpt
struct doesn't inherit from Paint anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/133655
2025-01-27 14:51:22 +01:00
Jesse Yurkovich
d4c2d73864 USD: Add test coverage for parent-child transforms during animation
Makes use of recently added test data to ensure proper handling of child
objects, with animated transform constraints, parented to other objects
who also have animated transform constraints.

Also uses the `colored_print` module to better segment the test output.

Pull Request: https://projects.blender.org/blender/blender/pulls/133600
2025-01-26 04:43:16 +01:00
Alaska
d2930e6285 Cycles Tests: Enable Principled BSDF OSL tests
The Principled BSDF tests were previously disabled when testing
with OSL as there was a noticeable difference in noise between SVM
and OSL when mixing/layering materials.

This commit enables the Principled BSDF OSL tests, but with a increased
threshold for failure so we can test for major regressions with the
Principled BSDF OSL implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/133530
2025-01-25 01:57:03 +01:00
Bastien Montagne
a3d9bdad6b Tests: Add simple script accessing (almost) all RNA properties.
Only runs on factory startup file, so not all possible paths are
covered. But should reduce likeliness of issues like #133551 in the
future.
2025-01-24 18:35:31 +01:00
Aras Pranckevicius
342235616a Tests: emit more details in import test .txt templates
- Animation keyframes now contain left/right handle information
- More fcurves are emitted
- Material textures emit whether their colorspace is "data"
- More files in fbx test coverage

Pull Request: https://projects.blender.org/blender/blender/pulls/133526
2025-01-24 10:24:33 +01:00
Alaska
ddd83226b8 Cycles tests: Remove outdated comment
There was a comment in the Cycles test suite blocklist about UDIM
textures rendering incorrectly. 

This has since been fixed (1) so remove the comment from the blocklist.

(1) 82cc0a3eff
2025-01-24 08:28:48 +01:00
Falk David
b9f253564e VSE: Python API: Deprecate sequence properties and replace with new ones
This PR adds new RNA properties that deprecate and replace any `sequence` property.
The old prooperties are still there and fully functional, but the description is changed
to indicate that these will be removed in the future and that the new properties should
be used instead.

| Deprecated property | Replacement property |
| --------------------------------- | ----------------------------------- |
| `context.active_sequence_strip` | `context.active_strip` |
| `context.selected_editable_sequences` | `context.selected_editable_strips` |
| `context.selected_sequences` | `context.selected_strips` |
| `context.sequences` | `context.strips` |
| `SequenceEditor.sequences` | `SequenceEditor.strips` |
| `SequenceEditor.sequences_all` |  `SequenceEditor.strips_all` |
| `MetaStrip.sequences` | `MetaStrip.strips` |

Previously, rna paths for animation data on strips started with `sequence_editor.sequences`.
This PRadds versioning for the rna paths to make sure to use
the new naming scheme. This does mean that in previous versions of blender,
the animations don't show but the data is not lost (even if the file is saved in the older version).

Also do some cleanup of existing python scripts inside the source to use the
new properties.

Part of #132963.

Pull Request: https://projects.blender.org/blender/blender/pulls/133156
2025-01-21 11:30:20 +01:00
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
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
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
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
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
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
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
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
Aaron Carlisle
1bcc01519a Cleanup: Spelling: "Explicitly" 2025-01-03 22:35:05 -05: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
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
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
Omar Emara
d764fd7200 Compositor: Disable anisotropic filtering tests on GPU
This patch disables compositor tests that rely on anisotropic filtering
for GPU testing. This is done until we make sure they pass universally
by not relying on hardware filtering.

Test files that rely on anisotropic filtering were moved to their own
tests to be able to disable them for GPU only.
2024-12-19 17:44:10 +02:00
Omar Emara
2a53debc73 Cleanup: Rename COMPOSITOR_REALTIME to GPU_COMPOSITOR
Pull Request: https://projects.blender.org/blender/blender/pulls/132118
2024-12-19 14:39:55 +01:00
Omar Emara
ae6ee3398d Cleanup: Make format 2024-12-19 15:12:38 +02:00
Omar Emara
b4230d84dc Compositor: Unify references between CPU and GPU tests
This patch removes the references for the GPU tests and uses the CPU
references for both CPU and GPU, since they are expected to match. This
also unifies the tests scripts into a single script with an argument
for execution device.
2024-12-19 14:35:20 +02:00
YimingWu
6191bc4f22 Object: Conversion of Font/Legacy curves to Curves and Grease Pencil
This patch implements Font to Curves, Legacy curves to Grease Pencil and
Font to Grease Pencil conversions.

Note that Font to Grease Pencil is done by converting Font to Curves
then converting Curves to Grease Pencil. Currently we do not have
direct conversion APIs.

Part of #131595 and #130518

Pull Request: https://projects.blender.org/blender/blender/pulls/131612
2024-12-18 15:38:55 +01:00
Jesse Yurkovich
1a01275aa9 Hydra: Update tests to allow bots to pass
Contains the following changes:
- Uses new `render_layer` images in test repo
- Excludes known broken tests with Hydra Storm from USD 24.05
  - packed float and packed half images show corruption
  - USD export doesn't support the current light-tree .blend
- Bump the `image_colorspace` and `image_mapping` thresholds to
  account for image filtering differences from OS/drivers

Pull Request: https://projects.blender.org/blender/blender/pulls/132044
2024-12-18 05:22:01 +01:00
Jeroen Bakker
28ea90f127 GPU: Split GPU backend and Draw manager unit tests
Both the draw manager and gpu backend used the same compilation
directive for enablement. This PR seperates them into
`WITH_GPU_DRAW_TESTS` for draw manager related tests and
`WITH_GPU_BACKEND_TESTS` for gpu backend related tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/132018
2024-12-17 13:28:21 +01:00