In GPv2 strokes could technically have zero points.
`CurvesGeometry` doesn't allow this, so we need to make
sure to explicitly skip over strokes with no points.
Pull Request: https://projects.blender.org/blender/blender/pulls/120536
Not all matrices are invertable (e.g. when a transformation matrix is has
a scale of zero), and it's sometimes important when a matrix is.
This also better specifies the behavior when the matrix is not invertable:
the identity matrix is returned.
Pull Request: https://projects.blender.org/blender/blender/pulls/120530
A small logic issue caused all write-only image resources
to be tagged as read-write in all cases. This caused
correctness issues on Intel and AMD GPUs which
are resolved through this change.
Change also yields a small performance uplift
due to enabling improved non-dependent workload
scheduling.
Authored by Apple: Michael Parkin-White
Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/120528
This PR performs the following refactors in sculpt_trim.cc:
* Remove `depth_front` and `depth_back` as `struct` properties, as they
are only used for generating the Mesh
* Moves the `calculate_depth` call into the `generate_geometry` step as
the latter is dependent on data from the former already
* Reorganize the methods so the overall file reads better.
* Minor comment nits and additions
Pull Request: https://projects.blender.org/blender/blender/pulls/120331
Split code to separate functions depending on the source of info for
socket inspection. Each function retrieves some optional string.
Collecting of result string is just loop.
Pull Request: https://projects.blender.org/blender/blender/pulls/120496
The reverse uv sampling operation generally fails when there the sample position
is within more than one uv triangle. Unfortunately, the combination of limited
floating point accuracy and very small triangle areas caused this case
sometimes, even if the triangles don't actually overlap. This happens relatively
rarely, but if it does, it causes annoying artifacts. The solution is to only
detect these kinds of overlapping triangles if they have a certain minimum size
and to be more relaxed otherwise.
Pull Request: https://projects.blender.org/blender/blender/pulls/120408
Make it match behavior of the previous Python importer: it was
accepting such faces, and then always calling mesh validation function
that got rid of them. Instead of doing the whole validation cost,
just do not add such faces in the first place.
Historically makesdna/rna did not link bf_guardedalloc for
some reason, but during one of my cmake cleanups have picked up
this dependency anyhow. To prevent duplicate symbols, remove the
now duplicated translation units as linking bf_guardedalloc has
seemingly not caused any issues.
Pull Request: https://projects.blender.org/blender/blender/pulls/120490
Bone collections are drawn in the new tree view by accessing properties
from `armature.collections_all[...]`, which means that drivers and
fcurves also target those. This is now taken into account when updating
the bone collection name.
For context: in Blender 4.0 the UIList used `.collections[...]` instead,
for which renaming was already handled properly.
Pull Request: https://projects.blender.org/blender/blender/pulls/120517
Use versioning code to change Drivers & F-Curves targeting
`armature.collections[...` to target `armature.collections_all[...`
instead. The former contains the root collections only, whereas the
latter contains all of them in a flat list. Not only does this fix the
tree view (it binds to properties via the `.collections_all` RNA path),
but also this makes the drivers & animation of the properties work even
when the hierarchy changes.
Note that both `.collections` and `.collections_all` give access to all
bone collections. The former just requires iterating hierarchically,
that is, via `some_collection.children`.
Pull Request: https://projects.blender.org/blender/blender/pulls/120514
Adds support for subpass transition for AMD/Intel IMR
GPUs. This enables correct functioning of EEVEE Next
deferred lighting pass on AMD platforms.
The emulation is consistent with the OpenGL approach
of generating additional texture bindings in the shader
for subpass inputs, and splitting render passes across
sub-pass boundaries.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/119784
`interpolate_curve_attributes()` did not transfer `cyclic` attribute to
target curves. This fixes the the problem and allows Interpolate
Curves node to interpolate cyclic curves and also work between a cyclic
curve and a non-cyclic curve.
Pull Request: https://projects.blender.org/blender/blender/pulls/120460
This adds operators to add a bezier and circle primitive in curves
edit mode. The operators support the same settings as in the
legacy curve edit mode. The `shift+A` shortcut is added as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/120513
`BKE_animdata_fix_paths_rename` would tag the owner ID itself
(`ID_RECALC_SYNC_TO_EVAL`) upon renaming when a corresponding fcurve was
found/fixed, however the action itself wasnt tagged. "The action is an
own datablock, meaning, changes to f-curves need to copy those changes
to all evaluated versions of the action datablock" (wording from
4045730d58).
(this is also the reason the action would "fix" itself after entering
tweakmode on it in the NLA, since that ripples down to
`ANIM_list_elem_update` -- which does the tagging on the action then).
Part of #104055
Pull Request: https://projects.blender.org/blender/blender/pulls/120292
Collections which were pointed by a modifier used to follow visibility of the
current object, and this visibility is static throughout the lifetime of the
dependency graph.
Change the code so that collections pointed by modifiers rely on the visibility
flushing, allowing to be optimized out from evaluation.
Pull Request: https://projects.blender.org/blender/blender/pulls/120516
`editmesh_active` theme is used to for active mesh element.
`vertex_active` is unused here (only used in graph editor) so remove it
from the 3d viewport and UV editor theme.
Found this in #119640
Pull Request: https://projects.blender.org/blender/blender/pulls/119649
Instead of using `MEM_callocN` to create an array of `BeztMap`
use a `blender::Vector`. This has the advantage that we don't need to worry about
freeing the memory.
In addition to that it can be passed as a `Span`, removing the need to pass the
length as a separate argument.
Doing that also allows to use the C++ syntax for `for` loops.
This also gives a small performance boost
| Before | After |
| - | - |
| 288ms | 260ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/120507
Caused by 30b0c5b225
That commit removed `use_insertkey_xyz_to_rgb` but
I didn't see the use of that in the python script.
Fixed by removing the usage of that property from the python script as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/120509
MoltenVK original intent was to let developers work on a mac system developing
for the vulkan eco-system. MoltenVK doesn't support all the features that we
require and would require additional workarounds to be actually supported.
It is not expected that we will release Blender with MoltenVK for this reason.
But it still has value for shader developers to validate shaders on metal and
vulkan on a single platform.

