Commit Graph

113581 Commits

Author SHA1 Message Date
Dalai Felinto
afa8b7632c Geometry Nodes: Warning Node: Show icons on the enum
Adds the icons to the Warning Type enum, so users associate the icons with the type.

Pull Request: https://projects.blender.org/blender/blender/pulls/128442
2024-10-01 18:19:48 +02:00
Julian Eisel
3798852071 Sculpt/Paint: Bring back some brush tools for paint modes
Since brush assets were merged, all sculpt and paint modes have a unified
"Brush" tool that is used for all brushes. Based on feedback, this mixes brush
types a bit too much, so some specific tools that use brushes should be brought
back. These brush types just behave very different from the main brush types,
and users expect them to be easily accessible from the toolbar. This also makes
them more discoverable and having tools that remember their last used brush can
be useful too (e.g. assigning shortcut to eraser tool to switch back to last
used eraser, rather than a specific eraser brush).

Note that further changes are planned, to get a true "best of both worlds"
design, where people can use a global brush library without having to worry
about tools, but brushes can also be accessed via tool categorization.
The new design works well with both mental models without being a compromise
in-between.

a79f9100a6 already brought back some tool for grease pencil draw mode, with this
commit the design is now applied to all sculpt & paint modes.

See PR for a list of tools that were brought back.

Design Task: https://projects.blender.org/blender/blender/issues/128066
Pull Request: https://projects.blender.org/blender/blender/pulls/128038
2024-10-01 18:03:33 +02:00
Sean Kim
eac36baafd Cleanup: Extract multires modifier operators into separate file
Pull Request: https://projects.blender.org/blender/blender/pulls/128397
2024-10-01 17:51:43 +02:00
Lukas Tönne
e07842de41 GPv3: "Join Objects" operator
Supports the `OB_GREASE_PENCIL` type in the "Join Objects" operator.

Each object is merged into the active object one-by-one. This first
combines the layer trees of the source and destination, adds vertex
groups and materials, and appends the drawings to the destination array.
Then internal references are updated: drawing indices in frame data,
mask layer names, layer parents, material and vertex group indices.

The source curves are transformed into the target object space, so their
world position remains the same. Note that animation data is also
transferred to the new object, but __not__ transformed in case of
diverging object- or layer transforms. This is expected and handled the
same way by other object types.

Pull Request: https://projects.blender.org/blender/blender/pulls/128429
2024-10-01 16:39:49 +02:00
Pratik Borhade
965fdf0d54 Fix #128390: GPv3: Select all toggle preference not working
Case for `SEL_TOGGLE` was not handled in GPv3 edit mode selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/128411
2024-10-01 16:09:28 +02:00
dereck
9221c545af Fix: string attributes not shown properly in spreadsheet
Pull Request: https://projects.blender.org/blender/blender/pulls/127892
2024-10-01 15:45:41 +02:00
Sybren A. Stüvel
66cf63d89b Anim: support layered Actions when animating curve points
Update `ED_curve_updateAnimPaths()` to handle F-Curves from both legacy
and layered Actions.

Ref: #123424

Pull Request: https://projects.blender.org/blender/blender/pulls/128428
2024-10-01 15:43:08 +02:00
Sybren A. Stüvel
ec0ecf08da Refactor: Anim, use blender::listbase_to_vector
Add a `const` version of `blender::listbase_to_vector`, and use it in
`animrig::fcurves_for_action_slot()`.

No functional changes.
2024-10-01 15:43:06 +02:00
Sybren A. Stüvel
b56715de03 Anim: Fix bug updating F-Curves for new Curve (object) points
When modifying a Curve object's points, its animation data is updated to
ensure that changes in point index are reflected in the F-Curve data
paths. This already worked fine for pre-existing Curve points, but
didn't happen correctly for points that were newly added since entering
edit mode.
2024-10-01 15:43:06 +02:00
Sybren A. Stüvel
31fd540048 Refactor: Anim, prepare ED_curve_updateAnimPaths() for legacy Actions
Refactor `ED_curve_updateAnimPaths()` and the static functions it calls,
separating out:

