Commit Graph

113461 Commits

Author SHA1 Message Date
Sybren A. Stüvel
f7effe8597 Anim: fix null pointer dereference when pushing down an Action
Pull Request: https://projects.blender.org/blender/blender/pulls/128199
2024-09-27 15:43:02 +02:00
Pablo Vazquez
fd59591fdc UI: Use proper icon for Grease Pencil selectors
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.
2024-09-27 15:05:05 +02:00
Jeroen Bakker
481c8fd5a7 Vulkan: Memory leak in immediate mode during exit
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
2024-09-27 15:01:10 +02:00
Hans Goudey
98f0926825 Geometry Nodes: Node tools soft selection and sculpt mask support
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
2024-09-27 14:39:01 +02:00
Christoph Lendenfeld
95b6cf0099 Anim: operator to move Slots to new action
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
2024-09-27 14:34:24 +02:00
Pratik Borhade
59aaf322ba GPv3: Select operations in sculpt mode
Select panel is missing when any selection mask is selected.
Also fix the poll function so operators can be accessed.

Pull Request: https://projects.blender.org/blender/blender/pulls/128177
2024-09-27 13:23:02 +02:00
Falk David
53b9594ee2 Geometry Nodes: Add "Merge Layers" node
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
2024-09-27 13:17:18 +02:00
Brady Johnston
e25405aeb7 Geometry Nodes: improve input labels on Integer Math node
This brings the labels for the Power operation on the integer math node
to align with the regular math node.

Pull Request: https://projects.blender.org/blender/blender/pulls/128222
2024-09-27 11:56:05 +02:00
casey bianco-davis
87bef46096 Fix: Crash when there is no active layer/group.
This fixes a crash in the move operator that would occur when
no layer or group was active.

Pull Request: https://projects.blender.org/blender/blender/pulls/128219
2024-09-27 10:21:23 +02:00
Jeroen Bakker
5250e57294 Fix #127288: Vulkan: Report Marketed Driver Version
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
2024-09-27 09:24:15 +02:00
Campbell Barton
38a888c794 Cleanup: correct FOREACH_OBJECT_FLAG_BEGIN flag argument
The macro couldn't take a flag argument unless it was called "flag".
2024-09-27 12:41:07 +10:00
Sean Kim
0f1bdd551c Fix: Sculpt: Debug assert when undoing deformation
This commit ensures that we pass in correctly-sized spans when restoring
position data.

Pull Request: https://projects.blender.org/blender/blender/pulls/128217
2024-09-27 04:35:15 +02:00
Hans Goudey
f241c15042 Cleanup: Sculpt: Simplify threaded node iteration
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
2024-09-27 04:31:39 +02:00
Hans Goudey
d832bf3ae4 Fix #122096: Crash after editing multi-user mesh with two scenes
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
2024-09-27 04:29:53 +02:00
Campbell Barton
7409db3e89 Fix crash applying object transform for multi-user objects
Regression in [0], note that these struct members may be null.

Also correct macro to support scene argument not called "scene".

[0]: 3a555b60f7
2024-09-27 12:28:29 +10:00
Campbell Barton
33b80415aa Cleanup: use const, correct arg names, spelling, use ELEMN(..) 2024-09-27 11:01:37 +10:00
Campbell Barton
634e44de9f Cleanup: remove redundant null check 2024-09-27 10:51:28 +10:00
Harley Acheson
b2eb8cc0df UI: Edge Highlighting While Resizing Editors
Highlighting of the active edges of editors while resizing.

