Implements the "Select Similar" operator for Grease Pencil v3.
Several modes are available. Each mode has a dedicated "distance" metric:
- layer, material: compared by index
- radius, opacity: simple value difference
- vertex color: euclidian float4 distance metric
The implementation uses a `Set` to find selected values first, then compare each point attribute value to each value in the set until a distance below the threshold is found. This could be optimized by using a KD-Tree in the future. Layer comparison is a special case because points are already separated into drawings by layer, so any drawing in a "selected" layer is becomes fully selected.
Co-authored-by: Lukas Tönne <lukas@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/111410
This adds an operator that splits all slots of the action on the active object,
into separate actions.
The newly created actions will be named `slot_name+Action`.
All users of those slots will be reassigned to this new action.
The exploded action will not be deleted, but will end up with 0 users
unless a fake user is set.
------
For the review, does that operator name make sense?
Pull Request: https://projects.blender.org/blender/blender/pulls/128251
Set `use_property_decorate = False` in the Animation panels in the
Properties editor. This has no visual effect right now, but if we ever
decide to add labels to the selectors, this will ensure that the layout
remains correct.
Context: `layout.template_action()` and `layout.template_search()` respond
differently to the default of `use_property_decorate = True`.
Send a WM notifier when deleting a node from a node tree/group. Removing
a node also removes its animation data, and thus animation editors need
to receive a notification to refresh.
Pull Request: https://projects.blender.org/blender/blender/pulls/128255
`BKE_animdata_fix_paths_remove()` now calls into the new function
`animrig::legacy::action_fcurves_remove()`, which works for both
legacy and slotted Actions.
Also I updated the documentation of the BKE function so that it's clear
what it's actually doing.
No functional changes for legacy Actions.
Ref: #123424
Pull Request: https://projects.blender.org/blender/blender/pulls/128252
Reduce cognitive complexity of `BKE_animdata_fix_paths_remove()` by
returning early, returning literals (instead of variables) when the
returned value is known, and just calling `BKE_animdata_from_id()` instead
of re-implementing it here.
No functional changes.
This adds a button for creating a new group/folder.
Having this as an exposed button makes it faster to create groups.
This also removes the entry for adding a group in the extra menu
since it's no longer needed there.
Pull Request: https://projects.blender.org/blender/blender/pulls/128000
With the Slotted Actions experimental feature enabled, Blender will use
versioning to automatically convert legacy Actions into slotted ones.
Assignment of the converted Action's slot can fail in the following
scenario, when dealing with the following dance between "old Blender"
(only supporting legacy Actions) and "new Blender" (versions supporting
slotted/layered Actions):
1. New Blender: create an action with two slots, ME and KE, and assign
to respectively a Mesh and a Shape Key. Save the file.
2. Old Blender: load the file. This will load the legacy data, but still
keep the assignments. This means that the Shape Key will get a ME
Action assigned, which is incompatible. Save the file.
3. New Blender: upgrades the Action, and tries to assign its only slot.
This will fail for the shape key, as the ID type doesn't match.
The failure is in itself okay, as there was actual data loss in this
scenario, and so issuing a warning is the right way to go about this.
The Action is still assigned, but the data-block won't get a slot
assigned.
Pull Request: https://projects.blender.org/blender/blender/pulls/128199
When assigning an Action with the new API:
- check the Actions ID type (if it is a legacy Action), and
- check whether the ID is in NLA tweak mode.
This means that action assignment can fail, so the
`animrig::assign_action()` and `animrig::unassign_action()` functions
now return a `[[nodiscard]] bool`.
Part of `generic_assign_action()` has now also been shielded with an
`#ifdef WITH_ANIM_BAKLAVA` just to be sure.
This also includes a change in `BKE_animdata_free()`. That function now
first exits NLA tweak mode (if enabled) before freeing the Actions. This
makes it possible to simply un-assign the assigned Action, as all the
NLA tweakmode stuff has already been taken care of by the responsible
function.
Pull Request: https://projects.blender.org/blender/blender/pulls/128199
Layer selectors in Line Art and all modifier's Influence panel was
using the Grease Pencil icon, instead of the Grease Pencil Layer icon.
At the moment they are similar so it's easy to miss. But soon there
will be a new icon for layers so better use the right one.
The Line Art modifier was using Grease Pencil icon for materials
selector.
When exiting the immediate buffers are discarded, but where not
destroyed making the buffers still leak.
Detected when looking into descriptor set freeze issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/128249
Happens for renders from command line, when kernel specialization
thread is still working after the allocators on the Blender side
have been deinitialized.
Add an explicit deinitializaiton, which ensures all Cycles worker
and cache threads are finished before the allocators are deinitialized.
This should solve occasional crashes when running regression tests
for Metal or Metal-RT.
Pull Request: https://projects.blender.org/blender/blender/pulls/128239
Implements the design from #120318. The existing selection nodes now have
the ability to deal with float/soft selection. For meshes the soft selection
corresponds to the inverse of the sculpt mask attribute. In the future this
will likely be unified with edit mode selection a bit more which is why
this design was chosen compared to separating masking and selection.
Curves and point clouds already use a single selection attribute with
either data type.
Pull Request: https://projects.blender.org/blender/blender/pulls/126316
This adds an operator that moves slots of slot channels selected in
the channel box to a new action.
All slots are moved together into that new action instead of
moving them into separate actions.
I think that's more reasonable because that way the "move slots into separate actions" is
still possible by selecting the slots one by one.
The "explode action" operator that does just that can be a separate operator.
The new action is named after the slot for the case when only one slot is moved.
When multiple slots are moved, the name "CombinedAction" is used.
This also adds a menu entry "Action" to the action editor.
Pull Request: https://projects.blender.org/blender/blender/pulls/128171
This patch improves working with grease pencil layers in geometry nodes.
* Allow layers to have duplicate names in geometry nodes. In original data, unique names are enforced.
* This allows e.g. duplicating layers and then merging them by name in the end.
* It also resolves a big serial bottleneck when working with many grease pencil layers in geometry nodes. Enforcing unique names is inefficient.
* New `Merge Layers` node that can merge multiple layers by name or by a custom group id.
* Applying a grease pencil modifier now first merges all layers with the same name to ensure all names are unique.
Co-authored-by: Jacques Lucke <jacques@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/127873
A driver (package) installed by the user can have many different drivers
and they can all report a different version. For AMD the version we
reported was from their Vulkan driver. This version isn't useful during
bug triaging.
This PR will use the driver info and driver name from the driver
properties to construct a driver version string that will be used for
reporting.
Pull Request: https://projects.blender.org/blender/blender/pulls/128232
347ec1acd7 switched to iterating over nodes with index
masks but introduced nested lambdas with the inner one slicing
the index mask with a range provided by `parallel_for`. That was
done to avoid calling `.local()` more than necessary but in practice
that doesn't have an effect, especially with a grain size of 1.
That nested iteration is cumbersome and error-prone. For the
simple parallel loops with thread local data, switch to just using the
`GrainSize` argument to `mask.foreach_index` instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/128221
In this case there are two dependency graphs, each with a separate
object containing the original mesh. Leaving edit mode modifies the
original mesh by deleting the edit mesh data. The active dependency
graph's object was tagged for that change, but the other dependency
graph didn't know about the change because its object wasn't tagged.
The solution is to tag the original mesh which will cause any
dependency graph using it to properly reevaluate.
Pull Request: https://projects.blender.org/blender/blender/pulls/128192
This commit forcibly rebuilds the PBVH whenever the number of verts is
changed by an operation, additionally, the related deform variables are
freed when undoing geometry steps now to ensure data remains consistent.
Pull Request: https://projects.blender.org/blender/blender/pulls/128145
Customizable highlighting of editor edges that can be used to help
differentiate between areas, indicate active area, and/or help users
with visual impairment. Can be completely removed as well. This
replaces the active area header highlighting, which doesn't work for
transparent headers.
Pull Request: https://projects.blender.org/blender/blender/pulls/116684
A combination of a few changes:
- Don't apply hardness again, the "cube tip" calculation already factors it in.
- Avoid multiplication by brush radius, just use the 0-1 distances from the
cube tip calculation directly.
- Add filtering by brush radius to fix the second part of #128004.
- Change brush radius filtering to be consistent with previous code using
less than or equal instead of less than.
Note that the current radius filtering in BKE_brush_calc_curve_factors is
unnecessary since we already filter by the radius in a separate step.
There were multiple issues that popped up when following the reproduction steps
in the report:
* Somehow, `socket.socket_data` was set for a custom socket type. I don't know
how that happened yet. I added some code to clean it up on file-load.
* `declaration_for_interface_socket` did not work yet when the socket type is
not registered. Now it just creates a custom socket with the correct idname,
even if that's not registered yet.
* There was a missing node tree update when changing `bl_socket_idname` of
interface sockets.
Pull Request: https://projects.blender.org/blender/blender/pulls/128191
Previous change in there (d0cf4a4a8b, in 4.3 only) reverted
retiming keys to have one draw call per strip again. Which gets fairly
expensive if many strips have retiming keys.
However! All the strips are already drawn in two parts: all the regular
strips first, and then all the strips that are being "dragged over"
the other strips. So we can totally draw retiming keys for the whole
batch of strips at once, and it will just work out fine.
Viewing whole Sprite Fright Edit v135 timeline, on PC (Ryzen 5950X,
Win10/VS2022): draw_timeline_seq 7.4ms -> 5.8ms
(sequencer_retiming_keys_draw part 1.7ms -> 0.3ms)
Pull Request: https://projects.blender.org/blender/blender/pulls/128170
After 4bf08198a7 it it no longer necessary to flip gizmo bounds if they are not valid.
Note: it is still possible to create an invalid crop and "losing" the gizmo if it is dragged and dropped outside the compositor canvas. This will be addressed in a different patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/127656
While we continue to improve our tooltips, this PR appends a period to
descriptions if it does not already end in punctuation (.!?), or does
not contain a bullet character. This only does so under the same
circumstances as in earlier code, removed in #125460.
Pull Request: https://projects.blender.org/blender/blender/pulls/128097
The material handling on curves was not super strong yet because there was not a
lot of need for it. However, now with Grease Pencil it's much more likely that
material selections are used on curves.
The patch is larger than one might expect at first, because we have to pass more
information into the field context in many places, because the materials are
stored on `Curves` and not `CurvesGeometry`.
Related to #128109.
Pull Request: https://projects.blender.org/blender/blender/pulls/128182
Immediate mode uses the old 'resource tracker' which has been replaced
by swap chain resource pools. This PR optimizes immediate mode buffers
by utilizing resource pools.
Pull Request: https://projects.blender.org/blender/blender/pulls/128188