- the manipulation of the F-Curves themselves, and
- the manipulation of whatever container holds those F-Curves.

This will make it considerably easier to convert the code to deal with a
`Span<FCurve *>` later instead of `ListBase`, which in turn is necessary
to handle layered Actions.

The old code used to move F-Curves from one `ListBase` to another, to
avoid visiting the same F-Curve twice. This is now done by tracking
those F-Curves in a `Set<FCurve *>`, so that it doesn't require
manipulation of the storage itself.

No functional changes.
2024-10-01 15:43:06 +02:00
Miguel Pozo
ba4c026215 Fix #128164: Race condition in ShaderCreateInfo::finalize()
We can have deferred and non-deferred shaders (so, different threads)
with the same `additonal_info` dependencies trying to finalize the same
`ShaderCreateInfo`.

This ensures `finalize` always runs from the main thread to avoid race
conditions.

Pull Request: https://projects.blender.org/blender/blender/pulls/128281
2024-10-01 15:35:57 +02:00
Julian Eisel
f57b9b12d2 UI: Increase size of active asset highlight in asset shelf
Generally increases padding of preview widgets a bit (while keeping the
preview size the same), and increases the size of the highlight surface
a bit. The default grease pencil brushes from the essentials asset
library use an opaque background, so the highlight was barely visible
before. It was difficult to identify the active brush from that. Now
it's a lot easier to identify visually.

See PR for comparison screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/128432
2024-10-01 15:33:15 +02:00
Jacques Lucke
fd4f864cba Geometry Nodes: improve display of node warnings in modifier
This does the following changes:
* Show info "warnings" in modifier too. Previously those were skipped. The
  different behavior of info/warning/error messages causes confusion.
* Add a new `Warnings` panel that only shows when there are warnings. In its
  title, it shows how many warnings there are.
* In the panel, warnings are sorted by severity and alphabetically.

Pull Request: https://projects.blender.org/blender/blender/pulls/128395
2024-10-01 15:31:50 +02:00
Lukas Tönne
d4cb32caf8 Fix: Add missing Grease Pencil v3 objects in BKE_animdata_main_cb.
This is needed for fcurve callbacks, such as renaming animation data
paths.
2024-10-01 15:29:35 +02:00
Sybren A. Stüvel
38f5b8d7d4 Anim: make layered Action sub-data copy constructors explicit
Mark these copy constructors as 'explicit' in `blender::animrig`:

- `Slot`
- `StripKeyframeData`
- `ChannelBag`

The copy constructors for the other related classes were already
`explicit` or `deleted`.

This prevents bugs by disallowing implicit copies. For example:

```cpp
ChannelBag cbag = agrp->channel_bag->wrap();
```

This should have been a reference (`ChannelBag &cbag`), an easy mistake
which is now caught by the compiler (and fixed in this commit).

No functional changes. The implicit copy that was removed was just
inefficient, but didn't produce the wrong results.

Pull Request: https://projects.blender.org/blender/blender/pulls/128424
2024-10-01 14:54:15 +02:00
Nathan Vegdahl
476fd1641c Refactor: make fcurve_find_in_action_slot_filtered() more general
Previously it only filtered on a specific rna path-based criteria.
This commit changes it to take a predicate function instead, splitting
off its previously fixed criteria into a separate function.

This also renames it to `fcurves_in_action_slot_filtered()` to better
reflect its new generalized functionality.

No functional changes intended.

