Avoid running a Python unit test for layered Actions in non-experimental
builds.
Due to a misunderstanding, enabling the user preference for the 'Slotted
Actions' experimental feature is still possible on release builds, which
caused this test to fail on non-experimental builds (because it's
intentionally missing a chunk of experimental code).
No functional changes to Blender itself.
Pull Request: https://projects.blender.org/blender/blender/pulls/128483
Add support for `rna_struct.keyframe_insert(…, group="name")` parameter,
when inserting keys into a layered Action.
This simply was never implemented, and the default channel group name
was always used.
Pull Request: https://projects.blender.org/blender/blender/pulls/128383
Clean up a keyframe insertion unit test I just committed, as it had some
commented-out code that shouldn't have been commented out. The test
logic could also be simplified, as the complexity was necessary for
replaying the broken test case, but not necessary for testing the actual
underlying behaviour.
No functional changes.
Ref: 2dba943341ce7a7706c3865b4b7b1cfc5d6bb746
Pull Request: https://projects.blender.org/blender/blender/pulls/128379
BaseException was used as a catch-all in situations where it
didn't make sense and where "Exception" is more appropriate
based on Python's documentation & error checking tools,
`pylint` warns `broad-exception-caught` for e.g.
BaseException includes SystemExit, KeyboardInterrupt & GeneratorExit,
so unless the intention is to catch calls to `sys.exit(..)`,
breaking a out of a loop using Ctrl-C or generator-exit,
then it shouldn't be used.
Even then, it's preferable to catch those exceptions explicitly.
Calling `action.fcurves.clear()` would clear the F-Curves, but didn't
update the F-Curve groups. This meant that the groups data still had their
original length & offsets into the F-Curves array, causing subsequent
F-Curve creation to crash Blender.
The unit test for this also covers the previous commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/128375
This includes tests for a "static" mesh where the materials have been
assigned and are expected to remain the same over time.
The test scenario also includes a "dynamic" mesh where both new faces
and new materials are assigned to the same mesh over time (inspired by
#118754). However, that cannot be tested right now due to missing
features of both the MeshSequenceCache and our USD IO code. No testing
will occur for that case until the features are implemented.
Pull Request: https://projects.blender.org/blender/blender/pulls/128341
This implements versioning code to go from legacy to layered action.
The versioning is only triggered when the experimental flag for
Multi-Slot actions is enabled.
All the actions are converted in place, which should be fine because
of backwards and forwards compatibility with layered actions.
Pull Request: https://projects.blender.org/blender/blender/pulls/127842
An additional scenario was added which tests multiple meshes with shape
keys being animated by a single armature. The meshes purposely use the
same shape key name to ensure we also correctly account for that.
Additionally, because the existing shape key and armature test coverage
comes from already written .usd files, this test will first export from
Blender so we can better validate a full Blender-to-Blender roundtrip.
Pull Request: https://projects.blender.org/blender/blender/pulls/128160
Color primvars/attributes were historically treated as a special case
for both import and export. This was mostly done to align with how
painting and viewport display works in Blender. Export would generally
ignore color attributes except when they were found on a Mesh's Point or
FaceCorner domains. And import went out of its way to map incoming color
primvars to the FaceCorner domain in more situations than necessary.
To facilitate better roundtripping in Blender<=>USD workflows, and to
reduce code duplication, this PR teaches the common attribute utilities
how to handle color types. The color attributes will now work on all
relevant Mesh and Curve domains.
There were tests in place for this already but they were set to verify
the inverse state, i.e. the technically broken state, until this could
be fixed.
There remains one special case: "displayColor" primvars and attributes.
The "displayColor" is a special primvar in USD and is the de-facto way
to set a simple viewport color in that ecosystem. It must also be a
color3f type. In order to not regress import, if a "displayColor"
primvar is found on the Face domain we will map it to FaceCorner instead
so it can be displayed in the viewport; which has been the case for the
past several releases. We can drop this special-case if/when Blender can
display Face colors through the Viewport Shading "Attribute" color type.
Additionally, Blender will export this, and only this, color attribute
as a color3f.
Note: As was the case prior to this PR, the following 2 discrepancies
still prevent "perfect" round-trips:
- USD does not have an equivalent to Blender's byte colors; they are
treated as float during IO
- Blender does not have an equivalent to USD's color3 types; they are
treated as color4 during IO
Pull Request: https://projects.blender.org/blender/blender/pulls/127784
This adds a new type of zone to Geometry Nodes that allows executing some nodes
for each element in a geometry.
## Features
* The `Selection` input allows iterating over a subset of elements on the set
domain.
* Fields passed into the input node are available as single values inside of the
zone.
* The input geometry can be split up into separate (completely independent)
geometries for each element (on all domains except face corner).
* New attributes can be created on the input geometry by outputting a single
value from each iteration.
* New geometries can be generated in each iteration.
* All of these geometries are joined to form the final output.
* Attributes from the input geometry are propagated to the output
geometries.
## Evaluation
The evaluation strategy is similar to the one used for repeat zones. Namely, it
dynamically builds a `lazy_function::Graph` once it knows how many iterations
are necessary. It contains a separate node for each iteration. The inputs for
each iteration are hardcoded into the graph. The outputs of each iteration a
passed to a separate lazy-function that reduces all the values down to the final
outputs. This final output can have a huge number of inputs and that is not
ideal for multi-threading yet, but that can still be improved in the future.
## Performance
There is a non-neglilible amount of overhead for each iteration. The overhead is
way larger than the per-element overhead when just doing field evaluation.
Therefore, normal field evaluation should be preferred when possible. That can
partially still be optimized if there is only some number crunching going on in
the zone but that optimization is not implemented yet.
However, processing many small geometries (e.g. each hair of a character
separately) will likely **always be slower** than working on fewer larger
geoemtries. The additional flexibility you get by processing each element
separately comes at the cost that Blender can't optimize the operation as well.
For node groups that need to handle lots of geometry elements, we recommend
trying to design the node setup so that iteration over tiny sub-geometries is
not required.
An opposite point is true as well though. It can be faster to process more
medium sized geometries in parallel than fewer very large geometries because of
more multi-threading opportunities. The exact threshold between tiny, medium and
large geometries depends on a lot of factors though.
Overall, this initial version of the new zone does not implement all
optimization opportunities yet, but the points mentioned above will still hold
true later.
Pull Request: https://projects.blender.org/blender/blender/pulls/127331
More thoroughly test certain image processing behavior of USDZ IO.
Namely that regular and UDIM images are imported back when using either
the packed or the copy import modes. Along the way ensure that we have
coverage for image downscaling on export as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/127985
Export Blender Point Clouds as `UsdGeomPoints` primitives.
Summary
- Adds the `USDPointsWriter` class
- Adds tests to ensure that animated positions, velocities, radii, and
regular attributes are all written correctly (in a sparse format)
- Adds a new `export_points` operator property, mirroring the existing
`import_points` option
Pull Request: https://projects.blender.org/blender/blender/pulls/126389
This commit adds low-level logic in BKE to support three behaviors in
case of name conflict when renaming an ID:
1. Always tweak new name of the renamed ID (never modify the other ID
name).
2. Always set requested name in renamed ID, modifying as needed the
other ID name.
3. Only modify the other ID name if it shares the same root name with the
current renamed ID's name.
It also adds quite some changes to IDTemplate, Outliner code, and
RNA-defined UILayout code, and the lower-level UI button API, to allow
for the new behavior defined in the design (i.e. option three from above list).
When renaming from the UI either 'fails' (falls back to adjusted name) or forces
renaming another ID, an INFO report is displayed.
This commit also fixes several issues in existing code, especially
regarding undo handling in rename operations (which could lead to saving
the wrong name in undo step, and/or over-generating undo steps).
API wise, the bahavior when directly assigning a name to the `ID.name`
property remains unchanged (option one from the list above). But a new
API call `ID.rename` has been added, which offers all three behaviors.
Unittests were added to cover the new implemented behaviors (both at
BKE level, and the RNA/Py API).
This commit implements #119139 design.
Pull Request: https://projects.blender.org/blender/blender/pulls/126996
Clear the entire scene at the start of every test case. Previously this
happened only at the start of the test suite. This should make tests
more independent.
No functional changes to the actual tests.
Add the ability to control whether or not Hardware Ray Tracing (HWRT)
is enabled during render tests.
This is done by adding `-RT` to the end of the device name in the
Cycles device list. E.g. `HIP-RT`. This is supported with HIP, oneAPI,
and Metal.
Change in behaviour:
If you do not specify `-RT`, then HWRT will be disabled. This results
in a change in behaviour:
1. `METAL` device tests on M3 or newer Macs no longer using MetalRT
2. `ONEAPI` device tests no longer use Embree GPU.
Note: Some tests are failing on some platforms/configurations that can
now be easily tested due to this commit. This does not effect the
build bot automated testing as it does not test these configurations.
These tests have not been blocked from running, primarily to help
developers investigate and fix the issues.
Ref #123012
Pull Request: https://projects.blender.org/blender/blender/pulls/125082
The `Action.groups` RNA functions now work with layered Actions as well.
They just expose / operate on the groups of the channelbag that belongs
to the first slot of the Action.
Pull Request: https://projects.blender.org/blender/blender/pulls/127241
This makes the logs fairly verbose, but it is not displayed by default
anyway, and it is the only easy way to find out exactly which file or ID
is breaking the test.
This PR enabled backend specific rendertest for EEVEE and Workbench.
Some changes that have been made are:
- Add suffix to the test identifying the backend (_opengl, _vulkan, _metal)
- Vulkan render tests are compared with the opengl results.
Most EEVEE tests run as expected there are some issues in the Vulkan
backend that needs to be addressed:
- Fully smooth reflective materials miss lighting.
- Tangent normals are off
None of the workbench tests pass. It has to do with downloading the depth
buffer. In Workbench they are stored as GPU_DEPTH32F_STENCIL8 and downloaded
as FLOAT. We didn't implement it in the vulkan backend yet and currently asserts.
The Vulkan render test run faster compared to OpenGL. On my system around
25-50% faster.
Pull Request: https://projects.blender.org/blender/blender/pulls/126784
In preparation for adding big-endian tests, disable them on macOS
where many are failing, although it looks like the cause of failure
may not relate to endian conversion, it needs further investigation.
Adds test coverage for the USD python hook machinery:
- Ensure processing occurs correctly when returning False or throwing
exceptions from all the hooks
- Validates that the hook arguments are valid (UsdStage, depsgraph, and
material parameters)
- Tests unregister to ensure hooks are fully removed from processing
Pull Request: https://projects.blender.org/blender/blender/pulls/126809
Newly validates the following:
- Image mapping transforms on import and export
- Typical normal map setups on import and export
- Alpha-clip node setups on import (was already tested for export)
Pull Request: https://projects.blender.org/blender/blender/pulls/126776
Additional coverage for the following scenarios:
- Ensures custom properties are exported and imported correctly
- Ensures that xform op modes and scene orientation options are properly
respected during export
Pull Request: https://projects.blender.org/blender/blender/pulls/126723
This PR adds channel groups (also known as fcurve groups or action groups) to
layered actions. For layered actions, these groups belong to the `ChannelBag`s
and can vary by bag.
From a user perspective, the goal is for these to function just like channel
groups from legacy actions. However, internally they are implemented a little
differently: legacy actions store both channel groups and fcurves in a listbase,
and groups indicate what fcurves are in them with a listbase that points
directly into the larger fcurve listbase. Layered actions, on the other hand,
store both fcurves and channel groups in an array, and groups indicate what
fcurves are in them by indexing into the fcurve array.
Despite taking this different approach, we still reuse the `bActionGroup` struct
for the new channel groups, just adding the necessary fields for index-based
fcurve membership as described above.
This PR does not implement all of the functionality needed to reach feature
parity with legacy action channel groups, but implements the main core and gets
them basically working.
It's easier to list the things that *haven't* been implemented yet:
- Operators for letting the user manually create/remove/move channel groups.
- Keyframe selection in the action/dopesheet editor on channel group rows
themselves are not yet working correctly.
- Handling channel groups in legacy/layered action conversion operators.
- Making the legacy `action.groups` property work on single-layer-single-strip
layered actions.
Those are left for future PRs. Other than that, in theory everything should be
working now.
Pull Request: https://projects.blender.org/blender/blender/pulls/125774
Verifies all currently supported USD Shape prim types are successfully
imported. Each prim has time sample data authored so the presence of a
Mesh Sequence Cache modifier is also checked.
Pull Request: https://projects.blender.org/blender/blender/pulls/126449
This extends the `GreasePencilDrawing` rna type using python.
The goal is to add an API that allows developers to transition to
the new grease pencil API a bit more smoothly.
Adds the following endpoints to the `GreasePencilDrawing`:
* `drawing.strokes`: Returns a list/slice of `GreasePencilStroke`s in the drawing.
Adds a python class `GreasePencilStroke`:
* `stroke.points`: Returns a list/slice of `GreasePencilStrokePoint`s.
* Getters/Setters of attributes for this stroke:
* `stroke.cyclic`
* `stroke.material_index`
* `stroke.select`
* `stroke.softness` (used to be `hardness`)
* `stroke.start_cap`
* `stroke.end_cap`
* `stroke.curve_type`: The type of curve: `POLY`,`BEZIER`,`CATMULL_ROM`,`NURBS`.
* `stroke.aspect_ratio`
* `stroke.fill_opacity`
* `stroke.fill_color`
* `stroke.time_start`
* High-level functions:
* `stroke.add_points(count)`: Adds `count` points at the end of the stroke.
* `stroke.remove_points(count)`: Removes `count` points from the end of the stroke. Note that this will not remove the stroke if the count is greater than the number of points in the stroke. A stroke has at least 1 point. Removing strokes can be done from the drawing.
Adds a python class `GreasePencilStrokePoint`:
* Getters/Setters of attributes for this point:
* `position`
* `radius`
* `opacity`
* `select`
* `vertex_color`
* `rotation`
* `delta_time`
Note that `GreasePencilStroke` and `GreasePencilStrokePoint` are not stored in the file and don't have an RNA API. This means that they are not compatible with e.g. `layout.prop`.
This API should not be used for performance critical code. It's likely
even slower than the python API from 4.2.
There will be migration documentation for addon developers here:
https://developer.blender.org/docs/release_notes/4.3/grease_pencil/#python-api-changes
Pull Request: https://projects.blender.org/blender/blender/pulls/125599
This commit adds a new cmake variable `WITH_CYCLES_TEST_OSL`
that runs every Cycles test a second time with OSL enabled.
At the moment only CPU OSL is enabled. There are plans to enable
OptiX OSL in the future when stability issues with OptiX OSL
have been resolved.
Some render tests have been blocked from running until we can figure
out a fix. The most notiable being all the Pricincipled BSDF tests
as some of them are failing due to noise differences.
Ref #123012
Pull Request: https://projects.blender.org/blender/blender/pulls/124601
While adding test coverage for mesh subdivision surface scenarios, a few
problems were noticed with vertex crease support.
This PR fixes:
- Used incorrect `crease_sharpnesses` instead of `corner_sharpnesses`
- Used incorrect value for an "infinitely sharp" vertex crease
- Unnecessarily wrote out Blender's `crease_vert` attribute as a primvar
Tests are added which validate everything we support.
Pull Request: https://projects.blender.org/blender/blender/pulls/126209
The mesh velocity data was not using the UsdUtilsSparseValueWriter and
was writing out data for all frames even if the velocity didn't change.
Adds test coverage for this scenario as well as other situations where a
MeshSequenceCache (MSC) would be required:
- Ensures that when positions vary a MSC is added
- Ensures that when velocities vary a MSC is added (see blender/blender@c862d40e09)
- Ensures that when attributes vary a MSC is added (see blender/blender@3c394d39f2)
Pull Request: https://projects.blender.org/blender/blender/pulls/126208
Adds test coverage for a few, minor, missing cases for USD Light export:
- Spot lights with the special case of a 0 radius
- Area lights of type SQUARE (RECTANGLE was already tested)
- Area lights of type ELLIPSE (DISK was already tested)
Pull Request: https://projects.blender.org/blender/blender/pulls/126203
This changes the behavior when deleting the last key of an FCurve on layered actions.
Previously the FCurve would continue to exist, whereas now it is deleted.
This makes it consistent with legacy actions.
I modified the "Clear Keyframes" operator in this PR as well to make it work with layered actions.
Pull Request: https://projects.blender.org/blender/blender/pulls/125327
Support the USD `color4f` (and related) types during import and use this
type when writing out Blender's color attributes.
This roundtrips Blender data correctly and will properly load data from
many more USD files as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/125839
Add an Action Slot selector to the Action editor's header, next to the
Action selector. The selector shows all slots in the action that are
suitable for animating objects (as the Action editor itself is limited
to showing the Action of the active object).
This also considerably simplifies the 'Animation Debug' panel, as some
debugging code has been removed, as well as the display of any animation
layers. The latter can be reintroduced (if necessary) when multi-layer
animation support is added. Most importantly, it removes the
WindowManager property that was used as a hack to assign layered Actions
to objects.
API change: the RNA property `AnimData.slot` is now a pointer property
that reflects the actual slot (it used to be an enum property).
Some small changes to the UI code were necessary to make the selector
show the slot's display name (and not their internal name).
Pull Request: https://projects.blender.org/blender/blender/pulls/125416