Commit Graph

117289 Commits

Author SHA1 Message Date
Harley Acheson
44168c32ff Fix #128406: Editor Highlight Edge Roundness
This separates out the edge drawing from the edge highlighting, needed
for the edge drawing shader. Also slightly improves the alignment of
the two.

Pull Request: https://projects.blender.org/blender/blender/pulls/128453
2024-10-01 21:58:02 +02:00
Harley Acheson
bfe693c8c2 UI: Changes to Docking Mouse Cursors
This makes one change and another correction to the mouse cursors used
during Docking. The change is to use WM_CURSOR_EDIT for Mac while just
hovering over the corner action zones. This means that Mac users will
transition from this to WM_CURSOR_HAND_CLOSED, instead using two hand
cursors.  The correction is to use the "split" cursors while splitting
areas. That it doesn't do that now is a mistake made during #127810.

Pull Request: https://projects.blender.org/blender/blender/pulls/128396
2024-10-01 21:04:20 +02:00
Germano Cavalcante
ab3e470b35 Fix: Occlusion of Curves failing during snapping
The geometry of objects behind Curves was being considered for snapping
even when occluded.

The occlusion test logic has been reworked and simplified when the snap
target is a Curve.

As a result, Snap to Face now works correctly for the active Curve.
2024-10-01 15:17:02 -03:00
Germano Cavalcante
304b3e026a Fix: Snap grid point of Rotate operator is closest to the constraint axis
The snap-to-grid constraint in the rotation operation should not be
limited to the grid closest to the constraint axis, as this restricts
rotational freedom.
2024-10-01 15:17:01 -03:00
Miguel Pozo
54ad693486 Fix: Partially revert #128281
Avoid the asserts until we figure out a better design.
2024-10-01 19:55:36 +02:00
Casey Bianco-Davis
b4881f6b0a GPv3: Layer Tint Color, Radius Offset and Adjustments panel.
This adds the layer adjustments back.
There is a the `Adjustment` panel under the layer properties with
the tint color, the tint factor, and the radius offset (now in meters).

The tint and radius offsets are stored as layer attributes.

For compatibility and the sake of not making the conversion code more complicated,
legacy layer adjustments are always converted to modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/126777
2024-10-01 19:04:32 +02:00
Sybren A. Stüvel
7ebe7a3b3b Fix #128200: Crash when duplicating essential brush asset
The check for the RNA property type was missing a nullptr check.

Pull Request: https://projects.blender.org/blender/blender/pulls/128441
2024-10-01 18:25:52 +02:00
Julian Eisel
33b670a65d Sculpt/Paint: Automatically switch tools when activating brushes
As discussed in #128066, we want that activating a brush makes sure the
most appropriate tool is activated. For example activating an eraser
brush should activate an eraser tool, if available. This makes the
tool and brush binding two ways, which is more clear. Plus it means that
users don't have to care about tools at all if they don't want to, they
can just keep switching brushes and Blender takes care of the tool.

Implementation wise, this works by letting a Python operator lookup a
tool for a given brush type name, when activating a brush.

Design Task: https://projects.blender.org/blender/blender/issues/128066
2024-10-01 18:21:15 +02:00
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