Pull Request: https://projects.blender.org/blender/blender/pulls/128423
2024-10-01 14:48:52 +02:00
Jeroen Bakker
4d8581c7ee Vulkan: Add node to update buffers
This change adds the option to update a buffer via the render
graph via `vkCmdUpdateBuffer`. This is only enabled for
uniform buffers as they are small and aligned/sized correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/128416
2024-10-01 14:22:56 +02:00
Jeroen Bakker
9dfb49d16b Vulkan: Fix incorrect access flag
Detected by latest vulkan validation layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/128417
2024-10-01 14:06:41 +02:00
Jeroen Bakker
71b7dd8079 Vulkan: Remove core 1.2 extensions
Vulkan backend registered extensions that were already part of Vulkan
1.2 core. These extensions don't need to be registered.

Pull Request: https://projects.blender.org/blender/blender/pulls/128408
2024-10-01 13:40:13 +02:00
Sybren A. Stüvel
5b9de19345 Anim: respect group parameter of rna_struct.keyframe_insert() func
Add support for `rna_struct.keyframe_insert(…, group="name")` parameter,
when inserting keys into a layered Action.

This simply was never implemented, and the default channel group name
was always used.

Pull Request: https://projects.blender.org/blender/blender/pulls/128383
2024-10-01 10:27:36 +02:00
Kevin Chuang
9f4da19800 Vulkan: Add support for VK_KHR_fragment_shader_barycentric
This PR introduces support for the extension `VK_KHR_fragment_shader_barycentric`,
and includes a few miscellaneous improvements related to it.

1. Add support for `VK_KHR_fragment_shader_barycentric`, if the physical device
  supports it. Otherwise, gpu_BaryCoord is generated through an injected geom
  shader, like it was previously.
2. Simplify the logic of checking has_geometry_stage in vert shader.
3. Fix a potential issue of location mismatch in an injected geom shader.

Related to #127687
Resolves #126228

Pull Request: https://projects.blender.org/blender/blender/pulls/127995
2024-10-01 09:32:59 +02:00
Jeroen Bakker
0eff22dd2a Fix #128258: Vulkan: Memory leak preview job rendering
When performing preview job rendering the memory wasn't recycled leading
to a memory leak. For background rendering we already recycled memory in
a correct way. This change enables the same branch during preview
rendering.

Also adds a better `VKDevice::debug_print` to see the resources being
tracked by the different threads and resource pools.

Pull Request: https://projects.blender.org/blender/blender/pulls/128377
2024-10-01 09:09:42 +02:00
Campbell Barton
38c30c5c43 Extensions: resolve test failing
Enable the extensions add-on by default, without this, it's enabled
on startup, causing the preferences to be tagged as modified.
2024-10-01 15:36:54 +10:00
Campbell Barton
08203a6048 Core: don't save an empty recent files (when no file exists)
Avoid creating redundant files when running tests & automated tasks.
2024-10-01 15:36:53 +10:00
Campbell Barton
c6fd26a3f5 Cleanup: spelling in comments 2024-10-01 09:59:33 +10:00
Campbell Barton
b3a9ca2ac2 Cleanup: remove unused variable 2024-10-01 09:54:29 +10:00
notrudyyy
8d11882d07 Fix #128257: Crash when using Set Vertex Colors with no brush
The issue is due to a null pointer dereference in the call to
`IMB_colormanagement_srgb_to_scene_linear_v3` in
`vpaint_get_current_col` in `paint_vertex.cc`.
`BKE_paint_brush_for_read` returns a null pointer and as a result
`brush_color` points to the zero page, thus causing a null pointer
dereference and hence the access violation exception.

Normally, users should not be able to have no brush selected inside
vertex paint mode. Instead of adding null checks everywhere, this
commit protects against this case by switching the poll method to
check for a brush before allowing execution.

Pull Request: https://projects.blender.org/blender/blender/pulls/128260
2024-10-01 00:04:53 +02:00
quackarooni
44fbd69317 Function Node: Value to String Integer subtype
This patch adds an `Integer` type to the Value to String node.
This allows for converting integer inputs into string outputs without
any loss of precision. Something which the original implementation is
not able to do.

This issue becomes evident at values greater than `2 ^ 24` or
`16,777,216`, where the precision loss is high enough that the float
implementation starts skipping certain integers.