Pull Request: https://projects.blender.org/blender/blender/pulls/117940
Specializing other frequently used film parameters
results in an additional ~20% uplift in film pass
performance. Measured on Apple Silicon.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/119736
This is a regression since fdc2962beb
The size of state can not be different between CPU and GPU.
This change replaces compile-time condition with a kernel feature
check, which solves the render regression on AMD Metal. It also
minimizes the state size on other GPUs when Light Tree is disabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/120476
Removes the implicit USAGE_ATTACHMENT flag from
atomic fallback textures which are buffer-backed.
This usage flag results in a validation failure, and is
not required by these textures as they are cleared
via the backing buffer.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/119785
It was mostly correct, except for the case where a user sets an
empty string as the export filename. What was happening is:
- STL exporter invocation adds ".stl" extension, so the path becomes
foo/.stl
- Code tries to replace extension with "ObjectName.stl", but
BLI_path_extension_replace sees that the filename part starts with
a dot and thinks the ".stl" part is the whole filename, not the
extension
- Resulting path thus becomes "foo/.stlObjectName.stl"
If the theme's name was changed, resetting the default theme did
nothing from a user perspective.
Internally it would add the Default theme to the end of the list where
it was ignored, then the default theme overwrote the data including the
next/prev links causing the ListBase to be invalid.
Resolve by ensuring the default theme is always first and use the
MEMCPY_STRUCT_AFTER macro to prevent links being overwritten.
Adds an (empty) sculpt mode for Grease Pencil v3 objects.
The object `SCULPT_GPENCIL` mode is re-used for Grease Pencil object
types. A `SCULPT_GREASE_PENCIL` context mode has been added, which is
specific to grease pencil objects. This is necessary for polling tools
and keymaps.
Pull Request: https://projects.blender.org/blender/blender/pulls/119338