Refactor to prepare for slotted action support to the evaluation of
quaternion F-Curves.
Since slotted Actions store F-Curves in an array, you cannot iterate over
them any more via the `ListBase` pointer `fcurve.next`. Quaternion
evaluation code has been refactored to work on a span of F-Curves instead
of just getting the first one.
For now, slotted Actions just evaluate their first slot only. A future
commit will add a slot handle parameter to evaluate the correct slot.
Implements the legacy `weight_data_add` button for GPv3.
Note: This PR properly accounts for the bone's transformation when applying so that the stroke does not appear to teleport after drawing, unlike the legacy system.
Pull Request: https://projects.blender.org/blender/blender/pulls/119302
Without it sometimes it feels that search didn't work, when it just
happened that we were near the end of the file.
It is the default in popular external editors as well.
Ref: !127528
The single characters "\" could not be used for filtering
because it was treated as an escape characters.
Although "\\" could be used to match "\".
Disable escape character behavior as this mostly makes sense for
matching file-names for shell input.
- Clarify misleading logic when the buffer couldn't be allocated.
- Use a utility function to calculate the thumbnail size.
- Calculate the thumbnail size for the on-disk thumbnail
separately (corrects minor rounding error) caused by
scaling the smaller size up.
Updating the node bounds just after deforming the vertices in the
node is faster because the position data is still fresh in CPU caches.
Updating it later on means all the other nodes have been processed
in the meantime which will evict that position data from the caches.
This results in a 1.11x improvement in the brush benchmark timing,
from 0.495s to 0.438s on a Ryzen 7950x (best of 5 runs).
As part of the change, the update tagging has completely moved
to each brush implementation. This continues the process of
making each brush more independent.
Part of #118145.
Pull Request: https://projects.blender.org/blender/blender/pulls/127536
The normals were not allocated before the brush code starts, which is
necessary to store the initial normals in the undo step, among other
things. Previously normals were calculated as part of building the PBVH.
That doesn't make sense anymore because that process shouldn't change
the mesh. For now just add the recalculation in a code path called by
`BKE_sculpt_update_object_for_edit`, called at the beginning of each
stroke, and other places.
I've done this a few times and would have benefited from a utility
function for it, apparently it's done in a few more places too. The
utilities aren't multithreaded for now, it doesn't seem important
and often multithreading happens at a different level of the call
stack anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/127517
Implements setting the armature parent and generating
vertex groups for the bones in the armature.
Note: This does not implement the `Envelope` or `Automatic Weights` options.
Pull Request: https://projects.blender.org/blender/blender/pulls/127515
Current the automasking code stores temporary data as geometry
attributes (except for multires where that doesn't work) in order to
persist the cached factors for cavity and occlusion accross multiple
strokes. However, the benefits of this aren't clear, compared to
improving the performance of these calculations. It's also the last
usage of the sculpt attribute API which we plan to remove. The system
is also hard to understand, to make a more solid cache of automasking
values it would be better to start from scratch.
This commit removes the sculpt attribute API and the automasking stroke
ID system, and moves the cached factors to be cached per stroke rather
than more permanently.
Pull Request: https://projects.blender.org/blender/blender/pulls/127470
Enums that are displayed as icon-only should have their icons defined
in RNA, not just through the layout in Python. That way they are shown
in the dropdown itself and users make the connection between the listed
item label and the icon while collapsed.
Previously, mapping old to new items was O(n^2) because each new item was
compared to all old items until the corresponding one was found. This patch
introduces a pre-filter to the old elements that have to be checked. Instead of
comparing all old items, only the ones with the same label are compared now.
This reduces the time complexity to O(n), making the tree view much more
usable with many items.
Joining many geometries was O(n^2) because of deduplication of the same
components was not done using a map. My test file that generates 1000
stars in a repeat zone got 10x faster, but it's possible to create a file for any
speedup.
This adds support for line separators in nodes. Currently this is only available for
built-in nodes and it's only used in the Simulation Zone. However, we also want
to use it in the For Each Geometry Element zone (#127331). Support for node groups
can be added separately too.

Pull Request: https://projects.blender.org/blender/blender/pulls/127501
Grease Pencil armature deformation has to use the correct
`vertex_group_names` list from the `Curves` (i.e. drawings) rather than
the names from its parent `GreasePencil` data block.
The ancient armature deformation code used a `defbase` list (`ListBase`
of type `bDeformGroup`) from the object via `BKE_id_defgroup_list_get`.
This function does not have enough information to determine the correct
vertex groups for GPv3, and it's use inside supposedly generic code is
highly questionable.
This patch removes the `defbase` lookup inside
`armature_deform_coords_impl` and instead passes an explicit list of
vertex group names to be used for resolving indices. We already have
context in every place this is called to determine the correct vertex
groups, without having to make assumptions down the line based on just
the object type.
Pull Request: https://projects.blender.org/blender/blender/pulls/127509
As a generic type for referencing the active/initial vertex, int is
more convenient here because mostly it's used for array indexing,
and moving from int to `BMVert` and `SubdivCCGCoord` is
simple and cheap.
Properly track Action and Slot assignment when entering/exiting NLA
tweak mode.
This doesn't properly sync the length of the NLA strip when exiting
tweak mode. This and more NLA work is tracked at #127489.
Pull Request: https://projects.blender.org/blender/blender/pulls/127498
Do not try to kill thumbnail generation job when destroying the cache
(which happens as part of destroying the scene) -- all the code
paths that destroy a scene already cancel outstanding WM jobs. And WM
itself might be gone at that point, so accessing a stale pointer to it
can lead to a crash.
Instead, fix the problem of "refresh sequencer can cause a crash" by
not destroying the thumbnail cache, but merely clearing it in
sequencer_refresh_all_exec.
Pull Request: https://projects.blender.org/blender/blender/pulls/127485
This option is meant to ignore any material locking when it
comes to editing strokes that might use locked materials.
There were some issues with the current implementation.
* The name did not reflect what it was supposed to do, so it
was renamed to `ignore_locked_materials`.
* The description of the option has been updated to better
reflect the behavior.
* Some util functions have been refactored
Pull Request: https://projects.blender.org/blender/blender/pulls/127423
For an NLA strip to use a slotted Action, it needs to specify which slot
to use in that action. This is now handled by two new properties on the
strip in DNA & RNA: `action_slot_handle` and `action_slot_name`.
These serve the same purpose as their counterparts on the `AnimData`
struct.
Note that this commit does NOT add NLA evaluation support for slotted
Actions. It merely allows assigning them. Evaluation, tweak mode
support, etc. will be implemented in future commits.
Pull Request: https://projects.blender.org/blender/blender/pulls/127359
Add an RNA function that can log the users of an Action Slot. It's
available in debug builds only, as it is purely a debug tool for C++
developers at the moment.
Eventually it's likely that the list of Action Slot users will be
exposed to RNA/Python directly, but I'll only write code for that once
we actually need it for non-debugging functionality. For now this is
enough.