Pull Request: https://projects.blender.org/blender/blender/pulls/128362
2024-09-30 23:10:41 +02:00
Harley Acheson
89d7f00ff8 UI: Fix Editor Highlight Top Bar
New editor highlighting (#116684) will sometimes highlight a nearby
area when hovering over the Top Bar. This is caused by the use of the
top-left corner for testing. This just uses the region midpoint
instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/128394
2024-09-30 22:17:56 +02:00
Colin Basnett
22d78c5a8e Geometry Nodes: add Matrix Determinant node
Pull Request: https://projects.blender.org/blender/blender/pulls/128212
2024-09-30 21:30:10 +02:00
Jacques Lucke
8f30c25207 Geometry Nodes: add panel for generated geometry on foreach zone
The panel makes the separation of the main geometry and generated geometry
outputs more obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/128382
2024-09-30 21:28:20 +02:00
Sean Kim
71033685f6 Fix #128272: Plane Trim applies to incorrect vertices
Missed in 68ef1d6f36

Affects all brushes that use the Plane Trim option:
* Clay Strips
* Multiplane Scrape
* Flatten
* Fill
* Scrape

Pull Request: https://projects.blender.org/blender/blender/pulls/128391
2024-09-30 21:20:40 +02:00
Jacques Lucke
f97fb87212 Cleanup: make utilities for node warnings more reusable 2024-09-30 21:18:08 +02:00
Harley Acheson
5bb7f06409 Fix #127825: Do Not Clear Recent Item If File Not Found
When attempting to load a blend file that is not found or otherwise
invalid we are currently showing an (ugly) popup menu report and then
clearing the item from the Recent Files list. Clearing the list could
be unwanted in the case of files that are temporarily offline. And we
now have the ability to only clear "Items not found" using the "Clear
Recent Files List" operator. This PR removes that clearing.

Pull Request: https://projects.blender.org/blender/blender/pulls/127882
2024-09-30 21:03:09 +02:00
Jacques Lucke
ee348d2bff Fix: missing grease pencil data after duplicate elements or realizing instancecs 2024-09-30 18:31:36 +02:00
Omar Emara
60bb3b6677 Fix #124737: Scale To Render size is not precise
The Scale node in the Scale To Render size mode is not precise in case
of the use of render size percentage. This is due to floating point
imprecisions and we mitigate it by rounding instead of flooring after
multiplying by the percentage.
2024-09-30 18:58:13 +03:00
Pablo Vazquez
d601c21f2f UI: Use Grease Pencil object icon for Dope Sheet
Use the Grease Pencil object icon for the mode selector in Dope Sheet.

Pull Request: https://projects.blender.org/blender/blender/pulls/128385
2024-09-30 17:57:20 +02:00
Omar Emara
1b392ef016 Fix #127093: Kuwahara node produces NaNs
The Kuwahara node produces NaNs if the pixels have a very high local
standard deviation and sharpness is also high. This is because the
weighted sum of the Kuwahara sectors can have a zero total weight, which
causes zero division. To fix this, we return the original color if the
total weight is zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/128378
2024-09-30 17:29:44 +02:00
Bastien Montagne
60908e8819 Refactor: Move bone eyedropper to C++ allocation.
Similar to what was already done for all other eyedroppers a few weeks
ago, part of pre-steps to make PointerRNA non-trivial.
2024-09-30 16:37:11 +02:00
Julian Eisel
88085accf7 Fix: Missing fill tool default brush in grease pencil draw mode
Apparently the name of the default fill brush in the essentials asset
library was changed in 9dfd0a171f.
2024-09-30 16:23:32 +02:00
Falk David
4c17ccbf56 GPv3: Add functions to copy parameters of layers and groups
Adds `BKE_grease_pencil_copy_layer_parameters` and
`BKE_grease_pencil_copy_layer_group_parameters` to copy
the parameters of layers and layer groups without copying
the data.
2024-09-30 16:20:43 +02:00
Falk David
be3e5e979f GPv3: Add function to copy GreasePencil parameters
Adds a kernel function to copy only the `GreasePencil` parameters
and not the layer tree or drawings.
2024-09-30 16:20:43 +02:00
notrudyyy
fcc263162d Fix #128087: EEVEE: Position render pass not in viewport shading panel
Adds Position Render pass to Render Pass enum in Viewport Shading popup for EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/128136
2024-09-30 16:20:14 +02:00
Julian Eisel
2a1004f7af Fix #128335: Activating brush from asset shelf sets tool, but not brush
We'd first set the brush, then change tools, which would again set the
brush to what it was before (switching tools tries to remember its last
used brush). Instead, switch the brush after switching the tool.

Also added a brush API check to test if the brush is valid for the
current mode, so that we don't end up switching tools in that case. This
matches previous behavior where this would be checked as part of setting
the brush already, causing the function to early exit before the tool is
changed.
2024-09-30 16:19:06 +02:00
Jacques Lucke
f839266b78 Geometry Nodes: support dynamic sockets and separators in panels 2024-09-30 16:07:36 +02:00
Omar Emara
161b110746 Fix #127372: Alpha Over has unexpected output size
The Alpha Over node has an unexpected output size in GPU mode. If the
Factor and first Image inputs were connected to the same output, the
size of the output will assume the size of the second Image input, even
though the first Image input has a higher domain priority.

That's because the Alpha Over node is compiled into a Shader Operation
which has a single operation input for all inputs connected to the same
output, but only the domain priority of the first input was considered,
so in the case of the Alpha Over node, the domain priority of the Factor
input was assumed, ignoring the priority of the first Image output.

To fix this, we consider the priority of all inputs connected to the
same output, and assume the highest priority of all.

Pull Request: https://projects.blender.org/blender/blender/pulls/128366
2024-09-30 15:46:09 +02:00
Jacques Lucke
7b79191594 Geometry Nodes: prefer float math node even for integer sockets in link-drag-search
The problem with the Integer Math node is that it is less flexible in common
cases because the other input has to be an integer too. There is no simple way
to switch the node to be a Float Math node (yet), so better insert that
directly. Using the Integer Math node is a more explicit choice now.

Searching for e.g. `iadd` prioritizes the Integer Math node thanks to prefix
search.

Pull Request: https://projects.blender.org/blender/blender/pulls/128370
2024-09-30 15:44:26 +02:00
Jacques Lucke
02ada0d064 Geometry Nodes: use shorter linear gizmo when using box shape
This solves an issue when both linear gizmos happen to be at the same position.
In this case the gizmos became fairly unusable because they overlapped a lot.
They can still overlap of course, but it's more likely that they start at the
same position than that they end at the same position.

Note, when using a transform gizmo, the collision between the scale and
translate gizmo is resolved already. The issue only happens when two independent
Linear Gizmo nodes are used.

Pull Request: https://projects.blender.org/blender/blender/pulls/128371
2024-09-30 15:43:20 +02:00
Sybren A. Stüvel
d58176e1e0 Anim: fix bug in action.fcurves.clear() corrupting F-Curve groups
Calling `action.fcurves.clear()` would clear the F-Curves, but didn't
update the F-Curve groups. This meant that the groups data still had their
original length & offsets into the F-Curves array, causing subsequent
F-Curve creation to crash Blender.

The unit test for this also covers the previous commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/128375
2024-09-30 15:42:58 +02:00
Sybren A. Stüvel
420082d4fe Anim: Fix issue with key insertion for array_index=-1
Fix an issue where Python's `rna_struct.keyframe_insert(path, index=-1)`
would not create any keys. This was caused by the new layered animation
code not taking -1 as an 'all array elements' wild-card.

The accompanying unit test will follow in another commit, as its success
depends on another bugfix as well.
2024-09-30 15:42:57 +02:00