Pull Request: https://projects.blender.org/blender/blender/pulls/120998
2024-09-27 00:56:52 +02:00
Sean Kim
726fd7365d Fix #126808: Crash when remeshing an object with a mirror modifier
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
2024-09-26 23:29:39 +02:00
Harley Acheson
28e5c1412e UI: Editor Edge Highlighting
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
2024-09-26 21:55:26 +02:00
Hans Goudey
6d9641daee Sculpt: Followup change/fix to clay strips brush
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.
2024-09-26 15:04:05 -04:00
Jacques Lucke
74f266c119 Fix #127855: crash when changing interface socket type with custom sockets
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
2024-09-26 20:41:06 +02:00
Aras Pranckevicius
f095f41c4a VSE: Faster timeline retiming keys drawing
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
2024-09-26 20:32:55 +02:00
Julian Eisel
590123d2e5 Sculpt/Paint: Update essential library paths for brush assets
Updates paths constants for the essentials asset library after 9dfd0a171f, which
splits the single essentials file into multiple.

Pull Request: https://projects.blender.org/blender/blender/pulls/128204
2024-09-26 19:26:52 +02:00
Habib Gahbiche
a537659341 Fix #127253: Compositor crop gizmo can produce invalid crop configurations
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
2024-09-26 19:24:14 +02:00
Jacques Lucke
fa33eb65bf Fix: missing translation in spreadsheet 2024-09-26 19:03:11 +02:00
Hans Goudey
6eea579f11 Fix #128004: Clay strips tip roundness ignored with 1.0 hardness
Caused by a subtle mistake in the translation of `sculpt_apply_hardness`
in 1d7dc7190f.
2024-09-26 13:01:18 -04:00
Hans Goudey
c1ab271480 Cleanup: Sculpt: Use C++ math types for brush cube distances 2024-09-26 13:01:18 -04:00
Harley Acheson
7b0c18afb4 UI: Automatically Add Some Tooltip Description Periods
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
2024-09-26 17:53:28 +02:00
Sean Kim
6eac125f24 Fix: Draw face set does not work for multires / dyntopo
Missed in 60ab232afb

Pull Request: https://projects.blender.org/blender/blender/pulls/128150
2024-09-26 17:37:50 +02:00
Sean Kim
f3121a3b96 Fix #128143: Relax face sets doesn't modify mesh
Missed in d64f62e4fa

Pull Request: https://projects.blender.org/blender/blender/pulls/128149
2024-09-26 17:36:54 +02:00
Jacques Lucke
5c3d215bfc Fix: Geometry Nodes: support Material Selection node for curves
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
2024-09-26 16:22:06 +02:00
Jeroen Bakker
725b5027fb Vulkan: Refactor immediate mode
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
2024-09-26 16:01:30 +02:00
Christoph Lendenfeld
bcd0d14943 Versioning for layered actions
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
2024-09-26 15:45:53 +02:00
Sergey Sharybin
5f8721d92a Fix #127964: Crash when baking from mesh with no faces
The issue has been introduced in aca27e5462.

Before that change the memory used for baking was cleared-alloced,
but now it relies on the default object initialization. This could
leave fields uninitialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/128181
2024-09-26 15:45:02 +02:00
Sergey Sharybin
a1a00ec49c Fix: Uninitialized variable in versioning code
The issue is originally caused by #120797.

Pull Request: https://projects.blender.org/blender/blender/pulls/128189
2024-09-26 15:42:30 +02:00
Sybren A. Stüvel
147d8aad54 Anim: Show Action Slot type in panel + change type icon RNA prop
Anim: Show Action Slot type in panel + change type icon RNA wrapper name

This PR combines two changes, both necessary to properly show the
Action Slot ID type in the GUI:

1. Expose the slot's ID type as an RNA enum property `id_root`, in the
   same way that the DNA `Action::idtype` is exposed as
   `Action.id_root` in RNA. The only differences are that this
   property is read-only on slots (it is supposed to be correct, and
   if it's not, I'd prefer a bug report over people working around
   this), and that the default value is named differently (`ANY` on
   Actions, `UNSPECIFIED` on Slots). The latter is done to clarify
   that this is not a situation that will last for long; as soon as
   the slot is assigned to any ID, it will be locked to that ID type.

2. Rename the RNA property `ActionSlot.idtype_icon` to
   `ActionSlot.id_root_icon` to be consistent with the above.

