Unregistered classes could be still referenced in active popups and as
soon they get focused they will likely crash after trying to access
freed data.
This avoid any crash by refreshing any active popup when a class
is unregistered, if the popup can't be refreshed and is referencing
the class to be unregistered it will be closed instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/157524
The `Make Group` operator for nodes expects that sockets remain valid
when removing a link to the node (to be replaced by a new external
link). This is not the case for highly dynamic nodes like viewer nodes.
A viewer socket is removed as soon as it is un-linked.
Make the group operator more robust by checking if sockets exist and
ignoring any link to group nodes when the socket disappears.
Ideally the viewer node would remain connected through these operations,
but that requires some detail special case for viewer behavior or some
way to ensure a viewer node copy has the same sockets as the original.
A regression test is also added for this case.
The `bl_node_copy_operators.py` has been modified to use the
`BLENDER_TEST_UPDATE` environment variable for updating the expected
test data, instead of the previous `--generate` script parameter.
This is consistent with other test scripts using the same mechanism.
A bug in `nearest_node_grid_coord` was fixed which created `nan` node
locations when running in `--background` mode due to zero UI scale.
Introduced by #157834.
Pull Request: https://projects.blender.org/blender/blender/pulls/160718
This is already on the verge of failure, and small changes are pushing this
over the threshold. Blocklist for now to unblock those PRs that do not
actually make this worse.
Ref #159824, #159635
It turns out the workaround for #154260 only disabled AVIF BW saving for
the Image->Save UI, but not in the Output Properties UI. So while 5.1
will remain problematic when using those settings, 5.2 has updated
libraries and can successfully output in both places.
Re-enable the Image->Save UI to make things consistent and add dedicated
BW variations to the imbuf suite of tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/160576
This particular combination was not computing the stack size correctly,
since shader raytrace was moved to a separate OptiX module. It needs to
be set manually now that it's not part of the same module.
Regression from c51fcf73a7.
Pull Request: https://projects.blender.org/blender/blender/pulls/160318
Unfortunately it appears that moving MNEE to another kernel did not
fundamentally fix the apparent compiler bug that breaks this. Another
refactor in 0baa98866c made the bug surface again.
It appears to work fine with HIP-RT, so we leave that case enabled.
HIP-RT is also enabled by default, so it's not as bad.
Pull Request: https://projects.blender.org/blender/blender/pulls/160110
Use the mechanism where there is one reference directory, and an override
directory for the cases that are known to be different.
The override is kept only where the committed USD reference and Hydra
reference differ beyond the test threshold; otherwise the Hydra render
is redundant and shares the USD reference. This helps work towards
making them match, and reduces the repository checkout size.
Pull Request: https://projects.blender.org/blender/blender/pulls/160433
Regression in [0] meant converting the active UV map to a vertex
group then adding a new UV map caused an out-of-bounds read
in AttributeStorage::lookup.
Vertex groups share the attribute namespace,
so an attribute can't be added with a name that matches a vertex group.
BKE_attribute_calc_unique_name didn't account for this,
so the name generated for the new UV map collided with the vertex group,
the attribute was never added,
and ED_mesh_uv_add returned a stale index.
Prevent collisions with vertex group names in
BKE_attribute_calc_unique_name.
Also convert attributes using BKE_attribute_remove instead of the
raw accessor, so the active UV map and color attribute stay valid
(matching the remove operator).
Ref !160314
[0]: 8adba33029
This adds support to import and to export subdivision parameters from
subsurface modifiers in Alembic.
As Alembic is using the OpenSubDiv 2.0 API to define the parameters, we
need to convert to and from the OpenSubDiv 3.0 API which Blender uses.
Since Alembic does not define proper enumerations for these values,
this adds relevant enumerations whose names derive from the USD Alembic
exporter to avoid using magic values.
On top of that we also export and import the subdivision levels for
viewport and render so those values get preserved when reimporting in
Blender.
For import, this also automatically adds a subdivision surface modifier
to subdivision meshes.
Pull Request: https://projects.blender.org/blender/blender/pulls/160260
Support import/export of Matrix4d primvar attribute values.
The changes to io_report.py are currently unused but were implemented
for completeness.
Note: The double-precision 64-bit values from USD are converted to float
32-bit on import.
Pull Request: https://projects.blender.org/blender/blender/pulls/160182
The heuristic for colorless reflections detection
was not taking into account the Multiscatter GGX case.
In this configuration, the `Favg` is tinting the reflectance
which results in colored reflections. The Gbuffer packing needs
to be notified to account for that.
See `GPU_MATFLAG_REFLECTION_MAYBE_COLORED`.
Also unblock Principled BSDF transmission test.
It was previously disabled because of a shadow
issue that was recently solved. Moreover it tests for this
specific case.
Pull Request: https://projects.blender.org/blender/blender/pulls/160232
When strip names were colliding, and the name already had "." in there,
everything after it was stripped and replaced with a number. This does
not follow the behavior of other parts of blender; treat
it as "this is a numeric suffix" if it actually contains a number only.
Pull Request: https://projects.blender.org/blender/blender/pulls/160155
Platform can get unstable. The artifacts that were detected seemed
like invalid synchronization of index buffers, or incorrect execution
of vertex buffers. This could be related to the combination of AMD
official drivers and Rocky8. More investigation is needed, but for
now we just disable these tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/160204
Initially noted by devops as a problem: UI tests when crashing
spawn our crash dialog, that will just sit there for 1200 seconds
until the CI environment decides the test has failed and kills the
process, clicking away the dialog also works, but neither option is
ideal here.
The crash handler knows when we are in background mode, (`-B`) and
suppresses this dialog so this is why it has not been an issue for the
normal tests. However when we do crash we get an unhelpful message
saying `Writing: blender.crash.txt` which is not collected by buildbot
so unless a developer can get a devops person to go retrieve this file
its contents will be left to ones imagination.
This PR adds a `--console-crash-handler` argument that does two things:
1 - Suppress the crash dialog even when we are not in background mode
2 - Rather than writing the crash data to blender.crash.txt write this
information to stderr so it shows up in the CI logs.
It also updates all invocations of blender I could find in our test
scripts to pass this new flag. The benchmark scripts have not been
updated as they regularly run against older blender versions that may
not support the new flag.
Pull Request: https://projects.blender.org/blender/blender/pulls/159983
Most game engines use and store normal data per-point. Blender's default
USD export always converts them to face-varying/corner. This PR exports
normals following Blender internal data model (point, corner or face),
thus making import in engines more straightforward for meshes that
already use per-point normals without additional conversion steps.
USD export tests have also been updated to reflect this change.
Pull Request: https://projects.blender.org/blender/blender/pulls/159858
EEVEE screen space ray tracing uses a bias of `-2.4e-7f * 2.0f` to avoid
self-intersections. This bias is increased to `-2.4e-7f * 7.0f` in order
to work around self-intersections present on Intel GPUs on Windows.
Pull Request: https://projects.blender.org/blender/blender/pulls/159953
The RNA path for the properties relating to depth of field on steroscopy
were wrong, so the FCurves for those properties were silently ignored.
To fix this the ENUMERATE_CAMERA_PROPERTIES macro is extended with a
`short_name` used for creating members and variables, and the `rna_name`
is replaced by a proper `rna_path`. The test file is also updated to
include tests for all properties which should have been done from the
get-go.
Pull Request: https://projects.blender.org/blender/blender/pulls/159812
This PR makes a number of changes to the bundled essential brush assets
for Weight Paint, along with a number of other mode / default changes
to improve the experience for beginners.
### Brush Changes
* The default brush is now the "Add Weight" brush, which uses the "Add"
blend mode, accumulation, and a low strength.
* The existing "Paint" brush is renamed to "Set Weight" and now has a
Constant falloff curve. This brush also has a new icon to distinguish
it from the "Add Weight" brush.
* The "Blur" brush has been changed to use accumulation with a low
strength.
* For all brushes, the stroke spacing has been changed to 5% to feel
more responsive.
* For all brushes which formerly used a Custom falloff curve that
approximated a smoothstep function, the built-in "Smooth" curve is
now used.
### Mode Changes
* Multi-Paint defaults to enabled
* Auto-Normalize defaults to enabled
* Mirror Vertex Groups defaults to enabled
Along with the above, the asset shelf is now shown by default in Weight
Paint mode, as there are now more brushes than tools in the toolbar.
Only the default startup files will use these new options, for existing
files, if the old "Paint" brush was active, the new "Add Weight" brush
will be active upon loading.
See #149470 for further context.
Asset PR: blender/blender-assets!67
Pull Request: https://projects.blender.org/blender/blender/pulls/158671
This is for a Bevel Geometry node. The code is a kind of port of the BMesh bevel code in bmesh_bevel.cc, but it needs substantial changes to use Mesh data structures instead of BMesh ones. And therefore, it needs to deal with the fact the the Mesh is not efficiently mutable. The approach is to make an "ExtendibleMesh" that holds data about the original Mesh but also deltas to that mesh to be applied at new Mesh construction time. Many other changes in the code were needed to use ints for Vert, Edge, Face, and Corner instead of pointers to BMesh elements.
In designing the Geometry Node, we made some decisions about some changes to the interface as compared to the BMesh interface to bevel. These were discussed in issue #98674. Some of the bigger decisions:
- Offsets are given per edge (4 of them, one for each side of each end) or per vertex (only the first slot is used) depending on whether we are edge beveling or vertex beveling. There is no "offset kind" spec -- you can achieve kinds other than "offset" by calculating outside the node.
- Miters are both simplfied and expanded. There is a boolean per corner called "miter". If it is true, and the given corner is just past a beveled edge, then the gap between that beveled edge and the next will be mitered. It will be in "patch" miter if the angle is reflect and an "arc" miter otherwise.
- So far there is no "clamp" and "loop slide" option. I remain undecided about what to do here. The eventual hope is that "clamp" will go away because I will use a "straight skeleton" algorithm to "eat away" geometry when it starts to overlap. But this won't happen in time for the intitial release. For now, I may implement clamp as "always on", but this isn't yet implemented. Loop slide can be done by calculation of offsets outside the node, but this could be tedious. I may or may not decide to implement loop slide inside the node; if I do, maybe it will be "always on" -- not sure.
- There is an "effect Faces" option in the UI but it isn't hooked up to anything yet. I'll probably disable that for the first release. Eventually I want to have it, as kind of inset operator.
- There is a "profile" input, meant to take a curve, that will be used for custom profiles, but that is not hooked up to anything yet.
- There are output fields, not yet hooked up, which will give selections of various parts of the new beveled mesh, to be used for things like special materials or normal handling. (As a consequence, there will be no hardening code native to this node.)
The state of the code as of this initial WIP is that many things work (with the exceptions noted above re clamping and loop slide and custom profiles). There are about 70 regression tests, ported from the bevel_operator.py tests (with more UV maps). They all "pass" right now but that's just because I made the expected_object match the current code output. I still have to go through them carefully one-by-one to see that they match the current BMesh behavior.
I added reviewers but this isn't really in a state to review yet, unless you are interested.
One thing I intend to do: update all the "old-style" math functions (that use raw float arrays) to "new-style" math functions.
This code was heavily assisted using Claude Sonnet 4.6 in Antigravity. But I have carefully read the output and will continue to do so, and will stand by the code as if it were totally my own (and, since I wrote the original BMesh code, it is in that sense mostly mine anyway).
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/158151
Add three new flags to bpy.data.file_path_foreach so render farms and
other scripts can find all relevant files for the Cycles texture cache.
- EXPAND_TOKENS: visit each UDIM tile path.
- EXPAND_SEQUENCES: visit each image and volume sequence file path.
- EXPAND_CACHES: visit cache files, like texture cache files
associated with images.
The previously reserved metadata field is now provided to callers,
with is_expanded and is_cache booleans to indicate the file kind.
Also is_readonly indicates if the path can be edited.
Ref #158964
Pull Request: https://projects.blender.org/blender/blender/pulls/159159