And of course the type is drawn in the Slot properties panel in the
Action editor. This now replaces the icon in the slot name (in the
same panel), so that it's clearer that that is the slot name, and not
an object/material/whatevertype name.
2024-09-26 15:33:44 +02:00
Nathan Vegdahl
124bae5a4d Fix: use action_treat_as_legacy() where appropriate
Previously we were using a bespoke hodgepodge of
`Action::is_action_legacy()` and `Action::is_action_layered()`,
sometimes in combination with checking for the Baklava feature flag,
when what we really meant is "Should this action be treated as legacy
or not?"

This commit changes the places where that's semantically what we meant
to use `action_treat_as_legacy()`. Some of those places were already
correct, using a compound conditional, but some of them weren't, and
thus were not always branching correctly. For those latter cases,
this commit is a bug fix.

Importantly, not all uses of bare `Action::is_action_legacy()` or
`Action::is_action_layered()` are semantically incorrect: there are many
places where that is the right thing to do. This commit takes care not
to touch those places.

Pull Request: https://projects.blender.org/blender/blender/pulls/128174
2024-09-26 15:16:56 +02:00
Charlie Jolly
c0a864aaa3 Fix #128102: Integer Math division has only float precision
The additional division modes were implemented with float
division then rounding to match float > int conversion in
existing float to int node.

As pointed out in the bug report the precision here is limited.

This patch replaces the float division with integer math which
increases the precision to much higher numbers.
Divide Round by due to the way it is calculated has less precision
than Divide Floor and Divide Ceil.

Pull Request: https://projects.blender.org/blender/blender/pulls/128123
2024-09-26 14:44:09 +02:00
Campbell Barton
381898b6dc Refactor: move BLI_path_util header to C++, rename to BLI_path_utils
Move to a C++ header to allow C++ features to be used there,
use the "utils" suffix as it's preferred for new files.

Ref !128147
2024-09-26 21:13:39 +10:00
Jacques Lucke
6810084a47 Attributes: improve API to iterate over attributes
This improve the API in multiple aspects:
* No need for an additional `lookup` call to get the current attribute. This
  would internally iterate over all attributes again. This leads to O(n^2)
  behavior. Note that there are still other reasons for O(n^2) behavior when
  processing attributes (where n is the number of attributes).
* Remove the need to return a value from the iteration code to indicate that the
  iteration should continue. This is now the default behavior. The iteration can
  still be stopped by calling `iter.stop()`.
* Easier access to `is_builtin` property.
* Iterator callback only has a single parameter instead of two (of which one is
  sometimes unused).

Pull Request: https://projects.blender.org/blender/blender/pulls/128128
2024-09-26 12:59:00 +02:00
Nathan Vegdahl
45085b2b0e Fix: cannot assign actions to IDs without animdata
This bug was introduced in #126561. The issue was that the UI action
selectors no longer ensured that animdata existed before attempting
to assign an action, which would then cause the assignment to fail.
However, this was only the case in Blender builds without experimental
features, since the new Baklava code paths would otherwise be taken,
which *do* handle this correctly.

This fixes the issue by ensuring animdata in the non-experimental code
paths again.

Pull Request: https://projects.blender.org/blender/blender/pulls/128083
2024-09-26 12:34:41 +02:00
Pratik Borhade
d10db547a7 Fix: Assert drawing GPv3 outline stroke
This is due to incorrect domain type.

Pull Request: https://projects.blender.org/blender/blender/pulls/128162
2024-09-26 12:07:41 +02:00
Jeroen Bakker
70313f68ce Vulkan: Log selected device
Currently the log only contained the first compatible device. It is
more important to the user to know which device is used.

This PR increases the level of the first compatible device so it is only
visible when increasing the log level. It reports the device, driver and
vendor when starting blender with `--debug-gpu`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128168
2024-09-26 12:05:09 +02:00
Jeroen Bakker
88b5467e0e Vulkan: Batch Upload Descriptor Sets
Descriptor sets will be uploaded in batch. This allows drivers to
do additional optimizations or at least push some looping to the
driver side.

Pull Request: https://projects.blender.org/blender/blender/pulls/128167
2024-09-26 12:04:09 +02:00
Jeroen Bakker
d75cf2efd4 Vulkan: Refactor resource binding
Resource binding was over-complicated as I didn't understood the state
manager and vulkan to make the correct decisions at that time. This
refactor will remove a lot of the complexity and improves the performance.

**Performance**

The performance improvement is noticeable in complex grease pencil
scenes.

Grease pencil benchmark file picknick:
- `NVIDIA Quadro RTX 6000` 17 fps -> 24 fps
- `Intel(R) Arc(tm) A750 Graphics (DG2)` 6 -> 21 fps

**Bottle-neck**

The performance improvements originates from moving the update entry
point from state manager to shader interface. The previous implementation
(state manager) had to loop over all the bound resources and find in the
shader interface where it was located in the descriptor set. Ignoring
resources that were not used by the shader. But also making it hard
to determine if descriptor sets actually changed. Previous implementation
assumed descriptor sets always changed.

When descriptor set changed a new descriptor set needed to be allocated.
Most drivers this is a fast operation, but on Intel/Mesa this was measurable
slow. Using an allocation pool doesn't fit the Vulkan API as you are only
able to reuse when the layout matches exactly. Of course doable, but requires
another structure to keep track of the actual layouts.

**Solution**

By using the shader interface as entry point we can:
1. Keep track if there are any changes in the state manager. If not and the
   layout is the same, the previous shader can be reused.
2. In stead of looping over each bound resource, we loop over bind points.

**Future extensions**

Bundle all descriptor set uploads just before use. This would be more
in line with how 'modern' Vulkan should be implemented. This PR already
separates the uploading from the updating and technically allows to upload
more than one descriptor set.

Instead of looking 1 set back we should measure if we can handle multiple
or keep track of the different layouts resources to improve the performance
even further.

Optional use `VK_KHR_descriptor_buffer` when available.

Pull Request: https://projects.blender.org/blender/blender/pulls/128068
2024-09-26 10:59:45 +02:00
Sybren A. Stüvel
9eae533e89 Fix #127908: Layered Action - slot users doesn't include action constraint
Use the `foreach_action_slot_use(id, callback)` iterator function to find
all action/slot uses of an ID. That already handles the action constraint,
and thus solves the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/128090
2024-09-26 10:54:16 +02:00
George Mavroeidis
ceaa064b97 Cleanup: Grease Pencil: Correct stroke outline tooltip description
Replaced "Convert stroke to **perimeter**" with "Convert stroke to **outline**"
in the outline tooltip description.

It was suggested that the description is not accurate and could be misleading
between the two terms. Thus, I simply just replaced the word across all tooltip
descriptions to keep it consistent and easily understood.

Resolves #126814.

Pull Request: https://projects.blender.org/blender/blender/pulls/127990
2024-09-26 10:39:33 +02:00
Christoph Lendenfeld
fae19d7c92 Anim: Eyedropper for bone properties
This adds an eyedropper button to properties where you can choose a bone.

Clicking it activates the modal operation and you can pick:
* Bones from the Outliner
* Bones from the 3D Viewport if the Armature is in Pose Mode or Edit Mode

## Limitation

Picking from the 3D viewport while in Object Mode doesn't work due to technical reasons.
The selection buffer is only filled with pose bones if the armature is in pose mode.
Using the picker while in object mode gives you the Armature object, not its bones.

So you cannot use the bone picker to constrain an object to a bone.
UNLESS you pin the panel with the object, go to pose mode and then pick.

There is a warning printed for those cases to tell the user why this hasn't worked.

Pull Request: https://projects.blender.org/blender/blender/pulls/121523
2024-09-26 10:05:09 +02:00
Aras Pranckevicius
70247df9b9 Fix: VSE tonemap effect is_point_inside_quad check was wrong
+0.5 should be added to integer pixel coordinate (sampling at pixel
center). This is only really visible in very specific scenarios, but
is more correct.
2024-09-26 10:17:31 +03:00